|
From: | Fred Kiefer |
Subject: | Re: migration to CGFloat for NSColor? |
Date: | Tue, 25 Oct 2011 22:43:24 +0200 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; de; rv:1.9.2.23) Gecko/20110920 SUSE/3.1.15 Thunderbird/3.1.15 |
On 25.10.2011 21:00, Eric Wasylishen wrote:
Hi, I started writing a patch to migrate NSColor to use CGFloat (in response to the bug report about -getComponents: taking a pointer to floats julian reported.) Of course, doing this will break any application code which uses that method. Do we want to do this? My feeling is, it is better to do it now than to postpone the change. I had to make updates in the color pickers, NSBitmapImageRep, and also updated the private -[NSGraphicsContext GSSetStroke/FillColor:] method to take CGFloat. There are also a lot of DPS/PS functions that take pointers to floats (for both setting colors, and font advances) - I guess those should not be modified, since that would break older OpenStep applications. Thoughts?
First off, it will only change things for 64bit systems, everything stays the same for 32bit. And even on 64 bit systems the compiler will convert most usages when recompiling existing applications. The problematic methods are the ones where we pass a pointer to a CGFloat value. These are the getXXX methods and colorWithColorSpace:components:count: and I would expect these get used less often in normal applications. So from my side this is a go forward advice. We need to rewrite the rest of gui to use CGFloat anyway, better we start off doing it now.
I wouldn't touch the PS/DPS functions for now, the float precision is good enough anyway.
[Prev in Thread] | Current Thread | [Next in Thread] |