Re. the "redefining keywords" trick. I know this works with at least some versions of g++. However when I tried doing it in MSVC 2008 I ended up with link errors between the library object files (compiled without the redefinition trick) and the app executable that did use the trick. It looked like MSVC was encoding the visibility in the mangled method names.
The first review I read about the StarOffice source code (now OpenOffice, LibreOffice) back then when it was open sourced was that it was full of #define private public lines