summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/carbon/org
diff options
context:
space:
mode:
authorVeronika Irvine <veronika>2002-10-25 15:51:27 +0000
committerVeronika Irvine <veronika>2002-10-25 15:51:27 +0000
commitf9ed50f9ace82d49eea0f85fd833127ec62460e7 (patch)
tree46d0870fb5c3c15d98eebb0cfe3d72017f5057d2 /bundles/org.eclipse.swt/Eclipse SWT/carbon/org
parent6f1328f9571f55f1e4b8672dcde929e3ba698fe0 (diff)
downloadeclipse.platform.swt-f9ed50f9ace82d49eea0f85fd833127ec62460e7.tar.gz
eclipse.platform.swt-f9ed50f9ace82d49eea0f85fd833127ec62460e7.tar.xz
eclipse.platform.swt-f9ed50f9ace82d49eea0f85fd833127ec62460e7.zip
Inlining RGBBackColor and RGBForeColor
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/carbon/org')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/GC.java14
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/MacUtil.java29
2 files changed, 32 insertions, 11 deletions
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 603af72c43..509124c45c 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
@@ -11,6 +11,7 @@ import org.eclipse.swt.SWT;
import org.eclipse.swt.internal.carbon.OS;
import org.eclipse.swt.internal.carbon.Rect;
import org.eclipse.swt.widgets.MacUtil;
+import org.eclipse.swt.internal.carbon.RGBColor;
/**
* Class <code>GC</code> is where all of the drawing capabilities that are
@@ -372,9 +373,16 @@ void drawImage(Image srcImage, int srcX, int srcY, int srcWidth, int srcHeight,
Rect rect= new Rect();
rect.left= (short)destX; rect.top= (short)destY;
rect.right= (short)(destX + destWidth); rect.bottom= (short)(destY + destHeight);
-
- OS.RGBBackColor((short)0xFFFF, (short)0xFFFF, (short)0xFFFF);
- OS.RGBForeColor((short)0x0000, (short)0x0000, (short)0x0000);
+
+ RGBColor color = new RGBColor();
+ color.red = (short)0xFFFF;
+ color.green = (short)0xFFFF;
+ color.blue = (short)0xFFFF;
+ OS.RGBBackColor(color);
+ color.red = (short)0x0000;
+ color.green = (short)0x0000;
+ color.blue = (short)0x0000;
+ OS.RGBForeColor(color);
if (srcImage.alpha != -1 || srcImage.alphaData != null) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/MacUtil.java b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/MacUtil.java
index 7c9977b884..fe7c43796b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/MacUtil.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/MacUtil.java
@@ -15,6 +15,7 @@ import org.eclipse.swt.internal.carbon.CGPoint;
import org.eclipse.swt.internal.carbon.OS;
import org.eclipse.swt.internal.carbon.Point;
import org.eclipse.swt.internal.carbon.Rect;
+import org.eclipse.swt.internal.carbon.RGBColor;
public class MacUtil {
@@ -465,21 +466,33 @@ public class MacUtil {
public static void RGBBackColor(int packed) {
if ((packed & 0xff000000) == 0) {
- OS.RGBBackColor((short)(((packed >> 16) & 0xFF) * 257),
- (short)(((packed >> 8) & 0xFF) * 257),
- (short)(((packed) & 0xFF) * 257));
+ RGBColor color = new RGBColor();
+ color.red = (short)(((packed >> 16) & 0xFF) * 257);
+ color.green = (short)(((packed >> 8) & 0xFF) * 257);
+ color.blue = (short)(((packed) & 0xFF) * 257);
+ OS.RGBBackColor(color);
} else {
- OS.RGBBackColor((short)0xFFFF, (short)0xFFFF, (short)0xFFFF);
+ RGBColor color = new RGBColor();
+ color.red = (short)0xFFFF;
+ color.green = (short)0xFFFF;
+ color.blue = (short)0xFFFF;
+ OS.RGBBackColor(color);
}
}
public static void RGBForeColor(int packed) {
if ((packed & 0xff000000) == 0) {
- OS.RGBForeColor((short)(((packed >> 16) & 0xFF) * 257),
- (short)(((packed >> 8) & 0xFF) * 257),
- (short)(((packed) & 0xFF) * 257));
+ RGBColor color = new RGBColor();
+ color.red = (short)(((packed >> 16) & 0xFF) * 257);
+ color.green = (short)(((packed >> 8) & 0xFF) * 257);
+ color.blue = (short)(((packed) & 0xFF) * 257);
+ OS.RGBForeColor(color);
} else {
- OS.RGBForeColor((short)0xFFFF, (short)0xFFFF, (short)0xFFFF);
+ RGBColor color = new RGBColor();
+ color.red = (short)0xFFFF;
+ color.green = (short)0xFFFF;
+ color.blue = (short)0xFFFF;
+ OS.RGBForeColor(color);
}
}