Re: migration to CGFloat for NSColor?
On 2011-10-25, at 2:43 PM, Fred Kiefer wrote: > 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. > Ok, I committed the patch. back needs to be recompiled because I changed the -GSSetStroke/FillColor: method on NSGraphicsContext. Eric ___ Gnustep-dev mailing list Gnustep-dev@gnu.org https://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: migration to CGFloat for NSColor?
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. ___ Gnustep-dev mailing list Gnustep-dev@gnu.org https://lists.gnu.org/mailman/listinfo/gnustep-dev
Re: migration to CGFloat for NSColor?
I think it's worth doing now. It will only break binaries on 64-bit platforms, and there will only ever be more of those in the future... Not sure about the DPS methods - a lot of those are the gui/back interface, and they will need either replacing or modifying... David On 25 Oct 2011, at 20: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? > Eric > ___ > Gnustep-dev mailing list > Gnustep-dev@gnu.org > https://lists.gnu.org/mailman/listinfo/gnustep-dev -- Sent from my IBM 1620 ___ Gnustep-dev mailing list Gnustep-dev@gnu.org https://lists.gnu.org/mailman/listinfo/gnustep-dev
migration to CGFloat for NSColor?
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? Eric ___ Gnustep-dev mailing list Gnustep-dev@gnu.org https://lists.gnu.org/mailman/listinfo/gnustep-dev