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: Gregory Casamento
Subject: Re: issues generating icon - NSImageRep immutable ?
Date: Mon, 5 Jun 2023 23:25:46 -0400

Riccardo/Fred,

On Mon, Jun 5, 2023 at 17:05 Riccardo Mottola <riccardo.mottola@libero.it> wrote:
Hi,

Fred Kiefer wrote:
> 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.

Line 301 has to go away (to test what I mean, it needs to be commented
out, so to make GS=Mac).
I refer to th drawing in line 351 (actual drawing is done inside
draw_value() called at line 369).

Indeed I want to draw into the ImageRep once focus is locked, that's
what Mac does.

When does it get overridden? when unlocking? Is there away to overcome
it? e.g. by making a copy of the Image rep before unlocking?

Would it be possible to render the image of the icon and the badge into an NSCustomImageRep?  This is how I am writing the icon in TimeMon.  In fairness though in that code the icon is written as a series of Bézier curves.  Fred, thoughts?

>
> 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.

That sounds bad... but maybe your memories need to be refreshed, perhps
we can find a way to work around it and maybe optimize it for certain
backends.

I think this might be one of those differences we need to accept, unfortunately.   It might be possible to write some code that will work on both while sidestepping this limitation. 

Riccardo

Yours, GC
--
Gregory Casamento
GNUstep Lead Developer / OLC, Principal Consultant
http://www.gnustep.org - http://heronsperch.blogspot.com
https://www.patreon.com/bePatron?u=352392 - Become a Patron
https://www.openhub.net/languages/objective_c - OpenHub standings

reply via email to

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