summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Color.java
diff options
context:
space:
mode:
authorVeronika Irvine <veronika>2002-02-15 19:12:05 +0000
committerVeronika Irvine <veronika>2002-02-15 19:12:05 +0000
commit36fb2c4d46dcc0dfabf387f2edcc3b0a1c41cc24 (patch)
tree5eb8523b5bb4172cb1940758df51988d35cd5e98 /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Color.java
parented14b21fb9a158afaf8778b900fb426d9a5bc9ea (diff)
downloadeclipse.platform.swt-36fb2c4d46dcc0dfabf387f2edcc3b0a1c41cc24.tar.gz
eclipse.platform.swt-36fb2c4d46dcc0dfabf387f2edcc3b0a1c41cc24.tar.xz
eclipse.platform.swt-36fb2c4d46dcc0dfabf387f2edcc3b0a1c41cc24.zip
M3
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Color.java')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Color.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Color.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Color.java
index e796d2151c..9d479b0265 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Color.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Color.java
@@ -29,6 +29,8 @@ public final class Color {
*/
public GdkColor handle;
Device display;
+ boolean isSystem;
+
Color() {
}
/**
@@ -88,6 +90,7 @@ public Color(Device display, RGB rgb) {
* they allocate.
*/
public void dispose() {
+ if (isSystem) return;
/**
* If this is a palette-based display,
* Decrease the reference count for this color.
@@ -232,6 +235,11 @@ public static Color gtk_new(GdkColor gdkColor) {
Color color = new Color(null, gtk_getRGBIntensities(gdkColor));
return color;
}
+public static Color gtk_new_system(GdkColor gdkColor) {
+ Color color = new Color(null, gtk_getRGBIntensities(gdkColor));
+ color.isSystem = true;
+ return color;
+}
static RGB gtk_getRGBIntensities(GdkColor gdkColor) {
boolean intensitiesAreZero = (gdkColor.red==0) && (gdkColor.green==0) && (gdkColor.blue==0);