Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Williams2018-09-13 13:46:51 +0000
committerEric Williams2018-09-13 14:24:48 +0000
commitf69c6c9705d5efb20afcec433475821f66af8f6c (patch)
tree111414bf366bbe747b576fb81997e124759dff9b
parent90a62b023a71e8fa112cd55d70706ea8fad5def9 (diff)
downloadeclipse.platform.swt-f69c6c9705d5efb20afcec433475821f66af8f6c.tar.gz
eclipse.platform.swt-f69c6c9705d5efb20afcec433475821f66af8f6c.tar.xz
eclipse.platform.swt-f69c6c9705d5efb20afcec433475821f66af8f6c.zip
Bug 530841: [GTK2] Remove GTK 2.x support
Remove GtkFixed code from Display and elsewhere. Change-Id: Icc230063927ab86b48e7202a3b5e830d604a7a3d Signed-off-by: Eric Williams <ericwill@redhat.com>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c12
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c1
-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/GTK.java10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java21
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java55
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java9
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java8
8 files changed, 1 insertions, 116 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 c86e163b98..e2268420f0 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
@@ -3940,18 +3940,6 @@ JNIEXPORT jintLong JNICALL GTK_NATIVE(_1GTK_1TYPE_1CELL_1RENDERER_1TOGGLE)
}
#endif
-#ifndef NO__1GTK_1TYPE_1FIXED
-JNIEXPORT jintLong JNICALL GTK_NATIVE(_1GTK_1TYPE_1FIXED)
- (JNIEnv *env, jclass that)
-{
- jintLong rc = 0;
- GTK_NATIVE_ENTER(env, that, _1GTK_1TYPE_1FIXED_FUNC);
- rc = (jintLong)GTK_TYPE_FIXED;
- GTK_NATIVE_EXIT(env, that, _1GTK_1TYPE_1FIXED_FUNC);
- return rc;
-}
-#endif
-
#ifndef NO__1GTK_1TYPE_1IM_1MULTICONTEXT
JNIEXPORT jintLong JNICALL GTK_NATIVE(_1GTK_1TYPE_1IM_1MULTICONTEXT)
(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 be28834944..284477ee85 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
@@ -305,7 +305,6 @@ char * GTK_nativeFunctionNames[] = {
"_1GTK_1TYPE_1CELL_1RENDERER_1PIXBUF",
"_1GTK_1TYPE_1CELL_1RENDERER_1TEXT",
"_1GTK_1TYPE_1CELL_1RENDERER_1TOGGLE",
- "_1GTK_1TYPE_1FIXED",
"_1GTK_1TYPE_1IM_1MULTICONTEXT",
"_1GTK_1TYPE_1MENU",
"_1GTK_1TYPE_1WIDGET",
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 bd880452cd..8994725ef3 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
@@ -303,7 +303,6 @@ typedef enum {
_1GTK_1TYPE_1CELL_1RENDERER_1PIXBUF_FUNC,
_1GTK_1TYPE_1CELL_1RENDERER_1TEXT_FUNC,
_1GTK_1TYPE_1CELL_1RENDERER_1TOGGLE_FUNC,
- _1GTK_1TYPE_1FIXED_FUNC,
_1GTK_1TYPE_1IM_1MULTICONTEXT_FUNC,
_1GTK_1TYPE_1MENU_FUNC,
_1GTK_1TYPE_1WIDGET_FUNC,
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 bf5b90b8f2..12c43ff758 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
@@ -448,16 +448,6 @@ public class GTK extends OS {
}
}
/** @method flags=const */
- public static final native long /*int*/ _GTK_TYPE_FIXED();
- public static final long /*int*/ GTK_TYPE_FIXED() {
- lock.lock();
- try {
- return _GTK_TYPE_FIXED();
- } finally {
- lock.unlock();
- }
- }
- /** @method flags=const */
public static final native long /*int*/ _GTK_TYPE_MENU();
public static final long /*int*/ GTK_TYPE_MENU() {
lock.lock();
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 dfa2a9987f..2518e4608d 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
@@ -2704,27 +2704,6 @@ static void gtk_widget_reparent (Control control, long /*int*/ newParentHandle)
}
}
-@Override
-long /*int*/ fixedMapProc (long /*int*/ widget) {
- GTK.gtk_widget_set_mapped (widget, true);
- long /*int*/ widgetList = GTK.gtk_container_get_children (widget);
- if (widgetList != 0) {
- long /*int*/ widgets = widgetList;
- while (widgets != 0) {
- long /*int*/ child = OS.g_list_data (widgets);
- if (GTK.gtk_widget_get_visible (child) && GTK.gtk_widget_get_child_visible (child) && !GTK.gtk_widget_get_mapped (child)) {
- GTK.gtk_widget_map (child);
- }
- widgets = OS.g_list_next (widgets);
- }
- OS.g_list_free (widgetList);
- }
- if (GTK.gtk_widget_get_has_window (widget)) {
- GDK.gdk_window_show_unraised (gtk_widget_get_window (widget));
- }
- return 0;
-}
-
void fixModal(long /*int*/ group, long /*int*/ modalGroup) {
}
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 a7e3057fbe..363c70d74f 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
@@ -327,9 +327,6 @@ public class Display extends Device {
/* Fixed Subclass */
static long /*int*/ fixed_type;
- static long /*int*/ fixed_info_ptr;
- static Callback fixedClassInitCallback, fixedMapCallback, fixedSizeAllocateCallback;
- static long /*int*/ fixedClassInitProc, fixedMapProc, fixedSizeAllocateProc, oldFixedSizeAllocateProc;
/* Renderer Subclass */
static long /*int*/ text_renderer_type, pixbuf_renderer_type, toggle_renderer_type;
@@ -1052,33 +1049,7 @@ void createDisplay (DeviceData data) {
int major = GTK.gtk_major_version(), minor = GTK.gtk_minor_version (), micro = GTK.gtk_micro_version ();
System.out.println ("***WARNING: Detected: " + major + "." + minor + "." + micro); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
- if (GTK.GTK3) {
- fixed_type = OS.swt_fixed_get_type();
- }
- if (fixed_type == 0) {
- byte [] type_name = Converter.wcsToMbcs ("SwtFixed", true); //$NON-NLS-1$
- fixedClassInitCallback = new Callback (getClass (), "fixedClassInitProc", 2); //$NON-NLS-1$
- fixedClassInitProc = fixedClassInitCallback.getAddress ();
- if (fixedClassInitProc == 0) error (SWT.ERROR_NO_MORE_CALLBACKS);
- fixedMapCallback = new Callback (getClass (), "fixedMapProc", 1); //$NON-NLS-1$
- fixedMapProc = fixedMapCallback.getAddress ();
- if (fixedMapProc == 0) error (SWT.ERROR_NO_MORE_CALLBACKS);
- fixedSizeAllocateCallback = new Callback (getClass (), "fixedSizeAllocateProc", 2); //$NON-NLS-1$
- fixedSizeAllocateProc = fixedSizeAllocateCallback.getAddress ();
- if (fixedSizeAllocateProc == 0) error (SWT.ERROR_NO_MORE_CALLBACKS);
- long /*int*/ queryPtr = OS.g_malloc (GTypeQuery.sizeof);
- OS.g_type_query (GTK.GTK_TYPE_FIXED(), queryPtr);
- GTypeQuery query = new GTypeQuery ();
- OS.memmove (query, queryPtr, GTypeQuery.sizeof);
- OS.g_free (queryPtr);
- GTypeInfo fixed_info = new GTypeInfo ();
- fixed_info.class_size = (short) query.class_size;
- fixed_info.class_init = fixedClassInitProc;
- fixed_info.instance_size = (short) query.instance_size;
- fixed_info_ptr = OS.g_malloc (GTypeInfo.sizeof);
- OS.memmove (fixed_info_ptr, fixed_info, GTypeInfo.sizeof);
- fixed_type = OS.g_type_register_static (GTK.GTK_TYPE_FIXED (), type_name, fixed_info_ptr, 0);
- }
+ fixed_type = OS.swt_fixed_get_type();
if (rendererClassInitProc == 0) {
rendererClassInitCallback = new Callback (getClass (), "rendererClassInitProc", 2); //$NON-NLS-1$
rendererClassInitProc = rendererClassInitCallback.getAddress ();
@@ -1485,30 +1456,6 @@ public Widget findWidget (Widget widget, long /*int*/ id) {
return null;
}
-static long /*int*/ fixedClassInitProc (long /*int*/ g_class, long /*int*/ class_data) {
- GtkWidgetClass klass = new GtkWidgetClass ();
- OS.memmove (klass, g_class);
- klass.map = fixedMapProc;
- oldFixedSizeAllocateProc = klass.size_allocate;
- klass.size_allocate = fixedSizeAllocateProc;
- OS.memmove (g_class, klass);
- return 0;
-}
-
-static long /*int*/ fixedMapProc (long /*int*/ handle) {
- Display display = getCurrent ();
- Widget widget = display.getWidget (handle);
- if (widget != null) return widget.fixedMapProc (handle);
- return 0;
-}
-
-static long /*int*/ fixedSizeAllocateProc (long /*int*/ handle, long /*int*/ allocation) {
- Display display = getCurrent ();
- Widget widget = display.getWidget (handle);
- if (widget != null) return widget.fixedSizeAllocateProc (handle, allocation);
- return OS.Call (oldFixedSizeAllocateProc, handle, allocation);
-}
-
static long /*int*/ rendererClassInitProc (long /*int*/ g_class, long /*int*/ class_data) {
GtkCellRendererClass klass = new GtkCellRendererClass ();
OS.memmove (klass, g_class);
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 05cae862ba..3af079bf92 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
@@ -1006,15 +1006,6 @@ void fixShell (Shell newShell, Control control) {
}
@Override
-long /*int*/ fixedSizeAllocateProc(long /*int*/ widget, long /*int*/ allocationPtr) {
- int clientWidth = 0;
- if ((style & SWT.MIRRORED) != 0) clientWidth = getClientWidth ();
- long /*int*/ result = super.fixedSizeAllocateProc (widget, allocationPtr);
- if ((style & SWT.MIRRORED) != 0) moveChildren (clientWidth);
- return result;
-}
-
-@Override
void fixStyle (long /*int*/ 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 2aba6133f5..f52b743be6 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
@@ -999,14 +999,6 @@ boolean filters (int eventType) {
return display.filters (eventType);
}
-long /*int*/ fixedMapProc (long /*int*/ widget) {
- return 0;
-}
-
-long /*int*/ fixedSizeAllocateProc(long /*int*/ widget, long /*int*/ allocationPtr) {
- return OS.Call (Display.oldFixedSizeAllocateProc, widget, allocationPtr);
-}
-
char [] fixMnemonic (String string) {
return fixMnemonic (string, true);
}

Back to the top