Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2020-01-08 15:29:26 +0000
committerAlexander Kurtakov2020-01-10 21:23:36 +0000
commitf966653a8a33bdef6afe64e52b7cd7da4c054d16 (patch)
tree3766c10769d751cf0582f3fe7be4199096b05424
parent795aeac59686647adf9dd0ea194583482609ac01 (diff)
downloadeclipse.platform.swt-f966653a8a33bdef6afe64e52b7cd7da4c054d16.tar.gz
eclipse.platform.swt-f966653a8a33bdef6afe64e52b7cd7da4c054d16.tar.xz
eclipse.platform.swt-f966653a8a33bdef6afe64e52b7cd7da4c054d16.zip
Bug 558927 - Adjust to rename from gtk+ to gtk
Gtk 4 port compiles against 3.96 now. Change-Id: I11af8bfea4c5cd9114efc68cec371d9adcc91cb3 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/make_linux.mak8
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c36
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.h8
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GDK.java11
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GTK.java7
8 files changed, 52 insertions, 28 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/make_linux.mak b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/make_linux.mak
index 62f365f104..470945ce42 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/make_linux.mak
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/make_linux.mak
@@ -62,17 +62,19 @@ CAIROCFLAGS = `pkg-config --cflags cairo`
CAIROLIBS = `pkg-config --libs-only-L cairo` -lcairo
# Do not use pkg-config to get libs because it includes unnecessary dependencies (i.e. pangoxft-1.0)
-GTKCFLAGS = `pkg-config --cflags gtk+-$(GTK_VERSION) gtk+-unix-print-$(GTK_VERSION)`
ifeq ($(GTK_VERSION), 4.0)
-GTKLIBS = `pkg-config --libs-only-L gtk+-$(GTK_VERSION) gthread-2.0` $(XLIB64) -L/usr/X11R6/lib -lgtk-4 -lcairo -lgthread-2.0
+GTKCFLAGS = `pkg-config --cflags gtk4 gtk4-x11 gtk4-unix-print`
+GTKLIBS = `pkg-config --libs-only-L gtk4 gtk4-x11 gthread-2.0` $(XLIB64) -L/usr/X11R6/lib -lgtk-4 -lcairo -lgthread-2.0
+ATKCFLAGS = `pkg-config --cflags atk gtk4 gtk4-unix-print`
else
+GTKCFLAGS = `pkg-config --cflags gtk+-$(GTK_VERSION) gtk+-unix-print-$(GTK_VERSION)`
GTKLIBS = `pkg-config --libs-only-L gtk+-$(GTK_VERSION) gthread-2.0` $(XLIB64) -L/usr/X11R6/lib -lgtk-3 -lgdk-3 -lcairo -lgthread-2.0
+ATKCFLAGS = `pkg-config --cflags atk gtk+-$(GTK_VERSION) gtk+-unix-print-$(GTK_VERSION)`
endif
AWT_LFLAGS = -shared ${SWT_LFLAGS}
AWT_LIBS = -L$(AWT_LIB_PATH) -ljawt
-ATKCFLAGS = `pkg-config --cflags atk gtk+-$(GTK_VERSION) gtk+-unix-print-$(GTK_VERSION)`
ATKLIBS = `pkg-config --libs-only-L atk` -latk-1.0
GLXLIBS = -lGL -lGLU -lm
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 613f2ed389..102c6b8d8c 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2019 IBM Corporation and others. All rights reserved.
+ * Copyright (c) 2000, 2020 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
@@ -870,7 +870,15 @@ JNIEXPORT jint JNICALL GDK_NATIVE(_1gdk_1drag_1context_1get_1actions)
{
jint rc = 0;
GDK_NATIVE_ENTER(env, that, _1gdk_1drag_1context_1get_1actions_FUNC);
- rc = (jint)gdk_drag_context_get_actions((GdkDragContext *)arg0);
+/*
+ rc = (jint)gdk_drag_context_get_actions(arg0);
+*/
+ {
+ GDK_LOAD_FUNCTION(fp, gdk_drag_context_get_actions)
+ if (fp) {
+ rc = (jint)((jint (CALLING_CONVENTION*)(jlong))fp)(arg0);
+ }
+ }
GDK_NATIVE_EXIT(env, that, _1gdk_1drag_1context_1get_1actions_FUNC);
return rc;
}
@@ -894,7 +902,15 @@ JNIEXPORT jint JNICALL GDK_NATIVE(_1gdk_1drag_1context_1get_1selected_1action)
{
jint rc = 0;
GDK_NATIVE_ENTER(env, that, _1gdk_1drag_1context_1get_1selected_1action_FUNC);
- rc = (jint)gdk_drag_context_get_selected_action((GdkDragContext *)arg0);
+/*
+ rc = (jint)gdk_drag_context_get_selected_action(arg0);
+*/
+ {
+ GDK_LOAD_FUNCTION(fp, gdk_drag_context_get_selected_action)
+ if (fp) {
+ rc = (jint)((jint (CALLING_CONVENTION*)(jlong))fp)(arg0);
+ }
+ }
GDK_NATIVE_EXIT(env, that, _1gdk_1drag_1context_1get_1selected_1action_FUNC);
return rc;
}
@@ -1238,7 +1254,15 @@ JNIEXPORT void JNICALL GDK_NATIVE(_1gdk_1event_1handler_1set)
(JNIEnv *env, jclass that, jlong arg0, jlong arg1, jlong arg2)
{
GDK_NATIVE_ENTER(env, that, _1gdk_1event_1handler_1set_FUNC);
- gdk_event_handler_set((GdkEventFunc)arg0, (gpointer)arg1, (GDestroyNotify)arg2);
+/*
+ gdk_event_handler_set(arg0, arg1, arg2);
+*/
+ {
+ GDK_LOAD_FUNCTION(fp, gdk_event_handler_set)
+ if (fp) {
+ ((void (CALLING_CONVENTION*)(jlong, jlong, jlong))fp)(arg0, arg1, arg2);
+ }
+ }
GDK_NATIVE_EXIT(env, that, _1gdk_1event_1handler_1set_FUNC);
}
#endif
@@ -7389,12 +7413,12 @@ JNIEXPORT void JNICALL GTK_NATIVE(_1gtk_1menu_1popup)
{
GTK_NATIVE_ENTER(env, that, _1gtk_1menu_1popup_FUNC);
/*
- gtk_menu_popup((GtkMenu *)arg0, (GtkWidget *)arg1, (GtkWidget *)arg2, (GtkMenuPositionFunc)arg3, (gpointer)arg4, (guint)arg5, (guint32)arg6);
+ gtk_menu_popup(arg0, arg1, arg2, arg3, arg4, arg5, arg6);
*/
{
GTK_LOAD_FUNCTION(fp, gtk_menu_popup)
if (fp) {
- ((void (CALLING_CONVENTION*)(GtkMenu *, GtkWidget *, GtkWidget *, GtkMenuPositionFunc, gpointer, guint, guint32))fp)((GtkMenu *)arg0, (GtkWidget *)arg1, (GtkWidget *)arg2, (GtkMenuPositionFunc)arg3, (gpointer)arg4, (guint)arg5, (guint32)arg6);
+ ((void (CALLING_CONVENTION*)(jlong, jlong, jlong, jlong, jlong, jint, jint))fp)(arg0, arg1, arg2, arg3, arg4, arg5, arg6);
}
}
GTK_NATIVE_EXIT(env, that, _1gtk_1menu_1popup_FUNC);
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 11abf15d99..a21cea01b2 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
@@ -101,7 +101,7 @@
#if defined(GDK_WINDOWING_X11)
-#if !GTK_CHECK_VERSION(3,94,0)
+#if !GTK_CHECK_VERSION(3,96,0)
#include <gtk/gtkx.h>
#define NO__1gdk_1x11_1surface_1get_1xid
#define NO__1gdk_1x11_1surface_1lookup_1for_1display
@@ -114,8 +114,12 @@
#define NO__1gtk_1socket_1get_1id
#define NO__1gtk_1socket_1new
#endif
+#if !GTK_CHECK_VERSION(3,96,0)
#include <gdk/gdkx.h>
#else
+#include <gdk/x11/gdkx.h>
+#endif
+#else
#define NO_GDK_1IS_1X11_1DISPLAY
@@ -171,7 +175,7 @@
#endif
-#if GTK_CHECK_VERSION(3,94,0)
+#if GTK_CHECK_VERSION(3,96,0)
#define GTK4 1
// Structs which do not exist on GTK4
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h
index 64e70086d0..a44efaad5b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h
@@ -36,10 +36,10 @@
#define LIB_ATK "libatk-1.0-0.dll"
#define LIB_FONTCONFIG "libfontconfig-1.dll"
#else
-#if GTK_CHECK_VERSION(3,94,0)
-#define LIB_GTK "libgtk-4.so.0.9400.0"
+#if GTK_CHECK_VERSION(3,96,0)
+#define LIB_GTK "libgtk-4.so.0.9600.0"
// Point GDK to GTK for GTK4
-#define LIB_GDK "libgtk-4.so.0.9400.0"
+#define LIB_GDK "libgtk-4.so.0.9600.0"
#else
#define LIB_GTK "libgtk-3.so.0"
#define LIB_GDK "libgdk-3.so.0"
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 ab0481d139..c6595483d2 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2019 IBM Corporation and others. All rights reserved.
+ * Copyright (c) 2000, 2020 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
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 10903b9c97..229f781389 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2019 IBM Corporation and others. All rights reserved.
+ * Copyright (c) 2000, 2020 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
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 43a1da94e1..63d8760868 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
@@ -902,9 +902,10 @@ public class GDK extends OS {
}
}
/**
- * @param context cast=(GdkDragContext *)
+ * @method flags=dynamic
*/
public static final native int _gdk_drag_context_get_actions(long context);
+ // TODO GTK4 function removed
public static final int gdk_drag_context_get_actions(long context) {
lock.lock();
try {
@@ -927,9 +928,10 @@ public class GDK extends OS {
}
}
/**
- * @param context cast=(GdkDragContext *)
+ * @method flags=dynamic
*/
public static final native int _gdk_drag_context_get_selected_action(long context);
+ // TODO GTK4 function removed
public static final int gdk_drag_context_get_selected_action(long context) {
lock.lock();
try {
@@ -1223,11 +1225,10 @@ public class GDK extends OS {
}
}
/**
- * @param func cast=(GdkEventFunc)
- * @param data cast=(gpointer)
- * @param notify cast=(GDestroyNotify)
+ * @method flags=dynamic
*/
public static final native void _gdk_event_handler_set(long func, long data, long notify);
+ // TODO GTK4 function removed
public static final void gdk_event_handler_set(long func, long data, long notify) {
lock.lock();
try {
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 d7ccfeda28..c3fa684a0c 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
@@ -4232,13 +4232,6 @@ public class GTK extends OS {
}
/**
* @method flags=dynamic
- * @param menu cast=(GtkMenu *)
- * @param parent_menu_shell cast=(GtkWidget *)
- * @param parent_menu_item cast=(GtkWidget *)
- * @param func cast=(GtkMenuPositionFunc)
- * @param data cast=(gpointer)
- * @param button cast=(guint)
- * @param activate_time cast=(guint32)
*/
public static final native void _gtk_menu_popup(long menu, long parent_menu_shell, long parent_menu_item, long func, long data, int button, int activate_time);
/** [GTK2/GTK3; 3.22 deprecated, replaced] */

Back to the top