XChangeDeviceControl/XGetDeviceControl ?
Andrew Zabolotny
anpaza at mail.ru
Tue Apr 18 00:40:20 PDT 2006
On Tue, 18 Apr 2006 00:57:43 +0300
Daniel Stone <daniel at fooishbar.org> wrote:
> > Why? The Unix ioctl is used a lot of years, and it has proven
> > himself a handy mechanism for exchanging data with the driver. I
> > don't see a big need for those structures to be officialy approved
> > by the X.org developers, this will certainly be an extra barrier
> > for driver developers, and they will anyway tend to overcome it in
> > some perverted way.
> And ioctls are now more-or-less deprecated in favour of sysfs. Go
> figure, I guess ...
Well, I never heard it put so straight "deprecated", I was under
impression that sysfs is meant to complement ioctl. And anyways, the
sysfs ideology is quite far from XChangeDeviceControl; while ioctl() is
it's closest cousine :)
> If there are hundreds of such structures, we're already doing
> something wrong. What use cases do you have in mind?
Well, here are the parameters for Wacom tablets:
XWACOM_PARAM_TOPX
XWACOM_PARAM_TOPY
XWACOM_PARAM_BOTTOMX
XWACOM_PARAM_BOTTOMY
These four already fit in a separate structure, like DEVICE_ACTIVEAREA
or something like this.
XWACOM_PARAM_DEBUGLEVEL
This one doesn't make sense to be put into any other structure?
So a separate DEVICE_DEBUGLEVEL? :-)
XWACOM_PARAM_PRESSCURVE
XWACOM_PARAM_RAWFILTER
XWACOM_PARAM_MODE
XWACOM_PARAM_SPEEDLEVEL
XWACOM_PARAM_CLICKFORCE
XWACOM_PARAM_ACCEL
XWACOM_PARAM_XYDEFAULT
XWACOM_PARAM_GIMP
XWACOM_PARAM_MMT
XWACOM_PARAM_TPCBUTTON
Well, with a big strain we can put all of the above into a single
structure, but this will introduce an additional level of complexity
like parsing masks or checking for -1 (DONTCHANGE flags) and such.
XWACOM_PARAM_BUTTON1...XWACOM_PARAM_BUTTON32
These definitely belong to a different structure, like
DEVICE_BUTTONACTIONS, and again there's the problem that you can't
change a single button assignment at a time. Right now it's simple:
call XChangeDeviceControl with DEVICE_RESOLUTION,
resolutions [0] = XWACOM_PARAM_BUTTONX; resolutions [1] = action;
and you're done.
--
Greetings,
Andrew
More information about the xorg
mailing list