Changeset 31

Show
Ignore:
Timestamp:
07/19/04 15:32:12 (4 years ago)
Author:
brad
Message:

Checkin of Yuriy changes - first to compile

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/0.1/src/SConstruct

    r15 r31  
    77 
    88SRC = ( 
    9     glob('dwt/*.d') + 
    10     glob('dwt/graphics/*.d') + 
     9    glob('dwt/*.d') +  
     10    glob('dwt/accessibility/*.d') + 
     11    glob('dwt/internal/win32/*.d') + 
    1112    glob('dwt/internal/*.d') + 
    1213    glob('dwt/util/*.d') + 
    13     glob('dwt/widgets/*.d') + 
    14     glob('HelloDWT.d') 
     14    glob('dwt/graphics/*.d') + 
     15    glob('dwt/widgets/*.d')  
    1516) 
    1617 
     
    1920    SRC += glob('dwt/*/win32/*.d') # ooo 
    2021 
     22 
    2123elif 'linux' in sys.platform: 
    2224    env.Append(DVERSIONS=['unix', 'linux'])  
    2325    SRC += glob('dwt/*/gtk/*.d') 
    24      
    25      
     26 
     27SRC += glob('HelloDWT.d') 
     28 
    2629env.Program(SRC) 
  • branches/0.1/src/dwt/accessibility/accessible.d

    r30 r31  
    5454public class Accessible { 
    5555 
     56    private import dwt.dwt; 
     57    private import dwt.widgets.control; 
     58    private import dwt.util.thread; 
    5659 
    5760    int refCount = 0, enumIndex = 0; 
     61/+  
    5862    COMObject objIAccessible, objIEnumVARIANT; 
    5963    IAccessible iaccessible; 
     
    6165    Vector accessibleControlListeners = new Vector(); 
    6266    Vector textListeners = new Vector (); 
     67+/ 
    6368    Object[] variants; 
    6469    Control control; 
     
    6671    this(Control control) { 
    6772        this.control = control; 
     73/+ TODO: 
    6874        int[] ppvObject = new int[1]; 
    6975        int result = COM.CreateStdAccessibleObject(control.handle, COM.OBJID_CLIENT, COM.IIDIAccessible, ppvObject); 
     
    113119            // method6 Clone - not implemented 
    114120        }; 
     121+/   
    115122        AddRef(); 
    116123    } 
    117      
    118124    /** 
    119125     * Invokes platform specific functionality to allocate a new accessible object. 
     
    132138        return new Accessible(control); 
    133139    } 
    134 /+ TODO: delegates? 
     140 
     141/+ 
    135142    /** 
    136143     * Adds the listener to the collection of listeners who will 
     
    216223        textListeners.addElement (listener);         
    217224    } 
    218 +/ 
    219  
     225+/   
    220226    /** 
    221227     * Gets the control for this Accessible object.  
     
    238244     */ 
    239245    public void internal_dispose_Accessible() { 
     246/+ TODO: working with COM 
    240247        if (iaccessible != null) 
    241248            iaccessible.Release(); 
    242249        iaccessible = null; 
     250+/ 
    243251        Release(); 
    244252    } 
     
    255263     */ 
    256264    public int internal_WM_GETOBJECT (int wParam, int lParam) { 
     265/+ TODO: COM 
    257266        if (objIAccessible == null) return 0; 
    258267        if (lParam == COM.OBJID_CLIENT) { 
    259268            return COM.LresultFromObject(COM.IIDIAccessible, wParam, objIAccessible.getAddress()); 
    260269        } 
     270+/ 
    261271        return 0; 
    262272    } 
    263273 
    264 /+ TODO: delegates? 
    265274    /** 
    266275     * Removes the listener from the collection of listeners who will 
     
    282291     * @see #addAccessibleListener 
    283292     */ 
     293/+ 
    284294    public void removeAccessibleListener(AccessibleListener listener) { 
    285295        checkWidget(); 
     
    340350    } 
    341351+/ 
    342  
    343352    /** 
    344353     * Sends a message to accessible clients that the child selection 
     
    354363    public void selectionChanged () { 
    355364        checkWidget(); 
    356         COM.NotifyWinEvent (COM.EVENT_OBJECT_SELECTIONWITHIN, control.handle, COM.OBJID_CLIENT, COM.CHILDID_SELF); 
     365        // TODO: COM.NotifyWinEvent (COM.EVENT_OBJECT_SELECTIONWITHIN, control.handle, COM.OBJID_CLIENT, COM.CHILDID_SELF); 
    357366    } 
    358367 
     
    371380        checkWidget(); 
    372381        int id; 
     382/+ TODO: 
    373383        if (childID == ACC.CHILDID_SELF) id = COM.CHILDID_SELF; 
    374384        else if (control instanceof Tree) id = childID; // Tree item childIDs are pointers 
    375385        else id = childID + 1; // All other childIDs are 1-based indices 
    376386        COM.NotifyWinEvent (COM.EVENT_OBJECT_FOCUS, control.handle, COM.OBJID_CLIENT, id); 
     387+/ 
    377388    } 
    378389 
     
    392403    public void textCaretMoved (int index) { 
    393404        checkWidget(); 
    394         COM.NotifyWinEvent (COM.EVENT_OBJECT_LOCATIONCHANGE, control.handle, COM.OBJID_CARET, COM.CHILDID_SELF); 
     405        // TODO: COM.NotifyWinEvent (COM.EVENT_OBJECT_LOCATIONCHANGE, control.handle, COM.OBJID_CARET, COM.CHILDID_SELF); 
    395406    } 
    396407     
     
    416427    public void textChanged (int type, int startIndex, int length) { 
    417428        checkWidget(); 
    418         COM.NotifyWinEvent (COM.EVENT_OBJECT_VALUECHANGE, control.handle, COM.OBJID_CLIENT, COM.CHILDID_SELF); 
     429        //TODO: COM.NotifyWinEvent (COM.EVENT_OBJECT_VALUECHANGE, control.handle, COM.OBJID_CLIENT, COM.CHILDID_SELF); 
    419430    } 
    420431     
     
    434445        // not an MSAA event 
    435446    } 
    436      
     447 
     448/+   
    437449    int QueryInterface(int arg1, int arg2) { 
    438450        if (iaccessible == null) return COM.CO_E_OBJNOTCONNECTED; 
     
    470482        return result; 
    471483    } 
     484+/ 
    472485 
    473486    int AddRef() { 
     
    478491    int Release() { 
    479492        refCount--; 
    480  
     493/+ 
    481494        if (refCount == 0) { 
    482495            if (objIAccessible != null) 
     
    488501            objIEnumVARIANT = null; 
    489502        } 
     503+/ 
    490504        return refCount; 
    491505    } 
    492  
     506/+ 
    493507    int accDoDefaultAction(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2) { 
    494508        if (iaccessible == null) return COM.CO_E_OBJNOTCONNECTED; 
     
    12041218        return COM.S_OK; 
    12051219    } 
    1206      
     1220 
    12071221    int stateToOs(int state) { 
    12081222        int osState = 0; 
     
    13071321        return role; 
    13081322    } 
     1323+/ 
    13091324 
    13101325    /* checkWidget was copied from Widget, and rewritten to work in this package */ 
    13111326    void checkWidget () { 
    1312         if (!isValidThread ()) SWT.error (SWT.ERROR_THREAD_INVALID_ACCESS); 
    1313         if (control.isDisposed ()) SWT.error (SWT.ERROR_WIDGET_DISPOSED); 
     1327        if (!isValidThread ()) DWT.error (DWT.ERROR_THREAD_INVALID_ACCESS); 
     1328        if (control.isDisposed ()) DWT.error (DWT.ERROR_WIDGET_DISPOSED); 
    13141329    } 
    13151330 
    13161331    /* isValidThread was copied from Widget, and rewritten to work in this package */ 
    1317     boolean isValidThread () { 
    1318         return control.getDisplay ().getThread () == Thread.currentThread (); 
    1319     } 
    1320      
    1321 +/ 
     1332    bit isValidThread () { 
     1333        bit result = false; 
     1334        result = control.getDisplay ().getThread () == Thread.currentThread () ? true : false; 
     1335        return result; 
     1336    } 
     1337     
     1338 
    13221339 
    13231340} 
  • branches/0.1/src/dwt/dwt.d

    r17 r31  
    25672567public static void error (int code, bit throwable) { 
    25682568 
    2569  
    2570  
    25712569    /* 
    25722570    * This code prevents the creation of "chains" of SWTErrors and 
     
    26482646//  error.throwable = throwable; 
    26492647//  throw error; 
    2650      
    2651  
    26522648 
    26532649} 
  • branches/0.1/src/dwt/graphics/color.d

    r17 r31  
    2727+/ 
    2828 
     29/** 
     30 * Instances of this class manage the operating system resources that 
     31 * implement DWT's RGB color model. To create a color you can either 
     32 * specify the individual color components as integers in the range 
     33 * 0 to 255 or provide an instance of an <code>RGB</code>. 
     34 * <p> 
     35 * Application code must explicitly invoke the <code>Color.dispose()</code> 
     36 * method to release the operating system resources managed by each instance 
     37 * when those instances are no longer required. 
     38 * </p> 
     39 * 
     40 * @see RGB 
     41 * @see Device#getSystemColor 
     42 */ 
     43 
     44public final class Color { 
     45 
    2946private import dwt.dwt; 
    3047private import dwt.graphics.rgb; 
     
    3249private import dwt.internal.win32.os; 
    3350private import std.string; 
    34  
    35  
    36 /** 
    37  * Instances of this class manage the operating system resources that 
    38  * implement DWT's RGB color model. To create a color you can either 
    39  * specify the individual color components as integers in the range 
    40  * 0 to 255 or provide an instance of an <code>RGB</code>. 
    41  * <p> 
    42  * Application code must explicitly invoke the <code>Color.dispose()</code> 
    43  * method to release the operating system resources managed by each instance 
    44  * when those instances are no longer required. 
    45  * </p> 
    46  * 
    47  * @see RGB 
    48  * @see Device#getSystemColor 
    49  */ 
    50  
    51 public final class Color { 
    5251 
    5352    /** 
     
    167166public bit equals (Object object) { 
    168167    if (object == this) return true; 
    169 // TODO: deal with instanceof       if (!(object instanceof Color)) return false; 
     168//  if (!(object instanceof Color)) return false; 
     169    if (!(cast(Color)object)) return false; 
    170170    Color color = cast(Color) object; 
    171171    return device == color.device && (handle & 0xFFFFFF) == (color.handle & 0xFFFFFF); 
     
    326326public char[] toString () { 
    327327    if (isDisposed()) return "Color {*DISPOSED*}"; //$NON-NLS-1$ 
    328     return "Color {" ~ .toString(getRed()) ~ ", " ~ .toString(getGreen()) ~ ", " ~ .toString(getBlue()) ~ "}"; //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ 
     328    char[] redColor = std.string.toString(getRed()); 
     329    return "Color {" ~ redColor 
     330    ~ ", " ~ std.string.toString(getGreen()) ~ ", "  
     331    ~ std.string.toString(getBlue()) ~ "}"; //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ 
    329332} 
    330333 
  • branches/0.1/src/dwt/graphics/cursor.d

    r17 r31  
    5656 
    5757public final class Cursor { 
    58      
     58 
     59    private import dwt.graphics.device; 
     60    private import dwt.graphics.imagedata; 
     61    private import dwt.graphics.image; 
     62 
     63    private import dwt.util.util; 
     64    private import std.string; 
     65    private import dwt.dwt; 
     66    private import dwt.internal.win32.os; 
     67    private import dwt.internal.win32.types; 
     68         
    5969    /** 
    6070     * the handle to the OS cursor resource 
     
    154164} 
    155165 
    156 /+ 
    157  
    158166/**   
    159167 * Constructs a new cursor given a device and a style 
     
    197205 * @see SWT#CURSOR_HAND 
    198206 */ 
    199 public Cursor(Device device, int style) { 
     207public this(Device device, int style) { 
    200208    if (device == null) device = Device.getDevice(); 
    201     if (device == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); 
     209    if (device == null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 
    202210    this.device = device; 
    203211    int lpCursorName = 0; 
    204212    switch (style) { 
    205         case SWT.CURSOR_HAND:         lpCursorName = OS.IDC_HAND; break; 
    206         case SWT.CURSOR_ARROW:        lpCursorName = OS.IDC_ARROW; break; 
    207         case SWT.CURSOR_WAIT:         lpCursorName = OS.IDC_WAIT; break; 
    208         case SWT.CURSOR_CROSS:        lpCursorName = OS.IDC_CROSS; break; 
    209         case SWT.CURSOR_APPSTARTING:  lpCursorName = OS.IDC_APPSTARTING; break; 
    210         case SWT.CURSOR_HELP:         lpCursorName = OS.IDC_HELP; break; 
    211         case SWT.CURSOR_SIZEALL:  lpCursorName = OS.IDC_SIZEALL; break; 
    212         case SWT.CURSOR_SIZENESW:     lpCursorName = OS.IDC_SIZENESW; break; 
    213         case SWT.CURSOR_SIZENS:   lpCursorName = OS.IDC_SIZENS; break; 
    214         case SWT.CURSOR_SIZENWSE:     lpCursorName = OS.IDC_SIZENWSE; break; 
    215         case SWT.CURSOR_SIZEWE:   lpCursorName = OS.IDC_SIZEWE; break; 
    216         case SWT.CURSOR_SIZEN:        lpCursorName = OS.IDC_SIZENS; break; 
    217         case SWT.CURSOR_SIZES:        lpCursorName = OS.IDC_SIZENS; break; 
    218         case SWT.CURSOR_SIZEE:        lpCursorName = OS.IDC_SIZEWE; break; 
    219         case SWT.CURSOR_SIZEW:        lpCursorName = OS.IDC_SIZEWE; break; 
    220         case SWT.CURSOR_SIZENE:   lpCursorName = OS.IDC_SIZENESW; break; 
    221         case SWT.CURSOR_SIZESE:   lpCursorName = OS.IDC_SIZENWSE; break; 
    222         case SWT.CURSOR_SIZESW:   lpCursorName = OS.IDC_SIZENESW; break; 
    223         case SWT.CURSOR_SIZENW:   lpCursorName = OS.IDC_SIZENWSE; break; 
    224         case SWT.CURSOR_UPARROW:  lpCursorName = OS.IDC_UPARROW; break; 
    225         case SWT.CURSOR_IBEAM:        lpCursorName = OS.IDC_IBEAM; break; 
    226         case SWT.CURSOR_NO:       lpCursorName = OS.IDC_NO; break; 
     213        case DWT.CURSOR_HAND:         lpCursorName = OS.IDC_HAND; break; 
     214        case DWT.CURSOR_ARROW:        lpCursorName = OS.IDC_ARROW; break; 
     215        case DWT.CURSOR_WAIT:         lpCursorName = OS.IDC_WAIT; break; 
     216        case DWT.CURSOR_CROSS:        lpCursorName = OS.IDC_CROSS; break; 
     217        case DWT.CURSOR_APPSTARTING:  lpCursorName = OS.IDC_APPSTARTING; break; 
     218        case DWT.CURSOR_HELP:         lpCursorName = OS.IDC_HELP; break; 
     219        case DWT.CURSOR_SIZEALL:  lpCursorName = OS.IDC_SIZEALL; break; 
     220        case DWT.CURSOR_SIZENESW:     lpCursorName = OS.IDC_SIZENESW; break; 
     221        case DWT.CURSOR_SIZENS:   lpCursorName = OS.IDC_SIZENS; break; 
     222        case DWT.CURSOR_SIZENWSE:     lpCursorName = OS.IDC_SIZENWSE; break; 
     223        case DWT.CURSOR_SIZEWE:   lpCursorName = OS.IDC_SIZEWE; break; 
     224        case DWT.CURSOR_SIZEN:        lpCursorName = OS.IDC_SIZENS; break; 
     225        case DWT.CURSOR_SIZES:        lpCursorName = OS.IDC_SIZENS; break; 
     226        case DWT.CURSOR_SIZEE:        lpCursorName = OS.IDC_SIZEWE; break; 
     227        case DWT.CURSOR_SIZEW:        lpCursorName = OS.IDC_SIZEWE; break; 
     228        case DWT.CURSOR_SIZENE:   lpCursorName = OS.IDC_SIZENESW; break; 
     229        case DWT.CURSOR_SIZESE:   lpCursorName = OS.IDC_SIZENWSE; break; 
     230        case DWT.CURSOR_SIZESW:   lpCursorName = OS.IDC_SIZENESW; break; 
     231        case DWT.CURSOR_SIZENW:   lpCursorName = OS.IDC_SIZENWSE; break; 
     232        case DWT.CURSOR_UPARROW:  lpCursorName = OS.IDC_UPARROW; break; 
     233        case DWT.CURSOR_IBEAM:        lpCursorName = OS.IDC_IBEAM; break; 
     234        case DWT.CURSOR_NO:       lpCursorName = OS.IDC_NO; break; 
    227235        default: 
    228             SWT.error(SWT.ERROR_INVALID_ARGUMENT); 
     236            DWT.error(DWT.ERROR_INVALID_ARGUMENT); 
    229237    } 
    230238    handle = OS.LoadCursor(0, lpCursorName); 
     
    233241    * Create a hand cursor if running in other Windows platforms. 
    234242    */ 
    235     if (handle == 0 && style == SWT.CURSOR_HAND) { 
     243    if (handle == 0 && style == DWT.CURSOR_HAND) { 
    236244        int width = OS.GetSystemMetrics(OS.SM_CXCURSOR); 
    237245        int height = OS.GetSystemMetrics(OS.SM_CYCURSOR); 
    238246        if (width == 32 && height == 32) { 
    239247            int hInst = OS.GetModuleHandle(null); 
    240             if (OS.IsWinCE) SWT.error(SWT.ERROR_NOT_IMPLEMENTED); 
    241             handle = OS.CreateCursor(hInst, 5, 0, 32, 32, HAND_SOURCE, HAND_MASK); 
     248            if (OS.IsWinCE) DWT.error(DWT.ERROR_NOT_IMPLEMENTED); 
     249            handle = OS.CreateCursor(hInst, 5, 0, 32, 32, &HAND_SOURCE, &HAND_MASK); 
    242250 
    243251        } 
    244252    } 
    245     if (handle == 0) SWT.error(SWT.ERROR_NO_HANDLES); 
     253    if (handle == 0) DWT.error(DWT.ERROR_NO_HANDLES); 
    246254    if (device.tracking) device.new_Object(this); 
    247255} 
     
    279287 * </ul> 
    280288 */ 
    281 public Cursor(Device device, ImageData source, ImageData mask, int hotspotX, int hotspotY) { 
     289public this(Device device, ImageData source, ImageData mask, int hotspotX, int hotspotY) { 
    282290    if (device == null) device = Device.getDevice(); 
    283     if (device == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); 
     291    if (device == null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 
    284292    this.device = device; 
    285     if (source == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); 
     293    if (source == null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 
    286294    if (mask == null) { 
    287         if (source.getTransparencyType() != SWT.TRANSPARENCY_MASK) { 
    288             SWT.error(SWT.ERROR_NULL_ARGUMENT); 
     295        if (source.getTransparencyType() != DWT.TRANSPARENCY_MASK) { 
     296            DWT.error(DWT.ERROR_NULL_ARGUMENT); 
    289297        } 
    290298        mask = source.getTransparencyMask(); 
     
    292300    /* Check the bounds. Mask must be the same size as source */ 
    293301    if (mask.width != source.width || mask.height != source.height) { 
    294         SWT.error(SWT.ERROR_INVALID_ARGUMENT); 
     302        DWT.error(DWT.ERROR_INVALID_ARGUMENT); 
    295303    } 
    296304    /* Check color depths */ 
    297     if (mask.depth != 1) SWT.error(SWT.ERROR_INVALID_ARGUMENT); 
    298     if (source.depth != 1) SWT.error(SWT.ERROR_INVALID_ARGUMENT); 
     305    if (mask.depth != 1) DWT.error(DWT.ERROR_INVALID_ARGUMENT); 
     306    if (source.depth != 1) DWT.error(DWT.ERROR_INVALID_ARGUMENT); 
    299307    /* Check the hotspots */ 
    300308    if (hotspotX >= source.width || hotspotX < 0 || 
    301309        hotspotY >= source.height || hotspotY < 0) { 
    302         SWT.error(SWT.ERROR_INVALID_ARGUMENT); 
     310        DWT.error(DWT.ERROR_INVALID_ARGUMENT); 
    303311    } 
    304312    /* Create the cursor */ 
    305313    int hInst = OS.GetModuleHandle(null); 
    306     if (OS.IsWinCE) SWT.error (SWT.ERROR_NOT_IMPLEMENTED); 
    307     handle = OS.CreateCursor(hInst, hotspotX, hotspotY, source.width, source.height, source.data, mask.data); 
    308     if (handle == 0) SWT.error(SWT.ERROR_NO_HANDLES); 
     314    if (OS.IsWinCE) DWT.error(DWT.ERROR_NOT_IMPLEMENTED); 
     315    handle = OS.CreateCursor(hInst, hotspotX, hotspotY, source.width, source.height, &source.data, &mask.data); 
     316    if (handle == 0) DWT.error(DWT.ERROR_NO_HANDLES); 
    309317    if (device.tracking) device.new_Object(this); 
    310318} 
     
    337345 * @since 3.0 
    338346 */ 
    339 public Cursor(Device device, ImageData source, int hotspotX, int hotspotY) { 
     347public this(Device device, ImageData source, int hotspotX, int hotspotY) { 
    340348    if (device == null) device = Device.getDevice(); 
    341     if (device == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); 
     349    if (device == null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 
    342350    this.device = device; 
    343     if (source == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); 
     351    if (source == null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 
    344352    /* Check the hotspots */ 
    345353    if (hotspotX >= source.width || hotspotX < 0 || 
    346354        hotspotY >= source.height || hotspotY < 0) { 
    347         SWT.error(SWT.ERROR_INVALID_ARGUMENT); 
     355        DWT.error(DWT.ERROR_INVALID_ARGUMENT); 
    348356    } 
    349357    ImageData mask = source.getTransparencyMask(); 
     
    352360    int hMask = result[1]; 
    353361    /* Create the icon */ 
    354     ICONINFO info = new ICONINFO()
     362    ICONINFO info
    355363    info.fIcon = true; 
    356364    info.hbmColor = hBitmap; 
    357365    info.hbmMask = hMask; 
    358     handle = OS.CreateIconIndirect(info); 
    359     if (handle == 0) SWT.error(SWT.ERROR_NO_HANDLES); 
     366    handle = OS.CreateIconIndirect(&info); 
     367    if (handle == 0) DWT.error(DWT.ERROR_NO_HANDLES); 
    360368    OS.DeleteObject(hBitmap); 
    361369    OS.DeleteObject(hMask); 
     
    414422 * @see #hashCode 
    415423 */ 
    416 public boolean equals (Object object) { 
     424public bit equals (Object object) { 
    417425    if (object == this) return true; 
    418     if (!(object instanceof Cursor)) return false; 
    419     Cursor cursor = (Cursor) object; 
     426    if (!(cast(Cursor)object))  
     427        return false; 
     428    Cursor cursor = cast(Cursor)object; 
    420429    return device == cursor.device && handle == cursor.handle; 
    421430} 
     
    445454 * @return <code>true</code> when the cursor is disposed and <code>false</code> otherwise 
    446455 */ 
    447 public boolean isDisposed() { 
     456public bit isDisposed() { 
    448457    return handle == 0; 
    449458} 
     
    455464 * @return a string representation of the receiver 
    456465 */ 
    457 public String toString () { 
     466public char[] toString() { 
    458467    if (isDisposed()) return "Cursor {*DISPOSED*}"; 
    459     return "Cursor {" + handle + "}"; 
     468    return "Cursor {" ~ std.string.toString(handle) ~ "}"; 
    460469} 
    461470 
     
    481490} 
    482491 
    483 +/ 
    484  
    485 
     492
  • branches/0.1/src/dwt/graphics/device.d

    r24 r31  
    6262 
    6363    import dwt.util.runnable; 
     64    import dwt.util.system; 
    6465} 
    6566 
     
    491492             */ 
    492493            if (OS.IsUnicode) { 
    493                 OS.EnumFontFamiliesW (hDC, ((LOGFONTW)lf).lfFaceName, lpEnumFontFamProc, scalable ? 1 : 0); 
     494                OS.EnumFontFamiliesW (hDC, (cast(LOGFONTW)lf).lfFaceName, lpEnumFontFamProc, scalable ? 1 : 0); 
    494495            } else { 
    495                 OS.EnumFontFamiliesA (hDC, ((LOGFONTA)lf).lfFaceName, lpEnumFontFamProc, scalable ? 1 : 0); 
     496                OS.EnumFontFamiliesA (hDC, (cast(LOGFONTA)lf).lfFaceName, lpEnumFontFamProc, scalable ? 1 : 0); 
    496497            } 
    497498+/ 
     
    753754    } 
    754755    Object [] newObjects = new Object [objects.length + 128]; 
    755 // TODO:  System.arraycopy (objects, 0, newObjects, 0, objects.length); 
     756  System.arraycopy (objects, 0, newObjects, 0, objects.length); 
    756757    newObjects [objects.length] = object; 
    757758    objects = newObjects; 
    758759    Error [] newErrors = new Error [errors.length + 128]; 
    759 // TODO:  System.arraycopy (errors, 0, newErrors, 0, errors.length); 
     760  System.arraycopy (errors, 0, newErrors, 0, errors.length); 
    760761    newErrors [errors.length] = new Error ("Same here"); 
    761762    errors = newErrors; 
  • branches/0.1/src/dwt/graphics/font.d

    r17 r31  
    3232private import dwt.internal.win32.os; 
    3333private import dwt.internal.win32.types; 
    34 private import std.string; 
     34//private import std.string; 
    3535 
    3636 
     
    180180public bit equals(Object object) { 
    181181    if (object == this) return true; 
    182 // TODO: instanceof   if (!(object instanceof Font)) return false; 
     182//    if (!(object instanceof Font)) return false; 
    183183    Font font = cast(Font) object; 
    184184    return device == font.device && handle == font.handle; 
     
    256256public char[] toString () { 
    257257    if (isDisposed()) return "Font {*DISPOSED*}"; 
    258     return "Font {" ~ .toString(handle) ~ "}"; 
     258    return "Font {" ~ std.string.toString(handle) ~ "}"; 
    259259} 
    260260 
  • branches/0.1/src/dwt/graphics/fontdata.d

    r17 r31  
    3737 
    3838private import dwt.util.string; 
     39//private import dwt.util.util; 
    3940 
    4041private import std.string; 
     42private import std.utf; 
    4143 
    4244 
     
    279281public bit equals (Object object) { 
    280282    if (object == this) return true; 
    281 // TODO: instanceof     if (!(object instanceof FontData)) return false; 
     283//  if (!(object instanceof FontData)) return false; 
     284    if (!(cast(FontData)object)) return false; 
    282285    FontData fd = cast(FontData)object; 
    283286    LOGFONT* lf = fd.data; 
     
    588591 */ 
    589592public char[] toString() { 
    590 /*// TODO:  StringBuffer buffer = new StringBuffer(); 
    591     buffer.append("1|"); 
    592     buffer.append(getName()); 
    593     buffer.append("|"); 
    594     buffer.append(getHeight()); 
    595     buffer.append("|"); 
    596     buffer.append(getStyle()); 
    597     buffer.append("|"); 
    598     buffer.append("WINDOWS|1|"); 
    599     buffer.append(data.lfHeight); 
    600     buffer.append("|"); 
    601     buffer.append(data.lfWidth); 
    602     buffer.append("|"); 
    603     buffer.append(data.lfEscapement); 
    604     buffer.append("|"); 
    605     buffer.append(data.lfOrientation); 
    606     buffer.append("|"); 
    607     buffer.append(data.lfWeight); 
    608     buffer.append("|"); 
    609     buffer.append(data.lfItalic); 
    610     buffer.append("|"); 
    611     buffer.append(data.lfUnderline); 
    612     buffer.append("|"); 
    613     buffer.append(data.lfStrikeOut); 
    614     buffer.append("|"); 
    615     buffer.append(data.lfCharSet); 
    616     buffer.append("|"); 
    617     buffer.append(data.lfOutPrecision); 
    618     buffer.append("|"); 
    619     buffer.append(data.lfClipPrecision); 
    620     buffer.append("|"); 
    621     buffer.append(data.lfQuality); 
    622     buffer.append("|"); 
    623     buffer.append(data.lfPitchAndFamily); 
    624     buffer.append("|"); 
    625     buffer.append(getName()); 
    626     return buffer.toString();*/ 
    627         return "FontData blaaaaaah. TODO: replace me with something useful."; 
     593    char[] fontDescription = "1|" ~ std.utf.toUTF8(getName()) ~ "|" 
     594        ~ .toString(getHeight()) ~ "|" 
     595        ~ .toString(getStyle()) ~ "|" ~ "WINDOWS|1|"  
     596        ~ .toString(data.lfHeight) ~ "|" 
     597        ~ .toString(data.lfWidth) ~ "|"  
     598        ~ .toString(data.lfEscapement) ~ "|"  
     599        ~ .toString(data.lfOrientation) ~ "|" 
     600        ~ .toString(data.lfWeight) ~ "|"  
     601        ~ .toString(data.lfItalic) ~ "|"  
     602        ~ .toString(data.lfUnderline) ~ "|" 
     603        ~ .toString(data.lfStrikeOut) ~ "|" 
     604        ~ .toString(data.lfCharSet) ~ "|" 
     605        ~ .toString(data.lfOutPrecision) ~ "|" 
     606        ~ .toString(data.lfClipPrecision) ~ "|" 
     607        ~ .toString(data.lfQuality) ~ "|" 
     608        ~ .toString(data.lfPitchAndFamily) ~ "|" 
     609        ~ .toUTF8(getName()); 
     610        return fontDescription; 
    628611} 
    629612 
  • branches/0.1/src/dwt/graphics/gc.d

    r27 r31  
    5353    import dwt.util.util; 
    5454 
    55   import std.math; 
    56   import std.string; 
     55//    import std.math; 
     56//    import std.string; 
    5757} 
    5858 
     
    14921492        return false; 
    14931493    return handle == gc.handle; 
    1494     //return (object === this);  /+ TODO: instanceof || ((object instanceof GC) && (handle == ((GC)object).handle)) +/ ; 
     1494//  TODO: original code was 
     1495//return (object == this) || ((object instanceof GC) && (handle == ((GC)object).handle)); 
    14951496} 
    14961497 
     
    25602561public char[] toString () { 
    25612562    if (isDisposed()) return "GC {*DISPOSED*}"; 
    2562     return "GC {" ~ .toString(handle) ~ "}"; 
     2563    return "GC {" ~ std.string.toString(handle) ~ "}"; 
    25632564} 
    25642565 
  • branches/0.1/src/dwt/graphics/image.d

    r27 r31  
    4444    import dwt.internal.win32.types; 
    4545 
    46   import std.string; 
     46//    import std.string; 
    4747} 
    4848 
     
    911911public bit equals (Object object) { 
    912912    if (object == this) return true; 
    913 // TODO:    if (!(object instanceof Image)) return false; 
    914913    Image image = cast(Image)object; 
     914    if (!image) return false; 
    915915    return device == image.device && handle == image.handle; 
    916916} 
     
    19631963public char[] toString () { 
    19641964    if (isDisposed()) return "Image {*DISPOSED*}"; 
    1965     return "Image {" ~ .toString(handle) ~ "}"; 
     1965    return "Image {" ~ std.string.toString(handle) ~ "}"; 
    19661966} 
    19671967 
  • branches/0.1/src/dwt/graphics/imagedata.d

    r17 r31  
    2727import org.eclipse.swt.internal.CloneableCompatibility; 
    2828+/ 
    29  
    30 private 
    31 
    32     import dwt.dwt; 
    33     import dwt.graphics.rgb; 
    34     import dwt.graphics.device; 
    35     import dwt.graphics.gc; 
    36     import dwt.graphics.palettedata; 
    37     import dwt.graphics.image; 
    38     import dwt.graphics.imageloader; 
    39     import dwt.internal.cloneablecompatibility; 
    40  
    41     import std.stream; 
    42 
     29private import dwt.internal.cloneablecompatibility; 
    4330 
    4431/** 
     
    6047public class ImageData : CloneableCompatibility { 
    6148 
     49private 
     50{ 
     51    import dwt.dwt; 
     52    import dwt.graphics.rgb; 
     53    import dwt.graphics.device; 
     54    import dwt.graphics.gc; 
     55    import dwt.graphics.palettedata; 
     56    import dwt.graphics.image; 
     57    import dwt.graphics.imageloader; 
     58    import std.stream; 
     59} 
    6260    /** 
    6361     * The width of the image, in pixels. 
  • branches/0.1/src/dwt/graphics/imageloader.d

    r17 r31  
    2121module dwt.graphics.imageloader; 
    2222 
    23 private 
    24 { 
    25     import dwt.dwt; 
    26  
    27     import dwt.internal.compatibility; 
    28  
    29     import dwt.graphics.imagedata; 
    30  
    31     import std.stream; 
    32 } 
    33  
    3423/** 
    3524 * Instances of this class are used to load images from, 
     
    5544 
    5645public class ImageLoader { 
     46 
     47private 
     48{ 
     49    import dwt.dwt; 
     50    import dwt.internal.compatibility; 
     51    import dwt.graphics.imagedata; 
     52    import std.stream; 
     53} 
    5754 
    5855    /** 
  • branches/0.1/src/dwt/graphics/point.d

    r17 r31  
    2525// import org.eclipse.swt.internal.SerializableCompatibility; 
    2626 
    27 private import dwt.util.util; 
    28  
    2927/** 
    3028 * Instances of this class represent places on the (x, y) 
     
    4745public final class Point /* implements SerializableCompatibility */ { 
    4846     
     47private import dwt.util.util; 
     48private import std.string; 
     49 
    4950    /** 
    5051     * the x coordinate of the point 
     
    114115 
    115116/+  TODO: compiler complains: 'dwt\graphics\point.d(97): function toString overrides but is not covariant with toString'  +/ 
    116 /* 
    117 public String toString () { 
    118     return "Point {" + x + ", " + y + "}"; 
     117public char[] toString () { 
     118    char[] pointDescription = "Point {"; // TODO: <Blandger> DMD complains, why?? 
     119    //~ .toString(x) ~ ", " ~ .toString(y) ~ "}"; 
     120    return pointDescription; 
    119121} 
    120 */ 
    121122 
    122123} 
  • branches/0.1/src/dwt/graphics/rectangle.d

    r17 r31  
    2525// import dwt.*; 
    2626 
    27 private import dwt.dwt; 
    28 private import dwt.graphics.point; 
    29  
    3027/** 
    3128 * Instances of this class represent rectangular areas in an 
     
    5047public final class Rectangle /* : SerializableCompatibility */ { 
    5148     
     49private import dwt.dwt; 
     50private import dwt.graphics.point; 
     51 
     52private import std.string; 
     53 
    5254    /** 
    5355     * the x coordinate of the rectangle 
     
    316318 * @return a string representation of the rectangle 
    317319 */ 
    318 /* public String toString () {  
    319     return "Rectangle {" + x + ", " + y + ", " + width + ", " + height + "}"; //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ 
    320 }*/  
     320public char[] toString () {  
     321    char[] description = "Rectangle {"; // TODO: <Blandger> DMD complains, why? 
     322//  ~ .toString(x) ~ ", " ~ .toString(y) 
     323//  ~ ", " ~ .toString(width) ~ ", " ~ .toString(height) ~ "}"; 
     324    return description; 
     325}  
    321326 
    322327/** 
  • branches/0.1/src/dwt/graphics/region.d

    r17 r31  
    3838    import dwt.internal.win32.types; 
    3939 
    40   import dwt.util.string; 
     40//    import dwt.util.string; 
    4141 
    4242} 
     
    251251public bit equals (Object object) { 
    252252    if (this == object) return true; 
    253 // TODO:    if (!(object instanceof Region)) return false; 
     253//  if (!(object instanceof Region)) return false; 
     254    if (!cast(Region)object) return false; 
    254255    Region rgn = cast(Region)object; 
    255256    return handle == rgn.handle; 
  • branches/0.1/src/dwt/graphics/rgb.d

    r17 r31  
    128128 */ 
    129129public char[] toString () { 
    130 &nb