Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXi Yan2019-01-23 14:15:12 -0500
committerXi Yan2019-01-23 14:15:12 -0500
commit51a0130d9b1343b377085816517ce34e9b2e2dca (patch)
tree19f9e6567acb3f24ee7bb2a61801c0a6f2eb27b2
parent4c6f9b48145b05e0fa1ba1ca2d72508f386576b0 (diff)
downloadeclipse.platform.swt-51a0130d9b1343b377085816517ce34e9b2e2dca.tar.gz
eclipse.platform.swt-51a0130d9b1343b377085816517ce34e9b2e2dca.tar.xz
eclipse.platform.swt-51a0130d9b1343b377085816517ce34e9b2e2dca.zip
Bug 541205 - [GTK4] Replace deprecated style-set signal
Replace style-set with style-updated for GTK3.0+. Tested with child eclipse, ControlExample, GraphicsExample. Change-Id: I570137c4529b625a56a47dee61e8c96d3501e957 Signed-off-by: Xi Yan <xixiyan@redhat.com>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java8
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java6
7 files changed, 18 insertions, 18 deletions
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 e1873bf0dd..1bdcecc39b 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
@@ -369,7 +369,7 @@ public class OS extends C {
public static final byte[] size_allocate = ascii("size-allocate");
public static final byte[] size_request = ascii("size-request");
public static final byte[] start_interactive_search = ascii("start-interactive-search");
- public static final byte[] style_set = ascii("style-set");
+ public static final byte[] style_updated = ascii("style-updated");
public static final byte[] swipe = ascii("swipe");
public static final byte[] switch_page = ascii("switch-page");
public static final byte[] test_collapse_row = ascii("test-collapse-row");
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 9e70d60b6d..b0687c9b09 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
@@ -1700,10 +1700,10 @@ long /*int*/ gtk_selection_done(long /*int*/ menushell) {
}
@Override
-long /*int*/ gtk_style_set (long /*int*/ widget, long /*int*/ previousStyle) {
+long /*int*/ gtk_style_updated (long /*int*/ widget) {
setButtonHandle (findButtonHandle ());
setMenuHandle (findMenuHandle ());
- return super.gtk_style_set (widget, previousStyle);
+ return super.gtk_style_updated (widget);
}
/**
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 b49fb77e6f..8e8dd7009c 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
@@ -923,8 +923,8 @@ long /*int*/ gtk_scroll_child (long /*int*/ widget, long /*int*/ scrollType, lon
}
@Override
-long /*int*/ gtk_style_set (long /*int*/ widget, long /*int*/ previousStyle) {
- long /*int*/ result = super.gtk_style_set (widget, previousStyle);
+long /*int*/ gtk_style_updated (long /*int*/ widget) {
+ long /*int*/ result = super.gtk_style_updated (widget);
if ((style & SWT.NO_BACKGROUND) != 0) {
//TODO: implement this on GTK3 as pixmaps are gone.
}
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 285bd7bba8..3b2fe474cd 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
@@ -393,8 +393,8 @@ void hookEvents () {
GTK.gtk_widget_add_controller(focusHandle, keyController);
GTK.gtk_event_controller_set_propagation_phase(keyController, GTK.GTK_PHASE_TARGET);
- long keyPressReleaseAddress = display.keyPressReleaseCallback.getAddress();
- long focusAddress = display.focusCallback.getAddress();
+ long /*int*/ keyPressReleaseAddress = display.keyPressReleaseCallback.getAddress();
+ long /*int*/ focusAddress = display.focusCallback.getAddress();
OS.g_signal_connect (keyController, OS.key_pressed, keyPressReleaseAddress, KEY_PRESSED);
OS.g_signal_connect (keyController, OS.key_released, keyPressReleaseAddress, KEY_RELEASED);
OS.g_signal_connect (keyController, OS.focus_in, focusAddress, FOCUS_IN);
@@ -497,7 +497,7 @@ void hookEvents () {
OS.g_signal_connect_closure (imHandle, OS.preedit_changed, display.getClosure (PREEDIT_CHANGED), false);
}
- OS.g_signal_connect_closure_by_id (paintHandle (), display.signalIds [STYLE_SET], 0, display.getClosure (STYLE_SET), false);
+ OS.g_signal_connect_closure_by_id (paintHandle (), display.signalIds [STYLE_UPDATED], 0, display.getClosure (STYLE_UPDATED), false);
long /*int*/ topHandle = topHandle ();
OS.g_signal_connect_closure_by_id (topHandle, display.signalIds [MAP], 0, display.getClosure (MAP), true);
@@ -4015,7 +4015,7 @@ long /*int*/ gtk_show_help (long /*int*/ widget, long /*int*/ helpType) {
}
@Override
-long /*int*/ gtk_style_set (long /*int*/ widget, long /*int*/ previousStyle) {
+long /*int*/ gtk_style_updated (long /*int*/ widget) {
if (backgroundImage != null) {
setBackgroundSurface (backgroundImage);
}
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 0c51c15c03..6111f78cbf 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
@@ -953,7 +953,7 @@ final private void hookEventsForDateTimeSpinner () {
GTK.gtk_widget_add_controller(textEntryHandle, keyController);
GTK.gtk_event_controller_set_propagation_phase(keyController, GTK.GTK_PHASE_TARGET);
- long focusAddress = display.focusCallback.getAddress();
+ long /*int*/ focusAddress = display.focusCallback.getAddress();
OS.g_signal_connect (keyController, OS.focus_in, focusAddress, FOCUS_IN);
} else {
OS.g_signal_connect_closure (textEntryHandle, OS.focus_in_event, display.getClosure (FOCUS_IN_EVENT), true);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java
index 4c95960a22..39211debde 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java
@@ -262,7 +262,7 @@ public class Display extends Device {
Callback signalCallback;
long /*int*/ shellHandle;
boolean settingsChanged, runSettings;
- static final int STYLE_SET = 1;
+ static final int STYLE_UPDATED = 1;
static final int PROPERTY_NOTIFY = 2;
/* Entry focus behaviour */
@@ -3583,7 +3583,7 @@ void initializeCallbacks () {
signalIds [Widget.SHOW] = OS.g_signal_lookup (OS.show, GTK.GTK_TYPE_WIDGET ());
signalIds [Widget.SHOW_HELP] = OS.g_signal_lookup (OS.show_help, GTK.GTK_TYPE_WIDGET ());
signalIds [Widget.SIZE_ALLOCATE] = OS.g_signal_lookup (OS.size_allocate, GTK.GTK_TYPE_WIDGET ());
- signalIds [Widget.STYLE_SET] = OS.g_signal_lookup (OS.style_set, GTK.GTK_TYPE_WIDGET ());
+ signalIds [Widget.STYLE_UPDATED] = OS.g_signal_lookup (OS.style_updated, GTK.GTK_TYPE_WIDGET ());
signalIds [Widget.UNMAP] = OS.g_signal_lookup (OS.unmap, GTK.GTK_TYPE_WIDGET ());
signalIds [Widget.UNMAP_EVENT] = OS.g_signal_lookup (OS.unmap_event, GTK.GTK_TYPE_WIDGET ());
signalIds [Widget.UNREALIZE] = OS.g_signal_lookup (OS.realize, GTK.GTK_TYPE_WIDGET ());
@@ -3658,6 +3658,7 @@ void initializeCallbacks () {
closuresProc [Widget.SELECTION_DONE] = windowProc2;
closuresProc [Widget.SHOW] = windowProc2;
closuresProc [Widget.START_INTERACTIVE_SEARCH] = windowProc2;
+ closuresProc [Widget.STYLE_UPDATED] = windowProc2;
closuresProc [Widget.VALUE_CHANGED] = windowProc2;
closuresProc [Widget.UNMAP] = windowProc2;
closuresProc [Widget.UNREALIZE] = windowProc2;
@@ -3702,7 +3703,6 @@ void initializeCallbacks () {
closuresProc [Widget.SCROLL_EVENT] = windowProc3;
closuresProc [Widget.SHOW_HELP] = windowProc3;
closuresProc [Widget.SIZE_ALLOCATE] = windowProc3;
- closuresProc [Widget.STYLE_SET] = windowProc3;
closuresProc [Widget.TOGGLED] = windowProc3;
closuresProc [Widget.UNMAP_EVENT] = windowProc3;
closuresProc [Widget.WINDOW_STATE_EVENT] = windowProc3;
@@ -3869,7 +3869,7 @@ void initializeSubclasses () {
}
void initializeSystemSettings () {
- if (!GTK.GTK4) OS.g_signal_connect (shellHandle, OS.style_set, signalProc, STYLE_SET);
+ OS.g_signal_connect (shellHandle, OS.style_updated, signalProc, STYLE_UPDATED);
/*
* Feature in GTK. Despite the fact that the
@@ -5847,7 +5847,7 @@ String simple_color_parser (String output, String value, int index) {
long /*int*/ signalProc (long /*int*/ gobject, long /*int*/ arg1, long /*int*/ user_data) {
switch((int)/*64*/user_data) {
- case STYLE_SET:
+ case STYLE_UPDATED:
settingsChanged = true;
break;
}
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 047c811c50..a8e7500745 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
@@ -181,7 +181,7 @@ public abstract class Widget {
static final int SHOW = 45;
static final int SHOW_HELP = 46;
static final int SIZE_ALLOCATE = 47;
- static final int STYLE_SET = 48;
+ static final int STYLE_UPDATED = 48;
static final int SWITCH_PAGE = 49;
static final int TEST_COLLAPSE_ROW = 50;
static final int TEST_EXPAND_ROW = 51;
@@ -935,7 +935,7 @@ long /*int*/ gtk_start_interactive_search (long /*int*/ widget) {
return 0;
}
-long /*int*/ gtk_style_set (long /*int*/ widget, long /*int*/ previousStyle) {
+long /*int*/ gtk_style_updated (long /*int*/ widget) {
return 0;
}
@@ -2127,6 +2127,7 @@ long /*int*/ windowProc (long /*int*/ handle, long /*int*/ user_data) {
case PREEDIT_CHANGED: return gtk_preedit_changed (handle);
case REALIZE: return gtk_realize (handle);
case START_INTERACTIVE_SEARCH: return gtk_start_interactive_search (handle);
+ case STYLE_UPDATED: return gtk_style_updated (handle);
case SELECT: return gtk_select (handle);
case SELECTION_DONE: return gtk_selection_done (handle);
case SHOW: return gtk_show (handle);
@@ -2179,7 +2180,6 @@ long /*int*/ windowProc (long /*int*/ handle, long /*int*/ arg0, long /*int*/ us
case SCROLL_EVENT: return gtk_scroll_event (handle, arg0);
case SHOW_HELP: return gtk_show_help (handle, arg0);
case SIZE_ALLOCATE: return gtk_size_allocate (handle, arg0);
- case STYLE_SET: return gtk_style_set (handle, arg0);
case TOGGLED: return gtk_toggled (handle, arg0);
case UNMAP_EVENT: return gtk_unmap_event (handle, arg0);
case WINDOW_STATE_EVENT: return gtk_window_state_event (handle, arg0);

Back to the top