Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2018-09-17 08:24:42 +0000
committerAlexander Kurtakov2018-09-17 08:24:42 +0000
commitf04161cd3ce2cb7be6ae95d3a4cbecc21f0f3b5f (patch)
tree29c787d7b2b6afb26d2f02f77bc168c9031aadd5
parentfeb800402c3634e71aedfc0160e5972ba1673aeb (diff)
downloadeclipse.platform.swt-f04161cd3ce2cb7be6ae95d3a4cbecc21f0f3b5f.tar.gz
eclipse.platform.swt-f04161cd3ce2cb7be6ae95d3a4cbecc21f0f3b5f.tar.xz
eclipse.platform.swt-f04161cd3ce2cb7be6ae95d3a4cbecc21f0f3b5f.zip
Bug 530841: [GTK2] Remove GTK 2.x support
Various GKT 2 drawing removals. Change-Id: I9dc357e307ec8b247f59b0b562e06e82b643a918 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c74
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GDK.java61
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Canvas.java9
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java8
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Group.java5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Sash.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java8
9 files changed, 9 insertions, 166 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 1ab84d76b4..8c9d98dccf 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
@@ -901,60 +901,6 @@ JNIEXPORT void JNICALL GDK_NATIVE(_1gdk_1drag_1status)
}
#endif
-#ifndef NO__1gdk_1draw_1arc
-JNIEXPORT void JNICALL GDK_NATIVE(_1gdk_1draw_1arc)
- (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jint arg2, jint arg3, jint arg4, jint arg5, jint arg6, jint arg7, jint arg8)
-{
- GDK_NATIVE_ENTER(env, that, _1gdk_1draw_1arc_FUNC);
-/*
- gdk_draw_arc(arg0, arg1, (gint)arg2, (gint)arg3, (gint)arg4, (gint)arg5, (gint)arg6, (gint)arg7, (gint)arg8);
-*/
- {
- GDK_LOAD_FUNCTION(fp, gdk_draw_arc)
- if (fp) {
- ((void (CALLING_CONVENTION*)(jintLong, jintLong, gint, gint, gint, gint, gint, gint, gint))fp)(arg0, arg1, (gint)arg2, (gint)arg3, (gint)arg4, (gint)arg5, (gint)arg6, (gint)arg7, (gint)arg8);
- }
- }
- GDK_NATIVE_EXIT(env, that, _1gdk_1draw_1arc_FUNC);
-}
-#endif
-
-#ifndef NO__1gdk_1draw_1image
-JNIEXPORT void JNICALL GDK_NATIVE(_1gdk_1draw_1image)
- (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jintLong arg2, jint arg3, jint arg4, jint arg5, jint arg6, jint arg7, jint arg8)
-{
- GDK_NATIVE_ENTER(env, that, _1gdk_1draw_1image_FUNC);
-/*
- gdk_draw_image(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
-*/
- {
- GDK_LOAD_FUNCTION(fp, gdk_draw_image)
- if (fp) {
- ((void (CALLING_CONVENTION*)(jintLong, jintLong, jintLong, jint, jint, jint, jint, jint, jint))fp)(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
- }
- }
- GDK_NATIVE_EXIT(env, that, _1gdk_1draw_1image_FUNC);
-}
-#endif
-
-#ifndef NO__1gdk_1draw_1pixbuf
-JNIEXPORT void JNICALL GDK_NATIVE(_1gdk_1draw_1pixbuf)
- (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jintLong arg2, jint arg3, jint arg4, jint arg5, jint arg6, jint arg7, jint arg8, jint arg9, jint arg10, jint arg11)
-{
- GDK_NATIVE_ENTER(env, that, _1gdk_1draw_1pixbuf_FUNC);
-/*
- gdk_draw_pixbuf(arg0, arg1, arg2, (gint)arg3, (gint)arg4, (gint)arg5, (gint)arg6, (gint)arg7, (gint)arg8, arg9, (gint)arg10, (gint)arg11);
-*/
- {
- GDK_LOAD_FUNCTION(fp, gdk_draw_pixbuf)
- if (fp) {
- ((void (CALLING_CONVENTION*)(jintLong, jintLong, jintLong, gint, gint, gint, gint, gint, gint, jint, gint, gint))fp)(arg0, arg1, arg2, (gint)arg3, (gint)arg4, (gint)arg5, (gint)arg6, (gint)arg7, (gint)arg8, arg9, (gint)arg10, (gint)arg11);
- }
- }
- GDK_NATIVE_EXIT(env, that, _1gdk_1draw_1pixbuf_FUNC);
-}
-#endif
-
#ifndef NO__1gdk_1drawable_1get_1depth
JNIEXPORT jint JNICALL GDK_NATIVE(_1gdk_1drawable_1get_1depth)
(JNIEnv *env, jclass that, jintLong arg0)
@@ -995,26 +941,6 @@ JNIEXPORT jintLong JNICALL GDK_NATIVE(_1gdk_1drawable_1get_1image)
}
#endif
-#ifndef NO__1gdk_1drawable_1get_1visible_1region
-JNIEXPORT jintLong JNICALL GDK_NATIVE(_1gdk_1drawable_1get_1visible_1region)
- (JNIEnv *env, jclass that, jintLong arg0)
-{
- jintLong rc = 0;
- GDK_NATIVE_ENTER(env, that, _1gdk_1drawable_1get_1visible_1region_FUNC);
-/*
- rc = (jintLong)gdk_drawable_get_visible_region(arg0);
-*/
- {
- GDK_LOAD_FUNCTION(fp, gdk_drawable_get_visible_region)
- if (fp) {
- rc = (jintLong)((jintLong (CALLING_CONVENTION*)(jintLong))fp)(arg0);
- }
- }
- GDK_NATIVE_EXIT(env, that, _1gdk_1drawable_1get_1visible_1region_FUNC);
- return rc;
-}
-#endif
-
#ifndef NO__1gdk_1error_1trap_1pop
JNIEXPORT jint JNICALL GDK_NATIVE(_1gdk_1error_1trap_1pop)
(JNIEnv *env, jclass that)
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 7d67ab1dd0..34d02b3903 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
@@ -77,12 +77,8 @@ char * GDK_nativeFunctionNames[] = {
"_1gdk_1drag_1context_1get_1selected_1action",
"_1gdk_1drag_1context_1list_1targets",
"_1gdk_1drag_1status",
- "_1gdk_1draw_1arc",
- "_1gdk_1draw_1image",
- "_1gdk_1draw_1pixbuf",
"_1gdk_1drawable_1get_1depth",
"_1gdk_1drawable_1get_1image",
- "_1gdk_1drawable_1get_1visible_1region",
"_1gdk_1error_1trap_1pop",
"_1gdk_1error_1trap_1push",
"_1gdk_1event_1copy",
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 c1b2230f49..cbf55d09b8 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
@@ -87,12 +87,8 @@ typedef enum {
_1gdk_1drag_1context_1get_1selected_1action_FUNC,
_1gdk_1drag_1context_1list_1targets_FUNC,
_1gdk_1drag_1status_FUNC,
- _1gdk_1draw_1arc_FUNC,
- _1gdk_1draw_1image_FUNC,
- _1gdk_1draw_1pixbuf_FUNC,
_1gdk_1drawable_1get_1depth_FUNC,
_1gdk_1drawable_1get_1image_FUNC,
- _1gdk_1drawable_1get_1visible_1region_FUNC,
_1gdk_1error_1trap_1pop_FUNC,
_1gdk_1error_1trap_1push_FUNC,
_1gdk_1event_1copy_FUNC,
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 e60a06e58b..c13821b5b6 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
@@ -803,57 +803,6 @@ public class GDK extends OS {
lock.unlock();
}
}
- /**
- * @method flags=dynamic
- * @param filled cast=(gint)
- * @param x cast=(gint)
- * @param y cast=(gint)
- * @param width cast=(gint)
- * @param height cast=(gint)
- * @param angle1 cast=(gint)
- * @param angle2 cast=(gint)
- */
- public static final native void _gdk_draw_arc(long /*int*/ drawable, long /*int*/ gc, int filled, int x, int y, int width, int height, int angle1, int angle2);
- public static final void gdk_draw_arc(long /*int*/ drawable, long /*int*/ gc, int filled, int x, int y, int width, int height, int angle1, int angle2) {
- lock.lock();
- try {
- _gdk_draw_arc(drawable, gc, filled, x, y, width, height, angle1, angle2);
- } finally {
- lock.unlock();
- }
- }
- /**
- * @method flags=dynamic
- */
- public static final native void _gdk_draw_image(long /*int*/ drawable, long /*int*/ gc, long /*int*/ image, int xsrc, int ysrc, int xdest, int ydest, int width, int height);
- public static final void gdk_draw_image(long /*int*/ drawable, long /*int*/ gc, long /*int*/ image, int xsrc, int ysrc, int xdest, int ydest, int width, int height) {
- lock.lock();
- try {
- _gdk_draw_image(drawable, gc, image, xsrc, ysrc, xdest, ydest, width, height);
- } finally {
- lock.unlock();
- }
- }
- /**
- * @method flags=dynamic
- * @param xsrc cast=(gint)
- * @param ysrc cast=(gint)
- * @param xdest cast=(gint)
- * @param ydest cast=(gint)
- * @param width cast=(gint)
- * @param height cast=(gint)
- * @param x_dither cast=(gint)
- * @param y_dither cast=(gint)
- */
- public static final native void _gdk_draw_pixbuf(long /*int*/ drawable, long /*int*/ gc, long /*int*/ pixbuf, int xsrc, int ysrc, int xdest, int ydest, int width, int height, int dither, int x_dither, int y_dither);
- public static final void gdk_draw_pixbuf(long /*int*/ drawable, long /*int*/ gc, long /*int*/ pixbuf, int xsrc, int ysrc, int xdest, int ydest, int width, int height, int dither, int x_dither, int y_dither) {
- lock.lock();
- try {
- _gdk_draw_pixbuf(drawable, gc, pixbuf, xsrc, ysrc, xdest, ydest, width, height, dither, x_dither, y_dither);
- } finally {
- lock.unlock();
- }
- }
/** @method flags=dynamic */
public static final native int _gdk_drawable_get_depth(long /*int*/ drawable);
public static final int gdk_drawable_get_depth(long /*int*/ drawable) {
@@ -895,16 +844,6 @@ public class GDK extends OS {
lock.unlock();
}
}
- /** @method flags=dynamic */
- public static final native long /*int*/ _gdk_drawable_get_visible_region(long /*int*/ drawable);
- public static final long /*int*/ gdk_drawable_get_visible_region(long /*int*/ drawable) {
- lock.lock();
- try {
- return _gdk_drawable_get_visible_region(drawable);
- } 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/gtk/org/eclipse/swt/widgets/Canvas.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Canvas.java
index fe12ad666f..23f0e2d052 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Canvas.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Canvas.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2017 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -338,12 +338,7 @@ void scrollInPixels (int destX, int destY, int x, int y, int width, int height,
boolean isFocus = caret != null && caret.isFocusCaret ();
if (isFocus) caret.killFocus ();
long /*int*/ window = paintWindow ();
- long /*int*/ visibleRegion;
- if (GTK.GTK3) {
- visibleRegion = GDK.gdk_window_get_visible_region (window);
- } else {
- visibleRegion = GDK.gdk_drawable_get_visible_region (window);
- }
+ long /*int*/ visibleRegion = GDK.gdk_window_get_visible_region (window);
GdkRectangle srcRect = new GdkRectangle ();
srcRect.x = x;
srcRect.y = y;
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 3c00112181..e87f2b0afd 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
@@ -904,11 +904,7 @@ long /*int*/ gtk_realize (long /*int*/ widget) {
if ((style & SWT.NO_BACKGROUND) != 0) {
long /*int*/ window = gtk_widget_get_window (paintHandle ());
if (window != 0) {
- if (GTK.GTK3) {
- GDK.gdk_window_set_background_pattern(window, 0);
- } else {
- GDK.gdk_window_set_back_pixmap (window, 0, false);
- }
+ GDK.gdk_window_set_background_pattern(window, 0);
}
}
if (socketHandle != 0) {
@@ -1414,7 +1410,7 @@ void connectFixedHandleDraw () {
* @param cairo the cairo context provided by GTK
*/
void propagateDraw (long /*int*/ container, long /*int*/ cairo) {
- if (container == fixedHandle && GTK.GTK3) {
+ if (container == fixedHandle) {
long /*int*/ list = GTK.gtk_container_get_children (container);
long /*int*/ temp = list;
while (temp != 0) {
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 41b8eae10d..c825a2f674 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
@@ -458,10 +458,9 @@ int setBounds(int x, int y, int width, int height, boolean move, boolean resize)
@Override
long /*int*/ paintHandle() {
- if (GTK.GTK3 && GTK.GTK_VERSION < OS.VERSION(3, 14, 0)) {
+ if (GTK.GTK_VERSION < OS.VERSION(3, 14, 0)) {
return super.paintHandle();
- }
- else {
+ } else {
long /*int*/ topHandle = topHandle ();
/* we draw all our children on the clientHandle*/
long /*int*/ paintHandle = clientHandle;
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 7d9b59137c..58c666de34 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,7 +150,7 @@ void createHandle (int index) {
}
void drawBand (int x, int y, int width, int height) {
- if ((style & SWT.SMOOTH) != 0 || GTK.GTK3) return;
+ if ((style & SWT.SMOOTH) != 0) return;
}
@Override
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 8e967e994a..2bac6bcd1b 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
@@ -1932,12 +1932,8 @@ long /*int*/ windowProc (long /*int*/ handle, long /*int*/ arg0, long /*int*/ us
case EVENT: return gtk_event (handle, arg0);
case EVENT_AFTER: return gtk_event_after (handle, arg0);
case EXPOSE_EVENT: {
- if (GTK.GTK3) {
- if (GTK.GTK_VERSION < OS.VERSION (3, 9, 0) || !GTK.GTK_IS_CONTAINER (handle)) {
- return gtk_draw (handle, arg0);
- }
- } else {
- return gtk_expose_event (handle, arg0);
+ if (GTK.GTK_VERSION < OS.VERSION (3, 9, 0) || !GTK.GTK_IS_CONTAINER (handle)) {
+ return gtk_draw (handle, arg0);
}
return 0;
}

Back to the top