[PATCH xinput] Handle XA_CARDINAL as property type

Peter Hutterer peter.hutterer at who-t.net
Tue Feb 21 16:07:12 PST 2012


On Tue, Feb 21, 2012 at 01:07:46PM +0100, Chase Douglas wrote:
> On 02/21/2012 12:33 PM, Daniel Stone wrote:
> > Hi,
> > 
> > On 21 February 2012 11:29, Chase Douglas <chase.douglas at canonical.com> wrote:
> >> I don't really know what XA_CARDINAL means. Where is it defined.
> > 
> > It's defined in Xatom.h (using cscope might be handy here - vim -t
> > XA_CARDINAL from any of my X source trees takes me to the definition),
> 
> Yes, though the C definition itself tells me nothing :).

XA_* defines are just static numbers for a bunch of predefined Atoms. They
have no intrinsic meaning, they're equivalent to whatever you get back from
XInternAtom(). XA_CARDINAL and a few others exist as #define because they're
a common type and it saves clients a few XInternAtom calls.

> > and means that the contents are a cardinal (as in, CARD{8,16,32}, as
> > in unsigned integer value).
> 
> Where's the documentation for the type, though, so I can figure out if
> how Peter determines the correct CARD* type is correct?

for properties of type XA_CARDINAL, the format defines the size of the
dataype. a rough guide is format 8 == CARD8, format 16 == CARD16 and format
32 == CARD32 though this being the Xlib property API, the latter is just a
rough approximation that depends on your architecture and whether you're
using core, XI 1.x or XI2.

Cheers,
  Peter


More information about the xorg-devel mailing list