testing strategy
Chuck Robey
chuckr at telenix.org
Sun Jul 20 17:43:36 PDT 2008
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Peter Hutterer wrote:
> On Sun, Jul 20, 2008 at 03:33:54PM -0400, Chuck Robey wrote:
>> I just finished spending 4 hours playing about with hw/xfree86/parser/cpconfig
>> (I wrote a small makefile for it) and I've been swapping various functions I
>> found in that directory, trying to find out how to parse the config file. I get
>> it how to print various stuff from List-s but I can't tell the right way to go
>> about making the List s yet. If there was an example of how to find all of the
>> following config section, I would truly appreciate this. Don't need to tell me
>> how to do it, just list the functions needed, I'll experiment out the rest:
>>
>> Section "InputDevice"
>>
>> # generated from default
>> Identifier "Mouse0"
>> Driver "mouse"
>> Option "Protocol" "auto"
>> Option "Device" "/dev/sysmouse"
>> Option "Emulate3Buttons" "no"
>> Option "ZAxisMapping" "4 5"
>> EndSection
>
>
> the default section is always
>
> Section "InputDevice"
> Identifier "..."
> Driver "..."
> Device "..." # not always required
> Option "whatever" "values"
> EndSection
>
> You can define Options in the driver, as much as you want.
> xf86CheckIntOption, xf86CheckStrOption, etc. hand you the value when you need
> it.
>
>> I know how to register all the values (valuators and buttons) and send events, I
>> just need to read the conf file. cpconfig is not terribly useful at this,
>> although it DOES work.
>
> why do you need to read the config file again?
Umm, again?
the server does it anyway, you
> just ask the server for the values applicable for your device. What am I
> missing here?
I don't really care a whit whether I'm reading the config file directly, or if
I'm grilling the xserver about it, either way, I need the info, and I don't know
how to get it. To be honest, though, I hadn't thouoght much about the fact that
the xserver might have already read the file once. Not that that matter one
heck of a lot to me, It's still missing info. Would be nice to know that info,
however, wouldn't it?
I'm always assuming everybody is thinking exactly what I am, so my typing is
often confusing (at least I know this about myself). Anyhow, I'm just trying to
find the Xorg-standardized method of reading the option info and the values
assigned in the config file, for everything in an InputDevice section. My own
tablet device is definitely going to have a InputDevice section, and I think no
more than about 6 to 8 configs options. Tablets need to get the X/Y (and Z,
being TipPressure) axis scaling info, and also 2 buttons and also a Proximity thing.
I have all this actually working, asa pure non-X,, but making it's output to the
screen in ASCII, which is just a bit short of expectations (poor joke?) At
least I know that the USB reading, configuring & parsing stuff works like a
charm. I just need to fully translate this to Xorg-speak.
The only stuff dealing with parsing the xorg.conf file I'm certain of yet is
xf86openConfigFile(), finding and opening the config file. Also, that a List
always has a GenericListRec list in it. It seems that all of the config info
always has a List in it.
Of course, I could cheat like hell and write my own parser, but I'd truly
dislike that. I can find sections there and there, in various input driver
directories, but I can't find anything (yet) that clearly demonstrates how to do
it. Can't find any descriptions, either.
If I stay at this a while longer, I will either figure this out (within the
week) or go stir-crazy. I'm not really sure which one comes first, any bets?)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (FreeBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkiD27gACgkQz62J6PPcoOlpSQCgoPwNWw4f2QUxUKP3v59d05uv
HRQAoJaE8XH2Iv/i9Z2L1VIaCb+bpJuo
=+gqA
-----END PGP SIGNATURE-----
More information about the xorg
mailing list