diff options
author | Boris Shingarov | 2002-03-10 05:28:43 +0000 |
---|---|---|
committer | Boris Shingarov | 2002-03-10 05:28:43 +0000 |
commit | 0b07d255be56f483e0715ddc9d6bcff07b3f7f99 (patch) | |
tree | 34040f0f4fd8d0d0da12a73dbf5dd5f9ef894f87 | |
parent | aad66d7a05aa8e672f7b912a8c0213d93037542a (diff) | |
download | eclipse.platform.swt-0b07d255be56f483e0715ddc9d6bcff07b3f7f99.tar.gz eclipse.platform.swt-0b07d255be56f483e0715ddc9d6bcff07b3f7f99.tar.xz eclipse.platform.swt-0b07d255be56f483e0715ddc9d6bcff07b3f7f99.zip |
*** empty log message ***
10 files changed, 16 insertions, 80 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GdkEvent.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GdkEvent.java deleted file mode 100644 index 95c783b4d0..0000000000 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GdkEvent.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.eclipse.swt.internal.gtk;
-
-/*
- * Copyright (c) IBM Corp. 2000, 2001. 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
- * available at http://www.gnu.org/licenses/lgpl.html. If the version
- * of the LGPL at http://www.gnu.org is different to the version of
- * the LGPL accompanying this distribution and there is any conflict
- * between the two license versions, the terms of the LGPL accompanying
- * this distribution shall govern.
- */
-
-public class GdkEvent {
- public int type;
- public int window;
- public byte send_event;
-
- GdkEvent() {};
- public GdkEvent(int ptr) {
- OS.memmove(this, ptr);
- }
-}
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 558d1f2325..6c4af74b6a 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 @@ -398,6 +398,7 @@ public static final native void gdk_flush(); public static final native void gdk_beep(); public static final native void gdk_color_free(GdkColor color); public static final native int GDK_ROOT_PARENT(); +public static final native int GDK_EVENT_TYPE(int event); public static final native void gdk_gc_set_stipple(int gc, int stipple); public static final native void gdk_gc_set_subwindow(int gc, int mode); public static final native void gdk_gc_set_fill(int gc, int fill); @@ -427,7 +428,7 @@ public static final native void gdk_window_clear_area_e(int window, int x, int y public static final native void gdk_window_resize(int window, int width, int height); public static final native void gdk_window_move (int window, int x, int y); public static final native int gdk_window_at_pointer(int[] win_x, int[] win_y); -public static final native int gdk_time_get(); +public static final native int GDK_CURRENT_TIME(); public static final native int gdk_screen_width_mm(); public static final native void gdk_window_get_geometry(int window, int[] x, int[] y, int[] width, int[] height, int[] depth); public static final native void gdk_window_raise(int window); @@ -742,7 +743,6 @@ public static final native void memmove(int dest, int[] src, int size); public static final native void memmove(GdkVisual dest, int src); public static final native void memmove(GdkFont dest, int src); public static final native void memmove(GdkColor dest, int src); -public static final native void memmove(GdkEvent dest, int src); public static final native void memmove(GdkEventExpose dest, int src); public static final native void memmove(GtkAdjustment dest, int src); public static final native void memmove(GtkCombo dest, int src); diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk1x/org/eclipse/swt/internal/gtk/GdkEvent.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk1x/org/eclipse/swt/internal/gtk/GdkEvent.java deleted file mode 100644 index 95c783b4d0..0000000000 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk1x/org/eclipse/swt/internal/gtk/GdkEvent.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.eclipse.swt.internal.gtk;
-
-/*
- * Copyright (c) IBM Corp. 2000, 2001. 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
- * available at http://www.gnu.org/licenses/lgpl.html. If the version
- * of the LGPL at http://www.gnu.org is different to the version of
- * the LGPL accompanying this distribution and there is any conflict
- * between the two license versions, the terms of the LGPL accompanying
- * this distribution shall govern.
- */
-
-public class GdkEvent {
- public int type;
- public int window;
- public byte send_event;
-
- GdkEvent() {};
- public GdkEvent(int ptr) {
- OS.memmove(this, ptr);
- }
-}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk1x/org/eclipse/swt/internal/gtk/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk1x/org/eclipse/swt/internal/gtk/OS.java index 558d1f2325..6c4af74b6a 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk1x/org/eclipse/swt/internal/gtk/OS.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk1x/org/eclipse/swt/internal/gtk/OS.java @@ -398,6 +398,7 @@ public static final native void gdk_flush(); public static final native void gdk_beep(); public static final native void gdk_color_free(GdkColor color); public static final native int GDK_ROOT_PARENT(); +public static final native int GDK_EVENT_TYPE(int event); public static final native void gdk_gc_set_stipple(int gc, int stipple); public static final native void gdk_gc_set_subwindow(int gc, int mode); public static final native void gdk_gc_set_fill(int gc, int fill); @@ -427,7 +428,7 @@ public static final native void gdk_window_clear_area_e(int window, int x, int y public static final native void gdk_window_resize(int window, int width, int height); public static final native void gdk_window_move (int window, int x, int y); public static final native int gdk_window_at_pointer(int[] win_x, int[] win_y); -public static final native int gdk_time_get(); +public static final native int GDK_CURRENT_TIME(); public static final native int gdk_screen_width_mm(); public static final native void gdk_window_get_geometry(int window, int[] x, int[] y, int[] width, int[] height, int[] depth); public static final native void gdk_window_raise(int window); @@ -742,7 +743,6 @@ public static final native void memmove(int dest, int[] src, int size); public static final native void memmove(GdkVisual dest, int src); public static final native void memmove(GdkFont dest, int src); public static final native void memmove(GdkColor dest, int src); -public static final native void memmove(GdkEvent dest, int src); public static final native void memmove(GdkEventExpose dest, int src); public static final native void memmove(GtkAdjustment dest, int src); public static final native void memmove(GtkCombo dest, int src); 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 51ca296ec5..f31d7b7392 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 @@ -1470,9 +1470,8 @@ int processKeyUp (int callData, int arg1, int int2) { int processMouseDown (int callData, int arg1, int int2) { OS.gtk_widget_grab_focus(handle); - GdkEvent gdkEvent = new GdkEvent(callData); int eventType = SWT.MouseDown; - if (gdkEvent.type == OS.GDK_2BUTTON_PRESS) eventType = SWT.MouseDoubleClick; + if (OS.GDK_EVENT_TYPE(callData) == OS.GDK_2BUTTON_PRESS) eventType = SWT.MouseDoubleClick; int[] pMod = new int[1]; OS.gdk_event_get_state(callData, pMod); int time = OS.gdk_event_get_time(callData); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java index 650ac7809a..054e369425 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java @@ -668,16 +668,10 @@ int processSelection (int int0, int int1, int int2) { GtkCList clist = new GtkCList (handle); if (int0 != clist.focus_row) return 0; if ((style & SWT.MULTI) != 0) selected = false; - boolean single = true; - if (int2 != 0) { - GdkEvent gdkEvent = new GdkEvent (int2); - single = gdkEvent.type != OS.GDK_2BUTTON_PRESS; - } - if (single) { - postEvent (SWT.Selection); - } else { - postEvent (SWT.DefaultSelection); - } + int type = SWT.Selection; + if (int2 != 0) + if (OS.GDK_EVENT_TYPE(int2) == OS.GDK_2BUTTON_PRESS) type = SWT.DefaultSelection; + postEvent (type); return 0; } 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 22c278c577..31e1bbccfa 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 @@ -312,7 +312,7 @@ public void close () { } void closeWidget () { Event event = new Event (); - event.time = OS.gdk_time_get (); + event.time = OS.GDK_CURRENT_TIME(); sendEvent (SWT.Close, event); if (event.doit && !isDisposed ()) dispose (); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk1x/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk1x/org/eclipse/swt/widgets/Control.java index 51ca296ec5..f31d7b7392 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk1x/org/eclipse/swt/widgets/Control.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk1x/org/eclipse/swt/widgets/Control.java @@ -1470,9 +1470,8 @@ int processKeyUp (int callData, int arg1, int int2) { int processMouseDown (int callData, int arg1, int int2) { OS.gtk_widget_grab_focus(handle); - GdkEvent gdkEvent = new GdkEvent(callData); int eventType = SWT.MouseDown; - if (gdkEvent.type == OS.GDK_2BUTTON_PRESS) eventType = SWT.MouseDoubleClick; + if (OS.GDK_EVENT_TYPE(callData) == OS.GDK_2BUTTON_PRESS) eventType = SWT.MouseDoubleClick; int[] pMod = new int[1]; OS.gdk_event_get_state(callData, pMod); int time = OS.gdk_event_get_time(callData); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk1x/org/eclipse/swt/widgets/List.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk1x/org/eclipse/swt/widgets/List.java index 650ac7809a..054e369425 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk1x/org/eclipse/swt/widgets/List.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk1x/org/eclipse/swt/widgets/List.java @@ -668,16 +668,10 @@ int processSelection (int int0, int int1, int int2) { GtkCList clist = new GtkCList (handle); if (int0 != clist.focus_row) return 0; if ((style & SWT.MULTI) != 0) selected = false; - boolean single = true; - if (int2 != 0) { - GdkEvent gdkEvent = new GdkEvent (int2); - single = gdkEvent.type != OS.GDK_2BUTTON_PRESS; - } - if (single) { - postEvent (SWT.Selection); - } else { - postEvent (SWT.DefaultSelection); - } + int type = SWT.Selection; + if (int2 != 0) + if (OS.GDK_EVENT_TYPE(int2) == OS.GDK_2BUTTON_PRESS) type = SWT.DefaultSelection; + postEvent (type); return 0; } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk1x/org/eclipse/swt/widgets/Shell.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk1x/org/eclipse/swt/widgets/Shell.java index 22c278c577..31e1bbccfa 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk1x/org/eclipse/swt/widgets/Shell.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk1x/org/eclipse/swt/widgets/Shell.java @@ -312,7 +312,7 @@ public void close () { } void closeWidget () { Event event = new Event (); - event.time = OS.gdk_time_get (); + event.time = OS.GDK_CURRENT_TIME(); sendEvent (SWT.Close, event); if (event.doit && !isDisposed ()) dispose (); } |