[Xcb] Add X Generic Extension event support

Daniel Martin consume.noise at gmail.com
Sat Jun 8 22:20:28 PDT 2013


On Sat, Jun 08, 2013 at 11:38:32AM -0700, Keith Packard wrote:
> Daniel Martin <consume.noise at gmail.com> writes:
> 
> > Hi everyone,
> >
> > fixing the full_sequence problem from the ground up would have been a
> > nice thing. But, I got conviced that this is a way we can't go without
> > causing a lot of trouble. So, we've to deal with it and that's what
> > these two patches do.
> >
> > The first one is for the proto. It introduces a new boolean attribute
> > "xge" to events. If it's set to "true", then xcbgen generates the XGE
> > event header:
> >     [PATCH proto] Add support for X Generic Extension events
> >
> > The second for the lib injects the full_sequence into XGE events at the
> > 32byte boundary. That wouldn't be necessary for XGE events <= 32bytes,
> > but it'll be injected in every XGE event for convenience:
> >     [PATCH libxcb] c_client.py: Inject full_sequence into GE events
> 
> This looks reasonable to me; the only (minor) concern I have is that
> this defines the XGE fields with fixed names, which could be different
> From some existing XGE definition. I think that's OK though; if there
> were any, they'd use the old event definition mechanism which would
> still do the right thing.

I've choosen those fixed names to match the names in xcb_ge_event_t.

> Oh, I discovered another use for the 'xge' info -- that should suppress
> the header file definition of the 'event type'.

Oh, a special case? Could you point me to it, please?

---8<--- side note ---
I thought about introducing templates for headers, which one could
reference by an attribute in the event (or reply). Example:
    <header name="ge_default">
        <field type="CARD8"  name="response_type"/>
        <field type="CARD8"  name="extension"/>
        <field type="CARD16" name="sequence"/>
        <field type="CARD32" name="length"/>
        <field type="CARD16" name="event_type"/>
    </header>
    ...
    <event name="foo" header="ge_default>
        <!-- event fields ... -->
    </event>

The advantage would be, that we don't need special attributes for
handling special headers (like no-sequence-number). We could just write
another template for that.
On the other hand, that would give people the opportunity to change
names of fields where it's not necessary (i.e. event_type vs. ev_type)
and could lead to inconsistencies between extensions and their events.
That's why I skipped that idea.
--->8--- side note ---

> Reviewed-by: Keith Packard <keithp at keithp.com>

Thanks.


More information about the Xcb mailing list