Add "this creates/frees an XID" to the XML and use that for better generated API #589
Labels
enhancement
New feature or request
help wanted
Extra attention is needed
P5
Priority Nice-to-have
question
Further information is requested
stable API
Things that might require API changes
Related: #369 and #516
We could do something like the following:
No idea what to do with the
free
annotation, but thecreate
would allow to provide a more Xlib-y API where the new XID is returned instead of provided by the caller. That would then remove the need forgenerate_id()
and thus fix #516.(Another option would be to add new XML
<free name="pid" />
and<create name="pid" />
that is only allowed inside of<request>
. More bikeshedding options...)My preferred approach for how to tackle this would be to first propose a WIP patch upstream to xcb-proto and get through the bikeshedding on how to call this and how to integrate that with XSD rules. After the "how" is done, one could go through all the extension and figure out where to add the annotations. Hopefully, the result would then be mergable upstream.
Open questions include:
Connection
look like? Properly fixing There is a possible race around generate_id and the use of the XC-MISC extension #516 would require not just callinggenerate_id()
in the generated code.CC @not-a-seagull just FYI. Feel free to just ignore this, but I thought you might be interested in this. Right now, it looks like you have e.g. a hand-written wrapper for
create_pixmap
that already returns the XID.The text was updated successfully, but these errors were encountered: