changeset 351:f1bb3949939b

Update to SWT 3.4.1
author Frank Benoit <benoit@tionex.de>
date Mon, 03 Nov 2008 23:35:30 +0100
parents 373b48b9eaf0
children a3c5f744d03f
files dsss.conf dwt/custom/CCombo.d dwt/internal/Library.d dwt/internal/gtk/OS.d dwt/program/Program.d dwt/widgets/Combo.d dwt/widgets/Composite.d dwt/widgets/Control.d
diffstat 8 files changed, 28 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/dsss.conf	Sun Nov 02 01:30:09 2008 -0800
+++ b/dsss.conf	Mon Nov 03 23:35:30 2008 +0100
@@ -1,4 +1,5 @@
 
 [dwt]
+buildflags+=-Jres
 type=library
 
--- a/dwt/custom/CCombo.d	Sun Nov 02 01:30:09 2008 -0800
+++ b/dwt/custom/CCombo.d	Mon Nov 03 23:35:30 2008 +0100
@@ -532,7 +532,7 @@
     list.deselectAll ();
 }
 void dropDown (bool drop) {
-    if (drop is isDropped () || !isVisible()) return;
+    if (drop is isDropped ()) return;
     if (!drop) {
         popup.setVisible (false);
         if (!isDisposed () && isFocusControl()) {
@@ -540,7 +540,7 @@
         }
         return;
     }
-
+    if (!isVisible()) return;
     if (getShell() !is popup.getParent ()) {
         String[] items = list.getItems ();
         int selectionIndex = list.getSelectionIndex ();
--- a/dwt/internal/Library.d	Sun Nov 02 01:30:09 2008 -0800
+++ b/dwt/internal/Library.d	Mon Nov 03 23:35:30 2008 +0100
@@ -35,7 +35,7 @@
     /**
      * DWT Minor version number (must be in the range 0..999)
      */
-    static const int MINOR_VERSION = 448;
+    static const int MINOR_VERSION = 449;
 
     /**
      * DWT revision number (must be >= 0)
--- a/dwt/internal/gtk/OS.d	Sun Nov 02 01:30:09 2008 -0800
+++ b/dwt/internal/gtk/OS.d	Mon Nov 03 23:35:30 2008 +0100
@@ -1239,6 +1239,7 @@
     mixin ForwardGtkOsCFunc!(.XSetIOErrorHandler);
     mixin ForwardGtkOsCFunc!(.XSetErrorHandler);
     mixin ForwardGtkOsCFunc!(.XSetInputFocus);
+    mixin ForwardGtkOsCFunc!(.XSetTransientForHint);
     mixin ForwardGtkOsCFunc!(.XSynchronize);
     mixin ForwardGtkOsCFunc!(.XTestFakeButtonEvent);
     mixin ForwardGtkOsCFunc!(.XTestFakeKeyEvent);
--- a/dwt/program/Program.d	Sun Nov 02 01:30:09 2008 -0800
+++ b/dwt/program/Program.d	Mon Nov 03 23:35:30 2008 +0100
@@ -246,7 +246,7 @@
     if (desktop is DESKTOP_UNKNOWN) {
         String gnomeName = "_NET_SUPPORTING_WM_CHECK";
         int /*long*/ gnome = OS.XInternAtom(xDisplay, gnomeName.ptr, true);
-        if (gnome !is OS.None && gnome_init()) {
+        if (gnome !is OS.None && (OS.GTK_VERSION >= OS.buildVERSION (2, 2, 0)) && gnome_init()) {
             desktop = DESKTOP_GNOME;
             int icon_theme = cast(int)GNOME.gnome_icon_theme_new();
             display.setData(ICON_THEME_DATA, new ValueWrapperInt(icon_theme));
--- a/dwt/widgets/Combo.d	Sun Nov 02 01:30:09 2008 -0800
+++ b/dwt/widgets/Combo.d	Mon Nov 03 23:35:30 2008 +0100
@@ -71,6 +71,7 @@
     alias Composite.computeSize computeSize;
     alias Composite.createHandle createHandle;
     alias Composite.dragDetect dragDetect;
+    alias Composite.gtk_button_press_event gtk_button_press_event;
     alias Composite.setBackgroundColor setBackgroundColor;
     alias Composite.setBounds setBounds;
     alias Composite.setForegroundColor setForegroundColor;
@@ -924,7 +925,7 @@
  *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  * </ul>
- * 
+ *
  * @since 3.4
  */
 public bool getListVisible () {
@@ -1133,7 +1134,11 @@
     * send the mouse event from the event_after handler.
     */
     if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) {
-        if (event.type is OS.GDK_BUTTON_PRESS) return 0;
+        GdkEventButton* gdkEvent = event;
+        if (gdkEvent.type is OS.GDK_BUTTON_PRESS && gdkEvent.button is 1 && (style & DWT.READ_ONLY) !is 0) {
+            return gtk_button_press_event(widget, event, false);
+        }
+
     }
     return super.gtk_button_press_event (widget, event);
 }
@@ -1277,7 +1282,7 @@
             case OS.GDK_BUTTON_PRESS: {
                 GdkEventButton* gdkEventButton = cast(GdkEventButton*)event;
                 if (gdkEventButton.button is 1) {
-                    if (!sendMouseEvent (DWT.MouseDown, gdkEventButton.button, display.clickCount, 0, false, gdkEventButton.time, gdkEventButton.x_root, gdkEventButton.y_root, false, gdkEventButton.state)) {
+                    if ((style & DWT.READ_ONLY) !is 0 && !sendMouseEvent (DWT.MouseDown, gdkEventButton.button, display.clickCount, 0, false, gdkEventButton.time, gdkEventButton.x_root, gdkEventButton.y_root, false, gdkEventButton.state)) {
                         return 1;
                     }
                     if (OS.GTK_VERSION >= OS.buildVERSION (2, 6, 0)) {
@@ -1966,7 +1971,7 @@
  *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  * </ul>
- * 
+ *
  * @since 3.4
  */
 public void setListVisible (bool visible) {
--- a/dwt/widgets/Composite.d	Sun Nov 02 01:30:09 2008 -0800
+++ b/dwt/widgets/Composite.d	Mon Nov 03 23:35:30 2008 +0100
@@ -71,6 +71,7 @@
     alias Scrollable.computeSize computeSize;
     alias Scrollable.fixStyle fixStyle;
     alias Scrollable.forceFocus forceFocus;
+    alias Scrollable.gtk_button_press_event gtk_button_press_event;
     alias Scrollable.moveAbove moveAbove;
     alias Scrollable.moveBelow moveBelow;
     alias Scrollable.setBounds setBounds;
--- a/dwt/widgets/Control.d	Sun Nov 02 01:30:09 2008 -0800
+++ b/dwt/widgets/Control.d	Mon Nov 03 23:35:30 2008 +0100
@@ -78,7 +78,7 @@
  * IMPORTANT: This class is intended to be subclassed <em>only</em>
  * within the DWT implementation.
  * </p>
- * 
+ *
  * @see <a href="http://www.eclipse.org/swt/snippets/#control">Control snippets</a>
  * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: ControlExample</a>
  * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
@@ -337,7 +337,7 @@
 
 /**
  * Prints the receiver and all children.
- * 
+ *
  * @param gc the gc where the drawing occurs
  * @return <code>true</code> if the operation was successful and <code>false</code> otherwise
  *
@@ -349,7 +349,7 @@
  *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  * </ul>
- * 
+ *
  * @since 3.4
  */
 public bool print (GC gc) {
@@ -1000,7 +1000,7 @@
  *
  * @exception IllegalArgumentException <ul>
  *    <li>ERROR_INVALID_ARGUMENT - if the region has been disposed</li>
- * </ul>  
+ * </ul>
  * @exception DWTException <ul>
  *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
@@ -2469,12 +2469,12 @@
     return result;
 }
 
-/** 
+/**
  * Returns the region that defines the shape of the control,
  * or null if the control has the default shape.
  *
  * @return the region that defines the shape of the shell (or null)
- *  
+ *
  * @exception DWTException <ul>
  *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
@@ -2548,7 +2548,11 @@
     return (state & HIDDEN) is 0;
 }
 
-override int /*long*/ gtk_button_press_event (GtkWidget* widget, GdkEventButton* gdkEvent) {
+override int /*long*/ gtk_button_press_event (GtkWidget* widget, GdkEventButton* event) {
+    return gtk_button_press_event (widget, event, true);
+}
+
+int /*long*/ gtk_button_press_event (GtkWidget* widget, GdkEventButton* gdkEvent, bool sendMouseDown) {
     if (gdkEvent.type is OS.GDK_3BUTTON_PRESS) return 0;
 
     /*
@@ -2582,7 +2586,7 @@
                 if (isDisposed ()) return 1;
             }
         }
-        if (!sendMouseEvent (DWT.MouseDown, gdkEvent.button, display.clickCount, 0, false, gdkEvent.time, gdkEvent.x_root, gdkEvent.y_root, false, gdkEvent.state)) {
+        if (sendMouseDown && !sendMouseEvent (DWT.MouseDown, gdkEvent.button, display.clickCount, 0, false, gdkEvent.time, gdkEvent.x_root, gdkEvent.y_root, false, gdkEvent.state)) {
             result = 1;
         }
         if (isDisposed ()) return 1;