[Mono-osx] Patches for NSColor
Miguel de Icaza
miguel at novell.com
Fri Dec 31 08:45:31 EST 2010
Hello Regan,
Attached is a git-diff output file for corrections to the NSColor interface
> in appkit.cs
> Also attached is NSColor.cs which provides strongly typed bindings for the
> two obj-c methods that take *CGFloat input.
> (I did not include the diff to the Makefile)
>
Thanks for the fixes, I liked them very much. I am not sure how we even
got those NSColor bindings there, I could have sworn I had reviewed every
API that we checked in to remove bad names (although I still find some every
once in a while).
>
> I added out parameters in the interface where appropriate, and the
> generator created correct code in all case. Of course this relies on
> continuing correct behavior of the generator, but in my opinion is much
> cleaner than creating additional wrapper methods to deal with an IntPtr.
>
Agreed.
I did a minimal amount of method/parameter renaming to be internally consist
> (as I saw it).
>
I liked them. And these are important for two reasons: they show up on
intellisense, and can provide valuable information to the developer while he
is developing, without having to look up the documentation, and because with
C# 4.0 users will be able to name their parameters. So good parameter
names are important.
> I resisted the urge to do more extensive renaming, because I wasn't sure it
> was appropriate. I would like to rename XxxxxRGBA() to XxxxxRgba() for
> consistency with MonoMac.CoreImage.CIColor and System.Drawing.Color. I also
> considered dropping "Component" from xxxComponent. (i.e RedComponent { get;}
> would become Red {get;}. Once again this would be consistent with CIColor
> and Color, furthermore Component seems to be a synonym for property.
> Thoughts?
>
Let us rename it. The only case where we might have problems is with
MacCore, as that API is already an API that is used by thousands of
developers, so we can not just break their apps like that.
For the "Component" part, I am do not remember why we did it this way, but I
remember that it was not my first choice, I would have to investigate again
why I chose to keep it that way. For now, let us keep it as-is.
This is my first submission, so feedback would be helpful.
>
Lovely work. You just missed adding the new file to the src/Makefile
Miguel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-osx/attachments/20101231/5dd8e9cb/attachment.html
More information about the Mono-osx
mailing list