[PATCH libXi 1/4] Add XI2 library-internal array offsets to XIint.h

Peter Hutterer peter.hutterer at who-t.net
Mon Jun 6 14:44:28 PDT 2011


On Mon, Jun 06, 2011 at 02:27:38PM +0100, Daniel Stone wrote:
> Hi,
> 
> On Mon, Jun 06, 2011 at 10:19:10PM +1000, Peter Hutterer wrote:
> > On 6/06/11 21:56 , Daniel Stone wrote:
> > >On Thu, Jun 02, 2011 at 05:13:31PM +1000, Peter Hutterer wrote:
> > >>These defines are currently defined in XI.h and XI2.h. Their only use is as
> > >>offset into a library-internal array. Move them to XIint.h so they may be
> > >>removed from the protocol headers with the next revision.
> > >
> > >Hmm, I'm kind of uneasy about having new protocol headers break builds
> > >with old libraries. :\
> > 
> > I'm pretty sure we discussed this once before and the outcome was:
> > the protocol headers can't be changed, the defines need to stay
> > around.
> 
> Yep, sounds familiar.
> 
> > what we can do however is _add_ them to libXi and ifdef them out
> > accordingly. this also means that the ifndef will never be hit, but
> > it's still easier to read this way.
> > 
> > so there is no matching patch for inputproto for this change, we
> > keep the defines around for backwards compatibility. the new
> > additions however are only in libXi.
> 
> Hmm, well in that case I guess the commit message at least needs to be
> fixed, but if we're (quite sensibly) not adding any new defines going
> forward, and these will never be used as they're just duplicating
> existing defines, I'm not really sure I see the point? Maybe just a
> comment saying 'see XI.h for previous values' or similar?

we're talking about two different defines here I think.

inputproto provides defines like XI_Add_DevicePresenceNotify_Major.
These describe the _protocol_ version and are in  minor/major format.
For device presence, protocol version is 1.4

libXi provides defines like XInput_Add_DevicePresenceNotify. These are
monotonous and are simply offsets into a libXi-internal array.
For device presence, this offset is 5. These defines is used on every
_XiCheckExtInt() call.
[this patch is about these defines, they currently live in inputproto]

For the protocol, I don't want to provide more defines for XI2.1, 2.2 etc
and just use the version numbers. For the library, these offsets need to be
defined though. so that we still do the right version number comparisons
internally in Xlib. So there will be additions to the static versions[]
array, and they need that offset defined somewhere so that we don't need to
guess that XI 2.1 is 8 and XI 2.2 will (likely) be 9.

Having said all that, the alternative to this patchset is to change
_XiCheckExtInit to take major.minor instead. Not sure if that counts as an
ABI break though. Technically we already had this ABI break when we made it
_X_HIDDEN so now we should be safe to change it.

Cheers,
  Peter


More information about the xorg-devel mailing list