Commit graph

550 commits

Author SHA1 Message Date
Michael Stapelberg
6b832a008a randr: add RandR 1.5 requests and data types
Reviewed-by: Peter Harris <pharris@opentext.com>
2015-08-04 11:11:26 -04:00
Peter Hutterer
755fb33fa5 xinput: align XIChangeProperty data items correctly
Items need to be 4-aligned, see also 055c13096d

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Christian Linhart <chris@demorecorder.com>
2015-07-04 15:54:21 +02:00
Christian Linhart
fef8a4cdc2 fix ABI/API compatibility problem in present
for function xcb_present_redirect_notify_sizeof

removing the explicit length of the list that was added since the
last release with the following changeset:
http://cgit.freedesktop.org/xcb/proto/commit/?id=c9b1523b23af52087a6354730f86b8d19fa3c7c0

Removing the explicit length again is OK because
implicit length is allowed when a list is the last
field of a request or event.

The compile problem that the prior change has tried to fix,
has been fixed in another way. Therefore removing the explicit length
is safe now.

Signed-off-by: Christian Linhart <chris@demorecorder.com>
2015-06-11 17:19:47 +02:00
Olivier Fourdan
f05c1e0ada xprint: Fix build of xprint extension
Generated XCB code based on xprint.xml won't compile because the
arguments do not match now that the accessor functions for requests are
generated in libxcb.

Fix the definition so that the arguments match and the generated C code
for XPrint can compile.

Note, XPrint support has been removed in the X server since 2008, so
this is mostly cosmetic or even pedantic because XPrint is long gone.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Peter Harris <pharris@opentext.com>
Reviewed-by: Christian Linhart <chris@demorecorder.com>
2015-05-31 11:15:27 +02:00
Ran Benita
54152b7a3d xml-xcb.txt: remove description of the "localfield" element
It was removed in:
http://cgit.freedesktop.org/xcb/proto/commit/?id=854d08c8242e8fbe7b5a000b75ec6845419806c4

Signed-off-by: Ran Benita <ran234@gmail.com>
Reviewed-by: Peter Harris <pharris@opentext.com>
Reviewed-by: Christian Linhart <chris@demorecorder.com>
2015-05-30 12:23:34 +02:00
Ran Benita
094eccc4b1 xml-xcb.txt: mention that case/bitcase can have a name
Signed-off-by: Ran Benita <ran234@gmail.com>
Reviewed-by: Christian Linhart <chris@demorecorder.com>
2015-05-30 12:21:34 +02:00
Jaya Tiwari
4c55046593 Remove valueparam support from xcbgen parsers and schema definition
Removed all the valueparam occurences from parsers and xml schema as
well along with all the protocol
definitions as valueparam has been replaced by switch bit-case

Signed-off-by: Jaya Tiwari <tiwari.jaya18@gmail.com>
Reviewed-by: Christian Linhart <chris@demorecorder.com>
2015-02-22 09:48:29 +01:00
Jaya Tiwari
cdea3dbd88 Replace valueparam with switch-bitcase in Screensaver
Changed valueparam to switch bitcase in Screensaver for the request
ScreenSaverSetAttributes

The changes of valueparam to switch has been made as per the specs for
the extension for the possible values of value-mask and value-list

ScreenSaverSetAttributes:
http://cgit.freedesktop.org/xorg/proto/scrnsaverproto/tree/specs/saver.xml#n633
Signed-off-by: Jaya Tiwari <tiwari.jaya18@gmail.com>
Reviewed-by: Christian Linhart <chris@demorecorder.com>
2015-02-22 09:18:05 +01:00
Jaya Tiwari
a3da4e8c60 Replace valueparam with switch-bitcase in Xproto
Hi Chris, Vincent,

Thankyou for the comments.
I have rearranged the pad position in the patch below.

CreateWindow
ChangeWindowAttributes
ConfigureWindow
CreateGC
ChangeGC
ChangeKeyboardControl

The changes of valueparam to switch has been made as per the specs for
the extension for the possible values of value-mask and value-list

CreateWindow:
http://cgit.freedesktop.org/xorg/proto/xproto/tree/specs/encoding.xml#n979

ChangeWindowAttributes:
http://cgit.freedesktop.org/xorg/proto/xproto/tree/specs/encoding.xml#n1006

ConfigureWindow:
http://cgit.freedesktop.org/xorg/proto/xproto/tree/specs/encoding.xml#n1105

CreateGC:
http://cgit.freedesktop.org/xorg/proto/xproto/tree/specs/encoding.xml#n1815

ChangeGC:
http://cgit.freedesktop.org/xorg/proto/xproto/tree/specs/encoding.xml#n1909

ChangeKeyboardControl:
http://cgit.freedesktop.org/xorg/proto/xproto/tree/specs/encoding.xml#n2547

Casted KEYCODE32 as a CARD32 and added BOOL32 here instead of glx due
common to usage in other extensions.

Signed-off-by: Jaya Tiwari <tiwari.jaya18@gmail.com>
Reviewed-by: Christian Linhart <chris@demorecorder.com>
Tested-by: Jaya Tiwari <tiwari.jaya18@gmail.com>
Tested-by: Christian Linhart <chris@demorecorder.com>

Comments by the reviewer Christian Linhart:

This will be API and ABI compatible for the same reasons as
your patch for the Render-extension.

I have checked this against the spec and implementation
and have not found any bugs.

Here are some explanations on how to overcome some difficulties
on reading the spec and the implementation.

The protocol specification is in some way misleading
and self-contradicting, but this can be resolved by
looking at the implementation.

Here are some problems with the spec:
The size of the whole value list is correctly described in
    http://cgit.freedesktop.org/xorg/proto/xproto/tree/specs/encoding.xml?id=xproto-7.0.26
as
    4n     LISTofVALUE                    value-list
i.e. 4 bytes per value, where n is the number of bits set in the mask.

But some of the values themselves are describe incorrectly,
e.g. BITGRAVITY is described as 1 byte value.
This is not correct for two reasons:
* it contradicts LISTofVALUE ( except if implicit padding to 4 byte boundary after each value is assumed )
* even if implicit 4-byte padding is assumed, this contradicts the Xlib implementation in
    http://cgit.freedesktop.org/xorg/lib/libX11/tree/src/Window.c?id=libX11-1.6.2#n55
    where bit_gravity is assigned to an value of type "unsigned long", which is a 32-bit value
    that's then sent verbatim to the server.
    Depending on byte-order this is not the same as a 1-byte BOOL and a 3 byte padding.

 * The server also treats BITGRAVITY as a 32-bit value.
   There, all values from the value list are treated as values of type XID,
    which is also 32 bit.
    The protocol data is cast to an array of XID.
    http://cgit.freedesktop.org/xorg/xserver/tree/dix/dispatch.c?id=xorg-server-1.16.3#n648

    Later, a XID* is first dereferenced and then cast to an 8-bit type ( CARD8 ).
    http://cgit.freedesktop.org/xorg/xserver/tree/dix/window.c?id=xorg-server-1.16.3#n1195
    Please not that it is first dereferenced. Therefore a 32-bit value is retrieved from the given data.
    Only after that it is cast to 8-bit, so that the least-significant 8 bits are taken.
    That's not the same a 1 byte value plus 3 byte padding depending on byteorder.

Maybe the spec should be changed, so that all values of the valuelist are
described as 4 byte?

***

Thank you for writing this testcase.

I have checked this with respect to ABI and API compatibility and the result was the same for me, too.

I.e. this confirms that your patches for xproto are ABI and API compatible. ( as far as a testcase can show correctness of course... )

So, we can add Tested-by: headers with your and my name to your changes for "xproto", when merging them upstream.
Your changes for "render" were tested by Asalle and me, so we can add appropriate Tested-by: headers there, too.
The other changes follow the same pattern and are reviewed, so we probably do not need to test them separately.

Thank you for the testcase and your patches.
2015-02-22 08:46:16 +01:00
Jaya Tiwari
2f60597b5e Replace valueparam with CARD32 bit field in Xprint
Replaced valueparam with a simple 32 bit field for PrintSelectInput
and PrintInputSelected by looking at the
lib code at :
http://cgit.freedesktop.org/xorg/lib/libXp/tree/src/XpInput.c?id=libXp-1.0.2

Signed-off-by: Jaya Tiwari <tiwari.jaya18@gmail.com>
Reviewed-by: Christian Linhart <chris@demorecorder.com>

Review-comments by Christian Linhart:
This patch fixes a bug:
The prior use of valueparam was incorrect, and you have fixed that bug with this patch.

This can be verified by looking at the code which you have linked to.
and by looking at the definitions of the protocol structs:
    For the PrintSelectInput-request:
        http://cgit.freedesktop.org/xorg/proto/printproto/tree/Printstr.h?id=printproto-1.0.5#n439
    For the reply of PrintInputSelected:
        http://cgit.freedesktop.org/xorg/proto/printproto/tree/Printstr.h?id=printproto-1.0.5#n457
2015-02-21 12:02:12 +01:00
Jaya Tiwari
e0a4f7ba91 Replace valueparam with switch-bitcase in render
Changed valueparam to switch bitcase in render extension for the requests :

CreatePicture
ChangePicture

The changes of valueparam to switch has been made as per the specs for
the render extension for the possible
values of value-mask and value-list

CreatePicture :
http://cgit.freedesktop.org/xorg/proto/renderproto/tree/renderproto.txt?id=renderproto-0.11.1#n572

ChangePicture:
http://cgit.freedesktop.org/xorg/proto/renderproto/tree/renderproto.txt?id=renderproto-0.11.1#n668

The backward compatibility for the extension was checked successfully
by rendering shapes with libraries having
valueparam and then by having libraries with switch bitcase.

Signed-off-by: Jaya Tiwari <tiwari.jaya18@gmail.com>
Reviewed-by: Christian Linhart <chris@demorecorder.com>
2015-02-21 11:20:24 +01:00
Christian Linhart
068430a7f9 Merge http://git.demorecorder.com/git/free-sw/xcb/proto
branch demorec/ParametrizedStruct-V5
2015-02-10 10:05:29 +01:00
Peter Harris
3255bac5ca xfixes: cursor-name is after cursor-image in GetCursorImageAndName
The current version of fixesproto.txt has cursor-name before
cursor-image, but all known implementations put cursor-name after
cursor-image on the wire.

Reviewed-by: Christian Linhart <chris@demorecorder.com>
Signed-off-by: Peter Harris <pharris@opentext.com>
2015-02-09 10:49:02 -05:00
Christian Linhart
2eba8fd0c9 xinput: update TODO: remove parametrized structs
Message-ID: <1410136150-30254-5-git-send-email-chris@demorecorder.com>
Patch-Thread-Subject: [Xcb] parametrized structs implemented
Patch-Set: ParametrizedStruct
Patch-Number: proto 5/5
Patch-Version: V1
Signed-off-by: Christian Linhart <chris@DemoRecorder.com>
2014-11-03 11:23:23 +01:00
Christian Linhart
8b244dcf78 xinput: rep GetDeviceMotionEvents: full support
complete definition of reply GetDeviceMotionEvents and struct DeviceTimeCoord
using paramref.

spec:
http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XIproto.txt?id=inputproto-2.3.1#n912
http://cgit.freedesktop.org/xorg/lib/libXi/tree/specs/encoding.xml?id=libXi-1.7.4#n983

code:
http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XIproto.h?id=inputproto-2.3.1#n461

Message-ID: <1410136150-30254-4-git-send-email-chris@demorecorder.com>
Patch-Thread-Subject: [Xcb] parametrized structs implemented
Patch-Set: ParametrizedStruct
Patch-Number: proto 4/5
Patch-Version: V1
Signed-off-by: Christian Linhart <chris@DemoRecorder.com>
2014-11-03 11:23:23 +01:00
Christian Linhart
fffbd04d63 xcb-doc: add paramref
The first paragraph of the description is loosely based on
a description proposed by Ran Benita.

Message-ID: <1410136150-30254-3-git-send-email-chris@demorecorder.com>
Patch-Thread-Subject: [Xcb] parametrized structs implemented
Patch-Set: ParametrizedStruct
Patch-Number: proto 3/5
Patch-Version: V1
Signed-off-by: Christian Linhart <chris@DemoRecorder.com>
2014-11-03 11:23:23 +01:00
Christian Linhart
d8c5e82ab2 schema: add paramref
Message-ID: <1410136150-30254-2-git-send-email-chris@demorecorder.com>
Patch-Thread-Subject: [Xcb] parametrized structs implemented
Patch-Set: ParametrizedStruct
Patch-Number: proto 2/5
Patch-Version: V1
Signed-off-by: Christian Linhart <chris@DemoRecorder.com>
2014-11-03 11:23:23 +01:00
Christian Linhart
4f3678a406 xcbgen: support paramref in the parser
paramref is similar to fieldref, but has a type attribute.

Message-ID: <1410136150-30254-1-git-send-email-chris@demorecorder.com>
Patch-Thread-Subject: [Xcb] parametrized structs implemented
Patch-Set: ParametrizedStruct
Patch-Number: proto 1/5
Patch-Version: V1
Signed-off-by: Christian Linhart <chris@DemoRecorder.com>
2014-11-03 11:23:23 +01:00
Christian Linhart
b98639bbe3 xinput: remove TODO-entry for popcount of a list
Message-ID: <1409845742-38797-8-git-send-email-chris@demorecorder.com>
Patch-Thread-Subject: [Xcb] support popcount of a list and associated xml changes
Patch-Set: PopcountList
Patch-Number: proto 8/8
Patch-Version: V1
Signed-off-by: Christian Linhart <chris@DemoRecorder.com>
2014-11-03 11:23:23 +01:00
Christian Linhart
3d8e9abc80 xinput: RawEvents: support lists axisvalues and axisvalues_raw
Support the lists axisvalues and axisvalues_raw in RawEvents.
These are RawKeyPress, RawButtonPress, RawTouchBegin and their eventcopies.

The length of both lists is determined by the number of bits set in the
list valuator_mask. This is solved in the same way as for event KeyPress.

spec:
http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XI2proto.txt?id=inputproto-2.3.1#n2362

code:
http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XI2proto.h?id=inputproto-2.3.1#n980

Message-ID: <1409845742-38797-7-git-send-email-chris@demorecorder.com>
Patch-Thread-Subject: [Xcb] support popcount of a list and associated xml changes
Patch-Set: PopcountList
Patch-Number: proto 7/8
Patch-Version: V1
Signed-off-by: Christian Linhart <chris@DemoRecorder.com>
2014-11-03 11:23:23 +01:00
Christian Linhart
fd9f1ade96 xinput: ev ButtonPress, TouchBegin: support list axisvalues
These events are identical to KeyPress, so needed to be changed the same way.
( in the spec, these are all listed under DeviceEvent )

spec:
http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XI2proto.txt?id=inputproto-2.3.1#n2214

code:
http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XI2proto.h?id=inputproto-2.3.1#n944

Message-ID: <1409845742-38797-6-git-send-email-chris@demorecorder.com>
Patch-Thread-Subject: [Xcb] support popcount of a list and associated xml changes
Patch-Set: PopcountList
Patch-Number: proto 6/8
Patch-Version: V1
Signed-off-by: Christian Linhart <chris@DemoRecorder.com>
2014-11-03 11:23:23 +01:00
Christian Linhart
d2a80fed90 xinput: ev KeyPress: support list axisvalues
The length of list axisvalues is determined by the number of bits set in the
list valuator_mask.

This is computed using sumof over popcount of the list-elements of valuator_mask.
This uses the new expression type <listelement-ref/> which refers to the current
list-element iterated by sumof.

spec:
http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XI2proto.txt?id=inputproto-2.3.1#n2214

code:
http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XI2proto.h?id=inputproto-2.3.1#n944

Message-ID: <1409845742-38797-5-git-send-email-chris@demorecorder.com>
Patch-Thread-Subject: [Xcb] support popcount of a list and associated xml changes
Patch-Set: PopcountList
Patch-Number: proto 5/8
Patch-Version: V1
Signed-off-by: Christian Linhart <chris@DemoRecorder.com>
2014-11-03 11:23:23 +01:00
Christian Linhart
e0d5a80d9c xcb-schema: add listelement-ref
Message-ID: <1409845742-38797-4-git-send-email-chris@demorecorder.com>
Patch-Thread-Subject: [Xcb] support popcount of a list and associated xml changes
Patch-Set: PopcountList
Patch-Number: proto 4/8
Patch-Version: V1
Signed-off-by: Christian Linhart <chris@DemoRecorder.com>
2014-11-03 11:23:23 +01:00
Christian Linhart
e5bc503a07 doc: new expr element listelement-ref
Message-ID: <1409845742-38797-3-git-send-email-chris@demorecorder.com>
Patch-Thread-Subject: [Xcb] support popcount of a list and associated xml changes
Patch-Set: PopcountList
Patch-Number: proto 3/8
Patch-Version: V1
Signed-off-by: Christian Linhart <chris@DemoRecorder.com>
2014-11-03 11:23:23 +01:00
Christian Linhart
408feddde3 xcbgen: new expr-type listelement-ref
Add parser-support for the new expression-type "listelement-ref"
which represents the current list-element when used inside
a list-iteration expression such as <sumof>.

This patch includes computation of the flag "contains_listelement_ref"
which is set to True when an expression or any of its
subexpressions is a listelement-ref.
(This is needed by the generator)

Message-ID: <1409845742-38797-2-git-send-email-chris@demorecorder.com>
Patch-Thread-Subject: [Xcb] support popcount of a list and associated xml changes
Patch-Set: PopcountList
Patch-Number: proto 2/8
Patch-Version: V1
Signed-off-by: Christian Linhart <chris@DemoRecorder.com>
2014-11-03 11:23:23 +01:00
Christian Linhart
c9b1523b23 present: specify length of RedirectNotify.notifies
The list "notifies" of the event RedirectNotify didn't have
a length.

The missing length has caused uncompilable C-Code with our
event-acessors patch because the length-acessor for that list
has used an undeclared variable for the list-length.

Having a length for that list is good anyways for ease of use.

Since the event doesn't contain a field which specifies the
length of the list, the length is derived from the length
of the event.

spec:
http://cgit.freedesktop.org/xorg/proto/presentproto/tree/presentproto.txt?id=presentproto-1.0#n429
http://cgit.freedesktop.org/xorg/proto/presentproto/tree/presentproto.txt?id=presentproto-1.0#n710

note:
The event definition starting at line 429 lists the relationship between
length of event ( "length" ) and length of list ( "n" )
as 17+2n where as the definition starting at line 710
lists 18+2n. The latter is correct according to my verification.
The spec should be fixed.

Message-ID: <1409845742-38797-1-git-send-email-chris@demorecorder.com>
Patch-Thread-Subject: [Xcb] support popcount of a list and associated xml changes
Patch-Set: PopcountList
Patch-Number: proto 1/8
Patch-Version: V1
Signed-off-by: Christian Linhart <chris@DemoRecorder.com>
2014-11-03 11:23:22 +01:00
Christian Linhart
b92405a2d0 xinput: rep XIGetProperty: replace bitcase with case
Message-ID: <1409820801-43629-10-git-send-email-chris@demorecorder.com>
Patch-Thread-Subject: [Xcb] xinput: xml-fixes possible with new generator features
Patch-Set: XmlFixesNewGenerator
Patch-Number: proto 10/10
Patch-Version: V1
Signed-off-by: Christian Linhart <chris@DemoRecorder.com>
2014-11-03 11:23:22 +01:00
Christian Linhart
b1d0917005 xinput: req XIChangeProperty: replace bitcase with case
Message-ID: <1409820801-43629-9-git-send-email-chris@demorecorder.com>
Patch-Thread-Subject: [Xcb] xinput: xml-fixes possible with new generator features
Patch-Set: XmlFixesNewGenerator
Patch-Number: proto 09/10
Patch-Version: V1
Signed-off-by: Christian Linhart <chris@DemoRecorder.com>
2014-11-03 11:23:22 +01:00
Christian Linhart
2b54d78b66 xinput: rep GetDeviceProperty: replace bitcase with case
Message-ID: <1409820801-43629-8-git-send-email-chris@demorecorder.com>
Patch-Thread-Subject: [Xcb] xinput: xml-fixes possible with new generator features
Patch-Set: XmlFixesNewGenerator
Patch-Number: proto 08/10
Patch-Version: V1
Signed-off-by: Christian Linhart <chris@DemoRecorder.com>
2014-11-03 11:23:22 +01:00
Christian Linhart
e184abaad4 xinput: cleanup the TODO-list
Message-ID: <1409820801-43629-7-git-send-email-chris@demorecorder.com>
Patch-Thread-Subject: [Xcb] xinput: xml-fixes possible with new generator features
Patch-Set: XmlFixesNewGenerator
Patch-Number: proto 07/10
Patch-Version: V1
Signed-off-by: Christian Linhart <chris@DemoRecorder.com>
2014-11-03 11:23:22 +01:00
Christian Linhart
6a5ed4a8c6 xinput: struct DeviceClass: full support
replace uninterpreted_data by switch-case

this is needed by struct XIDeviceInfo which is needed by reply XIQueryDevice.

changes for V2 of this patch:
* remove the pad after "sourceid" because that space is used by the first two bytes defined inside each case of the bit-case.
  ( noticed that problem by testing )

changes for V3 of this patch:
* adapt to removal of patches "proto 6/7 and 7/7" in patchset ListInputDevices:
  adjust linenumbers in the patch accordingly

spec:
http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XI2proto.txt?id=inputproto-2.3.1#n752

Note:
The spec lists TOUCHCLASS.num_touches as a CARD16 but the XI2proto.h header and the xml
use the type CARD8 for it.
Is this a spec bug?

code:
http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XI2.h?id=inputproto-2.3.1#n138
http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XI2proto.h?id=inputproto-2.3.1#n117

Message-ID: <5444E167.8090702@DemoRecorder.com>
Patch-Thread-Subject: [Xcb] xinput: xml-fixes possible with new generator features
Patch-Set: XmlFixesNewGenerator
Patch-Number: proto 06/10
Patch-Version: V3
Signed-off-by: Christian Linhart <chris@DemoRecorder.com>
2014-11-03 11:23:22 +01:00
Christian Linhart
0b86d30be2 xinput: struct HierarchyChange: full support
replace uninterpreted_data by switch-case

this is needed by request XIChangeHierarchy.

spec:
http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XI2proto.txt?id=inputproto-2.3.1#n1170

code:
http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XI2.h?id=inputproto-2.3.1#n118
http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XI2proto.h?id=inputproto-2.3.1#n444

Message-ID: <1409820801-43629-5-git-send-email-chris@demorecorder.com>
Patch-Thread-Subject: [Xcb] xinput: xml-fixes possible with new generator features
Patch-Set: XmlFixesNewGenerator
Patch-Number: proto 05/10
Patch-Version: V1
Signed-off-by: Christian Linhart <chris@DemoRecorder.com>
2014-11-03 11:23:22 +01:00
Christian Linhart
186d877b00 xinput: struct DeviceCtl: full support
replace uninterpreted_data by switch-case

this is needed by request ChangeDeviceControl.

spec:
http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XIproto.txt?id=inputproto-2.3.1#n688
http://cgit.freedesktop.org/xorg/lib/libXi/tree/specs/encoding.xml?id=libXi-1.7.4#n1907

Note: Only the DeviceCtl of type DeviceResolution is defined in both specs.
( this is struct name="DeviceResolutionCtl" in the xml. )
The other DeviceCtls are not defined in any of the specs.

code:
http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XI.h?id=inputproto-2.3.1#n170
http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XIproto.h?id=inputproto-2.3.1#n1343

Message-ID: <1409820801-43629-4-git-send-email-chris@demorecorder.com>
Patch-Thread-Subject: [Xcb] xinput: xml-fixes possible with new generator features
Patch-Set: XmlFixesNewGenerator
Patch-Number: proto 04/10
Patch-Version: V1
Signed-off-by: Christian Linhart <chris@DemoRecorder.com>
2014-11-03 11:23:22 +01:00
Christian Linhart
acced13ba0 xinput: struct DeviceState: full support
replace uninterpreted_data by switch-case

this is needed by reply GetDeviceControl.

spec:
http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XIproto.txt?id=inputproto-2.3.1#n640
http://cgit.freedesktop.org/xorg/lib/libXi/tree/specs/encoding.xml?id=libXi-1.7.4#n1856

Note: Only the DeviceControl of type DeviceResolution is defined in both specs.
( this is struct name="DeviceResolutionState" in the xml. )
The other DeviceControls are not defined in any of the specs.

code:
http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XI.h?id=inputproto-2.3.1#n170
http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XIproto.h?id=inputproto-2.3.1#n1263

Message-ID: <1409820801-43629-3-git-send-email-chris@demorecorder.com>
Patch-Thread-Subject: [Xcb] xinput: xml-fixes possible with new generator features
Patch-Set: XmlFixesNewGenerator
Patch-Number: proto 03/10
Patch-Version: V1
Signed-off-by: Christian Linhart <chris@DemoRecorder.com>
2014-11-03 11:23:22 +01:00
Christian Linhart
2dee213bbf xinput: struct FeedbackCtl: full support
replace uninterpreted_data by switch-case

this is needed by request ChangeFeedbackControl.

spec:
http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XIproto.txt?id=inputproto-2.3.1#n1719
http://cgit.freedesktop.org/xorg/lib/libXi/tree/specs/encoding.xml?id=libXi-1.7.4#n1445

code:
http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XI.h?id=inputproto-2.3.1#n244
http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XIproto.h?id=inputproto-2.3.1#n862

Message-ID: <1409820801-43629-2-git-send-email-chris@demorecorder.com>
Patch-Thread-Subject: [Xcb] xinput: xml-fixes possible with new generator features
Patch-Set: XmlFixesNewGenerator
Patch-Number: proto 02/10
Patch-Version: V1
Signed-off-by: Christian Linhart <chris@DemoRecorder.com>
2014-11-03 11:23:22 +01:00
Christian Linhart
022cec314e xinput: struct FeedbackState: full support
replace uninterpreted_data by switch-case

this is needed by reply GetFeedbackControl.

spec:
http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XIproto.txt?id=inputproto-2.3.1#n1613
http://cgit.freedesktop.org/xorg/lib/libXi/tree/specs/encoding.xml?id=libXi-1.7.4#n1341

code:
http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XI.h?id=inputproto-2.3.1#n244
http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XIproto.h?id=inputproto-2.3.1#n754

Message-ID: <1409820801-43629-1-git-send-email-chris@demorecorder.com>
Patch-Thread-Subject: [Xcb] xinput: xml-fixes possible with new generator features
Patch-Set: XmlFixesNewGenerator
Patch-Number: proto 01/10
Patch-Version: V1
Signed-off-by: Christian Linhart <chris@DemoRecorder.com>
2014-11-03 11:23:22 +01:00
Christian Linhart
a46b477830 xinput: remove TODO-entry for sumof and ListInputDevices
Note: patches 6 and 7 of this patchset were removed during the review process.

Signed-off-by: Christian Linhart <chris@demorecorder.com>
Reviewed-by: Ran Benita <ran234@gmail.com>

Message-ID: <545627EF.8020708@DemoRecorder.com>
Patch-Thread-Subject: [Xcb] [PATCHSET] ListInputDevices revision 2
Patch-Set: ListInputDevices
Patch-Number: proto 8/8
Patch-Version: V1
2014-11-03 11:23:22 +01:00
Christian Linhart
0d5a061ef2 xinput: ListInputDevices: full support
* define struct InputInfo with switch-case
* define the lists "infos" and "names"
* the list "infos" requires a new xml-construct:
  <sumof> with a nested expression, to access fields
  of the list which is iterated by sumof.

spec:
http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XIproto.txt?id=inputproto-2.3.1#n305
http://cgit.freedesktop.org/xorg/lib/libXi/tree/specs/encoding.xml?id=libXi-1.7.4#n715

code:
http://cgit.freedesktop.org/xorg/lib/libXi/tree/src/XListDev.c?id=libXi-1.7.4

Both specs are misleading ( or buggy ) in the following aspect:

In both specs, struct Deviceinfo is defined to contain a list
of InputInfo and a list of STR.

But, by analyzing the code in libXi, it was clear that
* InputInfo is contained in an extra toplevel list
  in the reply ListInputDevices
* the strings ( struct xproto:STR ) are also contained in a toplevel list
  in the reply

Signed-off-by: Christian Linhart <chris@demorecorder.com>
Reviewed-by: Ran Benita <ran234@gmail.com>

Message-ID: <545627EA.8010408@DemoRecorder.com>
Patch-Thread-Subject: [Xcb] [PATCHSET] ListInputDevices revision 2
Patch-Set: ListInputDevices
Patch-Number: proto 5/8
Patch-Version: V1
2014-11-03 11:23:22 +01:00
Christian Linhart
8c5c89f9f6 xcbgen: sumof with nested expression
Add parser support for sumof with a nested expression.
For example:
	<sumof ref="mylist1">
		<fieldref>bar</fieldref>
	</sumof>

The nested expression is added as the "rhs"-field of the
expression.object.

Signed-off-by: Christian Linhart <chris@demorecorder.com>
Reviewed-by: Ran Benita <ran234@gmail.com>

Message-ID: <545627E1.8070302@DemoRecorder.com>
Patch-Thread-Subject: [Xcb] [PATCHSET] ListInputDevices revision 2
Patch-Set: ListInputDevices
Patch-Number: proto 4/8
Patch-Version: V1
2014-11-03 11:23:22 +01:00
Christian Linhart
c057c4336f schema: add rule for sumof with nested expression
Signed-off-by: Christian Linhart <chris@demorecorder.com>
Reviewed-by: Ran Benita <ran234@gmail.com>

Message-ID: <545627DB.5090101@DemoRecorder.com>
Patch-Thread-Subject: [Xcb] [PATCHSET] ListInputDevices revision 2
Patch-Set: ListInputDevices
Patch-Number: proto 3/8
Patch-Version: V1
2014-11-03 11:23:22 +01:00
Christian Linhart
afdfe20848 xml-doc: add sumof with nested expression
Signed-off-by: Christian Linhart <chris@demorecorder.com>
Reviewed-by: Ran Benita <ran234@gmail.com>

Message-ID: <545627D5.4010008@DemoRecorder.com>
Patch-Thread-Subject: [Xcb] [PATCHSET] ListInputDevices revision 2
Patch-Set: ListInputDevices
Patch-Number: proto 2/8
Patch-Version: V1
2014-11-03 11:23:22 +01:00
Christian Linhart
88f9def934 xcbgen: fields get a parent reference
Objects of type Field get a reference to their parent.
This is needed in the generator to differentiate
field handling dependend on properties of their parent.

Signed-off-by: Christian Linhart <chris@demorecorder.com>
Reviewed-by: Ran Benita <ran234@gmail.com>

Message-ID: <545627CB.1000606@DemoRecorder.com>
Patch-Thread-Subject: [Xcb] [PATCHSET] ListInputDevices revision 2
Patch-Set: ListInputDevices
Patch-Number: proto 1/8
Patch-Version: V1
2014-11-03 11:23:22 +01:00
Christian Linhart
691d2b97e5 xinput: rep QueryDeviceState struct InputState: full support
Full support for the QueryDeviceState reply.
This has been done by changing the struct InputState
with using switch-case and implicit-padding="false".

Also fixed the type of field valuators of struct ValuatorState
from CARD32 to INT32.

V2: patch revised:
* removed the implicit-padding="false" attribute, according
  to the discussion in this thread.
* give names to the cases, which generates more beautiful code.

spec:
http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XIproto.txt?id=inputproto-2.3.1#n2082
http://cgit.freedesktop.org/xorg/lib/libXi/tree/specs/encoding.xml?id=libXi-1.7.4#n1728

Message-ID: <5400B9F6.5000208@DemoRecorder.com>
Patch-Thread-Subject: [Xcb] xinput:QueryDeviceState: full-support: generator and xml-changes
Patch-Set: QueryDeviceState
Patch-Number: proto 2/2
Patch-Version: V2
Signed-off-by: Christian Linhart <chris@DemoRecorder.com>
Reviewed-By: Ran Benita <ran234@gmail.com>
2014-09-09 23:54:45 +02:00
Christian Linhart
dc0c544fe0 schema: add switch-case
Reviewed-by: Peter Harris <pharris@opentext.com>
Reviewed-by: Ran Benita <ran234@gmail.com>
2014-08-25 19:42:02 -04:00
Christian Linhart
754c737875 xinput: req ChangeDeviceProperty: bitcase to case
Change the bitcases to cases
and remove the comment which says that bitcases should converted to cases.

Reviewed-by: Peter Harris <pharris@opentext.com>
Reviewed-by: Ran Benita <ran234@gmail.com>
2014-08-25 19:41:42 -04:00
Christian Linhart
127d34ac4f xcbgen-parser: support switch-case
"case" is implemented as a variation of "bitcase" as follows:

The old class "BitCaseType" became the abstract class
"CaseOrBitcaseType" with two derived classes
"CaseType" and "BitcaseType".
(Therefore BitcaseType keeps the old semantic which may
be important for some generators)

There are two additional flags in class Type:
* is_case
* is_case_or_bitcase
The latter is for convenience because case and bitcase
have to be treated the same way in many cases.

The list of cases and bitcases in a SwitchType object
is still called "bitcases".
Reasons:
* Renaming that list would break generators based on the parser.
* Creating an extra list for cases would make other code more
  complicated because you usually want to iterate over all
  case and bitcase members of a switch.

Reviewed-by: Ran Benita <ran234@gmail.com>
2014-08-25 19:39:31 -04:00
Christian Linhart
4987a5c6bc xml-xcb spec: describe switch-case
V2: patch revised according to suggestion from Peter Harris:
* add the restriction that <enumref>
  inside <bitcase> can only refer to an enum's <bit> members, and
  <enumref> inside <case> can only refer to an enum's <value> members.

Reviewed-by: Peter Harris <pharris@opentext.com>
Reviewed-by: Ran Benita <ran234@gmail.com>
2014-08-25 19:38:35 -04:00
Peter Harris
80a79d466d Merge http://infra-srv1.demorecorder.com/git/free-sw/xcb/proto
See the mailing list for Reviewed-bys.

Thread root is
http://lists.freedesktop.org/archives/xcb/2014-August/009632.html
2014-08-25 19:34:30 -04:00
Ran Benita
88415e6399 Add "altmask" attribute, like "altenum" for masks
"altmask" means the field is principally a bitmask of bits from the
enum, but in some cases can obtain other values (e.g. "out-of-band" data
in a free bit).

Several fields in xinput will benefit from this extra metadata.

Suggested-by: Peter Harris <pharris@opentext.com>
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: Peter Harris <pharris@opentext.com>
2014-08-25 19:28:59 -04:00
Christian Linhart
7d8c990d6a xinput: add TODO list
Add TODO list of things which cannot be done yet
with the current feature-set of xml and the generator.

V2: Fix reference in the parametrized struct-paragraph:
to correctly refer to the GetDeviceMotionEvents-reply
(instead of the ChangeKeyboardDevice-request which
does not need parametrized structs.)
2014-08-25 13:42:56 +02:00