diff options
author | Alexander Kurtakov | 2012-02-28 15:23:56 +0000 |
---|---|---|
committer | Carolyn MacLeod | 2012-03-06 21:46:51 +0000 |
commit | e48fdc7814a30e28e57b66aebebdc3a46aff9d16 (patch) | |
tree | 6bc53b2b7c8d767e48a238a6a34883aca5a3025a | |
parent | 3e7bf9b4f7e21c414e755e2540901a82433d3f8d (diff) | |
download | eclipse.platform.swt-e48fdc7814a30e28e57b66aebebdc3a46aff9d16.tar.gz eclipse.platform.swt-e48fdc7814a30e28e57b66aebebdc3a46aff9d16.tar.xz eclipse.platform.swt-e48fdc7814a30e28e57b66aebebdc3a46aff9d16.zip |
Use gdk_get_default_root_window instead of GDK_ROOT_PARENT.
The new function used is in GTK at least from version 2.0 and the macro
is deprecated and removed from GTK 3. All usages are fixed.
12 files changed, 39 insertions, 39 deletions
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 dc77be2cf6..2be0bf65ab 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 @@ -118,9 +118,9 @@ public class TableDragSourceEffect extends DragSourceEffect { hh[i] = h[0]; OS.gtk_tree_path_free (path); } - int /*long*/ source = OS.gdk_pixmap_new(OS.GDK_ROOT_PARENT(), width, height, -1); + int /*long*/ source = OS.gdk_pixmap_new(OS.gdk_get_default_root_window(), width, height, -1); int /*long*/ gcSource = OS.gdk_gc_new(source); - int /*long*/ mask = OS.gdk_pixmap_new(OS.GDK_ROOT_PARENT(), width, height, 1); + int /*long*/ mask = OS.gdk_pixmap_new(OS.gdk_get_default_root_window(), width, height, 1); int /*long*/ gcMask = OS.gdk_gc_new(mask); GdkColor color = new GdkColor(); color.pixel = 0; 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 586fb56338..a62d74eceb 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 @@ -117,9 +117,9 @@ public class TreeDragSourceEffect extends DragSourceEffect { hh[i] = h[0]; OS.gtk_tree_path_free (path); } - int /*long*/ source = OS.gdk_pixmap_new(OS.GDK_ROOT_PARENT(), width, height, -1); + int /*long*/ source = OS.gdk_pixmap_new(OS.gdk_get_default_root_window(), width, height, -1); int /*long*/ gcSource = OS.gdk_gc_new(source); - int /*long*/ mask = OS.gdk_pixmap_new(OS.GDK_ROOT_PARENT(), width, height, 1); + int /*long*/ mask = OS.gdk_pixmap_new(OS.gdk_get_default_root_window(), width, height, 1); int /*long*/ gcMask = OS.gdk_gc_new(mask); GdkColor color = new GdkColor(); color.pixel = 0; 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 86bcbd877c..c6e8818fb8 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 @@ -1311,18 +1311,6 @@ JNIEXPORT jintLong JNICALL OS_NATIVE(_1GDK_1PIXMAP_1XID) } #endif -#ifndef NO__1GDK_1ROOT_1PARENT -JNIEXPORT jintLong JNICALL OS_NATIVE(_1GDK_1ROOT_1PARENT) - (JNIEnv *env, jclass that) -{ - jintLong rc = 0; - OS_NATIVE_ENTER(env, that, _1GDK_1ROOT_1PARENT_FUNC); - rc = (jintLong)GDK_ROOT_PARENT(); - OS_NATIVE_EXIT(env, that, _1GDK_1ROOT_1PARENT_FUNC); - return rc; -} -#endif - #ifndef NO__1GDK_1TYPE_1COLOR JNIEXPORT jintLong JNICALL OS_NATIVE(_1GDK_1TYPE_1COLOR) (JNIEnv *env, jclass that) @@ -5854,6 +5842,18 @@ fail: } #endif +#ifndef NO__1gdk_1get_1default_1root_1window +JNIEXPORT jintLong JNICALL OS_NATIVE(_1gdk_1get_1default_1root_1window) + (JNIEnv *env, jclass that) +{ + jintLong rc = 0; + OS_NATIVE_ENTER(env, that, _1gdk_1get_1default_1root_1window_FUNC); + rc = (jintLong)gdk_get_default_root_window(); + OS_NATIVE_EXIT(env, that, _1gdk_1get_1default_1root_1window_FUNC); + return rc; +} +#endif + #ifndef NO__1gdk_1keyboard_1ungrab JNIEXPORT void JNICALL OS_NATIVE(_1gdk_1keyboard_1ungrab) (JNIEnv *env, jclass that, jint arg0) 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 a4566ed671..208bb19152 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 @@ -136,7 +136,6 @@ char * OS_nativeFunctionNames[] = { "_1Call", "_1FcConfigAppFontAddFile", "_1GDK_1PIXMAP_1XID", - "_1GDK_1ROOT_1PARENT", "_1GDK_1TYPE_1COLOR", "_1GDK_1TYPE_1PIXBUF", "_1GString_1len", @@ -491,6 +490,7 @@ char * OS_nativeFunctionNames[] = { "_1gdk_1gc_1set_1tile", "_1gdk_1gc_1set_1ts_1origin", "_1gdk_1gc_1set_1values", + "_1gdk_1get_1default_1root_1window", "_1gdk_1keyboard_1ungrab", "_1gdk_1keymap_1get_1default", "_1gdk_1keymap_1translate_1keyboard_1state", 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 2984b14a2e..050c8fb9e4 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 @@ -144,7 +144,6 @@ typedef enum { _1Call_FUNC, _1FcConfigAppFontAddFile_FUNC, _1GDK_1PIXMAP_1XID_FUNC, - _1GDK_1ROOT_1PARENT_FUNC, _1GDK_1TYPE_1COLOR_FUNC, _1GDK_1TYPE_1PIXBUF_FUNC, _1GString_1len_FUNC, @@ -499,6 +498,7 @@ typedef enum { _1gdk_1gc_1set_1tile_FUNC, _1gdk_1gc_1set_1ts_1origin_FUNC, _1gdk_1gc_1set_1values_FUNC, + _1gdk_1get_1default_1root_1window_FUNC, _1gdk_1keyboard_1ungrab_FUNC, _1gdk_1keymap_1get_1default_FUNC, _1gdk_1keymap_1translate_1keyboard_1state_FUNC, 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 dc8a57b531..a04247b179 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 @@ -1470,15 +1470,6 @@ public static final native int /*long*/ pangoLayoutNewProc_CALLBACK(int /*long*/ /** Natives */ public static final native int Call (int /*long*/ func, int /*long*/ arg0, int arg1, int arg2); public static final native long Call (int /*long*/ func, int /*long*/ arg0, int arg1, long arg2); -public static final native int /*long*/ _GDK_ROOT_PARENT(); -public static final int /*long*/ GDK_ROOT_PARENT() { - lock.lock(); - try { - return _GDK_ROOT_PARENT(); - } finally { - lock.unlock(); - } -} /** @method flags=const */ public static final native int /*long*/ _GDK_TYPE_COLOR(); public static final int /*long*/ GDK_TYPE_COLOR() { @@ -4475,6 +4466,15 @@ public static final void gdk_gc_set_values(int /*long*/ gc, GdkGCValues values, lock.unlock(); } } +public static final native int /*long*/ _gdk_get_default_root_window(); +public static final int /*long*/ gdk_get_default_root_window() { + lock.lock(); + try { + return _gdk_get_default_root_window(); + } finally { + lock.unlock(); + } +} public static final native void _gdk_keyboard_ungrab(int time); public static final void gdk_keyboard_ungrab(int time) { lock.lock(); 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 73f04041d4..c0db7a8895 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 @@ -440,7 +440,7 @@ public int /*long*/ internal_new_GC(GCData data) { } else { GdkVisual visual = new GdkVisual (); OS.memmove (visual, OS.gdk_visual_get_system()); - drawable = OS.gdk_pixmap_new(OS.GDK_ROOT_PARENT(), 1, 1, visual.depth); + drawable = OS.gdk_pixmap_new(OS.gdk_get_default_root_window(), 1, 1, visual.depth); gc = OS.gdk_gc_new (drawable); } if (gc == 0) SWT.error (SWT.ERROR_NO_HANDLES); 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 03178173e3..94c88d6974 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 @@ -1744,7 +1744,7 @@ public void drawText (String string, int x, int y, int flags) { if (data.stringWidth == -1) { computeStringSize(); } - int /*long*/ pixmap = OS.gdk_pixmap_new(OS.GDK_ROOT_PARENT(), data.stringWidth, data.stringHeight, -1); + int /*long*/ pixmap = OS.gdk_pixmap_new(OS.gdk_get_default_root_window(), data.stringWidth, data.stringHeight, -1); if (pixmap == 0) SWT.error(SWT.ERROR_NO_HANDLES); int /*long*/ gdkGC = OS.gdk_gc_new(pixmap); if (gdkGC == 0) SWT.error(SWT.ERROR_NO_HANDLES); 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 5c75e0c24f..271ef96305 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 @@ -392,7 +392,7 @@ public Image(Device device, Image srcImage, int flag) { createAlphaMask(width, height); /* Create the new pixmap */ - int /*long*/ pixmap = OS.gdk_pixmap_new (OS.GDK_ROOT_PARENT(), width, height, -1); + int /*long*/ pixmap = OS.gdk_pixmap_new (OS.gdk_get_default_root_window(), width, height, -1); if (pixmap == 0) SWT.error(SWT.ERROR_NO_HANDLES); int /*long*/ gdkGC = OS.gdk_gc_new(pixmap); if (gdkGC == 0) SWT.error(SWT.ERROR_NO_HANDLES); @@ -1271,10 +1271,10 @@ void init(int width, int height) { /* Create the pixmap */ if (OS.USE_CAIRO) { if (OS.GTK_VERSION >= OS.VERSION(2, 22, 0)) { - surface = OS.gdk_window_create_similar_surface(OS.GDK_ROOT_PARENT(), Cairo.CAIRO_CONTENT_COLOR, width, height); + surface = OS.gdk_window_create_similar_surface(OS.gdk_get_default_root_window(), Cairo.CAIRO_CONTENT_COLOR, width, height); } else { int /*long*/ xDisplay = OS.gdk_x11_display_get_xdisplay(OS.gdk_display_get_default()); - int /*long*/ xDrawable = OS.gdk_x11_drawable_get_xid(OS.GDK_ROOT_PARENT()); + int /*long*/ xDrawable = OS.gdk_x11_drawable_get_xid(OS.gdk_get_default_root_window()); int /*long*/ xVisual = OS.gdk_x11_visual_get_xvisual(OS.gdk_visual_get_system()); int /*long*/ rootSurface = Cairo.cairo_xlib_surface_create(xDisplay, xDrawable, xVisual, 1, 1); if (rootSurface == 0) SWT.error(SWT.ERROR_NO_HANDLES); @@ -1292,7 +1292,7 @@ void init(int width, int height) { this.height = height; return; } - this.pixmap = OS.gdk_pixmap_new(OS.GDK_ROOT_PARENT(), width, height, -1); + this.pixmap = OS.gdk_pixmap_new(OS.gdk_get_default_root_window(), width, height, -1); if (pixmap == 0) SWT.error(SWT.ERROR_NO_HANDLES); /* Fill the bitmap with white */ GdkColor white = new GdkColor(); @@ -1481,7 +1481,7 @@ void init(ImageData image) { } } OS.memmove(data, buffer, stride * height); - int /*long*/ pixmap = OS.gdk_pixmap_new (OS.GDK_ROOT_PARENT(), width, height, -1); + int /*long*/ pixmap = OS.gdk_pixmap_new (OS.gdk_get_default_root_window(), width, height, -1); if (pixmap == 0) SWT.error(SWT.ERROR_NO_HANDLES); int /*long*/ gdkGC = OS.gdk_gc_new(pixmap); if (gdkGC == 0) SWT.error(SWT.ERROR_NO_HANDLES); 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 ea04d0d442..14d20d03d2 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 @@ -390,7 +390,7 @@ public boolean print (GC gc) { GCData data = gc.getGCData (); OS.gdk_window_process_updates (window, true); int /*long*/ drawable = data.drawable; - if (drawable == 0) drawable = OS.GDK_ROOT_PARENT(); + if (drawable == 0) drawable = OS.gdk_get_default_root_window(); printWidget (gc, drawable, OS.gdk_drawable_get_depth (drawable), 0, 0); return true; } 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 9e30ebe5f0..f53ab7a218 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 @@ -1818,7 +1818,7 @@ Rectangle getWorkArea() { int[] actualFormat = new int[1]; int[] actualLength = new int[1]; int /*long*/[] data = new int /*long*/[1]; - if (!OS.gdk_property_get (OS.GDK_ROOT_PARENT (), atom, OS.GDK_NONE, 0, 16, 0, actualType, actualFormat, actualLength, data)) { + if (!OS.gdk_property_get (OS.gdk_get_default_root_window(), atom, OS.GDK_NONE, 0, 16, 0, actualType, actualFormat, actualLength, data)) { return null; } Rectangle result = null; @@ -2685,7 +2685,7 @@ public void internal_dispose_GC (int /*long*/ gc, GCData data) { */ public int /*long*/ internal_new_GC (GCData data) { if (isDisposed()) SWT.error(SWT.ERROR_DEVICE_DISPOSED); - int /*long*/ root = OS.GDK_ROOT_PARENT (); + int /*long*/ root = OS.gdk_get_default_root_window(); int /*long*/ gc; if (OS.USE_CAIRO) { gc = OS.gdk_cairo_create (root); 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 a67dc3ece1..0453d397da 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 @@ -306,7 +306,7 @@ Rectangle [] computeProportions (Rectangle [] rects) { } void drawRectangles (Rectangle [] rects) { - int /*long*/ window = OS.GDK_ROOT_PARENT (); + int /*long*/ window = OS.gdk_get_default_root_window(); if (parent != null) { window = OS.GTK_WIDGET_WINDOW (parent.paintHandle()); } @@ -662,7 +662,7 @@ void moveRectangles (int xChange, int yChange) { */ public boolean open () { checkWidget(); - window = OS.GDK_ROOT_PARENT (); + window = OS.gdk_get_default_root_window(); if (parent != null) { window = OS.GTK_WIDGET_WINDOW (parent.paintHandle()); } |