Changeset 42
- Timestamp:
- 01/03/05 01:55:04 (4 years ago)
- Files:
-
- trunk/src/HelloDWT.d (modified) (1 diff)
- trunk/src/SConstruct (modified) (2 diffs)
- trunk/src/dwt/accessibility/accessible.d (modified) (62 diffs)
- trunk/src/dwt/graphics/color.d (modified) (3 diffs)
- trunk/src/dwt/graphics/cursor.d (modified) (4 diffs)
- trunk/src/dwt/graphics/device.d (modified) (2 diffs)
- trunk/src/dwt/graphics/font.d (modified) (5 diffs)
- trunk/src/dwt/graphics/fontdata.d (modified) (8 diffs)
- trunk/src/dwt/graphics/gc.d (modified) (16 diffs)
- trunk/src/dwt/graphics/image.d (modified) (13 diffs)
- trunk/src/dwt/graphics/imagedata.d (modified) (20 diffs)
- trunk/src/dwt/graphics/imageloader.d (modified) (4 diffs)
- trunk/src/dwt/graphics/palettedata.d (modified) (1 diff)
- trunk/src/dwt/graphics/point.d (modified) (1 diff)
- trunk/src/dwt/graphics/rectangle.d (modified) (6 diffs)
- trunk/src/dwt/graphics/region.d (modified) (11 diffs)
- trunk/src/dwt/internal/callback.d (modified) (13 diffs)
- trunk/src/dwt/internal/callbacktable.d (modified) (5 diffs)
- trunk/src/dwt/internal/compatibility.d (modified) (2 diffs)
- trunk/src/dwt/internal/library.d (modified) (2 diffs)
- trunk/src/dwt/internal/make_callback.d.py (modified) (6 diffs)
- trunk/src/dwt/internal/win32/func.d (modified) (5 diffs)
- trunk/src/dwt/internal/win32/os.d (modified) (23 diffs)
- trunk/src/dwt/internal/win32/tchar.d (modified) (7 diffs)
- trunk/src/dwt/internal/win32/types.d (modified) (16 diffs)
- trunk/src/dwt/util/eventobject.d (modified) (1 diff)
- trunk/src/dwt/util/runnable.d (modified) (1 diff)
- trunk/src/dwt/util/string.d (modified) (3 diffs)
- trunk/src/dwt/util/system.d (modified) (1 diff)
- trunk/src/dwt/util/thread.d (modified) (1 diff)
- trunk/src/dwt/util/throwable.d (modified) (1 diff)
- trunk/src/dwt/util/util.d (modified) (3 diffs)
- trunk/src/dwt/widgets/button.d (modified) (24 diffs)
- trunk/src/dwt/widgets/canvas.d (modified) (10 diffs)
- trunk/src/dwt/widgets/caret.d (modified) (23 diffs)
- trunk/src/dwt/widgets/composite.d (modified) (27 diffs)
- trunk/src/dwt/widgets/control.d (modified) (172 diffs)
- trunk/src/dwt/widgets/decorations.d (modified) (49 diffs)
- trunk/src/dwt/widgets/display.d (modified) (79 diffs)
- trunk/src/dwt/widgets/imagelist.d (modified) (11 diffs)
- trunk/src/dwt/widgets/item.d (modified) (7 diffs)
- trunk/src/dwt/widgets/menu.d (modified) (26 diffs)
- trunk/src/dwt/widgets/menuitem.d (modified) (26 diffs)
- trunk/src/dwt/widgets/scrollable.d (modified) (13 diffs)
- trunk/src/dwt/widgets/scrollbar.d (modified) (26 diffs)
- trunk/src/dwt/widgets/shell.d (modified) (41 diffs)
- trunk/src/dwt/widgets/synchronizer.d (modified) (9 diffs)
- trunk/src/dwt/widgets/widget.d (modified) (25 diffs)
- trunk/src/err.txt (deleted)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/HelloDWT.d
r33 r42 2 2 + HelloDWT.d 3 3 +/ 4 5 import dwt.widgets.display;6 import dwt.widgets.shell;7 4 8 int main (char[][] args) { 5 //version = NoDWT; 9 6 10 Display display = new Display(); 11 Shell shell = new Shell(display); 12 shell.open(); 13 /+ TODO: get these functions working, and get delegates working before uncommenting. 14 while ( !shell.isDisposed() ) { 15 if ( !display.readAndDispatch() ) { 16 display.sleep(); 7 version (NoDWT) {} else { 8 import dwt.widgets.display; 9 import dwt.widgets.shell; 10 } 11 12 import dwt.util.thread; 13 14 int main() { 15 printf("Current thread:\n"); 16 Thread t = Thread.getThis(); 17 18 version (NoDWT) {} else { 19 int i = 0; 20 printf("Creating display...\n"); 21 Display display = new Display(); 22 printf("Creating shell...\n"); 23 Shell shell = new Shell(display); 24 printf("shell.open()"); 25 shell.open(); 26 27 version (none) { 28 printf("Loop\n"); 29 // TODO: get these functions working, and get delegates working before uncommenting. 30 while ( !shell.isDisposed() ) { 31 if ( !display.readAndDispatch() ) { 32 display.sleep(); 33 } 34 } 17 35 } 18 } 19 +/ 20 display.dispose(); 36 37 printf("Dispose\n", i++); 38 display.dispose(); 39 printf("Finis!!\n", i++); 40 } 41 21 42 return 0; 22 43 } trunk/src/SConstruct
r40 r42 20 20 21 21 if 'win32' in sys.platform: 22 env.Append(LIBS=['gdi32', 'imm32', 'msimg32', 'Advapi32', 'comctl32']) 23 env.Append(DVERSIONS=['Win32','Unicode']) 24 #env.Append(DLINKFLAGS='-L/exet:nt/su:windows:4.0') 22 LIBS=['gdi32', 'imm32', 'msimg32', 'Advapi32', 'comctl32', 'comdlg32', 'shell32'] 23 24 env.Append(LIBS=['gdi32', 'imm32', 'msimg32', 'Advapi32', 'comctl32', 'comdlg32', 'shell32']) 25 env.Append(DVERSIONS=['Unicode', 'DwtChar']) 26 env.Append(DFLAGS=['-g', '-debug']) 27 env.Append(DLINKFLAGS='-L/exet:nt') 25 28 SRC += glob('dwt/*/win32/*.d') # ooo 26 27 29 28 30 elif 'linux' in sys.platform: … … 30 32 SRC += glob('dwt/*/gtk/*.d') 31 33 32 env.Program('HelloDWT', SRC) 34 hello = env.Program('HelloDWT', SRC) 35 36 env.MSVSProject( 37 target='dwt' + env['MSVSPROJECTSUFFIX'], 38 srcs=SRC, 39 variant='Debug', 40 buildtarget=hello 41 ) 42 43 env.Default(hello) trunk/src/dwt/accessibility/accessible.d
r33 r42 1 1 /******************************************************************************* 2 2 * Copyright (c) 2000, 2003 IBM Corporation and others. 3 * All rights reserved. This program and the accompanying materials 3 * All rights reserved. This program and the accompanying materials 4 4 * are made available under the terms of the Common Public License v1.0 5 5 * which accompanies this distribution, and is available at 6 6 * http://www.eclipse.org/legal/cpl-v10.html 7 * 7 * 8 8 * Contributors: 9 9 * IBM Corporation - initial API and implementation … … 12 12 /******************************************************************************* 13 13 * DWT: SWT port for the D Language 14 * 14 * 15 15 * Contributors: 16 16 * The DWT team at http://www.dsource.org/projects/dwt 17 * 17 * 18 18 *******************************************************************************/ 19 19 … … 22 22 module dwt.accessibility.accessible; 23 23 24 /+ 24 /+ 25 25 import java.util.Vector; 26 26 import org.eclipse.swt.*; … … 43 43 * accessible control listener to implement accessibility for a 44 44 * custom control. 45 * 45 * 46 46 * @see Control#getAccessible 47 47 * @see AccessibleListener … … 49 49 * @see AccessibleControlListener 50 50 * @see AccessibleControlEvent 51 * 51 * 52 52 * @since 2.0 53 53 */ … … 59 59 60 60 int refCount = 0, enumIndex = 0; 61 /+ 61 /+ 62 62 COMObject objIAccessible, objIEnumVARIANT; 63 63 IAccessible iaccessible; … … 78 78 iaccessible = new IAccessible(ppvObject[0]); 79 79 iaccessible.AddRef(); 80 80 81 81 objIAccessible = new COMObject(new int[] {2,0,0,1,3,5,8,1,1,5,5,5,5,5,5,5,6,5,1,1,5,5,8,6,3,4,5,5}) { 82 82 public int method0(int[] args) {return QueryInterface(args[0], args[1]);} … … 109 109 public int method27(int[] args) {return put_accValue(args[0], args[1], args[2], args[3], args[4]);} 110 110 }; 111 111 112 112 objIEnumVARIANT = new COMObject(new int[] {2,0,0,3,1,0,1}) { 113 113 public int method0(int[] args) {return QueryInterface(args[0], args[1]);} … … 119 119 // method6 Clone - not implemented 120 120 }; 121 +/ 121 +/ 122 122 AddRef(); 123 123 } … … 163 163 public void addAccessibleListener(AccessibleListener listener) { 164 164 checkWidget(); 165 if (listener ==null) SWT.error(SWT.ERROR_NULL_ARGUMENT);165 if (listener is null) SWT.error(SWT.ERROR_NULL_ARGUMENT); 166 166 accessibleListeners.addElement(listener); 167 167 } 168 169 168 169 170 170 /** 171 171 * Adds the listener to the collection of listeners who will … … 191 191 public void addAccessibleControlListener(AccessibleControlListener listener) { 192 192 checkWidget(); 193 if (listener ==null) SWT.error(SWT.ERROR_NULL_ARGUMENT);193 if (listener is null) SWT.error(SWT.ERROR_NULL_ARGUMENT); 194 194 accessibleControlListeners.addElement(listener); 195 195 } … … 215 215 * @see AccessibleTextListener 216 216 * @see #removeAccessibleTextListener 217 * 217 * 218 218 * @since 3.0 219 219 */ 220 220 public void addAccessibleTextListener (AccessibleTextListener listener) { 221 221 checkWidget (); 222 if (listener ==null) SWT.error (SWT.ERROR_NULL_ARGUMENT);223 textListeners.addElement (listener); 224 } 225 +/ 226 /** 227 * Gets the control for this Accessible object. 222 if (listener is null) SWT.error (SWT.ERROR_NULL_ARGUMENT); 223 textListeners.addElement (listener); 224 } 225 +/ 226 /** 227 * Gets the control for this Accessible object. 228 228 * 229 229 * @since 3.0 … … 251 251 Release(); 252 252 } 253 253 254 254 /** 255 255 * Invokes platform specific functionality to handle a window message. … … 264 264 public int internal_WM_GETOBJECT (int wParam, int lParam) { 265 265 /+ TODO: COM 266 if (objIAccessible ==null) return 0;266 if (objIAccessible is null) return 0; 267 267 if (lParam == COM.OBJID_CLIENT) { 268 268 return COM.LresultFromObject(COM.IIDIAccessible, wParam, objIAccessible.getAddress()); … … 294 294 public void removeAccessibleListener(AccessibleListener listener) { 295 295 checkWidget(); 296 if (listener ==null) SWT.error(SWT.ERROR_NULL_ARGUMENT);296 if (listener is null) SWT.error(SWT.ERROR_NULL_ARGUMENT); 297 297 accessibleListeners.removeElement(listener); 298 298 } … … 319 319 public void removeAccessibleControlListener(AccessibleControlListener listener) { 320 320 checkWidget(); 321 if (listener ==null) SWT.error(SWT.ERROR_NULL_ARGUMENT);321 if (listener is null) SWT.error(SWT.ERROR_NULL_ARGUMENT); 322 322 accessibleControlListeners.removeElement(listener); 323 323 } … … 341 341 * @see AccessibleTextListener 342 342 * @see #addAccessibleTextListener 343 * 343 * 344 344 * @since 3.0 345 345 */ 346 346 public void removeAccessibleTextListener (AccessibleTextListener listener) { 347 347 checkWidget (); 348 if (listener ==null) SWT.error (SWT.ERROR_NULL_ARGUMENT);348 if (listener is null) SWT.error (SWT.ERROR_NULL_ARGUMENT); 349 349 textListeners.remove (listener); 350 350 } … … 358 358 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control</li> 359 359 * </ul> 360 * 360 * 361 361 * @since 3.0 362 362 */ … … 371 371 * 372 372 * @param childID an identifier specifying a child of the control 373 * 373 * 374 374 * @exception SWTException <ul> 375 375 * <li>ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed</li> … … 393 393 * 394 394 * @param index the new caret index within the control 395 * 395 * 396 396 * @exception SWTException <ul> 397 397 * <li>ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed</li> … … 405 405 // TODO: COM.NotifyWinEvent (COM.EVENT_OBJECT_LOCATIONCHANGE, control.handle, COM.OBJID_CARET, COM.CHILDID_SELF); 406 406 } 407 407 408 408 /** 409 409 * Sends a message to accessible clients that the text … … 419 419 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control</li> 420 420 * </ul> 421 * 421 * 422 422 * @see ACC#NOTIFY_TEXT_INSERT 423 423 * @see ACC#NOTIFY_TEXT_DELETE 424 * 424 * 425 425 * @since 3.0 426 426 */ … … 429 429 //TODO: COM.NotifyWinEvent (COM.EVENT_OBJECT_VALUECHANGE, control.handle, COM.OBJID_CLIENT, COM.CHILDID_SELF); 430 430 } 431 431 432 432 /** 433 433 * Sends a message to accessible clients that the text … … 446 446 } 447 447 448 /+ 448 /+ 449 449 int QueryInterface(int arg1, int arg2) { 450 if (iaccessible ==null) return COM.CO_E_OBJNOTCONNECTED;450 if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; 451 451 GUID guid = new GUID(); 452 452 COM.MoveMemory(guid, arg1, GUID.sizeof); … … 496 496 objIAccessible.dispose(); 497 497 objIAccessible = null; 498 498 499 499 if (objIEnumVARIANT != null) 500 500 objIEnumVARIANT.dispose(); … … 506 506 /+ 507 507 int accDoDefaultAction(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2) { 508 if (iaccessible ==null) return COM.CO_E_OBJNOTCONNECTED;508 if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; 509 509 // Currently, we don't let the application override this. Forward to the proxy. 510 510 int code = iaccessible.accDoDefaultAction(varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2); … … 514 514 515 515 int accHitTest(int xLeft, int yTop, int pvarChild) { 516 if (iaccessible ==null) return COM.CO_E_OBJNOTCONNECTED;516 if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; 517 517 if (accessibleControlListeners.size() == 0) { 518 518 return iaccessible.accHitTest(xLeft, yTop, pvarChild); … … 537 537 return COM.S_OK; 538 538 } 539 539 540 540 int accLocation(int pxLeft, int pyTop, int pcxWidth, int pcyHeight, int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2) { 541 if (iaccessible ==null) return COM.CO_E_OBJNOTCONNECTED;541 if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; 542 542 if ((varChild_vt & 0xFFFF) != COM.VT_I4) return COM.E_INVALIDARG; 543 543 … … 574 574 return COM.S_OK; 575 575 } 576 576 577 577 int accNavigate(int navDir, int varStart_vt, int varStart_reserved1, int varStart_lVal, int varStart_reserved2, int pvarEndUpAt) { 578 if (iaccessible ==null) return COM.CO_E_OBJNOTCONNECTED;578 if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; 579 579 // Currently, we don't let the application override this. Forward to the proxy. 580 580 int code = iaccessible.accNavigate(navDir, varStart_vt, varStart_reserved1, varStart_lVal, varStart_reserved2, pvarEndUpAt); … … 582 582 return code; 583 583 } 584 584 585 585 int accSelect(int flagsSelect, int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2) { 586 if (iaccessible ==null) return COM.CO_E_OBJNOTCONNECTED;586 if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; 587 587 // Currently, we don't let the application override this. Forward to the proxy. 588 588 int code = iaccessible.accSelect(flagsSelect, varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2); … … 592 592 593 593 int get_accChild(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int ppdispChild) { 594 if (iaccessible ==null) return COM.CO_E_OBJNOTCONNECTED;594 if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; 595 595 if ((varChild_vt & 0xFFFF) != COM.VT_I4) return COM.E_INVALIDARG; 596 596 if (accessibleControlListeners.size() == 0) { … … 615 615 return COM.S_FALSE; 616 616 } 617 617 618 618 int get_accChildCount(int pcountChildren) { 619 if (iaccessible ==null) return COM.CO_E_OBJNOTCONNECTED;619 if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; 620 620 621 621 /* Get the default child count from the OS. */ … … 640 640 return COM.S_OK; 641 641 } 642 642 643 643 int get_accDefaultAction(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int pszDefaultAction) { 644 if (iaccessible ==null) return COM.CO_E_OBJNOTCONNECTED;644 if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; 645 645 if ((varChild_vt & 0xFFFF) != COM.VT_I4) return COM.E_INVALIDARG; 646 646 647 647 /* Get the default defaultAction from the OS. */ 648 648 String osDefaultAction = null; … … 670 670 listener.getDefaultAction(event); 671 671 } 672 if (event.result ==null) return code;672 if (event.result is null) return code; 673 673 char[] data = (event.result + "\0").toCharArray(); 674 674 int ptr = COM.SysAllocString(data); … … 676 676 return COM.S_OK; 677 677 } 678 678 679 679 int get_accDescription(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int pszDescription) { 680 if (iaccessible ==null) return COM.CO_E_OBJNOTCONNECTED;680 if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; 681 681 if ((varChild_vt & 0xFFFF) != COM.VT_I4) return COM.E_INVALIDARG; 682 682 683 683 /* Get the default description from the OS. */ 684 684 String osDescription = null; … … 696 696 } 697 697 } 698 698 699 699 AccessibleEvent event = new AccessibleEvent(this); 700 700 if (varChild_lVal == COM.CHILDID_SELF) event.childID = ACC.CHILDID_SELF; … … 706 706 listener.getDescription(event); 707 707 } 708 if (event.result ==null) return code;708 if (event.result is null) return code; 709 709 char[] data = (event.result + "\0").toCharArray(); 710 710 int ptr = COM.SysAllocString(data); … … 712 712 return COM.S_OK; 713 713 } 714 714 715 715 int get_accFocus(int pvarChild) { 716 if (iaccessible ==null) return COM.CO_E_OBJNOTCONNECTED;716 if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; 717 717 718 718 /* Get the default focus child from the OS. */ … … 756 756 return COM.S_OK; 757 757 } 758 758 759 759 int get_accHelp(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int pszHelp) { 760 if (iaccessible ==null) return COM.CO_E_OBJNOTCONNECTED;760 if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; 761 761 if ((varChild_vt & 0xFFFF) != COM.VT_I4) return COM.E_INVALIDARG; 762 762 763 763 /* Get the default help string from the OS. */ 764 764 String osHelp = null; … … 786 786 listener.getHelp(event); 787 787 } 788 if (event.result ==null) return code;788 if (event.result is null) return code; 789 789 char[] data = (event.result + "\0").toCharArray(); 790 790 int ptr = COM.SysAllocString(data); … … 792 792 return COM.S_OK; 793 793 } 794 794 795 795 int get_accHelpTopic(int pszHelpFile, int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int pidTopic) { 796 if (iaccessible ==null) return COM.CO_E_OBJNOTCONNECTED;796 if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; 797 797 // Currently, we don't let the application override this. Forward to the proxy. 798 798 int code = iaccessible.get_accHelpTopic(pszHelpFile, varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2, pidTopic); … … 802 802 803 803 int get_accKeyboardShortcut(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int pszKeyboardShortcut) { 804 if (iaccessible ==null) return COM.CO_E_OBJNOTCONNECTED;804 if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; 805 805 if ((varChild_vt & 0xFFFF) != COM.VT_I4) return COM.E_INVALIDARG; 806 806 807 807 /* Get the default keyboard shortcut from the OS. */ 808 808 String osKeyboardShortcut = null; … … 830 830 listener.getKeyboardShortcut(event); 831 831 } 832 if (event.result ==null) return code;832 if (event.result is null) return code; 833 833 char[] data = (event.result + "\0").toCharArray(); 834 834 int ptr = COM.SysAllocString(data); … … 836 836 return COM.S_OK; 837 837 } 838 838 839 839 int get_accName(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int pszName) { 840 if (iaccessible ==null) return COM.CO_E_OBJNOTCONNECTED;840 if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; 841 841 if ((varChild_vt & 0xFFFF) != COM.VT_I4) return COM.E_INVALIDARG; 842 842 … … 866 866 listener.getName(event); 867 867 } 868 if (event.result ==null) return code;868 if (event.result is null) return code; 869 869 char[] data = (event.result + "\0").toCharArray(); 870 870 int ptr = COM.SysAllocString(data); … … 872 872 return COM.S_OK; 873 873 } 874 874 875 875 int get_accParent(int ppdispParent) { 876 if (iaccessible ==null) return COM.CO_E_OBJNOTCONNECTED;876 if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; 877 877 // Currently, we don't let the application override this. Forward to the proxy. 878 878 return iaccessible.get_accParent(ppdispParent); 879 879 } 880 880 881 881 int get_accRole(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int pvarRole) { 882 if (iaccessible ==null) return COM.CO_E_OBJNOTCONNECTED;882 if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; 883 883 if ((varChild_vt & 0xFFFF) != COM.VT_I4) return COM.E_INVALIDARG; 884 884 … … 907 907 /* Tree item childIDs are pointers (not 1-based indices). */ 908 908 event.childID = varChild_lVal; 909 909 910 910 // TEMPORARY CODE 911 911 /* Currently our checkbox tree is emulated using state mask images, … … 914 914 } else if (control instanceof Table) { 915 915 event.childID = varChild_lVal - 1; 916 916 917 917 // TEMPORARY CODE 918 918 /* Currently our checkbox table is emulated using state mask images, … … 932 932 return COM.S_OK; 933 933 } 934 934 935 935 int get_accSelection(int pvarChildren) { 936 if (iaccessible ==null) return COM.CO_E_OBJNOTCONNECTED;936 if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; 937 937 938 938 /* Get the default selection from the OS. */ … … 985 985 return COM.S_OK; 986 986 } 987 987 988 988 int get_accState(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int pvarState) { 989 if (iaccessible ==null) return COM.CO_E_OBJNOTCONNECTED;989 if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; 990 990 if ((varChild_vt & 0xFFFF) != COM.VT_I4) return COM.E_INVALIDARG; 991 991 … … 1028 1028 } else if (control instanceof Table) { 1029 1029 event.childID = varChild_lVal - 1; 1030 1030 1031 1031 // TEMPORARY CODE 1032 1032 /* Currently our checkbox table is emulated using state mask images, … … 1050 1050 return COM.S_OK; 1051 1051 } 1052 1052 1053 1053 int get_accValue(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int pszValue) { 1054 if (iaccessible ==null) return COM.CO_E_OBJNOTCONNECTED;1054 if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; 1055 1055 if ((varChild_vt & 0xFFFF) != COM.VT_I4) return COM.E_INVALIDARG; 1056 1056 1057 1057 /* Get the default value string from the OS. */ 1058 1058 String osValue = null; … … 1080 1080 listener.getValue(event); 1081 1081 } 1082 if (event.result ==null) return code;1082 if (event.result is null) return code; 1083 1083 char[] data = (event.result + "\0").toCharArray(); 1084 1084 int ptr = COM.SysAllocString(data); … … 1086 1086 return COM.S_OK; 1087 1087 } 1088 1088 1089 1089 int put_accName(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int szName) { 1090 1090 // MSAA: this method is no longer supported 1091 if (iaccessible ==null) return COM.CO_E_OBJNOTCONNECTED;1091 if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; 1092 1092 // We don't implement this. Forward to the proxy. 1093 1093 int code = iaccessible.put_accName(varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2, szName); … … 1095 1095 return code; 1096 1096 } 1097 1097 1098 1098 int put_accValue(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int szValue) { 1099 1099 // MSAA: this method is typically only used for edit controls 1100 if (iaccessible ==null) return COM.CO_E_OBJNOTCONNECTED;1100 if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; 1101 1101 // We don't implement this. Forward to the proxy. 1102 1102 int code = iaccessible.put_accValue(varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2, szValue); … … 1106 1106 1107 1107 /* IEnumVARIANT methods: Next, Skip, Reset */ 1108 /* Retrieve the next celt items in the enumeration sequence. 1108 /* Retrieve the next celt items in the enumeration sequence. 1109 1109 * If there are fewer than the requested number of elements left 1110 1110 * in the sequence, retrieve the remaining elements. 1111 * The number of elements actually retrieved is returned in pceltFetched 1111 * The number of elements actually retrieved is returned in pceltFetched 1112 1112 * (unless the caller passed in NULL for that parameter). 1113 1113 */ … … 1137 1137 } 1138 1138 variants = event.children; 1139 } 1139 } 1140 1140 Object[] nextItems = null; 1141 1141 if (variants != null && celt >= 1) { … … 1177 1177 return COM.S_FALSE; 1178 1178 } 1179 1179 1180 1180 /* Skip over the specified number of elements in the enumeration sequence. */ 1181 1181 int Skip(int celt) { … … 1200 1200 return COM.S_OK; 1201 1201 } 1202 1202 1203 1203 /* Reset the enumeration sequence to the beginning. */ 1204 1204 int Reset() { … … 1214 1214 return code; 1215 1215 } 1216 1216 1217 1217 enumIndex = 0; 1218 1218 return COM.S_OK; … … 1238 1238 return osState; 1239 1239 } 1240 1240 1241 1241 int osToState(int osState) { 1242 1242 int state = ACC.STATE_NORMAL; … … 1332 1332 bit isValidThread () { 1333 1333 bit result = false; 1334 result = control.getDisplay ().getThread () == Thread. currentThread() ? true : false;1334 result = control.getDisplay ().getThread () == Thread.getThis () ? true : false; 1335 1335 return result; 1336 1336 } 1337 1337 1338 1338 1339 1339 trunk/src/dwt/graphics/color.d
r41 r42 86 86 */ 87 87 public this(Device device, int red, int green, int blue) { 88 if (device ==null) device = Device.getDevice();89 if (device ==null) DWT.error(DWT.ERROR_NULL_ARGUMENT);88 if (device is null) device = Device.getDevice(); 89 if (device is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 90 90 init(device, red, green, blue); 91 91 if (device.tracking) device.new_Object(this); … … 115 115 */ 116 116 public this(Device device, RGB rgb) { 117 if (device ==null) device = Device.getDevice();118 if (device ==null) DWT.error(DWT.ERROR_NULL_ARGUMENT);117 if (device is null) device = Device.getDevice(); 118 if (device is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 119 119 init(device, rgb.red, rgb.green, rgb.blue); 120 120 if (device.tracking) device.new_Object(this); … … 341 341 */ 342 342 public static Color win32_new(Device device, int handle) { 343 if (device ==null) device = Device.getDevice();343 if (device is null) device = Device.getDevice(); 344 344 Color color = new Color(); 345 345 color.handle = handle; trunk/src/dwt/graphics/cursor.d
r41 r42 201 201 202 202 public this(Device device, int style) { 203 if (device ==null) device = Device.getDevice();204 if (device ==null) DWT.error(DWT.ERROR_NULL_ARGUMENT);203 if (device is null) device = Device.getDevice(); 204 if (device is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 205 205 this.device = device; 206 206 int lpCursorName = 0; … … 283 283 */ 284 284 public this(Device device, ImageData source, ImageData mask, int hotspotX, int hotspotY) { 285 if (device ==null) device = Device.getDevice();286 if (device ==null) DWT.error(DWT.ERROR_NULL_ARGUMENT);285 if (device is null) device = Device.getDevice(); 286 if (device is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 287 287 this.device = device; 288 if (source ==null) DWT.error(DWT.ERROR_NULL_ARGUMENT);289 if (mask ==null) {288 if (source is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 289 if (mask is null) { 290 290 if (source.getTransparencyType() != DWT.TRANSPARENCY_MASK) { 291 291 DWT.error(DWT.ERROR_NULL_ARGUMENT); … … 341 341 */ 342 342 public this(Device device, ImageData source, int hotspotX, int hotspotY) { 343 /+if (device ==null) device = Device.getDevice();344 if (device ==null) DWT.error(DWT.ERROR_NULL_ARGUMENT);343 /+if (device is null) device = Device.getDevice(); 344 if (device is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 345 345 this.device = device; 346 if (source ==null) DWT.error(DWT.ERROR_NULL_ARGUMENT);346 if (source is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 347 347 /* Check the hotspots */ 348 348 if (hotspotX >= source.width || hotspotX < 0 || … … 479 479 */ 480 480 public static Cursor win32_new(Device device, int handle) { 481 if (device ==null) device = Device.getDevice();481 if (device is null) device = Device.getDevice(); 482 482 Cursor cursor = new Cursor(); 483 483 cursor.handle = handle; trunk/src/dwt/graphics/device.d
r41 r42 460 460 int offset = 0; 461 461 int hDC = internal_new_GC (null); 462 if (faceName ==null) {462 if (faceName is null) { 463 463 /* The user did not specify a face name, so they want all versions of all available face names */ 464 464 … … 737 737 void new_Object (Object object) { 738 738 for (int i=0; i<objects.length; i++) { 739 if (objects [i] ==null) {739 if (objects [i] is null) { 740 740 objects [i] = object; 741 741 errors [i] = new Error ("Java doesn't require a string here but D does -- andy"); trunk/src/dwt/graphics/font.d
r41 r42 80 80 */ 81 81 public this(Device device, FontData fd) { 82 if (device ==null) device = Device.getDevice();83 if (device ==null) DWT.error(DWT.ERROR_NULL_ARGUMENT);82 if (device is null) device = Device.getDevice(); 83 if (device is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 84 84 init(device, fd); 85 85 if (device.tracking) device.new_Object(this); … … 110 110 */ 111 111 public this(Device device, FontData[] fds) { 112 if (device ==null) device = Device.getDevice();113 if (device ==null) DWT.error(DWT.ERROR_NULL_ARGUMENT);114 if (fds ==null) DWT.error(DWT.ERROR_NULL_ARGUMENT);112 if (device is null) device = Device.getDevice(); 113 if (device is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 114 if (fds is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 115 115 if (fds.length == 0) DWT.error(DWT.ERROR_INVALID_ARGUMENT); 116 116 init(device, fds[0]); … … 141 141 */ 142 142 public this(Device device, wchar[] name, int height, int style) { 143 if (device ==null) device = Device.getDevice();144 if (device ==null) DWT.error(DWT.ERROR_NULL_ARGUMENT);145 if (name ==null) DWT.error(DWT.ERROR_NULL_ARGUMENT);143 if (device is null) device = Device.getDevice(); 144 if (device is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 145 if (name is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 146 146 init(device, new FontData (name, height, style)); 147 147 if (device.tracking) device.new_Object(this); … … 218 218 219 219 void init (Device device, FontData fd) { 220 if (fd ==null) DWT.error(DWT.ERROR_NULL_ARGUMENT);220 if (fd is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 221 221 this.device = device; 222 222 LOGFONT* logFont = fd.data; … … 268 268 */ 269 269 public static Font win32_new(Device device, int handle) { 270 if (device ==null) device = Device.getDevice();270 if (device is null) device = Device.getDevice(); 271 271 Font font = new Font(); 272 272 font.handle = handle; trunk/src/dwt/graphics/fontdata.d
r41 r42 1 1 /******************************************************************************* 2 2 * Copyright (c) 2000, 2003 IBM Corporation and others. 3 * All rights reserved. This program and the accompanying materials 3 * All rights reserved. This program and the accompanying materials 4 4 * are made available under the terms of the Common Public License v1.0 5 5 * which accompanies this distribution, and is available at 6 6 * http://www.eclipse.org/legal/cpl-v10.html 7 * 7 * 8 8 * Contributors: 9 9 * IBM Corporation - initial API and implementation … … 12 12 /******************************************************************************* 13 13 * DWT: SWT port for the D Language 14 * 14 * 15 15 * Contributors: 16 16 * The DWT team at http://www.dsource.org/projects/dwt 17 * 17 * 18 18 *******************************************************************************/ 19 19 … … 35 35 private import std.string; 36 36 private import std.utf; 37 37
