Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTill Brychcy2017-04-18 17:39:32 -0400
committerLakshmi Shanmugam2017-09-07 06:40:09 -0400
commit0650943303854f471afb27787b61aa951ffc6d5e (patch)
treeae230daae5dae0c52827d223ecb47037d57ad5cf /bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa
parentbb0fbf37910ce31e91c0b4095fcfe53b905817bc (diff)
downloadeclipse.platform.swt-0650943303854f471afb27787b61aa951ffc6d5e.tar.gz
eclipse.platform.swt-0650943303854f471afb27787b61aa951ffc6d5e.tar.xz
eclipse.platform.swt-0650943303854f471afb27787b61aa951ffc6d5e.zip
Bug 505835 - [Cocoa] Button, do not respect foreground and background
color on MAC Perform custom coloring for Button background. Change-Id: I34084136e206e08e8a97fe8198720a093abdd589 Signed-off-by: Till Brychcy <register.eclipse@brychcy.de>
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppKitFull.bridgesupport.extras20
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSButton.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSButtonCell.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSControl.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSGradient.java11
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java6
6 files changed, 48 insertions, 1 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 d9d49f3248..154fddbb11 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
@@ -552,6 +552,9 @@
<method selector="attributedTitle" swt_gen="true">
<retval swt_gen="true"></retval>
</method>
+ <method selector="bezelStyle" swt_gen="true">
+ <retval swt_gen="true"></retval>
+ </method>
<method selector="setAllowsMixedState:" swt_gen="true">
<arg swt_gen="true"></arg>
<retval swt_gen="true"></retval>
@@ -600,6 +603,11 @@
<method selector="backgroundColor" swt_gen="true">
<retval swt_gen="true"></retval>
</method>
+ <method selector="drawBezelWithFrame:inView:" swt_gen="true" swt_gen_custom_callback="true" swt_gen_super_msgSend="true">
+ <arg swt_gen="true"></arg>
+ <arg swt_gen="true"></arg>
+ <retval swt_gen="true"></retval>
+ </method>
<method selector="drawImage:withFrame:inView:" swt_gen="true" swt_gen_custom_callback="true" swt_gen_super_msgSend="true">
<arg swt_gen="true"></arg>
<arg swt_gen="true"></arg>
@@ -1056,6 +1064,9 @@
<method selector="isEnabled" swt_gen="true">
<retval swt_gen="true"></retval>
</method>
+ <method selector="isHighlighted" swt_gen="true">
+ <retval swt_gen="true"></retval>
+ </method>
<method selector="sendAction:to:" swt_gen="true">
<arg swt_gen="true"></arg>
<arg swt_gen="true"></arg>
@@ -1435,11 +1446,20 @@
<arg swt_gen="true"></arg>
<retval swt_gen="true"></retval>
</method>
+ <method selector="drawInBezierPath:angle:" swt_gen="true">
+ <arg swt_gen="true"></arg>
+ <arg swt_gen="true"></arg>
+ <retval swt_gen="true"></retval>
+ </method>
<method selector="drawInRect:angle:" swt_gen="true">
<arg swt_gen="true"></arg>
<arg swt_gen="true"></arg>
<retval swt_gen="true"></retval>
</method>
+ <method selector="initWithColors:" swt_gen="true">
+ <arg swt_gen="true"></arg>
+ <retval swt_gen="true"></retval>
+ </method>
<method selector="initWithStartingColor:endingColor:" swt_gen="true">
<arg swt_gen="true"></arg>
<arg swt_gen="true"></arg>
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSButton.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSButton.java
index ac9edf4477..faa83f9e8c 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSButton.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSButton.java
@@ -29,6 +29,10 @@ public NSAttributedString attributedTitle() {
return result != 0 ? new NSAttributedString(result) : null;
}
+public long /*int*/ bezelStyle() {
+ return OS.objc_msgSend(this.id, OS.sel_bezelStyle);
+}
+
public void setAllowsMixedState(boolean allowsMixedState) {
OS.objc_msgSend(this.id, OS.sel_setAllowsMixedState_, allowsMixedState);
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSButtonCell.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSButtonCell.java
index f90fa8993a..35b08c299b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSButtonCell.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSButtonCell.java
@@ -29,6 +29,10 @@ public NSColor backgroundColor() {
return result != 0 ? new NSColor(result) : null;
}
+public void drawBezelWithFrame(NSRect frame, NSView controlView) {
+ OS.objc_msgSend(this.id, OS.sel_drawBezelWithFrame_inView_, frame, controlView != null ? controlView.id : 0);
+}
+
public void drawImage(NSImage image, NSRect frame, NSView controlView) {
OS.objc_msgSend(this.id, OS.sel_drawImage_withFrame_inView_, image != null ? image.id : 0, frame, controlView != null ? controlView.id : 0);
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSControl.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSControl.java
index bc1fb2a51d..a3525c9d40 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSControl.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSControl.java
@@ -59,6 +59,10 @@ public boolean isEnabled() {
return OS.objc_msgSend_bool(this.id, OS.sel_isEnabled);
}
+public boolean isHighlighted() {
+ return OS.objc_msgSend_bool(this.id, OS.sel_isHighlighted);
+}
+
public boolean sendAction(long /*int*/ theAction, id theTarget) {
return OS.objc_msgSend_bool(this.id, OS.sel_sendAction_to_, theAction, theTarget != null ? theTarget.id : 0);
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSGradient.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSGradient.java
index 25ac9ae263..0cd55d9623 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSGradient.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSGradient.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2017 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
@@ -28,10 +28,19 @@ public void drawFromPoint(NSPoint startingPoint, NSPoint endingPoint, long /*int
OS.objc_msgSend(this.id, OS.sel_drawFromPoint_toPoint_options_, startingPoint, endingPoint, options);
}
+public void drawInBezierPath(NSBezierPath path, double /*float*/ angle) {
+ OS.objc_msgSend(this.id, OS.sel_drawInBezierPath_angle_, path != null ? path.id : 0, angle);
+}
+
public void drawInRect(NSRect rect, double /*float*/ angle) {
OS.objc_msgSend(this.id, OS.sel_drawInRect_angle_, rect, angle);
}
+public NSGradient initWithColors(NSArray colorArray) {
+ long /*int*/ result = OS.objc_msgSend(this.id, OS.sel_initWithColors_, colorArray != null ? colorArray.id : 0);
+ return result == this.id ? this : (result != 0 ? new NSGradient(result) : null);
+}
+
public NSGradient initWithStartingColor(NSColor startingColor, NSColor endingColor) {
long /*int*/ result = OS.objc_msgSend(this.id, OS.sel_initWithStartingColor_endingColor_, startingColor != null ? startingColor.id : 0, endingColor != null ? endingColor.id : 0);
return result == this.id ? this : (result != 0 ? new NSGradient(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 6e67c413d4..338419fb4b 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
@@ -703,6 +703,8 @@ public static final native long /*int*/ CALLBACK_draggedImage_beganAt_(long /*in
public static final native long /*int*/ CALLBACK_draggedImage_endedAt_operation_(long /*int*/ func);
/** @method callback_types=void;id;SEL;NSRect;,callback_flags=none;none;none;struct; */
public static final native long /*int*/ CALLBACK_drawBackgroundInClipRect_(long /*int*/ func);
+/** @method callback_types=void;id;SEL;NSRect;NSView*;,callback_flags=none;none;none;struct;none; */
+public static final native long /*int*/ CALLBACK_drawBezelWithFrame_inView_(long /*int*/ func);
/** @method callback_types=void;id;SEL;NSImage*;NSRect;NSView*;,callback_flags=none;none;none;none;struct;none; */
public static final native long /*int*/ CALLBACK_drawImage_withFrame_inView_(long /*int*/ func);
/** @method callback_types=void;id;SEL;NSRect;NSView*;,callback_flags=none;none;none;struct;none; */
@@ -1077,6 +1079,7 @@ public static final long /*int*/ sel_beginSheetForWindow_modalDelegate_didEndSel
public static final long /*int*/ sel_beginSheetModalForWindow_modalDelegate_didEndSelector_contextInfo_ = sel_registerName("beginSheetModalForWindow:modalDelegate:didEndSelector:contextInfo:");
public static final long /*int*/ sel_beginSheetWithPrintInfo_modalForWindow_delegate_didEndSelector_contextInfo_ = sel_registerName("beginSheetWithPrintInfo:modalForWindow:delegate:didEndSelector:contextInfo:");
public static final long /*int*/ sel_bestRepresentationForDevice_ = sel_registerName("bestRepresentationForDevice:");
+public static final long /*int*/ sel_bezelStyle = sel_registerName("bezelStyle");
public static final long /*int*/ sel_bezierPath = sel_registerName("bezierPath");
public static final long /*int*/ sel_bezierPathByFlatteningPath = sel_registerName("bezierPathByFlatteningPath");
public static final long /*int*/ sel_bezierPathWithRect_ = sel_registerName("bezierPathWithRect:");
@@ -1309,9 +1312,11 @@ public static final long /*int*/ sel_drawAtPoint_ = sel_registerName("drawAtPoin
public static final long /*int*/ sel_drawAtPoint_fromRect_operation_fraction_ = sel_registerName("drawAtPoint:fromRect:operation:fraction:");
public static final long /*int*/ sel_drawBackgroundForGlyphRange_atPoint_ = sel_registerName("drawBackgroundForGlyphRange:atPoint:");
public static final long /*int*/ sel_drawBackgroundInClipRect_ = sel_registerName("drawBackgroundInClipRect:");
+public static final long /*int*/ sel_drawBezelWithFrame_inView_ = sel_registerName("drawBezelWithFrame:inView:");
public static final long /*int*/ sel_drawFromPoint_toPoint_options_ = sel_registerName("drawFromPoint:toPoint:options:");
public static final long /*int*/ sel_drawGlyphsForGlyphRange_atPoint_ = sel_registerName("drawGlyphsForGlyphRange:atPoint:");
public static final long /*int*/ sel_drawImage_withFrame_inView_ = sel_registerName("drawImage:withFrame:inView:");
+public static final long /*int*/ sel_drawInBezierPath_angle_ = sel_registerName("drawInBezierPath:angle:");
public static final long /*int*/ sel_drawInRect_ = sel_registerName("drawInRect:");
public static final long /*int*/ sel_drawInRect_angle_ = sel_registerName("drawInRect:angle:");
public static final long /*int*/ sel_drawInRect_fromRect_operation_fraction_ = sel_registerName("drawInRect:fromRect:operation:fraction:");
@@ -1444,6 +1449,7 @@ public static final long /*int*/ sel_initWithBitmapDataPlanes_pixelsWide_pixelsH
public static final long /*int*/ sel_initWithBitmapDataPlanes_pixelsWide_pixelsHigh_bitsPerSample_samplesPerPixel_hasAlpha_isPlanar_colorSpaceName_bytesPerRow_bitsPerPixel_ = sel_registerName("initWithBitmapDataPlanes:pixelsWide:pixelsHigh:bitsPerSample:samplesPerPixel:hasAlpha:isPlanar:colorSpaceName:bytesPerRow:bitsPerPixel:");
public static final long /*int*/ sel_initWithCapacity_ = sel_registerName("initWithCapacity:");
public static final long /*int*/ sel_initWithCharacters_length_ = sel_registerName("initWithCharacters:length:");
+public static final long /*int*/ sel_initWithColors_ = sel_registerName("initWithColors:");
public static final long /*int*/ sel_initWithContainerSize_ = sel_registerName("initWithContainerSize:");
public static final long /*int*/ sel_initWithContentRect_styleMask_backing_defer_ = sel_registerName("initWithContentRect:styleMask:backing:defer:");
public static final long /*int*/ sel_initWithContentRect_styleMask_backing_defer_screen_ = sel_registerName("initWithContentRect:styleMask:backing:defer:screen:");

Back to the top