Hi!
Furthermore as it is now, the orientation flags are inicialized to 0 at the time of the context creation and may only be changed later.
This may be a *temporary* solution, but this must be done by some setup function sooner rather than later. We need to know swap_axes for bytes_per_row in allocation anyway. Requiring user to do this manually and then force her to use GP_ContextWidth is insanity.
Maybe you don't get that right. The default settings are 0, 0, 0. And then user is encouraged to change these at runtime (that is the functionality these flags are introduced for).
Hint: Think of the rotation flags as you are thinking of cliping, they may change at any time.
There are some wrappers ready that rotates these flags clock wise and counter clock wise. But as it is now, changing flag value is all that is needed to change drawing direction. I'm not against doing more wrappers and declaring that changing these directly is forbiden. But then, either you have wrappers for manipulating rotation flags or for getting width and height. Also I agree that having wrappers for W and H is more annoying that wrappers for context orientation.
And no, swap_axes only changes logical orientation of the bitmap, no need to know these in time context is allocated. The context is always allocated in orientation 0, 0, 0 with physical w and h.
Either we declare GP_Context entirely public (declare it read-only xcept for clipping, then drop most wrappers, do sanity checks and keep our fingers crossed) or go with wrappers for everything ESPECIALLY such dangerous internal stuff (such as bytes_per_line and h) and consistently use these wrappers ourselves (if we want to have any chance to be able to modify GP_Context).
The problem with w and h, and moreover the reason why we have GP_TContextW() and GP_TContextH() is that logical w and h depends on axes_swap, while physical stays same from the point context was initialized.
Still I'm not sure, what is ideal solution here. Maybe wrappers for operations that are not usual and direct access to these that are used often.