diff options
10 files changed, 0 insertions, 226 deletions
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 b967288d9c..a9d566c31d 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 @@ -855,26 +855,6 @@ JNIEXPORT jint JNICALL GDK_NATIVE(_1gdk_1drawable_1get_1depth) } #endif -#ifndef NO__1gdk_1drawable_1get_1image -JNIEXPORT jintLong JNICALL GDK_NATIVE(_1gdk_1drawable_1get_1image) - (JNIEnv *env, jclass that, jintLong arg0, jint arg1, jint arg2, jint arg3, jint arg4) -{ - jintLong rc = 0; - GDK_NATIVE_ENTER(env, that, _1gdk_1drawable_1get_1image_FUNC); -/* - rc = (jintLong)gdk_drawable_get_image(arg0, (gint)arg1, (gint)arg2, (gint)arg3, (gint)arg4); -*/ - { - GDK_LOAD_FUNCTION(fp, gdk_drawable_get_image) - if (fp) { - rc = (jintLong)((jintLong (CALLING_CONVENTION*)(jintLong, gint, gint, gint, gint))fp)(arg0, (gint)arg1, (gint)arg2, (gint)arg3, (gint)arg4); - } - } - GDK_NATIVE_EXIT(env, that, _1gdk_1drawable_1get_1image_FUNC); - return rc; -} -#endif - #ifndef NO__1gdk_1event_1copy JNIEXPORT jintLong JNICALL GDK_NATIVE(_1gdk_1event_1copy) (JNIEnv *env, jclass that, jintLong arg0) @@ -18012,27 +17992,6 @@ fail: } #endif -#if (!defined(NO_memmove__Lorg_eclipse_swt_internal_gtk_GdkImage_2I) && !defined(JNI64)) || (!defined(NO_memmove__Lorg_eclipse_swt_internal_gtk_GdkImage_2J) && defined(JNI64)) -#ifndef JNI64 -JNIEXPORT void JNICALL OS_NATIVE(memmove__Lorg_eclipse_swt_internal_gtk_GdkImage_2I)(JNIEnv *env, jclass that, jobject arg0, jintLong arg1) -#else -JNIEXPORT void JNICALL OS_NATIVE(memmove__Lorg_eclipse_swt_internal_gtk_GdkImage_2J)(JNIEnv *env, jclass that, jobject arg0, jintLong arg1) -#endif -{ -#ifndef JNI64 - OS_NATIVE_ENTER(env, that, memmove__Lorg_eclipse_swt_internal_gtk_GdkImage_2I_FUNC); -#else - OS_NATIVE_ENTER(env, that, memmove__Lorg_eclipse_swt_internal_gtk_GdkImage_2J_FUNC); -#endif - if (arg0) setGdkImageFields(env, arg0, (GdkImage *)arg1); -#ifndef JNI64 - OS_NATIVE_EXIT(env, that, memmove__Lorg_eclipse_swt_internal_gtk_GdkImage_2I_FUNC); -#else - OS_NATIVE_EXIT(env, that, memmove__Lorg_eclipse_swt_internal_gtk_GdkImage_2J_FUNC); -#endif -} -#endif - #if (!defined(NO_memmove__Lorg_eclipse_swt_internal_gtk_GdkKeymapKey_2II) && !defined(JNI64)) || (!defined(NO_memmove__Lorg_eclipse_swt_internal_gtk_GdkKeymapKey_2JJ) && defined(JNI64)) #ifndef JNI64 JNIEXPORT void JNICALL OS_NATIVE(memmove__Lorg_eclipse_swt_internal_gtk_GdkKeymapKey_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 bef9ef9712..7d06f1faa8 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 @@ -159,7 +159,6 @@ X#define NO__1XWarpPointer #endif // TODO: the following are still called in code even on GTK3. -#define NO_GdkImage #define NO_GTK_1ENTRY_1IM_1CONTEXT #define NO_GTK_1TEXTVIEW_1IM_1CONTEXT 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 9891521339..554ee0f27b 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 @@ -74,7 +74,6 @@ char * GDK_nativeFunctionNames[] = { "_1gdk_1drag_1context_1list_1targets", "_1gdk_1drag_1status", "_1gdk_1drawable_1get_1depth", - "_1gdk_1drawable_1get_1image", "_1gdk_1event_1copy", "_1gdk_1event_1free", "_1gdk_1event_1get", @@ -1644,11 +1643,6 @@ char * OS_nativeFunctionNames[] = { "memmove__Lorg_eclipse_swt_internal_gtk_GdkEvent_2JJ", #endif #ifndef JNI64 - "memmove__Lorg_eclipse_swt_internal_gtk_GdkImage_2I", -#else - "memmove__Lorg_eclipse_swt_internal_gtk_GdkImage_2J", -#endif -#ifndef JNI64 "memmove__Lorg_eclipse_swt_internal_gtk_GdkKeymapKey_2II", #else "memmove__Lorg_eclipse_swt_internal_gtk_GdkKeymapKey_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 caf869e18e..7166f0b276 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 @@ -84,7 +84,6 @@ typedef enum { _1gdk_1drag_1context_1list_1targets_FUNC, _1gdk_1drag_1status_FUNC, _1gdk_1drawable_1get_1depth_FUNC, - _1gdk_1drawable_1get_1image_FUNC, _1gdk_1event_1copy_FUNC, _1gdk_1event_1free_FUNC, _1gdk_1event_1get_FUNC, @@ -1630,11 +1629,6 @@ typedef enum { memmove__Lorg_eclipse_swt_internal_gtk_GdkEvent_2JJ_FUNC, #endif #ifndef JNI64 - memmove__Lorg_eclipse_swt_internal_gtk_GdkImage_2I_FUNC, -#else - memmove__Lorg_eclipse_swt_internal_gtk_GdkImage_2J_FUNC, -#endif -#ifndef JNI64 memmove__Lorg_eclipse_swt_internal_gtk_GdkKeymapKey_2II_FUNC, #else memmove__Lorg_eclipse_swt_internal_gtk_GdkKeymapKey_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 c31516f9c3..a09296df75 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 @@ -784,70 +784,6 @@ void setGdkGeometryFields(JNIEnv *env, jobject lpObject, GdkGeometry *lpStruct) } #endif -#ifndef NO_GdkImage -typedef struct GdkImage_FID_CACHE { - int cached; - jclass clazz; - jfieldID type, visual, byte_order, width, height, depth, bpp, bpl, bits_per_pixel, mem, colormap, windowing_data; -} GdkImage_FID_CACHE; - -GdkImage_FID_CACHE GdkImageFc; - -void cacheGdkImageFields(JNIEnv *env, jobject lpObject) -{ - if (GdkImageFc.cached) return; - GdkImageFc.clazz = (*env)->GetObjectClass(env, lpObject); - GdkImageFc.type = (*env)->GetFieldID(env, GdkImageFc.clazz, "type", "I"); - GdkImageFc.visual = (*env)->GetFieldID(env, GdkImageFc.clazz, "visual", I_J); - GdkImageFc.byte_order = (*env)->GetFieldID(env, GdkImageFc.clazz, "byte_order", "I"); - GdkImageFc.width = (*env)->GetFieldID(env, GdkImageFc.clazz, "width", "I"); - GdkImageFc.height = (*env)->GetFieldID(env, GdkImageFc.clazz, "height", "I"); - GdkImageFc.depth = (*env)->GetFieldID(env, GdkImageFc.clazz, "depth", "S"); - GdkImageFc.bpp = (*env)->GetFieldID(env, GdkImageFc.clazz, "bpp", "S"); - GdkImageFc.bpl = (*env)->GetFieldID(env, GdkImageFc.clazz, "bpl", "S"); - GdkImageFc.bits_per_pixel = (*env)->GetFieldID(env, GdkImageFc.clazz, "bits_per_pixel", "S"); - GdkImageFc.mem = (*env)->GetFieldID(env, GdkImageFc.clazz, "mem", I_J); - GdkImageFc.colormap = (*env)->GetFieldID(env, GdkImageFc.clazz, "colormap", I_J); - GdkImageFc.windowing_data = (*env)->GetFieldID(env, GdkImageFc.clazz, "windowing_data", I_J); - GdkImageFc.cached = 1; -} - -GdkImage *getGdkImageFields(JNIEnv *env, jobject lpObject, GdkImage *lpStruct) -{ - if (!GdkImageFc.cached) cacheGdkImageFields(env, lpObject); - lpStruct->type = (GdkImageType)(*env)->GetIntField(env, lpObject, GdkImageFc.type); - lpStruct->visual = (GdkVisual *)(*env)->GetIntLongField(env, lpObject, GdkImageFc.visual); - lpStruct->byte_order = (GdkByteOrder)(*env)->GetIntField(env, lpObject, GdkImageFc.byte_order); - lpStruct->width = (gint)(*env)->GetIntField(env, lpObject, GdkImageFc.width); - lpStruct->height = (gint)(*env)->GetIntField(env, lpObject, GdkImageFc.height); - lpStruct->depth = (guint16)(*env)->GetShortField(env, lpObject, GdkImageFc.depth); - lpStruct->bpp = (guint16)(*env)->GetShortField(env, lpObject, GdkImageFc.bpp); - lpStruct->bpl = (guint16)(*env)->GetShortField(env, lpObject, GdkImageFc.bpl); - lpStruct->bits_per_pixel = (guint16)(*env)->GetShortField(env, lpObject, GdkImageFc.bits_per_pixel); - lpStruct->mem = (gpointer)(*env)->GetIntLongField(env, lpObject, GdkImageFc.mem); - lpStruct->colormap = (GdkColormap *)(*env)->GetIntLongField(env, lpObject, GdkImageFc.colormap); - lpStruct->windowing_data = (gpointer)(*env)->GetIntLongField(env, lpObject, GdkImageFc.windowing_data); - return lpStruct; -} - -void setGdkImageFields(JNIEnv *env, jobject lpObject, GdkImage *lpStruct) -{ - if (!GdkImageFc.cached) cacheGdkImageFields(env, lpObject); - (*env)->SetIntField(env, lpObject, GdkImageFc.type, (jint)lpStruct->type); - (*env)->SetIntLongField(env, lpObject, GdkImageFc.visual, (jintLong)lpStruct->visual); - (*env)->SetIntField(env, lpObject, GdkImageFc.byte_order, (jint)lpStruct->byte_order); - (*env)->SetIntField(env, lpObject, GdkImageFc.width, (jint)lpStruct->width); - (*env)->SetIntField(env, lpObject, GdkImageFc.height, (jint)lpStruct->height); - (*env)->SetShortField(env, lpObject, GdkImageFc.depth, (jshort)lpStruct->depth); - (*env)->SetShortField(env, lpObject, GdkImageFc.bpp, (jshort)lpStruct->bpp); - (*env)->SetShortField(env, lpObject, GdkImageFc.bpl, (jshort)lpStruct->bpl); - (*env)->SetShortField(env, lpObject, GdkImageFc.bits_per_pixel, (jshort)lpStruct->bits_per_pixel); - (*env)->SetIntLongField(env, lpObject, GdkImageFc.mem, (jintLong)lpStruct->mem); - (*env)->SetIntLongField(env, lpObject, GdkImageFc.colormap, (jintLong)lpStruct->colormap); - (*env)->SetIntLongField(env, lpObject, GdkImageFc.windowing_data, (jintLong)lpStruct->windowing_data); -} -#endif - #ifndef NO_GdkKeymapKey typedef struct GdkKeymapKey_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 05c93427c6..58e4ab6084 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 @@ -198,18 +198,6 @@ void setGdkGeometryFields(JNIEnv *env, jobject lpObject, GdkGeometry *lpStruct); #define GdkGeometry_sizeof() 0 #endif -#ifndef NO_GdkImage -void cacheGdkImageFields(JNIEnv *env, jobject lpObject); -GdkImage *getGdkImageFields(JNIEnv *env, jobject lpObject, GdkImage *lpStruct); -void setGdkImageFields(JNIEnv *env, jobject lpObject, GdkImage *lpStruct); -#define GdkImage_sizeof() sizeof(GdkImage) -#else -#define cacheGdkImageFields(a,b) -#define getGdkImageFields(a,b,c) NULL -#define setGdkImageFields(a,b,c) -#define GdkImage_sizeof() 0 -#endif - #ifndef NO_GdkKeymapKey void cacheGdkKeymapKeyFields(JNIEnv *env, jobject lpObject); GdkKeymapKey *getGdkKeymapKeyFields(JNIEnv *env, jobject lpObject, GdkKeymapKey *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 312b44f620..0c34893aa4 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 @@ -751,22 +751,6 @@ public class GDK extends OS { lock.unlock(); } } - /** - * @method flags=dynamic - * @param x cast=(gint) - * @param y cast=(gint) - * @param width cast=(gint) - * @param height cast=(gint) - */ - public static final native long /*int*/ _gdk_drawable_get_image(long /*int*/ drawable, int x, int y, int width, int height); - public static final long /*int*/ gdk_drawable_get_image(long /*int*/ drawable, int x, int y, int width, int height) { - lock.lock(); - try { - return _gdk_drawable_get_image(drawable, x, y, width, height); - } finally { - lock.unlock(); - } - } /** @param event cast=(GdkEvent *) */ public static final native long /*int*/ _gdk_event_copy(long /*int*/ event); public static final long /*int*/ gdk_event_copy(long /*int*/ event) { diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GdkImage.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GdkImage.java deleted file mode 100644 index f8a8ac1967..0000000000 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GdkImage.java +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2012 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 GdkImage { - /** @field cast=(GdkImageType) */ - public int type; - /** @field cast=(GdkVisual *) */ - public long /*int*/ visual; - /** @field cast=(GdkByteOrder) */ - public int byte_order; - /** @field cast=(gint) */ - public int width; - /** @field cast=(gint) */ - public int height; - /** @field cast=(guint16) */ - public short depth; - /** @field cast=(guint16) */ - public short bpp; - /** @field cast=(guint16) */ - public short bpl; - /** @field cast=(guint16) */ - public short bits_per_pixel; - /** @field cast=(gpointer) */ - public long /*int*/ mem; - /** @field cast=(GdkColormap *) */ - public long /*int*/ colormap; - /** @field cast=(gpointer) */ - public long /*int*/ windowing_data; -} 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 8f042fc58f..75baed8c0b 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 @@ -2975,11 +2975,6 @@ public static final native void memmove(GtkCellRendererClass dest, long /*int*/ /** * @param dest cast=(void *),flags=no_in * @param src cast=(const void *) - */ -public static final native void memmove(GdkImage dest, long /*int*/ src); -/** - * @param dest cast=(void *),flags=no_in - * @param src cast=(const void *) * @param size cast=(size_t) */ public static final native void memmove(GdkRectangle dest, long /*int*/ src, long /*int*/ size); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TrayItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TrayItem.java index 52ea486881..38f6f6ac1f 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TrayItem.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TrayItem.java @@ -290,38 +290,6 @@ long /*int*/ gtk_button_press_event (long /*int*/ widget, long /*int*/ eventPtr) @Override long /*int*/ gtk_size_allocate (long /*int*/ widget, long /*int*/ allocation) { - if (image != null && image.mask != 0) { - if (GDK.gdk_drawable_get_depth (image.mask) == 1) { - GtkAllocation widgetAllocation = new GtkAllocation (); - GTK.gtk_widget_get_allocation (widget, widgetAllocation); - int xoffset = (int) Math.floor (widgetAllocation.x + ((widgetAllocation.width) * 0.5) + 0.5); - int yoffset = (int) Math.floor (widgetAllocation.y + ((widgetAllocation.height) * 0.5) + 0.5); - Rectangle b = image.getBoundsInPixels(); - long /*int*/ gdkImagePtr = GDK.gdk_drawable_get_image (image.mask, 0, 0, b.width, b.height); - if (gdkImagePtr == 0) error(SWT.ERROR_NO_HANDLES); - GdkImage gdkImage = new GdkImage(); - OS.memmove (gdkImage, gdkImagePtr); - byte[] maskData = new byte [gdkImage.bpl * gdkImage.height]; - C.memmove (maskData, gdkImage.mem, maskData.length); - OS.g_object_unref (gdkImagePtr); - Region region = new Region (display); - for (int y = 0; y < b.height; y++) { - for (int x = 0; x < b.width; x++) { - int index = (y * gdkImage.bpl) + (x >> 3); - int theByte = maskData [index] & 0xFF; - int mask = 1 << (x & 0x7); - if ((theByte & mask) != 0) { - Rectangle rect = DPIUtil.autoScaleDown(new Rectangle(xoffset + x, yoffset + y, 1, 1)); - region.add(rect.x, rect.y, rect.width, rect.height); - } - } - } - GTK.gtk_widget_realize (handle); - long /*int*/ window = gtk_widget_get_window (handle); - GDK.gdk_window_shape_combine_region (window, region.handle, 0, 0); - region.dispose (); - } - } return 0; } |