[Xcb] [PULL proto 1/1] Replace valueparam with switch-bitcase in Xproto
Christian Linhart
chris at DemoRecorder.com
Sun Feb 22 00:09:02 PST 2015
Hi Jaya,
I have merged your patch to upstream:
http://cgit.freedesktop.org/xcb/proto/commit/?id=a3da4e8c60b5f6d2d3901f541561ead0adcad4b0
Thank you for your patch.
@all: This patch affects pretty central code such as Window-creation.
I'd appreciate to get feedback from additional testing (or using this code)
before making an official release.
Regards,
Chris
On 02/22/15 08:39, Christian Linhart wrote:
> Hi Jaya,
>
> Thank your fixing the padding issue.
>
> Your patch looks good, therefore:
> Reviewed-by: Christian Linhart <chris at demorecorder.com>
>
> Regards,
>
> Chris
>
> P.S.: Your patch didn't apply out of the box due to whitespace and line-wrapping issues.
> I guess this is because you have sent your patch in an HTML-email.
> Please make sure to send patches in text-only emails to avoid these problems in the future.
>
>
> On 01/27/15 16:29, Jaya Tiwari wrote:
>> 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 at gmail.com <mailto:tiwari.jaya18 at gmail.com>>
>>
>> ---
>> src/xproto.xml | 414 ++++++++++++++++++++++++++++++++++++++++++++++++++++++---
>> 1 file changed, 395 insertions(+), 19 deletions(-)
>>
>> diff --git a/src/xproto.xml b/src/xproto.xml
>> index bfb8a4c..db2e5a9 100644
>> --- a/src/xproto.xml
>> +++ b/src/xproto.xml
>> @@ -57,6 +57,7 @@ authorization from the authors.
>> <type>GCONTEXT</type>
>> </xidunion>
>>
>> + <typedef oldname="CARD32" newname="BOOL32" />
>> <typedef oldname="CARD32" newname="VISUALID" />
>>
>> <typedef oldname="CARD32" newname="TIMESTAMP" />
>> @@ -64,6 +65,8 @@ authorization from the authors.
>> <typedef oldname="CARD32" newname="KEYSYM" />
>>
>> <typedef oldname="CARD8" newname="KEYCODE" />
>> +
>> + <typedef oldname="CARD32" newname="KEYCODE32" />
>>
>> <typedef oldname="CARD8" newname="BUTTON" />
>>
>> @@ -1293,9 +1296,71 @@ parent's cursor will cause an immediate change in the displayed cursor.
>> <field type="CARD16" name="border_width" />
>> <field type="CARD16" name="class" enum="WindowClass" />
>> <field type="VISUALID" name="visual" />
>> - <valueparam value-mask-type="CARD32"
>> - value-mask-name="value_mask"
>> - value-list-name="value_list" />
>> + <field type="CARD32" name="value_mask" mask="CW" />
>> + <switch name="value_list">
>> + <fieldref>value_mask</fieldref>
>> + <bitcase>
>> + <enumref ref="CW">BackPixmap</enumref>
>> + <field type="PIXMAP" name="background_pixmap" altenum="BackPixmap"/>
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="CW">BackPixel</enumref>
>> + <field type="CARD32" name="background_pixel" />
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="CW">BorderPixmap</enumref>
>> + <field type="PIXMAP" name="border_pixmap" altenum="Pixmap"/>
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="CW">BorderPixel</enumref>
>> + <field type="CARD32" name="border_pixel" />
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="CW">BitGravity</enumref>
>> + <field type="CARD32" name="bit_gravity" enum="Gravity"/>
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="CW">WinGravity</enumref>
>> + <field type="CARD32" name="win_gravity" enum="Gravity"/>
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="CW">BackingStore</enumref>
>> + <field type="CARD32" name="backing_store" enum="BackingStore"/>
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="CW">BackingPlanes</enumref>
>> + <field type="CARD32" name="backing_planes" />
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="CW">BackingPixel</enumref>
>> + <field type="CARD32" name="backing_pixel" />
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="CW">OverrideRedirect</enumref>
>> + <field type="BOOL32" name="override_redirect" />
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="CW">SaveUnder</enumref>
>> + <field type="BOOL32" name="save_under" />
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="CW">EventMask</enumref>
>> + <field type="CARD32" name="event_mask" mask="EventMask"/>
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="CW">DontPropagate</enumref>
>> + <field type="CARD32" name="do_not_propogate_mask" mask="EventMask"/>
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="CW">Colormap</enumref>
>> + <field type="COLORMAP" name="colormap" altenum="Colormap"/>
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="CW">Cursor</enumref>
>> + <field type="CURSOR" name="cursor" altenum="Cursor"/>
>> + </bitcase>
>> + </switch>
>> +
>> <doc>
>> <brief>Creates a window</brief>
>> <description><![CDATA[
>> @@ -1374,9 +1439,71 @@ The X server could not allocate the requested resources (no memory?).
>> <request name="ChangeWindowAttributes" opcode="2">
>> <pad bytes="1" />
>> <field type="WINDOW" name="window" />
>> - <valueparam value-mask-type="CARD32"
>> - value-mask-name="value_mask"
>> - value-list-name="value_list" />
>> + <field type="CARD32" name="value_mask" mask="CW" />
>> + <switch name="value_list">
>> + <fieldref>value_mask</fieldref>
>> + <bitcase>
>> + <enumref ref="CW">BackPixmap</enumref>
>> + <field type="PIXMAP" name="background_pixmap" altenum="BackPixmap"/>
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="CW">BackPixel</enumref>
>> + <field type="CARD32" name="background_pixel" />
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="CW">BorderPixmap</enumref>
>> + <field type="PIXMAP" name="border_pixmap" altenum="Pixmap"/>
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="CW">BorderPixel</enumref>
>> + <field type="CARD32" name="border_pixel" />
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="CW">BitGravity</enumref>
>> + <field type="CARD32" name="bit_gravity" enum="Gravity"/>
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="CW">WinGravity</enumref>
>> + <field type="CARD32" name="win_gravity" enum="Gravity"/>
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="CW">BackingStore</enumref>
>> + <field type="CARD32" name="backing_store" enum="BackingStore"/>
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="CW">BackingPlanes</enumref>
>> + <field type="CARD32" name="backing_planes" />
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="CW">BackingPixel</enumref>
>> + <field type="CARD32" name="backing_pixel" />
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="CW">OverrideRedirect</enumref>
>> + <field type="BOOL32" name="override_redirect" />
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="CW">SaveUnder</enumref>
>> + <field type="BOOL32" name="save_under" />
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="CW">EventMask</enumref>
>> + <field type="CARD32" name="event_mask" mask="EventMask"/>
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="CW">DontPropagate</enumref>
>> + <field type="CARD32" name="do_not_propogate_mask" mask="EventMask"/>
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="CW">Colormap</enumref>
>> + <field type="COLORMAP" name="colormap" altenum="Colormap"/>
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="CW">Cursor</enumref>
>> + <field type="CURSOR" name="cursor" altenum="Cursor"/>
>> + </bitcase>
>> + </switch>
>> +
>> <doc>
>> <brief>change window attributes</brief>
>> <description><![CDATA[
>> @@ -1689,11 +1816,40 @@ The specified window does not exist.
>> <request name="ConfigureWindow" opcode="12">
>> <pad bytes="1" />
>> <field type="WINDOW" name="window" />
>> - <field type="CARD16" name="value_mask" />
>> + <field type="CARD16" name="value_mask" mask="ConfigWindow" />
>> <pad bytes="2" />
>> - <valueparam value-mask-type="CARD16"
>> - value-mask-name="value_mask"
>> - value-list-name="value_list" />
>> + <switch name="value_list">
>> + <fieldref>value_mask</fieldref>
>> + <bitcase>
>> + <enumref ref="ConfigWindow">X</enumref>
>> + <field type="INT32" name="x" />
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="ConfigWindow">Y</enumref>
>> + <field type="INT32" name="y" />
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="ConfigWindow">Width</enumref>
>> + <field type="CARD32" name="width" />
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="ConfigWindow">Height</enumref>
>> + <field type="CARD32" name="height" />
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="ConfigWindow">BorderWidth</enumref>
>> + <field type="CARD32" name="border_width" />
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="ConfigWindow">Sibling</enumref>
>> + <field type="WINDOW" name="sibling" altenum="Window"/>
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="ConfigWindow">StackMode</enumref>
>> + <field type="CARD32" name="stack_mode" enum="StackMode"/>
>> + </bitcase>
>> + </switch>
>> +
>> <doc>
>> <brief>Configures window attributes</brief>
>> <description><![CDATA[
>> @@ -3883,9 +4039,102 @@ TODO
>> <pad bytes="1" />
>> <field type="GCONTEXT" name="cid" />
>> <field type="DRAWABLE" name="drawable" />
>> - <valueparam value-mask-type="CARD32"
>> - value-mask-name="value_mask"
>> - value-list-name="value_list" />
>> + <field type="CARD32" name="value_mask" mask="GC" />
>> + <switch name="value_list">
>> + <fieldref>value_mask</fieldref>
>> + <bitcase>
>> + <enumref ref="GC">Function</enumref>
>> + <field type="CARD32" name="function" enum="GX"/>
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="GC">PlaneMask</enumref>
>> + <field type="CARD32" name="plane_mask" />
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="GC">Foreground</enumref>
>> + <field type="CARD32" name="foreground" />
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="GC">Background</enumref>
>> + <field type="CARD32" name="background" />
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="GC">LineWidth</enumref>
>> + <field type="CARD32" name="line_width" />
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="GC">LineStyle</enumref>
>> + <field type="CARD32" name="line_style" enum="LineStyle"/>
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="GC">CapStyle</enumref>
>> + <field type="CARD32" name="cap_style" enum="CapStyle"/>
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="GC">JoinStyle</enumref>
>> + <field type="CARD32" name="join_style" enum="JoinStyle"/>
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="GC">FillStyle</enumref>
>> + <field type="CARD32" name="fill_style" enum="FillStyle"/>
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="GC">FillRule</enumref>
>> + <field type="CARD32" name="fill_rule" enum="FillRule"/>
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="GC">Tile</enumref>
>> + <field type="PIXMAP" name="tile" altenum="Pixmap"/>
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="GC">Stipple</enumref>
>> + <field type="PIXMAP" name="stipple" altenum="Pixmap"/>
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="GC">TileStippleOriginX</enumref>
>> + <field type="INT32" name="tile_stipple_x_origin" />
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="GC">TileStippleOriginY</enumref>
>> + <field type="INT32" name="tile_stipple_y_origin" />
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="GC">Font</enumref>
>> + <field type="FONT" name="font" altenum="Font"/>
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="GC">SubwindowMode</enumref>
>> + <field type="CARD32" name="subwindow_mode" enum="SubwindowMode"/>
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="GC">GraphicsExposures</enumref>
>> + <field type="BOOL32" name="graphics_exposures" />
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="GC">ClipOriginX</enumref>
>> + <field type="INT32" name="clip_x_origin" />
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="GC">ClipOriginY</enumref>
>> + <field type="INT32" name="clip_y_origin" />
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="GC">ClipMask</enumref>
>> + <field type="PIXMAP" name="clip_mask" altenum="Pixmap"/>
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="GC">DashOffset</enumref>
>> + <field type="CARD32" name="dash_offset" />
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="GC">DashList</enumref>
>> + <field type="CARD32" name="dashes" />
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="GC">ArcMode</enumref>
>> + <field type="CARD32" name="arc_mode" enum="ArcMode"/>
>> + </bitcase>
>> + </switch>
>> <doc>
>> <brief>Creates a graphics context</brief>
>> <description><![CDATA[
>> @@ -3924,9 +4173,102 @@ The X server could not allocate the requested resources (no memory?).
>> <request name="ChangeGC" opcode="56">
>> <pad bytes="1" />
>> <field type="GCONTEXT" name="gc" />
>> - <valueparam value-mask-type="CARD32"
>> - value-mask-name="value_mask"
>> - value-list-name="value_list" />
>> + <field type="CARD32" name="value_mask" mask="GC" />
>> + <switch name="value_list">
>> + <fieldref>value_mask</fieldref>
>> + <bitcase>
>> + <enumref ref="GC">Function</enumref>
>> + <field type="CARD32" name="function" enum="GX"/>
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="GC">PlaneMask</enumref>
>> + <field type="CARD32" name="plane_mask" />
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="GC">Foreground</enumref>
>> + <field type="CARD32" name="foreground" />
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="GC">Background</enumref>
>> + <field type="CARD32" name="background" />
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="GC">LineWidth</enumref>
>> + <field type="CARD32" name="line_width" />
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="GC">LineStyle</enumref>
>> + <field type="CARD32" name="line_style" enum="LineStyle"/>
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="GC">CapStyle</enumref>
>> + <field type="CARD32" name="cap_style" enum="CapStyle"/>
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="GC">JoinStyle</enumref>
>> + <field type="CARD32" name="join_style" enum="JoinStyle"/>
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="GC">FillStyle</enumref>
>> + <field type="CARD32" name="fill_style" enum="FillStyle"/>
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="GC">FillRule</enumref>
>> + <field type="CARD32" name="fill_rule" enum="FillRule"/>
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="GC">Tile</enumref>
>> + <field type="PIXMAP" name="tile" altenum="Pixmap"/>
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="GC">Stipple</enumref>
>> + <field type="PIXMAP" name="stipple" altenum="Pixmap"/>
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="GC">TileStippleOriginX</enumref>
>> + <field type="INT32" name="tile_stipple_x_origin" />
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="GC">TileStippleOriginY</enumref>
>> + <field type="INT32" name="tile_stipple_y_origin" />
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="GC">Font</enumref>
>> + <field type="FONT" name="font" altenum="Font"/>
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="GC">SubwindowMode</enumref>
>> + <field type="CARD32" name="subwindow_mode" enum="SubwindowMode"/>
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="GC">GraphicsExposures</enumref>
>> + <field type="BOOL32" name="graphics_exposures" />
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="GC">ClipOriginX</enumref>
>> + <field type="INT32" name="clip_x_origin" />
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="GC">ClipOriginY</enumref>
>> + <field type="INT32" name="clip_y_origin" />
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="GC">ClipMask</enumref>
>> + <field type="PIXMAP" name="clip_mask" altenum="Pixmap"/>
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="GC">DashOffset</enumref>
>> + <field type="CARD32" name="dash_offset" />
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="GC">DashList</enumref>
>> + <field type="CARD32" name="dashes" />
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="GC">ArcMode</enumref>
>> + <field type="CARD32" name="arc_mode" enum="ArcMode"/>
>> + </bitcase>
>> + </switch>
>> <doc>
>> <brief>change graphics context components</brief>
>> <description><![CDATA[
>> @@ -4982,9 +5324,43 @@ sensitive!
>>
>> <request name="ChangeKeyboardControl" opcode="102">
>> <pad bytes="1" />
>> - <valueparam value-mask-type="CARD32"
>> - value-mask-name="value_mask"
>> - value-list-name="value_list" />
>> + <field type="CARD32" name="value_mask" mask="KB" />
>> + <switch name="value_list">
>> + <fieldref>value_mask</fieldref>
>> + <bitcase>
>> + <enumref ref="KB">KeyClickPercent</enumref>
>> + <field type="INT32" name="key_click_percent" />
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="KB">BellPercent</enumref>
>> + <field type="INT32" name="bell_percent" />
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="KB">BellPitch</enumref>
>> + <field type="INT32" name="bell_pitch" />
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="KB">BellDuration</enumref>
>> + <field type="INT32" name="bell_duration" />
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="KB">Led</enumref>
>> + <field type="CARD32" name="led" />
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="KB">LedMode</enumref>
>> + <field type="CARD32" name="led_mode" enum="LedMode"/>
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="KB">Key</enumref>
>> + <field type="KEYCODE32" name="key" />
>> + </bitcase>
>> + <bitcase>
>> + <enumref ref="KB">AutoRepeatMode</enumref>
>> + <field type="CARD32" name="auto_repeat_mode" enum="AutoRepeatMode"/>
>> + </bitcase>
>> + </switch>
>> +
>> </request>
>>
>> <request name="GetKeyboardControl" opcode="103">
>> --
>> 2.1.3
>>
>> Regards,
>> Jaya
>>
>> On Fri, Jan 16, 2015 at 6:41 AM, Christian Linhart <chris at demorecorder.com <mailto:chris at demorecorder.com>> wrote:
>>
>> Hi Vincent,
>>
>> Thank you very much for spotting this.
>>
>> In fact, the 2 byte pad is still there but at the wrong position.
>> Therefore it needs to be removed from the wrong position.
>> I have added my comment below.
>>
>> @Jaya: Can you please make a corrected patch?
>>
>> Thanks,
>>
>> Chris
>>
>> P.S.: there is a protocol spec that is clearer than the one you have cited:
>> http://cgit.freedesktop.org/xorg/proto/xproto/tree/specs/encoding.xml#n1105
>>
>>
>> On 01/16/15 11:31, Vincent Chen wrote:
>> > Hi,
>> >
>> > I think there might be an error with the specification of
>> > ConfigureWindow. According to:
>> >
>> > http://www.x.org/releases/X11R7.7/doc/xproto/x11protocol.html#requests:ConfigureWindow
>> >
>> > there should be a two-byte padding between the mask and the values.
>> > The old valueparam with mask type of CARD16 (as opposed to the usual
>> > CARD32) did not make this need for extra padding explicit. With the
>> > new switch bitcase, however, the extra padding should be manually
>> > inserted.
>> >
>> > On Mon, Dec 22, 2014 at 10:35 AM, Jaya Tiwari <tiwari.jaya18 at gmail.com <mailto:tiwari.jaya18 at gmail.com>> wrote:
>> >> @@ -1689,11 +1816,40 @@ <enum name="StackMode">
>> >> <request name="ConfigureWindow" opcode="12">
>> >> <pad bytes="1" />
>> >> <field type="WINDOW" name="window" />
>> >> - <field type="CARD16" name="value_mask" />
>> >> <pad bytes="2" />
>> This pad needs to be removed.
>> >> - <valueparam value-mask-type="CARD16"
>> >> - value-mask-name="value_mask"
>> >> - value-list-name="value_list" />
>> >> + <field type="CARD16" name="value_mask" mask="ConfigWindow" />
>> > Should add padding here:
>> >
>> > <pad bytes="2" />
>> Yes.
>> >
>> >> + <switch name="value_list">
>> >> + <fieldref>value_mask</fieldref>
>> >> + <bitcase>
>> >> + <enumref ref="ConfigWindow">X</enumref>
>> >> + <field type="INT32" name="x" />
>> >> + </bitcase>
>> >> + <bitcase>
>> >> + <enumref ref="ConfigWindow">Y</enumref>
>> >> + <field type="INT32" name="y" />
>> >> + </bitcase>
>> >> + <bitcase>
>> >> + <enumref ref="ConfigWindow">Width</enumref>
>> >> + <field type="CARD32" name="width" />
>> >> + </bitcase>
>> >> + <bitcase>
>> >> + <enumref ref="ConfigWindow">Height</enumref>
>> >> + <field type="CARD32" name="height" />
>> >> + </bitcase>
>> >> + <bitcase>
>> >> + <enumref ref="ConfigWindow">BorderWidth</enumref>
>> >> + <field type="CARD32" name="border_width" />
>> >> + </bitcase>
>> >> + <bitcase>
>> >> + <enumref ref="ConfigWindow">Sibling</enumref>
>> >> + <field type="WINDOW" name="sibling" altenum="Window"/>
>> >> + </bitcase>
>> >> + <bitcase>
>> >> + <enumref ref="ConfigWindow">StackMode</enumref>
>> >> + <field type="CARD32" name="stack_mode" enum="StackMode"/>
>> >> + </bitcase>
>> >> + </switch>
>> >> +
>> >> <doc>
>> >> <brief>Configures window attributes</brief>
>> >> <description><![CDATA[
>> > By the way, ConfigureWindow is the only place (that I know of) where
>> > the mask type is CARD16. Every other uses of valueparam uses mask type
>> > of CARD32. Not sure why the protocol designer didn't just make this
>> > CARD32 as well, since the mask plus the two padding uses up 4 bytes
>> > anyway...
>> >
>> > Regards,
>> >
>> > Vincent Chen
>> > _______________________________________________
>> > Xcb mailing list
>> > Xcb at lists.freedesktop.org <mailto:Xcb at lists.freedesktop.org>
>> > http://lists.freedesktop.org/mailman/listinfo/xcb
>>
>>
>>
>>
>> --
>> Regards,
>> Jaya
>>
>>
>> _______________________________________________
>> Xcb mailing list
>> Xcb at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/xcb
> _______________________________________________
> Xcb mailing list
> Xcb at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/xcb
More information about the Xcb
mailing list