diff options
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics')
3 files changed, 15 insertions, 73 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/Cursor.java b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/Cursor.java index d79759d57f..7686a0a38d 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/Cursor.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/Cursor.java @@ -56,46 +56,6 @@ public final class Cursor extends Resource { static boolean initialized; - /** - * data and mask used to create a Resize NS Cursor - */ - static final byte [] SIZENS_SOURCE = new byte[] { - (byte)0x00, (byte)0x00, - (byte)0x01, (byte)0x80, - (byte)0x03, (byte)0xC0, - (byte)0x07, (byte)0xE0, - (byte)0x01, (byte)0x80, - (byte)0x01, (byte)0x80, - (byte)0x01, (byte)0x80, - (byte)0x7F, (byte)0xFE, - (byte)0x7F, (byte)0xFE, - (byte)0x01, (byte)0x80, - (byte)0x01, (byte)0x80, - (byte)0x01, (byte)0x80, - (byte)0x07, (byte)0xE0, - (byte)0x03, (byte)0xC0, - (byte)0x01, (byte)0x80, - (byte)0x00, (byte)0x00, - }; - static final byte [] SIZENS_MASK = new byte[] { - (byte)0x01, (byte)0x80, - (byte)0x03, (byte)0xC0, - (byte)0x07, (byte)0xE0, - (byte)0x0F, (byte)0xF0, - (byte)0x0F, (byte)0xF0, - (byte)0x03, (byte)0xC0, - (byte)0xFF, (byte)0xFF, - (byte)0xFF, (byte)0xFF, - (byte)0xFF, (byte)0xFF, - (byte)0xFF, (byte)0xFF, - (byte)0x03, (byte)0xC0, - (byte)0x0F, (byte)0xF0, - (byte)0x0F, (byte)0xF0, - (byte)0x07, (byte)0xE0, - (byte)0x03, (byte)0xC0, - (byte)0x01, (byte)0x80, - }; - /** * Prevents uninitialized instances from being created outside the package. */ @@ -156,25 +116,11 @@ public Cursor(Device device, int style) { case SWT.CURSOR_HELP: handle = OS.kThemeCrossCursor; break; case SWT.CURSOR_SIZEALL: handle = OS.kThemeCrossCursor; break; case SWT.CURSOR_SIZENESW: handle = OS.kThemeCrossCursor; break; - case SWT.CURSOR_SIZENS: { - if (OS.VERSION >= 0x1030) { - handle = OS.kThemeResizeUpDownCursor; - } else { - org.eclipse.swt.internal.carbon.Cursor cursor = new org.eclipse.swt.internal.carbon.Cursor(); - cursor.data = SIZENS_SOURCE; - cursor.mask = SIZENS_MASK; - cursor.hotSpot_h = 7; - cursor.hotSpot_v = 7; - handle = OS.NewPtr(org.eclipse.swt.internal.carbon.Cursor.sizeof); - if (handle == 0) SWT.error(SWT.ERROR_NO_HANDLES); - OS.memcpy(handle, cursor, org.eclipse.swt.internal.carbon.Cursor.sizeof); - } - break; - } + case SWT.CURSOR_SIZENS: handle = OS.kThemeResizeUpDownCursor; break; case SWT.CURSOR_SIZENWSE: handle = OS.kThemeCrossCursor; break; case SWT.CURSOR_SIZEWE: handle = OS.kThemeResizeLeftRightCursor; break; - case SWT.CURSOR_SIZEN: handle = OS.VERSION >= 0x1030 ? OS.kThemeResizeUpCursor : OS.kThemeCrossCursor; break; - case SWT.CURSOR_SIZES: handle = OS.VERSION >= 0x1030 ? OS.kThemeResizeDownCursor : OS.kThemeCrossCursor; break; + case SWT.CURSOR_SIZEN: handle = OS.kThemeResizeUpCursor; break; + case SWT.CURSOR_SIZES: handle = OS.kThemeResizeDownCursor; break; case SWT.CURSOR_SIZEE: handle = OS.kThemeResizeRightCursor; break; case SWT.CURSOR_SIZEW: handle = OS.kThemeResizeLeftCursor; break; case SWT.CURSOR_SIZENE: handle = OS.kThemeCrossCursor; break; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/GC.java b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/GC.java index 20f61362f0..8b06182be9 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/GC.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/GC.java @@ -772,16 +772,14 @@ public void drawArc(int x, int y, int width, int height, int startAngle, int arc public void drawFocus(int x, int y, int width, int height) { if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); if (data.updateClip) setCGClipping(); - if (OS.VERSION >= 0x1030) { - int[] metric = new int[1]; - OS.GetThemeMetric(OS.kThemeMetricFocusRectOutset, metric); - CGRect rect = new CGRect (); - rect.x = x + metric[0]; - rect.y = y + metric[0]; - rect.width = width - metric[0] * 2; - rect.height = height - metric[0] * 2; - OS.HIThemeDrawFocusRect(rect, true, handle, OS.kHIThemeOrientationNormal); - } + int[] metric = new int[1]; + OS.GetThemeMetric(OS.kThemeMetricFocusRectOutset, metric); + CGRect rect = new CGRect (); + rect.x = x + metric[0]; + rect.y = y + metric[0]; + rect.width = width - metric[0] * 2; + rect.height = height - metric[0] * 2; + OS.HIThemeDrawFocusRect(rect, true, handle, OS.kHIThemeOrientationNormal); flush(); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/TextLayout.java b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/TextLayout.java index f18ce838c5..9edaf103c7 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/TextLayout.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/TextLayout.java @@ -443,12 +443,10 @@ public void draw(GC gc, int x, int y, int selectionStart, int selectionEnd, Colo boolean hasSelection = selectionStart <= selectionEnd && selectionStart != -1 && selectionEnd != -1; boolean restoreColor = false; if (hasSelection && selectionBackground != null) { - if (OS.VERSION >= 0x1030) { - restoreColor = true; - int color = OS.CGColorCreate(device.colorspace, selectionBackground.handle); - setLayoutControl(OS.kATSULineHighlightCGColorTag, color, 4); - OS.CGColorRelease(color); - } + restoreColor = true; + int color = OS.CGColorCreate(device.colorspace, selectionBackground.handle); + setLayoutControl(OS.kATSULineHighlightCGColorTag, color, 4); + OS.CGColorRelease(color); } /* * Feature in ATSU. There is no API to set a background attribute |