aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnatoly Spektor2012-08-07 14:17:06 (EDT)
committerSilenio Quarti2012-08-08 10:13:17 (EDT)
commit37911e0ffd8884382e7030a0b8c6d0f4e7752bc6 (patch)
tree26a4ec87e1c4b96e12155517601a76628898a155
parentfc2d2ec1727bbf89af6fa75dcff471c41c95b0be (diff)
downloadeclipse.platform.swt-37911e0ffd8884382e7030a0b8c6d0f4e7752bc6.zip
eclipse.platform.swt-37911e0ffd8884382e7030a0b8c6d0f4e7752bc6.tar.gz
eclipse.platform.swt-37911e0ffd8884382e7030a0b8c6d0f4e7752bc6.tar.bz2
Omit use of deprecated GTK_WIDGET_UNSET_FLAGS
Conflicts: bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c18
-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/Combo.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandItem.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java8
13 files changed, 53 insertions, 14 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 41d9821..92f1670 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
@@ -16147,6 +16147,24 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1widget_1set_1parent_1window)
}
#endif
+#ifndef NO__1gtk_1widget_1set_1receives_1default
+JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1widget_1set_1receives_1default)
+ (JNIEnv *env, jclass that, jintLong arg0, jboolean arg1)
+{
+ OS_NATIVE_ENTER(env, that, _1gtk_1widget_1set_1receives_1default_FUNC);
+/*
+ gtk_widget_set_receives_default(arg0, arg1);
+*/
+ {
+ OS_LOAD_FUNCTION(fp, gtk_widget_set_receives_default)
+ if (fp) {
+ ((void (CALLING_CONVENTION*)(jintLong, jboolean))fp)(arg0, arg1);
+ }
+ }
+ OS_NATIVE_EXIT(env, that, _1gtk_1widget_1set_1receives_1default_FUNC);
+}
+#endif
+
#ifndef NO__1gtk_1widget_1set_1redraw_1on_1allocate
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1widget_1set_1redraw_1on_1allocate)
(JNIEnv *env, jclass that, jintLong arg0, jboolean arg1)
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 1e38d0b..3b2b5ba 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
@@ -222,6 +222,7 @@
#define gtk_widget_set_can_focus_LIB LIB_GTK
#define gtk_widget_set_mapped_LIB LIB_GTK
#define gtk_widget_set_sensitive_LIB LIB_GTK
+#define gtk_widget_set_receives_default_LIB LIB_GTK
#define gtk_widget_set_visible_LIB LIB_GTK
#define gdk_pango_context_set_colormap_LIB LIB_GDK
#define gdk_x11_screen_get_window_manager_name_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 626e121..b1b6aae 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 = 1334;
-int OS_nativeFunctionCallCount[1334];
+int OS_nativeFunctionCount = 1335;
+int OS_nativeFunctionCallCount[1335];
char * OS_nativeFunctionNames[] = {
#ifndef JNI64
"Call__IIII",
@@ -1271,6 +1271,7 @@ char * OS_nativeFunctionNames[] = {
"_1gtk_1widget_1set_1mapped",
"_1gtk_1widget_1set_1name",
"_1gtk_1widget_1set_1parent_1window",
+ "_1gtk_1widget_1set_1receives_1default",
"_1gtk_1widget_1set_1redraw_1on_1allocate",
"_1gtk_1widget_1set_1sensitive",
"_1gtk_1widget_1set_1size_1request",
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 8975724..81bd705 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
@@ -1279,6 +1279,7 @@ typedef enum {
_1gtk_1widget_1set_1mapped_FUNC,
_1gtk_1widget_1set_1name_FUNC,
_1gtk_1widget_1set_1parent_1window_FUNC,
+ _1gtk_1widget_1set_1receives_1default_FUNC,
_1gtk_1widget_1set_1redraw_1on_1allocate_FUNC,
_1gtk_1widget_1set_1sensitive_FUNC,
_1gtk_1widget_1set_1size_1request_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 eb2d39a..1b27f48 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
@@ -12598,6 +12598,16 @@ public static final void gtk_widget_set_direction(int /*long*/ widget, int dir)
lock.unlock();
}
}
+/** @method flags=dynamic */
+public static final native void _gtk_widget_set_receives_default(int /*long*/ widget, boolean receives_default);
+public static final void gtk_widget_set_receives_default(int /*long*/ widget, boolean receives_default) {
+ lock.lock();
+ try {
+ _gtk_widget_set_receives_default(widget, receives_default);
+ } finally {
+ lock.unlock();
+ }
+}
/**
* @param widget cast=(GtkWidget *)
* @param double_buffered cast=(gboolean)
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java
index 6b4b552..b34449a 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java
@@ -450,7 +450,7 @@ void createHandle (int index) {
* clear the GTK_RECEIVES_DEFAULT flag.
*/
if ((style & SWT.READ_ONLY) != 0 && buttonHandle != 0) {
- OS.GTK_WIDGET_UNSET_FLAGS (buttonHandle, OS.GTK_RECEIVES_DEFAULT);
+ gtk_widget_set_receives_default (buttonHandle, false);
}
}
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 35c0369..8d68182 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
@@ -532,7 +532,7 @@ int /*long*/ focusHandle () {
boolean forceFocus (int /*long*/ focusHandle) {
if (socketHandle != 0) gtk_widget_set_can_focus (focusHandle, true);
boolean result = super.forceFocus (focusHandle);
- if (socketHandle != 0) OS.GTK_WIDGET_UNSET_FLAGS (focusHandle, OS.GTK_CAN_FOCUS);
+ if (socketHandle != 0) gtk_widget_set_can_focus (focusHandle, false);
return result;
}
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 6e57710..83d1920 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
@@ -195,7 +195,7 @@ void fixFocus (Control focusControl) {
OS.gtk_widget_grab_focus (focusHandle);
// widget could be disposed at this point
if (isDisposed ()) return;
- OS.GTK_WIDGET_UNSET_FLAGS (focusHandle, OS.GTK_CAN_FOCUS);
+ gtk_widget_set_can_focus (focusHandle, false);
}
void fixStyle () {
@@ -840,7 +840,7 @@ void moveHandle (int x, int y) {
* old bounds of the child are correctly redrawn.
*/
boolean visible = gtk_widget_get_visible (parentHandle);
- OS.GTK_WIDGET_UNSET_FLAGS (parentHandle, OS.GTK_VISIBLE);
+ gtk_widget_set_visible (parentHandle, false);
OS.gtk_fixed_move (parentHandle, topHandle, x, y);
if (visible) {
gtk_widget_set_visible (parentHandle, true);
@@ -4564,7 +4564,7 @@ public void setVisible (boolean visible) {
}
state |= HIDDEN;
if (fixFocus) {
- OS.GTK_WIDGET_UNSET_FLAGS (topHandle, OS.GTK_VISIBLE);
+ gtk_widget_set_visible (topHandle, false);
fixFocus (control);
if (isDisposed ()) return;
gtk_widget_set_visible (topHandle, true);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java
index e65d539..96cd6be 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java
@@ -163,10 +163,10 @@ void createText(boolean dropDown) {
createPopupShell(-1, -1, -1);
} else {
up = new Button(this, SWT.ARROW | SWT.UP);
- OS.GTK_WIDGET_UNSET_FLAGS(up.handle, OS.GTK_CAN_FOCUS);
+ gtk_widget_set_can_focus (up.handle, false);
//up.setToolTipText(SWT.getMessage ("SWT_Up")); //$NON-NLS-1$
down = new Button(this, SWT.ARROW | SWT.DOWN);
- OS.GTK_WIDGET_UNSET_FLAGS(down.handle, OS.GTK_CAN_FOCUS);
+ gtk_widget_set_can_focus (down.handle, false);
//down.setToolTipText(SWT.getMessage ("SWT_Down")); //$NON-NLS-1$
up.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event event) {
@@ -185,7 +185,7 @@ void createText(boolean dropDown) {
void createDropDownButton() {
down = new Button(this, SWT.ARROW | SWT.DOWN);
- OS.GTK_WIDGET_UNSET_FLAGS(down.handle, OS.GTK_CAN_FOCUS);
+ gtk_widget_set_can_focus (down.handle, false);
down.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event event) {
boolean dropped = isDropped();
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandItem.java
index 05d4dce..7da2a5e 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandItem.java
@@ -329,7 +329,7 @@ int /*long*/ gtk_button_press_event (int /*long*/ widget, int /*long*/ event) {
}
int /*long*/ gtk_focus_out_event (int /*long*/ widget, int /*long*/ event) {
- OS.GTK_WIDGET_UNSET_FLAGS (handle, OS.GTK_CAN_FOCUS);
+ gtk_widget_set_can_focus (handle, false);
parent.lastFocus = this;
return 0;
}
@@ -514,7 +514,7 @@ boolean setFocus () {
// widget could be disposed at this point
if (isDisposed ()) return false;
boolean result = OS.gtk_widget_is_focus (handle);
- if (!result) OS.GTK_WIDGET_UNSET_FLAGS (handle, OS.GTK_CAN_FOCUS);
+ if (!result) gtk_widget_set_can_focus (handle, false);
return result;
}
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 072dd38..7a45c3a 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
@@ -963,7 +963,7 @@ public void setEnabled (boolean enabled) {
if (enabled) {
OS.gtk_widget_set_sensitive (handle, true);
} else {
- OS.GTK_WIDGET_UNSET_FLAGS (handle, OS.GTK_SENSITIVE);
+ OS.gtk_widget_set_sensitive (handle, false);
}
}
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 87f0b0a..ccaa1c6 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
@@ -278,7 +278,7 @@ void createHandle (int index) {
boolean enabled = gtk_widget_get_sensitive (parentHandle);
if (!enabled) OS.gtk_widget_set_sensitive (parentHandle, true);
OS.gtk_menu_shell_insert (parentHandle, handle, index);
- if (!enabled) OS.GTK_WIDGET_UNSET_FLAGS (parentHandle, OS.GTK_SENSITIVE);
+ if (!enabled) OS.gtk_widget_set_sensitive (parentHandle, false);
OS.gtk_widget_show (handle);
}
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 eb1b4e8..e69adb8 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
@@ -1778,6 +1778,14 @@ void gtk_widget_set_visible (int /*long*/ widget, boolean visible) {
}
}
+void gtk_widget_set_receives_default (int /*long*/ widget, boolean receives_default) {
+ if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) {
+ OS.gtk_widget_set_receives_default (widget, receives_default);
+ } else {
+ OS.GTK_WIDGET_UNSET_FLAGS (widget, OS.GTK_RECEIVES_DEFAULT);
+ }
+}
+
/**
* Returns a string containing a concise, human-readable
* description of the receiver.