aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnatoly Spektor2012-07-09 15:10:22 (EDT)
committerSilenio Quarti2012-08-01 13:25:01 (EDT)
commitc6e846c2a1f2f65f82baf98b5937ac087d800678 (patch)
tree6875680861626be5e55d571c466f40fcb91d71b3
parent2d0d1fe9d220400e0b4957016ec81f97281b8e3b (diff)
downloadeclipse.platform.swt-c6e846c2a1f2f65f82baf98b5937ac087d800678.zip
eclipse.platform.swt-c6e846c2a1f2f65f82baf98b5937ac087d800678.tar.gz
eclipse.platform.swt-c6e846c2a1f2f65f82baf98b5937ac087d800678.tar.bz2
Use gtk_widget_get_mapped() instead of deprecated GTK_WIDGET_MAPPED
Conflicts: bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c20
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java22
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java6
9 files changed, 74 insertions, 11 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 8cef1d3..218ebcc 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
@@ -15486,6 +15486,26 @@ JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1widget_1get_1events)
}
#endif
+#ifndef NO__1gtk_1widget_1get_1mapped
+JNIEXPORT jboolean JNICALL OS_NATIVE(_1gtk_1widget_1get_1mapped)
+ (JNIEnv *env, jclass that, jintLong arg0)
+{
+ jboolean rc = 0;
+ OS_NATIVE_ENTER(env, that, _1gtk_1widget_1get_1mapped_FUNC);
+/*
+ rc = (jboolean)gtk_widget_get_mapped(arg0);
+*/
+ {
+ OS_LOAD_FUNCTION(fp, gtk_widget_get_mapped)
+ if (fp) {
+ rc = (jboolean)((jboolean (CALLING_CONVENTION*)(jintLong))fp)(arg0);
+ }
+ }
+ OS_NATIVE_EXIT(env, that, _1gtk_1widget_1get_1mapped_FUNC);
+ return rc;
+}
+#endif
+
#ifndef NO__1gtk_1widget_1get_1modifier_1style
JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1widget_1get_1modifier_1style)
(JNIEnv *env, jclass that, jintLong arg0)
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 7996ea0..7656883 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
@@ -204,6 +204,7 @@
#define gtk_widget_set_tooltip_text_LIB LIB_GTK
#define gtk_widget_set_has_window_LIB LIB_GTK
#define gtk_fixed_set_has_window_LIB LIB_GTK
+#define gtk_widget_get_mapped_LIB LIB_GTK
#define gdk_pango_context_set_colormap_LIB LIB_GDK
#define gdk_x11_screen_get_window_manager_name_LIB LIB_GDK
#define gdk_x11_screen_lookup_visual_LIB LIB_GDK
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 bedece6..54cce7e 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
@@ -18,8 +18,8 @@
#ifdef NATIVE_STATS
-int OS_nativeFunctionCount = 1320;
-int OS_nativeFunctionCallCount[1320];
+int OS_nativeFunctionCount = 1321;
+int OS_nativeFunctionCallCount[1321];
char * OS_nativeFunctionNames[] = {
#ifndef JNI64
"Call__IIII",
@@ -1227,6 +1227,7 @@ char * OS_nativeFunctionNames[] = {
"_1gtk_1widget_1get_1child_1visible",
"_1gtk_1widget_1get_1default_1style",
"_1gtk_1widget_1get_1events",
+ "_1gtk_1widget_1get_1mapped",
"_1gtk_1widget_1get_1modifier_1style",
"_1gtk_1widget_1get_1pango_1context",
"_1gtk_1widget_1get_1parent",
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 c1af2f8..896fe5c 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
@@ -1235,6 +1235,7 @@ typedef enum {
_1gtk_1widget_1get_1child_1visible_FUNC,
_1gtk_1widget_1get_1default_1style_FUNC,
_1gtk_1widget_1get_1events_FUNC,
+ _1gtk_1widget_1get_1mapped_FUNC,
_1gtk_1widget_1get_1modifier_1style_FUNC,
_1gtk_1widget_1get_1pango_1context_FUNC,
_1gtk_1widget_1get_1parent_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 972e477..2e7f3ff 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
@@ -12147,6 +12147,16 @@ public static final int /*long*/ gtk_widget_get_modifier_style(int /*long*/ widg
lock.unlock();
}
}
+/** @method flags=dynamic */
+public static final native boolean _gtk_widget_get_mapped(int /*long*/ widget);
+public static final boolean gtk_widget_get_mapped(int /*long*/ widget) {
+ lock.lock();
+ try {
+ return _gtk_widget_get_mapped(widget);
+ } finally {
+ lock.unlock();
+ }
+}
/** @param widget cast=(GtkWidget *) */
public static final native int /*long*/ _gtk_widget_get_pango_context(int /*long*/ widget);
public static final int /*long*/ gtk_widget_get_pango_context(int /*long*/ widget) {
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 f0f8295..cea75ad 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
@@ -2314,8 +2314,14 @@ int /*long*/ fixedMapProc (int /*long*/ widget) {
int /*long*/ widgets = widgetList;
while (widgets != 0) {
int /*long*/ child = OS.g_list_data (widgets);
- if (OS.GTK_WIDGET_VISIBLE (child) && OS.gtk_widget_get_child_visible (child) && !OS.GTK_WIDGET_MAPPED (child)) {
- OS.gtk_widget_map (child);
+ if (OS.GTK_VERSION >= OS.VERSION (2, 20, 0)) {
+ if (OS.GTK_WIDGET_VISIBLE (child) && OS.gtk_widget_get_child_visible (child) && !OS.gtk_widget_get_mapped (child)) {
+ OS.gtk_widget_map (child);
+ }
+ }else{
+ if (OS.GTK_WIDGET_VISIBLE (child) && OS.gtk_widget_get_child_visible (child) && !OS.GTK_WIDGET_MAPPED (child)) {
+ OS.gtk_widget_map (child);
+ }
}
widgets = OS.g_list_next (widgets);
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java
index 8bd1039..2a8379d 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java
@@ -193,7 +193,11 @@ static int checkStyle (int style) {
}
void _setVisible (boolean visible) {
- if (visible == OS.GTK_WIDGET_MAPPED (handle)) return;
+ if (OS.GTK_VERSION >= OS.VERSION (2, 20, 0)) {
+ if(visible == OS.gtk_widget_get_mapped(handle)) return;
+ }else{
+ if (visible == OS.GTK_WIDGET_MAPPED (handle)) return;
+ }
if (visible) {
sendEvent (SWT.Show);
if (getItemCount () != 0) {
@@ -372,8 +376,14 @@ void fixMenus (Decorations newParent) {
/*public*/ Rectangle getBounds () {
checkWidget();
- if (!OS.GTK_WIDGET_MAPPED (handle)) {
- return new Rectangle (0, 0, 0, 0);
+ if (OS.GTK_VERSION >= OS.VERSION (2, 20, 0)) {
+ if (!OS.gtk_widget_get_mapped (handle)){
+ return new Rectangle (0, 0, 0, 0);
+ }
+ }else{
+ if (!OS.GTK_WIDGET_MAPPED (handle)) {
+ return new Rectangle (0, 0, 0, 0);
+ }
}
int /*long*/ window = OS.GTK_WIDGET_WINDOW (handle);
int [] origin_x = new int [1], origin_y = new int [1];
@@ -639,7 +649,11 @@ public boolean getVisible () {
}
}
}
- return OS.GTK_WIDGET_MAPPED (handle);
+ if (OS.GTK_VERSION >= OS.VERSION (2, 20, 0)) {
+ return OS.gtk_widget_get_mapped(handle);
+ }else{
+ return OS.GTK_WIDGET_MAPPED (handle);
+ }
}
int /*long*/ gtk_hide (int /*long*/ widget) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java
index 69f6ae0..7350ddd 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java
@@ -319,8 +319,14 @@ int /*long*/ getAccelGroup () {
/*public*/ Rectangle getBounds () {
checkWidget();
- if (!OS.GTK_WIDGET_MAPPED (handle)) {
- return new Rectangle (0, 0, 0, 0);
+ if (OS.GTK_VERSION >= OS.VERSION (2, 20, 0)) {
+ if (!OS.gtk_widget_get_mapped (handle)) {
+ return new Rectangle (0, 0, 0, 0);
+ }
+ }else{
+ if (!OS.GTK_WIDGET_MAPPED (handle)) {
+ return new Rectangle (0, 0, 0, 0);
+ }
}
int x = OS.GTK_WIDGET_X (handle);
int y = OS.GTK_WIDGET_Y (handle);
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 deed81c..66262e3 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
@@ -2005,7 +2005,11 @@ public void setVisible (boolean visible) {
updateModal ();
}
showWithParent = visible;
- if ((OS.GTK_WIDGET_MAPPED (shellHandle) == visible)) return;
+ if (OS.GTK_VERSION >= OS.VERSION (2, 20, 0)) {
+ if (OS.gtk_widget_get_mapped(shellHandle) == visible) return;
+ }else{
+ if ((OS.GTK_WIDGET_MAPPED (shellHandle) == visible)) return;
+ }
if (visible) {
if (center && !moved) {
center ();