1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
|
/*
* Copyright 2007-2009 by Ping Cheng, Wacom Technology. <pingc@wacom.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wacom-properties.h>
#include "xf86Wacom.h"
#include "wcmFilter.h"
extern void xf86WcmInitialCoordinates(LocalDevicePtr local, int axes);
extern void wcmRotateTablet(LocalDevicePtr local, int value);
extern void wcmInitialScreens(LocalDevicePtr local);
int xf86WcmDevSwitchModeCall(LocalDevicePtr local, int mode);
int xf86WcmDevSwitchMode(ClientPtr client, DeviceIntPtr dev, int mode);
void xf86WcmChangeScreen(LocalDevicePtr local, int value);
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 3
int xf86WcmSetProperty(DeviceIntPtr dev, Atom property,
XIPropertyValuePtr prop, BOOL checkonly);
void InitWcmDeviceProperties(LocalDevicePtr local);
#endif
/*****************************************************************************
* xf86WcmSetPadCoreMode
****************************************************************************/
int xf86WcmSetPadCoreMode(LocalDevicePtr local)
{
WacomDevicePtr priv = (WacomDevicePtr)local->private;
int is_core = local->flags & (XI86_ALWAYS_CORE | XI86_CORE_POINTER);
/* Pad is always in relative mode when it's a core device.
* Always in absolute mode when it is not a core device.
*/
DBG(10, priv, "%p"
" is always in %s mode when it %s core device\n",
(void *)local->dev,
!is_core ? "absolute" : "relative",
is_core ? "is" : "isn't");
if (is_core)
priv->flags &= ~ABSOLUTE_FLAG;
else
priv->flags |= ABSOLUTE_FLAG;
return Success;
}
/*****************************************************************************
* xf86WcmDevSwitchModeCall --
*****************************************************************************/
int xf86WcmDevSwitchModeCall(LocalDevicePtr local, int mode)
{
WacomDevicePtr priv = (WacomDevicePtr)local->private;
int is_absolute = priv->flags & ABSOLUTE_FLAG;
DBG(3, priv, "to mode=%d\n", mode);
/* Pad is always in relative mode when it's a core device.
* Always in absolute mode when it is not a core device.
*/
if (IsPad(priv))
return xf86WcmSetPadCoreMode(local);
if ((mode == Absolute) && !is_absolute)
{
priv->flags |= ABSOLUTE_FLAG;
xf86ReplaceStrOption(local->options, "Mode", "Absolute");
xf86WcmInitialCoordinates(local, 0);
xf86WcmInitialCoordinates(local, 1);
}
else if ((mode == Relative) && is_absolute)
{
priv->flags &= ~ABSOLUTE_FLAG;
xf86ReplaceStrOption(local->options, "Mode", "Relative");
xf86WcmInitialCoordinates(local, 0);
xf86WcmInitialCoordinates(local, 1);
}
else if ( (mode != Absolute) && (mode != Relative))
{
DBG(10, priv, "invalid mode=%d\n", mode);
return BadMatch;
}
return Success;
}
/*****************************************************************************
* xf86WcmDevSwitchMode --
*****************************************************************************/
int xf86WcmDevSwitchMode(ClientPtr client, DeviceIntPtr dev, int mode)
{
LocalDevicePtr local = (LocalDevicePtr)dev->public.devicePrivate;
#ifdef DEBUG
WacomDevicePtr priv = (WacomDevicePtr)local->private;
DBG(3, priv, "dev=%p mode=%d\n",
(void *)dev, mode);
#endif
/* Share this call with sendAButton in wcmCommon.c */
return xf86WcmDevSwitchModeCall(local, mode);
}
/*****************************************************************************
* xf86WcmChangeScreen
****************************************************************************/
void xf86WcmChangeScreen(LocalDevicePtr local, int value)
{
WacomDevicePtr priv = (WacomDevicePtr)local->private;
if (priv->screen_no != value)
{
priv->screen_no = value;
xf86ReplaceIntOption(local->options, "ScreenNo", value);
}
if (priv->screen_no != -1)
priv->currentScreen = priv->screen_no;
wcmInitialScreens(local);
xf86WcmInitialCoordinates(local, 0);
xf86WcmInitialCoordinates(local, 1);
}
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 3
Atom prop_rotation;
Atom prop_tablet_area;
Atom prop_screen_area;
Atom prop_pressurecurve;
Atom prop_serials;
Atom prop_strip_buttons;
Atom prop_wheel_buttons;
Atom prop_display;
Atom prop_tv_resolutions;
Atom prop_screen;
Atom prop_cursorprox;
Atom prop_capacity;
Atom prop_threshold;
Atom prop_suppress;
Atom prop_touch;
Atom prop_hover;
Atom prop_tooltype;
Atom prop_btnactions;
#ifdef DEBUG
Atom prop_debuglevels;
#endif
/* Special case: format -32 means type is XA_ATOM */
static Atom InitWcmAtom(DeviceIntPtr dev, char *name, int format, int nvalues, int *values)
{
int i;
Atom atom;
uint8_t val_8[WCM_MAX_MOUSE_BUTTONS];
uint16_t val_16[WCM_MAX_MOUSE_BUTTONS];
uint32_t val_32[WCM_MAX_MOUSE_BUTTONS];
pointer converted = val_32;
Atom type = XA_INTEGER;
if (format == -32)
{
type = XA_ATOM;
format = 32;
}
for (i = 0; i < nvalues; i++)
{
switch(format)
{
case 8: val_8[i] = values[i]; break;
case 16: val_16[i] = values[i]; break;
case 32: val_32[i] = values[i]; break;
}
}
switch(format)
{
case 8: converted = val_8; break;
case 16: converted = val_16; break;
case 32: converted = val_32; break;
}
atom = MakeAtom(name, strlen(name), TRUE);
XIChangeDeviceProperty(dev, atom, type, format,
PropModeReplace, nvalues,
converted, FALSE);
XISetDevicePropertyDeletable(dev, atom, FALSE);
return atom;
}
void InitWcmDeviceProperties(LocalDevicePtr local)
{
WacomDevicePtr priv = (WacomDevicePtr) local->private;
WacomCommonPtr common = priv->common;
int values[WCM_MAX_MOUSE_BUTTONS];
DBG(10, priv, "\n");
values[0] = priv->topX;
values[1] = priv->topY;
values[2] = priv->bottomX;
values[3] = priv->bottomY;
prop_tablet_area = InitWcmAtom(local->dev, WACOM_PROP_TABLET_AREA, 32, 4, values);
values[0] = common->wcmRotate;
prop_rotation = InitWcmAtom(local->dev, WACOM_PROP_ROTATION, 8, 1, values);
values[0] = 0;
values[1] = 0;
values[2] = 100;
values[3] = 100;
prop_pressurecurve = InitWcmAtom(local->dev, WACOM_PROP_PRESSURECURVE, 32, 4, values);
values[0] = common->tablet_id;
values[1] = priv->old_serial;
values[2] = priv->old_device_id;
values[3] = priv->serial;
prop_serials = InitWcmAtom(local->dev, WACOM_PROP_SERIALIDS, 32, 4, values);
values[0] = priv->striplup;
values[1] = priv->stripldn;
values[2] = priv->striprup;
values[3] = priv->striprdn;
prop_strip_buttons = InitWcmAtom(local->dev, WACOM_PROP_STRIPBUTTONS, 8, 4, values);
values[0] = priv->relup;
values[1] = priv->reldn;
values[2] = priv->wheelup;
values[3] = priv->wheeldn;
prop_wheel_buttons = InitWcmAtom(local->dev, WACOM_PROP_WHEELBUTTONS, 8, 4, values);
values[0] = priv->tvResolution[0];
values[1] = priv->tvResolution[1];
values[2] = priv->tvResolution[2];
values[3] = priv->tvResolution[3];
prop_tv_resolutions = InitWcmAtom(local->dev, WACOM_PROP_TWINVIEW_RES, 32, 4, values);
values[0] = priv->screen_no;
values[1] = priv->twinview;
values[2] = priv->wcmMMonitor;
prop_display = InitWcmAtom(local->dev, WACOM_PROP_DISPLAY_OPTS, 8, 3, values);
values[0] = priv->screenTopX[priv->currentScreen];
values[1] = priv->screenTopY[priv->currentScreen];
values[2] = priv->screenBottomX[priv->currentScreen];
values[3] = priv->screenBottomY[priv->currentScreen];
prop_screen = InitWcmAtom(local->dev, WACOM_PROP_SCREENAREA, 32, 4, values);
values[0] = common->wcmCursorProxoutDist;
prop_cursorprox = InitWcmAtom(local->dev, WACOM_PROP_PROXIMITY_THRESHOLD, 32, 1, values);
values[0] = common->wcmCapacity;
prop_capacity = InitWcmAtom(local->dev, WACOM_PROP_CAPACITY, 32, 1, values);
values[0] = (!common->wcmMaxZ) ? 0 : common->wcmThreshold;
prop_threshold = InitWcmAtom(local->dev, WACOM_PROP_PRESSURE_THRESHOLD, 32, 1, values);
values[0] = common->wcmSuppress;
values[1] = common->wcmRawSample;
prop_suppress = InitWcmAtom(local->dev, WACOM_PROP_SAMPLE, 32, 2, values);
values[0] = common->wcmTouch;
prop_touch = InitWcmAtom(local->dev, WACOM_PROP_TOUCH, 8, 1, values);
values[0] = !common->wcmTPCButton;
prop_hover = InitWcmAtom(local->dev, WACOM_PROP_HOVER, 8, 1, values);
values[0] = MakeAtom(local->type_name, strlen(local->type_name), TRUE);
prop_tooltype = InitWcmAtom(local->dev, WACOM_PROP_TOOL_TYPE, -32, 1, values);
/* default to no actions */
memset(values, 0, sizeof(values));
prop_btnactions = InitWcmAtom(local->dev, WACOM_PROP_BUTTON_ACTIONS, -32, WCM_MAX_MOUSE_BUTTONS, values);
#ifdef DEBUG
values[0] = priv->debugLevel;
values[1] = common->debugLevel;
prop_debuglevels = InitWcmAtom(local->dev, WACOM_PROP_DEBUGLEVELS, 8, 2, values);
#endif
}
int xf86WcmSetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop,
BOOL checkonly)
{
LocalDevicePtr local = (LocalDevicePtr) dev->public.devicePrivate;
WacomDevicePtr priv = (WacomDevicePtr) local->private;
WacomCommonPtr common = priv->common;
DBG(10, priv, "\n");
if (property == prop_tablet_area)
{
INT32 *values = (INT32*)prop->data;
WacomToolAreaPtr area = priv->toolarea;
if (prop->size != 4 || prop->format != 32)
return BadValue;
/* value validation is unnecessary since we let utility programs, such as
* xsetwacom and userland control panel take care of the validation role.
* when all four values are set to -1, it is an area reset (xydefault) */
if ((values[0] != -1) || (values[1] != -1) ||
(values[2] != -1) || (values[3] != -1))
{
WacomToolArea tmp_area = *area;
area->topX = values[0];
area->topY = values[1];
area->bottomX = values[2];
area->bottomY = values[3];
/* validate the area */
if (wcmAreaListOverlap(area, priv->tool->arealist))
{
*area = tmp_area;
return BadValue;
}
*area = tmp_area;
}
if (!checkonly)
{
if ((values[0] == -1) && (values[1] == -1) &&
(values[2] == -1) && (values[3] == -1))
{
values[0] = 0;
values[1] = 0;
values[2] = priv->maxX;
values[3] = priv->maxY;
}
priv->topX = area->topX = values[0];
priv->topY = area->topY = values[1];
priv->bottomX = area->bottomX = values[2];
priv->bottomY = area->bottomY = values[3];
xf86WcmInitialCoordinates(local, 0);
xf86WcmInitialCoordinates(local, 1);
}
} else if (property == prop_pressurecurve)
{
INT32 *pcurve;
if (prop->size != 4 || prop->format != 32)
return BadValue;
pcurve = (INT32*)prop->data;
if ((pcurve[0] > 100) || (pcurve[1] > 100) ||
(pcurve[2] > 100) || (pcurve[3] > 100))
return BadValue;
if (IsCursor(priv) || IsPad (priv) || IsTouch (priv))
return BadValue;
if (!checkonly)
wcmSetPressureCurve (priv, pcurve[0], pcurve[1],
pcurve[2], pcurve[3]);
} else if (property == prop_suppress)
{
CARD32 *values;
if (prop->size != 2 || prop->format != 32)
return BadValue;
values = (CARD32*)prop->data;
if ((values[0] < 0) || (values[0] > 100))
return BadValue;
if ((values[1] < 0) || (values[1] > XWACOM_MAX_SAMPLES))
return BadValue;
if (!checkonly)
{
common->wcmSuppress = values[0];
common->wcmRawSample = values[1];
}
} else if (property == prop_rotation)
{
CARD8 value;
if (prop->size != 1 || prop->format != 8)
return BadValue;
value = *(CARD8*)prop->data;
if (value > 3)
return BadValue;
if (!checkonly && common->wcmRotate != value)
wcmRotateTablet(local, value);
} else if (property == prop_serials)
{
return BadValue; /* Read-only */
} else if (property == prop_strip_buttons)
{
CARD8 *values;
if (prop->size != 4 || prop->format != 8)
return BadValue;
values = (CARD8*)prop->data;
if (values[0] > WCM_MAX_MOUSE_BUTTONS ||
values[1] > WCM_MAX_MOUSE_BUTTONS ||
values[2] > WCM_MAX_MOUSE_BUTTONS ||
values[3] > WCM_MAX_MOUSE_BUTTONS)
return BadValue;
if (!checkonly)
{
/* FIXME: needs to take AC_* into account */
priv->striplup = values[0];
priv->stripldn = values[1];
priv->striprup = values[2];
priv->striprdn = values[3];
}
} else if (property == prop_wheel_buttons)
{
CARD8 *values;
if (prop->size != 4 || prop->format != 8)
return BadValue;
values = (CARD8*)prop->data;
if (values[0] > WCM_MAX_MOUSE_BUTTONS ||
values[1] > WCM_MAX_MOUSE_BUTTONS ||
values[2] > WCM_MAX_MOUSE_BUTTONS ||
values[3] > WCM_MAX_MOUSE_BUTTONS)
return BadValue;
if (!checkonly)
{
/* FIXME: needs to take AC_* into account */
priv->relup = values[0];
priv->reldn = values[1];
priv->wheelup = values[2];
priv->wheeldn = values[3];
}
} else if (property == prop_screen)
{
/* Long-term, this property should be removed, there's other ways to
* get the screen resolution. For now, we leave it in for backwards
* compat */
return BadValue; /* Read-only */
} else if (property == prop_display)
{
INT8 *values;
if (prop->size != 3 || prop->format != 8)
return BadValue;
values = (INT8*)prop->data;
if (values[0] < -1 || values[0] >= priv->numScreen)
return BadValue;
if (values[1] < TV_NONE || values[1] > TV_MAX)
return BadValue;
if ((values[2] != 0) && (values[2] != 1))
return BadValue;
if (!checkonly)
{
if (priv->screen_no != values[0])
xf86WcmChangeScreen(local, values[0]);
priv->screen_no = values[0];
if (priv->twinview != values[1])
{
int screen = priv->screen_no;
priv->twinview = values[1];
/* Can not restrict the cursor to a particular screen */
if (!values[1] && (screenInfo.numScreens == 1))
{
screen = -1;
priv->currentScreen = 0;
DBG(10, priv, "TwinView sets to "
"TV_NONE: can't change screen_no. \n");
}
xf86WcmChangeScreen(local, screen);
}
priv->wcmMMonitor = values[2];
}
} else if (property == prop_cursorprox)
{
CARD32 value;
if (prop->size != 1 || prop->format != 32)
return BadValue;
if (!IsCursor (priv))
return BadValue;
value = *(CARD32*)prop->data;
if (value > 255)
return BadValue;
if (!checkonly)
common->wcmCursorProxoutDist = value;
} else if (property == prop_capacity)
{
INT32 value;
if (prop->size != 1 || prop->format != 32)
return BadValue;
value = *(INT32*)prop->data;
if ((value < -1) || (value > 5))
return BadValue;
if (!checkonly)
common->wcmCapacity = value;
} else if (property == prop_threshold)
{
CARD32 value;
if (prop->size != 1 || prop->format != 32)
return BadValue;
value = *(CARD32*)prop->data;
if ((value < 1) || (value > 21))
return BadValue;
if (!checkonly)
common->wcmThreshold = value;
} else if (property == prop_touch)
{
CARD8 *values = (CARD8*)prop->data;
if (prop->size != 1 || prop->format != 8)
return BadValue;
if ((values[0] != 0) && (values[0] != 1))
return BadValue;
if (!checkonly && common->wcmTouch != values[0])
common->wcmTouch = values[0];
} else if (property == prop_hover)
{
CARD8 *values = (CARD8*)prop->data;
if (prop->size != 1 || prop->format != 8)
return BadValue;
if ((values[0] != 0) && (values[0] != 1))
return BadValue;
if (!checkonly && common->wcmTPCButton != !values[0])
common->wcmTPCButton = !values[0];
} else if (property == prop_tv_resolutions)
{
CARD32 *values;
if (prop->size != 4 || prop->format != 32)
return BadValue;
values = (CARD32*)prop->data;
/* non-TwinView settings can not set TwinView RESOLUTION */
if ((priv->twinview == TV_NONE) || (values[0] < 0) ||
(values[1] < 0) || (values[2] < 0) || (values[3] < 0) ||
((values[0] + values[2]) != screenInfo.screens[0]->width) ||
((values[1] + values[3]) != screenInfo.screens[0]->height))
return BadValue;
if (!checkonly)
{
priv->tvResolution[0] = values[0];
priv->tvResolution[1] = values[1];
priv->tvResolution[2] = values[2];
priv->tvResolution[3] = values[3];
/* reset screen info */
xf86WcmChangeScreen(local, priv->screen_no);
}
#ifdef DEBUG
} else if (property == prop_debuglevels)
{
CARD8 *values;
if (prop->size != 2 || prop->format != 8)
return BadMatch;
values = (CARD8*)prop->data;
if (values[0] > 10 || values[1] > 10)
return BadValue;
if (!checkonly)
{
priv->debugLevel = values[0];
common->debugLevel = values[1];
}
#endif
} else if (property == prop_btnactions)
{
Atom *values;
int i, j;
XIPropertyValuePtr val;
if (prop->size != WCM_MAX_MOUSE_BUTTONS || prop->format != 32 ||
prop->type != XA_ATOM)
return BadMatch;
/* How this works:
* prop_btnactions has a list of atoms stored. Any atom references
* another property on that device that contains the actual action.
* If this property changes, all action-properties are queried for
* their value and their value is stored in priv->key[button].
*
* If the button is pressed, the actions are executed.
*
* Any button action property needs to be monitored by this property
* handler too.
*/
values = (Atom*)prop->data;
for (i = 0; i < prop->size; i++)
{
if (!values[i])
continue;
if (values[i] == property || !ValidAtom(values[i]))
return BadValue;
if (XIGetDeviceProperty(local->dev, values[i], &val) != Success)
return BadValue;
}
if (!checkonly)
{
/* any action property needs to be registered for this handler. */
for (i = 0; i < prop->size; i++)
priv->btn_actions[i] = values[i];
for (i = 0; i < prop->size; i++)
{
if (!values[i])
continue;
XIGetDeviceProperty(local->dev, values[i], &val);
memset(priv->keys[i], 0, sizeof(priv->keys[i]));
for (j = 0; j < val->size; j++)
priv->keys[i][j] = ((unsigned int*)val->data)[j];
}
}
} else
{
int i, j;
/* check all properties used for button actions */
for (i = 0; i < ARRAY_SIZE(priv->btn_actions); i++)
if (priv->btn_actions[i] == property)
break;
if (i < ARRAY_SIZE(priv->btn_actions))
{
CARD32 *data;
int code;
int type;
if (prop->size >= 255 || prop->format != 32 ||
prop->type != XA_INTEGER)
return BadMatch;
data = (CARD32*)prop->data;
for (j = 0;j < prop->size; j++)
{
code = data[j] & AC_CODE;
type = data[j] & AC_TYPE;
switch(type)
{
case AC_KEY:
break;
case AC_BUTTON:
if (code > WCM_MAX_MOUSE_BUTTONS)
return BadValue;
break;
case AC_DISPLAYTOGGLE:
case AC_MODETOGGLE:
case AC_DBLCLICK:
break;
default:
return BadValue;
}
if (!checkonly)
{
memset(priv->keys[i], 0, sizeof(priv->keys[i]));
for (j = 0; j < prop->size; j++)
priv->keys[i][j] = data[j];
}
}
}
}
return Success;
}
#endif /* GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 3 */
/* vim: set noexpandtab shiftwidth=8: */
|