issues generating icon - NSImageRep immutable ?

Riccardo Mottola <[email protected]> Mon, 5 Jun 2023 10:25:13 +0000
Newsgroups gmane.comp.lib.gnustep.devel
Message-ID <[email protected]>
Hi all, especially Fred!

I'm working with Gregory to unify the various code paths in GNUmail to
support Icon Drawing with the notification.
Currently there are three code-paths:
1) GNUstep only, which has custom controller & and iconview
2) MacOS (supported on all mac versions, but now used only 10.4):
getting the application icon, drawing on the badge, setting the icon
3) on MacOS 10.5 and up, NSDockTile and setBadgeLabel

The main distinction happens in update:.

first step, would be to remove GNUstep specific code and support
setApplicationIconImage:

The relevant code is here:
https://svn.savannah.gnu.org/viewvc/gnustep-nonfsf/apps/gnumail/Framework/GNUMail/ApplicationIconController.m?revision=881&view=markup


If I remove the ApplicationIconView code (especially in init line
301-302) thins do not draw on GNUstep.

IN essente the code boilds down to:
1) get the image through
image = [NSImage imageNamed: @"NSApplicationIcon"];
2) lock focus)
3) draw the badge stuff (but could do whatever)
4) unlock focus
5) set the application image

Debugging a little with Gregory, we came to the conclusion that the
image gotten back is not modifiable. perhaps its NSImageRep is immutable
while it should be not?

Riccardo