Changeset 42

Show
Ignore:
Timestamp:
01/03/05 01:55:04 (4 years ago)
Author:
andy
Message:

Everything builds again (for me, anyway: DMD 0.110/SCons)

Changed lots of things to use the String alias instead of char[] and friends
for the simple reason that it apparently isn't clear which precise char type
it ought to be.

For now, one of DwtChar?, DwtWchar?, or DwtDchar? is required. This defines
the appropriate alias in dwt.util.util, as well as the asString() function, which
can be used to convert arrays of chars to String. It is basically an alias to
toUTF8/16/32, depending.

Lots of instances of "x == null" and "x != null" were changed to "x is null" and
"x !== null", respectively, which appears to have been the cause of several
segfaults in HelloDWT.

HelloDWT itself still segfaults, which now occurs somewhere in the call to
shell.open()

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/HelloDWT.d

    r33 r42  
    22 +  HelloDWT.d 
    33 +/ 
    4   
    5 import dwt.widgets.display; 
    6 import dwt.widgets.shell; 
    74 
    8 int main (char[][] args) { 
     5//version = NoDWT; 
    96 
    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(); 
     7version (NoDWT) {} else { 
     8    import dwt.widgets.display; 
     9    import dwt.widgets.shell; 
     10
     11 
     12import dwt.util.thread; 
     13 
     14int 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            } 
    1735        } 
    18     }  
    19 +/ 
    20     display.dispose(); 
     36 
     37        printf("Dispose\n", i++); 
     38        display.dispose(); 
     39        printf("Finis!!\n", i++); 
     40    } 
     41 
    2142    return 0; 
    2243} 
  • trunk/src/SConstruct

    r40 r42  
    2020 
    2121if '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') 
    2528    SRC += glob('dwt/*/win32/*.d') # ooo 
    26  
    2729 
    2830elif 'linux' in sys.platform: 
     
    3032    SRC += glob('dwt/*/gtk/*.d') 
    3133 
    32 env.Program('HelloDWT', SRC) 
     34hello = env.Program('HelloDWT', SRC) 
     35 
     36env.MSVSProject( 
     37    target='dwt' + env['MSVSPROJECTSUFFIX'], 
     38    srcs=SRC, 
     39    variant='Debug', 
     40    buildtarget=hello 
     41
     42 
     43env.Default(hello) 
  • trunk/src/dwt/accessibility/accessible.d

    r33 r42  
    11/******************************************************************************* 
    22 * 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 
    44 * are made available under the terms of the Common Public License v1.0 
    55 * which accompanies this distribution, and is available at 
    66 * http://www.eclipse.org/legal/cpl-v10.html 
    7  *  
     7 * 
    88 * Contributors: 
    99 *     IBM Corporation - initial API and implementation 
     
    1212/******************************************************************************* 
    1313 * DWT: SWT port for the D Language 
    14  *  
     14 * 
    1515 * Contributors: 
    1616 *  The DWT team at http://www.dsource.org/projects/dwt 
    17  *  
     17 * 
    1818 *******************************************************************************/ 
    1919 
     
    2222module dwt.accessibility.accessible; 
    2323 
    24 /+  
     24/+ 
    2525import java.util.Vector; 
    2626import org.eclipse.swt.*; 
     
    4343 * accessible control listener to implement accessibility for a 
    4444 * custom control. 
    45  *  
     45 * 
    4646 * @see Control#getAccessible 
    4747 * @see AccessibleListener 
     
    4949 * @see AccessibleControlListener 
    5050 * @see AccessibleControlEvent 
    51  *  
     51 * 
    5252 * @since 2.0 
    5353 */ 
     
    5959 
    6060    int refCount = 0, enumIndex = 0; 
    61 /+  
     61/+ 
    6262    COMObject objIAccessible, objIEnumVARIANT; 
    6363    IAccessible iaccessible; 
     
    7878        iaccessible = new IAccessible(ppvObject[0]); 
    7979        iaccessible.AddRef(); 
    80          
     80 
    8181        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}) { 
    8282            public int method0(int[] args) {return QueryInterface(args[0], args[1]);} 
     
    109109            public int method27(int[] args) {return put_accValue(args[0], args[1], args[2], args[3], args[4]);} 
    110110        }; 
    111          
     111 
    112112        objIEnumVARIANT = new COMObject(new int[] {2,0,0,3,1,0,1}) { 
    113113            public int method0(int[] args) {return QueryInterface(args[0], args[1]);} 
     
    119119            // method6 Clone - not implemented 
    120120        }; 
    121 +/  
     121+/ 
    122122        AddRef(); 
    123123    } 
     
    163163    public void addAccessibleListener(AccessibleListener listener) { 
    164164        checkWidget(); 
    165         if (listener == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); 
     165        if (listener is null) SWT.error(SWT.ERROR_NULL_ARGUMENT); 
    166166        accessibleListeners.addElement(listener); 
    167167    } 
    168      
    169      
     168 
     169 
    170170    /** 
    171171     * Adds the listener to the collection of listeners who will 
     
    191191    public void addAccessibleControlListener(AccessibleControlListener listener) { 
    192192        checkWidget(); 
    193         if (listener == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); 
     193        if (listener is null) SWT.error(SWT.ERROR_NULL_ARGUMENT); 
    194194        accessibleControlListeners.addElement(listener); 
    195195    } 
     
    215215     * @see AccessibleTextListener 
    216216     * @see #removeAccessibleTextListener 
    217      *  
     217     * 
    218218     * @since 3.0 
    219219     */ 
    220220    public void addAccessibleTextListener (AccessibleTextListener listener) { 
    221221        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. 
    228228     * 
    229229     * @since 3.0 
     
    251251        Release(); 
    252252    } 
    253      
     253 
    254254    /** 
    255255     * Invokes platform specific functionality to handle a window message. 
     
    264264    public int internal_WM_GETOBJECT (int wParam, int lParam) { 
    265265/+ TODO: COM 
    266         if (objIAccessible == null) return 0; 
     266        if (objIAccessible is null) return 0; 
    267267        if (lParam == COM.OBJID_CLIENT) { 
    268268            return COM.LresultFromObject(COM.IIDIAccessible, wParam, objIAccessible.getAddress()); 
     
    294294    public void removeAccessibleListener(AccessibleListener listener) { 
    295295        checkWidget(); 
    296         if (listener == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); 
     296        if (listener is null) SWT.error(SWT.ERROR_NULL_ARGUMENT); 
    297297        accessibleListeners.removeElement(listener); 
    298298    } 
     
    319319    public void removeAccessibleControlListener(AccessibleControlListener listener) { 
    320320        checkWidget(); 
    321         if (listener == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); 
     321        if (listener is null) SWT.error(SWT.ERROR_NULL_ARGUMENT); 
    322322        accessibleControlListeners.removeElement(listener); 
    323323    } 
     
    341341     * @see AccessibleTextListener 
    342342     * @see #addAccessibleTextListener 
    343      *  
     343     * 
    344344     * @since 3.0 
    345345     */ 
    346346    public void removeAccessibleTextListener (AccessibleTextListener listener) { 
    347347        checkWidget (); 
    348         if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT); 
     348        if (listener is null) SWT.error (SWT.ERROR_NULL_ARGUMENT); 
    349349        textListeners.remove (listener); 
    350350    } 
     
    358358     *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control</li> 
    359359     * </ul> 
    360      *  
     360     * 
    361361     * @since 3.0 
    362362     */ 
     
    371371     * 
    372372     * @param childID an identifier specifying a child of the control 
    373      *  
     373     * 
    374374     * @exception SWTException <ul> 
    375375     *    <li>ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed</li> 
     
    393393     * 
    394394     * @param index the new caret index within the control 
    395      *  
     395     * 
    396396     * @exception SWTException <ul> 
    397397     *    <li>ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed</li> 
     
    405405        // TODO: COM.NotifyWinEvent (COM.EVENT_OBJECT_LOCATIONCHANGE, control.handle, COM.OBJID_CARET, COM.CHILDID_SELF); 
    406406    } 
    407      
     407 
    408408    /** 
    409409     * Sends a message to accessible clients that the text 
     
    419419     *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control</li> 
    420420     * </ul> 
    421      *  
     421     * 
    422422     * @see ACC#NOTIFY_TEXT_INSERT 
    423423     * @see ACC#NOTIFY_TEXT_DELETE 
    424      *  
     424     * 
    425425     * @since 3.0 
    426426     */ 
     
    429429        //TODO: COM.NotifyWinEvent (COM.EVENT_OBJECT_VALUECHANGE, control.handle, COM.OBJID_CLIENT, COM.CHILDID_SELF); 
    430430    } 
    431      
     431 
    432432    /** 
    433433     * Sends a message to accessible clients that the text 
     
    446446    } 
    447447 
    448 /+  
     448/+ 
    449449    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; 
    451451        GUID guid = new GUID(); 
    452452        COM.MoveMemory(guid, arg1, GUID.sizeof); 
     
    496496                objIAccessible.dispose(); 
    497497            objIAccessible = null; 
    498                          
     498 
    499499            if (objIEnumVARIANT != null) 
    500500                objIEnumVARIANT.dispose(); 
     
    506506/+ 
    507507    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; 
    509509        // Currently, we don't let the application override this. Forward to the proxy. 
    510510        int code = iaccessible.accDoDefaultAction(varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2); 
     
    514514 
    515515    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; 
    517517        if (accessibleControlListeners.size() == 0) { 
    518518            return iaccessible.accHitTest(xLeft, yTop, pvarChild); 
     
    537537        return COM.S_OK; 
    538538    } 
    539      
     539 
    540540    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; 
    542542        if ((varChild_vt & 0xFFFF) != COM.VT_I4) return COM.E_INVALIDARG; 
    543543 
     
    574574        return COM.S_OK; 
    575575    } 
    576      
     576 
    577577    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; 
    579579        // Currently, we don't let the application override this. Forward to the proxy. 
    580580        int code = iaccessible.accNavigate(navDir, varStart_vt, varStart_reserved1, varStart_lVal, varStart_reserved2, pvarEndUpAt); 
     
    582582        return code; 
    583583    } 
    584      
     584 
    585585    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; 
    587587        // Currently, we don't let the application override this. Forward to the proxy. 
    588588        int code = iaccessible.accSelect(flagsSelect, varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2); 
     
    592592 
    593593    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; 
    595595        if ((varChild_vt & 0xFFFF) != COM.VT_I4) return COM.E_INVALIDARG; 
    596596        if (accessibleControlListeners.size() == 0) { 
     
    615615        return COM.S_FALSE; 
    616616    } 
    617      
     617 
    618618    int get_accChildCount(int pcountChildren) { 
    619         if (iaccessible == null) return COM.CO_E_OBJNOTCONNECTED; 
     619        if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; 
    620620 
    621621        /* Get the default child count from the OS. */ 
     
    640640        return COM.S_OK; 
    641641    } 
    642      
     642 
    643643    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; 
    645645        if ((varChild_vt & 0xFFFF) != COM.VT_I4) return COM.E_INVALIDARG; 
    646          
     646 
    647647        /* Get the default defaultAction from the OS. */ 
    648648        String osDefaultAction = null; 
     
    670670            listener.getDefaultAction(event); 
    671671        } 
    672         if (event.result == null) return code; 
     672        if (event.result is null) return code; 
    673673        char[] data = (event.result + "\0").toCharArray(); 
    674674        int ptr = COM.SysAllocString(data); 
     
    676676        return COM.S_OK; 
    677677    } 
    678      
     678 
    679679    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; 
    681681        if ((varChild_vt & 0xFFFF) != COM.VT_I4) return COM.E_INVALIDARG; 
    682          
     682 
    683683        /* Get the default description from the OS. */ 
    684684        String osDescription = null; 
     
    696696            } 
    697697        } 
    698          
     698 
    699699        AccessibleEvent event = new AccessibleEvent(this); 
    700700        if (varChild_lVal == COM.CHILDID_SELF) event.childID = ACC.CHILDID_SELF; 
     
    706706            listener.getDescription(event); 
    707707        } 
    708         if (event.result == null) return code; 
     708        if (event.result is null) return code; 
    709709        char[] data = (event.result + "\0").toCharArray(); 
    710710        int ptr = COM.SysAllocString(data); 
     
    712712        return COM.S_OK; 
    713713    } 
    714      
     714 
    715715    int get_accFocus(int pvarChild) { 
    716         if (iaccessible == null) return COM.CO_E_OBJNOTCONNECTED; 
     716        if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; 
    717717 
    718718        /* Get the default focus child from the OS. */ 
     
    756756        return COM.S_OK; 
    757757    } 
    758      
     758 
    759759    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; 
    761761        if ((varChild_vt & 0xFFFF) != COM.VT_I4) return COM.E_INVALIDARG; 
    762          
     762 
    763763        /* Get the default help string from the OS. */ 
    764764        String osHelp = null; 
     
    786786            listener.getHelp(event); 
    787787        } 
    788         if (event.result == null) return code; 
     788        if (event.result is null) return code; 
    789789        char[] data = (event.result + "\0").toCharArray(); 
    790790        int ptr = COM.SysAllocString(data); 
     
    792792        return COM.S_OK; 
    793793    } 
    794      
     794 
    795795    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; 
    797797        // Currently, we don't let the application override this. Forward to the proxy. 
    798798        int code = iaccessible.get_accHelpTopic(pszHelpFile, varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2, pidTopic); 
     
    802802 
    803803    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; 
    805805        if ((varChild_vt & 0xFFFF) != COM.VT_I4) return COM.E_INVALIDARG; 
    806          
     806 
    807807        /* Get the default keyboard shortcut from the OS. */ 
    808808        String osKeyboardShortcut = null; 
     
    830830            listener.getKeyboardShortcut(event); 
    831831        } 
    832         if (event.result == null) return code; 
     832        if (event.result is null) return code; 
    833833        char[] data = (event.result + "\0").toCharArray(); 
    834834        int ptr = COM.SysAllocString(data); 
     
    836836        return COM.S_OK; 
    837837    } 
    838      
     838 
    839839    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; 
    841841        if ((varChild_vt & 0xFFFF) != COM.VT_I4) return COM.E_INVALIDARG; 
    842842 
     
    866866            listener.getName(event); 
    867867        } 
    868         if (event.result == null) return code; 
     868        if (event.result is null) return code; 
    869869        char[] data = (event.result + "\0").toCharArray(); 
    870870        int ptr = COM.SysAllocString(data); 
     
    872872        return COM.S_OK; 
    873873    } 
    874      
     874 
    875875    int get_accParent(int ppdispParent) { 
    876         if (iaccessible == null) return COM.CO_E_OBJNOTCONNECTED; 
     876        if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; 
    877877        // Currently, we don't let the application override this. Forward to the proxy. 
    878878        return iaccessible.get_accParent(ppdispParent); 
    879879    } 
    880      
     880 
    881881    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; 
    883883        if ((varChild_vt & 0xFFFF) != COM.VT_I4) return COM.E_INVALIDARG; 
    884884 
     
    907907                /* Tree item childIDs are pointers (not 1-based indices). */ 
    908908                event.childID = varChild_lVal; 
    909                  
     909 
    910910                // TEMPORARY CODE 
    911911                /* Currently our checkbox tree is emulated using state mask images, 
     
    914914            } else if (control instanceof Table) { 
    915915                event.childID = varChild_lVal - 1; 
    916                  
     916 
    917917                // TEMPORARY CODE 
    918918                /* Currently our checkbox table is emulated using state mask images, 
     
    932932        return COM.S_OK; 
    933933    } 
    934      
     934 
    935935    int get_accSelection(int pvarChildren) { 
    936         if (iaccessible == null) return COM.CO_E_OBJNOTCONNECTED; 
     936        if (iaccessible is null) return COM.CO_E_OBJNOTCONNECTED; 
    937937 
    938938        /* Get the default selection from the OS. */ 
     
    985985        return COM.S_OK; 
    986986    } 
    987      
     987 
    988988    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; 
    990990        if ((varChild_vt & 0xFFFF) != COM.VT_I4) return COM.E_INVALIDARG; 
    991991 
     
    10281028            } else if (control instanceof Table) { 
    10291029                event.childID = varChild_lVal - 1; 
    1030                  
     1030 
    10311031                // TEMPORARY CODE 
    10321032                /* Currently our checkbox table is emulated using state mask images, 
     
    10501050        return COM.S_OK; 
    10511051    } 
    1052      
     1052 
    10531053    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; 
    10551055        if ((varChild_vt & 0xFFFF) != COM.VT_I4) return COM.E_INVALIDARG; 
    1056          
     1056 
    10571057        /* Get the default value string from the OS. */ 
    10581058        String osValue = null; 
     
    10801080            listener.getValue(event); 
    10811081        } 
    1082         if (event.result == null) return code; 
     1082        if (event.result is null) return code; 
    10831083        char[] data = (event.result + "\0").toCharArray(); 
    10841084        int ptr = COM.SysAllocString(data); 
     
    10861086        return COM.S_OK; 
    10871087    } 
    1088      
     1088 
    10891089    int put_accName(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int szName) { 
    10901090        // 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; 
    10921092        // We don't implement this. Forward to the proxy. 
    10931093        int code = iaccessible.put_accName(varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2, szName); 
     
    10951095        return code; 
    10961096    } 
    1097      
     1097 
    10981098    int put_accValue(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int szValue) { 
    10991099        // 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; 
    11011101        // We don't implement this. Forward to the proxy. 
    11021102        int code = iaccessible.put_accValue(varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2, szValue); 
     
    11061106 
    11071107    /* 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. 
    11091109     * If there are fewer than the requested number of elements left 
    11101110     * 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 
    11121112     * (unless the caller passed in NULL for that parameter). 
    11131113     */ 
     
    11371137            } 
    11381138            variants = event.children; 
    1139         }   
     1139        } 
    11401140        Object[] nextItems = null; 
    11411141        if (variants != null && celt >= 1) { 
     
    11771177        return COM.S_FALSE; 
    11781178    } 
    1179      
     1179 
    11801180    /* Skip over the specified number of elements in the enumeration sequence. */ 
    11811181    int Skip(int celt) { 
     
    12001200        return COM.S_OK; 
    12011201    } 
    1202      
     1202 
    12031203    /* Reset the enumeration sequence to the beginning. */ 
    12041204    int Reset() { 
     
    12141214            return code; 
    12151215        } 
    1216          
     1216 
    12171217        enumIndex = 0; 
    12181218        return COM.S_OK; 
     
    12381238        return osState; 
    12391239    } 
    1240      
     1240 
    12411241    int osToState(int osState) { 
    12421242        int state = ACC.STATE_NORMAL; 
     
    13321332    bit isValidThread () { 
    13331333        bit result = false; 
    1334         result = control.getDisplay ().getThread () == Thread.currentThread () ? true : false; 
     1334        result = control.getDisplay ().getThread () == Thread.getThis () ? true : false; 
    13351335        return result; 
    13361336    } 
    1337      
     1337 
    13381338 
    13391339 
  • trunk/src/dwt/graphics/color.d

    r41 r42  
    8686 */ 
    8787public 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); 
    9090    init(device, red, green, blue); 
    9191    if (device.tracking) device.new_Object(this); 
     
    115115 */ 
    116116public 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); 
    119119    init(device, rgb.red, rgb.green, rgb.blue); 
    120120    if (device.tracking) device.new_Object(this); 
     
    341341 */ 
    342342public static Color win32_new(Device device, int handle) { 
    343     if (device == null) device = Device.getDevice(); 
     343    if (device is null) device = Device.getDevice(); 
    344344    Color color = new Color(); 
    345345    color.handle = handle; 
  • trunk/src/dwt/graphics/cursor.d

    r41 r42  
    201201 
    202202public 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); 
    205205    this.device = device; 
    206206    int lpCursorName = 0; 
     
    283283 */ 
    284284public 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); 
    287287    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) { 
    290290        if (source.getTransparencyType() != DWT.TRANSPARENCY_MASK) { 
    291291            DWT.error(DWT.ERROR_NULL_ARGUMENT); 
     
    341341 */ 
    342342public 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); 
    345345    this.device = device; 
    346     if (source == null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 
     346    if (source is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 
    347347    /* Check the hotspots */ 
    348348    if (hotspotX >= source.width || hotspotX < 0 || 
     
    479479 */ 
    480480public static Cursor win32_new(Device device, int handle) { 
    481     if (device == null) device = Device.getDevice(); 
     481    if (device is null) device = Device.getDevice(); 
    482482    Cursor cursor = new Cursor(); 
    483483    cursor.handle = handle; 
  • trunk/src/dwt/graphics/device.d

    r41 r42  
    460460    int offset = 0; 
    461461    int hDC = internal_new_GC (null); 
    462     if (faceName == null) { 
     462    if (faceName is null) { 
    463463        /* The user did not specify a face name, so they want all versions of all available face names */ 
    464464 
     
    737737void new_Object (Object object) { 
    738738    for (int i=0; i<objects.length; i++) { 
    739         if (objects [i] == null) { 
     739        if (objects [i] is null) { 
    740740            objects [i] = object; 
    741741            errors [i] = new Error ("Java doesn't require a string here but D does -- andy"); 
  • trunk/src/dwt/graphics/font.d

    r41 r42  
    8080 */ 
    8181public 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); 
    8484    init(device, fd); 
    8585    if (device.tracking) device.new_Object(this); 
     
    110110 */ 
    111111public 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); 
    115115    if (fds.length == 0) DWT.error(DWT.ERROR_INVALID_ARGUMENT); 
    116116    init(device, fds[0]); 
     
    141141 */ 
    142142public 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); 
    146146    init(device, new FontData (name, height, style)); 
    147147    if (device.tracking) device.new_Object(this); 
     
    218218 
    219219void 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); 
    221221    this.device = device; 
    222222    LOGFONT* logFont = fd.data; 
     
    268268 */ 
    269269public static Font win32_new(Device device, int handle) { 
    270     if (device == null) device = Device.getDevice(); 
     270    if (device is null) device = Device.getDevice(); 
    271271    Font font = new Font(); 
    272272    font.handle = handle; 
  • trunk/src/dwt/graphics/fontdata.d

    r41 r42  
    11/******************************************************************************* 
    22 * 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 
    44 * are made available under the terms of the Common Public License v1.0 
    55 * which accompanies this distribution, and is available at 
    66 * http://www.eclipse.org/legal/cpl-v10.html 
    7  *  
     7 * 
    88 * Contributors: 
    99 *     IBM Corporation - initial API and implementation 
     
    1212/******************************************************************************* 
    1313 * DWT: SWT port for the D Language 
    14  *  
     14 * 
    1515 * Contributors: 
    1616 *  The DWT team at http://www.dsource.org/projects/dwt 
    17  *  
     17 * 
    1818 *******************************************************************************/ 
    1919 
     
    3535private import std.string; 
    3636private import std.utf; 
    37      
     37