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>
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>
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>
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>
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>
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.
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>
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>
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>
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>
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>
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>
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>
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>
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>
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#n429http://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>
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>
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>
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>
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>
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#n138http://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>
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
* 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#n305http://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
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
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
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#n2082http://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>
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>
"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>
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>
"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>
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.)