On Sat, 18 Jul 2020 15:26:44 +0000 Stefan Csomor wrote:
SC> Right now I have to support creation of wxBitmap also from system
SC> objects which might be scaled. And this will probably always be so, but
SC> as long as it's not public in creation, but only for accessing this
SC> should not be a problem ...
Yes, while I don't want to give the impression that I don't care about
internal quality of wxOSX code, because I do, I still care incomparably
more about the public API. So as long as we don't have APIs which basically
can never be implemented 100% correctly in wxBitmap, I'd be happy enough.
SC> A NSImage always has the same 'logical' size, only different 'physical'
SC> renderings, which somehow does not fit into my understanding of a
SC> wxBitmap. It is asked for a bestRepresentation for a graphics context.
I think wxBitmap should really be this, it's a logical evolution of the
current concept. It provides clear backwards compatibility, as you can
always have a single (which would also be best, due to lack of choice)
representation, while being extensible enough to support what we need.
SC> A IconBundle has no notion of logical size, it is just a bundle of
SC> different icons with different sizes, it is a bundle of
SC> wxIcons/wxBitmaps though. How about a wxBitmapBundle ? having only ONE
SC> logical size, with a GetBestBitmap( wxWindow* ) etc ?
I agree that current wxIconBundle is inappropriate because it can contain
icons of completely different sizes (and, in practice, will, i.e. it's
really our equivalent of Apple .appiconset thing, IIUC), but I don't think
it's worth creating a separate wxBitmapBundle. IMO we should either find
some way to change wxIconBundle to make it usable for what we need here or,
preferably, integrate having multiple representations in wxBitmap itself.
The latter would IMO be much better because not only we have many
functions taking or returning wxBitmap, which would be difficult to convert
to using wxIconBundle (or wxBitmapBundle, i.e. anything other than
wxBitmap), inside wx itself, but such functions are also very common in the
user code and we just can't change that. While changing wxBitmap could,
hopefully, be done in such a way that things would continue to work as well
as before without any changes and could be improved by changing just a few
small things in a single place (when loading/creating the bitmaps) instead
of having to modify the entire code base to use wxFooBundle instead of
wxBitmap.
So if at all possible, I'd be strongly in favour of handling this in
wxBitmap itself. In fact, we could even do it for Mac (and GTK 3?) only for
now (because MSW ignores bitmap scale anyhow), as long as we were sure that
the new API could be implemented in the other ports too.