It is a component of an experimental GUI toolkit that I am making that draws the contents of the controls on the raw window at the command of the main code. Simply swapping out this part you can change how the controls of all programs that use it look.
I am still not sure how you can change the theme while the program is running, because it would be quite annoying to have to exit all your programs to change the theme.
I wonder how toolkits like GTK+ and Qt do it.
GTK+ uses some kind of separate theme engines and a special language, it doesn't seem like a fast, elegant, and versatile solution to me.
I heard that Qt themes actually are written in C++ code, not sure how it actually works.