Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Williams2018-09-10 19:13:18 +0000
committerEric Williams2018-09-11 20:56:48 +0000
commit653f05d5c8bf3e06e39139572ab8e000d66bc4bc (patch)
tree60c18895db634f101a41cb0f3e4496c1254360d8
parentb58bf5db027266016218db51d3e9570bf39af209 (diff)
downloadeclipse.platform.swt-653f05d5c8bf3e06e39139572ab8e000d66bc4bc.tar.gz
eclipse.platform.swt-653f05d5c8bf3e06e39139572ab8e000d66bc4bc.tar.xz
eclipse.platform.swt-653f05d5c8bf3e06e39139572ab8e000d66bc4bc.zip
Bug 530841: [GTK2] Remove GTK 2.x supportI20180912-0210
Remove GTK2 color logic/machinery. Change-Id: Icb9e076904420a80053ed556aa73fd831deaa964 Signed-off-by: Eric Williams <ericwill@redhat.com>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/AccessibleObject.java12
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TableDragSourceEffect.java10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TreeDragSourceEffect.java10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/internal/dnd/gtk/ListDragSourceEffect.java10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cairo/org/eclipse/swt/internal/cairo/Cairo.java12
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c574
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.h1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c50
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h50
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_structs.c40
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_structs.h12
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GDK.java131
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GTK.java220
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GdkColor.java28
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java28
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java9
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Color.java163
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Cursor.java119
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Device.java21
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java65
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GCData.java12
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java130
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/TextLayout.java102
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java18
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ColorDialog.java143
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java34
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java9
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java247
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java31
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java543
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandBar.java9
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandItem.java7
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Group.java16
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/IME.java62
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java18
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java25
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Sash.java18
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java25
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java14
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabItem.java7
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java112
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java96
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java54
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java8
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java28
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tracker.java141
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java114
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java96
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java47
51 files changed, 569 insertions, 3182 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/AccessibleObject.java b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/AccessibleObject.java
index 59c1969adb..9724e0b3c6 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/AccessibleObject.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/AccessibleObject.java
@@ -3044,11 +3044,7 @@ class AccessibleObject {
if (color != null && !color.isDisposed()) {
long /*int*/ attrPtr = OS.g_malloc(AtkAttribute.sizeof);
attr.name = OS.g_strdup (ATK.atk_text_attribute_get_name(ATK.ATK_TEXT_ATTR_FG_COLOR));
- if (GTK.GTK3) {
- attr.value = getStringPtr ((color.handleRGBA.red * 255) + "," + (color.handleRGBA.green * 255) + "," + (color.handleRGBA.blue * 255)); //$NON-NLS-1$ //$NON-NLS-2$
- } else {
- attr.value = getStringPtr ((color.handle.red & 0xFFFF) + "," + (color.handle.blue & 0xFFFF) + "," + (color.handle.blue & 0xFFFF)); //$NON-NLS-1$ //$NON-NLS-2$
- }
+ attr.value = getStringPtr ((color.handleRGBA.red * 255) + "," + (color.handleRGBA.green * 255) + "," + (color.handleRGBA.blue * 255)); //$NON-NLS-1$ //$NON-NLS-2$
ATK.memmove(attrPtr, attr, AtkAttribute.sizeof);
result = OS.g_slist_append(result, attrPtr);
}
@@ -3056,11 +3052,7 @@ class AccessibleObject {
if (color != null && !color.isDisposed()) {
long /*int*/ attrPtr = OS.g_malloc(AtkAttribute.sizeof);
attr.name = OS.g_strdup (ATK.atk_text_attribute_get_name(ATK.ATK_TEXT_ATTR_BG_COLOR));
- if (GTK.GTK3) {
- attr.value = getStringPtr ((color.handleRGBA.red * 255) + "," + (color.handleRGBA.green * 255) + "," + (color.handleRGBA.blue * 255)); //$NON-NLS-1$ //$NON-NLS-2$
- } else {
- attr.value = getStringPtr ((color.handle.red & 0xFFFF) + "," + (color.handle.blue & 0xFFFF) + "," + (color.handle.blue & 0xFFFF)); //$NON-NLS-1$ //$NON-NLS-2$
- }
+ attr.value = getStringPtr ((color.handleRGBA.red * 255) + "," + (color.handleRGBA.green * 255) + "," + (color.handleRGBA.blue * 255)); //$NON-NLS-1$ //$NON-NLS-2$
ATK.memmove(attrPtr, attr, AtkAttribute.sizeof);
result = OS.g_slist_append(result, attrPtr);
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TableDragSourceEffect.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TableDragSourceEffect.java
index bdaf2bf663..a167fbe98b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TableDragSourceEffect.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TableDragSourceEffect.java
@@ -165,15 +165,7 @@ public class TableDragSourceEffect extends DragSourceEffect {
}
}
Cairo.cairo_destroy(cairo);
- if (GTK.GTK3) {
- dragSourceImage = Image.gtk_new (display, SWT.ICON, surface, 0);
- } else {
- long /*int*/ pixbuf = GDK.gdk_pixbuf_new(GDK.GDK_COLORSPACE_RGB, true, 8, width, height);
- if (pixbuf == 0) SWT.error(SWT.ERROR_NO_HANDLES);
- long /*int*/ colormap = GDK.gdk_colormap_get_system();
- GDK.gdk_pixbuf_get_from_drawable(pixbuf, surface, colormap, 0, 0, 0, 0, width, height);
- dragSourceImage = Image.gtk_new_from_pixbuf(display, SWT.ICON, pixbuf);
- }
+ dragSourceImage = Image.gtk_new (display, SWT.ICON, surface, 0);
}
OS.g_list_free (originalList);
return dragSourceImage;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TreeDragSourceEffect.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TreeDragSourceEffect.java
index b89278ed78..e23b1c4bb8 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TreeDragSourceEffect.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TreeDragSourceEffect.java
@@ -164,15 +164,7 @@ public class TreeDragSourceEffect extends DragSourceEffect {
}
}
Cairo.cairo_destroy(cairo);
- if (GTK.GTK3) {
- dragSourceImage = Image.gtk_new (display, SWT.ICON, surface, 0);
- } else {
- long /*int*/ pixbuf = GDK.gdk_pixbuf_new(GDK.GDK_COLORSPACE_RGB, true, 8, width, height);
- if (pixbuf == 0) SWT.error(SWT.ERROR_NO_HANDLES);
- long /*int*/ colormap = GDK.gdk_colormap_get_system();
- GDK.gdk_pixbuf_get_from_drawable(pixbuf, surface, colormap, 0, 0, 0, 0, width, height);
- dragSourceImage = Image.gtk_new_from_pixbuf(display, SWT.ICON, pixbuf);
- }
+ dragSourceImage = Image.gtk_new (display, SWT.ICON, surface, 0);
}
OS.g_list_free (originalList);
return dragSourceImage;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/internal/dnd/gtk/ListDragSourceEffect.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/internal/dnd/gtk/ListDragSourceEffect.java
index 3a7ed05a62..96e105ba37 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/internal/dnd/gtk/ListDragSourceEffect.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/internal/dnd/gtk/ListDragSourceEffect.java
@@ -161,15 +161,7 @@ public class ListDragSourceEffect extends DragSourceEffect {
}
}
Cairo.cairo_destroy(cairo);
- if (GTK.GTK3) {
- dragSourceImage = Image.gtk_new (display, SWT.ICON, surface, 0);
- } else {
- long /*int*/ pixbuf = GDK.gdk_pixbuf_new(GDK.GDK_COLORSPACE_RGB, true, 8, width, height);
- if (pixbuf == 0) SWT.error(SWT.ERROR_NO_HANDLES);
- long /*int*/ colormap = GDK.gdk_colormap_get_system();
- GDK.gdk_pixbuf_get_from_drawable(pixbuf, surface, colormap, 0, 0, 0, 0, width, height);
- dragSourceImage = Image.gtk_new_from_pixbuf(display, SWT.ICON, pixbuf);
- }
+ dragSourceImage = Image.gtk_new (display, SWT.ICON, surface, 0);
}
OS.g_list_free (originalList);
return dragSourceImage;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cairo/org/eclipse/swt/internal/cairo/Cairo.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cairo/org/eclipse/swt/internal/cairo/Cairo.java
index 90e5e11c7a..3c47925620 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/cairo/org/eclipse/swt/internal/cairo/Cairo.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cairo/org/eclipse/swt/internal/cairo/Cairo.java
@@ -21,7 +21,6 @@
package org.eclipse.swt.internal.cairo;
import org.eclipse.swt.internal.*;
-import org.eclipse.swt.internal.gtk.*;
public class Cairo extends Platform {
static {
@@ -1029,17 +1028,6 @@ public static final void cairo_set_source_rgb(long /*int*/ cr, double red, doubl
lock.unlock();
}
}
-/*
- * In some cases we need to call cairo_set_source_rgba() on GTK2, which
- * cannot use GdkRGBA objects. Convert the GdkColor object into doubles
- * can call cairo_set_source_rgba() using those values instead.
- */
-public static void cairo_set_source_rgba_compatibility (long /*int*/ cairo, GdkColor color) {
- double red = (color.red & 0xFFFF) / (float)0xFFFF;
- double green = (color.green & 0xFFFF) / (float)0xFFFF;
- double blue = (color.blue & 0xFFFF) / (float)0xFFFF;
- Cairo.cairo_set_source_rgba (cairo, red, green, blue, 1.0);
-}
/** @param cr cast=(cairo_t *) */
public static final native void _cairo_set_source_rgba(long /*int*/ cr, double red, double green, double blue, double alpha);
public static final void cairo_set_source_rgba(long /*int*/ cr, double red, double green, double blue, double alpha) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c
index 596c69a177..8547094f26 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c
@@ -60,18 +60,6 @@ JNIEXPORT jboolean JNICALL GDK_NATIVE(GDK_1IS_1X11_1DISPLAY)
}
#endif
-#ifndef NO_GdkColor_1sizeof
-JNIEXPORT jint JNICALL GDK_NATIVE(GdkColor_1sizeof)
- (JNIEnv *env, jclass that)
-{
- jint rc = 0;
- GDK_NATIVE_ENTER(env, that, GdkColor_1sizeof_FUNC);
- rc = (jint)GdkColor_sizeof();
- GDK_NATIVE_EXIT(env, that, GdkColor_1sizeof_FUNC);
- return rc;
-}
-#endif
-
#ifndef NO_GdkDragContext_1sizeof
JNIEXPORT jint JNICALL GDK_NATIVE(GdkDragContext_1sizeof)
(JNIEnv *env, jclass that)
@@ -276,18 +264,6 @@ JNIEXPORT jintLong JNICALL GDK_NATIVE(_1GDK_1PIXMAP_1XID)
}
#endif
-#ifndef NO__1GDK_1TYPE_1COLOR
-JNIEXPORT jintLong JNICALL GDK_NATIVE(_1GDK_1TYPE_1COLOR)
- (JNIEnv *env, jclass that)
-{
- jintLong rc = 0;
- GDK_NATIVE_ENTER(env, that, _1GDK_1TYPE_1COLOR_FUNC);
- rc = (jintLong)GDK_TYPE_COLOR;
- GDK_NATIVE_EXIT(env, that, _1GDK_1TYPE_1COLOR_FUNC);
- return rc;
-}
-#endif
-
#ifndef NO__1GDK_1TYPE_1PIXBUF
JNIEXPORT jintLong JNICALL GDK_NATIVE(_1GDK_1TYPE_1PIXBUF)
(JNIEnv *env, jclass that)
@@ -464,28 +440,6 @@ JNIEXPORT void JNICALL GDK_NATIVE(_1gdk_1cairo_1reset_1clip)
}
#endif
-#ifndef NO__1gdk_1cairo_1set_1source_1color
-JNIEXPORT void JNICALL GDK_NATIVE(_1gdk_1cairo_1set_1source_1color)
- (JNIEnv *env, jclass that, jintLong arg0, jobject arg1)
-{
- GdkColor _arg1, *lparg1=NULL;
- GDK_NATIVE_ENTER(env, that, _1gdk_1cairo_1set_1source_1color_FUNC);
- if (arg1) if ((lparg1 = getGdkColorFields(env, arg1, &_arg1)) == NULL) goto fail;
-/*
- gdk_cairo_set_source_color(arg0, lparg1);
-*/
- {
- GDK_LOAD_FUNCTION(fp, gdk_cairo_set_source_color)
- if (fp) {
- ((void (CALLING_CONVENTION*)(jintLong, GdkColor *))fp)(arg0, lparg1);
- }
- }
-fail:
- if (arg1 && lparg1) setGdkColorFields(env, arg1, lparg1);
- GDK_NATIVE_EXIT(env, that, _1gdk_1cairo_1set_1source_1color_FUNC);
-}
-#endif
-
#ifndef NO__1gdk_1cairo_1set_1source_1pixbuf
JNIEXPORT void JNICALL GDK_NATIVE(_1gdk_1cairo_1set_1source_1pixbuf)
(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jdouble arg2, jdouble arg3)
@@ -562,140 +516,6 @@ JNIEXPORT void JNICALL GDK_NATIVE(_1gdk_1cairo_1set_1source_1window)
}
#endif
-#ifndef NO__1gdk_1color_1free
-JNIEXPORT void JNICALL GDK_NATIVE(_1gdk_1color_1free)
- (JNIEnv *env, jclass that, jintLong arg0)
-{
- GDK_NATIVE_ENTER(env, that, _1gdk_1color_1free_FUNC);
-/*
- gdk_color_free((GdkColor *)arg0);
-*/
- {
- GDK_LOAD_FUNCTION(fp, gdk_color_free)
- if (fp) {
- ((void (CALLING_CONVENTION*)(GdkColor *))fp)((GdkColor *)arg0);
- }
- }
- GDK_NATIVE_EXIT(env, that, _1gdk_1color_1free_FUNC);
-}
-#endif
-
-#ifndef NO__1gdk_1color_1parse
-JNIEXPORT jboolean JNICALL GDK_NATIVE(_1gdk_1color_1parse)
- (JNIEnv *env, jclass that, jbyteArray arg0, jobject arg1)
-{
- jbyte *lparg0=NULL;
- GdkColor _arg1, *lparg1=NULL;
- jboolean rc = 0;
- GDK_NATIVE_ENTER(env, that, _1gdk_1color_1parse_FUNC);
- if (arg0) if ((lparg0 = (*env)->GetByteArrayElements(env, arg0, NULL)) == NULL) goto fail;
- if (arg1) if ((lparg1 = &_arg1) == NULL) goto fail;
-/*
- rc = (jboolean)gdk_color_parse((const gchar *)lparg0, (GdkColor *)lparg1);
-*/
- {
- GDK_LOAD_FUNCTION(fp, gdk_color_parse)
- if (fp) {
- rc = (jboolean)((jboolean (CALLING_CONVENTION*)(const gchar *, GdkColor *))fp)((const gchar *)lparg0, (GdkColor *)lparg1);
- }
- }
-fail:
- if (arg1 && lparg1) setGdkColorFields(env, arg1, lparg1);
- if (arg0 && lparg0) (*env)->ReleaseByteArrayElements(env, arg0, lparg0, 0);
- GDK_NATIVE_EXIT(env, that, _1gdk_1color_1parse_FUNC);
- return rc;
-}
-#endif
-
-#ifndef NO__1gdk_1color_1white
-JNIEXPORT jboolean JNICALL GDK_NATIVE(_1gdk_1color_1white)
- (JNIEnv *env, jclass that, jintLong arg0, jobject arg1)
-{
- GdkColor _arg1, *lparg1=NULL;
- jboolean rc = 0;
- GDK_NATIVE_ENTER(env, that, _1gdk_1color_1white_FUNC);
- if (arg1) if ((lparg1 = &_arg1) == NULL) goto fail;
-/*
- rc = (jboolean)gdk_color_white(arg0, lparg1);
-*/
- {
- GDK_LOAD_FUNCTION(fp, gdk_color_white)
- if (fp) {
- rc = (jboolean)((jboolean (CALLING_CONVENTION*)(jintLong, GdkColor *))fp)(arg0, lparg1);
- }
- }
-fail:
- if (arg1 && lparg1) setGdkColorFields(env, arg1, lparg1);
- GDK_NATIVE_EXIT(env, that, _1gdk_1color_1white_FUNC);
- return rc;
-}
-#endif
-
-#ifndef NO__1gdk_1colormap_1alloc_1color
-JNIEXPORT jboolean JNICALL GDK_NATIVE(_1gdk_1colormap_1alloc_1color)
- (JNIEnv *env, jclass that, jintLong arg0, jobject arg1, jboolean arg2, jboolean arg3)
-{
- GdkColor _arg1, *lparg1=NULL;
- jboolean rc = 0;
- GDK_NATIVE_ENTER(env, that, _1gdk_1colormap_1alloc_1color_FUNC);
- if (arg1) if ((lparg1 = getGdkColorFields(env, arg1, &_arg1)) == NULL) goto fail;
-/*
- rc = (jboolean)gdk_colormap_alloc_color(arg0, (GdkColor *)lparg1, (gboolean)arg2, (gboolean)arg3);
-*/
- {
- GDK_LOAD_FUNCTION(fp, gdk_colormap_alloc_color)
- if (fp) {
- rc = (jboolean)((jboolean (CALLING_CONVENTION*)(jintLong, GdkColor *, gboolean, gboolean))fp)(arg0, (GdkColor *)lparg1, (gboolean)arg2, (gboolean)arg3);
- }
- }
-fail:
- if (arg1 && lparg1) setGdkColorFields(env, arg1, lparg1);
- GDK_NATIVE_EXIT(env, that, _1gdk_1colormap_1alloc_1color_FUNC);
- return rc;
-}
-#endif
-
-#ifndef NO__1gdk_1colormap_1free_1colors
-JNIEXPORT void JNICALL GDK_NATIVE(_1gdk_1colormap_1free_1colors)
- (JNIEnv *env, jclass that, jintLong arg0, jobject arg1, jint arg2)
-{
- GdkColor _arg1, *lparg1=NULL;
- GDK_NATIVE_ENTER(env, that, _1gdk_1colormap_1free_1colors_FUNC);
- if (arg1) if ((lparg1 = getGdkColorFields(env, arg1, &_arg1)) == NULL) goto fail;
-/*
- gdk_colormap_free_colors(arg0, (GdkColor *)lparg1, (gint)arg2);
-*/
- {
- GDK_LOAD_FUNCTION(fp, gdk_colormap_free_colors)
- if (fp) {
- ((void (CALLING_CONVENTION*)(jintLong, GdkColor *, gint))fp)(arg0, (GdkColor *)lparg1, (gint)arg2);
- }
- }
-fail:
- GDK_NATIVE_EXIT(env, that, _1gdk_1colormap_1free_1colors_FUNC);
-}
-#endif
-
-#ifndef NO__1gdk_1colormap_1get_1system
-JNIEXPORT jintLong JNICALL GDK_NATIVE(_1gdk_1colormap_1get_1system)
- (JNIEnv *env, jclass that)
-{
- jintLong rc = 0;
- GDK_NATIVE_ENTER(env, that, _1gdk_1colormap_1get_1system_FUNC);
-/*
- rc = (jintLong)gdk_colormap_get_system();
-*/
- {
- GDK_LOAD_FUNCTION(fp, gdk_colormap_get_system)
- if (fp) {
- rc = (jintLong)((jintLong (CALLING_CONVENTION*)())fp)();
- }
- }
- GDK_NATIVE_EXIT(env, that, _1gdk_1colormap_1get_1system_FUNC);
- return rc;
-}
-#endif
-
#ifndef NO__1gdk_1cursor_1new_1for_1display
JNIEXPORT jintLong JNICALL GDK_NATIVE(_1gdk_1cursor_1new_1for_1display)
(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1)
@@ -744,31 +564,6 @@ JNIEXPORT jintLong JNICALL GDK_NATIVE(_1gdk_1cursor_1new_1from_1pixbuf)
}
#endif
-#ifndef NO__1gdk_1cursor_1new_1from_1pixmap
-JNIEXPORT jintLong JNICALL GDK_NATIVE(_1gdk_1cursor_1new_1from_1pixmap)
- (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jobject arg2, jobject arg3, jint arg4, jint arg5)
-{
- GdkColor _arg2, *lparg2=NULL;
- GdkColor _arg3, *lparg3=NULL;
- jintLong rc = 0;
- GDK_NATIVE_ENTER(env, that, _1gdk_1cursor_1new_1from_1pixmap_FUNC);
- if (arg2) if ((lparg2 = getGdkColorFields(env, arg2, &_arg2)) == NULL) goto fail;
- if (arg3) if ((lparg3 = getGdkColorFields(env, arg3, &_arg3)) == NULL) goto fail;
-/*
- rc = (jintLong)gdk_cursor_new_from_pixmap(arg0, arg1, (GdkColor *)lparg2, (GdkColor *)lparg3, (gint)arg4, (gint)arg5);
-*/
- {
- GDK_LOAD_FUNCTION(fp, gdk_cursor_new_from_pixmap)
- if (fp) {
- rc = (jintLong)((jintLong (CALLING_CONVENTION*)(jintLong, jintLong, GdkColor *, GdkColor *, gint, gint))fp)(arg0, arg1, (GdkColor *)lparg2, (GdkColor *)lparg3, (gint)arg4, (gint)arg5);
- }
- }
-fail:
- GDK_NATIVE_EXIT(env, that, _1gdk_1cursor_1new_1from_1pixmap_FUNC);
- return rc;
-}
-#endif
-
#ifndef NO__1gdk_1cursor_1unref
JNIEXPORT void JNICALL GDK_NATIVE(_1gdk_1cursor_1unref)
(JNIEnv *env, jclass that, jintLong arg0)
@@ -1570,27 +1365,6 @@ JNIEXPORT void JNICALL GDK_NATIVE(_1gdk_1gc_1set_1fill)
}
#endif
-#ifndef NO__1gdk_1gc_1set_1foreground
-JNIEXPORT void JNICALL GDK_NATIVE(_1gdk_1gc_1set_1foreground)
- (JNIEnv *env, jclass that, jintLong arg0, jobject arg1)
-{
- GdkColor _arg1, *lparg1=NULL;
- GDK_NATIVE_ENTER(env, that, _1gdk_1gc_1set_1foreground_FUNC);
- if (arg1) if ((lparg1 = getGdkColorFields(env, arg1, &_arg1)) == NULL) goto fail;
-/*
- gdk_gc_set_foreground(arg0, lparg1);
-*/
- {
- GDK_LOAD_FUNCTION(fp, gdk_gc_set_foreground)
- if (fp) {
- ((void (CALLING_CONVENTION*)(jintLong, GdkColor *))fp)(arg0, lparg1);
- }
- }
-fail:
- GDK_NATIVE_EXIT(env, that, _1gdk_1gc_1set_1foreground_FUNC);
-}
-#endif
-
#ifndef NO__1gdk_1gc_1set_1function
JNIEXPORT void JNICALL GDK_NATIVE(_1gdk_1gc_1set_1function)
(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1)
@@ -5389,28 +5163,6 @@ fail:
}
#endif
-#ifndef NO__1gtk_1color_1selection_1get_1current_1color
-JNIEXPORT void JNICALL GTK_NATIVE(_1gtk_1color_1selection_1get_1current_1color)
- (JNIEnv *env, jclass that, jintLong arg0, jobject arg1)
-{
- GdkColor _arg1, *lparg1=NULL;
- GTK_NATIVE_ENTER(env, that, _1gtk_1color_1selection_1get_1current_1color_FUNC);
- if (arg1) if ((lparg1 = &_arg1) == NULL) goto fail;
-/*
- gtk_color_selection_get_current_color(arg0, lparg1);
-*/
- {
- GTK_LOAD_FUNCTION(fp, gtk_color_selection_get_current_color)
- if (fp) {
- ((void (CALLING_CONVENTION*)(jintLong, GdkColor *))fp)(arg0, lparg1);
- }
- }
-fail:
- if (arg1 && lparg1) setGdkColorFields(env, arg1, lparg1);
- GTK_NATIVE_EXIT(env, that, _1gtk_1color_1selection_1get_1current_1color_FUNC);
-}
-#endif
-
#ifndef NO__1gtk_1color_1selection_1palette_1to_1string
JNIEXPORT jintLong JNICALL GTK_NATIVE(_1gtk_1color_1selection_1palette_1to_1string)
(JNIEnv *env, jclass that, jintLong arg0, jint arg1)
@@ -5431,27 +5183,6 @@ JNIEXPORT jintLong JNICALL GTK_NATIVE(_1gtk_1color_1selection_1palette_1to_1stri
}
#endif
-#ifndef NO__1gtk_1color_1selection_1set_1current_1color
-JNIEXPORT void JNICALL GTK_NATIVE(_1gtk_1color_1selection_1set_1current_1color)
- (JNIEnv *env, jclass that, jintLong arg0, jobject arg1)
-{
- GdkColor _arg1, *lparg1=NULL;
- GTK_NATIVE_ENTER(env, that, _1gtk_1color_1selection_1set_1current_1color_FUNC);
- if (arg1) if ((lparg1 = getGdkColorFields(env, arg1, &_arg1)) == NULL) goto fail;
-/*
- gtk_color_selection_set_current_color(arg0, lparg1);
-*/
- {
- GTK_LOAD_FUNCTION(fp, gtk_color_selection_set_current_color)
- if (fp) {
- ((void (CALLING_CONVENTION*)(jintLong, GdkColor *))fp)(arg0, lparg1);
- }
- }
-fail:
- GTK_NATIVE_EXIT(env, that, _1gtk_1color_1selection_1set_1current_1color_FUNC);
-}
-#endif
-
#ifndef NO__1gtk_1color_1selection_1set_1has_1palette
JNIEXPORT void JNICALL GTK_NATIVE(_1gtk_1color_1selection_1set_1has_1palette)
(JNIEnv *env, jclass that, jintLong arg0, jboolean arg1)
@@ -8218,30 +7949,6 @@ JNIEXPORT void JNICALL GTK_NATIVE(_1gtk_1list_1store_1set__JJIJI)(JNIEnv *env, j
}
#endif
-#if (!defined(NO__1gtk_1list_1store_1set__IIILorg_eclipse_swt_internal_gtk_GdkColor_2I) && !defined(JNI64)) || (!defined(NO__1gtk_1list_1store_1set__JJILorg_eclipse_swt_internal_gtk_GdkColor_2I) && defined(JNI64))
-#ifndef JNI64
-JNIEXPORT void JNICALL GTK_NATIVE(_1gtk_1list_1store_1set__IIILorg_eclipse_swt_internal_gtk_GdkColor_2I)(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jint arg2, jobject arg3, jint arg4)
-#else
-JNIEXPORT void JNICALL GTK_NATIVE(_1gtk_1list_1store_1set__JJILorg_eclipse_swt_internal_gtk_GdkColor_2I)(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jint arg2, jobject arg3, jint arg4)
-#endif
-{
- GdkColor _arg3, *lparg3=NULL;
-#ifndef JNI64
- GTK_NATIVE_ENTER(env, that, _1gtk_1list_1store_1set__IIILorg_eclipse_swt_internal_gtk_GdkColor_2I_FUNC);
-#else
- GTK_NATIVE_ENTER(env, that, _1gtk_1list_1store_1set__JJILorg_eclipse_swt_internal_gtk_GdkColor_2I_FUNC);
-#endif
- if (arg3) if ((lparg3 = getGdkColorFields(env, arg3, &_arg3)) == NULL) goto fail;
- gtk_list_store_set((GtkListStore *)arg0, (GtkTreeIter *)arg1, arg2, lparg3, arg4);
-fail:
-#ifndef JNI64
- GTK_NATIVE_EXIT(env, that, _1gtk_1list_1store_1set__IIILorg_eclipse_swt_internal_gtk_GdkColor_2I_FUNC);
-#else
- GTK_NATIVE_EXIT(env, that, _1gtk_1list_1store_1set__JJILorg_eclipse_swt_internal_gtk_GdkColor_2I_FUNC);
-#endif
-}
-#endif
-
#if (!defined(NO__1gtk_1list_1store_1set__IIILorg_eclipse_swt_internal_gtk_GdkRGBA_2I) && !defined(JNI64)) || (!defined(NO__1gtk_1list_1store_1set__JJILorg_eclipse_swt_internal_gtk_GdkRGBA_2I) && defined(JNI64))
#ifndef JNI64
JNIEXPORT void JNICALL GTK_NATIVE(_1gtk_1list_1store_1set__IIILorg_eclipse_swt_internal_gtk_GdkRGBA_2I)(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jint arg2, jobject arg3, jint arg4)
@@ -9801,19 +9508,6 @@ JNIEXPORT jint JNICALL GTK_NATIVE(_1gtk_1rc_1style_1get_1color_1flags)
}
#endif
-#ifndef NO__1gtk_1rc_1style_1set_1bg
-JNIEXPORT void JNICALL GTK_NATIVE(_1gtk_1rc_1style_1set_1bg)
- (JNIEnv *env, jclass that, jintLong arg0, jint arg1, jobject arg2)
-{
- GdkColor _arg2, *lparg2=NULL;
- GTK_NATIVE_ENTER(env, that, _1gtk_1rc_1style_1set_1bg_FUNC);
- if (arg2) if ((lparg2 = getGdkColorFields(env, arg2, &_arg2)) == NULL) goto fail;
- gtk_rc_style_set_bg((GtkRcStyle *)arg0, arg1, lparg2);
-fail:
- GTK_NATIVE_EXIT(env, that, _1gtk_1rc_1style_1set_1bg_FUNC);
-}
-#endif
-
#ifndef NO__1gtk_1rc_1style_1set_1bg_1pixmap_1name
JNIEXPORT void JNICALL GTK_NATIVE(_1gtk_1rc_1style_1set_1bg_1pixmap_1name)
(JNIEnv *env, jclass that, jintLong arg0, jint arg1, jintLong arg2)
@@ -9834,32 +9528,6 @@ JNIEXPORT void JNICALL GTK_NATIVE(_1gtk_1rc_1style_1set_1color_1flags)
}
#endif
-#ifndef NO__1gtk_1rc_1style_1set_1fg
-JNIEXPORT void JNICALL GTK_NATIVE(_1gtk_1rc_1style_1set_1fg)
- (JNIEnv *env, jclass that, jintLong arg0, jint arg1, jobject arg2)
-{
- GdkColor _arg2, *lparg2=NULL;
- GTK_NATIVE_ENTER(env, that, _1gtk_1rc_1style_1set_1fg_FUNC);
- if (arg2) if ((lparg2 = getGdkColorFields(env, arg2, &_arg2)) == NULL) goto fail;
- gtk_rc_style_set_fg((GtkRcStyle *)arg0, arg1, lparg2);
-fail:
- GTK_NATIVE_EXIT(env, that, _1gtk_1rc_1style_1set_1fg_FUNC);
-}
-#endif
-
-#ifndef NO__1gtk_1rc_1style_1set_1text
-JNIEXPORT void JNICALL GTK_NATIVE(_1gtk_1rc_1style_1set_1text)
- (JNIEnv *env, jclass that, jintLong arg0, jint arg1, jobject arg2)
-{
- GdkColor _arg2, *lparg2=NULL;
- GTK_NATIVE_ENTER(env, that, _1gtk_1rc_1style_1set_1text_FUNC);
- if (arg2) if ((lparg2 = getGdkColorFields(env, arg2, &_arg2)) == NULL) goto fail;
- gtk_rc_style_set_text((GtkRcStyle *)arg0, arg1, lparg2);
-fail:
- GTK_NATIVE_EXIT(env, that, _1gtk_1rc_1style_1set_1text_FUNC);
-}
-#endif
-
#ifndef NO__1gtk_1render_1background
JNIEXPORT void JNICALL GTK_NATIVE(_1gtk_1render_1background)
(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jdouble arg2, jdouble arg3, jdouble arg4, jdouble arg5)
@@ -10842,76 +10510,6 @@ JNIEXPORT void JNICALL GTK_NATIVE(_1gtk_1style_1context_1set_1state)
}
#endif
-#ifndef NO__1gtk_1style_1get_1base
-JNIEXPORT void JNICALL GTK_NATIVE(_1gtk_1style_1get_1base)
- (JNIEnv *env, jclass that, jintLong arg0, jint arg1, jobject arg2)
-{
- GdkColor _arg2, *lparg2=NULL;
- GTK_NATIVE_ENTER(env, that, _1gtk_1style_1get_1base_FUNC);
- if (arg2) if ((lparg2 = &_arg2) == NULL) goto fail;
- gtk_style_get_base((GtkStyle *)arg0, arg1, lparg2);
-fail:
- if (arg2 && lparg2) setGdkColorFields(env, arg2, lparg2);
- GTK_NATIVE_EXIT(env, that, _1gtk_1style_1get_1base_FUNC);
-}
-#endif
-
-#ifndef NO__1gtk_1style_1get_1bg
-JNIEXPORT void JNICALL GTK_NATIVE(_1gtk_1style_1get_1bg)
- (JNIEnv *env, jclass that, jintLong arg0, jint arg1, jobject arg2)
-{
- GdkColor _arg2, *lparg2=NULL;
- GTK_NATIVE_ENTER(env, that, _1gtk_1style_1get_1bg_FUNC);
- if (arg2) if ((lparg2 = &_arg2) == NULL) goto fail;
- gtk_style_get_bg((GtkStyle *)arg0, arg1, lparg2);
-fail:
- if (arg2 && lparg2) setGdkColorFields(env, arg2, lparg2);
- GTK_NATIVE_EXIT(env, that, _1gtk_1style_1get_1bg_FUNC);
-}
-#endif
-
-#ifndef NO__1gtk_1style_1get_1black
-JNIEXPORT void JNICALL GTK_NATIVE(_1gtk_1style_1get_1black)
- (JNIEnv *env, jclass that, jintLong arg0, jobject arg1)
-{
- GdkColor _arg1, *lparg1=NULL;
- GTK_NATIVE_ENTER(env, that, _1gtk_1style_1get_1black_FUNC);
- if (arg1) if ((lparg1 = &_arg1) == NULL) goto fail;
- gtk_style_get_black((GtkStyle *)arg0, lparg1);
-fail:
- if (arg1 && lparg1) setGdkColorFields(env, arg1, lparg1);
- GTK_NATIVE_EXIT(env, that, _1gtk_1style_1get_1black_FUNC);
-}
-#endif
-
-#ifndef NO__1gtk_1style_1get_1dark
-JNIEXPORT void JNICALL GTK_NATIVE(_1gtk_1style_1get_1dark)
- (JNIEnv *env, jclass that, jintLong arg0, jint arg1, jobject arg2)
-{
- GdkColor _arg2, *lparg2=NULL;
- GTK_NATIVE_ENTER(env, that, _1gtk_1style_1get_1dark_FUNC);
- if (arg2) if ((lparg2 = &_arg2) == NULL) goto fail;
- gtk_style_get_dark((GtkStyle *)arg0, arg1, lparg2);
-fail:
- if (arg2 && lparg2) setGdkColorFields(env, arg2, lparg2);
- GTK_NATIVE_EXIT(env, that, _1gtk_1style_1get_1dark_FUNC);
-}
-#endif
-
-#ifndef NO__1gtk_1style_1get_1fg
-JNIEXPORT void JNICALL GTK_NATIVE(_1gtk_1style_1get_1fg)
- (JNIEnv *env, jclass that, jintLong arg0, jint arg1, jobject arg2)
-{
- GdkColor _arg2, *lparg2=NULL;
- GTK_NATIVE_ENTER(env, that, _1gtk_1style_1get_1fg_FUNC);
- if (arg2) if ((lparg2 = &_arg2) == NULL) goto fail;
- gtk_style_get_fg((GtkStyle *)arg0, arg1, lparg2);
-fail:
- if (arg2 && lparg2) setGdkColorFields(env, arg2, lparg2);
- GTK_NATIVE_EXIT(env, that, _1gtk_1style_1get_1fg_FUNC);
-}
-#endif
-
#ifndef NO__1gtk_1style_1get_1font_1desc
JNIEXPORT jintLong JNICALL GTK_NATIVE(_1gtk_1style_1get_1font_1desc)
(JNIEnv *env, jclass that, jintLong arg0)
@@ -10924,34 +10522,6 @@ JNIEXPORT jintLong JNICALL GTK_NATIVE(_1gtk_1style_1get_1font_1desc)
}
#endif
-#ifndef NO__1gtk_1style_1get_1light
-JNIEXPORT void JNICALL GTK_NATIVE(_1gtk_1style_1get_1light)
- (JNIEnv *env, jclass that, jintLong arg0, jint arg1, jobject arg2)
-{
- GdkColor _arg2, *lparg2=NULL;
- GTK_NATIVE_ENTER(env, that, _1gtk_1style_1get_1light_FUNC);
- if (arg2) if ((lparg2 = &_arg2) == NULL) goto fail;
- gtk_style_get_light((GtkStyle *)arg0, arg1, lparg2);
-fail:
- if (arg2 && lparg2) setGdkColorFields(env, arg2, lparg2);
- GTK_NATIVE_EXIT(env, that, _1gtk_1style_1get_1light_FUNC);
-}
-#endif
-
-#ifndef NO__1gtk_1style_1get_1text
-JNIEXPORT void JNICALL GTK_NATIVE(_1gtk_1style_1get_1text)
- (JNIEnv *env, jclass that, jintLong arg0, jint arg1, jobject arg2)
-{
- GdkColor _arg2, *lparg2=NULL;
- GTK_NATIVE_ENTER(env, that, _1gtk_1style_1get_1text_FUNC);
- if (arg2) if ((lparg2 = &_arg2) == NULL) goto fail;
- gtk_style_get_text((GtkStyle *)arg0, arg1, lparg2);
-fail:
- if (arg2 && lparg2) setGdkColorFields(env, arg2, lparg2);
- GTK_NATIVE_EXIT(env, that, _1gtk_1style_1get_1text_FUNC);
-}
-#endif
-
#ifndef NO__1gtk_1style_1get_1xthickness
JNIEXPORT jint JNICALL GTK_NATIVE(_1gtk_1style_1get_1xthickness)
(JNIEnv *env, jclass that, jintLong arg0)
@@ -12339,30 +11909,6 @@ JNIEXPORT void JNICALL GTK_NATIVE(_1gtk_1tree_1store_1set__JJIJI)(JNIEnv *env, j
}
#endif
-#if (!defined(NO__1gtk_1tree_1store_1set__IIILorg_eclipse_swt_internal_gtk_GdkColor_2I) && !defined(JNI64)) || (!defined(NO__1gtk_1tree_1store_1set__JJILorg_eclipse_swt_internal_gtk_GdkColor_2I) && defined(JNI64))
-#ifndef JNI64
-JNIEXPORT void JNICALL GTK_NATIVE(_1gtk_1tree_1store_1set__IIILorg_eclipse_swt_internal_gtk_GdkColor_2I)(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jint arg2, jobject arg3, jint arg4)
-#else
-JNIEXPORT void JNICALL GTK_NATIVE(_1gtk_1tree_1store_1set__JJILorg_eclipse_swt_internal_gtk_GdkColor_2I)(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jint arg2, jobject arg3, jint arg4)
-#endif
-{
- GdkColor _arg3, *lparg3=NULL;
-#ifndef JNI64
- GTK_NATIVE_ENTER(env, that, _1gtk_1tree_1store_1set__IIILorg_eclipse_swt_internal_gtk_GdkColor_2I_FUNC);
-#else
- GTK_NATIVE_ENTER(env, that, _1gtk_1tree_1store_1set__JJILorg_eclipse_swt_internal_gtk_GdkColor_2I_FUNC);
-#endif
- if (arg3) if ((lparg3 = getGdkColorFields(env, arg3, &_arg3)) == NULL) goto fail;
- gtk_tree_store_set((GtkTreeStore *)arg0, (GtkTreeIter *)arg1, arg2, lparg3, arg4);
-fail:
-#ifndef JNI64
- GTK_NATIVE_EXIT(env, that, _1gtk_1tree_1store_1set__IIILorg_eclipse_swt_internal_gtk_GdkColor_2I_FUNC);
-#else
- GTK_NATIVE_EXIT(env, that, _1gtk_1tree_1store_1set__JJILorg_eclipse_swt_internal_gtk_GdkColor_2I_FUNC);
-#endif
-}
-#endif
-
#if (!defined(NO__1gtk_1tree_1store_1set__IIILorg_eclipse_swt_internal_gtk_GdkRGBA_2I) && !defined(JNI64)) || (!defined(NO__1gtk_1tree_1store_1set__JJILorg_eclipse_swt_internal_gtk_GdkRGBA_2I) && defined(JNI64))
#ifndef JNI64
JNIEXPORT void JNICALL GTK_NATIVE(_1gtk_1tree_1store_1set__IIILorg_eclipse_swt_internal_gtk_GdkRGBA_2I)(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jint arg2, jobject arg3, jint arg4)
@@ -13986,48 +13532,6 @@ JNIEXPORT jboolean JNICALL GTK_NATIVE(_1gtk_1widget_1mnemonic_1activate)
}
#endif
-#ifndef NO__1gtk_1widget_1modify_1base
-JNIEXPORT void JNICALL GTK_NATIVE(_1gtk_1widget_1modify_1base)
- (JNIEnv *env, jclass that, jintLong arg0, jint arg1, jobject arg2)
-{
- GdkColor _arg2, *lparg2=NULL;
- GTK_NATIVE_ENTER(env, that, _1gtk_1widget_1modify_1base_FUNC);
- if (arg2) if ((lparg2 = getGdkColorFields(env, arg2, &_arg2)) == NULL) goto fail;
-/*
- gtk_widget_modify_base((GtkWidget *)arg0, (GtkStateType)arg1, (GdkColor *)lparg2);
-*/
- {
- GTK_LOAD_FUNCTION(fp, gtk_widget_modify_base)
- if (fp) {
- ((void (CALLING_CONVENTION*)(GtkWidget *, GtkStateType, GdkColor *))fp)((GtkWidget *)arg0, (GtkStateType)arg1, (GdkColor *)lparg2);
- }
- }
-fail:
- GTK_NATIVE_EXIT(env, that, _1gtk_1widget_1modify_1base_FUNC);
-}
-#endif
-
-#ifndef NO__1gtk_1widget_1modify_1bg
-JNIEXPORT void JNICALL GTK_NATIVE(_1gtk_1widget_1modify_1bg)
- (JNIEnv *env, jclass that, jintLong arg0, jint arg1, jobject arg2)
-{
- GdkColor _arg2, *lparg2=NULL;
- GTK_NATIVE_ENTER(env, that, _1gtk_1widget_1modify_1bg_FUNC);
- if (arg2) if ((lparg2 = getGdkColorFields(env, arg2, &_arg2)) == NULL) goto fail;
-/*
- gtk_widget_modify_bg((GtkWidget *)arg0, (GtkStateType)arg1, (GdkColor *)lparg2);
-*/
- {
- GTK_LOAD_FUNCTION(fp, gtk_widget_modify_bg)
- if (fp) {
- ((void (CALLING_CONVENTION*)(GtkWidget *, GtkStateType, GdkColor *))fp)((GtkWidget *)arg0, (GtkStateType)arg1, (GdkColor *)lparg2);
- }
- }
-fail:
- GTK_NATIVE_EXIT(env, that, _1gtk_1widget_1modify_1bg_FUNC);
-}
-#endif
-
#ifndef NO__1gtk_1widget_1modify_1font
JNIEXPORT void JNICALL GTK_NATIVE(_1gtk_1widget_1modify_1font)
(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1)
@@ -17125,34 +16629,6 @@ fail:
}
#endif
-#if (!defined(NO__1g_1object_1set__I_3BLorg_eclipse_swt_internal_gtk_GdkColor_2I) && !defined(JNI64)) || (!defined(NO__1g_1object_1set__J_3BLorg_eclipse_swt_internal_gtk_GdkColor_2J) && defined(JNI64))
-#ifndef JNI64
-JNIEXPORT void JNICALL OS_NATIVE(_1g_1object_1set__I_3BLorg_eclipse_swt_internal_gtk_GdkColor_2I)(JNIEnv *env, jclass that, jintLong arg0, jbyteArray arg1, jobject arg2, jintLong arg3)
-#else
-JNIEXPORT void JNICALL OS_NATIVE(_1g_1object_1set__J_3BLorg_eclipse_swt_internal_gtk_GdkColor_2J)(JNIEnv *env, jclass that, jintLong arg0, jbyteArray arg1, jobject arg2, jintLong arg3)
-#endif
-{
- jbyte *lparg1=NULL;
- GdkColor _arg2, *lparg2=NULL;
-#ifndef JNI64
- OS_NATIVE_ENTER(env, that, _1g_1object_1set__I_3BLorg_eclipse_swt_internal_gtk_GdkColor_2I_FUNC);
-#else
- OS_NATIVE_ENTER(env, that, _1g_1object_1set__J_3BLorg_eclipse_swt_internal_gtk_GdkColor_2J_FUNC);
-#endif
- if (arg1) if ((lparg1 = (*env)->GetByteArrayElements(env, arg1, NULL)) == NULL) goto fail;
- if (arg2) if ((lparg2 = getGdkColorFields(env, arg2, &_arg2)) == NULL) goto fail;
- g_object_set((gpointer)arg0, (const gchar *)lparg1, lparg2, (const gchar *)NULL);
-fail:
- if (arg2 && lparg2) setGdkColorFields(env, arg2, lparg2);
- if (arg1 && lparg1) (*env)->ReleaseByteArrayElements(env, arg1, lparg1, 0);
-#ifndef JNI64
- OS_NATIVE_EXIT(env, that, _1g_1object_1set__I_3BLorg_eclipse_swt_internal_gtk_GdkColor_2I_FUNC);
-#else
- OS_NATIVE_EXIT(env, that, _1g_1object_1set__J_3BLorg_eclipse_swt_internal_gtk_GdkColor_2J_FUNC);
-#endif
-}
-#endif
-
#if (!defined(NO__1g_1object_1set__I_3BLorg_eclipse_swt_internal_gtk_GdkRGBA_2I) && !defined(JNI64)) || (!defined(NO__1g_1object_1set__J_3BLorg_eclipse_swt_internal_gtk_GdkRGBA_2J) && defined(JNI64))
#ifndef JNI64
JNIEXPORT void JNICALL OS_NATIVE(_1g_1object_1set__I_3BLorg_eclipse_swt_internal_gtk_GdkRGBA_2I)(JNIEnv *env, jclass that, jintLong arg0, jbyteArray arg1, jobject arg2, jintLong arg3)
@@ -19832,30 +19308,6 @@ fail:
}
#endif
-#if (!defined(NO_memmove__ILorg_eclipse_swt_internal_gtk_GdkColor_2I) && !defined(JNI64)) || (!defined(NO_memmove__JLorg_eclipse_swt_internal_gtk_GdkColor_2J) && defined(JNI64))
-#ifndef JNI64
-JNIEXPORT void JNICALL OS_NATIVE(memmove__ILorg_eclipse_swt_internal_gtk_GdkColor_2I)(JNIEnv *env, jclass that, jintLong arg0, jobject arg1, jintLong arg2)
-#else
-JNIEXPORT void JNICALL OS_NATIVE(memmove__JLorg_eclipse_swt_internal_gtk_GdkColor_2J)(JNIEnv *env, jclass that, jintLong arg0, jobject arg1, jintLong arg2)
-#endif
-{
- GdkColor _arg1, *lparg1=NULL;
-#ifndef JNI64
- OS_NATIVE_ENTER(env, that, memmove__ILorg_eclipse_swt_internal_gtk_GdkColor_2I_FUNC);
-#else
- OS_NATIVE_ENTER(env, that, memmove__JLorg_eclipse_swt_internal_gtk_GdkColor_2J_FUNC);
-#endif
- if (arg1) if ((lparg1 = getGdkColorFields(env, arg1, &_arg1)) == NULL) goto fail;
- memmove((void *)arg0, (const void *)lparg1, (size_t)arg2);
-fail:
-#ifndef JNI64
- OS_NATIVE_EXIT(env, that, memmove__ILorg_eclipse_swt_internal_gtk_GdkColor_2I_FUNC);
-#else
- OS_NATIVE_EXIT(env, that, memmove__JLorg_eclipse_swt_internal_gtk_GdkColor_2J_FUNC);
-#endif
-}
-#endif
-
#if (!defined(NO_memmove__ILorg_eclipse_swt_internal_gtk_GdkEventButton_2I) && !defined(JNI64)) || (!defined(NO_memmove__JLorg_eclipse_swt_internal_gtk_GdkEventButton_2J) && defined(JNI64))
#ifndef JNI64
JNIEXPORT void JNICALL OS_NATIVE(memmove__ILorg_eclipse_swt_internal_gtk_GdkEventButton_2I)(JNIEnv *env, jclass that, jintLong arg0, jobject arg1, jintLong arg2)
@@ -20158,32 +19610,6 @@ fail:
}
#endif
-#if (!defined(NO_memmove__Lorg_eclipse_swt_internal_gtk_GdkColor_2II) && !defined(JNI64)) || (!defined(NO_memmove__Lorg_eclipse_swt_internal_gtk_GdkColor_2JJ) && defined(JNI64))
-#ifndef JNI64
-JNIEXPORT void JNICALL OS_NATIVE(memmove__Lorg_eclipse_swt_internal_gtk_GdkColor_2II)(JNIEnv *env, jclass that, jobject arg0, jintLong arg1, jintLong arg2)
-#else
-JNIEXPORT void JNICALL OS_NATIVE(memmove__Lorg_eclipse_swt_internal_gtk_GdkColor_2JJ)(JNIEnv *env, jclass that, jobject arg0, jintLong arg1, jintLong arg2)
-#endif
-{
- GdkColor _arg0, *lparg0=NULL;
-#ifndef JNI64
- OS_NATIVE_ENTER(env, that, memmove__Lorg_eclipse_swt_internal_gtk_GdkColor_2II_FUNC);
-#else
- OS_NATIVE_ENTER(env, that, memmove__Lorg_eclipse_swt_internal_gtk_GdkColor_2JJ_FUNC);
-#endif
- if (!arg0) goto fail;
- if ((lparg0 = &_arg0) == NULL) goto fail;
- memmove((void *)lparg0, (const void *)arg1, (size_t)arg2);
-fail:
- if (arg0 && lparg0) setGdkColorFields(env, arg0, lparg0);
-#ifndef JNI64
- OS_NATIVE_EXIT(env, that, memmove__Lorg_eclipse_swt_internal_gtk_GdkColor_2II_FUNC);
-#else
- OS_NATIVE_EXIT(env, that, memmove__Lorg_eclipse_swt_internal_gtk_GdkColor_2JJ_FUNC);
-#endif
-}
-#endif
-
#if (!defined(NO_memmove__Lorg_eclipse_swt_internal_gtk_GdkDragContext_2II) && !defined(JNI64)) || (!defined(NO_memmove__Lorg_eclipse_swt_internal_gtk_GdkDragContext_2JJ) && defined(JNI64))
#ifndef JNI64
JNIEXPORT void JNICALL OS_NATIVE(memmove__Lorg_eclipse_swt_internal_gtk_GdkDragContext_2II)(JNIEnv *env, jclass that, jobject arg0, jintLong arg1, jintLong arg2)
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.h
index 78230105d0..529677b877 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.h
@@ -214,7 +214,6 @@ X#define NO__1XWarpPointer
#define NO_memmove__Lorg_eclipse_swt_internal_gtk_GtkAdjustment_2I
#define NO_memmove__Lorg_eclipse_swt_internal_gtk_GtkAdjustment_2J
#define NO_GtkFixed
-#define NO__1GDK_1TYPE_1COLOR
#define NO_memmove__ILorg_eclipse_swt_internal_gtk_GtkFixed_2
#define NO_memmove__JLorg_eclipse_swt_internal_gtk_GtkFixed_2
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c
index 6491dd15eb..14ad886ebe 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c
@@ -25,7 +25,6 @@ char * GDK_nativeFunctionNames[] = {
"GDK_1EVENT_1TYPE",
"GDK_1EVENT_1WINDOW",
"GDK_1IS_1X11_1DISPLAY",
- "GdkColor_1sizeof",
"GdkDragContext_1sizeof",
"GdkEventAny_1sizeof",
"GdkEventButton_1sizeof",
@@ -43,7 +42,6 @@ char * GDK_nativeFunctionNames[] = {
"GdkRectangle_1sizeof",
"GdkWindowAttr_1sizeof",
"_1GDK_1PIXMAP_1XID",
- "_1GDK_1TYPE_1COLOR",
"_1GDK_1TYPE_1PIXBUF",
"_1GDK_1TYPE_1RGBA",
"_1gdk_1atom_1intern",
@@ -54,21 +52,13 @@ char * GDK_nativeFunctionNames[] = {
"_1gdk_1cairo_1region",
"_1gdk_1cairo_1region_1create_1from_1surface",
"_1gdk_1cairo_1reset_1clip",
- "_1gdk_1cairo_1set_1source_1color",
"_1gdk_1cairo_1set_1source_1pixbuf",
"_1gdk_1cairo_1set_1source_1pixmap",
"_1gdk_1cairo_1set_1source_1rgba",
"_1gdk_1cairo_1set_1source_1window",
- "_1gdk_1color_1free",
- "_1gdk_1color_1parse",
- "_1gdk_1color_1white",
- "_1gdk_1colormap_1alloc_1color",
- "_1gdk_1colormap_1free_1colors",
- "_1gdk_1colormap_1get_1system",
"_1gdk_1cursor_1new_1for_1display",
"_1gdk_1cursor_1new_1from_1name",
"_1gdk_1cursor_1new_1from_1pixbuf",
- "_1gdk_1cursor_1new_1from_1pixmap",
"_1gdk_1cursor_1unref",
"_1gdk_1device_1get_1associated_1device",
"_1gdk_1device_1get_1window_1at_1position",
@@ -115,7 +105,6 @@ char * GDK_nativeFunctionNames[] = {
"_1gdk_1flush",
"_1gdk_1gc_1new",
"_1gdk_1gc_1set_1fill",
- "_1gdk_1gc_1set_1foreground",
"_1gdk_1gc_1set_1function",
"_1gdk_1gc_1set_1stipple",
"_1gdk_1gc_1set_1subwindow",
@@ -403,9 +392,7 @@ char * GTK_nativeFunctionNames[] = {
"_1gtk_1color_1chooser_1set_1use_1alpha",
"_1gtk_1color_1selection_1dialog_1get_1color_1selection",
"_1gtk_1color_1selection_1dialog_1new",
- "_1gtk_1color_1selection_1get_1current_1color",
"_1gtk_1color_1selection_1palette_1to_1string",
- "_1gtk_1color_1selection_1set_1current_1color",
"_1gtk_1color_1selection_1set_1has_1palette",
"_1gtk_1combo_1box_1get_1active",
"_1gtk_1combo_1box_1get_1model",
@@ -619,11 +606,6 @@ char * GTK_nativeFunctionNames[] = {
"_1gtk_1list_1store_1set__JJIJI",
#endif
#ifndef JNI64
- "_1gtk_1list_1store_1set__IIILorg_eclipse_swt_internal_gtk_GdkColor_2I",
-#else
- "_1gtk_1list_1store_1set__JJILorg_eclipse_swt_internal_gtk_GdkColor_2I",
-#endif
-#ifndef JNI64
"_1gtk_1list_1store_1set__IIILorg_eclipse_swt_internal_gtk_GdkRGBA_2I",
#else
"_1gtk_1list_1store_1set__JJILorg_eclipse_swt_internal_gtk_GdkRGBA_2I",
@@ -755,11 +737,8 @@ char * GTK_nativeFunctionNames[] = {
"_1gtk_1rc_1parse_1string",
"_1gtk_1rc_1style_1get_1bg_1pixmap_1name",
"_1gtk_1rc_1style_1get_1color_1flags",
- "_1gtk_1rc_1style_1set_1bg",
"_1gtk_1rc_1style_1set_1bg_1pixmap_1name",
"_1gtk_1rc_1style_1set_1color_1flags",
- "_1gtk_1rc_1style_1set_1fg",
- "_1gtk_1rc_1style_1set_1text",
"_1gtk_1render_1background",
"_1gtk_1render_1focus",
"_1gtk_1render_1frame",
@@ -827,14 +806,7 @@ char * GTK_nativeFunctionNames[] = {
"_1gtk_1style_1context_1restore",
"_1gtk_1style_1context_1save",
"_1gtk_1style_1context_1set_1state",
- "_1gtk_1style_1get_1base",
- "_1gtk_1style_1get_1bg",
- "_1gtk_1style_1get_1black",
- "_1gtk_1style_1get_1dark",
- "_1gtk_1style_1get_1fg",
"_1gtk_1style_1get_1font_1desc",
- "_1gtk_1style_1get_1light",
- "_1gtk_1style_1get_1text",
"_1gtk_1style_1get_1xthickness",
"_1gtk_1style_1get_1ythickness",
"_1gtk_1target_1list_1new",
@@ -969,11 +941,6 @@ char * GTK_nativeFunctionNames[] = {
"_1gtk_1tree_1store_1set__JJIJI",
#endif
#ifndef JNI64
- "_1gtk_1tree_1store_1set__IIILorg_eclipse_swt_internal_gtk_GdkColor_2I",
-#else
- "_1gtk_1tree_1store_1set__JJILorg_eclipse_swt_internal_gtk_GdkColor_2I",
-#endif
-#ifndef JNI64
"_1gtk_1tree_1store_1set__IIILorg_eclipse_swt_internal_gtk_GdkRGBA_2I",
#else
"_1gtk_1tree_1store_1set__JJILorg_eclipse_swt_internal_gtk_GdkRGBA_2I",
@@ -1107,8 +1074,6 @@ char * GTK_nativeFunctionNames[] = {
"_1gtk_1widget_1is_1focus",
"_1gtk_1widget_1map",
"_1gtk_1widget_1mnemonic_1activate",
- "_1gtk_1widget_1modify_1base",
- "_1gtk_1widget_1modify_1bg",
"_1gtk_1widget_1modify_1font",
"_1gtk_1widget_1modify_1style",
"_1gtk_1widget_1override_1background_1color",
@@ -1414,11 +1379,6 @@ char * OS_nativeFunctionNames[] = {
"_1g_1object_1set__J_3BJJ",
#endif
#ifndef JNI64
- "_1g_1object_1set__I_3BLorg_eclipse_swt_internal_gtk_GdkColor_2I",
-#else
- "_1g_1object_1set__J_3BLorg_eclipse_swt_internal_gtk_GdkColor_2J",
-#endif
-#ifndef JNI64
"_1g_1object_1set__I_3BLorg_eclipse_swt_internal_gtk_GdkRGBA_2I",
#else
"_1g_1object_1set__J_3BLorg_eclipse_swt_internal_gtk_GdkRGBA_2J",
@@ -1678,11 +1638,6 @@ char * OS_nativeFunctionNames[] = {
"memmove__JLorg_eclipse_swt_internal_gtk_GTypeInfo_2I",
#endif
#ifndef JNI64
- "memmove__ILorg_eclipse_swt_internal_gtk_GdkColor_2I",
-#else
- "memmove__JLorg_eclipse_swt_internal_gtk_GdkColor_2J",
-#endif
-#ifndef JNI64
"memmove__ILorg_eclipse_swt_internal_gtk_GdkEventButton_2I",
#else
"memmove__JLorg_eclipse_swt_internal_gtk_GdkEventButton_2J",
@@ -1748,11 +1703,6 @@ char * OS_nativeFunctionNames[] = {
"memmove__Lorg_eclipse_swt_internal_gtk_GTypeQuery_2JJ",
#endif
#ifndef JNI64
- "memmove__Lorg_eclipse_swt_internal_gtk_GdkColor_2II",
-#else
- "memmove__Lorg_eclipse_swt_internal_gtk_GdkColor_2JJ",
-#endif
-#ifndef JNI64
"memmove__Lorg_eclipse_swt_internal_gtk_GdkDragContext_2II",
#else
"memmove__Lorg_eclipse_swt_internal_gtk_GdkDragContext_2JJ",
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h
index 70894d8d40..48619c5e11 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h
@@ -35,7 +35,6 @@ typedef enum {
GDK_1EVENT_1TYPE_FUNC,
GDK_1EVENT_1WINDOW_FUNC,
GDK_1IS_1X11_1DISPLAY_FUNC,
- GdkColor_1sizeof_FUNC,
GdkDragContext_1sizeof_FUNC,
GdkEventAny_1sizeof_FUNC,
GdkEventButton_1sizeof_FUNC,
@@ -53,7 +52,6 @@ typedef enum {
GdkRectangle_1sizeof_FUNC,
GdkWindowAttr_1sizeof_FUNC,
_1GDK_1PIXMAP_1XID_FUNC,
- _1GDK_1TYPE_1COLOR_FUNC,
_1GDK_1TYPE_1PIXBUF_FUNC,
_1GDK_1TYPE_1RGBA_FUNC,
_1gdk_1atom_1intern_FUNC,
@@ -64,21 +62,13 @@ typedef enum {
_1gdk_1cairo_1region_FUNC,
_1gdk_1cairo_1region_1create_1from_1surface_FUNC,
_1gdk_1cairo_1reset_1clip_FUNC,
- _1gdk_1cairo_1set_1source_1color_FUNC,
_1gdk_1cairo_1set_1source_1pixbuf_FUNC,
_1gdk_1cairo_1set_1source_1pixmap_FUNC,
_1gdk_1cairo_1set_1source_1rgba_FUNC,
_1gdk_1cairo_1set_1source_1window_FUNC,
- _1gdk_1color_1free_FUNC,
- _1gdk_1color_1parse_FUNC,
- _1gdk_1color_1white_FUNC,
- _1gdk_1colormap_1alloc_1color_FUNC,
- _1gdk_1colormap_1free_1colors_FUNC,
- _1gdk_1colormap_1get_1system_FUNC,
_1gdk_1cursor_1new_1for_1display_FUNC,
_1gdk_1cursor_1new_1from_1name_FUNC,
_1gdk_1cursor_1new_1from_1pixbuf_FUNC,
- _1gdk_1cursor_1new_1from_1pixmap_FUNC,
_1gdk_1cursor_1unref_FUNC,
_1gdk_1device_1get_1associated_1device_FUNC,
_1gdk_1device_1get_1window_1at_1position_FUNC,
@@ -125,7 +115,6 @@ typedef enum {
_1gdk_1flush_FUNC,
_1gdk_1gc_1new_FUNC,
_1gdk_1gc_1set_1fill_FUNC,
- _1gdk_1gc_1set_1foreground_FUNC,
_1gdk_1gc_1set_1function_FUNC,
_1gdk_1gc_1set_1stipple_FUNC,
_1gdk_1gc_1set_1subwindow_FUNC,
@@ -401,9 +390,7 @@ typedef enum {
_1gtk_1color_1chooser_1set_1use_1alpha_FUNC,
_1gtk_1color_1selection_1dialog_1get_1color_1selection_FUNC,
_1gtk_1color_1selection_1dialog_1new_FUNC,
- _1gtk_1color_1selection_1get_1current_1color_FUNC,
_1gtk_1color_1selection_1palette_1to_1string_FUNC,
- _1gtk_1color_1selection_1set_1current_1color_FUNC,
_1gtk_1color_1selection_1set_1has_1palette_FUNC,
_1gtk_1combo_1box_1get_1active_FUNC,
_1gtk_1combo_1box_1get_1model_FUNC,
@@ -617,11 +604,6 @@ typedef enum {
_1gtk_1list_1store_1set__JJIJI_FUNC,
#endif
#ifndef JNI64
- _1gtk_1list_1store_1set__IIILorg_eclipse_swt_internal_gtk_GdkColor_2I_FUNC,
-#else
- _1gtk_1list_1store_1set__JJILorg_eclipse_swt_internal_gtk_GdkColor_2I_FUNC,
-#endif
-#ifndef JNI64
_1gtk_1list_1store_1set__IIILorg_eclipse_swt_internal_gtk_GdkRGBA_2I_FUNC,
#else
_1gtk_1list_1store_1set__JJILorg_eclipse_swt_internal_gtk_GdkRGBA_2I_FUNC,
@@ -753,11 +735,8 @@ typedef enum {
_1gtk_1rc_1parse_1string_FUNC,
_1gtk_1rc_1style_1get_1bg_1pixmap_1name_FUNC,
_1gtk_1rc_1style_1get_1color_1flags_FUNC,
- _1gtk_1rc_1style_1set_1bg_FUNC,
_1gtk_1rc_1style_1set_1bg_1pixmap_1name_FUNC,
_1gtk_1rc_1style_1set_1color_1flags_FUNC,
- _1gtk_1rc_1style_1set_1fg_FUNC,
- _1gtk_1rc_1style_1set_1text_FUNC,
_1gtk_1render_1background_FUNC,
_1gtk_1render_1focus_FUNC,
_1gtk_1render_1frame_FUNC,
@@ -825,14 +804,7 @@ typedef enum {
_1gtk_1style_1context_1restore_FUNC,
_1gtk_1style_1context_1save_FUNC,
_1gtk_1style_1context_1set_1state_FUNC,
- _1gtk_1style_1get_1base_FUNC,
- _1gtk_1style_1get_1bg_FUNC,
- _1gtk_1style_1get_1black_FUNC,
- _1gtk_1style_1get_1dark_FUNC,
- _1gtk_1style_1get_1fg_FUNC,
_1gtk_1style_1get_1font_1desc_FUNC,
- _1gtk_1style_1get_1light_FUNC,
- _1gtk_1style_1get_1text_FUNC,
_1gtk_1style_1get_1xthickness_FUNC,
_1gtk_1style_1get_1ythickness_FUNC,
_1gtk_1target_1list_1new_FUNC,
@@ -967,11 +939,6 @@ typedef enum {
_1gtk_1tree_1store_1set__JJIJI_FUNC,
#endif
#ifndef JNI64
- _1gtk_1tree_1store_1set__IIILorg_eclipse_swt_internal_gtk_GdkColor_2I_FUNC,
-#else
- _1gtk_1tree_1store_1set__JJILorg_eclipse_swt_internal_gtk_GdkColor_2I_FUNC,
-#endif
-#ifndef JNI64
_1gtk_1tree_1store_1set__IIILorg_eclipse_swt_internal_gtk_GdkRGBA_2I_FUNC,
#else
_1gtk_1tree_1store_1set__JJILorg_eclipse_swt_internal_gtk_GdkRGBA_2I_FUNC,
@@ -1105,8 +1072,6 @@ typedef enum {
_1gtk_1widget_1is_1focus_FUNC,
_1gtk_1widget_1map_FUNC,
_1gtk_1widget_1mnemonic_1activate_FUNC,
- _1gtk_1widget_1modify_1base_FUNC,
- _1gtk_1widget_1modify_1bg_FUNC,
_1gtk_1widget_1modify_1font_FUNC,
_1gtk_1widget_1modify_1style_FUNC,
_1gtk_1widget_1override_1background_1color_FUNC,
@@ -1400,11 +1365,6 @@ typedef enum {
_1g_1object_1set__J_3BJJ_FUNC,
#endif
#ifndef JNI64
- _1g_1object_1set__I_3BLorg_eclipse_swt_internal_gtk_GdkColor_2I_FUNC,
-#else
- _1g_1object_1set__J_3BLorg_eclipse_swt_internal_gtk_GdkColor_2J_FUNC,
-#endif
-#ifndef JNI64
_1g_1object_1set__I_3BLorg_eclipse_swt_internal_gtk_GdkRGBA_2I_FUNC,
#else
_1g_1object_1set__J_3BLorg_eclipse_swt_internal_gtk_GdkRGBA_2J_FUNC,
@@ -1664,11 +1624,6 @@ typedef enum {
memmove__JLorg_eclipse_swt_internal_gtk_GTypeInfo_2I_FUNC,
#endif
#ifndef JNI64
- memmove__ILorg_eclipse_swt_internal_gtk_GdkColor_2I_FUNC,
-#else
- memmove__JLorg_eclipse_swt_internal_gtk_GdkColor_2J_FUNC,
-#endif
-#ifndef JNI64
memmove__ILorg_eclipse_swt_internal_gtk_GdkEventButton_2I_FUNC,
#else
memmove__JLorg_eclipse_swt_internal_gtk_GdkEventButton_2J_FUNC,
@@ -1734,11 +1689,6 @@ typedef enum {
memmove__Lorg_eclipse_swt_internal_gtk_GTypeQuery_2JJ_FUNC,
#endif
#ifndef JNI64
- memmove__Lorg_eclipse_swt_internal_gtk_GdkColor_2II_FUNC,
-#else
- memmove__Lorg_eclipse_swt_internal_gtk_GdkColor_2JJ_FUNC,
-#endif
-#ifndef JNI64
memmove__Lorg_eclipse_swt_internal_gtk_GdkDragContext_2II_FUNC,
#else
memmove__Lorg_eclipse_swt_internal_gtk_GdkDragContext_2JJ_FUNC,
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_structs.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_structs.c
index a665a781f6..e8c7ffeaf0 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_structs.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_structs.c
@@ -203,46 +203,6 @@ void setGTypeQueryFields(JNIEnv *env, jobject lpObject, GTypeQuery *lpStruct)
}
#endif
-#ifndef NO_GdkColor
-typedef struct GdkColor_FID_CACHE {
- int cached;
- jclass clazz;
- jfieldID pixel, red, green, blue;
-} GdkColor_FID_CACHE;
-
-GdkColor_FID_CACHE GdkColorFc;
-
-void cacheGdkColorFields(JNIEnv *env, jobject lpObject)
-{
- if (GdkColorFc.cached) return;
- GdkColorFc.clazz = (*env)->GetObjectClass(env, lpObject);
- GdkColorFc.pixel = (*env)->GetFieldID(env, GdkColorFc.clazz, "pixel", "I");
- GdkColorFc.red = (*env)->GetFieldID(env, GdkColorFc.clazz, "red", "S");
- GdkColorFc.green = (*env)->GetFieldID(env, GdkColorFc.clazz, "green", "S");
- GdkColorFc.blue = (*env)->GetFieldID(env, GdkColorFc.clazz, "blue", "S");
- GdkColorFc.cached = 1;
-}
-
-GdkColor *getGdkColorFields(JNIEnv *env, jobject lpObject, GdkColor *lpStruct)
-{
- if (!GdkColorFc.cached) cacheGdkColorFields(env, lpObject);
- lpStruct->pixel = (guint32)(*env)->GetIntField(env, lpObject, GdkColorFc.pixel);
- lpStruct->red = (guint16)(*env)->GetShortField(env, lpObject, GdkColorFc.red);
- lpStruct->green = (guint16)(*env)->GetShortField(env, lpObject, GdkColorFc.green);
- lpStruct->blue = (guint16)(*env)->GetShortField(env, lpObject, GdkColorFc.blue);
- return lpStruct;
-}
-
-void setGdkColorFields(JNIEnv *env, jobject lpObject, GdkColor *lpStruct)
-{
- if (!GdkColorFc.cached) cacheGdkColorFields(env, lpObject);
- (*env)->SetIntField(env, lpObject, GdkColorFc.pixel, (jint)lpStruct->pixel);
- (*env)->SetShortField(env, lpObject, GdkColorFc.red, (jshort)lpStruct->red);
- (*env)->SetShortField(env, lpObject, GdkColorFc.green, (jshort)lpStruct->green);
- (*env)->SetShortField(env, lpObject, GdkColorFc.blue, (jshort)lpStruct->blue);
-}
-#endif
-
#ifndef NO_GdkDragContext
typedef struct GdkDragContext_FID_CACHE {
int cached;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_structs.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_structs.h
index 969c9c182f..9ce376899b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_structs.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_structs.h
@@ -66,18 +66,6 @@ void setGTypeQueryFields(JNIEnv *env, jobject lpObject, GTypeQuery *lpStruct);
#define GTypeQuery_sizeof() 0
#endif
-#ifndef NO_GdkColor
-void cacheGdkColorFields(JNIEnv *env, jobject lpObject);
-GdkColor *getGdkColorFields(JNIEnv *env, jobject lpObject, GdkColor *lpStruct);
-void setGdkColorFields(JNIEnv *env, jobject lpObject, GdkColor *lpStruct);
-#define GdkColor_sizeof() sizeof(GdkColor)
-#else
-#define cacheGdkColorFields(a,b)
-#define getGdkColorFields(a,b,c) NULL
-#define setGdkColorFields(a,b,c)
-#define GdkColor_sizeof() 0
-#endif
-
#ifndef NO_GdkDragContext
void cacheGdkDragContextFields(JNIEnv *env, jobject lpObject);
GdkDragContext *getGdkDragContextFields(JNIEnv *env, jobject lpObject, GdkDragContext *lpStruct);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GDK.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GDK.java
index 2fca22577f..7d2ab70f73 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GDK.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GDK.java
@@ -258,7 +258,6 @@ public class GDK extends OS {
public static final int GDK_WINDOW_TYPE_HINT_TOOLTIP = 10;
/** sizeof(TYPE) for 32/64 bit support */
- public static final native int GdkColor_sizeof();
public static final native int GdkKeymapKey_sizeof();
public static final native int GdkRGBA_sizeof();
public static final native int GdkDragContext_sizeof();
@@ -294,17 +293,6 @@ public class GDK extends OS {
lock.unlock();
}
}
-
- /** @method flags=const */
- public static final native long /*int*/ _GDK_TYPE_COLOR();
- public static final long /*int*/ GDK_TYPE_COLOR() {
- lock.lock();
- try {
- return _GDK_TYPE_COLOR();
- } finally {
- lock.unlock();
- }
- }
/** @method flags=const */
public static final native long /*int*/ _GDK_TYPE_RGBA();
public static final long /*int*/ GDK_TYPE_RGBA() {
@@ -536,16 +524,6 @@ public class GDK extends OS {
}
}
/** @method flags=dynamic */
- public static final native void _gdk_cairo_set_source_color(long /*int*/ cairo, GdkColor color);
- public static final void gdk_cairo_set_source_color(long /*int*/ cairo, GdkColor color) {
- lock.lock();
- try {
- _gdk_cairo_set_source_color(cairo, color);
- } finally {
- lock.unlock();
- }
- }
- /** @method flags=dynamic */
public static final native void _gdk_cairo_set_source_rgba(long /*int*/ cairo, GdkRGBA rgba);
public static final void gdk_cairo_set_source_rgba(long /*int*/ cairo, GdkRGBA rgba) {
lock.lock();
@@ -635,86 +613,6 @@ public class GDK extends OS {
lock.unlock();
}
}
- /**
- * @method flags=dynamic
- * @param color cast=(GdkColor *) */
- public static final native void _gdk_color_free(long /*int*/ color);
- public static final void gdk_color_free(long /*int*/ color) {
- lock.lock();
- assert !GTK.GTK3 : "GTK2 code was run by GTK3";
- try {
- _gdk_color_free(color);
- } finally {
- lock.unlock();
- }
- }
- /**
- * @method flags=dynamic
- * @param spec cast=(const gchar *)
- * @param color cast=(GdkColor *),flags=no_in
- */
- public static final native boolean _gdk_color_parse(byte[] spec, GdkColor color);
- public static final boolean gdk_color_parse(byte[] spec, GdkColor color) {
- lock.lock();
- assert !GTK.GTK3 : "GTK2 code was run by GTK3";
- try {
- return _gdk_color_parse(spec, color);
- } finally {
- lock.unlock();
- }
- }
- /**
- * @method flags=dynamic
- * @param color flags=no_in
- */
- public static final native boolean _gdk_color_white(long /*int*/ colormap, GdkColor color);
- public static final boolean gdk_color_white(long /*int*/ colormap, GdkColor color) {
- lock.lock();
- try {
- return _gdk_color_white(colormap, color);
- } finally {
- lock.unlock();
- }
- }
- /**
- * @method flags=dynamic
- * @param color cast=(GdkColor *)
- * @param writeable cast=(gboolean)
- * @param best_match cast=(gboolean)
- */
- public static final native boolean _gdk_colormap_alloc_color(long /*int*/ colormap, GdkColor color, boolean writeable, boolean best_match);
- public static final boolean gdk_colormap_alloc_color(long /*int*/ colormap, GdkColor color, boolean writeable, boolean best_match) {
- lock.lock();
- try {
- return _gdk_colormap_alloc_color(colormap, color, writeable, best_match);
- } finally {
- lock.unlock();
- }
- }
- /**
- * @method flags=dynamic
- * @param colors cast=(GdkColor *),flags=no_out
- * @param ncolors cast=(gint)
- */
- public static final native void _gdk_colormap_free_colors(long /*int*/ colormap, GdkColor colors, int ncolors);
- public static final void gdk_colormap_free_colors(long /*int*/ colormap, GdkColor colors, int ncolors) {
- lock.lock();
- try {
- _gdk_colormap_free_colors(colormap, colors, ncolors);
- } finally {
- lock.unlock();
- }
- }
- /** @method flags=dynamic */
- public static final native long /*int*/ _gdk_colormap_get_system();
- public static final long /*int*/ gdk_colormap_get_system() {
- lock.lock();
- try {
- return _gdk_colormap_get_system();
- } finally {
- lock.unlock();
- }
- }
/** @method flags=dynamic */
public static final native void _gdk_cursor_unref(long /*int*/ cursor);
public static final void gdk_cursor_unref(long /*int*/ cursor) {
@@ -749,22 +647,6 @@ public class GDK extends OS {
lock.unlock();
}
}
- /**
- * @method flags=dynamic
- * @param fg cast=(GdkColor *),flags=no_out
- * @param bg cast=(GdkColor *),flags=no_out
- * @param x cast=(gint)
- * @param y cast=(gint)
- */
- public static final native long /*int*/ _gdk_cursor_new_from_pixmap(long /*int*/ source, long /*int*/ mask, GdkColor fg, GdkColor bg, int x, int y);
- public static final long /*int*/ gdk_cursor_new_from_pixmap(long /*int*/ source, long /*int*/ mask, GdkColor fg, GdkColor bg, int x, int y) {
- lock.lock();
- try {
- return _gdk_cursor_new_from_pixmap(source, mask, fg, bg, x, y);
- } finally {
- lock.unlock();
- }
- }
/** @method flags=dynamic */
public static final native long /*int*/ _gdk_cursor_new_from_pixbuf(long /*int*/ display, long /*int*/ pixbuf, int x, int y);
public static final long /*int*/ gdk_cursor_new_from_pixbuf(long /*int*/ display, long /*int*/ pixbuf, int x, int y) {
@@ -1302,19 +1184,6 @@ public class GDK extends OS {
}
/**
* @method flags=dynamic
- * @param color flags=no_out
- */
- public static final native void _gdk_gc_set_foreground(long /*int*/ gc, GdkColor color);
- public static final void gdk_gc_set_foreground(long /*int*/ gc, GdkColor color) {
- lock.lock();
- try {
- _gdk_gc_set_foreground(gc, color);
- } finally {
- lock.unlock();
- }
- }
- /**
- * @method flags=dynamic
*/
public static final native void _gdk_gc_set_function(long /*int*/ gc, long /*int*/ function);
public static final void gdk_gc_set_function(long /*int*/ gc, long /*int*/ function) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GTK.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GTK.java
index 97119bed03..80f1a57500 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GTK.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GTK.java
@@ -1470,20 +1470,6 @@ public class GTK extends OS {
lock.unlock();
}
}
- /**
- * @method flags=dynamic
- * @param color flags=no_in
- */
- public static final native void _gtk_color_selection_get_current_color(long /*int*/ colorsel, GdkColor color);
- /** [GTK2/GTK3; 3.4 deprecated] */
- public static final void gtk_color_selection_get_current_color(long /*int*/ colorsel, GdkColor color) {
- lock.lock();
- try {
- _gtk_color_selection_get_current_color(colorsel, color);
- } finally {
- lock.unlock();
- }
- }
/** @method flags=dynamic */
public static final native long /*int*/ _gtk_color_selection_palette_to_string(long /*int*/ colors, int n_colors);
/** [GTK2/GTK3; 3.6 deprecated] */
@@ -1495,20 +1481,6 @@ public class GTK extends OS {
lock.unlock();
}
}
- /**
- * @method flags=dynamic
- * @param color flags=no_out
- */
- public static final native void _gtk_color_selection_set_current_color(long /*int*/ colorsel, GdkColor color);
- /** [GTK2/GTK3; 3.4 deprecated] */
- public static final void gtk_color_selection_set_current_color(long /*int*/ colorsel, GdkColor color) {
- lock.lock();
- try {
- _gtk_color_selection_set_current_color(colorsel, color);
- } finally {
- lock.unlock();
- }
- }
/** @method flags=dynamic */
public static final native void _gtk_color_selection_set_has_palette(long /*int*/ colorsel, boolean has_palette);
/** [GTK2/GTK3; 3.6 deprecated] */
@@ -4033,21 +4005,6 @@ public class GTK extends OS {
* @param iter cast=(GtkTreeIter *)
* @param value flags=no_out
*/
- public static final native void _gtk_list_store_set(long /*int*/ store, long /*int*/ iter, int column, GdkColor value, int terminator);
- public static final void gtk_list_store_set(long /*int*/ store, long /*int*/ iter, int column, GdkColor value, int terminator) {
- lock.lock();
- assert !GTK3 : "GTK2 code was run by GTK3";
- try {
- _gtk_list_store_set(store, iter, column, value, terminator);
- } finally {
- lock.unlock();
- }
- }
- /**
- * @param store cast=(GtkListStore *)
- * @param iter cast=(GtkTreeIter *)
- * @param value flags=no_out
- */
public static final native void _gtk_list_store_set(long /*int*/ store, long /*int*/ iter, int column, GdkRGBA value, int terminator);
public static final void gtk_list_store_set(long /*int*/ store, long /*int*/ iter, int column, GdkRGBA value, int terminator) {
lock.lock();
@@ -5561,19 +5518,6 @@ public class GTK extends OS {
}
/**
* @param style cast=(GtkRcStyle *)
- * @param color flags=no_out
- */
- public static final native void _gtk_rc_style_set_bg(long /*int*/ style, int index, GdkColor color);
- public static final void gtk_rc_style_set_bg(long /*int*/ style, int index, GdkColor color) {
- lock.lock();
- try {
- _gtk_rc_style_set_bg(style, index, color);
- } finally {
- lock.unlock();
- }
- }
- /**
- * @param style cast=(GtkRcStyle *)
* @param name cast=(char *)
*/
public static final native void _gtk_rc_style_set_bg_pixmap_name(long /*int*/ style, int index, long /*int*/ name);
@@ -5635,32 +5579,6 @@ public class GTK extends OS {
}
}
/**
- * @param style cast=(GtkRcStyle *)
- * @param color flags=no_out
- */
- public static final native void _gtk_rc_style_set_fg(long /*int*/ style, int index, GdkColor color);
- public static final void gtk_rc_style_set_fg(long /*int*/ style, int index, GdkColor color) {
- lock.lock();
- try {
- _gtk_rc_style_set_fg(style, index, color);
- } finally {
- lock.unlock();
- }
- }
- /**
- * @param style cast=(GtkRcStyle *)
- * @param color flags=no_out
- */
- public static final native void _gtk_rc_style_set_text(long /*int*/ style, int index, GdkColor color);
- public static final void gtk_rc_style_set_text(long /*int*/ style, int index, GdkColor color) {
- lock.lock();
- try {
- _gtk_rc_style_set_text(style, index, color);
- } finally {
- lock.unlock();
- }
- }
- /**
* @method flags=dynamic
* @param scrolled_window cast=(GtkScrolledWindow *)
* @param child cast=(GtkWidget *)
@@ -6147,19 +6065,6 @@ public class GTK extends OS {
lock.unlock();
}
}
- /**
- * @param style cast=(GtkStyle *)
- * @param color flags=no_in
- */
- public static final native void _gtk_style_get_base(long /*int*/ style, int index, GdkColor color);
- public static final void gtk_style_get_base(long /*int*/ style, int index, GdkColor color) {
- lock.lock();
- try {
- _gtk_style_get_base(style, index, color);
- } finally {
- lock.unlock();
- }
- }
/** @method flags=dynamic */
public static final native void _gtk_style_context_add_class(long /*int*/ context, byte[] class_name);
public static final void gtk_style_context_add_class(long /*int*/ context, byte[] class_name) {
@@ -6289,58 +6194,6 @@ public class GTK extends OS {
lock.unlock();
}
}
- /**
- * @param style cast=(GtkStyle *)
- * @param color flags=no_in
- */
- public static final native void _gtk_style_get_black(long /*int*/ style, GdkColor color);
- public static final void gtk_style_get_black(long /*int*/ style, GdkColor color) {
- lock.lock();
- try {
- _gtk_style_get_black(style, color);
- } finally {
- lock.unlock();
- }
- }
- /**
- * @param style cast=(GtkStyle *)
- * @param color flags=no_in
- */
- public static final native void _gtk_style_get_bg(long /*int*/ style, int index, GdkColor color);
- public static final void gtk_style_get_bg(long /*int*/ style, int index, GdkColor color) {
- lock.lock();
- try {
- _gtk_style_get_bg(style, index, color);
- } finally {
- lock.unlock();
- }
- }
- /**
- * @param style cast=(GtkStyle *)
- * @param color flags=no_in
- */
- public static final native void _gtk_style_get_dark(long /*int*/ style, int index, GdkColor color);
- public static final void gtk_style_get_dark(long /*int*/ style, int index, GdkColor color) {
- lock.lock();
- try {
- _gtk_style_get_dark(style, index, color);
- } finally {
- lock.unlock();
- }
- }
- /**
- * @param style cast=(GtkStyle *)
- * @param color flags=no_in
- */
- public static final native void _gtk_style_get_fg(long /*int*/ style, int index, GdkColor color);
- public static final void gtk_style_get_fg(long /*int*/ style, int index, GdkColor color) {
- lock.lock();
- try {
- _gtk_style_get_fg(style, index, color);
- } finally {
- lock.unlock();
- }
- }
/** @param style cast=(GtkStyle *) */
public static final native long /*int*/ _gtk_style_get_font_desc(long /*int*/ style);
public static final long /*int*/ gtk_style_get_font_desc(long /*int*/ style) {
@@ -6351,32 +6204,6 @@ public class GTK extends OS {
lock.unlock();
}
}
- /**
- * @param style cast=(GtkStyle *)
- * @param color flags=no_in
- */
- public static final native void _gtk_style_get_light(long /*int*/ style, int index, GdkColor color);
- public static final void gtk_style_get_light(long /*int*/ style, int index, GdkColor color) {
- lock.lock();
- try {
- _gtk_style_get_light(style, index, color);
- } finally {
- lock.unlock();
- }
- }
- /**
- * @param style cast=(GtkStyle *)
- * @param color flags=no_in
- */
- public static final native void _gtk_style_get_text(long /*int*/ style, int index, GdkColor color);
- public static final void gtk_style_get_text(long /*int*/ style, int index, GdkColor color) {
- lock.lock();
- try {
- _gtk_style_get_text(style, index, color);
- } finally {
- lock.unlock();
- }
- }
/** @param style cast=(GtkStyle *) */
public static final native int _gtk_style_get_xthickness(long /*int*/ style);
public static final int gtk_style_get_xthickness(long /*int*/ style) {
@@ -7691,21 +7518,6 @@ public class GTK extends OS {
* @param iter cast=(GtkTreeIter *)
* @param value flags=no_out
*/
- public static final native void _gtk_tree_store_set(long /*int*/ store, long /*int*/ iter, int column, GdkColor value, int terminator);
- public static final void gtk_tree_store_set(long /*int*/ store, long /*int*/ iter, int column, GdkColor value, int terminator) {
- lock.lock();
- assert !GTK3 : "GTK2 code was run by GTK3";
- try {
- _gtk_tree_store_set(store, iter, column, value, terminator);
- } finally {
- lock.unlock();
- }
- }
- /**
- * @param store cast=(GtkTreeStore *)
- * @param iter cast=(GtkTreeIter *)
- * @param value flags=no_out
- */
public static final native void _gtk_tree_store_set(long /*int*/ store, long /*int*/ iter, int column, GdkRGBA value, int terminator);
public static final void gtk_tree_store_set(long /*int*/ store, long /*int*/ iter, int column, GdkRGBA value, int terminator) {
lock.lock();
@@ -8978,38 +8790,6 @@ public class GTK extends OS {
/**
* @method flags=dynamic
* @param widget cast=(GtkWidget *)
- * @param state cast=(GtkStateType)
- * @param color cast=(GdkColor *),flags=no_out
- */
- public static final native void _gtk_widget_modify_base(long /*int*/ widget, int state, GdkColor color);
- /** [GTK2/GTK3; 3.0 deprecated] */
- public static final void gtk_widget_modify_base(long /*int*/ widget, int state, GdkColor color) {
- lock.lock();
- try {
- _gtk_widget_modify_base(widget, state, color);
- } finally {
- lock.unlock();
- }
- }
- /**
- * @method flags=dynamic
- * @param widget cast=(GtkWidget *)
- * @param state cast=(GtkStateType)
- * @param color cast=(GdkColor *),flags=no_out
- */
- public static final native void _gtk_widget_modify_bg(long /*int*/ widget, int state, GdkColor color);
- /** [GTK2/GTK3; 3.0 deprecated] */
- public static final void gtk_widget_modify_bg(long /*int*/ widget, int state, GdkColor color) {
- lock.lock();
- try {
- _gtk_widget_modify_bg(widget, state, color);
- } finally {
- lock.unlock();
- }
- }
- /**
- * @method flags=dynamic
- * @param widget cast=(GtkWidget *)
* @param pango_font_descr cast=(PangoFontDescription *)
*/
public static final native void _gtk_widget_modify_font(long /*int*/ widget, long /*int*/ pango_font_descr);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GdkColor.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GdkColor.java
deleted file mode 100644
index 507a8f6fa7..0000000000
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GdkColor.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved.
- * The contents of this file are made available under the terms
- * of the GNU Lesser General Public License (LGPL) Version 2.1 that
- * accompanies this distribution (lgpl-v21.txt). The LGPL is also
- * available at http://www.gnu.org/licenses/lgpl.html. If the version
- * of the LGPL at http://www.gnu.org is different to the version of
- * the LGPL accompanying this distribution and there is any conflict
- * between the two license versions, the terms of the LGPL accompanying
- * this distribution shall govern.
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swt.internal.gtk;
-
-
-public class GdkColor {
- /** @field cast=(guint32) */
- public int pixel;
- /** @field cast=(guint16) */
- public short red;
- /** @field cast=(guint16) */
- public short green;
- /** @field cast=(guint16) */
- public short blue;
- public static final int sizeof = GDK.GdkColor_sizeof();
-}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
index dd5a248820..793b5e237b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
@@ -2070,20 +2070,6 @@ public static final void g_object_set(long /*int*/ object, byte[] first_property
lock.unlock();
}
}
-/**
- * @param object cast=(gpointer)
- * @param first_property_name cast=(const gchar *)
- * @param terminator cast=(const gchar *),flags=sentinel
- */
-public static final native void _g_object_set(long /*int*/ object, byte[] first_property_name, GdkColor data, long /*int*/ terminator);
-public static final void g_object_set(long /*int*/ object, byte[] first_property_name, GdkColor data, long /*int*/ terminator) {
- lock.lock();
- try {
- _g_object_set(object, first_property_name, data, terminator);
- } finally {
- lock.unlock();
- }
-}
//Note, the function below is handled in a special way in os.h because of the GdkRGBA (gtk3 only) struct. See os.h
//So although it is not marked as dynamic, it is only build on gtk3.
@@ -2920,13 +2906,6 @@ public static final native void memmove(long /*int*/ dest, GTypeInfo src, int si
* @param size cast=(size_t)
*/
public static final native void memmove(long /*int*/ dest, GtkTargetEntry src, long /*int*/ size);
-//NOTE: Call only on GTK2 as this uses GdkColor.
-/**
- * @param dest cast=(void *)
- * @param src cast=(const void *),flags=no_out
- * @param size cast=(size_t)
- */
-public static final native void memmove(long /*int*/ dest, GdkColor src, long /*int*/ size);
//NOTE: Call only on GTK3 as this uses GdkRGBA.
/**
* @param dest cast=(void *)
@@ -2991,13 +2970,6 @@ public static final native void memmove(GtkWidgetClass dest, long /*int*/ src);
* @param size cast=(size_t)
*/
public static final native void memmove(GtkBorder dest, long /*int*/ src, long /*int*/ size);
-//NOTE: Call only on GTK2 as this uses GdkColor.
-/**
- * @param dest cast=(void *),flags=no_in
- * @param src cast=(const void *)
- * @param size cast=(size_t)
- */
-public static final native void memmove(GdkColor dest, long /*int*/ src, long /*int*/ size);
/**
* @param dest cast=(void *),flags=no_in
* @param src cast=(const void *)
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java b/bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java
index 9efcf2f93f..4bce5d7c04 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java
@@ -408,13 +408,8 @@ public long /*int*/ internal_new_GC(GCData data) {
}
data.device = this;
data.drawable = drawable;
- if (GTK.GTK3) {
- data.backgroundRGBA = getSystemColor (SWT.COLOR_WHITE).handleRGBA;
- data.foregroundRGBA = getSystemColor (SWT.COLOR_BLACK).handleRGBA;
- } else {
- data.background = getSystemColor (SWT.COLOR_WHITE).handle;
- data.foreground = getSystemColor (SWT.COLOR_BLACK).handle;
- }
+ data.backgroundRGBA = getSystemColor (SWT.COLOR_WHITE).handleRGBA;
+ data.foregroundRGBA = getSystemColor (SWT.COLOR_BLACK).handleRGBA;
data.font = getSystemFont ();
Point dpi = getDPI(), screenDPI = getIndependentDPI();
data.width = (int)(GTK.gtk_page_setup_get_paper_width (pageSetup, GTK.GTK_UNIT_POINTS) * dpi.x / screenDPI.x);
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 87bcd1a8b7..4ccac95b6a 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
@@ -48,19 +48,6 @@ public final class Color extends Resource {
*
* @noreference This field is not intended to be referenced by clients.
*/
- public GdkColor handle;
- /**
- * the handle to the OS color resource
- * (Warning: This field is platform dependent)
- * <p>
- * <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT
- * public API. It is marked public only so that it can be shared
- * within the packages provided by SWT. It is not available on all
- * platforms and should never be accessed from application code.
- * </p>
- *
- * @noreference This field is not intended to be referenced by clients.
- */
public GdkRGBA handleRGBA;
int alpha = 0;
@@ -223,20 +210,7 @@ public Color(Device device, RGB rgb, int alpha) {
@Override
void destroy() {
- if (GTK.GTK3) {
- handleRGBA = null;
- } else {
- int pixel = handle.pixel;
- if (device.colorRefCount != null) {
- /* If this was the last reference, remove the color from the list */
- if (--device.colorRefCount[pixel] == 0) {
- device.gdkColors[pixel] = null;
- }
- }
- long /*int*/ colormap = GDK.gdk_colormap_get_system();
- GDK.gdk_colormap_free_colors(colormap, handle, 1);
- handle = null;
- }
+ handleRGBA = null;
}
/**
@@ -254,19 +228,11 @@ public boolean equals(Object object) {
if (object == this) return true;
if (!(object instanceof Color)) return false;
Color color = (Color)object;
- if (GTK.GTK3) {
- GdkRGBA gdkRGBA = color.handleRGBA;
- if (handleRGBA == gdkRGBA) return true;
- return device == color.device && Double.compare(handleRGBA.red, gdkRGBA.red) == 0 &&
- Double.compare(handleRGBA.green, gdkRGBA.green) == 0 && Double.compare(handleRGBA.blue, gdkRGBA.blue) == 0 &&
- Double.compare(handleRGBA.alpha, gdkRGBA.alpha) == 0;
- } else {
- GdkColor gdkColor = color.handle;
- if (handle == gdkColor) return true;
- return device == color.device && handle.red == gdkColor.red &&
- handle.green == gdkColor.green && handle.blue == gdkColor.blue &&
- alpha == color.alpha;
- }
+ GdkRGBA gdkRGBA = color.handleRGBA;
+ if (handleRGBA == gdkRGBA) return true;
+ return device == color.device && Double.compare(handleRGBA.red, gdkRGBA.red) == 0 &&
+ Double.compare(handleRGBA.green, gdkRGBA.green) == 0 && Double.compare(handleRGBA.blue, gdkRGBA.blue) == 0 &&
+ Double.compare(handleRGBA.alpha, gdkRGBA.alpha) == 0;
}
/**
@@ -295,11 +261,7 @@ public int getAlpha() {
*/
public int getBlue() {
if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
- if (GTK.GTK3) {
- return (int) (handleRGBA.blue * 255) & 0xFF;
- } else {
- return (handle.blue >> 8) & 0xFF;
- }
+ return (int) (handleRGBA.blue * 255) & 0xFF;
}
/**
@@ -313,11 +275,7 @@ public int getBlue() {
*/
public int getGreen() {
if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
- if (GTK.GTK3) {
- return (int) (handleRGBA.green * 255) & 0xFF;
- } else {
- return (handle.green >> 8) & 0xFF;
- }
+ return (int) (handleRGBA.green * 255) & 0xFF;
}
/**
@@ -331,11 +289,7 @@ public int getGreen() {
*/
public int getRed() {
if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
- if (GTK.GTK3) {
- return (int) (handleRGBA.red * 255) & 0xFF;
- } else {
- return (handle.red >> 8) & 0xFF;
- }
+ return (int) (handleRGBA.red * 255) & 0xFF;
}
/**
@@ -351,12 +305,8 @@ public int getRed() {
@Override
public int hashCode() {
if (isDisposed()) return 0;
- if (GTK.GTK3) {
- return Double.hashCode(handleRGBA.red) ^ Double.hashCode(handleRGBA.green) ^ Double.hashCode(handleRGBA.blue)
- ^ Double.hashCode(handleRGBA.alpha);
- } else {
- return handle.red ^ handle.green ^ handle.blue ^ alpha;
- }
+ return Double.hashCode(handleRGBA.red) ^ Double.hashCode(handleRGBA.green) ^ Double.hashCode(handleRGBA.blue)
+ ^ Double.hashCode(handleRGBA.alpha);
}
/**
@@ -399,26 +349,6 @@ public RGBA getRGBA () {
* </p>
*
* @param device the device on which to allocate the color
- * @param gdkColor the handle for the color
- *
- * @noreference This method is not intended to be referenced by clients.
- */
-public static Color gtk_new(Device device, GdkColor gdkColor) {
- assert !GTK.GTK3 : "GTK2 code was run by GTK3";
- return gtk_new(device, gdkColor, 255);
-}
-
-/**
- * Invokes platform specific functionality to allocate a new color.
- * <p>
- * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
- * API for <code>Color</code>. It is marked public only so that it
- * can be shared within the packages provided by SWT. It is not
- * available on all platforms, and should never be called from
- * application code.
- * </p>
- *
- * @param device the device on which to allocate the color
* @param gdkRGBA the handle for the color
*
* @noreference This method is not intended to be referenced by clients.
@@ -442,30 +372,6 @@ public static Color gtk_new(Device device, GdkRGBA gdkRGBA) {
* </p>
*
* @param device the device on which to allocate the color
- * @param gdkColor the handle for the color
- * @param alpha the int for the alpha content in the color(Currently SWT honors extreme values for alpha ie. 0 or 255)
- *
- * @noreference This method is not intended to be referenced by clients.
- */
-public static Color gtk_new(Device device, GdkColor gdkColor, int alpha) {
- assert !GTK.GTK3 : "GTK2 code was run by GTK3";
- Color color = new Color(device);
- color.handle = gdkColor;
- color.alpha = alpha;
- return color;
-}
-
-/**
- * Invokes platform specific functionality to allocate a new color.
- * <p>
- * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
- * API for <code>Color</code>. It is marked public only so that it
- * can be shared within the packages provided by SWT. It is not
- * available on all platforms, and should never be called from
- * application code.
- * </p>
- *
- * @param device the device on which to allocate the color
* @param gdkRGBA the handle for the color
* @param alpha the int for the alpha content in the color(Currently SWT honors extreme values for alpha ie. 0 or 255)
*
@@ -502,40 +408,13 @@ void init(int red, int green, int blue, int alpha) {
(alpha > 255) || (alpha < 0)) {
SWT.error(SWT.ERROR_INVALID_ARGUMENT);
}
- if (!GTK.GTK3) {
- GdkColor gdkColor = new GdkColor();
- gdkColor.red = (short)((red & 0xFF) | ((red & 0xFF) << 8));
- gdkColor.green = (short)((green & 0xFF) | ((green & 0xFF) << 8));
- gdkColor.blue = (short)((blue & 0xFF) | ((blue & 0xFF) << 8));
- this.alpha = alpha;
- long /*int*/ colormap = GDK.gdk_colormap_get_system();
- if (!GDK.gdk_colormap_alloc_color(colormap, gdkColor, true, true)) {
- /* Allocate black. */
- gdkColor = new GdkColor();
- GDK.gdk_colormap_alloc_color(colormap, gdkColor, true, true);
- }
- handle = gdkColor;
- if (device.colorRefCount != null) {
- /* Make a copy of the color to put in the colors array */
- GdkColor colorCopy = new GdkColor();
- colorCopy.red = handle.red;
- colorCopy.green = handle.green;
- colorCopy.blue = handle.blue;
- colorCopy.pixel = handle.pixel;
- device.gdkColors[colorCopy.pixel] = colorCopy;
- device.colorRefCount[colorCopy.pixel]++;
- }
- } else {
- // GdkColormap is deprecated on GTK3, just create the handle directly
- GdkRGBA rgba = new GdkRGBA ();
- rgba.red = (double) red / 255;
- rgba.green = (double) green / 255;
- rgba.blue = (double) blue / 255;
- rgba.alpha = (double) alpha / 255;
- this.alpha = alpha;
- handleRGBA = rgba;
- }
-
+ GdkRGBA rgba = new GdkRGBA ();
+ rgba.red = (double) red / 255;
+ rgba.green = (double) green / 255;
+ rgba.blue = (double) blue / 255;
+ rgba.alpha = (double) alpha / 255;
+ this.alpha = alpha;
+ handleRGBA = rgba;
}
/**
@@ -550,11 +429,7 @@ void init(int red, int green, int blue, int alpha) {
*/
@Override
public boolean isDisposed() {
- if (GTK.GTK3) {
- return handleRGBA == null;
- } else {
- return handle == null;
- }
+ return handleRGBA == null;
}
/**
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Cursor.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Cursor.java
index bb4b401a4f..aac2ab45cc 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Cursor.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Cursor.java
@@ -452,76 +452,61 @@ public Cursor(Device device, ImageData source, int hotspotX, int hotspotY) {
}
long /*int*/ createCursor(byte[] sourceData, byte[] maskData, int width, int height, int hotspotX, int hotspotY, boolean reverse) {
- if (GTK.GTK3) {
- for (int i = 0; i < sourceData.length; i++) {
- byte s = sourceData[i];
- sourceData[i] = (byte)(((s & 0x80) >> 7) |
- ((s & 0x40) >> 5) |
- ((s & 0x20) >> 3) |
- ((s & 0x10) >> 1) |
- ((s & 0x08) << 1) |
- ((s & 0x04) << 3) |
- ((s & 0x02) << 5) |
- ((s & 0x01) << 7));
- sourceData[i] = (byte) ~sourceData[i];
- }
- for (int i = 0; i < maskData.length; i++) {
- byte s = maskData[i];
- maskData[i] = (byte)(((s & 0x80) >> 7) |
- ((s & 0x40) >> 5) |
- ((s & 0x20) >> 3) |
- ((s & 0x10) >> 1) |
- ((s & 0x08) << 1) |
- ((s & 0x04) << 3) |
- ((s & 0x02) << 5) |
- ((s & 0x01) << 7));
- maskData[i] = (byte) ~maskData[i];
- }
- PaletteData palette = new PaletteData(new RGB(0, 0, 0), new RGB(255, 255, 255));
- ImageData source = new ImageData(width, height, 1, palette, 1, sourceData);
- ImageData mask = new ImageData(width, height, 1, palette, 1, maskData);
- byte[] data = new byte[source.width * source.height * 4];
- for (int y = 0; y < source.height; y++) {
- int offset = y * source.width * 4;
- for (int x = 0; x < source.width; x++) {
- int pixel = source.getPixel(x, y);
- int maskPixel = mask.getPixel(x, y);
- if (pixel == 0 && maskPixel == 0) {
- // BLACK
- data[offset+3] = (byte)0xFF;
- } else if (pixel == 0 && maskPixel == 1) {
- // WHITE - cursor color
- data[offset] = data[offset + 1] = data[offset + 2] = data[offset + 3] = (byte)0xFF;
- } else if (pixel == 1 && maskPixel == 0) {
- // SCREEN
- } else {
- /* no support */
- // REVERSE SCREEN -> SCREEN
- }
- offset += 4;
+ for (int i = 0; i < sourceData.length; i++) {
+ byte s = sourceData[i];
+ sourceData[i] = (byte)(((s & 0x80) >> 7) |
+ ((s & 0x40) >> 5) |
+ ((s & 0x20) >> 3) |
+ ((s & 0x10) >> 1) |
+ ((s & 0x08) << 1) |
+ ((s & 0x04) << 3) |
+ ((s & 0x02) << 5) |
+ ((s & 0x01) << 7));
+ sourceData[i] = (byte) ~sourceData[i];
+ }
+ for (int i = 0; i < maskData.length; i++) {
+ byte s = maskData[i];
+ maskData[i] = (byte)(((s & 0x80) >> 7) |
+ ((s & 0x40) >> 5) |
+ ((s & 0x20) >> 3) |
+ ((s & 0x10) >> 1) |
+ ((s & 0x08) << 1) |
+ ((s & 0x04) << 3) |
+ ((s & 0x02) << 5) |
+ ((s & 0x01) << 7));
+ maskData[i] = (byte) ~maskData[i];
+ }
+ PaletteData palette = new PaletteData(new RGB(0, 0, 0), new RGB(255, 255, 255));
+ ImageData source = new ImageData(width, height, 1, palette, 1, sourceData);
+ ImageData mask = new ImageData(width, height, 1, palette, 1, maskData);
+ byte[] data = new byte[source.width * source.height * 4];
+ for (int y = 0; y < source.height; y++) {
+ int offset = y * source.width * 4;
+ for (int x = 0; x < source.width; x++) {
+ int pixel = source.getPixel(x, y);
+ int maskPixel = mask.getPixel(x, y);
+ if (pixel == 0 && maskPixel == 0) {
+ // BLACK
+ data[offset+3] = (byte)0xFF;
+ } else if (pixel == 0 && maskPixel == 1) {
+ // WHITE - cursor color
+ data[offset] = data[offset + 1] = data[offset + 2] = data[offset + 3] = (byte)0xFF;
+ } else if (pixel == 1 && maskPixel == 0) {
+ // SCREEN
+ } else {
+ /* no support */
+ // REVERSE SCREEN -> SCREEN
}
+ offset += 4;
}
- long /*int*/ pixbuf = GDK.gdk_pixbuf_new(GDK.GDK_COLORSPACE_RGB, true, 8, width, height);
- if (pixbuf == 0) SWT.error(SWT.ERROR_NO_HANDLES);
- int stride = GDK.gdk_pixbuf_get_rowstride(pixbuf);
- long /*int*/ pixels = GDK.gdk_pixbuf_get_pixels(pixbuf);
- C.memmove(pixels, data, stride * height);
- long /*int*/ cursor = GDK.gdk_cursor_new_from_pixbuf(GDK.gdk_display_get_default(), pixbuf, hotspotX, hotspotY);
- OS.g_object_unref(pixbuf);
- return cursor;
- }
- long /*int*/ sourcePixmap = GDK.gdk_bitmap_create_from_data(0, sourceData, width, height);
- long /*int*/ maskPixmap = GDK.gdk_bitmap_create_from_data(0, maskData, width, height);
- long /*int*/ cursor = 0;
- if (sourcePixmap != 0 && maskPixmap != 0) {
- GdkColor foreground = new GdkColor();
- if (!reverse) foreground.red = foreground.green = foreground.blue = (short)0xFFFF;
- GdkColor background = new GdkColor();
- if (reverse) background.red = background.green = background.blue = (short)0xFFFF;
- cursor = GDK.gdk_cursor_new_from_pixmap (sourcePixmap, maskPixmap, foreground, background, hotspotX, hotspotY);
}
- if (sourcePixmap != 0) OS.g_object_unref (sourcePixmap);
- if (maskPixmap != 0) OS.g_object_unref (maskPixmap);
+ long /*int*/ pixbuf = GDK.gdk_pixbuf_new(GDK.GDK_COLORSPACE_RGB, true, 8, width, height);
+ if (pixbuf == 0) SWT.error(SWT.ERROR_NO_HANDLES);
+ int stride = GDK.gdk_pixbuf_get_rowstride(pixbuf);
+ long /*int*/ pixels = GDK.gdk_pixbuf_get_pixels(pixbuf);
+ C.memmove(pixels, data, stride * height);
+ long /*int*/ cursor = GDK.gdk_cursor_new_from_pixbuf(GDK.gdk_display_get_default(), pixbuf, hotspotX, hotspotY);
+ OS.g_object_unref(pixbuf);
return cursor;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Device.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Device.java
index 29ee68b2e8..80749902a6 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Device.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Device.java
@@ -66,10 +66,6 @@ public abstract class Device implements Drawable {
Object [] objects;
Object trackingLock;
- /* Colormap and reference count */
- GdkColor [] gdkColors;
- int [] colorRefCount;
-
/* Disposed flag */
boolean disposed;
@@ -937,23 +933,6 @@ protected void release () {
if (systemFont != null) systemFont.dispose ();
systemFont = null;
- if (gdkColors != null) {
- if (!GTK.GTK3) {
- long /*int*/ colormap = GDK.gdk_colormap_get_system();
- for (int i = 0; i < gdkColors.length; i++) {
- GdkColor color = gdkColors [i];
- if (color != null) {
- while (colorRefCount [i] > 0) {
- GDK.gdk_colormap_free_colors(colormap, color, 1);
- --colorRefCount [i];
- }
- }
- }
- }
- }
- gdkColors = null;
- colorRefCount = null;
-
if (COLOR_BLACK != null) COLOR_BLACK.dispose();
if (COLOR_DARK_RED != null) COLOR_DARK_RED.dispose();
if (COLOR_DARK_GREEN != null) COLOR_DARK_GREEN.dispose();
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java
index 47c79fad57..338dbd2010 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java
@@ -281,23 +281,14 @@ void checkGC (int mask) {
data.state |= mask;
long /*int*/ cairo = data.cairo;
if ((state & (BACKGROUND | FOREGROUND)) != 0) {
- GdkColor color = null;
GdkRGBA colorRGBA = null;
Pattern pattern;
if ((state & FOREGROUND) != 0) {
- if (GTK.GTK3) {
- colorRGBA = data.foregroundRGBA;
- } else {
- color = data.foreground;
- }
+ colorRGBA = data.foregroundRGBA;
pattern = data.foregroundPattern;
data.state &= ~BACKGROUND;
} else {
- if (GTK.GTK3) {
- colorRGBA = data.backgroundRGBA;
- } else {
- color = data.background;
- }
+ colorRGBA = data.backgroundRGBA;
pattern = data.backgroundPattern;
data.state &= ~FOREGROUND;
}
@@ -314,11 +305,7 @@ void checkGC (int mask) {
Cairo.cairo_set_source(cairo, pattern.handle);
}
} else {
- if (GTK.GTK3) {
- Cairo.cairo_set_source_rgba(cairo, colorRGBA.red, colorRGBA.green, colorRGBA.blue, data.alpha / (float)0xFF);
- } else {
- Cairo.cairo_set_source_rgba(cairo, (color.red & 0xFFFF) / (float)0xFFFF, (color.green & 0xFFFF) / (float)0xFFFF, (color.blue & 0xFFFF) / (float)0xFFFF, data.alpha / (float)0xFF);
- }
+ Cairo.cairo_set_source_rgba(cairo, colorRGBA.red, colorRGBA.green, colorRGBA.blue, data.alpha / (float)0xFF);
}
}
if ((state & FONT) != 0) {
@@ -1982,11 +1969,7 @@ public int getAntialias() {
*/
public Color getBackground() {
if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
- if (GTK.GTK3) {
- return Color.gtk_new(data.device, data.backgroundRGBA);
- } else {
- return Color.gtk_new(data.device, data.background);
- }
+ return Color.gtk_new(data.device, data.backgroundRGBA);
}
/**
@@ -2226,11 +2209,7 @@ public FontMetrics getFontMetrics() {
*/
public Color getForeground() {
if (handle == 0) SWT.error(SWT.ERROR_WIDGET_DISPOSED);
- if (GTK.GTK3) {
- return Color.gtk_new(data.device, data.foregroundRGBA);
- } else {
- return Color.gtk_new(data.device, data.foreground);
- }
+ return Color.gtk_new(data.device, data.foregroundRGBA);
}
/**
@@ -2598,13 +2577,8 @@ double[] identity() {
}
void init(Drawable drawable, GCData data, long /*int*/ gdkGC) {
- if (GTK.GTK3) {
- if (data.foregroundRGBA != null) data.state &= ~FOREGROUND;
- if (data.backgroundRGBA != null) data.state &= ~(BACKGROUND | BACKGROUND_BG);
- } else {
- if (data.foreground != null) data.state &= ~FOREGROUND;
- if (data.background != null) data.state &= ~(BACKGROUND | BACKGROUND_BG);
- }
+ if (data.foregroundRGBA != null) data.state &= ~FOREGROUND;
+ if (data.backgroundRGBA != null) data.state &= ~(BACKGROUND | BACKGROUND_BG);
if (data.font != null) data.state &= ~FONT;
Image image = data.image;
if (image != null) {
@@ -2845,11 +2819,7 @@ public void setBackground(Color color) {
if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
if (color == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
if (color.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
- if (GTK.GTK3) {
- data.backgroundRGBA = color.handleRGBA;
- } else {
- data.background = color.handle;
- }
+ data.backgroundRGBA = color.handleRGBA;
data.backgroundPattern = null;
data.state &= ~(BACKGROUND | BACKGROUND_BG);
}
@@ -2916,17 +2886,8 @@ static void setCairoRegion(long /*int*/ cairo, long /*int*/ rgn) {
}
static void setCairoPatternColor(long /*int*/ pattern, int offset, Color c, int alpha) {
- if (GTK.GTK3) {
- GdkRGBA rgba = c.handleRGBA;
- Cairo.cairo_pattern_add_color_stop_rgba(pattern, offset, rgba.red, rgba.green, rgba.blue, alpha / 255f);
- } else {
- GdkColor color = c.handle;
- double aa = (alpha & 0xFF) / (double)0xFF;
- double red = ((color.red & 0xFFFF) / (double)0xFFFF);
- double green = ((color.green & 0xFFFF) / (double)0xFFFF);
- double blue = ((color.blue & 0xFFFF) / (double)0xFFFF);
- Cairo.cairo_pattern_add_color_stop_rgba(pattern, offset, red, green, blue, aa);
- }
+ GdkRGBA rgba = c.handleRGBA;
+ Cairo.cairo_pattern_add_color_stop_rgba(pattern, offset, rgba.red, rgba.green, rgba.blue, alpha / 255f);
}
void setCairoClip(long /*int*/ damageRgn, long /*int*/ clipRgn) {
@@ -3259,11 +3220,7 @@ public void setForeground(Color color) {
if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
if (color == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
if (color.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
- if (GTK.GTK3) {
- data.foregroundRGBA = color.handleRGBA;
- } else {
- data.foreground = color.handle;
- }
+ data.foregroundRGBA = color.handleRGBA;
data.foregroundPattern = null;
data.state &= ~FOREGROUND;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GCData.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GCData.java
index 4b4d67493e..ba044ea83c 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GCData.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GCData.java
@@ -43,18 +43,6 @@ public final class GCData {
*
* @noreference This field is not intended to be referenced by clients.
*/
- public GdkColor foreground,background;
-
- /**
- * <p>
- * <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT
- * public API. It is marked public only so that it can be shared
- * within the packages provided by SWT. It is not available on all
- * platforms and should never be accessed from application code.
- * </p>
- *
- * @noreference This field is not intended to be referenced by clients.
- */
public GdkRGBA foregroundRGBA, backgroundRGBA;
public Font font;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java
index 2ab46e0307..6e551d3339 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java
@@ -926,127 +926,6 @@ void createSurface() {
if (surface != 0) return;
/* There is no pixmaps in GTK 3. */
if (GTK.GTK3) return;
- /* Generate the mask if necessary. */
- if (transparentPixel != -1) createMask();
- int[] w = new int[1], h = new int[1];
- GDK.gdk_pixmap_get_size(pixmap, w, h);
- int width = w[0], height = h[0];
- this.width = width;
- this.height = height;
- if (mask != 0 || alpha != -1 || alphaData != null) {
- long /*int*/ pixbuf = GDK.gdk_pixbuf_new(GDK.GDK_COLORSPACE_RGB, true, 8, width, height);
- if (pixbuf == 0) SWT.error(SWT.ERROR_NO_HANDLES);
- long /*int*/ colormap = GDK.gdk_colormap_get_system();
- GDK.gdk_pixbuf_get_from_drawable(pixbuf, pixmap, colormap, 0, 0, 0, 0, width, height);
- int stride = GDK.gdk_pixbuf_get_rowstride(pixbuf);
- long /*int*/ pixels = GDK.gdk_pixbuf_get_pixels(pixbuf);
- byte[] line = new byte[stride];
- int oa, or, og, ob;
- if (OS.BIG_ENDIAN) {
- oa = 0; or = 1; og = 2; ob = 3;
- } else {
- oa = 3; or = 2; og = 1; ob = 0;
- }
- if (mask != 0 && GDK.gdk_drawable_get_depth(mask) == 1) {
- long /*int*/ maskPixbuf = GDK.gdk_pixbuf_new(GDK.GDK_COLORSPACE_RGB, false, 8, width, height);
- if (maskPixbuf == 0) SWT.error(SWT.ERROR_NO_HANDLES);
- GDK.gdk_pixbuf_get_from_drawable(maskPixbuf, mask, 0, 0, 0, 0, 0, width, height);
- int maskStride = GDK.gdk_pixbuf_get_rowstride(maskPixbuf);
- long /*int*/ maskPixels = GDK.gdk_pixbuf_get_pixels(maskPixbuf);
- byte[] maskLine = new byte[maskStride];
- long /*int*/ offset = pixels, maskOffset = maskPixels;
- for (int y=0; y<height; y++) {
- C.memmove(line, offset, stride);
- C.memmove(maskLine, maskOffset, maskStride);
- for (int x=0, offset1=0; x<width; x++, offset1 += 4) {
- if (maskLine[x * 3] == 0) {
- line[offset1 + 0] = line[offset1 + 1] = line[offset1 + 2] = line[offset1 + 3] = 0;
- } else {
- byte r = line[offset1 + 0];
- byte g = line[offset1 + 1];
- byte b = line[offset1 + 2];
- line[offset1 + oa] = (byte)0xFF;
- line[offset1 + or] = r;
- line[offset1 + og] = g;
- line[offset1 + ob] = b;
- }
- }
- C.memmove(offset, line, stride);
- offset += stride;
- maskOffset += maskStride;
- }
- OS.g_object_unref(maskPixbuf);
- } else if (alpha != -1) {
- long /*int*/ offset = pixels;
- for (int y=0; y<height; y++) {
- C.memmove(line, offset, stride);
- for (int x=0, offset1=0; x<width; x++, offset1 += 4) {
- /* pre-multiplied alpha */
- int r = ((line[offset1 + 0] & 0xFF) * alpha) + 128;
- r = (r + (r >> 8)) >> 8;
- int g = ((line[offset1 + 1] & 0xFF) * alpha) + 128;
- g = (g + (g >> 8)) >> 8;
- int b = ((line[offset1 + 2] & 0xFF) * alpha) + 128;
- b = (b + (b >> 8)) >> 8;
- line[offset1 + oa] = (byte)alpha;
- line[offset1 + or] = (byte)r;
- line[offset1 + og] = (byte)g;
- line[offset1 + ob] = (byte)b;
- }
- C.memmove(offset, line, stride);
- offset += stride;
- }
- } else if (alphaData != null) {
- long /*int*/ offset = pixels;
- for (int y = 0; y < h [0]; y++) {
- C.memmove (line, offset, stride);
- for (int x=0, offset1=0; x<width; x++, offset1 += 4) {
- int alpha = alphaData [y*w [0]+x] & 0xFF;
- /* pre-multiplied alpha */
- int r = ((line[offset1 + 0] & 0xFF) * alpha) + 128;
- r = (r + (r >> 8)) >> 8;
- int g = ((line[offset1 + 1] & 0xFF) * alpha) + 128;
- g = (g + (g >> 8)) >> 8;
- int b = ((line[offset1 + 2] & 0xFF) * alpha) + 128;
- b = (b + (b >> 8)) >> 8;
- line[offset1 + oa] = (byte)alpha;
- line[offset1 + or] = (byte)r;
- line[offset1 + og] = (byte)g;
- line[offset1 + ob] = (byte)b;
- }
- C.memmove (offset, line, stride);
- offset += stride;
- }
- } else {
- long /*int*/ offset = pixels;
- for (int y = 0; y < h [0]; y++) {
- C.memmove (line, offset, stride);
- for (int x=0, offset1=0; x<width; x++, offset1 += 4) {
- byte r = line[offset1 + 0];
- byte g = line[offset1 + 1];
- byte b = line[offset1 + 2];
- line[offset1 + oa] = (byte)0xFF;
- line[offset1 + or] = r;
- line[offset1 + og] = g;
- line[offset1 + ob] = b;
- }
- C.memmove (offset, line, stride);
- offset += stride;
- }
- }
- surface = Cairo.cairo_image_surface_create(Cairo.CAIRO_FORMAT_ARGB32, width, height);
- long /*int*/ data = Cairo.cairo_image_surface_get_data(surface);
- C.memmove(data, pixels, stride * height);
- Cairo.cairo_surface_mark_dirty(surface);
- OS.g_object_unref(pixbuf);
- } else {
- long /*int*/ xDisplay = GDK.gdk_x11_display_get_xdisplay(GDK.gdk_display_get_default());
- long /*int*/ xDrawable = GDK.GDK_PIXMAP_XID(pixmap);
- long /*int*/ xVisual = GDK.gdk_x11_visual_get_xvisual(GDK.gdk_visual_get_system());
- surface = Cairo.cairo_xlib_surface_create(xDisplay, xDrawable, xVisual, width, height);
- }
- /* Destroy the image mask if the there is a GC created on the image */
- if (transparentPixel != -1 && memGC != null) destroyMask();
}
/**
@@ -1587,13 +1466,8 @@ public long /*int*/ internal_new_GC (GCData data) {
}
data.device = device;
data.drawable = pixmap;
- if (GTK.GTK3) {
- data.foregroundRGBA = device.COLOR_BLACK.handleRGBA;
- data.backgroundRGBA = device.COLOR_WHITE.handleRGBA;
- } else {
- data.background = device.COLOR_WHITE.handle;
- data.foreground = device.COLOR_BLACK.handle;
- }
+ data.foregroundRGBA = device.COLOR_BLACK.handleRGBA;
+ data.backgroundRGBA = device.COLOR_WHITE.handleRGBA;
data.font = device.systemFont;
data.image = this;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/TextLayout.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/TextLayout.java
index e6bb31e778..6750fde25b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/TextLayout.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/TextLayout.java
@@ -221,16 +221,11 @@ void computeRuns () {
if (style.foreground == null) {
// Bug 497071: use COLOR_LINK_FOREGROUND for StyledText links
long /*int*/ attr;
- if (GTK.GTK3) {
- GdkRGBA linkRGBA = device.getSystemColor(SWT.COLOR_LINK_FOREGROUND).handleRGBA;
- // Manual conversion since PangoAttrColor is a special case.
- // It uses GdkColor style colors but is supported on GTK3.
- attr = OS.pango_attr_foreground_new((short)(linkRGBA.red * 0xFFFF),
- (short)(linkRGBA.green * 0xFFFF), (short)(linkRGBA.blue * 0xFFFF));
- } else {
- GdkColor linkColor = device.getSystemColor(SWT.COLOR_LINK_FOREGROUND).handle;
- attr = OS.pango_attr_foreground_new(linkColor.red, linkColor.green, linkColor.blue);
- }
+ GdkRGBA linkRGBA = device.getSystemColor(SWT.COLOR_LINK_FOREGROUND).handleRGBA;
+ // Manual conversion since PangoAttrColor is a special case.
+ // It uses GdkColor style colors but is supported on GTK3.
+ attr = OS.pango_attr_foreground_new((short)(linkRGBA.red * 0xFFFF),
+ (short)(linkRGBA.green * 0xFFFF), (short)(linkRGBA.blue * 0xFFFF));
OS.memmove (attribute, attr, PangoAttribute.sizeof);
attribute.start_index = byteStart;
attribute.end_index = byteEnd;
@@ -249,14 +244,9 @@ void computeRuns () {
OS.pango_attr_list_insert(attrList, attr);
OS.pango_attr_list_insert(selAttrList, OS.pango_attribute_copy(attr));
if (style.underlineColor != null) {
- if (GTK.GTK3) {
- GdkRGBA rgba = style.underlineColor.handleRGBA;
- attr = OS.pango_attr_underline_color_new((short)(rgba.red * 0xFFFF),
- (short)(rgba.green * 0xFFFF), (short)(rgba.blue * 0xFFFF));
- } else {
- GdkColor fg = style.underlineColor.handle;
- attr = OS.pango_attr_underline_color_new(fg.red, fg.green, fg.blue);
- }
+ GdkRGBA rgba = style.underlineColor.handleRGBA;
+ attr = OS.pango_attr_underline_color_new((short)(rgba.red * 0xFFFF),
+ (short)(rgba.green * 0xFFFF), (short)(rgba.blue * 0xFFFF));
if (attr != 0) {
OS.memmove(attribute, attr, PangoAttribute.sizeof);
attribute.start_index = byteStart;
@@ -276,14 +266,9 @@ void computeRuns () {
OS.pango_attr_list_insert(attrList, attr);
OS.pango_attr_list_insert(selAttrList, OS.pango_attribute_copy(attr));
if (style.strikeoutColor != null) {
- if (GTK.GTK3) {
- GdkRGBA rgba = style.strikeoutColor.handleRGBA;
- attr = OS.pango_attr_strikethrough_color_new((short)(rgba.red * 0xFFFF),
- (short)(rgba.green * 0xFFFF), (short)(rgba.blue * 0xFFFF));
- } else {
- GdkColor fg = style.strikeoutColor.handle;
- attr = OS.pango_attr_strikethrough_color_new(fg.red, fg.green, fg.blue);
- }
+ GdkRGBA rgba = style.strikeoutColor.handleRGBA;
+ attr = OS.pango_attr_strikethrough_color_new((short)(rgba.red * 0xFFFF),
+ (short)(rgba.green * 0xFFFF), (short)(rgba.blue * 0xFFFF));
if (attr != 0) {
OS.memmove(attribute, attr, PangoAttribute.sizeof);
attribute.start_index = byteStart;
@@ -297,14 +282,9 @@ void computeRuns () {
Color foreground = style.foreground;
if (foreground != null && !foreground.isDisposed()) {
long /*int*/ attr;
- if (GTK.GTK3) {
- GdkRGBA rgba = foreground.handleRGBA;
- attr = OS.pango_attr_foreground_new((short)(rgba.red * 0xFFFF),
- (short)(rgba.green * 0xFFFF), (short)(rgba.blue * 0xFFFF));
- } else {
- GdkColor fg = foreground.handle;
- attr = OS.pango_attr_foreground_new(fg.red, fg.green, fg.blue);
- }
+ GdkRGBA rgba = foreground.handleRGBA;
+ attr = OS.pango_attr_foreground_new((short)(rgba.red * 0xFFFF),
+ (short)(rgba.green * 0xFFFF), (short)(rgba.blue * 0xFFFF));
OS.memmove (attribute, attr, PangoAttribute.sizeof);
attribute.start_index = byteStart;
attribute.end_index = byteEnd;
@@ -314,14 +294,9 @@ void computeRuns () {
Color background = style.background;
if (background != null && !background.isDisposed()) {
long /*int*/ attr;
- if (GTK.GTK3) {
- GdkRGBA rgba = background.handleRGBA;
- attr = OS.pango_attr_background_new((short)(rgba.red * 0xFFFF),
- (short)(rgba.green * 0xFFFF), (short)(rgba.blue * 0xFFFF));
- } else {
- GdkColor bg = background.handle;
- attr = OS.pango_attr_background_new(bg.red, bg.green, bg.blue);
- }
+ GdkRGBA rgba = background.handleRGBA;
+ attr = OS.pango_attr_background_new((short)(rgba.red * 0xFFFF),
+ (short)(rgba.green * 0xFFFF), (short)(rgba.blue * 0xFFFF));
OS.memmove (attribute, attr, PangoAttribute.sizeof);
attribute.start_index = byteStart;
attribute.end_index = byteEnd;
@@ -503,13 +478,8 @@ void drawInPixels(GC gc, int x, int y, int selectionStart, int selectionEnd, Col
long /*int*/ iter = OS.pango_layout_get_iter(layout);
if (selectionBackground == null) selectionBackground = device.getSystemColor(SWT.COLOR_LIST_SELECTION);
Cairo.cairo_save(cairo);
- if (GTK.GTK3) {
- GdkRGBA rgba = selectionBackground.handleRGBA;
- Cairo.cairo_set_source_rgba(cairo, rgba.red, rgba.green, rgba.blue, rgba.alpha);
- } else {
- GdkColor color = selectionBackground.handle;
- Cairo.cairo_set_source_rgba(cairo, (color.red & 0xFFFF) / (float)0xFFFF, (color.green & 0xFFFF) / (float)0xFFFF, (color.blue & 0xFFFF) / (float)0xFFFF, data.alpha / (float)0xFF);
- }
+ GdkRGBA rgba = selectionBackground.handleRGBA;
+ Cairo.cairo_set_source_rgba(cairo, rgba.red, rgba.green, rgba.blue, rgba.alpha);
int lineIndex = 0;
do {
int lineEnd;
@@ -621,19 +591,11 @@ void drawWithCairo(GC gc, int x, int y, int start, int end, boolean fullSelectio
if (rgn != 0) {
GDK.gdk_cairo_region(cairo, rgn);
Cairo.cairo_clip(cairo);
- if (GTK.GTK3) {
- Cairo.cairo_set_source_rgba(cairo, bg.handleRGBA.red, bg.handleRGBA.green, bg.handleRGBA.blue, bg.handleRGBA.alpha);
- } else {
- Cairo.cairo_set_source_rgba(cairo, (bg.handle.red & 0xFFFF) / (float)0xFFFF, (bg.handle.green & 0xFFFF) / (float)0xFFFF, (bg.handle.blue & 0xFFFF) / (float)0xFFFF, data.alpha / (float)0xFF);
- }
+ Cairo.cairo_set_source_rgba(cairo, bg.handleRGBA.red, bg.handleRGBA.green, bg.handleRGBA.blue, bg.handleRGBA.alpha);
Cairo.cairo_paint(cairo);
GDK.gdk_region_destroy(rgn);
}
- if (GTK.GTK3) {
- Cairo.cairo_set_source_rgba(cairo, fg.handleRGBA.red, fg.handleRGBA.green, fg.handleRGBA.blue, fg.handleRGBA.alpha);
- } else {
- Cairo.cairo_set_source_rgba(cairo, (fg.handle.red & 0xFFFF) / (float)0xFFFF, (fg.handle.green & 0xFFFF) / (float)0xFFFF, (fg.handle.blue & 0xFFFF) / (float)0xFFFF, data.alpha / (float)0xFF);
- }
+ Cairo.cairo_set_source_rgba(cairo, fg.handleRGBA.red, fg.handleRGBA.green, fg.handleRGBA.blue, fg.handleRGBA.alpha);
Cairo.cairo_move_to(cairo, x, y);
OS.pango_layout_set_attributes(layout, selAttrList);
OS.pango_cairo_show_layout(cairo, layout);
@@ -671,18 +633,10 @@ void drawBorder(GC gc, int x, int y, Color selectionColor) {
Region.gdk_region_get_rectangles(rgn, rects, nRects);
GdkRectangle rect = new GdkRectangle();
GdkRGBA colorRGBA = null;
- GdkColor color = null;
- if (GTK.GTK3) {
- if (colorRGBA == null && style.borderColor != null) colorRGBA = style.borderColor.handleRGBA;
- if (colorRGBA == null && selectionColor != null) colorRGBA = selectionColor.handleRGBA;
- if (colorRGBA == null && style.foreground != null) colorRGBA = style.foreground.handleRGBA;
- if (colorRGBA == null) colorRGBA = data.foregroundRGBA;
- } else {
- if (color == null && style.borderColor != null) color = style.borderColor.handle;
- if (color == null && selectionColor != null) color = selectionColor.handle;
- if (color == null && style.foreground != null) color = style.foreground.handle;
- if (color == null) color = data.foreground;
- }
+ if (colorRGBA == null && style.borderColor != null) colorRGBA = style.borderColor.handleRGBA;
+ if (colorRGBA == null && selectionColor != null) colorRGBA = selectionColor.handleRGBA;
+ if (colorRGBA == null && style.foreground != null) colorRGBA = style.foreground.handleRGBA;
+ if (colorRGBA == null) colorRGBA = data.foregroundRGBA;
int width = 1;
float[] dashes = null;
switch (style.borderStyle) {
@@ -690,11 +644,7 @@ void drawBorder(GC gc, int x, int y, Color selectionColor) {
case SWT.BORDER_DASH: dashes = width != 0 ? GC.LINE_DASH : GC.LINE_DASH_ZERO; break;
case SWT.BORDER_DOT: dashes = width != 0 ? GC.LINE_DOT : GC.LINE_DOT_ZERO; break;
}
- if (GTK.GTK3) {
- Cairo.cairo_set_source_rgba(cairo, colorRGBA.red, colorRGBA.green, colorRGBA.blue, colorRGBA.alpha);
- } else {
- Cairo.cairo_set_source_rgba(cairo, (color.red & 0xFFFF) / (float)0xFFFF, (color.green & 0xFFFF) / (float)0xFFFF, (color.blue & 0xFFFF) / (float)0xFFFF, data.alpha / (float)0xFF);
- }
+ Cairo.cairo_set_source_rgba(cairo, colorRGBA.red, colorRGBA.green, colorRGBA.blue, colorRGBA.alpha);
Cairo.cairo_set_line_width(cairo, width);
if (dashes != null) {
double[] cairoDashes = new double[dashes.length];
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java
index c9155c9d5b..665ffc7947 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java
@@ -846,15 +846,6 @@ void setBackgroundGdkRGBA (long /*int*/ context, long /*int*/ handle, GdkRGBA rg
}
@Override
-void setBackgroundGdkColor (GdkColor color) {
- assert !GTK.GTK3 : "GTK2 code was run by GTK3";
- super.setBackgroundGdkColor (color);
- setBackgroundGdkColor(fixedHandle, color);
- if (labelHandle != 0) setBackgroundGdkColor(labelHandle, color);
- if (imageHandle != 0) setBackgroundGdkColor(imageHandle, color);
-}
-
-@Override
int setBounds (int x, int y, int width, int height, boolean move, boolean resize) {
/*
* Bug in GTK. For some reason, when the label is
@@ -962,15 +953,6 @@ void setForegroundGdkRGBA (GdkRGBA rgba) {
}
@Override
-void setForegroundGdkColor (GdkColor color) {
- assert !GTK.GTK3 : "GTK2 code was run by GTK3";
- super.setForegroundGdkColor (color);
- setForegroundColor (fixedHandle, color);
- if (labelHandle != 0) setForegroundColor (labelHandle, color);
- if (imageHandle != 0) setForegroundColor (imageHandle, color);
-}
-
-@Override
void setForegroundGdkRGBA (long /*int*/ handle, GdkRGBA rgba) {
assert GTK.GTK3 : "GTK3 code was run by GTK2";
if (GTK.GTK_VERSION < OS.VERSION(3, 14, 0)) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ColorDialog.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ColorDialog.java
index 2b215a37f1..ae22b89e9e 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ColorDialog.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ColorDialog.java
@@ -138,84 +138,36 @@ public RGB open () {
Display display = parent != null ? parent.getDisplay (): Display.getCurrent ();
long /*int*/ colorsel = 0;
GdkRGBA rgba;
- GdkColor color;
- if (GTK.GTK_VERSION <= OS.VERSION (3, 4, 0)) {
- if (parent != null) {
- long /*int*/ shellHandle = parent.topHandle ();
- GTK.gtk_window_set_transient_for (handle, shellHandle);
- }
- long /*int*/ group = GTK.gtk_window_get_group (0);
- GTK.gtk_window_group_add_window (group, handle);
- GTK.gtk_window_set_modal (handle, true);
-
- colorsel = GTK.gtk_color_selection_dialog_get_color_selection (handle);
- if (rgb != null) {
- color = new GdkColor ();
- color.red = (short)((rgb.red & 0xFF) | ((rgb.red & 0xFF) << 8));
- color.green = (short)((rgb.green & 0xFF) | ((rgb.green & 0xFF) << 8));
- color.blue = (short)((rgb.blue & 0xFF) | ((rgb.blue & 0xFF) << 8));
- GTK.gtk_color_selection_set_current_color (colorsel, color);
- }
- GTK.gtk_color_selection_set_has_palette (colorsel, true);
- } else {
- rgba = new GdkRGBA ();
- if (rgb != null) {
- rgba.red = (double) rgb.red / 255;
- rgba.green = (double) rgb.green / 255;
- rgba.blue = (double) rgb.blue / 255;
- rgba.alpha = 1;
- }
- GTK.gtk_color_chooser_set_rgba (handle, rgba);
+ rgba = new GdkRGBA ();
+ if (rgb != null) {
+ rgba.red = (double) rgb.red / 255;
+ rgba.green = (double) rgb.green / 255;
+ rgba.blue = (double) rgb.blue / 255;
+ rgba.alpha = 1;
}
+ GTK.gtk_color_chooser_set_rgba (handle, rgba);
if (rgbs != null) {
- if (GTK.GTK_VERSION >= OS.VERSION (3, 4, 0)) {
- int colorsPerRow = 9;
- long /*int*/ gdkRGBAS = OS.g_malloc(GdkRGBA.sizeof * rgbs.length);
- rgba = new GdkRGBA ();
- for (int i=0; i<rgbs.length; i++) {
- RGB rgbS = rgbs[i];
- if (rgbS != null) {
- rgba.red = (double) rgbS.red / 255;
- rgba.green = (double) rgbS.green / 255;
- rgba.blue = (double) rgbS.blue / 255;
- OS.memmove (gdkRGBAS + i * GdkRGBA.sizeof, rgba, GdkRGBA.sizeof);
- }
- }
- GTK.gtk_color_chooser_add_palette(handle, GTK.GTK_ORIENTATION_HORIZONTAL, colorsPerRow,
- rgbs.length, gdkRGBAS);
- GTK.gtk_color_chooser_set_rgba (handle, rgba);
-
-
- if (GTK.gtk_color_chooser_get_use_alpha(handle)) {
- GTK.gtk_color_chooser_set_use_alpha (handle, false);
- }
- OS.g_free (gdkRGBAS);
- } else {
- long /*int*/ gdkColors = OS.g_malloc(GdkColor.sizeof * rgbs.length);
- for (int i=0; i<rgbs.length; i++) {
- RGB rgb = rgbs[i];
- if (rgb != null) {
- color = new GdkColor ();
- color.red = (short)((rgb.red & 0xFF) | ((rgb.red & 0xFF) << 8));
- color.green = (short)((rgb.green & 0xFF) | ((rgb.green & 0xFF) << 8));
- color.blue = (short)((rgb.blue & 0xFF) | ((rgb.blue & 0xFF) << 8));
- OS.memmove (gdkColors + i * GdkColor.sizeof, color, GdkColor.sizeof);
- }
+ int colorsPerRow = 9;
+ long /*int*/ gdkRGBAS = OS.g_malloc(GdkRGBA.sizeof * rgbs.length);
+ rgba = new GdkRGBA ();
+ for (int i=0; i<rgbs.length; i++) {
+ RGB rgbS = rgbs[i];
+ if (rgbS != null) {
+ rgba.red = (double) rgbS.red / 255;
+ rgba.green = (double) rgbS.green / 255;
+ rgba.blue = (double) rgbS.blue / 255;
+ OS.memmove (gdkRGBAS + i * GdkRGBA.sizeof, rgba, GdkRGBA.sizeof);
}
- long /*int*/ strPtr = GTK.gtk_color_selection_palette_to_string(gdkColors, rgbs.length);
- int length = C.strlen (strPtr);
+ }
+ GTK.gtk_color_chooser_add_palette(handle, GTK.GTK_ORIENTATION_HORIZONTAL, colorsPerRow,
+ rgbs.length, gdkRGBAS);
+ GTK.gtk_color_chooser_set_rgba (handle, rgba);
- buffer = new byte [length];
- C.memmove (buffer, strPtr, length);
- String paletteString = new String (Converter.mbcsToWcs (buffer));
- buffer = Converter.wcsToMbcs (paletteString, true);
- OS.g_free (gdkColors);
- long /*int*/ settings = GTK.gtk_settings_get_default ();
- if (settings != 0) {
- GTK.gtk_settings_set_string_property(settings, GTK.gtk_color_palette, buffer, Converter.wcsToMbcs ("gtk_color_selection_palette_to_string", true));
- }
+ if (GTK.gtk_color_chooser_get_use_alpha(handle)) {
+ GTK.gtk_color_chooser_set_use_alpha (handle, false);
}
+ OS.g_free (gdkRGBAS);
}
display.addIdleProc ();
@@ -251,48 +203,11 @@ public RGB open () {
int red = 0;
int green = 0;
int blue = 0;
- if (GTK.GTK_VERSION >= OS.VERSION (3, 4, 0)) {
- rgba = new GdkRGBA ();
- GTK.gtk_color_chooser_get_rgba (handle, rgba);
- red = (int) (rgba.red * 255);
- green = (int) (rgba.green * 255);
- blue = (int) (rgba.blue * 255);
- } else {
- color = new GdkColor ();
- GTK.gtk_color_selection_get_current_color (colorsel, color);
- red = (color.red >> 8) & 0xFF;
- green = (color.green >> 8) & 0xFF;
- blue = (color.blue >> 8) & 0xFF;
-
- long /*int*/ settings = GTK.gtk_settings_get_default ();
- if (settings != 0) {
-
- long /*int*/ [] ptr = new long /*int*/ [1];
- OS.g_object_get (settings, GTK.gtk_color_palette, ptr, 0);
- if (ptr [0] != 0) {
- int length = C.strlen (ptr [0]);
- buffer = new byte [length];
- C.memmove (buffer, ptr [0], length);
- OS.g_free (ptr [0]);
- String [] gdkColorStrings = null;
- if (length > 0) {
- String gtk_color_palette = new String(Converter.mbcsToWcs (buffer));
- gdkColorStrings = splitString(gtk_color_palette, ':');
- length = gdkColorStrings.length;
- }
- rgbs = new RGB [length];
- for (int i=0; i<length; i++) {
- String colorString = gdkColorStrings[i];
- buffer = Converter.wcsToMbcs (colorString, true);
- GDK.gdk_color_parse(buffer, color);
- int redI = (color.red >> 8) & 0xFF;
- int greenI = (color.green >> 8) & 0xFF;
- int blueI = (color.blue >> 8) & 0xFF;
- rgbs [i] = new RGB (redI, greenI, blueI);
- }
- }
- }
- }
+ rgba = new GdkRGBA ();
+ GTK.gtk_color_chooser_get_rgba (handle, rgba);
+ red = (int) (rgba.red * 255);
+ green = (int) (rgba.green * 255);
+ blue = (int) (rgba.blue * 255);
rgb = new RGB (red, green, blue);
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java
index ac16cd1a77..f16bd0a2ef 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java
@@ -934,12 +934,6 @@ long /*int*/ eventWindow () {
return paintWindow ();
}
-@Override
-GdkColor getBackgroundGdkColor () {
- assert !GTK.GTK3 : "GTK2 code was run by GTK3";
- return getBaseGdkColor ();
-}
-
/**
* Returns a point describing the location of the caret relative
* to the receiver.
@@ -1010,12 +1004,6 @@ GdkRGBA getContextBackgroundGdkRGBA () {
return defaultBackground();
}
-@Override
-GdkColor getForegroundGdkColor () {
- assert !GTK.GTK3 : "GTK2 code was run by GTK3";
- return getTextColor ();
-}
-
/**
* Returns the item at the given, zero-relative index in the
* receiver's list. Throws an exception if the index is out
@@ -2099,18 +2087,6 @@ void setBackgroundGdkRGBA (GdkRGBA rgba) {
}
@Override
-void setBackgroundGdkColor (GdkColor color) {
- assert !GTK.GTK3 : "GTK2 code was run by GTK3";
- super.setBackgroundGdkColor (color);
- if (entryHandle != 0) GTK.gtk_widget_modify_base (entryHandle, 0, color);
- if (cellHandle != 0) OS.g_object_set (cellHandle, OS.background_gdk, color, 0);
- OS.g_object_set (textRenderer, OS.background_gdk, color, 0);
-
- if (entryHandle != 0) setBackgroundGdkColor(entryHandle, color);
- setBackgroundGdkColor (fixedHandle, color);
-}
-
-@Override
int setBounds (int x, int y, int width, int height, boolean move, boolean resize) {
int newHeight = height;
if (resize) newHeight = Math.max (getTextHeightInPixels (), height);
@@ -2165,16 +2141,6 @@ void setFontDescription (long /*int*/ font) {
}
@Override
-void setForegroundGdkColor (GdkColor color) {
- assert !GTK.GTK3 : "GTK2 code was run by GTK3";
- super.setForegroundColor (handle, color, false);
- if (entryHandle != 0) {
- setForegroundColor (entryHandle, color, false);
- }
- OS.g_object_set (textRenderer, OS.foreground_gdk, color, 0);
-}
-
-@Override
void setForegroundGdkRGBA (GdkRGBA rgba) {
assert GTK.GTK3 : "GTK3 code was run by GTK2";
if (entryHandle != 0) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java
index 93c77b1693..0fb7138913 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java
@@ -518,13 +518,8 @@ void drawBackgroundInPixels (GC gc, int x, int y, int width, int height, int off
Cairo.cairo_surface_destroy (surface);
Cairo.cairo_pattern_destroy (pattern);
} else {
- if (GTK.GTK3) {
- GdkRGBA rgba = control.getBackgroundGdkRGBA ();
- Cairo.cairo_set_source_rgba (cairo, rgba.red, rgba.green, rgba.blue, rgba.alpha);
- } else {
- GdkColor color = control.getBackgroundGdkColor ();
- Cairo.cairo_set_source_rgba_compatibility (cairo, color);
- }
+ GdkRGBA rgba = control.getBackgroundGdkRGBA ();
+ Cairo.cairo_set_source_rgba (cairo, rgba.red, rgba.green, rgba.blue, rgba.alpha);
}
Cairo.cairo_rectangle (cairo, x, y, width, height);
Cairo.cairo_fill (cairo);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
index 86e5fdec6e..e9a5fe9c56 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
@@ -213,17 +213,11 @@ void drawBackground (Control control, long /*int*/ window, long /*int*/ cr, long
Cairo.cairo_set_source (cairo, pattern);
Cairo.cairo_pattern_destroy (pattern);
} else {
- GdkRGBA rgba;
- if (GTK.GTK3) {
- rgba = control.getBackgroundGdkRGBA();
- if (noBackgroundRegion) {
- Cairo.cairo_set_source_rgba (cairo, 0.0, 0.0, 0.0, 0.0);
- } else {
- Cairo.cairo_set_source_rgba (cairo, rgba.red, rgba.green, rgba.blue, rgba.alpha);
- }
+ GdkRGBA rgba = control.getBackgroundGdkRGBA();
+ if (noBackgroundRegion) {
+ Cairo.cairo_set_source_rgba (cairo, 0.0, 0.0, 0.0, 0.0);
} else {
- GdkColor color = control.getBackgroundGdkColor ();
- Cairo.cairo_set_source_rgba_compatibility (cairo, color);
+ Cairo.cairo_set_source_rgba (cairo, rgba.red, rgba.green, rgba.blue, rgba.alpha);
}
}
Cairo.cairo_rectangle (cairo, x, y, width, height);
@@ -304,14 +298,6 @@ void fixStyle (long /*int*/ handle) {
*/
if ((state & BACKGROUND) != 0) return;
if ((state & THEME_BACKGROUND) == 0) return;
- if (!GTK.GTK3) {
- long /*int*/ childStyle = parent.childStyle ();
- if (childStyle != 0) {
- GdkColor color = new GdkColor();
- GTK.gtk_style_get_bg (childStyle, 0, color);
- setBackgroundGdkColor (color);
- }
- }
}
long /*int*/ focusHandle () {
@@ -2874,26 +2860,13 @@ boolean forceFocus (long /*int*/ focusHandle) {
public Color getBackground () {
checkWidget();
Color color;
- if (GTK.GTK3) {
- if (backgroundAlpha == 0) {
- color = Color.gtk_new (display, this.getBackgroundGdkRGBA (), 0);
- return color;
- }
- else {
- Control control = findBackgroundControl ();
- if (control == null) control = this;
- return Color.gtk_new (display, control.getBackgroundGdkRGBA (), backgroundAlpha);
- }
+ if (backgroundAlpha == 0) {
+ color = Color.gtk_new (display, this.getBackgroundGdkRGBA (), 0);
+ return color;
} else {
- if (backgroundAlpha == 0) {
- color = Color.gtk_new (display, this.getBackgroundGdkColor (), 0);
- return color;
- }
- else {
- Control control = findBackgroundControl ();
- if (control == null) control = this;
- return Color.gtk_new (display, control.getBackgroundGdkColor (), backgroundAlpha);
- }
+ Control control = findBackgroundControl ();
+ if (control == null) control = this;
+ return Color.gtk_new (display, control.getBackgroundGdkRGBA (), backgroundAlpha);
}
}
@@ -2902,11 +2875,6 @@ GdkRGBA getBackgroundGdkRGBA () {
return getBgGdkRGBA ();
}
-GdkColor getBackgroundGdkColor () {
- assert !GTK.GTK3 : "GTK2 code was run by GTK3";
- return getBgGdkColor ();
-}
-
/**
* Returns the receiver's background image.
*
@@ -2963,34 +2931,11 @@ GdkRGBA getBgGdkRGBA () {
return getContextBackgroundGdkRGBA ();
}
-GdkColor getBgGdkColor () {
- assert !GTK.GTK3 : "GTK2 code was run by GTK3";
- long /*int*/ fontHandle = fontHandle ();
- GTK.gtk_widget_realize (fontHandle);
- GdkColor color = new GdkColor ();
-
- long /*int*/ style = GTK.gtk_widget_get_style (fontHandle);
- if (style != 0){
- GTK.gtk_style_get_bg (style, GTK.GTK_STATE_NORMAL, color);
- }
-
- return color;
-}
-
GdkRGBA getBaseGdkRGBA () {
assert GTK.GTK3 : "GTK3 code was run by GTK2";
return getContextBackgroundGdkRGBA ();
}
-GdkColor getBaseGdkColor () {
- assert !GTK.GTK3 : "GTK2 code was run by GTK3";
- long /*int*/ fontHandle = fontHandle ();
- GTK.gtk_widget_realize (fontHandle);
- GdkColor color = new GdkColor ();
- GTK.gtk_style_get_base (GTK.gtk_widget_get_style (fontHandle), GTK.GTK_STATE_NORMAL, color);
- return color;
-}
-
/**
* Returns the receiver's border width in points.
*
@@ -3126,7 +3071,7 @@ long /*int*/ getFontDescription () {
public Color getForeground () {
checkWidget();
Color color;
- color = GTK.GTK3? Color.gtk_new (display, getForegroundGdkRGBA ()) : Color.gtk_new (display, getForegroundGdkColor ());
+ color = Color.gtk_new (display, getForegroundGdkRGBA ());
return color;
}
@@ -3135,37 +3080,10 @@ GdkRGBA getForegroundGdkRGBA () {
return getContextColorGdkRGBA();
}
-GdkColor getForegroundGdkColor () {
- assert !GTK.GTK3 : "GTK2 code was run by GTK3";
- return getFgColor ();
-}
-
-GdkColor getFgColor () {
- assert !GTK.GTK3 : "GTK2 code was run by GTK3";
- long /*int*/ fontHandle = fontHandle ();
- GTK.gtk_widget_realize (fontHandle);
- GdkColor color = new GdkColor ();
-
- long /*int*/ style = GTK.gtk_widget_get_style (fontHandle);
- if (style != 0){
- GTK.gtk_style_get_fg (style, GTK.GTK_STATE_NORMAL, color);
- }
- return color;
-}
-
Point getIMCaretPos () {
return new Point (0, 0);
}
-GdkColor getTextColor () {
- assert !GTK.GTK3 : "GTK2 code was run by GTK3";
- long /*int*/ fontHandle = fontHandle ();
- GTK.gtk_widget_realize (fontHandle);
- GdkColor color = new GdkColor ();
- GTK.gtk_style_get_text (GTK.gtk_widget_get_style (fontHandle), GTK.GTK_STATE_NORMAL, color);
- return color;
-}
-
/**
* Returns layout data which is associated with the receiver.
*
@@ -4042,13 +3960,8 @@ public long /*int*/ internal_new_GC (GCData data) {
Control control = findBackgroundControl ();
if (control == null) control = this;
data.font = font != null ? font : defaultFont ();
- if (GTK.GTK3) {
- data.foregroundRGBA = getForegroundGdkRGBA ();
- data.backgroundRGBA = control.getBackgroundGdkRGBA ();
- } else {
- data.foreground = getForegroundGdkColor ();
- data.background = control.getBackgroundGdkColor ();
- }
+ data.foregroundRGBA = getForegroundGdkRGBA ();
+ data.backgroundRGBA = control.getBackgroundGdkRGBA ();
}
return gc;
}
@@ -4728,44 +4641,19 @@ public void setBackground (Color color) {
private void _setBackground (Color color) {
if (((state & BACKGROUND) == 0) && color == null) return;
boolean set = false;
- if (GTK.GTK3) {
- GdkRGBA rgba = null;
- if (color != null) {
- rgba = color.handleRGBA;
- backgroundAlpha = color.getAlpha();
- }
- set = true;
- if (set) {
- if (color == null) {
- state &= ~BACKGROUND;
- } else {
- state |= BACKGROUND;
- }
- setBackgroundGdkRGBA (rgba);
- }
- } else {
- GdkColor gdkColor = null;
- if (color != null) {
- if (color.isDisposed ()) error(SWT.ERROR_INVALID_ARGUMENT);
- gdkColor = color.handle;
- backgroundAlpha = color.getAlpha ();
- }
- if (gdkColor == null) {
- long /*int*/ style = GTK.gtk_widget_get_modifier_style (handle);
- set = (GTK.gtk_rc_style_get_color_flags (style, GTK.GTK_STATE_NORMAL) & GTK.GTK_RC_BG) != 0;
+ GdkRGBA rgba = null;
+ if (color != null) {
+ rgba = color.handleRGBA;
+ backgroundAlpha = color.getAlpha();
+ }
+ set = true;
+ if (set) {
+ if (color == null) {
+ state &= ~BACKGROUND;
} else {
- GdkColor oldColor = getBackgroundGdkColor ();
- set = oldColor.pixel != gdkColor.pixel;
- }
- if (set) {
-
- if (color == null) {
- state &= ~BACKGROUND;
- } else {
- state |= BACKGROUND;
- }
- setBackgroundGdkColor (gdkColor);
+ state |= BACKGROUND;
}
+ setBackgroundGdkRGBA (rgba);
}
redrawChildren ();
}
@@ -4822,42 +4710,6 @@ void gtk_css_provider_load_from_css (long /*int*/ context, String css) {
GTK.gtk_css_provider_load_from_data (provider, Converter.wcsToMbcs (css, true), -1, null);
}
-void setBackgroundGdkColor (long /*int*/ handle, GdkColor color) {
- assert !GTK.GTK3 : "GTK2 code was run by GTK3";
- int index = GTK.GTK_STATE_NORMAL;
- long /*int*/ style = GTK.gtk_widget_get_modifier_style (handle);
- long /*int*/ ptr = GTK.gtk_rc_style_get_bg_pixmap_name (style, index);
- if (ptr != 0) OS.g_free (ptr);
- ptr = 0;
-
- String pixmapName = null;
- int flags = GTK.gtk_rc_style_get_color_flags (style, index);
- if (color != null) {
- flags |= GTK.GTK_RC_BG;
- pixmapName = "<none>"; //$NON-NLS-1$
- } else {
- flags &= ~GTK.GTK_RC_BG;
- if (backgroundImage == null && (state & PARENT_BACKGROUND) != 0) {
- pixmapName = "<parent>"; //$NON-NLS-1$
- }
- }
- if (pixmapName != null) {
- byte[] buffer = Converter.wcsToMbcs (pixmapName, true);
- ptr = OS.g_malloc (buffer.length);
- C.memmove (ptr, buffer, buffer.length);
- }
-
- GTK.gtk_rc_style_set_bg_pixmap_name (style, index, ptr);
- GTK.gtk_rc_style_set_bg (style, index, color);
- GTK.gtk_rc_style_set_color_flags (style, index, flags);
- modifyStyle (handle, style);
-}
-
-void setBackgroundGdkColor (GdkColor color) {
- assert !GTK.GTK3 : "GTK2 code was run by GTK3";
- setBackgroundGdkColor (handle, color);
-}
-
void setBackgroundGdkRGBA(GdkRGBA rgba) {
assert GTK.GTK3 : "GTK3 code was run by GTK2";
setBackgroundGdkRGBA (handle, rgba);
@@ -5228,35 +5080,16 @@ void setFontDescription (long /*int*/ font) {
public void setForeground (Color color) {
checkWidget();
if (((state & FOREGROUND) == 0) && color == null) return;
- GdkColor gdkColor = null;
- if (color != null) {
- if (color.isDisposed ()) error(SWT.ERROR_INVALID_ARGUMENT);
- gdkColor = color.handle;
- }
boolean set = false;
- if (GTK.GTK3) {
- set = !getForeground().equals(color);
- } else {
- if (gdkColor == null) {
- long /*int*/ style = GTK.gtk_widget_get_modifier_style (handle);
- set = (GTK.gtk_rc_style_get_color_flags (style, GTK.GTK_STATE_NORMAL) & GTK.GTK_RC_FG) != 0;
- } else {
- GdkColor oldColor = getForegroundGdkColor ();
- set = oldColor.pixel != gdkColor.pixel;
- }
- }
+ set = !getForeground().equals(color);
if (set) {
if (color == null) {
state &= ~FOREGROUND;
} else {
state |= FOREGROUND;
}
- if (GTK.GTK3) {
- GdkRGBA rgba = color == null ? null : color.handleRGBA;
- setForegroundGdkRGBA (rgba);
- } else {
- setForegroundGdkColor (gdkColor);
- }
+ GdkRGBA rgba = color == null ? null : color.handleRGBA;
+ setForegroundGdkRGBA (rgba);
}
}
@@ -5265,11 +5098,6 @@ void setForegroundGdkRGBA (GdkRGBA rgba) {
setForegroundGdkRGBA (handle, rgba);
}
-void setForegroundGdkColor (GdkColor color) {
- assert !GTK.GTK3 : "GTK2 code was run by GTK3";
- setForegroundColor (handle, color);
-}
-
void setForegroundGdkRGBA (long /*int*/ handle, GdkRGBA rgba) {
assert GTK.GTK3 : "GTK3 code was run by GTK2";
if (GTK.GTK_VERSION >= OS.VERSION(3, 14, 0)) {
@@ -5603,13 +5431,8 @@ public boolean setParent (Composite parent) {
}
void setParentBackground () {
- if (GTK.GTK3) {
- setBackgroundGdkRGBA (handle, null);
- if (fixedHandle != 0) setBackgroundGdkRGBA (fixedHandle, null);
- } else {
- setBackgroundGdkColor (handle, null);
- if (fixedHandle != 0) setBackgroundGdkColor (fixedHandle, null);
- }
+ setBackgroundGdkRGBA (handle, null);
+ if (fixedHandle != 0) setBackgroundGdkRGBA (fixedHandle, null);
}
void setParentGdkWindow (Control child) {
@@ -5976,15 +5799,9 @@ void setZOrder (Control sibling, boolean above, boolean fixRelations, boolean fi
}
void setWidgetBackground () {
- if (GTK.GTK3) {
- GdkRGBA rgba = (state & BACKGROUND) != 0 ? getBackgroundGdkRGBA () : null;
- if (fixedHandle != 0) setBackgroundGdkRGBA (fixedHandle, rgba);
- setBackgroundGdkRGBA (handle, rgba);
- } else {
- GdkColor color = (state & BACKGROUND) != 0 ? getBackgroundGdkColor () : null;
- if (fixedHandle != 0) setBackgroundGdkColor (fixedHandle, color);
- setBackgroundGdkColor (handle, color);
- }
+ GdkRGBA rgba = (state & BACKGROUND) != 0 ? getBackgroundGdkRGBA () : null;
+ if (fixedHandle != 0) setBackgroundGdkRGBA (fixedHandle, rgba);
+ setBackgroundGdkRGBA (handle, rgba);
}
boolean showMenu (int x, int y) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java
index 7c2d2a171f..67a6ad8789 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java
@@ -724,16 +724,6 @@ private void hideDropDownCalendar () {
return;
}
-@Override
-GdkColor getBackgroundGdkColor () {
- assert !GTK.GTK3 : "GTK2 code was run by GTK3";
- if (isCalendar ()) {
- return getBaseGdkColor ();
- } else {
- return super.getBackgroundGdkColor ();
- }
-}
-
String getComputeSizeString (int style) {
if ((style & SWT.DATE) != 0) {
return (style & SWT.SHORT) != 0 ? DEFAULT_SHORT_DATE_FORMAT : (style & SWT.LONG) != 0 ? DEFAULT_LONG_DATE_FORMAT : DEFAULT_MEDIUM_DATE_FORMAT;
@@ -1402,26 +1392,11 @@ void sendSelectionEvent () {
@Override
public void setBackground (Color color) {
super.setBackground (color);
- if (!GTK.GTK3) {
- if ((isCalendar ()) && color == null) {
- GTK.gtk_widget_modify_base (containerHandle, 0, null);
- }
- }
bg = color;
if (popupCalendar != null) popupCalendar.setBackground (color);
}
@Override
-void setBackgroundGdkColor (GdkColor color) {
- assert !GTK.GTK3 : "GTK2 code was run by GTK3";
- if (isCalendar ()) {
- GTK.gtk_widget_modify_base (containerHandle, 0, color);
- } else {
- super.setBackgroundGdkColor (color);
- }
-}
-
-@Override
void setBackgroundGdkRGBA (GdkRGBA rgba) {
assert GTK.GTK3 : "GTK3 code was run by GTK2";
super.setBackgroundGdkRGBA(rgba);
@@ -1472,12 +1447,6 @@ public void setFont (Font font) {
}
@Override
-void setForegroundGdkColor (GdkColor color) {
- assert !GTK.GTK3 : "GTK2 code was run by GTK3";
- setForegroundColor (containerHandle, color, false);
-}
-
-@Override
void setForegroundGdkRGBA (GdkRGBA rgba) {
assert GTK.GTK3 : "GTK3 code was run by GTK2";
setForegroundGdkRGBA (containerHandle, rgba);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java
index d5f720614e..598b0439fd 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java
@@ -281,15 +281,6 @@ public class Display extends Device {
Resource [] resources;
static final int RESOURCE_SIZE = 1 + 4 + SWT.CURSOR_HAND + 1;
- /* Colors, GTK2 */
- GdkColor COLOR_WIDGET_DARK_SHADOW, COLOR_WIDGET_NORMAL_SHADOW, COLOR_WIDGET_LIGHT_SHADOW;
- GdkColor COLOR_WIDGET_HIGHLIGHT_SHADOW, COLOR_WIDGET_BACKGROUND, COLOR_WIDGET_FOREGROUND, COLOR_WIDGET_BORDER;
- GdkColor COLOR_LIST_FOREGROUND, COLOR_LIST_BACKGROUND, COLOR_LIST_SELECTION, COLOR_LIST_SELECTION_TEXT;
- GdkColor COLOR_LIST_SELECTION_INACTIVE, COLOR_LIST_SELECTION_TEXT_INACTIVE;
- GdkColor COLOR_INFO_BACKGROUND, COLOR_INFO_FOREGROUND, COLOR_LINK_FOREGROUND;
- GdkColor COLOR_TITLE_FOREGROUND, COLOR_TITLE_BACKGROUND, COLOR_TITLE_BACKGROUND_GRADIENT;
- GdkColor COLOR_TITLE_INACTIVE_FOREGROUND, COLOR_TITLE_INACTIVE_BACKGROUND, COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT;
-
/* Colors, GTK3 */
GdkRGBA COLOR_WIDGET_DARK_SHADOW_RGBA, COLOR_WIDGET_NORMAL_SHADOW_RGBA, COLOR_WIDGET_LIGHT_SHADOW_RGBA;
GdkRGBA COLOR_WIDGET_HIGHLIGHT_SHADOW_RGBA, COLOR_WIDGET_BACKGROUND_RGBA, COLOR_WIDGET_FOREGROUND_RGBA, COLOR_WIDGET_BORDER_RGBA;
@@ -477,7 +468,7 @@ public class Display extends Device {
/* GTK Version */
static final int GTK3_MAJOR = 3;
- static final int GTK3_MINOR = 0;
+ static final int GTK3_MINOR = 4;
static final int GTK3_MICRO = 0;
/* Display Data */
@@ -2903,63 +2894,33 @@ public Thread getSyncThread () {
@Override
public Color getSystemColor (int id) {
checkDevice ();
- if (GTK.GTK3) {
- GdkRGBA gdkRGBA = null;
- switch (id) {
- case SWT.COLOR_LINK_FOREGROUND: gdkRGBA = copyRGBA(COLOR_LINK_FOREGROUND_RGBA); break;
- case SWT.COLOR_INFO_FOREGROUND: gdkRGBA = copyRGBA(COLOR_INFO_FOREGROUND_RGBA); break;
- case SWT.COLOR_INFO_BACKGROUND: gdkRGBA = copyRGBA(COLOR_INFO_BACKGROUND_RGBA); break;
- case SWT.COLOR_TITLE_FOREGROUND: gdkRGBA = copyRGBA(COLOR_TITLE_FOREGROUND_RGBA); break;
- case SWT.COLOR_TITLE_BACKGROUND: gdkRGBA = copyRGBA(COLOR_TITLE_BACKGROUND_RGBA); break;
- case SWT.COLOR_TITLE_BACKGROUND_GRADIENT: gdkRGBA = copyRGBA(COLOR_TITLE_BACKGROUND_GRADIENT_RGBA); break;
- case SWT.COLOR_TITLE_INACTIVE_FOREGROUND: gdkRGBA = copyRGBA(COLOR_TITLE_INACTIVE_FOREGROUND_RGBA); break;
- case SWT.COLOR_TITLE_INACTIVE_BACKGROUND: gdkRGBA = copyRGBA(COLOR_TITLE_INACTIVE_BACKGROUND_RGBA); break;
- case SWT.COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT: gdkRGBA = copyRGBA(COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT_RGBA); break;
- case SWT.COLOR_WIDGET_DARK_SHADOW: gdkRGBA = copyRGBA(COLOR_WIDGET_DARK_SHADOW_RGBA); break;
- case SWT.COLOR_WIDGET_NORMAL_SHADOW: gdkRGBA = copyRGBA(COLOR_WIDGET_NORMAL_SHADOW_RGBA); break;
- case SWT.COLOR_WIDGET_LIGHT_SHADOW: gdkRGBA = copyRGBA(COLOR_WIDGET_LIGHT_SHADOW_RGBA); break;
- case SWT.COLOR_WIDGET_HIGHLIGHT_SHADOW: gdkRGBA = copyRGBA(COLOR_WIDGET_HIGHLIGHT_SHADOW_RGBA); break;
- case SWT.COLOR_WIDGET_BACKGROUND: gdkRGBA = copyRGBA(COLOR_WIDGET_BACKGROUND_RGBA); break;
- case SWT.COLOR_WIDGET_FOREGROUND: gdkRGBA = copyRGBA(COLOR_WIDGET_FOREGROUND_RGBA); break;
- case SWT.COLOR_WIDGET_BORDER: gdkRGBA = copyRGBA(COLOR_WIDGET_BORDER_RGBA); break;
- case SWT.COLOR_LIST_FOREGROUND: gdkRGBA = copyRGBA(COLOR_LIST_FOREGROUND_RGBA); break;
- case SWT.COLOR_LIST_BACKGROUND: gdkRGBA = copyRGBA(COLOR_LIST_BACKGROUND_RGBA); break;
- case SWT.COLOR_LIST_SELECTION: gdkRGBA = copyRGBA(COLOR_LIST_SELECTION_RGBA); break;
- case SWT.COLOR_LIST_SELECTION_TEXT: gdkRGBA = copyRGBA(COLOR_LIST_SELECTION_TEXT_RGBA); break;
- default:
- return super.getSystemColor (id);
- }
- if (gdkRGBA == null) return super.getSystemColor (SWT.COLOR_BLACK);
- return Color.gtk_new (this, gdkRGBA);
- } else {
- GdkColor gdkColor = null;
- switch (id) {
- case SWT.COLOR_LINK_FOREGROUND: gdkColor = COLOR_LINK_FOREGROUND; break;
- case SWT.COLOR_INFO_FOREGROUND: gdkColor = COLOR_INFO_FOREGROUND; break;
- case SWT.COLOR_INFO_BACKGROUND: gdkColor = COLOR_INFO_BACKGROUND; break;
- case SWT.COLOR_TITLE_FOREGROUND: gdkColor = COLOR_TITLE_FOREGROUND; break;
- case SWT.COLOR_TITLE_BACKGROUND: gdkColor = COLOR_TITLE_BACKGROUND; break;
- case SWT.COLOR_TITLE_BACKGROUND_GRADIENT: gdkColor = COLOR_TITLE_BACKGROUND_GRADIENT; break;
- case SWT.COLOR_TITLE_INACTIVE_FOREGROUND: gdkColor = COLOR_TITLE_INACTIVE_FOREGROUND; break;
- case SWT.COLOR_TITLE_INACTIVE_BACKGROUND: gdkColor = COLOR_TITLE_INACTIVE_BACKGROUND; break;
- case SWT.COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT: gdkColor = COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT; break;
- case SWT.COLOR_WIDGET_DARK_SHADOW: gdkColor = COLOR_WIDGET_DARK_SHADOW; break;
- case SWT.COLOR_WIDGET_NORMAL_SHADOW: gdkColor = COLOR_WIDGET_NORMAL_SHADOW; break;
- case SWT.COLOR_WIDGET_LIGHT_SHADOW: gdkColor = COLOR_WIDGET_LIGHT_SHADOW; break;
- case SWT.COLOR_WIDGET_HIGHLIGHT_SHADOW: gdkColor = COLOR_WIDGET_HIGHLIGHT_SHADOW; break;
- case SWT.COLOR_WIDGET_BACKGROUND: gdkColor = COLOR_WIDGET_BACKGROUND; break;
- case SWT.COLOR_WIDGET_FOREGROUND: gdkColor = COLOR_WIDGET_FOREGROUND; break;
- case SWT.COLOR_WIDGET_BORDER: gdkColor = COLOR_WIDGET_BORDER; break;
- case SWT.COLOR_LIST_FOREGROUND: gdkColor = COLOR_LIST_FOREGROUND; break;
- case SWT.COLOR_LIST_BACKGROUND: gdkColor = COLOR_LIST_BACKGROUND; break;
- case SWT.COLOR_LIST_SELECTION: gdkColor = COLOR_LIST_SELECTION; break;
- case SWT.COLOR_LIST_SELECTION_TEXT: gdkColor = COLOR_LIST_SELECTION_TEXT; break;
- default:
- return super.getSystemColor (id);
- }
- if (gdkColor == null) return super.getSystemColor (SWT.COLOR_BLACK);
- return Color.gtk_new (this, gdkColor);
- }
+ GdkRGBA gdkRGBA = null;
+ switch (id) {
+ case SWT.COLOR_LINK_FOREGROUND: gdkRGBA = copyRGBA(COLOR_LINK_FOREGROUND_RGBA); break;
+ case SWT.COLOR_INFO_FOREGROUND: gdkRGBA = copyRGBA(COLOR_INFO_FOREGROUND_RGBA); break;
+ case SWT.COLOR_INFO_BACKGROUND: gdkRGBA = copyRGBA(COLOR_INFO_BACKGROUND_RGBA); break;
+ case SWT.COLOR_TITLE_FOREGROUND: gdkRGBA = copyRGBA(COLOR_TITLE_FOREGROUND_RGBA); break;
+ case SWT.COLOR_TITLE_BACKGROUND: gdkRGBA = copyRGBA(COLOR_TITLE_BACKGROUND_RGBA); break;
+ case SWT.COLOR_TITLE_BACKGROUND_GRADIENT: gdkRGBA = copyRGBA(COLOR_TITLE_BACKGROUND_GRADIENT_RGBA); break;
+ case SWT.COLOR_TITLE_INACTIVE_FOREGROUND: gdkRGBA = copyRGBA(COLOR_TITLE_INACTIVE_FOREGROUND_RGBA); break;
+ case SWT.COLOR_TITLE_INACTIVE_BACKGROUND: gdkRGBA = copyRGBA(COLOR_TITLE_INACTIVE_BACKGROUND_RGBA); break;
+ case SWT.COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT: gdkRGBA = copyRGBA(COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT_RGBA); break;
+ case SWT.COLOR_WIDGET_DARK_SHADOW: gdkRGBA = copyRGBA(COLOR_WIDGET_DARK_SHADOW_RGBA); break;
+ case SWT.COLOR_WIDGET_NORMAL_SHADOW: gdkRGBA = copyRGBA(COLOR_WIDGET_NORMAL_SHADOW_RGBA); break;
+ case SWT.COLOR_WIDGET_LIGHT_SHADOW: gdkRGBA = copyRGBA(COLOR_WIDGET_LIGHT_SHADOW_RGBA); break;
+ case SWT.COLOR_WIDGET_HIGHLIGHT_SHADOW: gdkRGBA = copyRGBA(COLOR_WIDGET_HIGHLIGHT_SHADOW_RGBA); break;
+ case SWT.COLOR_WIDGET_BACKGROUND: gdkRGBA = copyRGBA(COLOR_WIDGET_BACKGROUND_RGBA); break;
+ case SWT.COLOR_WIDGET_FOREGROUND: gdkRGBA = copyRGBA(COLOR_WIDGET_FOREGROUND_RGBA); break;
+ case SWT.COLOR_WIDGET_BORDER: gdkRGBA = copyRGBA(COLOR_WIDGET_BORDER_RGBA); break;
+ case SWT.COLOR_LIST_FOREGROUND: gdkRGBA = copyRGBA(COLOR_LIST_FOREGROUND_RGBA); break;
+ case SWT.COLOR_LIST_BACKGROUND: gdkRGBA = copyRGBA(COLOR_LIST_BACKGROUND_RGBA); break;
+ case SWT.COLOR_LIST_SELECTION: gdkRGBA = copyRGBA(COLOR_LIST_SELECTION_RGBA); break;
+ case SWT.COLOR_LIST_SELECTION_TEXT: gdkRGBA = copyRGBA(COLOR_LIST_SELECTION_TEXT_RGBA); break;
+ default:
+ return super.getSystemColor (id);
+ }
+ if (gdkRGBA == null) return super.getSystemColor (SWT.COLOR_BLACK);
+ return Color.gtk_new (this, gdkRGBA);
}
/**
@@ -3198,329 +3159,228 @@ void initializeSystemColors () {
GTK.gtk_widget_set_name (tooltipShellHandle, gtk_tooltip);
GTK.gtk_widget_realize (tooltipShellHandle);
- if (GTK.GTK3) {
- COLOR_WIDGET_DARK_SHADOW_RGBA = new GdkRGBA ();
- COLOR_WIDGET_DARK_SHADOW_RGBA.alpha = 1.0;
- /*
- * Feature in GTK: previously SWT fetched system colors using
- * GtkStyleContext machinery. This machinery is largely deprecated
- * and will all together stop functioning eventually. Instead, we
- * can parse the GTK system theme and use the values stored there to
- * generate SWT's system colors.
- *
- * The functionality works for GTK3.14 and above as follows:
- *
- * 1) load and parse the system theme
- * 2) check to see if the value needed exists in the theme
- * 3a) if the value exists, parse it and convert it to a GdkColor object
- * 3b) if the value doesn't exist, use the old GtkStyleContext machinery
- * to fetch and return it as a GdkColor object
- *
- * Some colors have multiple different theme values that correspond to
- * them, while some colors only have one potential match. Therefore
- * some colors will have better theme coverage than others.
- */
- long /*int*/ context = GTK.gtk_widget_get_style_context (tooltipShellHandle);
- GTK.gtk_style_context_add_class (context, GTK.GTK_STYLE_CLASS_TOOLTIP);
- GTK.gtk_style_context_invalidate(context);
- GdkRGBA rgba = new GdkRGBA();
-
- // Initialize and create a list of X11 named colors
- initializeColorList();
- /*
- * Find current GTK theme: either use the system theme,
- * or one provided using the GTK_THEME environment variable.
- * See bug 534007.
- */
- byte [] buffer = OS.GTK_THEME_SET ? Converter.wcsToMbcs (OS.GTK_THEME_NAME, true) : OS.getThemeNameBytes();
- // Load the dark variant if specified
- byte [] darkBuffer = OS.GTK_THEME_DARK ? darkBuffer = Converter.wcsToMbcs ("dark", true) : null;
+ COLOR_WIDGET_DARK_SHADOW_RGBA = new GdkRGBA ();
+ COLOR_WIDGET_DARK_SHADOW_RGBA.alpha = 1.0;
+ /*
+ * Feature in GTK: previously SWT fetched system colors using
+ * GtkStyleContext machinery. This machinery is largely deprecated
+ * and will all together stop functioning eventually. Instead, we
+ * can parse the GTK system theme and use the values stored there to
+ * generate SWT's system colors.
+ *
+ * The functionality works for GTK3.14 and above as follows:
+ *
+ * 1) load and parse the system theme
+ * 2) check to see if the value needed exists in the theme
+ * 3a) if the value exists, parse it and convert it to a GdkColor object
+ * 3b) if the value doesn't exist, use the old GtkStyleContext machinery
+ * to fetch and return it as a GdkColor object
+ *
+ * Some colors have multiple different theme values that correspond to
+ * them, while some colors only have one potential match. Therefore
+ * some colors will have better theme coverage than others.
+ */
+ long /*int*/ context = GTK.gtk_widget_get_style_context (tooltipShellHandle);
+ GTK.gtk_style_context_add_class (context, GTK.GTK_STYLE_CLASS_TOOLTIP);
+ GTK.gtk_style_context_invalidate(context);
+ GdkRGBA rgba = new GdkRGBA();
+ // Initialize and create a list of X11 named colors
+ initializeColorList();
+ /*
+ * Find current GTK theme: either use the system theme,
+ * or one provided using the GTK_THEME environment variable.
+ * See bug 534007.
+ */
+ byte [] buffer = OS.GTK_THEME_SET ? Converter.wcsToMbcs (OS.GTK_THEME_NAME, true) : OS.getThemeNameBytes();
+ // Load the dark variant if specified
+ byte [] darkBuffer = OS.GTK_THEME_DARK ? darkBuffer = Converter.wcsToMbcs ("dark", true) : null;
- // Fetch the actual theme in char/string format
- long /*int*/ themeProvider = GTK.gtk_css_provider_get_named(buffer, darkBuffer);
+ // Fetch the actual theme in char/string format
+ long /*int*/ themeProvider = GTK.gtk_css_provider_get_named(buffer, darkBuffer);
- String cssOutput = gtk_css_provider_to_string(themeProvider);
+ String cssOutput = gtk_css_provider_to_string(themeProvider);
- if (GTK.GTK_VERSION >= OS.VERSION(3, 14, 0)) {
- String colorInfoForeground = gtk_css_default_theme_values(SWT.COLOR_INFO_FOREGROUND, cssOutput);
- if (!colorInfoForeground.isEmpty()) {
- if (colorInfoForeground != "parsed") {
- COLOR_INFO_FOREGROUND_RGBA = gtk_css_property_to_rgba (colorInfoForeground);
- }
- } else {
- COLOR_INFO_FOREGROUND_RGBA = styleContextGetColor (context, GTK.GTK_STATE_FLAG_NORMAL);
+ if (GTK.GTK_VERSION >= OS.VERSION(3, 14, 0)) {
+ String colorInfoForeground = gtk_css_default_theme_values(SWT.COLOR_INFO_FOREGROUND, cssOutput);
+ if (!colorInfoForeground.isEmpty()) {
+ if (colorInfoForeground != "parsed") {
+ COLOR_INFO_FOREGROUND_RGBA = gtk_css_property_to_rgba (colorInfoForeground);
}
} else {
COLOR_INFO_FOREGROUND_RGBA = styleContextGetColor (context, GTK.GTK_STATE_FLAG_NORMAL);
}
+ } else {
+ COLOR_INFO_FOREGROUND_RGBA = styleContextGetColor (context, GTK.GTK_STATE_FLAG_NORMAL);
+ }
- if (GTK.GTK_VERSION >= OS.VERSION(3, 14, 0)) {
- String colorInfoBackground = gtk_css_default_theme_values(SWT.COLOR_INFO_BACKGROUND, cssOutput);
- if (!colorInfoBackground.isEmpty()) {
- if (colorInfoBackground != "parsed") {
- COLOR_INFO_BACKGROUND_RGBA = gtk_css_property_to_rgba (colorInfoBackground);
- }
- } else {
- COLOR_INFO_BACKGROUND_RGBA = getBackgroundColor (context, GTK.GTK_STATE_FLAG_NORMAL);
+ if (GTK.GTK_VERSION >= OS.VERSION(3, 14, 0)) {
+ String colorInfoBackground = gtk_css_default_theme_values(SWT.COLOR_INFO_BACKGROUND, cssOutput);
+ if (!colorInfoBackground.isEmpty()) {
+ if (colorInfoBackground != "parsed") {
+ COLOR_INFO_BACKGROUND_RGBA = gtk_css_property_to_rgba (colorInfoBackground);
}
} else {
COLOR_INFO_BACKGROUND_RGBA = getBackgroundColor (context, GTK.GTK_STATE_FLAG_NORMAL);
}
- GTK.gtk_widget_destroy (tooltipShellHandle);
+ } else {
+ COLOR_INFO_BACKGROUND_RGBA = getBackgroundColor (context, GTK.GTK_STATE_FLAG_NORMAL);
+ }
+ GTK.gtk_widget_destroy (tooltipShellHandle);
- context = GTK.gtk_widget_get_style_context (shellHandle);
+ context = GTK.gtk_widget_get_style_context (shellHandle);
- if (GTK.GTK_VERSION >= OS.VERSION(3, 14, 0)) {
- String colorWidgetForeground = gtk_css_default_theme_values(SWT.COLOR_WIDGET_FOREGROUND, cssOutput);
- if (!colorWidgetForeground.isEmpty()) {
- COLOR_WIDGET_FOREGROUND_RGBA = gtk_css_property_to_rgba (colorWidgetForeground);
- } else {
- COLOR_WIDGET_FOREGROUND_RGBA = styleContextGetColor (context, GTK.GTK_STATE_FLAG_NORMAL);
- }
+ if (GTK.GTK_VERSION >= OS.VERSION(3, 14, 0)) {
+ String colorWidgetForeground = gtk_css_default_theme_values(SWT.COLOR_WIDGET_FOREGROUND, cssOutput);
+ if (!colorWidgetForeground.isEmpty()) {
+ COLOR_WIDGET_FOREGROUND_RGBA = gtk_css_property_to_rgba (colorWidgetForeground);
} else {
COLOR_WIDGET_FOREGROUND_RGBA = styleContextGetColor (context, GTK.GTK_STATE_FLAG_NORMAL);
}
+ } else {
+ COLOR_WIDGET_FOREGROUND_RGBA = styleContextGetColor (context, GTK.GTK_STATE_FLAG_NORMAL);
+ }
- if (GTK.GTK_VERSION >= OS.VERSION(3, 14, 0)) {
- String colorWidgetBackground = gtk_css_default_theme_values(SWT.COLOR_WIDGET_BACKGROUND, cssOutput);
- if (!colorWidgetBackground.isEmpty()) {
- COLOR_WIDGET_BACKGROUND_RGBA = gtk_css_property_to_rgba (colorWidgetBackground);
- } else {
- GTK.gtk_style_context_get_background_color (context, GTK.GTK_STATE_FLAG_NORMAL, rgba);
- COLOR_WIDGET_BACKGROUND_RGBA = copyRGBA (rgba);
- }
+ if (GTK.GTK_VERSION >= OS.VERSION(3, 14, 0)) {
+ String colorWidgetBackground = gtk_css_default_theme_values(SWT.COLOR_WIDGET_BACKGROUND, cssOutput);
+ if (!colorWidgetBackground.isEmpty()) {
+ COLOR_WIDGET_BACKGROUND_RGBA = gtk_css_property_to_rgba (colorWidgetBackground);
} else {
GTK.gtk_style_context_get_background_color (context, GTK.GTK_STATE_FLAG_NORMAL, rgba);
COLOR_WIDGET_BACKGROUND_RGBA = copyRGBA (rgba);
}
- COLOR_WIDGET_LIGHT_SHADOW_RGBA = COLOR_WIDGET_BACKGROUND_RGBA;
- COLOR_WIDGET_NORMAL_SHADOW_RGBA = toGdkRGBA (COLOR_WIDGET_BACKGROUND_RGBA, 0.7);
- COLOR_WIDGET_HIGHLIGHT_SHADOW_RGBA = toGdkRGBA (COLOR_WIDGET_BACKGROUND_RGBA, 1.3);
-
- GTK.gtk_style_context_save (context);
- GTK.gtk_style_context_add_class(context, GTK.GTK_STYLE_CLASS_VIEW);
- GTK.gtk_style_context_add_class(context, GTK.GTK_STYLE_CLASS_CELL);
- GTK.gtk_style_context_invalidate(context);
-
- if (GTK.GTK_VERSION >= OS.VERSION(3, 14, 0)) {
- String colorListForeground = gtk_css_default_theme_values(SWT.COLOR_LIST_FOREGROUND, cssOutput);
- if (!colorListForeground.isEmpty()) {
- COLOR_LIST_FOREGROUND_RGBA = gtk_css_property_to_rgba (colorListForeground);
- } else {
- COLOR_LIST_FOREGROUND_RGBA = styleContextGetColor (context, GTK.GTK_STATE_FLAG_NORMAL);
- }
+ } else {
+ GTK.gtk_style_context_get_background_color (context, GTK.GTK_STATE_FLAG_NORMAL, rgba);
+ COLOR_WIDGET_BACKGROUND_RGBA = copyRGBA (rgba);
+ }
+ COLOR_WIDGET_LIGHT_SHADOW_RGBA = COLOR_WIDGET_BACKGROUND_RGBA;
+ COLOR_WIDGET_NORMAL_SHADOW_RGBA = toGdkRGBA (COLOR_WIDGET_BACKGROUND_RGBA, 0.7);
+ COLOR_WIDGET_HIGHLIGHT_SHADOW_RGBA = toGdkRGBA (COLOR_WIDGET_BACKGROUND_RGBA, 1.3);
+
+ GTK.gtk_style_context_save (context);
+ GTK.gtk_style_context_add_class(context, GTK.GTK_STYLE_CLASS_VIEW);
+ GTK.gtk_style_context_add_class(context, GTK.GTK_STYLE_CLASS_CELL);
+ GTK.gtk_style_context_invalidate(context);
+
+ if (GTK.GTK_VERSION >= OS.VERSION(3, 14, 0)) {
+ String colorListForeground = gtk_css_default_theme_values(SWT.COLOR_LIST_FOREGROUND, cssOutput);
+ if (!colorListForeground.isEmpty()) {
+ COLOR_LIST_FOREGROUND_RGBA = gtk_css_property_to_rgba (colorListForeground);
} else {
COLOR_LIST_FOREGROUND_RGBA = styleContextGetColor (context, GTK.GTK_STATE_FLAG_NORMAL);
}
+ } else {
+ COLOR_LIST_FOREGROUND_RGBA = styleContextGetColor (context, GTK.GTK_STATE_FLAG_NORMAL);
+ }
- if (GTK.GTK_VERSION >= OS.VERSION(3, 14, 0)) {
- String colorListBackground = gtk_css_default_theme_values(SWT.COLOR_LIST_BACKGROUND, cssOutput);
- if (!colorListBackground.isEmpty()) {
- COLOR_LIST_BACKGROUND_RGBA = gtk_css_property_to_rgba (colorListBackground);
- } else {
- GTK.gtk_style_context_get_background_color (context, GTK.GTK_STATE_FLAG_NORMAL, rgba);
- COLOR_LIST_BACKGROUND_RGBA = copyRGBA(rgba);
- }
+ if (GTK.GTK_VERSION >= OS.VERSION(3, 14, 0)) {
+ String colorListBackground = gtk_css_default_theme_values(SWT.COLOR_LIST_BACKGROUND, cssOutput);
+ if (!colorListBackground.isEmpty()) {
+ COLOR_LIST_BACKGROUND_RGBA = gtk_css_property_to_rgba (colorListBackground);
} else {
GTK.gtk_style_context_get_background_color (context, GTK.GTK_STATE_FLAG_NORMAL, rgba);
COLOR_LIST_BACKGROUND_RGBA = copyRGBA(rgba);
}
+ } else {
+ GTK.gtk_style_context_get_background_color (context, GTK.GTK_STATE_FLAG_NORMAL, rgba);
+ COLOR_LIST_BACKGROUND_RGBA = copyRGBA(rgba);
+ }
- GTK.gtk_style_context_restore (context);
+ GTK.gtk_style_context_restore (context);
- if (GTK.GTK_VERSION >= OS.VERSION(3, 14, 0)) {
- String colorListSelectionText = gtk_css_default_theme_values(SWT.COLOR_LIST_SELECTION_TEXT, cssOutput);
- if (!colorListSelectionText.isEmpty()) {
- COLOR_LIST_SELECTION_TEXT_RGBA = gtk_css_property_to_rgba (colorListSelectionText);
- } else {
- COLOR_LIST_SELECTION_TEXT_RGBA = styleContextGetColor (context, GTK.GTK_STATE_FLAG_SELECTED);
- }
+ if (GTK.GTK_VERSION >= OS.VERSION(3, 14, 0)) {
+ String colorListSelectionText = gtk_css_default_theme_values(SWT.COLOR_LIST_SELECTION_TEXT, cssOutput);
+ if (!colorListSelectionText.isEmpty()) {
+ COLOR_LIST_SELECTION_TEXT_RGBA = gtk_css_property_to_rgba (colorListSelectionText);
} else {
COLOR_LIST_SELECTION_TEXT_RGBA = styleContextGetColor (context, GTK.GTK_STATE_FLAG_SELECTED);
}
- COLOR_TITLE_FOREGROUND_RGBA = COLOR_LIST_SELECTION_TEXT_RGBA;
+ } else {
+ COLOR_LIST_SELECTION_TEXT_RGBA = styleContextGetColor (context, GTK.GTK_STATE_FLAG_SELECTED);
+ }
+ COLOR_TITLE_FOREGROUND_RGBA = COLOR_LIST_SELECTION_TEXT_RGBA;
- if (GTK.GTK_VERSION >= OS.VERSION(3, 14, 0)) {
- String colorListSelection = gtk_css_default_theme_values(SWT.COLOR_LIST_SELECTION, cssOutput);
- if (!colorListSelection.isEmpty()) {
- COLOR_LIST_SELECTION_RGBA = gtk_css_property_to_rgba (colorListSelection);
- } else {
- GTK.gtk_style_context_get_background_color (context, GTK.GTK_STATE_FLAG_SELECTED, rgba);
- COLOR_LIST_SELECTION_RGBA = copyRGBA (rgba);
- }
+ if (GTK.GTK_VERSION >= OS.VERSION(3, 14, 0)) {
+ String colorListSelection = gtk_css_default_theme_values(SWT.COLOR_LIST_SELECTION, cssOutput);
+ if (!colorListSelection.isEmpty()) {
+ COLOR_LIST_SELECTION_RGBA = gtk_css_property_to_rgba (colorListSelection);
} else {
GTK.gtk_style_context_get_background_color (context, GTK.GTK_STATE_FLAG_SELECTED, rgba);
COLOR_LIST_SELECTION_RGBA = copyRGBA (rgba);
}
- COLOR_TITLE_BACKGROUND_RGBA = COLOR_LIST_SELECTION_RGBA;
- COLOR_TITLE_BACKGROUND_GRADIENT_RGBA = toGdkRGBA (COLOR_LIST_SELECTION_RGBA, 1.3);
+ } else {
+ GTK.gtk_style_context_get_background_color (context, GTK.GTK_STATE_FLAG_SELECTED, rgba);
+ COLOR_LIST_SELECTION_RGBA = copyRGBA (rgba);
+ }
+ COLOR_TITLE_BACKGROUND_RGBA = COLOR_LIST_SELECTION_RGBA;
+ COLOR_TITLE_BACKGROUND_GRADIENT_RGBA = toGdkRGBA (COLOR_LIST_SELECTION_RGBA, 1.3);
- if (GTK.GTK_VERSION >= OS.VERSION(3, 14, 0)) {
- String colorListSelectionTextInactive = gtk_css_default_theme_values(SWT_COLOR_LIST_SELECTION_TEXT_INACTIVE, cssOutput);
- if (!colorListSelectionTextInactive.isEmpty()) {
- COLOR_LIST_SELECTION_TEXT_INACTIVE_RGBA = gtk_css_property_to_rgba (colorListSelectionTextInactive);
- } else {
- COLOR_LIST_SELECTION_TEXT_INACTIVE_RGBA = styleContextGetColor (context, GTK.GTK_STATE_FLAG_ACTIVE);
- }
+ if (GTK.GTK_VERSION >= OS.VERSION(3, 14, 0)) {
+ String colorListSelectionTextInactive = gtk_css_default_theme_values(SWT_COLOR_LIST_SELECTION_TEXT_INACTIVE, cssOutput);
+ if (!colorListSelectionTextInactive.isEmpty()) {
+ COLOR_LIST_SELECTION_TEXT_INACTIVE_RGBA = gtk_css_property_to_rgba (colorListSelectionTextInactive);
} else {
COLOR_LIST_SELECTION_TEXT_INACTIVE_RGBA = styleContextGetColor (context, GTK.GTK_STATE_FLAG_ACTIVE);
}
+ } else {
+ COLOR_LIST_SELECTION_TEXT_INACTIVE_RGBA = styleContextGetColor (context, GTK.GTK_STATE_FLAG_ACTIVE);
+ }
- if (GTK.GTK_VERSION >= OS.VERSION(3, 14, 0)) {
- String colorListSelectionInactive = gtk_css_default_theme_values(SWT_COLOR_LIST_SELECTION_INACTIVE, cssOutput);
- if (!colorListSelectionInactive.isEmpty()) {
- COLOR_LIST_SELECTION_INACTIVE_RGBA = gtk_css_property_to_rgba (colorListSelectionInactive);
- } else {
- GTK.gtk_style_context_get_background_color (context, GTK.GTK_STATE_FLAG_ACTIVE, rgba);
- COLOR_LIST_SELECTION_INACTIVE_RGBA = copyRGBA (rgba);
- }
+ if (GTK.GTK_VERSION >= OS.VERSION(3, 14, 0)) {
+ String colorListSelectionInactive = gtk_css_default_theme_values(SWT_COLOR_LIST_SELECTION_INACTIVE, cssOutput);
+ if (!colorListSelectionInactive.isEmpty()) {
+ COLOR_LIST_SELECTION_INACTIVE_RGBA = gtk_css_property_to_rgba (colorListSelectionInactive);
} else {
GTK.gtk_style_context_get_background_color (context, GTK.GTK_STATE_FLAG_ACTIVE, rgba);
COLOR_LIST_SELECTION_INACTIVE_RGBA = copyRGBA (rgba);
}
+ } else {
+ GTK.gtk_style_context_get_background_color (context, GTK.GTK_STATE_FLAG_ACTIVE, rgba);
+ COLOR_LIST_SELECTION_INACTIVE_RGBA = copyRGBA (rgba);
+ }
- if (GTK.GTK_VERSION >= OS.VERSION(3, 14, 0)) {
- String colorTitleInactiveForeground = gtk_css_default_theme_values(SWT.COLOR_TITLE_INACTIVE_FOREGROUND, cssOutput);
- if (!colorTitleInactiveForeground.isEmpty()) {
- COLOR_TITLE_INACTIVE_FOREGROUND_RGBA = gtk_css_property_to_rgba (colorTitleInactiveForeground);
- } else {
- COLOR_TITLE_INACTIVE_FOREGROUND_RGBA = styleContextGetColor (context, GTK.GTK_STATE_FLAG_INSENSITIVE);
- }
+ if (GTK.GTK_VERSION >= OS.VERSION(3, 14, 0)) {
+ String colorTitleInactiveForeground = gtk_css_default_theme_values(SWT.COLOR_TITLE_INACTIVE_FOREGROUND, cssOutput);
+ if (!colorTitleInactiveForeground.isEmpty()) {
+ COLOR_TITLE_INACTIVE_FOREGROUND_RGBA = gtk_css_property_to_rgba (colorTitleInactiveForeground);
} else {
COLOR_TITLE_INACTIVE_FOREGROUND_RGBA = styleContextGetColor (context, GTK.GTK_STATE_FLAG_INSENSITIVE);
}
+ } else {
+ COLOR_TITLE_INACTIVE_FOREGROUND_RGBA = styleContextGetColor (context, GTK.GTK_STATE_FLAG_INSENSITIVE);
+ }
- COLOR_TITLE_INACTIVE_BACKGROUND_RGBA = rgba;
- if (GTK.GTK_VERSION >= OS.VERSION(3, 14, 0)) {
- String colorTitleInactiveBackground = gtk_css_default_theme_values(SWT.COLOR_TITLE_INACTIVE_BACKGROUND, cssOutput);
- if (!colorTitleInactiveBackground.isEmpty()) {
- COLOR_TITLE_INACTIVE_BACKGROUND_RGBA = gtk_css_property_to_rgba (colorTitleInactiveBackground);
- } else {
- GTK.gtk_style_context_get_background_color (context, GTK.GTK_STATE_FLAG_INSENSITIVE, rgba);
- COLOR_TITLE_INACTIVE_BACKGROUND_RGBA = copyRGBA (rgba);
- }
+ COLOR_TITLE_INACTIVE_BACKGROUND_RGBA = rgba;
+ if (GTK.GTK_VERSION >= OS.VERSION(3, 14, 0)) {
+ String colorTitleInactiveBackground = gtk_css_default_theme_values(SWT.COLOR_TITLE_INACTIVE_BACKGROUND, cssOutput);
+ if (!colorTitleInactiveBackground.isEmpty()) {
+ COLOR_TITLE_INACTIVE_BACKGROUND_RGBA = gtk_css_property_to_rgba (colorTitleInactiveBackground);
} else {
GTK.gtk_style_context_get_background_color (context, GTK.GTK_STATE_FLAG_INSENSITIVE, rgba);
COLOR_TITLE_INACTIVE_BACKGROUND_RGBA = copyRGBA (rgba);
}
- COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT_RGBA = toGdkRGBA (COLOR_TITLE_INACTIVE_BACKGROUND_RGBA, 1.3);
-
- // NOTE: If COLOR_LINK_FOREGROUND cannot be found from the GTK CSS theme then there is no reliable
- // way to find it on GTK3 using GtkStyleContext machinery. Use COLOR_LIST_SELECTION instead
- // as they are often the same.
- if (GTK.GTK_VERSION >= OS.VERSION(3, 14, 0)) {
- String colorLinkForeground = gtk_css_default_theme_values(SWT.COLOR_LINK_FOREGROUND, cssOutput);
- if (!colorLinkForeground.isEmpty()) {
- if (colorLinkForeground != "parsed") {
- COLOR_LINK_FOREGROUND_RGBA = gtk_css_property_to_rgba (colorLinkForeground);
- }
- } else {
- COLOR_LINK_FOREGROUND_RGBA = COLOR_LIST_SELECTION_RGBA;
+ } else {
+ GTK.gtk_style_context_get_background_color (context, GTK.GTK_STATE_FLAG_INSENSITIVE, rgba);
+ COLOR_TITLE_INACTIVE_BACKGROUND_RGBA = copyRGBA (rgba);
+ }
+ COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT_RGBA = toGdkRGBA (COLOR_TITLE_INACTIVE_BACKGROUND_RGBA, 1.3);
+
+ // NOTE: If COLOR_LINK_FOREGROUND cannot be found from the GTK CSS theme then there is no reliable
+ // way to find it on GTK3 using GtkStyleContext machinery. Use COLOR_LIST_SELECTION instead
+ // as they are often the same.
+ if (GTK.GTK_VERSION >= OS.VERSION(3, 14, 0)) {
+ String colorLinkForeground = gtk_css_default_theme_values(SWT.COLOR_LINK_FOREGROUND, cssOutput);
+ if (!colorLinkForeground.isEmpty()) {
+ if (colorLinkForeground != "parsed") {
+ COLOR_LINK_FOREGROUND_RGBA = gtk_css_property_to_rgba (colorLinkForeground);
}
} else {
COLOR_LINK_FOREGROUND_RGBA = COLOR_LIST_SELECTION_RGBA;
}
-
- return;
} else {
- COLOR_LINK_FOREGROUND = initializeColorLinkForeground(tooltipShellHandle);
-
- long /*int*/ colormap = GDK.gdk_colormap_get_system();
- GDK.gdk_colormap_alloc_color(colormap, COLOR_LINK_FOREGROUND, true, true);
-
- /* Get Tooltip resources */
- long /*int*/ tooltipStyle = GTK.gtk_widget_get_style (tooltipShellHandle);
- GdkColor gdkColor = new GdkColor();
- GTK.gtk_style_get_fg (tooltipStyle, GTK.GTK_STATE_NORMAL, gdkColor);
- COLOR_INFO_FOREGROUND = gdkColor;
- gdkColor = new GdkColor();
- GTK.gtk_style_get_bg (tooltipStyle, GTK.GTK_STATE_NORMAL, gdkColor);
- COLOR_INFO_BACKGROUND = gdkColor;
- GTK.gtk_widget_destroy (tooltipShellHandle);
-
- /* Get Shell resources */
- long /*int*/ style = GTK.gtk_widget_get_style (shellHandle);
- gdkColor = new GdkColor();
- GTK.gtk_style_get_black (style, gdkColor);
- COLOR_WIDGET_DARK_SHADOW = gdkColor;
- gdkColor = new GdkColor();
- GTK.gtk_style_get_dark (style, GTK.GTK_STATE_NORMAL, gdkColor);
- COLOR_WIDGET_NORMAL_SHADOW = gdkColor;
- gdkColor = new GdkColor();
- GTK.gtk_style_get_bg (style, GTK.GTK_STATE_NORMAL, gdkColor);
- COLOR_WIDGET_LIGHT_SHADOW = gdkColor;
- gdkColor = new GdkColor();
- GTK.gtk_style_get_light (style, GTK.GTK_STATE_NORMAL, gdkColor);
- COLOR_WIDGET_HIGHLIGHT_SHADOW = gdkColor;
- gdkColor = new GdkColor();
- GTK.gtk_style_get_fg (style, GTK.GTK_STATE_NORMAL, gdkColor);
- COLOR_WIDGET_FOREGROUND = gdkColor;
- gdkColor = new GdkColor();
- GTK.gtk_style_get_bg (style, GTK.GTK_STATE_NORMAL, gdkColor);
- COLOR_WIDGET_BACKGROUND = gdkColor;
- //gdkColor = new GdkColor();
- //OS.gtk_style_get_text (style, OS.GTK_STATE_NORMAL, gdkColor);
- //COLOR_TEXT_FOREGROUND = gdkColor;
- //gdkColor = new GdkColor();
- //OS.gtk_style_get_base (style, OS.GTK_STATE_NORMAL, gdkColor);
- //COLOR_TEXT_BACKGROUND = gdkColor;
- gdkColor = new GdkColor();
- GTK.gtk_style_get_text (style, GTK.GTK_STATE_NORMAL, gdkColor);
- COLOR_LIST_FOREGROUND = gdkColor;
- gdkColor = new GdkColor();
- GTK.gtk_style_get_base (style, GTK.GTK_STATE_NORMAL, gdkColor);
- COLOR_LIST_BACKGROUND = gdkColor;
- gdkColor = new GdkColor();
- GTK.gtk_style_get_text (style, GTK.GTK_STATE_SELECTED, gdkColor);
- COLOR_LIST_SELECTION_TEXT = gdkColor;
- gdkColor = new GdkColor();
- GTK.gtk_style_get_base (style, GTK.GTK_STATE_SELECTED, gdkColor);
- COLOR_LIST_SELECTION = gdkColor;
- gdkColor = new GdkColor();
- GTK.gtk_style_get_text (style, GTK.GTK_STATE_ACTIVE, gdkColor);
- COLOR_LIST_SELECTION_TEXT_INACTIVE = gdkColor;
- gdkColor = new GdkColor();
- GTK.gtk_style_get_base (style, GTK.GTK_STATE_ACTIVE, gdkColor);
- COLOR_LIST_SELECTION_INACTIVE = gdkColor;
- gdkColor = new GdkColor();
- GTK.gtk_style_get_bg (style, GTK.GTK_STATE_SELECTED, gdkColor);
- COLOR_TITLE_BACKGROUND = gdkColor;
- gdkColor = new GdkColor();
- GTK.gtk_style_get_fg (style, GTK.GTK_STATE_SELECTED, gdkColor);
- COLOR_TITLE_FOREGROUND = gdkColor;
- gdkColor = new GdkColor();
- GTK.gtk_style_get_light (style, GTK.GTK_STATE_SELECTED, gdkColor);
- COLOR_TITLE_BACKGROUND_GRADIENT = gdkColor;
- gdkColor = new GdkColor();
- GTK.gtk_style_get_bg (style, GTK.GTK_STATE_INSENSITIVE, gdkColor);
- COLOR_TITLE_INACTIVE_BACKGROUND = gdkColor;
- gdkColor = new GdkColor();
- GTK.gtk_style_get_fg (style, GTK.GTK_STATE_INSENSITIVE, gdkColor);
- COLOR_TITLE_INACTIVE_FOREGROUND = gdkColor;
- gdkColor = new GdkColor();
- GTK.gtk_style_get_light (style, GTK.GTK_STATE_INSENSITIVE, gdkColor);
- COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT = gdkColor;
-
+ COLOR_LINK_FOREGROUND_RGBA = COLOR_LIST_SELECTION_RGBA;
}
-}
-/*
- * Initialize COLOR_LINK_FOREGROUND in a helper method to allow for calling on GTK2.
- */
-GdkColor initializeColorLinkForeground (long /*int*/ tooltipShellHandle) {
- long /*int*/ linkWidget = GTK.gtk_label_new (new byte[1]);
- if (linkWidget == 0) error (SWT.ERROR_NO_HANDLES);
- GTK.gtk_container_add (tooltipShellHandle, linkWidget);
- long /*int*/ [] linkColor = new long /*int*/ [1];
- GTK.gtk_widget_style_get (linkWidget, OS.link_color, linkColor, 0);
- GdkColor gdkColor = new GdkColor();
- if (linkColor [0] != 0) {
- OS.memmove (gdkColor, linkColor[0], GdkColor.sizeof);
- GDK.gdk_color_free (linkColor [0]);
- } else {
- gdkColor.blue = (short)0xeeee;
- }
- return gdkColor;
+ return;
}
GdkRGBA styleContextGetColor(long /*int*/ context, int flag) {
@@ -4039,13 +3899,8 @@ public long /*int*/ internal_new_GC (GCData data) {
}
data.device = this;
data.drawable = root;
- if (GTK.GTK3) {
- data.backgroundRGBA = getSystemColor (SWT.COLOR_WHITE).handleRGBA;
- data.foregroundRGBA = getSystemColor (SWT.COLOR_BLACK).handleRGBA;
- } else {
- data.background = getSystemColor (SWT.COLOR_WHITE).handle;
- data.foreground = getSystemColor (SWT.COLOR_BLACK).handle;
- }
+ data.backgroundRGBA = getSystemColor (SWT.COLOR_WHITE).handleRGBA;
+ data.foregroundRGBA = getSystemColor (SWT.COLOR_BLACK).handleRGBA;
data.font = getSystemFont ();
}
return gc;
@@ -4771,13 +4626,13 @@ void releaseDisplay () {
}
/* Release the System Colors */
- COLOR_WIDGET_DARK_SHADOW = COLOR_WIDGET_NORMAL_SHADOW = COLOR_WIDGET_LIGHT_SHADOW =
- COLOR_WIDGET_HIGHLIGHT_SHADOW = COLOR_WIDGET_BACKGROUND = COLOR_WIDGET_BORDER =
- COLOR_LIST_FOREGROUND = COLOR_LIST_BACKGROUND = COLOR_LIST_SELECTION = COLOR_LIST_SELECTION_TEXT =
- COLOR_LIST_SELECTION_INACTIVE = COLOR_LIST_SELECTION_TEXT_INACTIVE =
- COLOR_WIDGET_FOREGROUND = COLOR_TITLE_FOREGROUND = COLOR_TITLE_BACKGROUND = COLOR_TITLE_BACKGROUND_GRADIENT =
- COLOR_TITLE_INACTIVE_FOREGROUND = COLOR_TITLE_INACTIVE_BACKGROUND = COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT =
- COLOR_INFO_BACKGROUND = COLOR_INFO_FOREGROUND = COLOR_LINK_FOREGROUND = null;
+ COLOR_WIDGET_DARK_SHADOW_RGBA = COLOR_WIDGET_NORMAL_SHADOW_RGBA = COLOR_WIDGET_LIGHT_SHADOW_RGBA =
+ COLOR_WIDGET_HIGHLIGHT_SHADOW_RGBA = COLOR_WIDGET_BACKGROUND_RGBA = COLOR_WIDGET_BORDER_RGBA =
+ COLOR_LIST_FOREGROUND_RGBA = COLOR_LIST_BACKGROUND_RGBA = COLOR_LIST_SELECTION_RGBA = COLOR_LIST_SELECTION_TEXT_RGBA =
+ COLOR_LIST_SELECTION_INACTIVE_RGBA = COLOR_LIST_SELECTION_TEXT_INACTIVE_RGBA =
+ COLOR_WIDGET_FOREGROUND_RGBA = COLOR_TITLE_FOREGROUND_RGBA = COLOR_TITLE_BACKGROUND_RGBA = COLOR_TITLE_BACKGROUND_GRADIENT_RGBA =
+ COLOR_TITLE_INACTIVE_FOREGROUND_RGBA = COLOR_TITLE_INACTIVE_BACKGROUND_RGBA = COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT_RGBA =
+ COLOR_INFO_BACKGROUND_RGBA = COLOR_INFO_FOREGROUND_RGBA = COLOR_LINK_FOREGROUND_RGBA = null;
/* Dispose the event callback */
GDK.gdk_event_handler_set (0, 0, 0);
@@ -5522,14 +5377,8 @@ void showIMWindow (Control control) {
if (preeditString [0] != 0 && C.strlen (preeditString [0]) > 0) {
Control widget = control.findBackgroundControl ();
if (widget == null) widget = control;
- if (GTK.GTK3) {
- widget.setBackgroundGdkRGBA (preeditWindow, control.getBackgroundGdkRGBA());
- widget.setForegroundGdkRGBA (preeditLabel, control.getForegroundGdkRGBA());
- } else {
- GdkColor color = widget.getBackgroundGdkColor ();
- GTK.gtk_widget_modify_bg (preeditWindow, GTK.GTK_STATE_NORMAL, color);
- widget.setForegroundColor (preeditLabel, control.getForegroundGdkColor());
- }
+ widget.setBackgroundGdkRGBA (preeditWindow, control.getBackgroundGdkRGBA());
+ widget.setForegroundGdkRGBA (preeditLabel, control.getForegroundGdkRGBA());
widget.setFontDescription (preeditLabel, control.getFontDescription ());
if (pangoAttrs [0] != 0) GTK.gtk_label_set_attributes (preeditLabel, pangoAttrs[0]);
GTK.gtk_label_set_text (preeditLabel, preeditString [0]);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandBar.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandBar.java
index 6e71b2796f..670824a398 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandBar.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandBar.java
@@ -455,15 +455,6 @@ void setFontDescription (long /*int*/ font) {
}
@Override
-void setForegroundGdkColor (GdkColor color) {
- assert !GTK.GTK3 : "GTK2 code was run by GTK3";
- super.setForegroundGdkColor (color);
- for (int i = 0; i < itemCount; i++) {
- items[i].setForegroundColor (color);
- }
-}
-
-@Override
void setForegroundGdkRGBA (GdkRGBA rgba) {
assert GTK.GTK3 : "GTK3 code was run by GTK2";
super.setForegroundGdkRGBA(rgba);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandItem.java
index cbd7aa3b1d..3fedc74bfc 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandItem.java
@@ -585,13 +585,6 @@ void setFontDescription (long /*int*/ font) {
if (imageHandle != 0) setFontDescription (imageHandle, font);
}
-void setForegroundColor (GdkColor color) {
- assert !GTK.GTK3 : "GTK2 code was run by GTK3";
- setForegroundColor (handle, color);
- if (labelHandle != 0) setForegroundColor (labelHandle, color);
- if (imageHandle != 0) setForegroundColor (imageHandle, color);
-}
-
void setForegroundRGBA (GdkRGBA rgba) {
assert GTK.GTK3 : "GTK3 code was run by GTK2";
parent.setForegroundGdkRGBA (handle, rgba);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Group.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Group.java
index 23a117e2f6..a5a4371815 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Group.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Group.java
@@ -347,15 +347,6 @@ void setBackgroundGdkRGBA(long /*int*/ handle, GdkRGBA rgba) {
}
@Override
-void setBackgroundGdkColor (GdkColor color) {
- assert !GTK.GTK3 : "GTK2 code was run by GTK3";
- super.setBackgroundGdkColor (color);
- setBackgroundGdkColor (fixedHandle, color);
- // Bug 453827 - client handle should also be painted as it's visible to the user now.
- setBackgroundGdkColor (clientHandle, color);
-}
-
-@Override
void setFontDescription (long /*int*/ font) {
super.setFontDescription (font);
setFontDescription (labelHandle, font);
@@ -381,13 +372,6 @@ void setForegroundGdkRGBA (long /*int*/ handle, GdkRGBA rgba) {
}
@Override
-void setForegroundGdkColor (GdkColor color) {
- assert !GTK.GTK3 : "GTK2 code was run by GTK3";
- super.setForegroundGdkColor (color);
- setForegroundColor(labelHandle, color);
-}
-
-@Override
void setForegroundGdkRGBA (GdkRGBA rgba) {
assert GTK.GTK3 : "GTK3 code was run by GTK2";
super.setForegroundGdkRGBA(rgba);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/IME.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/IME.java
index c2e3a38c81..e3e5b1ffc1 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/IME.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/IME.java
@@ -321,42 +321,26 @@ long /*int*/ gtk_preedit_changed (long /*int*/ imcontext) {
long /*int*/ attr = OS.pango_attr_iterator_get (iterator, OS.PANGO_ATTR_FOREGROUND);
if (attr != 0) {
OS.memmove (attrColor, attr, PangoAttrColor.sizeof);
- if (GTK.GTK3) {
- GdkRGBA rgba = new GdkRGBA ();
- rgba.alpha = 1.0;
- // Manual conversion since PangoAttrColor is a special case.
- // It uses GdkColor style colors but is supported on GTK3.
- rgba.red = (attrColor.color_red & 0xFFFF) / (float)0xFFFF;
- rgba.green = (attrColor.color_green & 0xFFFF) / (float)0xFFFF;
- rgba.blue = (attrColor.color_blue & 0xFFFF) / (float)0xFFFF;
- styles [i].foreground = Color.gtk_new(display, rgba);
- } else {
- GdkColor color = new GdkColor ();
- color.red = attrColor.color_red;
- color.green = attrColor.color_green;
- color.blue = attrColor.color_blue;
- styles [i].foreground = Color.gtk_new (display, color);
- }
+ GdkRGBA rgba = new GdkRGBA ();
+ rgba.alpha = 1.0;
+ // Manual conversion since PangoAttrColor is a special case.
+ // It uses GdkColor style colors but is supported on GTK3.
+ rgba.red = (attrColor.color_red & 0xFFFF) / (float)0xFFFF;
+ rgba.green = (attrColor.color_green & 0xFFFF) / (float)0xFFFF;
+ rgba.blue = (attrColor.color_blue & 0xFFFF) / (float)0xFFFF;
+ styles [i].foreground = Color.gtk_new(display, rgba);
}
attr = OS.pango_attr_iterator_get (iterator, OS.PANGO_ATTR_BACKGROUND);
if (attr != 0) {
OS.memmove (attrColor, attr, PangoAttrColor.sizeof);
- if (GTK.GTK3) {
- GdkRGBA rgba = new GdkRGBA ();
- rgba.alpha = 1.0;
- // Manual conversion since PangoAttrColor is a special case.
- // It uses GdkColor style colors but is supported on GTK3.
- rgba.red = (attrColor.color_red & 0xFFFF) / (float)0xFFFF;
- rgba.green = (attrColor.color_green & 0xFFFF) / (float)0xFFFF;
- rgba.blue = (attrColor.color_blue & 0xFFFF) / (float)0xFFFF;
- styles [i].background = Color.gtk_new(display, rgba);
- } else {
- GdkColor color = new GdkColor ();
- color.red = attrColor.color_red;
- color.green = attrColor.color_green;
- color.blue = attrColor.color_blue;
- styles [i].background = Color.gtk_new (display, color);
- }
+ GdkRGBA rgba = new GdkRGBA ();
+ rgba.alpha = 1.0;
+ // Manual conversion since PangoAttrColor is a special case.
+ // It uses GdkColor style colors but is supported on GTK3.
+ rgba.red = (attrColor.color_red & 0xFFFF) / (float)0xFFFF;
+ rgba.green = (attrColor.color_green & 0xFFFF) / (float)0xFFFF;
+ rgba.blue = (attrColor.color_blue & 0xFFFF) / (float)0xFFFF;
+ styles [i].background = Color.gtk_new(display, rgba);
}
attr = OS.pango_attr_iterator_get (iterator, OS.PANGO_ATTR_UNDERLINE);
if (attr != 0) {
@@ -374,12 +358,14 @@ long /*int*/ gtk_preedit_changed (long /*int*/ imcontext) {
if (styles [i].underline) {
attr = OS.pango_attr_iterator_get(iterator, OS.PANGO_ATTR_UNDERLINE_COLOR);
if (attr != 0) {
- OS.memmove (attrColor, attr, PangoAttrColor.sizeof);
- GdkColor color = new GdkColor ();
- color.red = attrColor.color_red;
- color.green = attrColor.color_green;
- color.blue = attrColor.color_blue;
- styles [i].underlineColor = Color.gtk_new (display, color);
+ GdkRGBA rgba = new GdkRGBA ();
+ rgba.alpha = 1.0;
+ // Manual conversion since PangoAttrColor is a special case.
+ // It uses GdkColor style colors but is supported on GTK3.
+ rgba.red = (attrColor.color_red & 0xFFFF) / (float)0xFFFF;
+ rgba.green = (attrColor.color_green & 0xFFFF) / (float)0xFFFF;
+ rgba.blue = (attrColor.color_blue & 0xFFFF) / (float)0xFFFF;
+ styles [i].underlineColor = Color.gtk_new(display, rgba);
}
}
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java
index 6b8eef955c..843ed625da 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java
@@ -535,15 +535,6 @@ private void gtk_label_set_align (float xalign, float yalign) {
}
@Override
-void setBackgroundGdkColor (GdkColor color) {
- assert !GTK.GTK3 : "GTK2 code was run by GTK3";
- super.setBackgroundGdkColor (color);
- setBackgroundGdkColor(fixedHandle, color);
- if (labelHandle != 0) setBackgroundGdkColor(labelHandle, color);
- if (imageHandle != 0) setBackgroundGdkColor(imageHandle, color);
-}
-
-@Override
int setBounds (int x, int y, int width, int height, boolean move, boolean resize) {
/*
* Bug in GTK. For some reason, when the label is
@@ -609,15 +600,6 @@ void setFontDescription (long /*int*/ font) {
}
@Override
-void setForegroundGdkColor (GdkColor color) {
- assert !GTK.GTK3 : "GTK2 code was run by GTK3";
- super.setForegroundGdkColor(color);
- setForegroundColor (fixedHandle, color);
- if (labelHandle != 0) setForegroundColor (labelHandle, color);
- if (imageHandle != 0) setForegroundColor (imageHandle, color);
-}
-
-@Override
void setForegroundGdkRGBA (GdkRGBA rgba) {
assert GTK.GTK3 : "GTK3 code was run by GTK2";
super.setForegroundGdkRGBA (rgba);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java
index 86da9b8b8e..ed7a8b1d85 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java
@@ -447,12 +447,6 @@ long /*int*/ eventWindow () {
return paintWindow ();
}
-@Override
-GdkColor getBackgroundGdkColor () {
- assert !GTK.GTK3 : "GTK2 code was run by GTK3";
- return getBaseGdkColor ();
-}
-
/**
* Returns the zero-relative index of the item which currently
* has the focus in the receiver, or -1 if no item has focus.
@@ -476,12 +470,6 @@ public int getFocusIndex () {
return index [0];
}
-@Override
-GdkColor getForegroundGdkColor () {
- assert !GTK.GTK3 : "GTK2 code was run by GTK3";
- return getTextColor ();
-}
-
/**
* Returns the item at the given, zero-relative index in the
* receiver. Throws an exception if the index is out of range.
@@ -1440,13 +1428,6 @@ void selectFocusIndex (int index) {
}
@Override
-void setBackgroundGdkColor (GdkColor color) {
- assert !GTK.GTK3 : "GTK2 code was run by GTK3";
- super.setBackgroundGdkColor (color);
- GTK.gtk_widget_modify_base (handle, 0, color);
-}
-
-@Override
int setBounds (int x, int y, int width, int height, boolean move, boolean resize) {
int result = super.setBounds (x, y, width, height, move, resize);
/*
@@ -1536,12 +1517,6 @@ void setForegroundGdkRGBA (GdkRGBA rgba) {
}
}
-@Override
-void setForegroundGdkColor (GdkColor color) {
- assert !GTK.GTK3 : "GTK2 code was run by GTK3";
- setForegroundColor (handle, color, false);
-}
-
/**
* Selects the item at the given zero-relative index in the receiver.
* If the item at the index was already selected, it remains selected.
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Sash.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Sash.java
index b356cf3177..db6253bbbb 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Sash.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Sash.java
@@ -150,23 +150,7 @@ void createHandle (int index) {
}
void drawBand (int x, int y, int width, int height) {
- if ((style & SWT.SMOOTH) != 0) return;
- long /*int*/ window = gtk_widget_get_window (parent.paintHandle());
- if (window == 0) return;
- byte [] bits = {-86, 85, -86, 85, -86, 85, -86, 85};
- long /*int*/ stipplePixmap = GDK.gdk_bitmap_create_from_data (window, bits, 8, 8);
- long /*int*/ gc = GDK.gdk_gc_new (window);
- long /*int*/ colormap = GDK.gdk_colormap_get_system();
- GdkColor color = new GdkColor ();
- GDK.gdk_color_white (colormap, color);
- GDK.gdk_gc_set_foreground (gc, color);
- GDK.gdk_gc_set_stipple (gc, stipplePixmap);
- GDK.gdk_gc_set_subwindow (gc, GDK.GDK_INCLUDE_INFERIORS);
- GDK.gdk_gc_set_fill (gc, GDK.GDK_STIPPLED);
- GDK.gdk_gc_set_function (gc, GDK.GDK_XOR);
- GDK.gdk_draw_rectangle (window, gc, 1, x, y, width, height);
- OS.g_object_unref (stipplePixmap);
- OS.g_object_unref (gc);
+ if ((style & SWT.SMOOTH) != 0 || GTK.GTK3) return;
}
@Override
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java
index bcffb68022..20234dc385 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java
@@ -768,14 +768,8 @@ void createHandle (int index) {
GTK.gtk_window_set_title (shellHandle, new byte [1]);
if ((style & (SWT.NO_TRIM | SWT.BORDER | SWT.SHELL_TRIM)) == 0) {
GTK.gtk_container_set_border_width (shellHandle, 1);
- if (GTK.GTK3) {
- if (GTK.GTK_VERSION < OS.VERSION (3, 14, 0)) {
- GTK.gtk_widget_override_background_color (shellHandle, GTK.GTK_STATE_FLAG_NORMAL, new GdkRGBA());
- }
- } else {
- GdkColor color = new GdkColor ();
- GTK.gtk_style_get_black (GTK.gtk_widget_get_style (shellHandle), color);
- GTK.gtk_widget_modify_bg (shellHandle, GTK.GTK_STATE_NORMAL, color);
+ if (GTK.GTK_VERSION < OS.VERSION (3, 14, 0)) {
+ GTK.gtk_widget_override_background_color (shellHandle, GTK.GTK_STATE_FLAG_NORMAL, new GdkRGBA());
}
}
if ((style & SWT.TOOL) != 0) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java
index 2e49082b54..374c3173ee 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java
@@ -425,12 +425,6 @@ void fixIM () {
}
@Override
-GdkColor getBackgroundGdkColor () {
- assert !GTK.GTK3 : "GTK2 code was run by GTK3";
- return getBaseGdkColor ();
-}
-
-@Override
int getBorderWidthInPixels () {
checkWidget();
if ((this.style & SWT.BORDER) != 0) {
@@ -439,12 +433,6 @@ int getBorderWidthInPixels () {
return 0;
}
-@Override
-GdkColor getForegroundGdkColor () {
- assert !GTK.GTK3 : "GTK2 code was run by GTK3";
- return getTextColor ();
-}
-
/**
* Returns the amount that the receiver's value will be
* modified by when the up/down arrows are pressed.
@@ -957,13 +945,6 @@ void setBackgroundGdkRGBA (long /*int*/ context, long /*int*/ handle, GdkRGBA rg
}
@Override
-void setBackgroundGdkColor (GdkColor color) {
- assert !GTK.GTK3 : "GTK2 code was run by GTK3";
- super.setBackgroundGdkColor (color);
- GTK.gtk_widget_modify_base (handle, 0, color);
-}
-
-@Override
void setCursor (long /*int*/ cursor) {
long /*int*/ defaultCursor = 0;
if (cursor == 0) defaultCursor = GDK.gdk_cursor_new_for_display (GDK.gdk_display_get_default(), GDK.GDK_XTERM);
@@ -971,12 +952,6 @@ void setCursor (long /*int*/ cursor) {
if (cursor == 0) gdk_cursor_unref (defaultCursor);
}
-@Override
-void setForegroundGdkColor (GdkColor color) {
- assert !GTK.GTK3 : "GTK2 code was run by GTK3";
- setForegroundColor (handle, color, false);
-}
-
/**
* Sets the amount that the receiver's value will be
* modified by when the up/down arrows are pressed to
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java
index fa1505b1de..9858d4f9a6 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java
@@ -320,7 +320,7 @@ void createItem (TabItem item, int index) {
System.arraycopy (items, index, items, index + 1, itemCount++ - index);
items [index] = item;
if ((state & FOREGROUND) != 0) {
- item.setForegroundGdkColor (getForegroundGdkColor());
+ item.setForegroundGdkRGBA (item.handle, getForegroundGdkRGBA());
}
if ((state & FONT) != 0) {
item.setFontDescription (getFontDescription());
@@ -804,18 +804,6 @@ void setForegroundGdkRGBA (GdkRGBA rgba) {
}
@Override
-void setForegroundGdkColor (GdkColor color) {
- assert !GTK.GTK3 : "GTK2 code was run by GTK3";
- super.setForegroundGdkColor (color);
- TabItem [] items = getItems ();
- for (int i = 0; i < items.length; i++) {
- if (items[i] != null) {
- items[i].setForegroundGdkColor (color);
- }
- }
-}
-
-@Override
void setOrientation (boolean create) {
super.setOrientation (create);
if (items != null) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabItem.java
index 120027a12d..ff45232aaf 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabItem.java
@@ -333,13 +333,6 @@ void setForegroundRGBA (GdkRGBA rgba) {
setForegroundGdkRGBA (imageHandle, rgba);
}
-void setForegroundGdkColor (GdkColor color) {
- assert !GTK.GTK3 : "GTK2 code was run by GTK3";
- /* Don't set the color in vbox handle (it doesn't draw) */
- setForegroundColor (labelHandle, color, false);
- setForegroundColor (imageHandle, color, false);
-}
-
void setForegroundGdkRGBA (long /*int*/ handle, GdkRGBA rgba) {
assert GTK.GTK3 : "GTK3 code was run by GTK2";
GdkRGBA toSet = new GdkRGBA();
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
index 6bc92776e5..9a235f5aff 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
@@ -84,7 +84,6 @@ public class Table extends Composite {
ImageList imageList, headerImageList;
boolean firstCustomDraw;
int drawState, drawFlags;
- GdkColor drawForeground;
GdkRGBA background, foreground, drawForegroundRGBA;
Color headerBackground, headerForeground;
String headerCSSBackground, headerCSSForeground;
@@ -241,26 +240,16 @@ long /*int*/ cellDataProc (long /*int*/ tree_column, long /*int*/ cell, long /*i
ptr [0] = 0;
GTK.gtk_tree_model_get (tree_model, iter, modelIndex + CELL_BACKGROUND, ptr, -1);
if (ptr [0] != 0) {
- if (GTK.GTK3) {
- OS.g_object_set (cell, OS.cell_background_rgba, ptr[0], 0);
- GDK.gdk_rgba_free (ptr [0]);
- } else {
- OS.g_object_set (cell, OS.cell_background_gdk, ptr[0], 0);
- GDK.gdk_color_free (ptr [0]);
- }
+ OS.g_object_set (cell, OS.cell_background_rgba, ptr[0], 0);
+ GDK.gdk_rgba_free (ptr [0]);
}
}
if (!isPixbuf) {
ptr [0] = 0;
GTK.gtk_tree_model_get (tree_model, iter, modelIndex + CELL_FOREGROUND, ptr, -1);
if (ptr [0] != 0) {
- if (GTK.GTK3) {
- OS.g_object_set (cell, OS.foreground_rgba, ptr [0], 0);
- GDK.gdk_rgba_free (ptr [0]);
- } else {
- OS.g_object_set (cell, OS.foreground_gdk, ptr [0], 0);
- GDK.gdk_color_free (ptr [0]);
- }
+ OS.g_object_set (cell, OS.foreground_rgba, ptr [0], 0);
+ GDK.gdk_rgba_free (ptr [0]);
}
ptr [0] = 0;
GTK.gtk_tree_model_get (tree_model, iter, modelIndex + CELL_FONT, ptr, -1);
@@ -587,14 +576,8 @@ void createColumn (TableColumn column, int index) {
GTK.gtk_tree_model_get (oldModel, oldItem, j, ptr, -1);
GTK.gtk_list_store_set (newModel, newItem, j, ptr [0], -1);
if (ptr [0] != 0) {
- if (GTK.GTK3) {
- if (types[j] == GDK.GDK_TYPE_RGBA()) {
- GDK.gdk_rgba_free(ptr[0]);
- }
- } else {
- if (types[j] == GDK.GDK_TYPE_COLOR()) {
- GDK.gdk_color_free(ptr[0]);
- }
+ if (types[j] == GDK.GDK_TYPE_RGBA()) {
+ GDK.gdk_rgba_free(ptr[0]);
}
if (types [j] == OS.G_TYPE_STRING ()) {
OS.g_free ((ptr [0]));
@@ -1069,11 +1052,7 @@ void destroyItem (TableColumn column) {
GTK.gtk_list_store_set (newModel, newItem, j, ptr [0], -1);
if (ptr [0] != 0) {
if (j == FOREGROUND_COLUMN || j == BACKGROUND_COLUMN) {
- if (GTK.GTK3) {
- GDK.gdk_rgba_free (ptr [0]);
- } else {
- GDK.gdk_color_free (ptr [0]);
- }
+ GDK.gdk_rgba_free (ptr [0]);
} else if (j == FONT_COLUMN) {
OS.pango_font_description_free (ptr [0]);
}
@@ -1088,20 +1067,12 @@ void destroyItem (TableColumn column) {
GTK.gtk_tree_model_get (oldModel, oldItem, column.modelIndex + CELL_FOREGROUND, ptr, -1);
GTK.gtk_list_store_set (newModel, newItem, FIRST_COLUMN + CELL_FOREGROUND, ptr [0], -1);
if (ptr [0] != 0) {
- if (GTK.GTK3) {
- GDK.gdk_rgba_free (ptr [0]);
- } else {
- GDK.gdk_color_free (ptr [0]);
- }
+ GDK.gdk_rgba_free (ptr [0]);
}
GTK.gtk_tree_model_get (oldModel, oldItem, column.modelIndex + CELL_BACKGROUND, ptr, -1);
GTK.gtk_list_store_set (newModel, newItem, FIRST_COLUMN + CELL_BACKGROUND, ptr [0], -1);
if (ptr [0] != 0) {
- if (GTK.GTK3) {
- GDK.gdk_rgba_free (ptr [0]);
- } else {
- GDK.gdk_color_free (ptr [0]);
- }
+ GDK.gdk_rgba_free (ptr [0]);
}
GTK.gtk_tree_model_get (oldModel, oldItem, column.modelIndex + CELL_FONT, ptr, -1);
GTK.gtk_list_store_set (newModel, newItem, FIRST_COLUMN + CELL_FONT, ptr [0], -1);
@@ -1246,11 +1217,6 @@ void fixChildren (Shell newShell, Shell oldShell, Decorations newDecorations, De
}
@Override
-GdkColor getBackgroundGdkColor () {
- return getBaseGdkColor ();
-}
-
-@Override
Rectangle getClientAreaInPixels () {
checkWidget ();
forceResize ();
@@ -1335,15 +1301,15 @@ long /*int*/[] getColumnTypes (int columnCount) {
// per row data
types [CHECKED_COLUMN] = OS.G_TYPE_BOOLEAN ();
types [GRAYED_COLUMN] = OS.G_TYPE_BOOLEAN ();
- types [FOREGROUND_COLUMN] = GTK.GTK3? GDK.GDK_TYPE_RGBA() : GDK.GDK_TYPE_COLOR ();
- types [BACKGROUND_COLUMN] = GTK.GTK3? GDK.GDK_TYPE_RGBA() : GDK.GDK_TYPE_COLOR ();
+ types [FOREGROUND_COLUMN] = GDK.GDK_TYPE_RGBA();
+ types [BACKGROUND_COLUMN] = GDK.GDK_TYPE_RGBA();
types [FONT_COLUMN] = OS.PANGO_TYPE_FONT_DESCRIPTION ();
// per cell data
for (int i=FIRST_COLUMN; i<types.length; i+=CELL_TYPES) {
types [i + CELL_PIXBUF] = GDK.GDK_TYPE_PIXBUF ();
types [i + CELL_TEXT] = OS.G_TYPE_STRING ();
- types [i + CELL_FOREGROUND] = GTK.GTK3? GDK.GDK_TYPE_RGBA() : GDK.GDK_TYPE_COLOR ();
- types [i + CELL_BACKGROUND] = GTK.GTK3? GDK.GDK_TYPE_RGBA() : GDK.GDK_TYPE_COLOR ();
+ types [i + CELL_FOREGROUND] = GDK.GDK_TYPE_RGBA();
+ types [i + CELL_BACKGROUND] = GDK.GDK_TYPE_RGBA();
types [i + CELL_FONT] = OS.PANGO_TYPE_FONT_DESCRIPTION ();
}
return types;
@@ -1476,12 +1442,6 @@ TableItem getFocusItem () {
return item;
}
-@Override
-GdkColor getForegroundGdkColor () {
- assert !GTK.GTK3 : "GTK2 code was run by GTK3";
- return getTextColor ();
-}
-
/**
* Returns the width in pixels of a grid line.
*
@@ -2990,11 +2950,7 @@ void rendererRender (long /*int*/ cell, long /*int*/ cr, long /*int*/ window, lo
}
if (ptr [0] != 0) {
drawState |= SWT.BACKGROUND;
- if (GTK.GTK3) {
- GDK.gdk_rgba_free (ptr [0]);
- } else {
- GDK.gdk_color_free (ptr [0]);
- }
+ GDK.gdk_rgba_free (ptr [0]);
}
if ((flags & GTK.GTK_CELL_RENDERER_SELECTED) != 0) drawState |= SWT.SELECTED;
if (!GTK.GTK3 || (flags & GTK.GTK_CELL_RENDERER_SELECTED) == 0) {
@@ -3090,11 +3046,7 @@ void rendererRender (long /*int*/ cell, long /*int*/ cr, long /*int*/ window, lo
Rectangle eventRect = new Rectangle (rect.x, rect.y, rect.width, rect.height);
event.setBounds (DPIUtil.autoScaleDown (eventRect));
sendEvent (SWT.EraseItem, event);
- if (GTK.GTK3) {
- drawForegroundRGBA = null;
- } else {
- drawForeground = null;
- }
+ drawForegroundRGBA = null;
drawState = event.doit ? event.detail : 0;
drawFlags &= ~(GTK.GTK_CELL_RENDERER_FOCUSED | GTK.GTK_CELL_RENDERER_SELECTED);
if ((drawState & SWT.SELECTED) != 0) drawFlags |= GTK.GTK_CELL_RENDERER_SELECTED;
@@ -3118,11 +3070,7 @@ void rendererRender (long /*int*/ cell, long /*int*/ cr, long /*int*/ window, lo
}
} else {
if (wasSelected) {
- if (GTK.GTK3) {
- drawForegroundRGBA = gc.getForeground ().handleRGBA;
- } else {
- drawForeground = gc.getForeground ().handle;
- }
+ drawForegroundRGBA = gc.getForeground ().handleRGBA;
}
}
gc.dispose();
@@ -3141,9 +3089,7 @@ void rendererRender (long /*int*/ cell, long /*int*/ cr, long /*int*/ window, lo
long /*int*/ g_class = OS.g_type_class_peek_parent (OS.G_OBJECT_GET_CLASS (cell));
GtkCellRendererClass klass = new GtkCellRendererClass ();
OS.memmove (klass, g_class);
- if (drawForeground != null && GTK.GTK_IS_CELL_RENDERER_TEXT (cell) && !GTK.GTK3) {
- OS.g_object_set (cell, OS.foreground_gdk, drawForeground, 0);
- } else if (drawForegroundRGBA != null && GTK.GTK_IS_CELL_RENDERER_TEXT (cell) && GTK.GTK3) {
+ if (drawForegroundRGBA != null && GTK.GTK_IS_CELL_RENDERER_TEXT (cell) && GTK.GTK3) {
OS.g_object_set (cell, OS.foreground_rgba, drawForegroundRGBA, 0);
}
if (GTK.GTK3) {
@@ -3203,19 +3149,14 @@ void rendererRender (long /*int*/ cell, long /*int*/ cr, long /*int*/ window, lo
* gtk_paint_flat_box () changes the background color state_type
* to GTK_STATE_ACTIVE. The fix is to use the same values in the GC.
*/
- background = GTK.GTK3 ? Color.gtk_new (display, display.COLOR_LIST_SELECTION_INACTIVE_RGBA) : Color.gtk_new (display, display.COLOR_LIST_SELECTION_INACTIVE);
- foreground = GTK.GTK3 ? Color.gtk_new (display, display.COLOR_LIST_SELECTION_TEXT_INACTIVE_RGBA) : Color.gtk_new (display, display.COLOR_LIST_SELECTION_TEXT_INACTIVE);
+ background = Color.gtk_new (display, display.COLOR_LIST_SELECTION_INACTIVE_RGBA);
+ foreground = Color.gtk_new (display, display.COLOR_LIST_SELECTION_TEXT_INACTIVE_RGBA);
}
gc.setBackground (background);
gc.setForeground (foreground);
} else {
gc.setBackground (item.getBackground (columnIndex));
- Color foreground;
- if (GTK.GTK3) {
- foreground = drawForegroundRGBA != null ? Color.gtk_new (display, drawForegroundRGBA) : item.getForeground (columnIndex);
- } else {
- foreground = drawForeground != null ? Color.gtk_new (display, drawForeground) : item.getForeground (columnIndex);
- }
+ Color foreground = drawForegroundRGBA != null ? Color.gtk_new (display, drawForegroundRGBA) : item.getForeground (columnIndex);
gc.setForeground (foreground);
}
gc.setFont (item.getFont (columnIndex));
@@ -3433,13 +3374,6 @@ void selectFocusIndex (int index) {
}
@Override
-void setBackgroundGdkColor (GdkColor color) {
- assert !GTK.GTK3 : "GTK2 code was run by GTK3";
- super.setBackgroundGdkColor (color);
- GTK.gtk_widget_modify_base (handle, 0, color);
-}
-
-@Override
void setBackgroundGdkRGBA (long /*int*/ context, long /*int*/ handle, GdkRGBA rgba) {
assert GTK.GTK3 : "GTK3 code was run by GTK2";
/* Setting the background color overrides the selected background color.
@@ -3563,12 +3497,6 @@ void setForegroundGdkRGBA (GdkRGBA rgba) {
}
}
-@Override
-void setForegroundGdkColor (GdkColor color) {
- assert !GTK.GTK3 : "GTK2 code was run by GTK3";
- setForegroundColor (handle, color, false);
-}
-
/**
* Sets the header background color to the color specified
* by the argument, or to the default system color if the argument is null.
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java
index 1d34cc938d..7c64ecac7c 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java
@@ -134,17 +134,10 @@ Color _getBackground () {
long /*int*/ [] ptr = new long /*int*/ [1];
GTK.gtk_tree_model_get (parent.modelHandle, handle, Table.BACKGROUND_COLUMN, ptr, -1);
if (ptr [0] == 0) return parent.getBackground ();
- if (GTK.GTK3) {
- GdkRGBA gdkRGBA = new GdkRGBA ();
- OS.memmove(gdkRGBA, ptr [0], GdkRGBA.sizeof);
- GDK.gdk_rgba_free (ptr [0]);
- return Color.gtk_new(display, gdkRGBA);
- } else {
- GdkColor gdkColor = new GdkColor ();
- OS.memmove (gdkColor, ptr [0], GdkColor.sizeof);
- GDK.gdk_color_free (ptr [0]);
- return Color.gtk_new (display, gdkColor);
- }
+ GdkRGBA gdkRGBA = new GdkRGBA ();
+ OS.memmove(gdkRGBA, ptr [0], GdkRGBA.sizeof);
+ GDK.gdk_rgba_free (ptr [0]);
+ return Color.gtk_new(display, gdkRGBA);
}
Color _getBackground (int index) {
@@ -154,17 +147,10 @@ Color _getBackground (int index) {
int modelIndex = parent.columnCount == 0 ? Table.FIRST_COLUMN : parent.columns [index].modelIndex;
GTK.gtk_tree_model_get (parent.modelHandle, handle, modelIndex + Table.CELL_BACKGROUND, ptr, -1);
if (ptr [0] == 0) return _getBackground ();
- if (GTK.GTK3) {
- GdkRGBA gdkRGBA = new GdkRGBA ();
- OS.memmove(gdkRGBA, ptr [0], GdkRGBA.sizeof);
- GDK.gdk_rgba_free (ptr [0]);
- return Color.gtk_new(display, gdkRGBA);
- } else {
- GdkColor gdkColor = new GdkColor ();
- OS.memmove (gdkColor, ptr [0], GdkColor.sizeof);
- GDK.gdk_color_free (ptr [0]);
- return Color.gtk_new (display, gdkColor);
- }
+ GdkRGBA gdkRGBA = new GdkRGBA ();
+ OS.memmove(gdkRGBA, ptr [0], GdkRGBA.sizeof);
+ GDK.gdk_rgba_free (ptr [0]);
+ return Color.gtk_new(display, gdkRGBA);
}
boolean _getChecked () {
@@ -177,17 +163,10 @@ Color _getForeground () {
long /*int*/ [] ptr = new long /*int*/ [1];
GTK.gtk_tree_model_get (parent.modelHandle, handle, Table.FOREGROUND_COLUMN, ptr, -1);
if (ptr [0] == 0) return parent.getForeground ();
- if (GTK.GTK3) {
- GdkRGBA gdkRGBA = new GdkRGBA ();
- OS.memmove(gdkRGBA, ptr [0], GdkRGBA.sizeof);
- GDK.gdk_rgba_free (ptr [0]);
- return Color.gtk_new(display, gdkRGBA);
- } else {
- GdkColor gdkColor = new GdkColor ();
- OS.memmove (gdkColor, ptr [0], GdkColor.sizeof);
- GDK.gdk_color_free (ptr [0]);
- return Color.gtk_new (display, gdkColor);
- }
+ GdkRGBA gdkRGBA = new GdkRGBA ();
+ OS.memmove(gdkRGBA, ptr [0], GdkRGBA.sizeof);
+ GDK.gdk_rgba_free (ptr [0]);
+ return Color.gtk_new(display, gdkRGBA);
}
Color _getForeground (int index) {
@@ -197,17 +176,10 @@ Color _getForeground (int index) {
int modelIndex = parent.columnCount == 0 ? Table.FIRST_COLUMN : parent.columns [index].modelIndex;
GTK.gtk_tree_model_get (parent.modelHandle, handle, modelIndex + Table.CELL_FOREGROUND, ptr, -1);
if (ptr [0] == 0) return _getForeground ();
- if (GTK.GTK3) {
- GdkRGBA gdkRGBA = new GdkRGBA ();
- OS.memmove(gdkRGBA, ptr [0], GdkRGBA.sizeof);
- GDK.gdk_rgba_free (ptr [0]);
- return Color.gtk_new(display, gdkRGBA);
- } else {
- GdkColor gdkColor = new GdkColor ();
- OS.memmove (gdkColor, ptr [0], GdkColor.sizeof);
- GDK.gdk_color_free (ptr [0]);
- return Color.gtk_new (display, gdkColor);
- }
+ GdkRGBA gdkRGBA = new GdkRGBA ();
+ OS.memmove(gdkRGBA, ptr [0], GdkRGBA.sizeof);
+ GDK.gdk_rgba_free (ptr [0]);
+ return Color.gtk_new(display, gdkRGBA);
}
Image _getImage (int index) {
@@ -862,13 +834,8 @@ public void setBackground (Color color) {
error (SWT.ERROR_INVALID_ARGUMENT);
}
if (_getBackground ().equals (color)) return;
- if (GTK.GTK3) {
- GdkRGBA gdkRGBA = color != null ? color.handleRGBA : null;
- GTK.gtk_list_store_set (parent.modelHandle, handle, Table.BACKGROUND_COLUMN, gdkRGBA, -1);
- } else {
- GdkColor gdkColor = color != null ? color.handle : null;
- GTK.gtk_list_store_set (parent.modelHandle, handle, Table.BACKGROUND_COLUMN, gdkColor, -1);
- }
+ GdkRGBA gdkRGBA = color != null ? color.handleRGBA : null;
+ GTK.gtk_list_store_set (parent.modelHandle, handle, Table.BACKGROUND_COLUMN, gdkRGBA, -1);
cached = true;
}
@@ -899,13 +866,8 @@ public void setBackground (int index, Color color) {
int count = Math.max (1, parent.getColumnCount ());
if (0 > index || index > count - 1) return;
int modelIndex = parent.columnCount == 0 ? Table.FIRST_COLUMN : parent.columns [index].modelIndex;
- if (GTK.GTK3) {
- GdkRGBA gdkRGBA = color != null ? color.handleRGBA : null;
- GTK.gtk_list_store_set (parent.modelHandle, handle, modelIndex + Table.CELL_BACKGROUND, gdkRGBA, -1);
- } else {
- GdkColor gdkColor = color != null ? color.handle : null;
- GTK.gtk_list_store_set (parent.modelHandle, handle, modelIndex + Table.CELL_BACKGROUND, gdkColor, -1);
- }
+ GdkRGBA gdkRGBA = color != null ? color.handleRGBA : null;
+ GTK.gtk_list_store_set (parent.modelHandle, handle, modelIndex + Table.CELL_BACKGROUND, gdkRGBA, -1);
cached = true;
if (color != null) {
@@ -1079,13 +1041,8 @@ public void setForeground (Color color){
error (SWT.ERROR_INVALID_ARGUMENT);
}
if (_getForeground ().equals (color)) return;
- if (GTK.GTK3) {
- GdkRGBA gdkRGBA = color != null ? color.handleRGBA : null;
- GTK.gtk_list_store_set (parent.modelHandle, handle, Table.FOREGROUND_COLUMN, gdkRGBA, -1);
- } else {
- GdkColor gdkColor = color != null ? color.handle : null;
- GTK.gtk_list_store_set (parent.modelHandle, handle, Table.FOREGROUND_COLUMN, gdkColor, -1);
- }
+ GdkRGBA gdkRGBA = color != null ? color.handleRGBA : null;
+ GTK.gtk_list_store_set (parent.modelHandle, handle, Table.FOREGROUND_COLUMN, gdkRGBA, -1);
cached = true;
}
@@ -1116,13 +1073,8 @@ public void setForeground (int index, Color color){
int count = Math.max (1, parent.getColumnCount ());
if (0 > index || index > count - 1) return;
int modelIndex = parent.columnCount == 0 ? Table.FIRST_COLUMN : parent.columns [index].modelIndex;
- if (GTK.GTK3) {
- GdkRGBA gdkRGBA = color != null ? color.handleRGBA : null;
- GTK.gtk_list_store_set (parent.modelHandle, handle, modelIndex + Table.CELL_FOREGROUND, gdkRGBA, -1);
- } else {
- GdkColor gdkColor = color != null ? color.handle : null;
- GTK.gtk_list_store_set (parent.modelHandle, handle, modelIndex + Table.CELL_FOREGROUND, gdkColor, -1);
- }
+ GdkRGBA gdkRGBA = color != null ? color.handleRGBA : null;
+ GTK.gtk_list_store_set (parent.modelHandle, handle, modelIndex + Table.CELL_FOREGROUND, gdkRGBA, -1);
cached = true;
if (color != null) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java
index af59716c0c..fae98b3092 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java
@@ -824,12 +824,6 @@ void fixIM () {
}
@Override
-GdkColor getBackgroundGdkColor () {
- assert !GTK.GTK3 : "GTK2 code was run by GTK3";
- return getBaseGdkColor ();
-}
-
-@Override
int getBorderWidthInPixels () {
checkWidget();
if ((style & SWT.MULTI) != 0) return super.getBorderWidthInPixels ();
@@ -1026,12 +1020,6 @@ public boolean getEditable () {
return GTK.gtk_text_view_get_editable (handle);
}
-@Override
-GdkColor getForegroundGdkColor () {
- assert !GTK.GTK3 : "GTK2 code was run by GTK3";
- return getTextColor ();
-}
-
/**
* Returns the number of lines.
*
@@ -1708,27 +1696,14 @@ void drawMessage (long /*int*/ cr) {
case SWT.CENTER: x = (width - rect.width) / 2; break;
case SWT.RIGHT: x = rtl ? innerBorder.left : width - rect.width; break;
}
- GdkColor textColor = new GdkColor ();
- GdkColor baseColor = new GdkColor ();
- if (GTK.GTK3) {
- long /*int*/ styleContext = GTK.gtk_widget_get_style_context (handle);
- GdkRGBA textRGBA;
- textRGBA = display.styleContextGetColor (styleContext, GTK.GTK_STATE_FLAG_INSENSITIVE);
- Point thickness = getThickness (handle);
- x += thickness.x;
- y += thickness.y;
- long /*int*/ cairo = cr != 0 ? cr : GDK.gdk_cairo_create(window);
- Cairo.cairo_set_source_rgba(cairo, textRGBA.red, textRGBA.green, textRGBA.blue, textRGBA.alpha);
- } else {
- long /*int*/ style = GTK.gtk_widget_get_style (handle);
- GTK.gtk_style_get_text (style, GTK.GTK_STATE_INSENSITIVE, textColor);
- GTK.gtk_style_get_base (style, GTK.GTK_STATE_NORMAL, baseColor);
- long /*int*/ cairo = cr != 0 ? cr : GDK.gdk_cairo_create(window);
- Cairo.cairo_set_source_rgba_compatibility (cairo, textColor);
- Cairo.cairo_move_to(cairo, x, y);
- OS.pango_cairo_show_layout(cairo, layout);
- if (cr != cairo) Cairo.cairo_destroy(cairo);
- }
+ long /*int*/ styleContext = GTK.gtk_widget_get_style_context (handle);
+ GdkRGBA textRGBA;
+ textRGBA = display.styleContextGetColor (styleContext, GTK.GTK_STATE_FLAG_INSENSITIVE);
+ Point thickness = getThickness (handle);
+ x += thickness.x;
+ y += thickness.y;
+ long /*int*/ cairo = cr != 0 ? cr : GDK.gdk_cairo_create(window);
+ Cairo.cairo_set_source_rgba(cairo, textRGBA.red, textRGBA.green, textRGBA.blue, textRGBA.alpha);
OS.g_object_unref (layout);
}
}
@@ -2281,13 +2256,6 @@ public void selectAll () {
}
@Override
-void setBackgroundGdkColor (GdkColor color) {
- assert !GTK.GTK3 : "GTK2 code was run by GTK3";
- super.setBackgroundGdkColor (color);
- GTK.gtk_widget_modify_base (handle, 0, color);
-}
-
-@Override
GdkRGBA getContextBackgroundGdkRGBA () {
assert GTK.GTK3 : "GTK3 code was run by GTK2";
if (background != null && (state & BACKGROUND) != 0) {
@@ -2423,12 +2391,6 @@ void setFontDescription (long /*int*/ font) {
setTabStops (tabs);
}
-@Override
-void setForegroundGdkColor (GdkColor color) {
- assert !GTK.GTK3 : "GTK2 code was run by GTK3";
- setForegroundColor (handle, color, false);
-}
-
/**
* Sets the widget message. The message text is displayed
* as a hint for the user, indicating the purpose of the field.
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java
index 1a5c634252..f663b0bd7b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java
@@ -685,16 +685,6 @@ void setForegroundGdkRGBA (GdkRGBA rgba) {
}
@Override
-void setForegroundGdkColor (GdkColor color) {
- assert !GTK.GTK3 : "GTK2 code was run by GTK3";
- super.setForegroundGdkColor (color);
- ToolItem [] items = getItems ();
- for (int i = 0; i < items.length; i++) {
- items[i].setForegroundColor (color);
- }
-}
-
-@Override
void setOrientation (boolean create) {
super.setOrientation (create);
ToolItem [] items = _getItems ();
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java
index 71434b09fd..54ac00d83c 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java
@@ -240,9 +240,6 @@ void createHandle (int index) {
if (imageHandle != 0) {
GTK.gtk_tool_button_set_icon_widget(handle, imageHandle);
}
- if ((parent.state & FOREGROUND) != 0) {
- setForegroundColor (parent.getForegroundGdkColor());
- }
if ((parent.state & FONT) != 0) {
setFontDescription (parent.getFontDescription());
}
@@ -1036,11 +1033,6 @@ void setBackgroundRGBA (GdkRGBA rgba) {
if (handle != 0) setBackgroundRGBA (handle, rgba);
}
-void setForegroundColor (GdkColor color) {
- assert !GTK.GTK3 : "GTK2 code was run by GTK3";
- if (labelHandle != 0) setForegroundColor (labelHandle, color);
-}
-
void setBackgroundRGBA (long /*int*/ handle, GdkRGBA rgba) {
assert GTK.GTK3 : "GTK3 code was run by GTK2";
if (GTK.GTK_VERSION >= OS.VERSION(3, 14, 0)) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java
index d1f02266a6..a6f523145a 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java
@@ -278,16 +278,12 @@ void createHandle (int index) {
state |= HANDLE;
handle = GTK.gtk_window_new (GTK.GTK_WINDOW_POPUP);
Color background = display.getSystemColor (SWT.COLOR_INFO_BACKGROUND);
- if (GTK.GTK3) {
- long /*int*/ context = GTK.gtk_widget_get_style_context (handle);
- GdkRGBA bgRGBA = background.handleRGBA;
- String name = GTK.GTK_VERSION >= OS.VERSION(3, 20, 0) ? "window" : "GtkWindow";
- String css = name + " {background-color: " + display.gtk_rgba_to_css_string(bgRGBA) + ";}";
- gtk_css_provider_load_from_css (context, css);
- GTK.gtk_style_context_invalidate (context);
- } else {
- GTK.gtk_widget_modify_bg (handle, GTK.GTK_STATE_NORMAL, background.handle);
- }
+ long /*int*/ context = GTK.gtk_widget_get_style_context (handle);
+ GdkRGBA bgRGBA = background.handleRGBA;
+ String name = GTK.GTK_VERSION >= OS.VERSION(3, 20, 0) ? "window" : "GtkWindow";
+ String css = name + " {background-color: " + display.gtk_rgba_to_css_string(bgRGBA) + ";}";
+ gtk_css_provider_load_from_css (context, css);
+ GTK.gtk_style_context_invalidate (context);
GTK.gtk_window_set_type_hint (handle, GDK.GDK_WINDOW_TYPE_HINT_TOOLTIP);
}
}
@@ -512,11 +508,7 @@ void drawTooltip (long /*int*/ cr) {
x += INSET;
int [] w = new int [1], h = new int [1];
Color foreground = display.getSystemColor (SWT.COLOR_INFO_FOREGROUND);
- if (GTK.GTK3) {
- GDK.gdk_cairo_set_source_rgba(cairo,foreground.handleRGBA);
- } else {
- GDK.gdk_cairo_set_source_color(cairo,foreground.handle);
- }
+ GDK.gdk_cairo_set_source_rgba(cairo,foreground.handleRGBA);
Cairo.cairo_move_to(cairo, x,y );
OS.pango_cairo_show_layout(cairo, layoutText);
OS.pango_layout_get_pixel_size (layoutText, w, h);
@@ -525,11 +517,7 @@ void drawTooltip (long /*int*/ cr) {
if (layoutMessage != 0) {
x = BORDER + PADDING + INSET;
Color foreground = display.getSystemColor (SWT.COLOR_INFO_FOREGROUND);
- if (GTK.GTK3) {
- GDK.gdk_cairo_set_source_rgba(cairo,foreground.handleRGBA);
- } else {
- GDK.gdk_cairo_set_source_color(cairo,foreground.handle);
- }
+ GDK.gdk_cairo_set_source_rgba(cairo,foreground.handleRGBA);
Cairo.cairo_move_to(cairo, x, y);
OS.pango_cairo_show_layout(cairo, layoutMessage);
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tracker.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tracker.java
index 6472c200d5..3d5284859f 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tracker.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tracker.java
@@ -329,96 +329,79 @@ void drawRectangles (Rectangle [] rects) {
window = gtk_widget_get_window (parent.paintHandle());
}
if (window == 0) return;
- if (GTK.GTK3) {
- if (overlay == 0) return;
- GTK.gtk_widget_shape_combine_region (overlay, 0);
- // Bug 498217.
- // As of Gtk 3.9.1, Commit a60ccd3672467efb454b121993febc36f33cbc79, off-screen GDK windows are not processed.
- // Because of this gtk doesn't send move events to SWT. Platform.UI uses an off-screen tracker to draw
- // custom rectangles for it's part-drag-preview. Drawing/updates for these broke because tracker is off screen.
- // Solution: If a tracker is to move off-screen, then instead draw it 1x1 and transparent.
- boolean isOnScreen = true;
- { // Figure out if the combined rectangles are on or off screen.
+ if (overlay == 0) return;
+ GTK.gtk_widget_shape_combine_region (overlay, 0);
- // Produce a single rectangle big enough to contain all rects.
- // Note, this is different from loop below that creates a Region. (See region != rectangle note in javadoc).
- cachedUnion.x = rects[0].x;
- cachedUnion.y = rects[0].y;
- cachedUnion.width = rects[0].width;
- cachedUnion.height = rects[0].height;
- if (rects.length > 1) {
- for (int i = 1; i < rects.length; i++) {
- cachedUnion.add(rects[i]);
- }
- }
+ // Bug 498217.
+ // As of Gtk 3.9.1, Commit a60ccd3672467efb454b121993febc36f33cbc79, off-screen GDK windows are not processed.
+ // Because of this gtk doesn't send move events to SWT. Platform.UI uses an off-screen tracker to draw
+ // custom rectangles for it's part-drag-preview. Drawing/updates for these broke because tracker is off screen.
+ // Solution: If a tracker is to move off-screen, then instead draw it 1x1 and transparent.
+ boolean isOnScreen = true;
+ { // Figure out if the combined rectangles are on or off screen.
- // Ensure we have absolute screen coordinates. (btw, there are no absolute coordinates on Wayland, so Tracker(Display) is probably broken).
- if (parent != null) { // if Tracker(Display) has absolute coords. Tracker(Composite) has relative. For relative, we need to find absolute.
- cachedUnion = display.mapInPixels(parent, null, cachedUnion) ;
+ // Produce a single rectangle big enough to contain all rects.
+ // Note, this is different from loop below that creates a Region. (See region != rectangle note in javadoc).
+ cachedUnion.x = rects[0].x;
+ cachedUnion.y = rects[0].y;
+ cachedUnion.width = rects[0].width;
+ cachedUnion.height = rects[0].height;
+ if (rects.length > 1) {
+ for (int i = 1; i < rects.length; i++) {
+ cachedUnion.add(rects[i]);
}
+ }
- if (!cachedCombinedDisplayResolution.intersects(cachedUnion)) {
- isOnScreen = false;
- }
+ // Ensure we have absolute screen coordinates. (btw, there are no absolute coordinates on Wayland, so Tracker(Display) is probably broken).
+ if (parent != null) { // if Tracker(Display) has absolute coords. Tracker(Composite) has relative. For relative, we need to find absolute.
+ cachedUnion = display.mapInPixels(parent, null, cachedUnion) ;
}
- long /*int*/ region = GDK.gdk_region_new ();
- GdkRectangle rect = new GdkRectangle();
- if (isOnScreen) {
- // Combine Rects into a region. (region is not necessarily a rectangle, E.g it can be 'L' shaped etc..).
- for (int i = 0; i < rects.length; i++) {
- // Turn filled rectangles into just the outer lines by drawing one line at a time.
- Rectangle r = parent != null ? display.mapInPixels(parent, null, rects[i]) : rects[i];
- rect.x = r.x;
- rect.y = r.y;
- rect.width = r.width + 1;
- rect.height = 1;
- GDK.gdk_region_union_with_rect(region, rect); // Top line
- rect.width = 1;
- rect.height = r.height + 1;
- GDK.gdk_region_union_with_rect(region, rect); // Left line.
- rect.x = r.x + r.width;
- GDK.gdk_region_union_with_rect(region, rect); // Right line.
- rect.x = r.x;
- rect.y = r.y + r.height;
- rect.width = r.width + 1;
- rect.height = 1;
- GDK.gdk_region_union_with_rect(region, rect); // Bottom line
- }
- setTrackerBackground(true);
- } else { // Offscreen
- // part of Bug 498217 fix. Tracker must be at least 1x1 for move events to work.
- rect.x = 0;
- rect.y = 0;
- rect.height = 1;
- rect.width = 1;
- GDK.gdk_region_union_with_rect(region, rect);
- setTrackerBackground(false);
+ if (!cachedCombinedDisplayResolution.intersects(cachedUnion)) {
+ isOnScreen = false;
}
+ }
- GTK.gtk_widget_shape_combine_region (overlay, region);
- GDK.gdk_region_destroy (region);
- long /*int*/ overlayWindow = GTK.gtk_widget_get_window (overlay);
- GDK.gdk_window_hide (overlayWindow);
- GDK.gdk_window_show (overlayWindow);
- } else { // GTK2
- long /*int*/ gc = GDK.gdk_gc_new (window);
- if (gc == 0) return;
- long /*int*/ colormap = GDK.gdk_colormap_get_system ();
- GdkColor color = new GdkColor ();
- GDK.gdk_color_white (colormap, color);
- GDK.gdk_gc_set_foreground (gc, color);
- GDK.gdk_gc_set_subwindow (gc, GDK.GDK_INCLUDE_INFERIORS);
- GDK.gdk_gc_set_function (gc, GDK.GDK_XOR);
- for (int i=0; i<rects.length; i++) {
- Rectangle rect = rects [i];
- int x = rect.x;
- if (parent != null && (parent.style & SWT.MIRRORED) != 0) x = parent.getClientWidth () - rect.width - x;
- GDK.gdk_draw_rectangle (window, gc, 0, x, rect.y, rect.width, rect.height);
+ long /*int*/ region = GDK.gdk_region_new ();
+ GdkRectangle rect = new GdkRectangle();
+ if (isOnScreen) {
+ // Combine Rects into a region. (region is not necessarily a rectangle, E.g it can be 'L' shaped etc..).
+ for (int i = 0; i < rects.length; i++) {
+ // Turn filled rectangles into just the outer lines by drawing one line at a time.
+ Rectangle r = parent != null ? display.mapInPixels(parent, null, rects[i]) : rects[i];
+ rect.x = r.x;
+ rect.y = r.y;
+ rect.width = r.width + 1;
+ rect.height = 1;
+ GDK.gdk_region_union_with_rect(region, rect); // Top line
+ rect.width = 1;
+ rect.height = r.height + 1;
+ GDK.gdk_region_union_with_rect(region, rect); // Left line.
+ rect.x = r.x + r.width;
+ GDK.gdk_region_union_with_rect(region, rect); // Right line.
+ rect.x = r.x;
+ rect.y = r.y + r.height;
+ rect.width = r.width + 1;
+ rect.height = 1;
+ GDK.gdk_region_union_with_rect(region, rect); // Bottom line
}
- OS.g_object_unref (gc);
+ setTrackerBackground(true);
+ } else { // Offscreen
+ // part of Bug 498217 fix. Tracker must be at least 1x1 for move events to work.
+ rect.x = 0;
+ rect.y = 0;
+ rect.height = 1;
+ rect.width = 1;
+ GDK.gdk_region_union_with_rect(region, rect);
+ setTrackerBackground(false);
}
+
+ GTK.gtk_widget_shape_combine_region (overlay, region);
+ GDK.gdk_region_destroy (region);
+ long /*int*/ overlayWindow = GTK.gtk_widget_get_window (overlay);
+ GDK.gdk_window_hide (overlayWindow);
+ GDK.gdk_window_show (overlayWindow);
}
/**
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java
index 1963655daf..892f04e550 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java
@@ -92,7 +92,6 @@ public class Tree extends Composite {
boolean modelChanged;
boolean expandAll;
int drawState, drawFlags;
- GdkColor drawForeground;
GdkRGBA background, foreground, drawForegroundRGBA;
boolean ownerDraw, ignoreSize, ignoreAccessibility, pixbufSizeSet, hasChildren;
int pixbufHeight, pixbufWidth;
@@ -290,26 +289,16 @@ long /*int*/ cellDataProc (long /*int*/ tree_column, long /*int*/ cell, long /*i
ptr [0] = 0;
GTK.gtk_tree_model_get (tree_model, iter, modelIndex + CELL_BACKGROUND, ptr, -1);
if (ptr [0] != 0) {
- if (GTK.GTK3) {
- OS.g_object_set (cell, OS.cell_background_rgba, ptr[0], 0);
- GDK.gdk_rgba_free(ptr [0]);
- } else {
- OS.g_object_set (cell, OS.cell_background_gdk, ptr[0], 0);
- GDK.gdk_color_free (ptr [0]);
- }
+ OS.g_object_set (cell, OS.cell_background_rgba, ptr[0], 0);
+ GDK.gdk_rgba_free(ptr [0]);
}
}
if (!isPixbuf) {
ptr [0] = 0;
GTK.gtk_tree_model_get (tree_model, iter, modelIndex + CELL_FOREGROUND, ptr, -1);
if (ptr [0] != 0) {
- if (GTK.GTK3) {
- OS.g_object_set (cell, OS.foreground_rgba, ptr [0], 0);
- GDK.gdk_rgba_free (ptr [0]);
- } else {
- OS.g_object_set (cell, OS.foreground_gdk, ptr [0], 0);
- GDK.gdk_color_free (ptr [0]);
- }
+ OS.g_object_set (cell, OS.foreground_rgba, ptr [0], 0);
+ GDK.gdk_rgba_free (ptr [0]);
}
ptr [0] = 0;
GTK.gtk_tree_model_get (tree_model, iter, modelIndex + CELL_FONT, ptr, -1);
@@ -637,14 +626,8 @@ void copyModel (long /*int*/ oldModel, int oldStart, long /*int*/ newModel, int
GTK.gtk_tree_model_get (oldModel, oldItem, j, ptr, -1);
GTK.gtk_tree_store_set (newModel, newItem, j, ptr [0], -1);
if (ptr [0] != 0) {
- if (GTK.GTK3) {
- if (types[j] == GDK.GDK_TYPE_RGBA()) {
- GDK.gdk_rgba_free(ptr[0]);
- }
- } else {
- if (types[j] == GDK.GDK_TYPE_COLOR()) {
- GDK.gdk_color_free(ptr[0]);
- }
+ if (types[j] == GDK.GDK_TYPE_RGBA()) {
+ GDK.gdk_rgba_free(ptr[0]);
}
if (types [j] == OS.G_TYPE_STRING ()) {
OS.g_free ((ptr [0]));
@@ -660,14 +643,8 @@ void copyModel (long /*int*/ oldModel, int oldStart, long /*int*/ newModel, int
GTK.gtk_tree_model_get (oldModel, oldItem, oldStart + j, ptr, -1);
GTK.gtk_tree_store_set (newModel, newItem, newIndex, ptr [0], -1);
if (ptr[0] != 0) {
- if (GTK.GTK3) {
- if (types[newIndex] == GDK.GDK_TYPE_RGBA()) {
- GDK.gdk_rgba_free(ptr[0]);
- }
- } else {
- if (types[newIndex] == GDK.GDK_TYPE_COLOR()) {
- GDK.gdk_color_free(ptr[0]);
- }
+ if (types[newIndex] == GDK.GDK_TYPE_RGBA()) {
+ GDK.gdk_rgba_free(ptr[0]);
}
if (types [newIndex] == OS.G_TYPE_STRING ()) {
OS.g_free ((ptr [0]));
@@ -1246,12 +1223,6 @@ void fixChildren (Shell newShell, Shell oldShell, Decorations newDecorations, De
}
@Override
-GdkColor getBackgroundGdkColor () {
- assert !GTK.GTK3 : "GTK2 code was run by GTK3";
- return getBaseGdkColor ();
-}
-
-@Override
Rectangle getClientAreaInPixels () {
checkWidget ();
forceResize ();
@@ -1393,15 +1364,15 @@ long /*int*/[] getColumnTypes (int columnCount) {
types [ID_COLUMN] = OS.G_TYPE_INT ();
types [CHECKED_COLUMN] = OS.G_TYPE_BOOLEAN ();
types [GRAYED_COLUMN] = OS.G_TYPE_BOOLEAN ();
- types [FOREGROUND_COLUMN] = GTK.GTK3? GDK.GDK_TYPE_RGBA() : GDK.GDK_TYPE_COLOR ();
- types [BACKGROUND_COLUMN] = GTK.GTK3? GDK.GDK_TYPE_RGBA() : GDK.GDK_TYPE_COLOR ();
+ types [FOREGROUND_COLUMN] = GDK.GDK_TYPE_RGBA();
+ types [BACKGROUND_COLUMN] = GDK.GDK_TYPE_RGBA();
types [FONT_COLUMN] = OS.PANGO_TYPE_FONT_DESCRIPTION ();
// per cell data
for (int i=FIRST_COLUMN; i<types.length; i+=CELL_TYPES) {
types [i + CELL_PIXBUF] = GDK.GDK_TYPE_PIXBUF ();
types [i + CELL_TEXT] = OS.G_TYPE_STRING ();
- types [i + CELL_FOREGROUND] = GTK.GTK3? GDK.GDK_TYPE_RGBA() : GDK.GDK_TYPE_COLOR ();
- types [i + CELL_BACKGROUND] = GTK.GTK3? GDK.GDK_TYPE_RGBA() : GDK.GDK_TYPE_COLOR ();
+ types [i + CELL_FOREGROUND] = GDK.GDK_TYPE_RGBA();
+ types [i + CELL_BACKGROUND] = GDK.GDK_TYPE_RGBA();
types [i + CELL_FONT] = OS.PANGO_TYPE_FONT_DESCRIPTION ();
}
return types;
@@ -1484,12 +1455,6 @@ TreeItem getFocusItem () {
return item;
}
-@Override
-GdkColor getForegroundGdkColor () {
- assert !GTK.GTK3 : "GTK2 code was run by GTK3";
- return getTextColor ();
-}
-
/**
* Returns the width in pixels of a grid line.
*
@@ -3044,11 +3009,7 @@ void rendererRender (long /*int*/ cell, long /*int*/ cr, long /*int*/ window, lo
}
if (ptr [0] != 0) {
drawState |= SWT.BACKGROUND;
- if (GTK.GTK3) {
- GDK.gdk_rgba_free (ptr [0]);
- } else {
- GDK.gdk_color_free (ptr [0]);
- }
+ GDK.gdk_rgba_free (ptr [0]);
}
if ((flags & GTK.GTK_CELL_RENDERER_SELECTED) != 0) drawState |= SWT.SELECTED;
if (!GTK.GTK3 || (flags & GTK.GTK_CELL_RENDERER_SELECTED) == 0) {
@@ -3138,11 +3099,7 @@ void rendererRender (long /*int*/ cell, long /*int*/ cr, long /*int*/ window, lo
event.setBounds (DPIUtil.autoScaleDown (eventRect));
event.detail = drawState;
sendEvent (SWT.EraseItem, event);
- if (GTK.GTK3) {
- drawForegroundRGBA = null;
- } else {
- drawForeground = null;
- }
+ drawForegroundRGBA = null;
drawState = event.doit ? event.detail : 0;
drawFlags &= ~(GTK.GTK_CELL_RENDERER_FOCUSED | GTK.GTK_CELL_RENDERER_SELECTED);
if ((drawState & SWT.SELECTED) != 0) drawFlags |= GTK.GTK_CELL_RENDERER_SELECTED;
@@ -3156,11 +3113,7 @@ void rendererRender (long /*int*/ cell, long /*int*/ cr, long /*int*/ window, lo
}
} else {
if (wasSelected) {
- if (GTK.GTK3) {
- drawForegroundRGBA = gc.getForeground ().handleRGBA;
- } else {
- drawForeground = gc.getForeground ().handle;
- }
+ drawForegroundRGBA = gc.getForeground ().handleRGBA;
}
}
gc.dispose();
@@ -3180,9 +3133,7 @@ void rendererRender (long /*int*/ cell, long /*int*/ cr, long /*int*/ window, lo
long /*int*/ g_class = OS.g_type_class_peek_parent (OS.G_OBJECT_GET_CLASS (cell));
GtkCellRendererClass klass = new GtkCellRendererClass ();
OS.memmove (klass, g_class);
- if (drawForeground != null && GTK.GTK_IS_CELL_RENDERER_TEXT (cell) && !GTK.GTK3) {
- OS.g_object_set (cell, OS.foreground_gdk, drawForeground, 0);
- } else if (drawForegroundRGBA != null && GTK.GTK_IS_CELL_RENDERER_TEXT (cell) && GTK.GTK3) {
+ if (drawForegroundRGBA != null && GTK.GTK_IS_CELL_RENDERER_TEXT (cell) && GTK.GTK3) {
OS.g_object_set (cell, OS.foreground_rgba, drawForegroundRGBA, 0);
}
if (GTK.GTK3) {
@@ -3242,28 +3193,14 @@ void rendererRender (long /*int*/ cell, long /*int*/ cr, long /*int*/ window, lo
GC gc = getGC(cr);
if ((drawState & SWT.SELECTED) != 0) {
Color background, foreground;
- if (GTK.gtk_widget_has_focus (handle) || GTK.GTK3) {
- background = display.getSystemColor (SWT.COLOR_LIST_SELECTION);
- foreground = display.getSystemColor (SWT.COLOR_LIST_SELECTION_TEXT);
- } else {
- /*
- * Feature in GTK. When the widget doesn't have focus, then
- * gtk_paint_flat_box () changes the background color state_type
- * to GTK_STATE_ACTIVE. The fix is to use the same values in the GC.
- */
- background = Color.gtk_new (display, display.COLOR_LIST_SELECTION_INACTIVE);
- foreground = Color.gtk_new (display, display.COLOR_LIST_SELECTION_TEXT_INACTIVE);
- }
+ background = display.getSystemColor (SWT.COLOR_LIST_SELECTION);
+ foreground = display.getSystemColor (SWT.COLOR_LIST_SELECTION_TEXT);
gc.setBackground (background);
gc.setForeground (foreground);
} else {
gc.setBackground (item.getBackground (columnIndex));
Color foreground;
- if (GTK.GTK3) {
- foreground = drawForegroundRGBA != null ? Color.gtk_new (display, drawForegroundRGBA) : item.getForeground (columnIndex);
- } else {
- foreground = drawForeground != null ? Color.gtk_new (display, drawForeground) : item.getForeground (columnIndex);
- }
+ foreground = drawForegroundRGBA != null ? Color.gtk_new (display, drawForegroundRGBA) : item.getForeground (columnIndex);
gc.setForeground (foreground);
}
gc.setFont (item.getFont (columnIndex));
@@ -3472,13 +3409,6 @@ public void selectAll () {
}
@Override
-void setBackgroundGdkColor (GdkColor color) {
- assert !GTK.GTK3 : "GTK2 code was run by GTK3";
- super.setBackgroundGdkColor (color);
- GTK.gtk_widget_modify_base (handle, 0, color);
-}
-
-@Override
void setBackgroundGdkRGBA (long /*int*/ context, long /*int*/ handle, GdkRGBA rgba) {
assert GTK.GTK3 : "GTK3 code was run by GTK2";
/* Setting the background color overrides the selected background color.
@@ -3602,12 +3532,6 @@ void setForegroundGdkRGBA (GdkRGBA rgba) {
}
}
-@Override
-void setForegroundGdkColor (GdkColor color) {
- assert !GTK.GTK3 : "GTK2 code was run by GTK3";
- setForegroundColor (handle, color, false);
-}
-
/**
* Sets the header background color to the color specified
* by the argument, or to the default system color if the argument is null.
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java
index cdd5fadc09..6fdb654e96 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java
@@ -220,17 +220,10 @@ Color _getBackground () {
long /*int*/ [] ptr = new long /*int*/ [1];
GTK.gtk_tree_model_get (parent.modelHandle, handle, Tree.BACKGROUND_COLUMN, ptr, -1);
if (ptr [0] == 0) return parent.getBackground ();
- if (GTK.GTK3) {
- GdkRGBA gdkRGBA = new GdkRGBA ();
- OS.memmove(gdkRGBA, ptr [0], GdkRGBA.sizeof);
- GDK.gdk_rgba_free (ptr [0]);
- return Color.gtk_new(display, gdkRGBA);
- } else {
- GdkColor gdkColor = new GdkColor ();
- OS.memmove (gdkColor, ptr [0], GdkColor.sizeof);
- GDK.gdk_color_free (ptr [0]);
- return Color.gtk_new (display, gdkColor);
- }
+ GdkRGBA gdkRGBA = new GdkRGBA ();
+ OS.memmove(gdkRGBA, ptr [0], GdkRGBA.sizeof);
+ GDK.gdk_rgba_free (ptr [0]);
+ return Color.gtk_new(display, gdkRGBA);
}
Color _getBackground (int index) {
@@ -240,17 +233,10 @@ Color _getBackground (int index) {
int modelIndex = parent.columnCount == 0 ? Tree.FIRST_COLUMN : parent.columns [index].modelIndex;
GTK.gtk_tree_model_get (parent.modelHandle, handle, modelIndex + Tree.CELL_BACKGROUND, ptr, -1);
if (ptr [0] == 0) return _getBackground ();
- if (GTK.GTK3) {
- GdkRGBA gdkRGBA = new GdkRGBA ();
- OS.memmove(gdkRGBA, ptr [0], GdkRGBA.sizeof);
- GDK.gdk_rgba_free (ptr [0]);
- return Color.gtk_new(display, gdkRGBA);
- } else {
- GdkColor gdkColor = new GdkColor ();
- OS.memmove (gdkColor, ptr [0], GdkColor.sizeof);
- GDK.gdk_color_free (ptr [0]);
- return Color.gtk_new (display, gdkColor);
- }
+ GdkRGBA gdkRGBA = new GdkRGBA ();
+ OS.memmove(gdkRGBA, ptr [0], GdkRGBA.sizeof);
+ GDK.gdk_rgba_free (ptr [0]);
+ return Color.gtk_new(display, gdkRGBA);
}
boolean _getChecked () {
@@ -263,17 +249,10 @@ Color _getForeground () {
long /*int*/ [] ptr = new long /*int*/ [1];
GTK.gtk_tree_model_get (parent.modelHandle, handle, Tree.FOREGROUND_COLUMN, ptr, -1);
if (ptr [0] == 0) return parent.getForeground ();
- if (GTK.GTK3) {
- GdkRGBA gdkRGBA = new GdkRGBA ();
- OS.memmove(gdkRGBA, ptr [0], GdkRGBA.sizeof);
- GDK.gdk_rgba_free (ptr [0]);
- return Color.gtk_new(display, gdkRGBA);
- } else {
- GdkColor gdkColor = new GdkColor ();
- OS.memmove (gdkColor, ptr [0], GdkColor.sizeof);
- GDK.gdk_color_free (ptr [0]);
- return Color.gtk_new (display, gdkColor);
- }
+ GdkRGBA gdkRGBA = new GdkRGBA ();
+ OS.memmove(gdkRGBA, ptr [0], GdkRGBA.sizeof);
+ GDK.gdk_rgba_free (ptr [0]);
+ return Color.gtk_new(display, gdkRGBA);
}
Color _getForeground (int index) {
@@ -283,17 +262,10 @@ Color _getForeground (int index) {
int modelIndex = parent.columnCount == 0 ? Tree.FIRST_COLUMN : parent.columns [index].modelIndex;
GTK.gtk_tree_model_get (parent.modelHandle, handle, modelIndex + Tree.CELL_FOREGROUND, ptr, -1);
if (ptr [0] == 0) return _getForeground ();
- if (GTK.GTK3) {
- GdkRGBA gdkRGBA = new GdkRGBA ();
- OS.memmove(gdkRGBA, ptr [0], GdkRGBA.sizeof);
- GDK.gdk_rgba_free (ptr [0]);
- return Color.gtk_new(display, gdkRGBA);
- } else {
- GdkColor gdkColor = new GdkColor ();
- OS.memmove (gdkColor, ptr [0], GdkColor.sizeof);
- GDK.gdk_color_free (ptr [0]);
- return Color.gtk_new (display, gdkColor);
- }
+ GdkRGBA gdkRGBA = new GdkRGBA ();
+ OS.memmove(gdkRGBA, ptr [0], GdkRGBA.sizeof);
+ GDK.gdk_rgba_free (ptr [0]);
+ return Color.gtk_new(display, gdkRGBA);
}
Image _getImage (int index) {
@@ -1177,13 +1149,8 @@ public void setBackground (Color color) {
error (SWT.ERROR_INVALID_ARGUMENT);
}
if (_getBackground ().equals (color)) return;
- if (GTK.GTK3) {
- GdkRGBA gdkRGBA = color != null ? color.handleRGBA : null;
- GTK.gtk_tree_store_set (parent.modelHandle, handle, Tree.BACKGROUND_COLUMN, gdkRGBA, -1);
- } else {
- GdkColor gdkColor = color != null ? color.handle : null;
- GTK.gtk_tree_store_set (parent.modelHandle, handle, Tree.BACKGROUND_COLUMN, gdkColor, -1);
- }
+ GdkRGBA gdkRGBA = color != null ? color.handleRGBA : null;
+ GTK.gtk_tree_store_set (parent.modelHandle, handle, Tree.BACKGROUND_COLUMN, gdkRGBA, -1);
cached = true;
}
@@ -1215,13 +1182,8 @@ public void setBackground (int index, Color color) {
int count = Math.max (1, parent.getColumnCount ());
if (0 > index || index > count - 1) return;
int modelIndex = parent.columnCount == 0 ? Tree.FIRST_COLUMN : parent.columns [index].modelIndex;
- if (GTK.GTK3) {
- GdkRGBA gdkRGBA = color != null ? color.handleRGBA : null;
- GTK.gtk_tree_store_set (parent.modelHandle, handle, modelIndex + Tree.CELL_BACKGROUND, gdkRGBA, -1);
- } else {
- GdkColor gdkColor = color != null ? color.handle : null;
- GTK.gtk_tree_store_set (parent.modelHandle, handle, modelIndex + Tree.CELL_BACKGROUND, gdkColor, -1);
- }
+ GdkRGBA gdkRGBA = color != null ? color.handleRGBA : null;
+ GTK.gtk_tree_store_set (parent.modelHandle, handle, modelIndex + Tree.CELL_BACKGROUND, gdkRGBA, -1);
cached = true;
updated = true;
@@ -1428,13 +1390,8 @@ public void setForeground (Color color){
error (SWT.ERROR_INVALID_ARGUMENT);
}
if (_getForeground ().equals (color)) return;
- if (GTK.GTK3) {
- GdkRGBA gdkRGBA = color != null ? color.handleRGBA : null;
- GTK.gtk_tree_store_set (parent.modelHandle, handle, Tree.FOREGROUND_COLUMN, gdkRGBA, -1);
- } else {
- GdkColor gdkColor = color != null ? color.handle : null;
- GTK.gtk_tree_store_set (parent.modelHandle, handle, Tree.FOREGROUND_COLUMN, gdkColor, -1);
- }
+ GdkRGBA gdkRGBA = color != null ? color.handleRGBA : null;
+ GTK.gtk_tree_store_set (parent.modelHandle, handle, Tree.FOREGROUND_COLUMN, gdkRGBA, -1);
cached = true;
}
@@ -1466,13 +1423,8 @@ public void setForeground (int index, Color color){
int count = Math.max (1, parent.getColumnCount ());
if (0 > index || index > count - 1) return;
int modelIndex = parent.columnCount == 0 ? Tree.FIRST_COLUMN : parent.columns [index].modelIndex;
- if (GTK.GTK3) {
- GdkRGBA gdkRGBA = color != null ? color.handleRGBA : null;
- GTK.gtk_tree_store_set (parent.modelHandle, handle, modelIndex + Tree.CELL_FOREGROUND, gdkRGBA, -1);
- } else {
- GdkColor gdkColor = color != null ? color.handle : null;
- GTK.gtk_tree_store_set (parent.modelHandle, handle, modelIndex + Tree.CELL_FOREGROUND, gdkColor, -1);
- }
+ GdkRGBA gdkRGBA = color != null ? color.handleRGBA : null;
+ GTK.gtk_tree_store_set (parent.modelHandle, handle, modelIndex + Tree.CELL_FOREGROUND, gdkRGBA, -1);
cached = true;
updated = true;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java
index 11946f58c6..4a3cf89e95 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java
@@ -1646,53 +1646,6 @@ void setFontDescription (long /*int*/ widget, long /*int*/ font) {
}
}
-void setForegroundColor (long /*int*/ handle, GdkColor color) {
- assert !GTK.GTK3 : "GTK2 code was run by GTK3";
- setForegroundColor (handle, color, true);
-}
-
-void setForegroundColor (long /*int*/ handle, GdkColor color, boolean setStateActive) {
- assert !GTK.GTK3 : "GTK2 code was run by GTK3";
- /*
- * Feature in GTK. When the widget doesn't have focus, then
- * gtk_default_draw_flat_box () changes the background color state_type
- * to GTK_STATE_ACTIVE. Widgets whose background is drawn using
- * gtk_paint_flat_box or gtk_default_draw_flat_box have to pass false for
- * setStateActive.
- */
- long /*int*/ style = GTK.gtk_widget_get_modifier_style (handle);
- GTK.gtk_rc_style_set_fg (style, GTK.GTK_STATE_NORMAL, color);
- if (setStateActive) GTK.gtk_rc_style_set_fg (style, GTK.GTK_STATE_ACTIVE, color);
- GTK.gtk_rc_style_set_fg (style, GTK.GTK_STATE_PRELIGHT, color);
- int flags = GTK.gtk_rc_style_get_color_flags (style, GTK.GTK_STATE_NORMAL);
- flags = (color == null) ? flags & ~GTK.GTK_RC_FG: flags | GTK.GTK_RC_FG;
- GTK.gtk_rc_style_set_color_flags (style, GTK.GTK_STATE_NORMAL, flags);
- if (setStateActive) {
- flags = GTK.gtk_rc_style_get_color_flags (style, GTK.GTK_STATE_ACTIVE);
- flags = (color == null) ? flags & ~GTK.GTK_RC_FG: flags | GTK.GTK_RC_FG;
- GTK.gtk_rc_style_set_color_flags (style, GTK.GTK_STATE_ACTIVE, flags);
- }
- flags = GTK.gtk_rc_style_get_color_flags (style, GTK.GTK_STATE_PRELIGHT);
- flags = (color == null) ? flags & ~GTK.GTK_RC_FG: flags | GTK.GTK_RC_FG;
- GTK.gtk_rc_style_set_color_flags (style, GTK.GTK_STATE_PRELIGHT, flags);
-
- GTK.gtk_rc_style_set_text (style, GTK.GTK_STATE_NORMAL, color);
- if (setStateActive) GTK.gtk_rc_style_set_text (style, GTK.GTK_STATE_ACTIVE, color);
- GTK.gtk_rc_style_set_text (style, GTK.GTK_STATE_PRELIGHT, color);
- flags = GTK.gtk_rc_style_get_color_flags (style, GTK.GTK_STATE_NORMAL);
- flags = (color == null) ? flags & ~GTK.GTK_RC_TEXT: flags | GTK.GTK_RC_TEXT;
- GTK.gtk_rc_style_set_color_flags (style, GTK.GTK_STATE_NORMAL, flags);
- flags = GTK.gtk_rc_style_get_color_flags (style, GTK.GTK_STATE_PRELIGHT);
- flags = (color == null) ? flags & ~GTK.GTK_RC_TEXT: flags | GTK.GTK_RC_TEXT;
- GTK.gtk_rc_style_set_color_flags (style, GTK.GTK_STATE_PRELIGHT, flags);
- if (setStateActive) {
- flags = GTK.gtk_rc_style_get_color_flags (style, GTK.GTK_STATE_ACTIVE);
- flags = (color == null) ? flags & ~GTK.GTK_RC_TEXT: flags | GTK.GTK_RC_TEXT;
- GTK.gtk_rc_style_set_color_flags (style, GTK.GTK_STATE_ACTIVE, flags);
- }
- modifyStyle (handle, style);
-}
-
boolean setInputState (Event event, int state) {
if ((state & GDK.GDK_MOD1_MASK) != 0) event.stateMask |= SWT.ALT;
if ((state & GDK.GDK_SHIFT_MASK) != 0) event.stateMask |= SWT.SHIFT;

Back to the top