Technical notes

xCHM has been implemented by creating a wxWidgets virtual filesystem (writing my own filesystem handler, as they call it), that would allow me to refer to a file inside a .chm archive by saying "file:foo.chm#chm:/bar.html". In order to do that I created a C++ wrapper around the CHMLIB C API, and added a few things of my own, such as figuring out where the contents description file is in the archive, what the default page's name is and other stuff like that. As a consequence of the index file being HTML parsable, I derived my own parser and taghandler from the respective wxWidgets classes in order to produce the topics tree control.

I also added some code to fast search in all the pages of the book, based on the $FIftiMain file that can be found inside indexed .chm archives. $FIftiMain is actually a binary representation of a search tree (B-tree) that when used, allows for logarithmic search times as opposed to a regular grep, which is a slow painful joke in comparison. Initially, I wrote xCHM with a grep search wired in that seemed to work fine with small .chm files and if wxGTK wasn't compiled in Unicode mode, but after some hickups I have decided to completely replace it with the fast index search, which I did since version 0.8.1. The fast index search could not have been done without Pabs' help, and in fact parts of the code have been 'borrowed' from his chmdeco project..

The rest is pretty much boilerplate UI code.

If you would like to see the class hierarchy in more detail, you can download the xchm-VERSION-doc.tar.gz tarball from the SourceForge page or look at it online here.

I assume there are probably some bugs left. I am way more interested in bug reports than feature requests. Being employed, I don't have enough time to work on xCHM, so development gets frozen indefinitely at times, and when I do get the time, I'd rather make sure the code works than wrestle with some out-of-this-world feature that someone 'just can't live without'.

With regard to bug reports, it would really help if you could point out the problem and the code section that needs improvement. If that's not possible it's ok, but if at all possible I'll need the input data as well (the .chm file that crashed/confused xCHM).

Limitations

xCHM can't handle:

* .chm files packing .mht files. The wxHtmlWindow component can only handle HTML pages. I couldn't fix this one even if I wanted to; I have no clue about .mht - and it's really a wxWidgets problem (as far as it is a problem).

* non-trivial JavaScript, VBScript or <InsertNameHere>Script. In fact, I believe that at the time I'm writing this the wxHtmlWindow component completely ignores all of the above.

* 'very proprietary' .chm files, making heavy use of MS-ITS:, mk:@MSITStore: links. The latter is not even supported by xCHM. So if you're trying to read Windows help files and can't quite make it, better just boot it and use hh.exe.

* complicated non-Latin charsets. It can handle some of them, sometimes. But fonts on your platform are probably not the fonts available on Windows, and the info to deduce them from is pretty undocumented too.

* probably other stuff too.


SourceForge.net Logo Support This Project