gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: issues generating icon - NSImageRep immutable ?


From: Fred Kiefer
Subject: Re: issues generating icon - NSImageRep immutable ?
Date: Mon, 5 Jun 2023 20:14:44 +0200

Sorry, I am completely lost here. Are you referring to line 301 or 351? I think 
that you expect the code starting in line 351 will be able to update the 
appIcon. This won’t work in GNUstep. When locking focus on an image we try to 
draw a representation of the image on an NSCachedImageRep. Your further drawing 
may also land in that image rep, but that will get overridden again. We may 
need to copy back changes from the NSCachedImageRep into the actual NSImage.

As far as I remember this requires a complete rewrite of the image handling and 
would be only possible for a few of the current drawing backends. At least this 
is what I came up with years ago when I tried for the last time. Maybe it is 
better if I stay out of this and let you two come up with a better solution.

Cheers,
Fred



> Am 05.06.2023 um 12:25 schrieb Riccardo Mottola <riccardo.mottola@libero.it>:
> 
> 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
> 
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]