Hello wine-devel,
trying to get more work done on UiRibbon during the holidays, could need some
help regarding planning though.
Short rundown:
uiribbon.dll uses a proprietary binary format to load ribbon structure data.
This is created using UICC.exe (shipped by windows SDK) from a XML markup; the
binary is embedded into the application.
I already reversed the binary format pretty far, and wrote a file format
description.
That file format description uses Kaitai Struct, a declarative language to
generate binary data parsers. Currently I'm working on a Kaitai backend to
generate a C parser.
I'm probably going to create a folder under "libs" called "uiribbon" where
said description and classes generated by kaitai struct (and the runtime) can
lie.
I do believe that leaving the parser/generation up to Kaitai is a good idea,
especially since Wine itself doesn't need to rely on Kaitai. Just need it to
regenerate the parser if the format description is modified.
I hope that's not a problem, because I really want to go the Kaitai Struct
route.
The problem:
Still not sure how to deal with tests. And if we need to use a writer..
I could make a "custom UICC", a program to turn XML markup into the binary
format. Not really useful for applications, but could be a "nice to have" or
useful for tests. Lots of work though.
Problem 1: Windows doesn't ship UICC by default. That means if we need it for
tests, it needs to be installed, or tests won't be able to run.
Problem 2: Windows doesn't really have a parser exposed for the binary markup.
You can load it and it either works, or doesn't - in the worst case the
application simply crashes. Other error cases simply create a broken ribbon,
only displayed completely in black. Not easy to see what's wrong, or test if
it's wrong to begin with.
Although it should probably be possible to extract existing UI elements using
uiautomation. Not sure exactly how useful it is.
Question is how we do the tests:
1) Put markup and according binaries into the tests, write tests against the
binaries to assert what we expect from the written markup. If I recall
correctly, embedding binary blobs wasn't too well received.
2) Put markup into tests. Compile it on windows using real UICC, test the
parser that way (using something like C_SRCS = ../uiribbon_parser.c to have
the parser available in the tests)
3) Compile markup using custom UICC, test the ribbon against windows (using
uiautomation, limited testing only).
Maybe some combination.
Thoughts?
Regards,
Fabian Maurer