Commit Graph

68 Commits

Author SHA1 Message Date
Alan Coopersmith 23e83724df Fix spelling/wording issues
Most (but not all) of these were found by using
  codespell --builtin clear,rare,usage,informal,code,names
but not everything reported by that was fixed.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2020-07-05 13:07:33 -07:00
Daniel Martin d5379b350f Use ARRAY_SIZE all over the tree
Roundhouse kick replacing the various (sizeof(foo)/sizeof(foo[0])) with
the ARRAY_SIZE macro from dix.h when possible. A semantic patch for
coccinelle has been used first. Additionally, a few macros have been
inlined as they had only one or two users.

Signed-off-by: Daniel Martin <consume.noise@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2017-10-30 13:45:20 -04:00
Adam Jackson dc7ceda90f dispatch: Mark swapped dispatch as _X_COLD
This touches everything that ends up in the Xorg binary; the big missing
part is GLX since that's all generated code. Cuts about 14k from the
binary on amd64.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2017-03-01 10:16:20 -05:00
Keith Packard dfc91f0f63 Hold input lock while calling input device SetProperty callback
This keeps the input driver SetProperty function from being called
while input events are being processed.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-09-15 07:50:34 +10:00
Adam Jackson 137ac094e7 dix: Push UpdateCurrentTimeIf down out of the main loop
This was added in:

    commit 312910b4e3
    Author: Chase Douglas <chase.douglas@canonical.com>
    Date:   Wed Apr 18 11:15:40 2012 -0700

        Update currentTime in dispatch loop

Unfortunately this is equivalent to calling GetTimeInMillis() once per
request. In the absolute best case (as on Linux) you're only hitting the
vDSO; on other platforms that's a syscall. Either way it puts a pretty
hard ceiling on request throughput.

Instead, push the call down to the requests that need it; basically,
grab processing and event generation.

Cc: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-05-04 10:58:01 -04:00
Alan Coopersmith 1c56ac63c0 Convert top level extensions to new *allocarray functions
v2: remove now useless parentheses

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-04-21 16:57:08 -07:00
Alan Coopersmith 73c63afb93 Xi: unvalidated lengths in Xinput extension [CVE-2014-8095]
Multiple functions in the Xinput extension handling of requests from
clients failed to check that the length of the request sent by the
client was large enough to perform all the required operations and
thus could read or write to memory outside the bounds of the request
buffer.

This commit includes the creation of a new REQUEST_AT_LEAST_EXTRA_SIZE
macro in include/dix.h for the common case of needing to ensure a
request is large enough to include both the request itself and a
minimum amount of extra data following the request header.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-12-08 18:09:48 -08:00
Keith Packard 60014a4a98 Replace 'pointer' type with 'void *'
This lets us stop using the 'pointer' typedef in Xdefs.h as 'pointer'
is used throughout the X server for other things, and having duplicate
names generates compiler warnings.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-12 10:24:11 -08:00
Benjamin Tissoires d511a3016a Add missing labels for multitouch valuators
ABS_MT_DISTANCE exists since kernel v2.6.38,
ABS_MT_TOOL_X|Y appeared in v3.6.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-10-30 15:11:10 +10:00
Alan Coopersmith 9f7ef7f7f0 Fix up formatting of initializers for arrays of structs
The indenter seems to have gotten confused by initializing arrays of
structs with the struct defined inline - for predefined structs it did
a better job, so match that.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-08-06 15:22:53 -07:00
Alan Coopersmith 7328900042 XIChangeDeviceProperty: free newly allocated prop when SetProperty fails
Reported by parfait 1.0:

Error: Memory leak (CWE 401)
   Memory leak of pointer 'prop' allocated with XICreateDeviceProperty(property)
        at line 774 of Xi/xiproperty.c in function 'XIChangeDeviceProperty'.
          'prop' allocated at line 700 with XICreateDeviceProperty(property).
          prop leaks when handler != NULL at line 768
              and handler->SetProperty != NULL at line 769
              and checkonly != 0 at line 772
              and rc != 0 at line 772.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-08-05 08:25:03 +10:00
Alan Coopersmith 9805cedf7b Use C99 designated initializers in extension Events
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Tested-by: Daniel Stone <daniel@fooishbar.org>
2012-07-09 22:52:30 -07:00
Alan Coopersmith 2f5caeaddb Use C99 designated initializers in Xinput Replies
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Tested-by: Daniel Stone <daniel@fooishbar.org>
2012-07-09 19:58:30 -07:00
Alan Coopersmith 789d64e19a Remove unneccesary casts from WriteToClient calls
Casting return to (void) was used to tell lint that you intended
to ignore the return value, so it didn't warn you about it.

Casting the third argument to (char *) was used as the most generic
pointer type in the days before compilers supported C89 (void *)
(except for a couple places it's used for byte-sized pointer math).

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Tested-by: Daniel Stone <daniel@fooishbar.org>
2012-07-09 19:12:56 -07:00
Peter Hutterer ae1c48ebc8 Xi: fix "discards ''const' qualifier" warnings
extinit.c: In function 'XInputExtensionInit':
extinit.c:1301:29: warning: assignment discards 'const' qualifier from
pointer target type [enabled by default]
extinit.c:1303:36: warning: assignment discards 'const' qualifier from
pointer target type [enabled by default]

property.c: In function 'XIChangeDeviceProperty':
xiproperty.c:757:39: warning: cast discards '__attribute__((const))'
qualifier from pointer target type [-Wcast-qual]

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-05-17 08:51:31 +10:00
Keith Packard 9838b7032e Introduce a consistent coding style
This is strictly the application of the script 'x-indent-all.sh'
from util/modular. Compared to the patch that Daniel posted in
January, I've added a few indent flags:

	-bap
	-psl
	-T PrivatePtr
	-T pmWait
	-T _XFUNCPROTOBEGIN
	-T _XFUNCPROTOEND
	-T _X_EXPORT

The typedefs were needed to make the output of sdksyms.sh match the
previous output, otherwise, the code is formatted badly enough that
sdksyms.sh generates incorrect output.

The generated code was compared with the previous version and found to
be essentially identical -- "assert" line numbers and BUILD_TIME were
the only differences found.

The comparison was done with this script:

dir1=$1
dir2=$2

for dir in $dir1 $dir2; do
	(cd $dir && find . -name '*.o' | while read file; do
		dir=`dirname $file`
		base=`basename $file .o`
		dump=$dir/$base.dump
		objdump -d $file > $dump
	done)
done

find $dir1 -name '*.dump' | while read dump; do
	otherdump=`echo $dump | sed "s;$dir1;$dir2;"`
	diff -u $dump $otherdump
done

Signed-off-by: Keith Packard <keithp@keithp.com>
Acked-by: Daniel Stone <daniel@fooishbar.org>
Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-03-21 13:54:42 -07:00
Peter Hutterer ed8f3c4bd1 Xi: change XIChangeDeviceProperty from const pointer to const void *
According to Daniel Kurtz, a typedef void *pointer is a atomic type. So a
'const pointer' is equivalent to 'void* const' instead of the intended
'const void*'.

This technically changes the ABI, but we don't bump it for this.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-01-06 14:04:45 +10:00
Alan Coopersmith 05f589d464 Fix gcc -Wwrite-strings warnings in various extensions
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-23 12:15:07 -08:00
Alan Coopersmith 5f285a30a1 Make XIGetKnownProperty take a const char * argument
Now that MakeAtom takes const char *, so can XIGetKnownProperty.
Clears 71 warnings from gcc -Wwrite-strings of the form:
devices.c:145:5: warning: passing argument 1 of 'XIGetKnownProperty' discards qualifiers from pointer target type
../include/exevents.h:128:23: note: expected 'char *' but argument is of type 'const char *'

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-11-23 12:15:06 -08:00
Daniel Stone 78d8d6dd7f Input: Add vertical and horizontal scroll axes
To be used for smooth scrolling with future driver APIs, replacing
Rel Vert Wheel and Rel Horiz Wheel axes, which have not been used in any
open driver to date.

Combined with double-granularity ValuatorMasks, these axes allow for
fine-grained scroll data to be sent to clients.  Future commits allow
drivers to post these scroll axes to
QueuePointerEvents/GetPointerEvents, which take care of emulating legacy
scroll button events.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2011-09-29 12:26:43 +10:00
Matt Turner 2c7c520cfe Use internal temp variable for swap macros
Also, fix whitespace, mainly around
	swaps(&rep.sequenceNumber)

Reviewed-by: Peter Harris <pharris@opentext.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
2011-09-21 17:12:04 -04:00
Julien Cristau eb8141b6ed Xi: fix length checks for swapped clients
ChangeDeviceProperty and XIChangeProperty are followed by some data, so
use REQUEST_AT_LEAST_SIZE instead of REQUEST_SIZE_MATCH.

X.Org bug#35082 <https://bugs.freedesktop.org/show_bug.cgi?id=35082>

Reported-by: Markus Fleschutz <markus.fleschutz@x-software.com>
Signed-off-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-03-09 07:59:41 +10:00
Peter Hutterer 81daba8ce9 Xi: constify XIChangeDeviceProperty()
We don't modify "value", make it official.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com>
2011-02-14 09:12:58 +10:00
Mikhail Gusarov 7287ef9e6c Remove unnecessary parentheses around return values in functions
This patch was generated by the following Perl code:

perl -i -pe 's/([^_])return\s*\(\s*([^(]+?)\s*\)s*;(\s+(\n))?/$1return $2;$4/g;'

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-10 06:42:42 -07:00
Mikhail Gusarov 0a4d8cbdcd Remove more superfluous if(p) checks around free(p)
This patch has been generated by the following Coccinelle semantic patch:

@@
expression E;
@@

-if(E) { free(E); }
+free(E);

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Fernando Carrijo <fcarrijo@yahoo.com.br>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2010-06-06 20:27:18 +07:00
Peter Korsgaard 6cccf0131c dix: add 3x3 transformation matrix xinput property for multi-head handling
For absolute input devices (E.G. touchscreens) in multi-head setups,
we need a way to bind the device to an randr output. This adds the
infrastructure to the server to allow us to do so.

positionSprite() scales input coordinates to the dimensions of the shared
(total) screen frame buffer, so to restrict motion to an output we need to
scale/rotate/translate device coordinates to a subset of the frame buffer
before passing them on to positionSprite.

This is done here using a 3x3 transformation matrix, which is applied to
the device coordinates using homogeneous coordinates, E.G.:

[ c0 c1 c2 ]   [ x ]
[ c3 c4 c5 ] * [ y ]
[ c6 c7 c8 ]   [ 1 ]

Notice: As input devices have varying input ranges, the coordinates are
first scaled to the [0..1] range for generality, and afterwards scaled
back up.

E.G. for a dual head setup (using same resolution) next to each other, you
would want to scale the X coordinates of the touchscreen connected to the
both heads by 50%, and translate (offset) the coordinates of the rightmost
head by 50%, or in matrix form:

   left:            right:
[ 0.5 0 0 ]     [ 0.5 0 0.5 ]
[ 0   1 0 ]     [ 0   1 0   ]
[ 0   0 1 ]     [ 0   0 0   ]

Which can be done using xinput:

xinput set-prop <left> --type=float "Coordinate Transformation Matrix" \
       0.5 0 0 0 1 0 0 0 1

xinput set-prop <right> --type=float "Coordinate Transformation Matrix" \
       0.5 0 0.5 0 1 0 0 0 1

Likewise more complication setups involving more heads, rotation or
different resolution can be handled.

Signed-off-by: Peter Korsgaard <peter.korsgaard@barco.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-28 16:49:30 +10:00
Mikhail Gusarov 3f3ff971ec Replace X-allocation functions with their C89 counterparts
The only remaining X-functions used in server are XNF*, the rest is converted to
plain alloc/calloc/realloc/free/strdup.

X* functions are still exported from server and x* macros are still defined in
header file, so both ABI and API are not affected by this change.

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-13 00:22:37 +07:00
Peter Hutterer 9802839d35 Xi: reset the known properties at the end of the server generation.
Properties allocated through XIGetKnownProperty() aren't reset on the second
server generation but keep the old value. As a result, wrong Atoms are
supplied to the driver, resulting in potential data corruption or weird
error message.

Reproducible by running "xlsatom | grep FLOAT" twice on a plain X server.
The second X server generation won't have the FLOAT atom defined anymore,
despite the users of this atom not noticing any errors.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-07 12:16:43 -07:00
Benjamin Tissoires a34812b090 Add labels for multitouch valuators
Thoses definitions have been included in the kernel but the X server is not updated accordingly.
Without these definitions, the multitouch axes are not correctly labelled.

Signed-off-by: Benjamin Tissoires <tissoire@cena.fr>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-02-09 10:21:27 +10:00
Peter Hutterer ea14a41821 Xi: reset device properties to NULL after deleting them. (#25374)
Commit 0e6cee853d introduced cleanup code to
remove the accel properties when switching schemes. The same code is
triggered by the default closedown code but only after unconditionally
removing all device properties (as part of the cleanup). The properties,
although deleted never got reset to NULL.

X.Org Bug 25374 <http://bugs.freedesktop.org/show_bug.cgi?id=25374>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Andy Furniss <lists@andyfurniss.entadsl.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2009-12-11 11:37:37 +10:00
Peter Hutterer 1b127ab842 Xi: when deleting all properties, reset property handler to NULL.
Trying to unregister property handlers during the device closure process
leads to invalid memory accesses.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2009-11-25 10:57:07 +10:00
Peter Hutterer a30e739a14 Xi: don't crash when deleting invalid device properties.
Deleting a property that was not set on a device leads to a null-pointer
reference. The protocol allows deleting those properties - it has to be a
noop.

Reproducible:
xinput --set-prop "My device" --type=int --format=8 "my property" 1
xinput --delete-prop "My other device" "my property"

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-11-22 19:42:13 -08:00
Peter Hutterer 903c3db1d1 Xext: rename Xtst* to XTest*
This patch corrects a misnaming of XTest-related functions.

The extension itself announces itself as XTEST. Xtst is the library name
itself, but all library functions are prefixed by XTest. Same with the
naming in the server.

- Rename all *Xtst* functions to *XTest* for consistency with the library
  and in-server API.
- Rename the "Xtst device" property to "XTEST device" for consistency with
  the extension naming.
- Rename the device naming to "<master device name> XTEST device". The
  default xtest devices become "Virtual core XTEST pointer" and "Virtual
  core XTEST keyboard".

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-27 14:24:51 +10:00
Peter Hutterer 7dd415aa6a Xi: use byte-counting macros instead of manual calculation.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-14 10:05:53 +10:00
Peter Hutterer e13605ea40 dix: introduce "Xtst Device" label property.
Xtst devices get this property assigned automatically so they can be
detected easily by a client.
The property is read-only.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-01 08:46:31 +10:00
Eamon Walsh 119b966677 Xi: fix up access modes for calls to dixLookupDevice().
New access modes are being passed to the device access hook for XI2:
DixCreateAccess for creating a new master device;
DixAdd/RemoveAccess for attaching/removing slave devices to a master; and
DixListProp/GetProp/SetPropAccess for device properties.

Refer to the XACE-Spec document in xorg-docs, section "Device Access."

Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
2009-06-23 20:50:29 -04:00
Peter Hutterer 17f9723f48 input: bump to ints for deviceids - XI2 requires 16-bit deviceids.
Note: ABI break, but ABI_XINPUT_VERSION has NOT been bumped. Recompile input
drivers.

Revert "Xi: return BadImplementation for deviceids 256 and above"
This reverts commit 2b459f44f3.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-18 14:40:54 +10:00
Peter Hutterer 2b459f44f3 Xi: return BadImplementation for deviceids 256 and above
The protocol allows for 16 bit device ids, but the implementation doesn't
yet. We need to break the input ABI once more to shift the DeviceIntRec's
CARD8 to a CARD16, along with some changes in the privates.

Once that is done, revert this patch.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-05 16:09:09 +10:00
Peter Hutterer b395da91c5 Xi: silence two compiler warnings
chdevcur.c:97: warning: ‘SecurityLookupIDByType’ is deprecated (declared at
../include/resource.h:269)

xiproperty.c:200: warning: passing argument 2 of ‘GetEventFilter’ from
incompatible pointer type

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-22 15:44:58 +10:00
Peter Hutterer 83f32d3972 Xi: Add XI2 property requests. 2009-05-08 14:33:23 +10:00
Peter Hutterer 9935bec6e8 Xi: split some code out of the XI 1.5 property request processing.
This is in preparation for the XI2 property requests that can re-use much of
this code.
2009-05-08 14:33:23 +10:00
Peter Hutterer f6f1e41706 Xi: fix copy/paste error causing sizeof against wrong struct.
This wrong check may cause BadLength to be returned to the client even if the
length is correct.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-08 14:33:23 +10:00
Peter Hutterer fc0013d744 Xi: don't double-swap the XListDeviceProperties reply.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-08 14:33:23 +10:00
Peter Hutterer 0d9a42dc03 Xi: don't crash on a NULL property name, just return None.
strcmp doesn't like NULL-pointers.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-03-09 14:01:54 +10:00
Peter Hutterer a706dd8771 include: add a range of button labels.
Mostly the same buttons as defined by linux/input.h, with five exceptions:
"Button Unknown" for a button that cannot be labelled.
"Button Wheel Up", "Button Wheel Down" for buttons 4/5, traditionally the
wheel buttons.
"Button Horiz Wheel Up", "Button Horiz Wheel Down" for buttons 6/7,
traditionally the horiz. wheel buttons.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Daniel Stone <daniel@fooishbar.org>
2009-03-03 07:07:30 +10:00
Simon Thum 6bf6a4c47e Xi: create well-known atoms on demand, rather than preinit them
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-03 08:51:11 +10:00
Peter Hutterer 01ffaf6834 Xi: define a range of axis labels.
This is copied from linux/input.h, presumably that's the ones at least the
Linux kernel can give us for any device.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-23 08:09:29 +11:00
Simon Thum 19275ea8e9 dix: add property support for pointer acceleration.
Note: properties don't need to be cleaned up, the DIX does it for us anyway.
Data that is stored in properties is cleaned up by the property system.
Handlers, etc. don't need to be unregistered while cleaning up, as they get
deleted when the device is removed anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
Signed-off-by: Simon Thum <simon.thum@gmx.de>
2009-01-15 09:28:55 +10:00
Peter Hutterer a48c81dcdf Xi: add XATOM_FLOAT to server-defined properties.
This property is used to denote type float for input properties. Such
properties can be accessed easily through the XIPropToFloat() function.

Code originally written by Simon Thum.

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2009-01-12 12:55:27 +10:00
Peter Hutterer 669f6810af Xi: add XIPropToInt() auxiliary function.
Converts an XIPropertyValuePtr to an integer, provided that type and format is
right.

Code originally written by Simon Thum.

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2009-01-12 12:55:27 +10:00