[Xcb] bind from XML (was: Objective-C binding)

Jamey Sharp jamey at minilop.net
Sat May 13 11:35:19 PDT 2006


On Sat, May 13, 2006 at 07:57:40PM +0200, Florent Monnier wrote:
> Hi Jamey,

Hi Florent!

> I really don't care if the key-words are something or something else.

Yes, I don't care either. I was joking about that.

> I have seen that everything in the XML files is made for the C language since 
> every key words are C ones (enum, union, ...) and I really don't care of it.

Things are named after C keywords, yes, but that doesn't make them
C-specific. We've tried to keep their semantics language-independent.

> > <field name="child">
> >   <type>WINDOW</type>
> >   <const>0</type>
> > </field>
> s/const/type/ ?

Of course I meant to write <const>0</const>. 0 isn't a type, it's a
value. (I'd accept <value>0</value>, for example.)

> > But seriously, note that you should always be able to lift an integer
> > into a WINDOW, or else other bad things will happen. So the protocol
> > description as it stands doesn't prevent any valid programs from being
> > written.
> 
> My question was only: could it be possible to make little enhancements to 
> bring it compatible with other languages than C ? since it seems (I'm not 
> sure yet) that it won't be descriptive enough for OCaml.

In this case, 0 is drawn from the WINDOW type, really. That's why I
claim the current description is sufficient for OCaml and other
languages: the WINDOW type needs to contain 0 as well as all the other
29-bit unsigned integers anyway. That's what I was trying to say about
being "able to lift an integer into a WINDOW".

> (IMHO attributes are often more easy to parse than PCData,
> it's only a personal point of view, maybe not shared with other peoples.)

I see your point regarding SAX. However, XPath, and by extension XSLT,
make attributes and elements equally easy to use. In this case I find
the element style more readable and less confusing. I don't know: if we
bother implementing this extended description at all, I'd consider
either style.

> The value 0 is confusing for other purpose than C, because in C a null pointer 
> can be made from the integer value 0, but in other languages 0 is strictly an 
> integer value and Null is something else.

The X protocol has no pointers. I wrote 0 because for the case you
brought up, an integer 0 appears on the wire. You may have been mislead
by the protocol authors using the name "None" for this 0 value.

--Jamey
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.freedesktop.org/archives/xcb/attachments/20060513/9e893575/attachment.pgp


More information about the Xcb mailing list