comparison org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Display.d @ 47:65761bc28ab2

swt linux again compilable for d1.
author Frank Benoit <benoit@tionex.de>
date Fri, 27 Mar 2009 11:43:53 +0100
parents f713da8bc051
children ddbfe84d86df
comparison
equal deleted inserted replaced
46:17310ba3c1bc 47:65761bc28ab2
44 import org.eclipse.swt.widgets.Widget; 44 import org.eclipse.swt.widgets.Widget;
45 45
46 import tango.stdc.string; 46 import tango.stdc.string;
47 import java.lang.all; 47 import java.lang.all;
48 48
49 import tango.core.Thread; 49 import java.lang.Thread;
50 50
51 /** 51 /**
52 * Instances of this class are responsible for managing the 52 * Instances of this class are responsible for managing the
53 * connection between SWT and the underlying operating 53 * connection between SWT and the underlying operating
54 * system. Their most important function is to implement 54 * system. Their most important function is to implement
761 widget.cellDataProc (tree_column, cell, tree_model, iter, data); 761 widget.cellDataProc (tree_column, cell, tree_model, iter, data);
762 } 762 }
763 763
764 protected override void checkDevice () { 764 protected override void checkDevice () {
765 if (thread is null) error (SWT.ERROR_WIDGET_DISPOSED); 765 if (thread is null) error (SWT.ERROR_WIDGET_DISPOSED);
766 if (thread !is Thread.getThis ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); 766 if (thread !is Thread.currentThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS);
767 if (isDisposed ()) error (SWT.ERROR_DEVICE_DISPOSED); 767 if (isDisposed ()) error (SWT.ERROR_DEVICE_DISPOSED);
768 } 768 }
769 769
770 static void checkDisplay (Thread thread, bool multiple) { 770 static void checkDisplay (Thread thread, bool multiple) {
771 synchronized (Device.classinfo) { 771 synchronized (Device.classinfo) {
905 * 905 *
906 * @see #init 906 * @see #init
907 */ 907 */
908 protected override void create (DeviceData data) { 908 protected override void create (DeviceData data) {
909 checkSubclass (); 909 checkSubclass ();
910 checkDisplay(thread = Thread.getThis (), false); 910 checkDisplay(thread = Thread.currentThread (), false);
911 createDisplay (data); 911 createDisplay (data);
912 register (this); 912 register (this);
913 if (Default is null) Default = this; 913 if (Default is null) Default = this;
914 } 914 }
915 915
1420 * running thread is not a user-interface thread for any display. 1420 * running thread is not a user-interface thread for any display.
1421 * 1421 *
1422 * @return the current display 1422 * @return the current display
1423 */ 1423 */
1424 public static Display getCurrent () { 1424 public static Display getCurrent () {
1425 return findDisplay (Thread.getThis ()); 1425 return findDisplay (Thread.currentThread ());
1426 } 1426 }
1427 1427
1428 int getCaretBlinkTime () { 1428 int getCaretBlinkTime () {
1429 // checkDevice (); 1429 // checkDevice ();
1430 auto settings = OS.gtk_settings_get_default (); 1430 auto settings = OS.gtk_settings_get_default ();
2614 return gdkGC; 2614 return gdkGC;
2615 return null; 2615 return null;
2616 } 2616 }
2617 2617
2618 bool isValidThread () { 2618 bool isValidThread () {
2619 return thread is Thread.getThis (); 2619 return thread is Thread.currentThread ();
2620 } 2620 }
2621 2621
2622 /** 2622 /**
2623 * Maps a point from one coordinate system to another. 2623 * Maps a point from one coordinate system to another.
2624 * When the control is null, coordinates are mapped to 2624 * When the control is null, coordinates are mapped to
4151 * @see #sleep 4151 * @see #sleep
4152 */ 4152 */
4153 public void wake () { 4153 public void wake () {
4154 synchronized (Device.classinfo) { 4154 synchronized (Device.classinfo) {
4155 if (isDisposed ()) error (SWT.ERROR_DEVICE_DISPOSED); 4155 if (isDisposed ()) error (SWT.ERROR_DEVICE_DISPOSED);
4156 if (thread is Thread.getThis ()) return; 4156 if (thread is Thread.currentThread ()) return;
4157 wakeThread (); 4157 wakeThread ();
4158 } 4158 }
4159 } 4159 }
4160 4160
4161 void wakeThread () { 4161 void wakeThread () {