Sun Mar 5 08:05:23 2017 UTC ()
merge xf86-input-keyboard 1.9.0 and xf86-input-mouse 1.9.2


(mrg)
diff -r1.11 -r1.12 xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_KbdMap.c
diff -r1.6 -r1.7 xsrc/external/mit/xf86-input-keyboard/dist/src/kbd.c
diff -r1.2 -r1.3 xsrc/external/mit/xf86-input-mouse/dist/xorg-mouse.pc.in
diff -r1.17 -r1.18 xsrc/external/mit/xf86-input-mouse/dist/src/mouse.c

cvs diff -r1.11 -r1.12 xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_KbdMap.c (expand / switch to unified diff)

--- xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_KbdMap.c 2015/11/12 12:03:58 1.11
+++ xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_KbdMap.c 2017/03/05 08:05:23 1.12
@@ -336,47 +336,47 @@ static CARD8 wsUsbMap[] = { @@ -336,47 +336,47 @@ static CARD8 wsUsbMap[] = {
336 /* 123 */ KEY_L10, 336 /* 123 */ KEY_L10,
337 /* 124 */ KEY_L6, 337 /* 124 */ KEY_L6,
338 /* 125 */ KEY_L8, 338 /* 125 */ KEY_L8,
339 /* 126 */ KEY_L9, 339 /* 126 */ KEY_L9,
340 /* 127 */ KEY_Mute, 340 /* 127 */ KEY_Mute,
341 /* 128 */ KEY_AudioRaise, 341 /* 128 */ KEY_AudioRaise,
342 /* 129 */ KEY_AudioLower, 342 /* 129 */ KEY_AudioLower,
343 /* 130 */ KEY_NOTUSED, 343 /* 130 */ KEY_NOTUSED,
344 /* 131 */ KEY_NOTUSED, 344 /* 131 */ KEY_NOTUSED,
345 /* 132 */ KEY_NOTUSED, 345 /* 132 */ KEY_NOTUSED,
346 /* 133 */ KEY_NOTUSED, 346 /* 133 */ KEY_NOTUSED,
347 /* 134 */ KEY_NOTUSED, 347 /* 134 */ KEY_NOTUSED,
348/* 348/*
349 * Special keycode for For Japanese keyboard 349 * Special keycodes for Japanese keyboards
350 * Override atKeyname HKTG and BSlash2 code to unique for JP106 keybaord 350 * Override atKeyname HKTG and BSlash2 code to unique values for JP106 keyboards
351 */ 351 */
352#undef KEY_HKTG 352#undef KEY_HKTG
353#define KEY_HKTG 200 /* Japanee Hiragana Katakana Toggle */ 353#define KEY_HKTG 200 /* Japanese Hiragana Katakana Toggle */
354#undef KEY_BSlash2 354#undef KEY_BSlash2
355#define KEY_BSlash2 203 /* Japanese '\_' key */ 355#define KEY_BSlash2 203 /* Japanese '\_' key */
356 356
357 /* 135 */ KEY_BSlash2, /* Japanese 106 kbd: '\_' */ 357 /* 135 */ KEY_BSlash2, /* Japanese 106 kbd: '\_' */
358 /* 136 */ KEY_HKTG, /* Japanese 106 kbd: Hiragana Katakana toggle */ 358 /* 136 */ KEY_HKTG, /* Japanese 106 kbd: Hiragana Katakana toggle */
359 /* 137 */ KEY_Yen, /* Japanese 106 kbd: '\|' */ 359 /* 137 */ KEY_Yen, /* Japanese 106 kbd: '\|' */
360 /* 138 */ KEY_XFER, /* Japanese 106 kbd: Henkan */ 360 /* 138 */ KEY_XFER, /* Japanese 106 kbd: Henkan */
361 /* 139 */ KEY_NFER, /* Japanese 106 kbd: Muhenkan */ 361 /* 139 */ KEY_NFER, /* Japanese 106 kbd: Muhenkan */
362 /* 140 */ KEY_NOTUSED, 362 /* 140 */ KEY_NOTUSED,
363 /* 141 */ KEY_NOTUSED, 363 /* 141 */ KEY_NOTUSED,
364 /* 142 */ KEY_NOTUSED, 364 /* 142 */ KEY_NOTUSED,
365 /* 143 */ KEY_NOTUSED, 365 /* 143 */ KEY_NOTUSED,
366/* 366/*
367 * Special keycode for For Korean keyboard 367 * Special keycodes for Korean keyboards
368 * Define Hangul and Hangul_Hanja unique key code 368 * Define Hangul and Hangul_Hanja unique key codes
369 * These keys also use KANA and EISU on some Macintosh Japanese USB Keyboards 369 * These keys also use KANA and EISU on some Macintosh Japanese USB keyboards
370 */ 370 */
371#define KEY_Hangul 201 /* Also KANA Key on Mac JP USB kbd */ 371#define KEY_Hangul 201 /* Also KANA Key on Mac JP USB kbd */
372#define KEY_Hangul_Hanja 202 /* Also EISU Key on Mac JP USB kbd */ 372#define KEY_Hangul_Hanja 202 /* Also EISU Key on Mac JP USB kbd */
373 /* 144 */ KEY_Hangul, /* Korean 106 kbd: Hangul */ 373 /* 144 */ KEY_Hangul, /* Korean 106 kbd: Hangul */
374 /* 145 */ KEY_Hangul_Hanja, /* Korean 106 kbd: Hangul Hanja */ 374 /* 145 */ KEY_Hangul_Hanja, /* Korean 106 kbd: Hangul Hanja */
375 /* 146 */ KEY_NOTUSED, 375 /* 146 */ KEY_NOTUSED,
376 /* 147 */ KEY_NOTUSED, 376 /* 147 */ KEY_NOTUSED,
377 /* 148 */ KEY_NOTUSED, 377 /* 148 */ KEY_NOTUSED,
378 /* 149 */ KEY_NOTUSED, 378 /* 149 */ KEY_NOTUSED,
379 /* 150 */ KEY_NOTUSED, 379 /* 150 */ KEY_NOTUSED,
380 /* 151 */ KEY_NOTUSED, 380 /* 151 */ KEY_NOTUSED,
381 /* 152 */ KEY_NOTUSED, 381 /* 152 */ KEY_NOTUSED,
382 /* 153 */ KEY_NOTUSED, 382 /* 153 */ KEY_NOTUSED,

cvs diff -r1.6 -r1.7 xsrc/external/mit/xf86-input-keyboard/dist/src/kbd.c (expand / switch to unified diff)

--- xsrc/external/mit/xf86-input-keyboard/dist/src/kbd.c 2013/06/05 07:11:16 1.6
+++ xsrc/external/mit/xf86-input-keyboard/dist/src/kbd.c 2017/03/05 08:05:23 1.7
@@ -35,149 +35,136 @@ @@ -35,149 +35,136 @@
35 35
36#include "xf86Xinput.h" 36#include "xf86Xinput.h"
37#include "xf86_OSproc.h" 37#include "xf86_OSproc.h"
38#include "xf86OSKbd.h" 38#include "xf86OSKbd.h"
39#include "compiler.h" 39#include "compiler.h"
40 40
41#include "exevents.h" 41#include "exevents.h"
42#include <X11/Xatom.h> 42#include <X11/Xatom.h>
43#include "xserver-properties.h" 43#include "xserver-properties.h"
44 44
45#include "xkbstr.h" 45#include "xkbstr.h"
46#include "xkbsrv.h" 46#include "xkbsrv.h"
47 47
 48#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 23
 49#define HAVE_THREADED_INPUT 1
 50#endif
 51
48#define CAPSFLAG 1 52#define CAPSFLAG 1
49#define NUMFLAG 2 53#define NUMFLAG 2
50#define SCROLLFLAG 4 54#define SCROLLFLAG 4
51#define MODEFLAG 8 55#define MODEFLAG 8
52#define COMPOSEFLAG 16 56#define COMPOSEFLAG 16
53/* Used to know when the first DEVICE_ON after a DEVICE_INIT is called */ 57/* Used to know when the first DEVICE_ON after a DEVICE_INIT is called */
54#define INITFLAG (1U << 31) 58#define INITFLAG (1U << 31)
55 59
56#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12 
57static InputInfoPtr KbdPreInit(InputDriverPtr drv, IDevPtr dev, int flags); 
58#else 
59static int KbdPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags); 60static int KbdPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags);
60#endif 
61static int KbdProc(DeviceIntPtr device, int what); 61static int KbdProc(DeviceIntPtr device, int what);
62static void KbdCtrl(DeviceIntPtr device, KeybdCtrl *ctrl); 62static void KbdCtrl(DeviceIntPtr device, KeybdCtrl *ctrl);
63static void KbdBell(int percent, DeviceIntPtr dev, pointer ctrl, int unused); 63static void KbdBell(int percent, DeviceIntPtr dev, pointer ctrl, int unused);
64static void PostKbdEvent(InputInfoPtr pInfo, unsigned int key, Bool down); 64static void PostKbdEvent(InputInfoPtr pInfo, unsigned int key, Bool down);
65 65
66static void InitKBD(InputInfoPtr pInfo, Bool init); 66static void InitKBD(InputInfoPtr pInfo, Bool init);
67static void UpdateLeds(InputInfoPtr pInfo); 67static void UpdateLeds(InputInfoPtr pInfo);
68 68
69_X_EXPORT InputDriverRec KBD = { 
70 1, 
71 "kbd", 
72 NULL, 
73 KbdPreInit, 
74 NULL, 
75 NULL 
76}; 
77 
78_X_EXPORT InputDriverRec KEYBOARD = { 
79 1, 
80 "keyboard", 
81 NULL, 
82 KbdPreInit, 
83 NULL, 
84 NULL 
85}; 
86 
87static const char *kbdDefaults[] = { 69static const char *kbdDefaults[] = {
88#ifdef __NetBSD__ 70#ifdef __NetBSD__
89#ifdef DEFAULT_TO_WSKBD 71#ifdef DEFAULT_TO_WSKBD
90 "Protocol", "wskbd", 72 "Protocol", "wskbd",
91#else 73#else
92 "Protocol", "standard", 74 "Protocol", "standard",
93#endif 75#endif
94#else /* NetBSD */ 76#else /* NetBSD */
95 "Protocol", "standard", 77 "Protocol", "standard",
96#endif /* NetBSD */ 78#endif /* NetBSD */
97 "XkbRules", "base", 79 "XkbRules", "base",
98 "XkbModel", "pc105", 80 "XkbModel", "pc105",
99 "XkbLayout", "us", 81 "XkbLayout", "us",
100 NULL 82 NULL
101}; 83};
102 84
103static char *xkb_rules; 85static char *xkb_rules;
104static char *xkb_model; 86static char *xkb_model;
105static char *xkb_layout; 87static char *xkb_layout;
106static char *xkb_variant; 88static char *xkb_variant;
107static char *xkb_options; 89static char *xkb_options;
108 90
109#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12 91_X_EXPORT InputDriverRec KBD = {
110static int 92 1,
111NewKbdPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags); 93 "kbd",
112 94 NULL,
113static InputInfoPtr 95 KbdPreInit,
114KbdPreInit(InputDriverPtr drv, IDevPtr dev, int flags) 96 NULL,
115{ 97 NULL
116 InputInfoPtr pInfo; 98};
117 99
118 if (!(pInfo = xf86AllocateInput(drv, 0))) 100_X_EXPORT InputDriverRec KEYBOARD = {
119 return NULL; 101 1,
 102 "keyboard",
 103 NULL,
 104 KbdPreInit,
 105 NULL,
 106 NULL
 107};
120 108
121 pInfo->name = dev->identifier; 109static XF86ModuleVersionInfo xf86KbdVersionRec = {
122 pInfo->flags = XI86_KEYBOARD_CAPABLE; 110 "kbd",
123 pInfo->conversion_proc = NULL; 111 MODULEVENDORSTRING,
124 pInfo->reverse_conversion_proc = NULL; 112 MODINFOSTRING1,
125 pInfo->private_flags = 0; 113 MODINFOSTRING2,
126 pInfo->always_core_feedback = NULL; 114 XORG_VERSION_CURRENT,
127 pInfo->conf_idev = dev; 115 PACKAGE_VERSION_MAJOR, PACKAGE_VERSION_MINOR, PACKAGE_VERSION_PATCHLEVEL,
128 pInfo->close_proc = NULL; 116 ABI_CLASS_XINPUT,
129 117 ABI_XINPUT_VERSION,
130 if (NewKbdPreInit(drv, pInfo, flags) == Success) 118 MOD_CLASS_XINPUT,
131 { 119 {0, 0, 0, 0}
132 pInfo->flags |= XI86_CONFIGURED; 120};
133 return pInfo; 
134 } 
135 121
136 xf86DeleteInput(pInfo, 0); 122static pointer
137 return NULL; 123xf86KbdPlug(pointer module, pointer options, int *errmaj, int *errmin)
 124{
 125 xf86AddInputDriver(&KBD, module, 0);
 126 return module;
138} 127}
139 128
140static int 129_X_EXPORT XF86ModuleData kbdModuleData = {
141NewKbdPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags) 130 &xf86KbdVersionRec,
142#else 131 xf86KbdPlug,
 132 NULL
 133};
 134
143static int 135static int
144KbdPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags) 136KbdPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
145#endif 
146{ 137{
147 KbdDevPtr pKbd; 138 KbdDevPtr pKbd;
148 char *s; 139 char *s;
149 const char **defaults; 140 const char **defaults;
150 int rc = Success; 141 int rc = Success;
151 142
152 /* Initialise the InputInfoRec. */ 143 /* Initialise the InputInfoRec. */
153 pInfo->type_name = XI_KEYBOARD; 144 pInfo->type_name = XI_KEYBOARD;
154 pInfo->device_control = KbdProc; 145 pInfo->device_control = KbdProc;
155 /* 146 /*
156 * We don't specify our own read_input function. We expect 147 * We don't specify our own read_input function. We expect
157 * an OS specific readInput() function to handle this. 148 * an OS specific readInput() function to handle this.
158 */ 149 */
159 pInfo->read_input = NULL; 150 pInfo->read_input = NULL;
160 pInfo->control_proc = NULL; 151 pInfo->control_proc = NULL;
161 pInfo->switch_mode = NULL; 152 pInfo->switch_mode = NULL;
162 pInfo->fd = -1; 153 pInfo->fd = -1;
163 pInfo->dev = NULL; 154 pInfo->dev = NULL;
164 155
165 defaults = kbdDefaults; 156 defaults = kbdDefaults;
166 xf86CollectInputOptions(pInfo, defaults 157 xf86CollectInputOptions(pInfo, defaults);
167#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12 
168 , NULL 
169#endif 
170 ); 
171 xf86ProcessCommonOptions(pInfo, pInfo->options);  158 xf86ProcessCommonOptions(pInfo, pInfo->options);
172 159
173 if (!(pKbd = calloc(sizeof(KbdDevRec), 1))) { 160 if (!(pKbd = calloc(sizeof(KbdDevRec), 1))) {
174 rc = BadAlloc; 161 rc = BadAlloc;
175 goto out; 162 goto out;
176 } 163 }
177 164
178 pInfo->private = pKbd; 165 pInfo->private = pKbd;
179 pKbd->PostEvent = PostKbdEvent; 166 pKbd->PostEvent = PostKbdEvent;
180 167
181 if (!xf86OSKbdPreInit(pInfo)) { 168 if (!xf86OSKbdPreInit(pInfo)) {
182 rc = BadAlloc; 169 rc = BadAlloc;
183 goto out; 170 goto out;
@@ -299,115 +286,110 @@ InitKBD(InputInfoPtr pInfo, Bool init) @@ -299,115 +286,110 @@ InitKBD(InputInfoPtr pInfo, Bool init)
299 (leds & INITFLAG ? 0 : leds & NUMFLAG)) { 286 (leds & INITFLAG ? 0 : leds & NUMFLAG)) {
300 pKbd->PostEvent(pInfo, KEY_NumLock, TRUE); 287 pKbd->PostEvent(pInfo, KEY_NumLock, TRUE);
301 pKbd->PostEvent(pInfo, KEY_NumLock, FALSE); 288 pKbd->PostEvent(pInfo, KEY_NumLock, FALSE);
302 } 289 }
303 } 290 }
304} 291}
305 292
306static int 293static int
307KbdProc(DeviceIntPtr device, int what) 294KbdProc(DeviceIntPtr device, int what)
308{ 295{
309 296
310 InputInfoPtr pInfo = device->public.devicePrivate; 297 InputInfoPtr pInfo = device->public.devicePrivate;
311 KbdDevPtr pKbd = (KbdDevPtr) pInfo->private; 298 KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
 299 XkbRMLVOSet rmlvo;
312 KeySymsRec keySyms; 300 KeySymsRec keySyms;
313 CARD8 modMap[MAP_LENGTH]; 301 CARD8 modMap[MAP_LENGTH];
314 int ret; 302 int ret;
315 303
316 switch (what) { 304 switch (what) {
317 case DEVICE_INIT: 305 case DEVICE_INIT:
318 ret = pKbd->KbdInit(pInfo, what); 306 ret = pKbd->KbdInit(pInfo, what);
319 if (ret != Success) 307 if (ret != Success)
320 return ret; 308 return ret;
321 309
322 pKbd->KbdGetMapping(pInfo, &keySyms, modMap); 310 pKbd->KbdGetMapping(pInfo, &keySyms, modMap);
323 311
324 device->public.on = FALSE; 312 device->public.on = FALSE;
325#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 5 313 rmlvo.rules = xkb_rules;
326 { 314 rmlvo.model = xkb_model;
327 XkbRMLVOSet rmlvo; 315 rmlvo.layout = xkb_layout;
328 rmlvo.rules = xkb_rules; 316 rmlvo.variant = xkb_variant;
329 rmlvo.model = xkb_model; 317 rmlvo.options = xkb_options;
330 rmlvo.layout = xkb_layout; 
331 rmlvo.variant = xkb_variant; 
332 rmlvo.options = xkb_options; 
333 318
334 if (!InitKeyboardDeviceStruct(device, &rmlvo, KbdBell, KbdCtrl)) 319 if (!InitKeyboardDeviceStruct(device, &rmlvo, KbdBell, KbdCtrl))
335 { 320 {
336 xf86Msg(X_ERROR, "%s: Keyboard initialization failed. This " 321 xf86Msg(X_ERROR, "%s: Keyboard initialization failed. This "
337 "could be a missing or incorrect setup of " 322 "could be a missing or incorrect setup of "
338 "xkeyboard-config.\n", device->name); 323 "xkeyboard-config.\n", device->name);
339 324
340 return BadValue; 325 return BadValue;
341 } 
342 } 326 }
343# ifdef XI_PROP_DEVICE_NODE 327# ifdef XI_PROP_DEVICE_NODE
344 { 328 {
345 const char *device_node = 329 const char *device_node =
346 xf86CheckStrOption(pInfo->options, "Device", NULL); 330 xf86CheckStrOption(pInfo->options, "Device", NULL);
347 331
348 if (device_node) 332 if (device_node)
349 { 333 {
350 Atom prop_device = MakeAtom(XI_PROP_DEVICE_NODE, 334 Atom prop_device = MakeAtom(XI_PROP_DEVICE_NODE,
351 strlen(XI_PROP_DEVICE_NODE), TRUE); 335 strlen(XI_PROP_DEVICE_NODE), TRUE);
352 XIChangeDeviceProperty(device, prop_device, XA_STRING, 8, 336 XIChangeDeviceProperty(device, prop_device, XA_STRING, 8,
353 PropModeReplace, strlen(device_node), 337 PropModeReplace, strlen(device_node),
354 device_node, FALSE); 338 device_node, FALSE);
355 } 339 }
356 } 340 }
357# endif /* XI_PROP_DEVICE_NODE */ 341# endif /* XI_PROP_DEVICE_NODE */
358#else 
359 { 
360 XkbComponentNamesRec xkbnames; 
361 memset(&xkbnames, 0, sizeof(xkbnames)); 
362 XkbSetRulesDflts(xkb_rules, xkb_model, xkb_layout, 
363 xkb_variant, xkb_options); 
364 XkbInitKeyboardDeviceStruct(device, &xkbnames, &keySyms, 
365 modMap, KbdBell, 
366 (KbdCtrlProcPtr)KbdCtrl); 
367 } 
368#endif /* XINPUT ABI 5*/ 
369 InitKBD(pInfo, TRUE); 342 InitKBD(pInfo, TRUE);
370 break; 343 break;
371 case DEVICE_ON: 344 case DEVICE_ON:
372 if (device->public.on) 345 if (device->public.on)
373 break; 346 break;
374 /* 347 /*
375 * Set the keyboard into "direct" mode and turn on 348 * Set the keyboard into "direct" mode and turn on
376 * event translation. 349 * event translation.
377 */ 350 */
378 if ((ret = pKbd->KbdOn(pInfo, what)) != Success) 351 if ((ret = pKbd->KbdOn(pInfo, what)) != Success)
379 return ret; 352 return ret;
380 /* 353 /*
381 * Discard any pending input after a VT switch to prevent the server 354 * Discard any pending input after a VT switch to prevent the server
382 * passing on parts of the VT switch sequence. 355 * passing on parts of the VT switch sequence.
383 */ 356 */
384 if (pInfo->fd >= 0) { 357 if (pInfo->fd >= 0) {
385 xf86FlushInput(pInfo->fd); 358 xf86FlushInput(pInfo->fd);
 359#if HAVE_THREADED_INPUT
 360 xf86AddEnabledDevice(pInfo);
 361#else
386 AddEnabledDevice(pInfo->fd); 362 AddEnabledDevice(pInfo->fd);
 363#endif
387 } 364 }
388 365
389 device->public.on = TRUE; 366 device->public.on = TRUE;
390 InitKBD(pInfo, FALSE); 367 InitKBD(pInfo, FALSE);
391 break; 368 break;
392 369
393 case DEVICE_CLOSE: 370 case DEVICE_CLOSE:
394 case DEVICE_OFF: 371 case DEVICE_OFF:
395 372
396 /* 373 /*
397 * Restore original keyboard directness and translation. 374 * Restore original keyboard directness and translation.
398 */ 375 */
399 if (pInfo->fd != -1) 376 if (pInfo->fd != -1) {
 377#if HAVE_THREADED_INPUT
 378 xf86RemoveEnabledDevice(pInfo);
 379#else
400 RemoveEnabledDevice(pInfo->fd); 380 RemoveEnabledDevice(pInfo->fd);
 381#endif
 382 }
401 pKbd->KbdOff(pInfo, what); 383 pKbd->KbdOff(pInfo, what);
402 device->public.on = FALSE; 384 device->public.on = FALSE;
403 break; 385 break;
404 386
405 default: 387 default:
406 return BadValue; 388 return BadValue;
407 } 389 }
408 return (Success); 390 return (Success);
409} 391}
410 392
411static void 393static void
412PostKbdEvent(InputInfoPtr pInfo, unsigned int scanCode, Bool down) 394PostKbdEvent(InputInfoPtr pInfo, unsigned int scanCode, Bool down)
413{ 395{
@@ -441,50 +423,13 @@ PostKbdEvent(InputInfoPtr pInfo, unsigne @@ -441,50 +423,13 @@ PostKbdEvent(InputInfoPtr pInfo, unsigne
441 * they need to get the same key code as the base key on the same 423 * they need to get the same key code as the base key on the same
442 * physical keyboard key. 424 * physical keyboard key.
443 */ 425 */
444 426
445 state = XkbStateFieldFromRec(&keyc->xkbInfo->state); 427 state = XkbStateFieldFromRec(&keyc->xkbInfo->state);
446 428
447 if (((state & AltMask) == AltMask) && (scanCode == KEY_SysReqest)) 429 if (((state & AltMask) == AltMask) && (scanCode == KEY_SysReqest))
448 scanCode = KEY_Print; 430 scanCode = KEY_Print;
449 else if (scanCode == KEY_Break) 431 else if (scanCode == KEY_Break)
450 scanCode = KEY_Pause; 432 scanCode = KEY_Pause;
451 433
452 xf86PostKeyboardEvent(device, scanCode + MIN_KEYCODE, down); 434 xf86PostKeyboardEvent(device, scanCode + MIN_KEYCODE, down);
453} 435}
454 
455static void 
456xf86KbdUnplug(pointer p) 
457{ 
458} 
459 
460static pointer 
461xf86KbdPlug(pointer module, 
462 pointer options, 
463 int *errmaj, 
464 int *errmin) 
465{ 
466 xf86AddInputDriver(&KBD, module, 0); 
467 
468 return module; 
469} 
470 
471static XF86ModuleVersionInfo xf86KbdVersionRec = 
472{ 
473 "kbd", 
474 MODULEVENDORSTRING, 
475 MODINFOSTRING1, 
476 MODINFOSTRING2, 
477 XORG_VERSION_CURRENT, 
478 PACKAGE_VERSION_MAJOR, PACKAGE_VERSION_MINOR, PACKAGE_VERSION_PATCHLEVEL, 
479 ABI_CLASS_XINPUT, 
480 ABI_XINPUT_VERSION, 
481 MOD_CLASS_XINPUT, 
482 {0, 0, 0, 0} /* signature, to be patched into the file by */ 
483 /* a tool */ 
484}; 
485 
486_X_EXPORT XF86ModuleData kbdModuleData = { 
487 &xf86KbdVersionRec, 
488 xf86KbdPlug, 
489 xf86KbdUnplug 
490}; 

cvs diff -r1.2 -r1.3 xsrc/external/mit/xf86-input-mouse/dist/xorg-mouse.pc.in (expand / switch to unified diff)

--- xsrc/external/mit/xf86-input-mouse/dist/xorg-mouse.pc.in 2014/07/16 02:45:47 1.2
+++ xsrc/external/mit/xf86-input-mouse/dist/xorg-mouse.pc.in 2017/03/05 08:05:23 1.3
@@ -1,8 +1,10 @@ @@ -1,8 +1,10 @@
1prefix=@prefix@ 1prefix=@prefix@
 2exec_prefix=@exec_prefix@
 3libdir=@libdir@
2includedir=@includedir@ 4includedir=@includedir@
3sdkdir=@sdkdir@ 5sdkdir=@sdkdir@
4 6
5Name: xorg-mouse 7Name: xorg-mouse
6Description: X.Org mouse input driver for non-evdev OS'es 8Description: X.Org mouse input driver for non-evdev OS'es
7Version: @PACKAGE_VERSION@ 9Version: @PACKAGE_VERSION@
8Cflags: -I${sdkdir} 10Cflags: -I${sdkdir}

cvs diff -r1.17 -r1.18 xsrc/external/mit/xf86-input-mouse/dist/src/mouse.c (expand / switch to unified diff)

--- xsrc/external/mit/xf86-input-mouse/dist/src/mouse.c 2015/07/22 09:42:15 1.17
+++ xsrc/external/mit/xf86-input-mouse/dist/src/mouse.c 2017/03/05 08:05:23 1.18
@@ -119,40 +119,51 @@ typedef struct _DragLockRec { @@ -119,40 +119,51 @@ typedef struct _DragLockRec {
119 119
120 /* simulate these buttons being down although they are not */ 120 /* simulate these buttons being down although they are not */
121 int simulatedDown; 121 int simulatedDown;
122 122
123 /* 123 /*
124 * data to map bits for drag lock buttons to corresponding 124 * data to map bits for drag lock buttons to corresponding
125 * bits for the target buttons 125 * bits for the target buttons
126 */ 126 */
127 int nib_table[NIB_COUNT][NIB_SIZE]; 127 int nib_table[NIB_COUNT][NIB_SIZE];
128 128
129} DragLockRec, *DragLockPtr; 129} DragLockRec, *DragLockPtr;
130 130
131 131
 132#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 23
 133#define HAVE_THREADED_INPUT 1
 134#endif
 135
 136#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 24
 137#define BLOCK_HANDLER_ARGS void *data, void *waitTime
 138#define WAKEUP_HANDLER_ARGS void *data, int i
 139#else
 140#define BLOCK_HANDLER_ARGS pointer data, struct timeval **waitTime, pointer LastSelectMask
 141#define WAKEUP_HANDLER_ARGS void *data, int i, pointer LastSelectMask
 142#endif
 143
132#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12 144#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
133static InputInfoPtr MousePreInit(InputDriverPtr drv, IDevPtr dev, int flags); 145static InputInfoPtr MousePreInit(InputDriverPtr drv, IDevPtr dev, int flags);
134#else 146#else
135static int MousePreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags); 147static int MousePreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags);
136#endif 148#endif
137 149
138static int MouseProc(DeviceIntPtr device, int what); 150static int MouseProc(DeviceIntPtr device, int what);
139static void MouseCtrl(DeviceIntPtr device, PtrCtrl *ctrl); 151static void MouseCtrl(DeviceIntPtr device, PtrCtrl *ctrl);
140static void MousePostEvent(InputInfoPtr pInfo, int buttons, 152static void MousePostEvent(InputInfoPtr pInfo, int buttons,
141 int dx, int dy, int dz, int dw); 153 int dx, int dy, int dz, int dw);
142static void MouseReadInput(InputInfoPtr pInfo); 154static void MouseReadInput(InputInfoPtr pInfo);
143static void MouseBlockHandler(pointer data, struct timeval **waitTime, 155static void MouseBlockHandler(BLOCK_HANDLER_ARGS);
144 pointer LastSelectMask); 156static void MouseWakeupHandler(WAKEUP_HANDLER_ARGS);
145static void MouseWakeupHandler(pointer data, int i, pointer LastSelectMask); 
146static void FlushButtons(MouseDevPtr pMse); 157static void FlushButtons(MouseDevPtr pMse);
147 158
148static Bool SetupMouse(InputInfoPtr pInfo); 159static Bool SetupMouse(InputInfoPtr pInfo);
149static Bool initMouseHW(InputInfoPtr pInfo); 160static Bool initMouseHW(InputInfoPtr pInfo);
150#ifdef SUPPORT_MOUSE_RESET 161#ifdef SUPPORT_MOUSE_RESET
151static Bool mouseReset(InputInfoPtr pInfo, unsigned char val); 162static Bool mouseReset(InputInfoPtr pInfo, unsigned char val);
152static void ps2WakeupHandler(pointer data, int i, pointer LastSelectMask); 163static void ps2WakeupHandler(pointer data, int i, pointer LastSelectMask);
153static void ps2BlockHandler(pointer data, struct timeval **waitTime, 164static void ps2BlockHandler(pointer data, struct timeval **waitTime,
154 pointer LastSelectMask); 165 pointer LastSelectMask);
155#endif 166#endif
156static void Emulate3ButtonsSetEnabled(InputInfoPtr pInfo, Bool enable); 167static void Emulate3ButtonsSetEnabled(InputInfoPtr pInfo, Bool enable);
157 168
158/* mouse autoprobe stuff */ 169/* mouse autoprobe stuff */
@@ -2015,43 +2026,53 @@ static char reverseMap[16] = { 0, 4, 2 @@ -2015,43 +2026,53 @@ static char reverseMap[16] = { 0, 4, 2
2015 9, 13, 11, 15 }; 2026 9, 13, 11, 15 };
2016 2027
2017static char hitachMap[16] = { 0, 2, 1, 3, 2028static char hitachMap[16] = { 0, 2, 1, 3,
2018 8, 10, 9, 11, 2029 8, 10, 9, 11,
2019 4, 6, 5, 7, 2030 4, 6, 5, 7,
2020 12, 14, 13, 15 }; 2031 12, 14, 13, 15 };
2021 2032
2022#define reverseBits(map, b) (((b) & ~0x0f) | map[(b) & 0x0f]) 2033#define reverseBits(map, b) (((b) & ~0x0f) | map[(b) & 0x0f])
2023 2034
2024static CARD32 2035static CARD32
2025buttonTimer(InputInfoPtr pInfo) 2036buttonTimer(InputInfoPtr pInfo)
2026{ 2037{
2027 MouseDevPtr pMse; 2038 MouseDevPtr pMse;
 2039#if !HAVE_THREADED_INPUT
2028 int sigstate; 2040 int sigstate;
 2041#endif
2029 int id; 2042 int id;
2030 2043
2031 pMse = pInfo->private; 2044 pMse = pInfo->private;
2032 2045
 2046#if HAVE_THREADED_INPUT
 2047 input_lock();
 2048#else
2033 sigstate = xf86BlockSIGIO (); 2049 sigstate = xf86BlockSIGIO ();
 2050#endif
2034 2051
2035 pMse->emulate3Pending = FALSE; 2052 pMse->emulate3Pending = FALSE;
2036 if ((id = stateTab[pMse->emulateState][4][0]) != 0) { 2053 if ((id = stateTab[pMse->emulateState][4][0]) != 0) {
2037 xf86PostButtonEvent(pInfo->dev, 0, abs(id), (id >= 0), 0, 0); 2054 xf86PostButtonEvent(pInfo->dev, 0, abs(id), (id >= 0), 0, 0);
2038 pMse->emulateState = stateTab[pMse->emulateState][4][2]; 2055 pMse->emulateState = stateTab[pMse->emulateState][4][2];
2039 } else { 2056 } else {
2040 LogMessageVerbSigSafe(X_WARNING, -1, 2057 LogMessageVerbSigSafe(X_WARNING, -1,
2041 "Got unexpected buttonTimer in state %d\n", pMse->emulateState); 2058 "Got unexpected buttonTimer in state %d\n", pMse->emulateState);
2042 } 2059 }
2043 2060
 2061#if HAVE_THREADED_INPUT
 2062 input_unlock();
 2063#else
2044 xf86UnblockSIGIO (sigstate); 2064 xf86UnblockSIGIO (sigstate);
 2065#endif
2045 return 0; 2066 return 0;
2046} 2067}
2047 2068
2048static void 2069static void
2049Emulate3ButtonsSetEnabled(InputInfoPtr pInfo, Bool enable) 2070Emulate3ButtonsSetEnabled(InputInfoPtr pInfo, Bool enable)
2050{ 2071{
2051 MouseDevPtr pMse = pInfo->private; 2072 MouseDevPtr pMse = pInfo->private;
2052 2073
2053 if (pMse->emulate3Buttons == enable) 2074 if (pMse->emulate3Buttons == enable)
2054 return; 2075 return;
2055 2076
2056 pMse->emulate3Buttons = enable; 2077 pMse->emulate3Buttons = enable;
2057 2078
@@ -2088,46 +2109,42 @@ Emulate3ButtonsSoft(InputInfoPtr pInfo) @@ -2088,46 +2109,42 @@ Emulate3ButtonsSoft(InputInfoPtr pInfo)
2088 * 3 buttons. 2109 * 3 buttons.
2089 */ 2110 */
2090 return TRUE; 2111 return TRUE;
2091#else 2112#else
2092 LogMessageVerbSigSafe(X_INFO, 4, 2113 LogMessageVerbSigSafe(X_INFO, 4,
2093 "mouse: 3rd Button detected: disabling emulate3Button\n"); 2114 "mouse: 3rd Button detected: disabling emulate3Button\n");
2094 2115
2095 Emulate3ButtonsSetEnabled(pInfo, FALSE); 2116 Emulate3ButtonsSetEnabled(pInfo, FALSE);
2096 2117
2097 return FALSE; 2118 return FALSE;
2098#endif 2119#endif
2099} 2120}
2100 2121
2101static void MouseBlockHandler(pointer data, 2122static void MouseBlockHandler(BLOCK_HANDLER_ARGS)
2102 struct timeval **waitTime, 
2103 pointer LastSelectMask) 
2104{ 2123{
2105 InputInfoPtr pInfo = (InputInfoPtr) data; 2124 InputInfoPtr pInfo = (InputInfoPtr) data;
2106 MouseDevPtr pMse = (MouseDevPtr) pInfo->private; 2125 MouseDevPtr pMse = (MouseDevPtr) pInfo->private;
2107 int ms; 2126 int ms;
2108 2127
2109 if (pMse->emulate3Pending) 2128 if (pMse->emulate3Pending)
2110 { 2129 {
2111 ms = pMse->emulate3Expires - GetTimeInMillis (); 2130 ms = pMse->emulate3Expires - GetTimeInMillis ();
2112 if (ms <= 0) 2131 if (ms <= 0)
2113 ms = 0; 2132 ms = 0;
2114 AdjustWaitForDelay (waitTime, ms); 2133 AdjustWaitForDelay (waitTime, ms);
2115 } 2134 }
2116} 2135}
2117 2136
2118static void MouseWakeupHandler(pointer data, 2137static void MouseWakeupHandler(WAKEUP_HANDLER_ARGS)
2119 int i, 
2120 pointer LastSelectMask) 
2121{ 2138{
2122 InputInfoPtr pInfo = (InputInfoPtr) data; 2139 InputInfoPtr pInfo = (InputInfoPtr) data;
2123 MouseDevPtr pMse = (MouseDevPtr) pInfo->private; 2140 MouseDevPtr pMse = (MouseDevPtr) pInfo->private;
2124 int ms; 2141 int ms;
2125 2142
2126 if (pMse->emulate3Pending) 2143 if (pMse->emulate3Pending)
2127 { 2144 {
2128 ms = pMse->emulate3Expires - GetTimeInMillis (); 2145 ms = pMse->emulate3Expires - GetTimeInMillis ();
2129 if (ms <= 0) 2146 if (ms <= 0)
2130 buttonTimer (pInfo); 2147 buttonTimer (pInfo);
2131 } 2148 }
2132} 2149}
2133 2150
@@ -3266,34 +3283,40 @@ autoOSProtocol(InputInfoPtr pInfo, int * @@ -3266,34 +3283,40 @@ autoOSProtocol(InputInfoPtr pInfo, int *
3266 3283
3267/* 3284/*
3268 * createProtocolList() -- create a list of protocols which may 3285 * createProtocolList() -- create a list of protocols which may
3269 * match on the incoming data stream. 3286 * match on the incoming data stream.
3270 */ 3287 */
3271static void 3288static void
3272createProtoList(MouseDevPtr pMse, MouseProtocolID *protoList) 3289createProtoList(MouseDevPtr pMse, MouseProtocolID *protoList)
3273{ 3290{
3274 int i, j, k = 0; 3291 int i, j, k = 0;
3275 MouseProtocolID prot; 3292 MouseProtocolID prot;
3276 unsigned char *para; 3293 unsigned char *para;
3277 mousePrivPtr mPriv = (mousePrivPtr)pMse->mousePriv; 3294 mousePrivPtr mPriv = (mousePrivPtr)pMse->mousePriv;
3278 MouseProtocolID *tmplist = NULL; 3295 MouseProtocolID *tmplist = NULL;
 3296#if !HAVE_THREADED_INPUT
3279 int blocked; 3297 int blocked;
 3298#endif
3280 3299
3281 AP_DBGC(("Autoprobe: ")); 3300 AP_DBGC(("Autoprobe: "));
3282 for (i = 0; i < mPriv->count; i++) 3301 for (i = 0; i < mPriv->count; i++)
3283 AP_DBGC(("%2.2x ", (unsigned char) mPriv->data[i])); 3302 AP_DBGC(("%2.2x ", (unsigned char) mPriv->data[i]));
3284 AP_DBGC(("\n")); 3303 AP_DBGC(("\n"));
3285 3304
 3305#if HAVE_THREADED_INPUT
 3306 input_lock();
 3307#else
3286 blocked = xf86BlockSIGIO (); 3308 blocked = xf86BlockSIGIO ();
 3309#endif
3287 3310
3288 /* create a private copy first so we can write in the old list */ 3311 /* create a private copy first so we can write in the old list */
3289 if ((tmplist = malloc(sizeof(MouseProtocolID) * NUM_AUTOPROBE_PROTOS))){ 3312 if ((tmplist = malloc(sizeof(MouseProtocolID) * NUM_AUTOPROBE_PROTOS))){
3290 for (i = 0; protoList[i] != PROT_UNKNOWN; i++) { 3313 for (i = 0; protoList[i] != PROT_UNKNOWN; i++) {
3291 tmplist[i] = protoList[i]; 3314 tmplist[i] = protoList[i];
3292 } 3315 }
3293 tmplist[i] = PROT_UNKNOWN; 3316 tmplist[i] = PROT_UNKNOWN;
3294 protoList = tmplist; 3317 protoList = tmplist;
3295 } else 3318 } else
3296 return; 3319 return;
3297 3320
3298 for (i = 0; ((prot = protoList[i]) != PROT_UNKNOWN 3321 for (i = 0; ((prot = protoList[i]) != PROT_UNKNOWN
3299 && (k < NUM_AUTOPROBE_PROTOS - 1)) ; i++) { 3322 && (k < NUM_AUTOPROBE_PROTOS - 1)) ; i++) {
@@ -3382,27 +3405,31 @@ createProtoList(MouseDevPtr pMse, MouseP @@ -3382,27 +3405,31 @@ createProtoList(MouseDevPtr pMse, MouseP
3382 } 3405 }
3383 j = next_header_candidate; 3406 j = next_header_candidate;
3384 next_header_candidate = 0; 3407 next_header_candidate = 0;
3385 /* we have tested number of bytes per package for header */ 3408 /* we have tested number of bytes per package for header */
3386 if (j > para[4] && ++header_count > para[4]) 3409 if (j > para[4] && ++header_count > para[4])
3387 break; 3410 break;
3388 /* we have not found anything that looks like a header */ 3411 /* we have not found anything that looks like a header */
3389 if (!next_header_candidate) 3412 if (!next_header_candidate)
3390 break; 3413 break;
3391 AP_DBG(("Looking for new header\n")); 3414 AP_DBG(("Looking for new header\n"));
3392 } 3415 }
3393 } 3416 }
3394 3417
 3418#if HAVE_THREADED_INPUT
 3419 input_unlock();
 3420#else
3395 xf86UnblockSIGIO(blocked); 3421 xf86UnblockSIGIO(blocked);
 3422#endif
3396 3423
3397 mPriv->protoList[k] = PROT_UNKNOWN; 3424 mPriv->protoList[k] = PROT_UNKNOWN;
3398 3425
3399 free(tmplist); 3426 free(tmplist);
3400} 3427}
3401 3428
3402 3429
3403/* This only needs to be done once */ 3430/* This only needs to be done once */
3404static void **serialDefaultsList = NULL; 3431static void **serialDefaultsList = NULL;
3405 3432
3406/* 3433/*
3407 * createSerialDefaultsLists() - create a list of the different default 3434 * createSerialDefaultsLists() - create a list of the different default
3408 * settings for the serial interface of the known protocols. 3435 * settings for the serial interface of the known protocols.