diff options
author | Silenio Quarti <silenio> | 2011-03-30 21:42:33 +0000 |
---|---|---|
committer | Silenio Quarti <silenio> | 2011-03-30 21:42:33 +0000 |
commit | ea1614638a2d49cacb0be9856960133527b7df52 (patch) | |
tree | 33dac84308959aaff73fd399b3a5bdb18d3541a9 /bundles/org.eclipse.swt | |
parent | d099ecf28ae6761de33550ff2099dd439ec506a3 (diff) | |
download | eclipse.platform.swt-ea1614638a2d49cacb0be9856960133527b7df52.tar.gz eclipse.platform.swt-ea1614638a2d49cacb0be9856960133527b7df52.tar.xz eclipse.platform.swt-ea1614638a2d49cacb0be9856960133527b7df52.zip |
Bug 339132 - [Cocoa] GEF Thumbnail sync view broken in 3.7
Diffstat (limited to 'bundles/org.eclipse.swt')
24 files changed, 94 insertions, 79 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppKitFull.bridgesupport.extras b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppKitFull.bridgesupport.extras index e929da8c1f..72a8c8cb23 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppKitFull.bridgesupport.extras +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppKitFull.bridgesupport.extras @@ -861,6 +861,9 @@ <method class_method="true" selector="clearColor" swt_gen="true"> <retval swt_gen="true"></retval> </method> + <method selector="colorSpace" swt_gen="true"> + <retval swt_gen="true"></retval> + </method> <method selector="colorUsingColorSpaceName:" swt_gen="true"> <arg swt_gen="true"></arg> <retval swt_gen="true"></retval> @@ -970,6 +973,9 @@ </method> </class> <class name="NSColorSpace" swt_gen="mixed"> + <method selector="colorSpaceModel" swt_gen="true"> + <retval swt_gen="true"></retval> + </method> <method class_method="true" selector="genericRGBColorSpace" swt_gen="true"> <retval swt_gen="true"></retval> </method> @@ -4806,6 +4812,7 @@ <enum name="NSPrintPanelShowsPageSetupAccessory" swt_gen="true"></enum> <enum name="NSProgressIndicatorPreferredThickness" swt_gen="true"></enum> <enum name="NSPushOnPushOffButton" swt_gen="true"></enum> + <enum name="NSRGBColorSpaceModel" swt_gen="true"></enum> <enum name="NSRadioButton" swt_gen="true"></enum> <enum name="NSRegularControlSize" swt_gen="true"></enum> <enum name="NSRegularSquareBezelStyle" swt_gen="true"></enum> diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSColor.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSColor.java index 8623990f5b..aea601d9a2 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSColor.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSColor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2010 IBM Corporation and others. + * Copyright (c) 2000, 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -52,6 +52,11 @@ public static NSColor clearColor() { return result != 0 ? new NSColor(result) : null; } +public NSColorSpace colorSpace() { + int /*long*/ result = OS.objc_msgSend(this.id, OS.sel_colorSpace); + return result != 0 ? new NSColorSpace(result) : null; +} + public NSColor colorUsingColorSpaceName(NSString colorSpace) { int /*long*/ result = OS.objc_msgSend(this.id, OS.sel_colorUsingColorSpaceName_, colorSpace != null ? colorSpace.id : 0); return result == this.id ? this : (result != 0 ? new NSColor(result) : null); diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSColorSpace.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSColorSpace.java index 9bcae3debf..71c2f2c44d 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSColorSpace.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSColorSpace.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2010 IBM Corporation and others. + * Copyright (c) 2000, 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -24,6 +24,10 @@ public NSColorSpace(id id) { super(id); } +public int /*long*/ colorSpaceModel() { + return OS.objc_msgSend(this.id, OS.sel_colorSpaceModel); +} + public static NSColorSpace genericRGBColorSpace() { int /*long*/ result = OS.objc_msgSend(OS.class_NSColorSpace, OS.sel_genericRGBColorSpace); return result != 0 ? new NSColorSpace(result) : null; diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java index 4d9e51c3ce..6281c199ba 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java @@ -1044,6 +1044,8 @@ public static final int /*long*/ sel_collapseItem_ = sel_registerName("collapseI public static final int /*long*/ sel_collapseItem_collapseChildren_ = sel_registerName("collapseItem:collapseChildren:"); public static final int /*long*/ sel_color = sel_registerName("color"); public static final int /*long*/ sel_colorAtX_y_ = sel_registerName("colorAtX:y:"); +public static final int /*long*/ sel_colorSpace = sel_registerName("colorSpace"); +public static final int /*long*/ sel_colorSpaceModel = sel_registerName("colorSpaceModel"); public static final int /*long*/ sel_colorSpaceName = sel_registerName("colorSpaceName"); public static final int /*long*/ sel_colorUsingColorSpaceName_ = sel_registerName("colorUsingColorSpaceName:"); public static final int /*long*/ sel_colorWithCalibratedRed_green_blue_alpha_ = sel_registerName("colorWithCalibratedRed:green:blue:alpha:"); @@ -2346,6 +2348,7 @@ public static final int NSPrintPanelShowsPageRange = 2; public static final int NSPrintPanelShowsPageSetupAccessory = 256; public static final int NSProgressIndicatorPreferredThickness = 14; public static final int NSPushOnPushOffButton = 1; +public static final int NSRGBColorSpaceModel = 1; public static final int NSRadioButton = 4; public static final int NSRegularControlSize = 0; public static final int NSRegularSquareBezelStyle = 2; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Cursor.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Cursor.java index 5a7ad50400..12915c2c7b 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Cursor.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Cursor.java @@ -169,7 +169,7 @@ public Cursor(Device device, int style) { size.width = width; size.height = height; nsImage = nsImage.initWithSize(size); - nsImageRep = nsImageRep.initWithBitmapDataPlanes(0, width, height, 8, 4, true, false, OS.NSCalibratedRGBColorSpace, + nsImageRep = nsImageRep.initWithBitmapDataPlanes(0, width, height, 8, 4, true, false, OS.NSDeviceRGBColorSpace, OS.NSAlphaFirstBitmapFormat | OS.NSAlphaNonpremultipliedBitmapFormat, width*4, 32); OS.memmove(nsImageRep.bitmapData(), WAIT_SOURCE, WAIT_SOURCE.length); nsImage.addRepresentation(nsImageRep); @@ -282,7 +282,7 @@ void createNSCursor(int hotspotX, int hotspotY, byte[] buffer, int width, int he size.height = height; nsImage = nsImage.initWithSize(size); nsImageRep = nsImageRep.initWithBitmapDataPlanes(0, width, height, - 8, 4, true, false, OS.NSCalibratedRGBColorSpace, + 8, 4, true, false, OS.NSDeviceRGBColorSpace, OS.NSAlphaFirstBitmapFormat | OS.NSAlphaNonpremultipliedBitmapFormat, width * 4, 32); OS.memmove(nsImageRep.bitmapData(), buffer, buffer.length); nsImage.addRepresentation(nsImageRep); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java index 810e2aeaef..6748065458 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java @@ -290,7 +290,7 @@ NSAutoreleasePool checkGC (int mask) { } else { float /*double*/ [] color = data.foreground; if (data.fg != null) data.fg.release(); - NSColor fg = data.fg = NSColor.colorWithCalibratedRed(color[0], color[1], color[2], data.alpha / 255f); + NSColor fg = data.fg = NSColor.colorWithDeviceRed(color[0], color[1], color[2], data.alpha / 255f); fg.retain(); fg.setStroke(); } @@ -302,7 +302,7 @@ NSAutoreleasePool checkGC (int mask) { } else { float /*double*/ [] color = data.foreground; if (data.fg != null) data.fg.release(); - NSColor fg = data.fg = NSColor.colorWithCalibratedRed(color[0], color[1], color[2], data.alpha / 255f); + NSColor fg = data.fg = NSColor.colorWithDeviceRed(color[0], color[1], color[2], data.alpha / 255f); fg.retain(); fg.setFill(); } @@ -315,11 +315,7 @@ NSAutoreleasePool checkGC (int mask) { } else { float /*double*/ [] color = data.background; if (data.bg != null) data.bg.release(); - NSColor bg; - if (OS.VERSION < 0x1060) - bg = data.bg = NSColor.colorWithDeviceRed(color[0], color[1], color[2], data.alpha / 255f); - else - bg = data.bg = NSColor.colorWithCalibratedRed(color[0], color[1], color[2], data.alpha / 255f); + NSColor bg = data.bg = NSColor.colorWithDeviceRed(color[0], color[1], color[2], data.alpha / 255f); bg.retain(); bg.setFill(); } @@ -778,7 +774,7 @@ NSAttributedString createString(String string, int flags, boolean draw) { NSColor fg = data.fg; if (fg == null) { float /*double*/ [] color = data.foreground; - fg = data.fg = NSColor.colorWithCalibratedRed(color[0], color[1], color[2], data.alpha / 255f); + fg = data.fg = NSColor.colorWithDeviceRed(color[0], color[1], color[2], data.alpha / 255f); fg.retain(); } dict.setObject(fg, OS.NSForegroundColorAttributeName); @@ -1686,7 +1682,7 @@ public void drawText (String string, int x, int y, int flags) { NSColor bg = data.bg; if (bg == null) { float /*double*/ [] color = data.background; - bg = data.bg = NSColor.colorWithCalibratedRed(color[0], color[1], color[2], data.alpha / 255f); + bg = data.bg = NSColor.colorWithDeviceRed(color[0], color[1], color[2], data.alpha / 255f); bg.retain(); } bg.setFill(); @@ -1836,8 +1832,8 @@ public void fillGradientRectangle(int x, int y, int width, int height, boolean v if (fromRGB.equals(toRGB)) { fillRectangle(x, y, width, height); } else { - NSColor startingColor = NSColor.colorWithCalibratedRed(fromRGB.red / 255f, fromRGB.green / 255f, fromRGB.blue / 255f, data.alpha / 255f); - NSColor endingColor = NSColor.colorWithCalibratedRed(toRGB.red / 255f, toRGB.green / 255f, toRGB.blue / 255f, data.alpha / 255f); + NSColor startingColor = NSColor.colorWithDeviceRed(fromRGB.red / 255f, fromRGB.green / 255f, fromRGB.blue / 255f, data.alpha / 255f); + NSColor endingColor = NSColor.colorWithDeviceRed(toRGB.red / 255f, toRGB.green / 255f, toRGB.blue / 255f, data.alpha / 255f); NSGradient gradient = ((NSGradient)new NSGradient().alloc()).initWithStartingColor(startingColor, endingColor); NSRect rect = new NSRect(); rect.x = x; @@ -1913,7 +1909,7 @@ void fillPattern(NSBezierPath path, Pattern pattern) { float /*double*/ dify = end.y - start.y; if (difx == 0 && dify == 0) { float /*double*/ [] color = pattern.color1; - NSColor.colorWithCalibratedRed(color[0], color[1], color[2], data.alpha / 255f).setFill(); + NSColor.colorWithDeviceRed(color[0], color[1], color[2], data.alpha / 255f).setFill(); path.fill(); handle.restoreGraphicsState(); return; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Image.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Image.java index 2ccfd06cae..3a38788510 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Image.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Image.java @@ -248,7 +248,7 @@ public Image(Device device, Image srcImage, int flag) { handle = (NSImage)new NSImage().alloc(); handle = handle.initWithSize(size); NSBitmapImageRep rep = (NSBitmapImageRep)new NSBitmapImageRep().alloc(); - rep = rep.initWithBitmapDataPlanes(0, width, height, srcRep.bitsPerSample(), srcRep.samplesPerPixel(), srcRep.hasAlpha(), srcRep.isPlanar(), OS.NSCalibratedRGBColorSpace, format, srcRep.bytesPerRow(), bpp); + rep = rep.initWithBitmapDataPlanes(0, width, height, srcRep.bitsPerSample(), srcRep.samplesPerPixel(), srcRep.hasAlpha(), srcRep.isPlanar(), OS.NSDeviceRGBColorSpace, format, srcRep.bytesPerRow(), bpp); handle.addRepresentation(rep); rep.release(); handle.setCacheMode(OS.NSImageCacheNever); @@ -844,7 +844,7 @@ void init(int width, int height) { size.height = height; handle = handle.initWithSize(size); NSBitmapImageRep rep = (NSBitmapImageRep)new NSBitmapImageRep().alloc(); - rep = rep.initWithBitmapDataPlanes(0, width, height, 8, 3, false, false, OS.NSCalibratedRGBColorSpace, OS.NSAlphaFirstBitmapFormat | OS.NSAlphaNonpremultipliedBitmapFormat, width * 4, 32); + rep = rep.initWithBitmapDataPlanes(0, width, height, 8, 3, false, false, OS.NSDeviceRGBColorSpace, OS.NSAlphaFirstBitmapFormat | OS.NSAlphaNonpremultipliedBitmapFormat, width * 4, 32); OS.memset(rep.bitmapData(), 0xFF, width * height * 4); handle.addRepresentation(rep); rep.release(); @@ -958,7 +958,7 @@ void init(ImageData image) { size.height = height; handle = handle.initWithSize(size); NSBitmapImageRep rep = (NSBitmapImageRep)new NSBitmapImageRep().alloc(); - rep = rep.initWithBitmapDataPlanes(0, width, height, 8, hasAlpha ? 4 : 3, hasAlpha, false, OS.NSCalibratedRGBColorSpace, OS.NSAlphaFirstBitmapFormat | OS.NSAlphaNonpremultipliedBitmapFormat, bpr, 32); + rep = rep.initWithBitmapDataPlanes(0, width, height, 8, hasAlpha ? 4 : 3, hasAlpha, false, OS.NSDeviceRGBColorSpace, OS.NSAlphaFirstBitmapFormat | OS.NSAlphaNonpremultipliedBitmapFormat, bpr, 32); OS.memmove(rep.bitmapData(), buffer, dataSize); handle.addRepresentation(rep); rep.release(); @@ -1000,7 +1000,7 @@ void initNative(String filename) { size.height = height; handle = handle.initWithSize(size); NSBitmapImageRep rep = (NSBitmapImageRep)new NSBitmapImageRep().alloc(); - rep = rep.initWithBitmapDataPlanes(0, width, height, 8, hasAlpha ? 4 : 3, hasAlpha, false, OS.NSCalibratedRGBColorSpace, OS.NSAlphaFirstBitmapFormat | OS.NSAlphaNonpremultipliedBitmapFormat, bpr, 32); + rep = rep.initWithBitmapDataPlanes(0, width, height, 8, hasAlpha ? 4 : 3, hasAlpha, false, OS.NSDeviceRGBColorSpace, OS.NSAlphaFirstBitmapFormat | OS.NSAlphaNonpremultipliedBitmapFormat, bpr, 32); handle.addRepresentation(rep); rep.release(); handle.setCacheMode(OS.NSImageCacheNever); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Pattern.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Pattern.java index 224aed6aaa..4d72b20f4f 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Pattern.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Pattern.java @@ -171,8 +171,8 @@ public Pattern(Device device, float x1, float y1, float x2, float y2, Color colo this.color2 = color2.handle; this.alpha1 = alpha1; this.alpha2 = alpha2; - NSColor start = NSColor.colorWithCalibratedRed(color1.handle[0], color1.handle[1], color1.handle[2], alpha1 / 255f); - NSColor end = NSColor.colorWithCalibratedRed(color2.handle[0], color2.handle[1], color2.handle[2], alpha2 / 255f); + NSColor start = NSColor.colorWithDeviceRed(color1.handle[0], color1.handle[1], color1.handle[2], alpha1 / 255f); + NSColor end = NSColor.colorWithDeviceRed(color2.handle[0], color2.handle[1], color2.handle[2], alpha2 / 255f); gradient = ((NSGradient)new NSGradient().alloc()).initWithStartingColor(start, end); init(); } finally { diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/TextLayout.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/TextLayout.java index ca0438944f..f74deb3e59 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/TextLayout.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/TextLayout.java @@ -217,19 +217,19 @@ void computeRuns() { } Color foreground = style.foreground; if (foreground != null) { - NSColor color = NSColor.colorWithCalibratedRed(foreground.handle[0], foreground.handle[1], foreground.handle[2], 1); + NSColor color = NSColor.colorWithDeviceRed(foreground.handle[0], foreground.handle[1], foreground.handle[2], 1); attrStr.addAttribute(OS.NSForegroundColorAttributeName, color, range); } Color background = style.background; if (background != null) { - NSColor color = NSColor.colorWithCalibratedRed(background.handle[0], background.handle[1], background.handle[2], 1); + NSColor color = NSColor.colorWithDeviceRed(background.handle[0], background.handle[1], background.handle[2], 1); attrStr.addAttribute(OS.NSBackgroundColorAttributeName, color, range); } if (style.strikeout) { attrStr.addAttribute(OS.NSStrikethroughStyleAttributeName, NSNumber.numberWithInt(OS.NSUnderlineStyleSingle), range); Color strikeColor = style.strikeoutColor; if (strikeColor != null) { - NSColor color = NSColor.colorWithCalibratedRed(strikeColor.handle[0], strikeColor.handle[1], strikeColor.handle[2], 1); + NSColor color = NSColor.colorWithDeviceRed(strikeColor.handle[0], strikeColor.handle[1], strikeColor.handle[2], 1); attrStr.addAttribute(OS.NSStrikethroughColorAttributeName, color, range); } } @@ -248,7 +248,7 @@ void computeRuns() { case SWT.UNDERLINE_LINK: { underlineStyle = OS.NSUnderlineStyleSingle; if (foreground == null) { - NSColor color = NSColor.colorWithCalibratedRed(LINK_FOREGROUND.red / 255f, LINK_FOREGROUND.green / 255f, LINK_FOREGROUND.blue / 255f, 1); + NSColor color = NSColor.colorWithDeviceRed(LINK_FOREGROUND.red / 255f, LINK_FOREGROUND.green / 255f, LINK_FOREGROUND.blue / 255f, 1); attrStr.addAttribute(OS.NSForegroundColorAttributeName, color, range); } break; @@ -258,7 +258,7 @@ void computeRuns() { attrStr.addAttribute(OS.NSUnderlineStyleAttributeName, NSNumber.numberWithInt(underlineStyle), range); Color underlineColor = style.underlineColor; if (underlineColor != null) { - NSColor color = NSColor.colorWithCalibratedRed(underlineColor.handle[0], underlineColor.handle[1], underlineColor.handle[2], 1); + NSColor color = NSColor.colorWithDeviceRed(underlineColor.handle[0], underlineColor.handle[1], underlineColor.handle[2], 1); attrStr.addAttribute(OS.NSUnderlineColorAttributeName, color, range); } } @@ -449,7 +449,7 @@ public void draw(GC gc, int x, int y, int selectionStart, int selectionEnd, Colo boolean hasSelection = selectionStart <= selectionEnd && selectionStart != -1 && selectionEnd != -1; if (hasSelection || ((flags & SWT.LAST_LINE_SELECTION) != 0 && (flags & (SWT.FULL_SELECTION | SWT.DELIMITER_SELECTION)) != 0)) { if (selectionBackground == null) selectionBackground = device.getSystemColor(SWT.COLOR_LIST_SELECTION); - NSColor selectionColor = NSColor.colorWithCalibratedRed(selectionBackground.handle[0], selectionBackground.handle[1], selectionBackground.handle[2], selectionBackground.handle[3]); + NSColor selectionColor = NSColor.colorWithDeviceRed(selectionBackground.handle[0], selectionBackground.handle[1], selectionBackground.handle[2], selectionBackground.handle[3]); NSBezierPath path = NSBezierPath.bezierPath(); NSRect rect = new NSRect(); if (hasSelection) { @@ -534,7 +534,7 @@ public void draw(GC gc, int x, int y, int selectionStart, int selectionEnd, Colo if (style.underlineColor != null) color = style.underlineColor.handle; if (color == null && style.foreground != null) color = style.foreground.handle; if (color != null) { - NSColor.colorWithCalibratedRed(color[0], color[1], color[2], color[3]).setStroke(); + NSColor.colorWithDeviceRed(color[0], color[1], color[2], color[3]).setStroke(); } for (int k = 0; k < rectCount[0]; k++, pArray += NSRect.sizeof) { OS.memmove(rect, pArray, NSRect.sizeof); @@ -601,7 +601,7 @@ public void draw(GC gc, int x, int y, int selectionStart, int selectionEnd, Colo if (style.borderColor != null) color = style.borderColor.handle; if (color == null && style.foreground != null) color = style.foreground.handle; if (color != null) { - NSColor.colorWithCalibratedRed(color[0], color[1], color[2], color[3]).setStroke(); + NSColor.colorWithDeviceRed(color[0], color[1], color[2], color[3]).setStroke(); } int width = 1; float[] dashes = null; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ColorDialog.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ColorDialog.java index 1cc930d1ad..e63fc47018 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ColorDialog.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ColorDialog.java @@ -125,7 +125,7 @@ public RGB open() { Display display = parent != null ? parent.getDisplay() : Display.getCurrent(); display.subclassPanel(panel, className); if (rgb != null) { - NSColor color = NSColor.colorWithCalibratedRed(rgb.red / 255f, rgb.green / 255f, rgb.blue / 255f, 1); + NSColor color = NSColor.colorWithDeviceRed(rgb.red / 255f, rgb.green / 255f, rgb.blue / 255f, 1); panel.setColor(color); } SWTPanelDelegate delegate = (SWTPanelDelegate)new SWTPanelDelegate().alloc().init(); @@ -145,8 +145,8 @@ public RGB open() { if (selected) { NSColor color = panel.color(); if (color != null) { - color = color.colorUsingColorSpaceName(OS.NSCalibratedRGBColorSpace); - rgb = new RGB((int)(color.redComponent() * 255), (int)(color.greenComponent() * 255), (int)(color.blueComponent() * 255)); + float /*double*/ [] handle = display.getNSColorRGB(color); + rgb = new RGB((int)(handle[0] * 255), (int)(handle[1] * 255), (int)(handle[2] * 255)); } } return rgb; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Combo.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Combo.java index c4a766798c..1c61304291 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Combo.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Combo.java @@ -1323,7 +1323,7 @@ void setForeground (float /*double*/ [] color) { if (color == null) { nsColor = NSColor.textColor (); } else { - nsColor = NSColor.colorWithCalibratedRed(color[0], color[1], color[2], 1); + nsColor = NSColor.colorWithDeviceRed(color[0], color[1], color[2], 1); } ((NSTextField)view).setTextColor(nsColor); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java index fb4123cf2f..9c86496d85 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java @@ -938,7 +938,7 @@ NSAttributedString createString (String string, Font font, float /*double*/ [] f addTraits(dict, font); if (enabled) { if (foreground != null) { - NSColor color = NSColor.colorWithCalibratedRed(foreground[0], foreground[1], foreground[2], foreground[3]); + NSColor color = NSColor.colorWithDeviceRed(foreground[0], foreground[1], foreground[2], foreground[3]); dict.setObject (color, OS.NSForegroundColorAttributeName); } } else { @@ -1294,7 +1294,7 @@ void fillBackground (NSView view, NSGraphicsContext context, NSRect rect, int im alpha = background[3]; } context.saveGraphicsState (); - NSColor.colorWithCalibratedRed (background [0], background [1], background [2], alpha).setFill (); + NSColor.colorWithDeviceRed (background [0], background [1], background [2], alpha).setFill (); NSBezierPath.fillRect (rect); context.restoreGraphicsState (); } @@ -3379,7 +3379,7 @@ void setBackground () { setBackgroundImage (control.backgroundImage.handle); } else { float /*double*/ [] color = control.background != null ? control.background : control.defaultBackground().handle; - NSColor nsColor = NSColor.colorWithCalibratedRed(color[0], color[1], color[2], color[3]); + NSColor nsColor = NSColor.colorWithDeviceRed(color[0], color[1], color[2], color[3]); setBackgroundColor (nsColor); } } @@ -4853,7 +4853,7 @@ void updateBackgroundColor () { Control control = findBackgroundControl (); if (control == null) control = this; float /*double*/ [] color = control.background != null ? control.background : control.defaultBackground().handle; - NSColor nsColor = NSColor.colorWithCalibratedRed(color[0], color[1], color[2], color[3]); + NSColor nsColor = NSColor.colorWithDeviceRed(color[0], color[1], color[2], color[3]); setBackgroundColor (nsColor); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/DateTime.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/DateTime.java index 6569fdeb8f..cb2a9ffea4 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/DateTime.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/DateTime.java @@ -657,7 +657,7 @@ void setForeground (float /*double*/ [] color) { nsColor = NSColor.textColor (); } } else { - nsColor = NSColor.colorWithCalibratedRed(color[0], color[1], color[2], 1); + nsColor = NSColor.colorWithDeviceRed(color[0], color[1], color[2], 1); } ((NSDatePicker)view).setTextColor(nsColor); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java index 5a62c97776..e395a0d31a 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java @@ -1820,12 +1820,15 @@ float /*double*/ [] getWidgetColorRGB (int id) { case SWT.COLOR_LIST_SELECTION_TEXT: color = NSColor.selectedTextColor(); break; case SWT.COLOR_LIST_SELECTION: color = NSColor.selectedTextBackgroundColor(); break; } - return getWidgetColorRGB (color); + return getNSColorRGB (color); } -float /*double*/ [] getWidgetColorRGB (NSColor color) { +float /*double*/ [] getNSColorRGB (NSColor color) { if (color == null) return null; - color = color.colorUsingColorSpaceName(OS.NSCalibratedRGBColorSpace); + NSColorSpace colorSpace = color.colorSpace(); + if (colorSpace == null || colorSpace.colorSpaceModel() != OS.NSRGBColorSpaceModel) { + color = color.colorUsingColorSpaceName(OS.NSDeviceRGBColorSpace); + } if (color == null) return null; float /*double*/[] components = new float /*double*/[(int)/*64*/color.numberOfComponents()]; color.getComponents(components); @@ -2922,10 +2925,10 @@ void initColors () { colors[SWT.COLOR_LIST_SELECTION_TEXT] = getWidgetColorRGB(SWT.COLOR_LIST_SELECTION_TEXT); colors[SWT.COLOR_LIST_SELECTION] = getWidgetColorRGB(SWT.COLOR_LIST_SELECTION); - alternateSelectedControlColor = getWidgetColorRGB(NSColor.alternateSelectedControlColor()); - alternateSelectedControlTextColor = getWidgetColorRGB(NSColor.alternateSelectedControlTextColor()); - secondarySelectedControlColor = getWidgetColorRGB(NSColor.secondarySelectedControlColor()); - selectedControlTextColor = getWidgetColorRGB(NSColor.selectedControlTextColor()); + alternateSelectedControlColor = getNSColorRGB(NSColor.alternateSelectedControlColor()); + alternateSelectedControlTextColor = getNSColorRGB(NSColor.alternateSelectedControlTextColor()); + secondarySelectedControlColor = getNSColorRGB(NSColor.secondarySelectedControlColor()); + selectedControlTextColor = getNSColorRGB(NSColor.selectedControlTextColor()); } void initFonts () { diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/FontDialog.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/FontDialog.java index d8586893ad..16b3620b9e 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/FontDialog.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/FontDialog.java @@ -177,8 +177,9 @@ void setColor_forAttribute(int /*long*/ id, int /*long*/ sel, int /*long*/ color if (attribute != 0 && NSString.stringWith("NSColor").isEqualToString(new NSString(attribute))) { //$NON-NLS-1$ if (colorArg != 0) { NSColor color = new NSColor(colorArg); - color = color.colorUsingColorSpaceName(OS.NSCalibratedRGBColorSpace); - rgb = new RGB((int)(color.redComponent() * 255), (int)(color.greenComponent() * 255), (int)(color.blueComponent() * 255)); + Display display = parent != null ? parent.getDisplay() : Display.getCurrent(); + float /*double*/ [] handle = display.getNSColorRGB(color); + rgb = new RGB((int)(handle[0] * 255), (int)(handle[1] * 255), (int)(handle[2] * 255)); } else { rgb = null; } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Group.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Group.java index 38748df1ef..d7090e8925 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Group.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Group.java @@ -214,7 +214,7 @@ void setForeground (float /*double*/ [] color) { if (color == null) { nsColor = NSColor.textColor (); } else { - nsColor = NSColor.colorWithCalibratedRed (color[0], color[1], color[2], 1); + nsColor = NSColor.colorWithDeviceRed (color[0], color[1], color[2], 1); } NSTextFieldCell cell = new NSTextFieldCell (((NSBox)view).titleCell ().id); cell.setTextColor (nsColor); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/IME.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/IME.java index 44165a7df5..d828e3a0e3 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/IME.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/IME.java @@ -261,17 +261,14 @@ TextStyle getStyle (NSDictionary attribs) { for (int j = 0; j < count; j++) { NSString key = new NSString (keys.objectAtIndex (j)); if (key.isEqualTo (OS.NSBackgroundColorAttributeName)) { - NSColor color = new NSColor (attribs.objectForKey (key)).colorUsingColorSpaceName (OS.NSCalibratedRGBColorSpace); - float /*double*/ [] rgbColor = new float /*double*/ []{color.redComponent(), color.greenComponent(), color.blueComponent(), color.alphaComponent()}; - style.background = Color.cocoa_new (display, rgbColor); + NSColor color = new NSColor (attribs.objectForKey (key)); + style.background = Color.cocoa_new (display, display.getNSColorRGB(color)); } else if (key.isEqualTo (OS.NSForegroundColorAttributeName)) { - NSColor color = new NSColor (attribs.objectForKey (key)).colorUsingColorSpaceName (OS.NSCalibratedRGBColorSpace); - float /*double*/ [] rgbColor = new float /*double*/ []{color.redComponent(), color.greenComponent(), color.blueComponent(), color.alphaComponent()}; - style.foreground = Color.cocoa_new (display, rgbColor); + NSColor color = new NSColor (attribs.objectForKey (key)); + style.foreground = Color.cocoa_new (display, display.getNSColorRGB(color)); } else if (key.isEqualTo (OS.NSUnderlineColorAttributeName)) { - NSColor color = new NSColor (attribs.objectForKey (key)).colorUsingColorSpaceName (OS.NSCalibratedRGBColorSpace); - float /*double*/ [] rgbColor = new float /*double*/ []{color.redComponent(), color.greenComponent(), color.blueComponent(), color.alphaComponent()}; - style.underlineColor = Color.cocoa_new (display, rgbColor); + NSColor color = new NSColor (attribs.objectForKey (key)); + style.underlineColor = Color.cocoa_new (display, display.getNSColorRGB(color)); } else if (key.isEqualTo (OS.NSUnderlineStyleAttributeName)) { NSNumber value = new NSNumber (attribs.objectForKey (key)); switch (value.intValue ()) { @@ -281,9 +278,8 @@ TextStyle getStyle (NSDictionary attribs) { } style.underline = value.intValue () != OS.NSUnderlineStyleNone; } else if (key.isEqualTo (OS.NSStrikethroughColorAttributeName)) { - NSColor color = new NSColor (attribs.objectForKey (key)).colorUsingColorSpaceName (OS.NSCalibratedRGBColorSpace); - float /*double*/ [] rgbColor = new float /*double*/ []{color.redComponent(), color.greenComponent(), color.blueComponent(), color.alphaComponent()}; - style.strikeoutColor = Color.cocoa_new (display, rgbColor); + NSColor color = new NSColor (attribs.objectForKey (key)); + style.strikeoutColor = Color.cocoa_new (display, display.getNSColorRGB(color)); } else if (key.isEqualTo (OS.NSStrikethroughStyleAttributeName)) { NSNumber value = new NSNumber (attribs.objectForKey (key)); style.strikeout = value.intValue () != OS.NSUnderlineStyleNone; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Link.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Link.java index d0be05f1b2..edbd4a42a8 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Link.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Link.java @@ -266,7 +266,7 @@ void enableWidget (boolean enabled) { if (foreground == null) { nsColor = NSColor.textColor (); } else { - nsColor = NSColor.colorWithCalibratedRed (foreground [0], foreground [1], foreground [2], foreground[3]); + nsColor = NSColor.colorWithDeviceRed (foreground [0], foreground [1], foreground [2], foreground[3]); } } else { nsColor = NSColor.disabledControlTextColor(); @@ -632,7 +632,7 @@ void setForeground (float /*double*/ [] color) { if (color == null) { nsColor = NSColor.textColor (); } else { - nsColor = NSColor.colorWithCalibratedRed (color [0], color [1], color [2], 1); + nsColor = NSColor.colorWithDeviceRed (color [0], color [1], color [2], 1); } ((NSTextView) view).setTextColor (nsColor); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Spinner.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Spinner.java index d91d284851..aa7f32ff95 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Spinner.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Spinner.java @@ -777,7 +777,7 @@ void setForeground (float /*double*/ [] color) { if (color == null) { nsColor = NSColor.textColor (); } else { - nsColor = NSColor.colorWithCalibratedRed (color [0], color [1], color [2], 1); + nsColor = NSColor.colorWithDeviceRed (color [0], color [1], color [2], 1); } ((NSTextField) textView).setTextColor (nsColor); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Table.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Table.java index 6fe551283f..783c205e35 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Table.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Table.java @@ -1026,7 +1026,7 @@ void drawInteriorWithFrame_inView (int /*long*/ id, int /*long*/ sel, NSRect rec if (drawBackground && !drawSelection) { context.saveGraphicsState (); float /*double*/ [] colorRGB = background.handle; - NSColor color = NSColor.colorWithCalibratedRed (colorRGB[0], colorRGB[1], colorRGB[2], 1f); + NSColor color = NSColor.colorWithDeviceRed (colorRGB[0], colorRGB[1], colorRGB[2], 1f); color.setFill (); NSBezierPath.fillRect (cellRect); context.restoreGraphicsState (); @@ -1086,7 +1086,7 @@ void drawInteriorWithFrame_inView (int /*long*/ id, int /*long*/ sel, NSRect rec newStr.drawInRect(newRect); newStr.release(); } else { - NSColor nsColor = NSColor.colorWithCalibratedRed(color[0], color[1], color[2], color[3]); + NSColor nsColor = NSColor.colorWithDeviceRed(color[0], color[1], color[2], color[3]); cell.setTextColor(nsColor); callSuper = true; } @@ -3283,7 +3283,7 @@ void tableView_willDisplayCell_forTableColumn_row (int /*long*/ id, int /*long*/ Color foreground = item.cellForeground != null ? item.cellForeground [index] : null; if (foreground == null) foreground = item.foreground; if (foreground == null) foreground = getForegroundColor(); - color = NSColor.colorWithCalibratedRed (foreground.handle [0], foreground.handle [1], foreground.handle [2], 1); + color = NSColor.colorWithDeviceRed (foreground.handle [0], foreground.handle [1], foreground.handle [2], 1); } } else { color = NSColor.disabledControlTextColor(); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TaskItem.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TaskItem.java index a905bb6551..921bb7263f 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TaskItem.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TaskItem.java @@ -415,7 +415,7 @@ void updateImage () { NSImage newImage = (NSImage)new NSImage().alloc (); newImage = newImage.initWithSize (size); NSBitmapImageRep rep = (NSBitmapImageRep)new NSBitmapImageRep ().alloc (); - rep = rep.initWithBitmapDataPlanes (0, (int)size.width, (int)size.height, 8, 4, true, false, OS.NSCalibratedRGBColorSpace, OS.NSAlphaFirstBitmapFormat | OS.NSAlphaNonpremultipliedBitmapFormat, (int)size.width * 4, 32); + rep = rep.initWithBitmapDataPlanes (0, (int)size.width, (int)size.height, 8, 4, true, false, OS.NSDeviceRGBColorSpace, OS.NSAlphaFirstBitmapFormat | OS.NSAlphaNonpremultipliedBitmapFormat, (int)size.width * 4, 32); newImage.addRepresentation (rep); rep.release (); @@ -439,13 +439,13 @@ void updateImage () { if (drawIntermidiate || drawProgress) { switch (progressState) { case SWT.ERROR: - NSColor.colorWithCalibratedRed (1, 0, 0, 0.6f).setFill (); + NSColor.colorWithDeviceRed (1, 0, 0, 0.6f).setFill (); break; case SWT.PAUSED: - NSColor.colorWithCalibratedRed (1, 1, 0, 0.6f).setFill (); + NSColor.colorWithDeviceRed (1, 1, 0, 0.6f).setFill (); break; default: - NSColor.colorWithCalibratedRed (1, 1, 1, 0.6f).setFill (); + NSColor.colorWithDeviceRed (1, 1, 1, 0.6f).setFill (); } rect.width = size.width / (PROGRESS_BARS * 2 - 1); rect.height = size.height / 3; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Text.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Text.java index 95a1d4032a..5647139030 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Text.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Text.java @@ -1690,7 +1690,7 @@ void setForeground (float /*double*/ [] color) { } else { float /*double*/ alpha = 1; if ((style & SWT.MULTI) != 0 && !isEnabled()) alpha = 0.5f; - nsColor = NSColor.colorWithCalibratedRed (color [0], color [1], color [2], alpha); + nsColor = NSColor.colorWithDeviceRed (color [0], color [1], color [2], alpha); } if ((style & SWT.SINGLE) != 0) { ((NSTextField) view).setTextColor (nsColor); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolItem.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolItem.java index 8ea4570086..63577564e2 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolItem.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolItem.java @@ -437,7 +437,7 @@ void drawImageWithFrameInView (int /*long*/ id, int /*long*/ sel, int /*long*/ i super.drawImageWithFrameInView(id, sel, image, rect, view); if (drawSelected) { - NSColor.colorWithCalibratedRed(0,0,0,.3f).setFill(); + NSColor.colorWithDeviceRed(0,0,0,.3f).setFill(); OS.NSRectFillUsingOperation(rect, OS.NSCompositeSourceAtop); OS.CGContextEndTransparencyLayer(cgContext); NSGraphicsContext.currentContext().restoreGraphicsState(); @@ -449,7 +449,7 @@ NSRect drawTitleWithFrameInView (int /*long*/ id, int /*long*/ sel, int /*long*/ // An unbordered cell doesn't draw any highlighting when pushed or selected, so we have to do it here. if (hiliteShadow) { - NSColor transWhiteColor = NSColor.colorWithCalibratedRed(1.0f, 1.0f, 1.0f, .8f); + NSColor transWhiteColor = NSColor.colorWithDeviceRed(1.0f, 1.0f, 1.0f, .8f); NSAttributedString attribStr = new NSAttributedString(title); NSMutableAttributedString tmpString = new NSMutableAttributedString(attribStr.mutableCopy()); NSRange range = new NSRange(); @@ -468,8 +468,8 @@ void drawWidget (int /*long*/ id, NSGraphicsContext context, NSRect rect) { if (drawSelected) { NSRect bounds = view.bounds(); context.saveGraphicsState(); - NSColor.colorWithCalibratedRed(0.1f, 0.1f, 0.1f, 0.1f).setFill(); - NSColor.colorWithCalibratedRed(0.2f, 0.2f, 0.2f, 0.2f).setStroke(); + NSColor.colorWithDeviceRed(0.1f, 0.1f, 0.1f, 0.1f).setFill(); + NSColor.colorWithDeviceRed(0.2f, 0.2f, 0.2f, 0.2f).setStroke(); NSBezierPath.fillRect(bounds); bounds.x += 0.5f; bounds.y += 0.5f; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tree.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tree.java index 598e1a89d0..b108f6c8e1 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tree.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tree.java @@ -1083,7 +1083,7 @@ void drawInteriorWithFrame_inView (int /*long*/ id, int /*long*/ sel, NSRect rec if (drawBackground && !drawSelection) { context.saveGraphicsState (); float /*double*/ [] colorRGB = background.handle; - NSColor color = NSColor.colorWithCalibratedRed (colorRGB[0], colorRGB[1], colorRGB[2], 1f); + NSColor color = NSColor.colorWithDeviceRed (colorRGB[0], colorRGB[1], colorRGB[2], 1f); color.setFill (); NSBezierPath.fillRect (cellRect); context.restoreGraphicsState (); @@ -1163,7 +1163,7 @@ void drawInteriorWithFrame_inView (int /*long*/ id, int /*long*/ sel, NSRect rec newStr.drawInRect(newRect); newStr.release(); } else { - NSColor nsColor = NSColor.colorWithCalibratedRed(color[0], color[1], color[2], color[3]); + NSColor nsColor = NSColor.colorWithDeviceRed(color[0], color[1], color[2], color[3]); cell.setTextColor(nsColor); callSuper = true; } @@ -2191,7 +2191,7 @@ void outlineView_willDisplayCell_forTableColumn_item (int /*long*/ id, int /*lon Color foreground = item.cellForeground != null ? item.cellForeground [index] : null; if (foreground == null) foreground = item.foreground; if (foreground == null) foreground = getForegroundColor (); - color = NSColor.colorWithCalibratedRed (foreground.handle [0], foreground.handle [1], foreground.handle [2], 1); + color = NSColor.colorWithDeviceRed (foreground.handle [0], foreground.handle [1], foreground.handle [2], 1); } } else { color = NSColor.disabledControlTextColor(); |