Changeset 351:f1bb3949939b
- Timestamp:
- 11/03/08 17:35:30
(2 months ago)
- Author:
- Frank Benoit <benoit@tionex.de>
- branch:
- default
- Message:
Update to SWT 3.4.1
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r350 |
r351 |
|
| 1 | 1 | |
|---|
| 2 | 2 | [dwt] |
|---|
| | 3 | buildflags+=-Jres |
|---|
| 3 | 4 | type=library |
|---|
| 4 | 5 | |
|---|
| r259 |
r351 |
|
| 533 | 533 | } |
|---|
| 534 | 534 | void dropDown (bool drop) { |
|---|
| 535 | | if (drop is isDropped () || !isVisible()) return; |
|---|
| | 535 | if (drop is isDropped ()) return; |
|---|
| 536 | 536 | if (!drop) { |
|---|
| 537 | 537 | popup.setVisible (false); |
|---|
| … | … | |
| 541 | 541 | return; |
|---|
| 542 | 542 | } |
|---|
| 543 | | |
|---|
| | 543 | if (!isVisible()) return; |
|---|
| 544 | 544 | if (getShell() !is popup.getParent ()) { |
|---|
| 545 | 545 | String[] items = list.getItems (); |
|---|
| r259 |
r351 |
|
| 36 | 36 | * DWT Minor version number (must be in the range 0..999) |
|---|
| 37 | 37 | */ |
|---|
| 38 | | static const int MINOR_VERSION = 448; |
|---|
| | 38 | static const int MINOR_VERSION = 449; |
|---|
| 39 | 39 | |
|---|
| 40 | 40 | /** |
|---|
| r325 |
r351 |
|
| 1240 | 1240 | mixin ForwardGtkOsCFunc!(.XSetErrorHandler); |
|---|
| 1241 | 1241 | mixin ForwardGtkOsCFunc!(.XSetInputFocus); |
|---|
| | 1242 | mixin ForwardGtkOsCFunc!(.XSetTransientForHint); |
|---|
| 1242 | 1243 | mixin ForwardGtkOsCFunc!(.XSynchronize); |
|---|
| 1243 | 1244 | mixin ForwardGtkOsCFunc!(.XTestFakeButtonEvent); |
|---|
| r328 |
r351 |
|
| 247 | 247 | String gnomeName = "_NET_SUPPORTING_WM_CHECK"; |
|---|
| 248 | 248 | int /*long*/ gnome = OS.XInternAtom(xDisplay, gnomeName.ptr, true); |
|---|
| 249 | | if (gnome !is OS.None && gnome_init()) { |
|---|
| | 249 | if (gnome !is OS.None && (OS.GTK_VERSION >= OS.buildVERSION (2, 2, 0)) && gnome_init()) { |
|---|
| 250 | 250 | desktop = DESKTOP_GNOME; |
|---|
| 251 | 251 | int icon_theme = cast(int)GNOME.gnome_icon_theme_new(); |
|---|
| r259 |
r351 |
|
| 72 | 72 | alias Composite.createHandle createHandle; |
|---|
| 73 | 73 | alias Composite.dragDetect dragDetect; |
|---|
| | 74 | alias Composite.gtk_button_press_event gtk_button_press_event; |
|---|
| 74 | 75 | alias Composite.setBackgroundColor setBackgroundColor; |
|---|
| 75 | 76 | alias Composite.setBounds setBounds; |
|---|
| … | … | |
| 925 | 926 | * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
|---|
| 926 | 927 | * </ul> |
|---|
| 927 | | * |
|---|
| | 928 | * |
|---|
| 928 | 929 | * @since 3.4 |
|---|
| 929 | 930 | */ |
|---|
| … | … | |
| 1134 | 1135 | */ |
|---|
| 1135 | 1136 | if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) { |
|---|
| 1136 | | if (event.type is OS.GDK_BUTTON_PRESS) return 0; |
|---|
| | 1137 | GdkEventButton* gdkEvent = event; |
|---|
| | 1138 | if (gdkEvent.type is OS.GDK_BUTTON_PRESS && gdkEvent.button is 1 && (style & DWT.READ_ONLY) !is 0) { |
|---|
| | 1139 | return gtk_button_press_event(widget, event, false); |
|---|
| | 1140 | } |
|---|
| | 1141 | |
|---|
| 1137 | 1142 | } |
|---|
| 1138 | 1143 | return super.gtk_button_press_event (widget, event); |
|---|
| … | … | |
| 1278 | 1283 | GdkEventButton* gdkEventButton = cast(GdkEventButton*)event; |
|---|
| 1279 | 1284 | if (gdkEventButton.button is 1) { |
|---|
| 1280 | | if (!sendMouseEvent (DWT.MouseDown, gdkEventButton.button, display.clickCount, 0, false, gdkEventButton.time, gdkEventButton.x_root, gdkEventButton.y_root, false, gdkEventButton.state)) { |
|---|
| | 1285 | 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)) { |
|---|
| 1281 | 1286 | return 1; |
|---|
| 1282 | 1287 | } |
|---|
| … | … | |
| 1967 | 1972 | * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
|---|
| 1968 | 1973 | * </ul> |
|---|
| 1969 | | * |
|---|
| | 1974 | * |
|---|
| 1970 | 1975 | * @since 3.4 |
|---|
| 1971 | 1976 | */ |
|---|
| r259 |
r351 |
|
| 72 | 72 | alias Scrollable.fixStyle fixStyle; |
|---|
| 73 | 73 | alias Scrollable.forceFocus forceFocus; |
|---|
| | 74 | alias Scrollable.gtk_button_press_event gtk_button_press_event; |
|---|
| 74 | 75 | alias Scrollable.moveAbove moveAbove; |
|---|
| 75 | 76 | alias Scrollable.moveBelow moveBelow; |
|---|
| r259 |
r351 |
|
| 79 | 79 | * within the DWT implementation. |
|---|
| 80 | 80 | * </p> |
|---|
| 81 | | * |
|---|
| | 81 | * |
|---|
| 82 | 82 | * @see <a href="http://www.eclipse.org/swt/snippets/#control">Control snippets</a> |
|---|
| 83 | 83 | * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: ControlExample</a> |
|---|
| … | … | |
| 338 | 338 | /** |
|---|
| 339 | 339 | * Prints the receiver and all children. |
|---|
| 340 | | * |
|---|
| | 340 | * |
|---|
| 341 | 341 | * @param gc the gc where the drawing occurs |
|---|
| 342 | 342 | * @return <code>true</code> if the operation was successful and <code>false</code> otherwise |
|---|
| … | … | |
| 350 | 350 | * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
|---|
| 351 | 351 | * </ul> |
|---|
| 352 | | * |
|---|
| | 352 | * |
|---|
| 353 | 353 | * @since 3.4 |
|---|
| 354 | 354 | */ |
|---|
| … | … | |
| 1001 | 1001 | * @exception IllegalArgumentException <ul> |
|---|
| 1002 | 1002 | * <li>ERROR_INVALID_ARGUMENT - if the region has been disposed</li> |
|---|
| 1003 | | * </ul> |
|---|
| | 1003 | * </ul> |
|---|
| 1004 | 1004 | * @exception DWTException <ul> |
|---|
| 1005 | 1005 | * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
|---|
| … | … | |
| 2470 | 2470 | } |
|---|
| 2471 | 2471 | |
|---|
| 2472 | | /** |
|---|
| | 2472 | /** |
|---|
| 2473 | 2473 | * Returns the region that defines the shape of the control, |
|---|
| 2474 | 2474 | * or null if the control has the default shape. |
|---|
| 2475 | 2475 | * |
|---|
| 2476 | 2476 | * @return the region that defines the shape of the shell (or null) |
|---|
| 2477 | | * |
|---|
| | 2477 | * |
|---|
| 2478 | 2478 | * @exception DWTException <ul> |
|---|
| 2479 | 2479 | * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
|---|
| … | … | |
| 2549 | 2549 | } |
|---|
| 2550 | 2550 | |
|---|
| 2551 | | override int /*long*/ gtk_button_press_event (GtkWidget* widget, GdkEventButton* gdkEvent) { |
|---|
| | 2551 | override int /*long*/ gtk_button_press_event (GtkWidget* widget, GdkEventButton* event) { |
|---|
| | 2552 | return gtk_button_press_event (widget, event, true); |
|---|
| | 2553 | } |
|---|
| | 2554 | |
|---|
| | 2555 | int /*long*/ gtk_button_press_event (GtkWidget* widget, GdkEventButton* gdkEvent, bool sendMouseDown) { |
|---|
| 2552 | 2556 | if (gdkEvent.type is OS.GDK_3BUTTON_PRESS) return 0; |
|---|
| 2553 | 2557 | |
|---|
| … | … | |
| 2583 | 2587 | } |
|---|
| 2584 | 2588 | } |
|---|
| 2585 | | if (!sendMouseEvent (DWT.MouseDown, gdkEvent.button, display.clickCount, 0, false, gdkEvent.time, gdkEvent.x_root, gdkEvent.y_root, false, gdkEvent.state)) { |
|---|
| | 2589 | if (sendMouseDown && !sendMouseEvent (DWT.MouseDown, gdkEvent.button, display.clickCount, 0, false, gdkEvent.time, gdkEvent.x_root, gdkEvent.y_root, false, gdkEvent.state)) { |
|---|
| 2586 | 2590 | result = 1; |
|---|
| 2587 | 2591 | } |
|---|