Last year, I announced the decision to use the Rocket library for menus rather than WebKit, primarily for security reasons, although it's also worthwhile to make the package simpler to write and easier to read -- which is important if it's to do a good job as a reference implementation.
Rocket solves these problems by being a much simpler, thinner interface layer (it really is just the renderer -- actually following links will be handled by callbacks to my code, which allows me to completely control the browsing process, making it both easier to write and more secure).
What I did not mention in my previous post (because I did not realize it until I started running tests in early December), was that Rocket is actually not a complete Python extension module. This is not really clear from the documentation (I may have to do something about that!), and I just figured I was having some trouble initializing it correctly (after all, the demos ran fine). Well, it turns out that, for me, "Rocket is only half a rocket-ship". The other half has to be provided by a backend rendering library -- something like OpenGL or SDL2. And that work has to be done in C++, you can't fix it from Python.
So I needed to get the other half of the rocketship built.
I was stuck on that for awhile, but ended up commissioning Tom Mason, who is the author of "Freeablo" (a free-software alternative to the Diablo game engine), and who therefore has C++ experience with Rocket and the SDL2 backend, which is what I wanted to use.
He released this to me just last week, and I've been running tests with it. Everything seems to be working exactly as it should, and it even works in the same logical X Window as VLC, so integration of menus and playback is very smooth and quick.
So this part is now done.
I wish I could do justice to how much better and easier this makes my situation!
There is still quite a bit of Python code to write, but it is much simpler, more familiar to me, and all focused on getting the desired Lib-Ray player behavior.
This will become a new "ichinose" branch in the SVN, as soon as I get the source organized. Here's a block diagram of this new Rocket-based architecture:
The orange "Rocket-Standalone" is what Tom Mason just completed, which allows all of the C++ stack to fit together. The Python layer above that are existing Python bindings for these libraries. The Lib-Ray Player Python application sits on top of that -- and that's what I'll be working on over the next month. Some pieces of this, like the Volume Object Model and the Localization code can be used with little or no re-writing. The "Menu-Browser" and "Video" modules will pretty much have to be completely re-written (although they will now be a lot simpler and easier to understand).
I will add support for infrared remote controls (probably based on "liRC") as well as mounting and automounting the UDF volume file-systems after the basic stack is all working with pre-mounted volumes and keyboard/mouse control.
I guess the stickiest part now is that I'm going to have to do some translation to go from a more standard XHTML+CSS markup on the Lib-Ray volume to the RML+RCSS markup that Rocket understands. This is mostly a subset, which I could just declare to be standard for Lib-Ray. But there are some oddities that need to be seen to:
1) Background images are handled in a non-standard and more complex way. This is undesirable since Lib-Ray menus will probably use them extensively. So I'll need to fix this in the filtering process.
2) Rocket doesn't actually understand hyperlink ( A-HREF ) tags at all, it just allows you to set event handlers on any element. So my filter will need to find the tags, read the URLs, and assign handlers.
Those are simple, easy-to-test text-filtering tasks. Very familiar territory.
After that, I'll need to implement hyperlink navigation, including dispatching my special URLs for sending messages to the VLC video player. Of course, this fine control over navigation was one of the main reasons to choose Rocket.
I'm hesitant to make projections because of all the ones I've made that have fallen through on this project, but I really do think I'll be done with the player by the end of March now.