Changeset 249:b3dbd786541a

Show
Ignore:
Timestamp:
07/06/08 11:23:35 (2 months ago)
Author:
Frank Benoit <benoit@tionex.de>
branch:
default
Message:

Fix: compile errors

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • dwt/graphics/GC.d

    r246 r249  
    14851485 
    14861486    /* Find the RGB values for the transparent pixel. */ 
    1487     bool isDib = bm.bmBits !is 0
     1487    bool isDib = bm.bmBits !is null
    14881488    auto hBitmap = srcImage.handle; 
    14891489    auto srcHdc = OS.CreateCompatibleDC(handle); 
  • dwt/graphics/TextLayout.d

    r246 r249  
    1818import dwt.internal.gdip.Gdip; 
    1919 
    20 import dwt.internal.win32.EMR; 
    21 import dwt.internal.win32.EMREXTCREATEFONTINDIRECTW; 
    2220import dwt.internal.win32.OS; 
    2321 
     
    512510} 
    513511 
    514 SCRIPT_ANALYSIS cloneScriptAnalysis (SCRIPT_ANALYSIS src) { 
    515     SCRIPT_ANALYSIS dst = new SCRIPT_ANALYSIS()
     512SCRIPT_ANALYSIS cloneScriptAnalysis ( inout SCRIPT_ANALYSIS src) { 
     513    SCRIPT_ANALYSIS dst
    516514    dst.eScript = src.eScript; 
    517515    dst.fRTL = src.fRTL; 
     
    521519    dst.fLogicalOrder = src.fLogicalOrder; 
    522520    dst.fNoGlyphIndex = src.fNoGlyphIndex; 
    523     dst.s = new SCRIPT_STATE(); 
    524521    dst.s.uBidiLevel = src.s.uBidiLevel;  
    525522    dst.s.fOverrideDirection = src.s.fOverrideDirection; 
     
    27842781} 
    27852782 
    2786 bool shape (HDC hdc, StyleItem run, char[] chars, int[] glyphCount, int maxGlyphs, SCRIPT_PROPERTIES sp) { 
    2787     wchar[] wchars = StrToWCHARs( chars ); 
     2783bool shape (HDC hdc, StyleItem run, wchar[] wchars, int[] glyphCount, int maxGlyphs, SCRIPT_PROPERTIES* sp) { 
     2784    //wchar[] wchars = StrToWCHARs( chars ); 
    27882785    bool useCMAPcheck = !sp.fComplex && !run.analysis.fNoGlyphIndex; 
    27892786    if (useCMAPcheck) { 
    2790         short[] glyphs = new short[chars.length]; 
    2791         if (OS.ScriptGetCMap(hdc, run.psc, chars, chars.length, 0, glyphs) !is OS.S_OK) { 
    2792             if (run.psc !is 0) { 
     2787        ushort[] glyphs = new ushort[wchars.length]; 
     2788        scope(exit) delete glyphs; 
     2789        if (OS.ScriptGetCMap(hdc, run.psc, wchars.ptr, wchars.length, 0, glyphs.ptr) !is OS.S_OK) { 
     2790            if (run.psc !is null) { 
    27932791                OS.ScriptFreeCache(run.psc); 
    27942792                glyphCount[0] = 0; 
    2795                 OS.MoveMemory(run.psc, new int /*long*/ [1], OS.PTR_SIZEOF)
     2793                *cast(int*)run.psc = 1
    27962794            } 
    27972795            return false; 
     
    28402838    segmentsText.getChars(run.start, run.start + run.length, chars, 0); 
    28412839    wchar[] wchars = StrToWCHARs( chars ); 
    2842     int maxGlyphs = (chars.length * 3 / 2) + 16; 
     2840    int maxGlyphs = (wchars.length * 3 / 2) + 16; 
    28432841    auto hHeap = OS.GetProcessHeap(); 
    28442842    run.glyphs = cast(ushort*)OS.HeapAlloc(hHeap, OS.HEAP_ZERO_MEMORY, maxGlyphs * 2); 
     
    28502848    run.psc = cast(SCRIPT_CACHE*)OS.HeapAlloc(hHeap, OS.HEAP_ZERO_MEMORY, (void*).sizeof); 
    28512849    if (run.psc is null) DWT.error(DWT.ERROR_NO_HANDLES); 
    2852     final short script = run.analysis.eScript; 
    2853     final SCRIPT_PROPERTIES sp = new SCRIPT_PROPERTIES(); 
    2854     OS.MoveMemory(sp, device.scripts[script], SCRIPT_PROPERTIES.sizeof); 
    2855     bool shapeSucceed = shape(hdc, run, chars, buffer,  maxGlyphs, sp); 
     2850    short script = run.analysis.eScript; 
     2851    auto sp = device.scripts[script]; 
     2852    bool shapeSucceed = shape(hdc, run, wchars, buffer,  maxGlyphs, sp); 
    28562853    if (!shapeSucceed) { 
    2857         int /*long*/ hFont = OS.GetCurrentObject(hdc, OS.OBJ_FONT); 
    2858         int /*long*/ ssa = OS.HeapAlloc(hHeap, OS.HEAP_ZERO_MEMORY, OS.SCRIPT_STRING_ANALYSIS_sizeof()); 
    2859         int /*long*/ metaFileDc = OS.CreateEnhMetaFile(hdc, null, null, null); 
    2860         int /*long*/ oldMetaFont = OS.SelectObject(metaFileDc, hFont); 
     2854        auto hFont = OS.GetCurrentObject(hdc, OS.OBJ_FONT); 
     2855        auto ssa = cast(SCRIPT_STRING_ANALYSIS*) OS.HeapAlloc(hHeap, OS.HEAP_ZERO_MEMORY, SCRIPT_STRING_ANALYSIS.sizeof); 
     2856        auto metaFileDc = OS.CreateEnhMetaFile(hdc, null, null, null); 
     2857        auto oldMetaFont = OS.SelectObject(metaFileDc, hFont); 
    28612858        int flags = OS.SSA_METAFILE | OS.SSA_FALLBACK | OS.SSA_GLYPHS | OS.SSA_LINK; 
    2862         if (OS.ScriptStringAnalyse(metaFileDc, chars, chars.length, 0, -1, flags, 0, null, null, 0, 0, 0, ssa) is OS.S_OK) { 
     2859        if (OS.ScriptStringAnalyse(metaFileDc, wchars.ptr, wchars.length, 0, -1, flags, 0, null, null, null, null, null, ssa) is OS.S_OK) { 
    28632860            OS.ScriptStringOut(ssa, 0, 0, 0, null, 0, 0, false); 
    28642861            OS.ScriptStringFree(ssa); 
     
    28662863        OS.HeapFree(hHeap, 0, ssa); 
    28672864        OS.SelectObject(metaFileDc, oldMetaFont); 
    2868         int /*long*/ metaFile = OS.CloseEnhMetaFile(metaFileDc); 
    2869         final EMREXTCREATEFONTINDIRECTW emr = new EMREXTCREATEFONTINDIRECTW(); 
    2870         class MetaFileEnumProc { 
    2871             int /*long*/ metaFileEnumProc (int /*long*/ hDC, int /*long*/ table, int /*long*/ record, int /*long*/ nObj, int /*long*/ lpData) { 
    2872                 OS.MoveMemory(emr.emr, record, EMR.sizeof); 
    2873                 switch (emr.emr.iType) { 
    2874                     case OS.EMR_EXTCREATEFONTINDIRECTW: 
    2875                         OS.MoveMemory(emr, record, EMREXTCREATEFONTINDIRECTW.sizeof); 
    2876                         break; 
    2877                     case OS.EMR_EXTTEXTOUTW: 
    2878                         return 0; 
    2879                 } 
    2880                 return 1; 
    2881             } 
    2882         }; 
    2883         MetaFileEnumProc object = new MetaFileEnumProc(); 
    2884         /* Avoid compiler warnings */ 
    2885         if (false) object.metaFileEnumProc(0, 0, 0, 0, 0); 
    2886         Callback callback = new Callback(object, "metaFileEnumProc", 5); 
    2887         int /*long*/ address = callback.getAddress(); 
    2888         if (address is 0) DWT.error(DWT.ERROR_NO_MORE_CALLBACKS); 
    2889         OS.EnumEnhMetaFile(0, metaFile, address, 0, null); 
     2865        auto metaFile = OS.CloseEnhMetaFile(metaFileDc); 
     2866        EMREXTCREATEFONTINDIRECTW emr; 
     2867        static extern(Windows) int metaFileEnumProc (HDC hDC, HANDLETABLE* table, ENHMETARECORD* record, int nObj, LPARAM lpData) { 
     2868            EMREXTCREATEFONTINDIRECTW* emr_; 
     2869            OS.MoveMemory(&emr_.emr, record, EMR.sizeof); 
     2870            switch (emr_.emr.iType) { 
     2871                case OS.EMR_EXTCREATEFONTINDIRECTW: 
     2872                    OS.MoveMemory(emr_, record, EMREXTCREATEFONTINDIRECTW.sizeof); 
     2873                    break; 
     2874                case OS.EMR_EXTTEXTOUTW: 
     2875                    return 0; 
     2876            } 
     2877            return 1; 
     2878        } 
     2879        OS.EnumEnhMetaFile(null, metaFile, &metaFileEnumProc, &emr, null); 
    28902880        OS.DeleteEnhMetaFile(metaFile); 
    2891         callback.dispose(); 
    2892  
    2893         int /*long*/ newFont = OS.CreateFontIndirectW(emr.elfw.elfLogFont); 
     2881 
     2882        auto newFont = OS.CreateFontIndirectW(&emr.elfw.elfLogFont); 
    28942883        OS.SelectObject(hdc, newFont); 
    2895         if (shapeSucceed = shape(hdc, run, chars, buffer,  maxGlyphs, sp)) { 
     2884        if ((shapeSucceed = shape(hdc, run, wchars, buffer,  maxGlyphs, sp)) is true ) { 
    28962885            run.fallbackFont = newFont; 
    28972886        } 
     
    28992888            if (!sp.fComplex) { 
    29002889                run.analysis.fNoGlyphIndex = true; 
    2901                 if (shapeSucceed = shape(hdc, run, chars, buffer,  maxGlyphs, sp)) { 
     2890                if ((shapeSucceed = shape(hdc, run, wchars, buffer,  maxGlyphs, sp)) is true ) { 
    29022891                    run.fallbackFont = newFont; 
    29032892                } else { 
     
    29182907                    /* ReleaseFont() */ 
    29192908                    OS.VtblCall(8, mLangFontLink2, cast(int)hNewFont); 
    2920                     auto mLangFont = OS.CreateFontIndirect(logFont); 
     2909                    auto mLangFont = OS.CreateFontIndirect(&logFont); 
    29212910                    auto oldFont = OS.SelectObject(hdc, mLangFont); 
    2922                     if (shapeSucceed = shape(hdc, run, chars, buffer,  maxGlyphs, sp)) { 
     2911                    if ((shapeSucceed = shape(hdc, run, wchars, buffer,  maxGlyphs, sp)) is true ) { 
    29232912                        run.fallbackFont = mLangFont; 
    29242913                    } else { 
  • dwt/internal/win32/OS.d

    r245 r249  
    811811    public static const int EDGE_ETCHED = (BDR_SUNKENOUTER | BDR_RAISEDINNER); 
    812812    public static const int EDGE_BUMP = (BDR_RAISEDOUTER | BDR_SUNKENINNER); 
     813    public static const int ELF_VENDOR_SIZE = 4; 
    813814    public static const int EM_CANUNDO = 0xc6; 
    814815    public static const int EM_CHARFROMPOS = 0xd7; 
     
    841842    public static const int EM_SETTABSTOPS = 0xcb; 
    842843    public static const int EM_UNDO = 199; 
     844    public static const int EMR_EXTCREATEFONTINDIRECTW = 82; 
     845    public static const int EMR_EXTTEXTOUTW = 84; 
    843846    public static const int EN_ALIGN_LTR_EC = 0x0700; 
    844847    public static const int EN_ALIGN_RTL_EC = 0x0701; 
     
    11081111    public static const int LB_SETSEL = 0x185; 
    11091112    public static const int LB_SETTOPINDEX = 0x197; 
     1113    public static const int LF_FULLFACESIZE = 64; 
    11101114    public static const int LF_FACESIZE = 32; 
    11111115    public static const int LGRPID_ARABIC = 0xd; 
     
    17001704    public static const int SS_REALSIZEIMAGE = 0x800; 
    17011705    public static const int SS_RIGHT = 0x2; 
     1706    public static const int SSA_FALLBACK = 0x00000020; 
     1707    public static const int SSA_GLYPHS = 0x00000080; 
     1708    public static const int SSA_METAFILE = 0x00000800; 
     1709    public static const int SSA_LINK = 0x00001000; 
    17021710    public static const int STANDARD_RIGHTS_READ = 0x20000; 
    17031711    public static const int STARTF_USESHOWWINDOW = 0x1; 
     
    23292337    alias WINAPI.CreateAcceleratorTableA CreateAcceleratorTable; 
    23302338    alias WINAPI.CreateDCA CreateDC; 
     2339    alias WINAPI.CreateEnhMetaFileA CreateEnhMetaFile; 
    23312340    alias WINAPI.CreateEventA CreateEvent; 
    23322341    alias WINAPI.CreateFileA CreateFile; 
     
    24342443    alias WINAPI.CreateAcceleratorTableW CreateAcceleratorTable; 
    24352444    alias WINAPI.CreateDCW CreateDC; 
     2445    alias WINAPI.CreateEnhMetaFileW CreateEnhMetaFile; 
    24362446    alias WINAPI.CreateEventW CreateEvent; 
    24372447    alias WINAPI.CreateFileW CreateFile; 
     
    28252835alias WINAPI.CloseHandle CloseHandle; 
    28262836alias WINAPI.CloseClipboard CloseClipboard; 
     2837alias WINAPI.CloseEnhMetaFile CloseEnhMetaFile; 
     2838alias WINAPI.CloseMetaFile CloseMetaFile; 
    28272839alias WINAPI.CombineRgn CombineRgn; 
    28282840alias WINAPI.CommDlgExtendedError CommDlgExtendedError; 
     
    28742886alias WINAPI.DeferWindowPos DeferWindowPos; 
    28752887alias WINAPI.DeleteDC DeleteDC; 
     2888alias WINAPI.DeleteEnhMetaFile DeleteEnhMetaFile; 
    28762889alias WINAPI.DeleteMenu DeleteMenu; 
    28772890alias WINAPI.DeleteObject DeleteObject; 
     
    29072920alias WINAPI.EndPath EndPath; 
    29082921alias WINAPI.EnumDisplayMonitors EnumDisplayMonitors; 
     2922alias WINAPI.EnumEnhMetaFile EnumEnhMetaFile; 
    29092923alias WINAPI.EnumFontFamiliesA EnumFontFamiliesA; 
    29102924alias WINAPI.EnumFontFamiliesExA EnumFontFamiliesExA; 
     
    32263240alias WINAPI.ScriptPlace ScriptPlace; 
    32273241alias WINAPI.ScriptRecordDigitSubstitution ScriptRecordDigitSubstitution; 
     3242alias WINAPI.ScriptGetCMap ScriptGetCMap; 
    32283243alias WINAPI.ScriptShape ScriptShape; 
     3244alias WINAPI.ScriptStringAnalyse ScriptStringAnalyse; 
     3245alias WINAPI.ScriptStringOut ScriptStringOut; 
     3246alias WINAPI.ScriptStringFree ScriptStringFree; 
    32293247alias WINAPI.ScriptTextOut ScriptTextOut; 
    32303248alias WINAPI.ScriptXtoCP ScriptXtoCP; 
  • dwt/internal/win32/WINAPI.d

    r214 r249  
    274274//     WINBOOL RemoveFontResourceA(LPCSTR); 
    275275//     HENHMETAFILE CopyEnhMetaFileA(HENHMETAFILE, LPCSTR); 
    276 //     HDC CreateEnhMetaFileA(HDC, LPCSTR, LPRECT, LPCSTR); 
     276    HDC CreateEnhMetaFileA(HDC, LPCSTR, LPRECT, LPCSTR); 
    277277//     HENHMETAFILE GetEnhMetaFileA(LPCSTR); 
    278278//     UINT GetEnhMetaFileDescriptionA(HENHMETAFILE, UINT, LPSTR); 
     
    665665//     WINBOOL RemoveFontResourceW(LPCWSTR); 
    666666//     HENHMETAFILE CopyEnhMetaFileW(HENHMETAFILE, LPCWSTR); 
    667 //     HDC CreateEnhMetaFileW(HDC, LPCWSTR, LPRECT, LPCWSTR); 
     667    HDC CreateEnhMetaFileW(HDC, LPCWSTR, LPRECT, LPCWSTR); 
    668668//     HENHMETAFILE GetEnhMetaFileW(LPCWSTR); 
    669669//     UINT GetEnhMetaFileDescriptionW(HENHMETAFILE, UINT, LPWSTR); 
     
    13701370//     WINBOOL CancelDC(HDC); 
    13711371//     WINBOOL Chord(HDC, int, int, int, int, int, int, int, int); 
    1372 //     HMETAFILE CloseMetaFile(HDC); 
     1372    HMETAFILE CloseMetaFile(HDC); 
    13731373//     int CombineRgn(HRGN, HRGN, HRGN, int); 
    13741374//     HBITMAP CreateBitmap(int, int, UINT, UINT, POINTER); 
     
    15071507//     WINBOOL PlayMetaFileRecord(HDC, LPHANDLETABLE, LPMETARECORD, UINT); 
    15081508//     WINBOOL EnumMetaFile(HDC, HMETAFILE, ENUMMETAFILEPROC, LPARAM); 
    1509 //     HENHMETAFILE CloseEnhMetaFile(HDC); 
    1510 //     WINBOOL DeleteEnhMetaFile(HENHMETAFILE); 
    1511 //     WINBOOL EnumEnhMetaFile(HDC, HENHMETAFILE, ENHMETAFILEPROC, LPVOID, RECT*); 
     1509    HENHMETAFILE CloseEnhMetaFile(HDC); 
     1510    WINBOOL DeleteEnhMetaFile(HENHMETAFILE); 
     1511    WINBOOL EnumEnhMetaFile(HDC, HENHMETAFILE, ENHMETAFILEPROC, LPVOID, RECT*); 
    15121512//     UINT GetEnhMetaFileHeader(HENHMETAFILE, UINT, LPENHMETAHEADER); 
    15131513//     UINT GetEnhMetaFilePaletteEntries(HENHMETAFILE, UINT, LPPALETTEENTRY); 
     
    34643464  int *piNumScripts 
    34653465); 
     3466HRESULT ScriptGetCMap( 
     3467  HDC hdc, 
     3468  SCRIPT_CACHE* psc, 
     3469  WCHAR* pwcInChars, 
     3470  int cChars, 
     3471  DWORD dwFlags, 
     3472  WORD* pwOutGlyphs 
     3473); 
     3474HRESULT ScriptStringAnalyse( 
     3475  HDC hdc, 
     3476  void* pString, 
     3477  int cString, 
     3478  int cGlyphs, 
     3479  int iCharset, 
     3480  DWORD dwFlags, 
     3481  int iReqWidth, 
     3482  SCRIPT_CONTROL* psControl, 
     3483  SCRIPT_STATE* psState, 
     3484  int* piDx, 
     3485  SCRIPT_TABDEF* pTabdef, 
     3486  BYTE* pbInClass, 
     3487  SCRIPT_STRING_ANALYSIS* pssa 
     3488); 
     3489HRESULT ScriptStringOut( 
     3490  SCRIPT_STRING_ANALYSIS ssa,  
     3491  int iX,  
     3492  int iY,  
     3493  UINT uOptions,  
     3494  RECT* prc,  
     3495  int iMinSel,  
     3496  int iMaxSel,  
     3497  BOOL fDisabled  
     3498); 
     3499HRESULT ScriptStringFree( 
     3500  SCRIPT_STRING_ANALYSIS* pssa   
     3501); 
     3502 
    34663503HRESULT ScriptItemize( 
    34673504  WCHAR *pwcInChars, 
  • dwt/internal/win32/WINTYPES.d

    r247 r249  
    1345513455extern(Windows){ 
    1345613456alias int (*ENUMMETAFILEPROC)(HDC, HANDLETABLE, METARECORD, int, LPARAM); 
    13457 alias int (*ENHMETAFILEPROC)(HDC, HANDLETABLE, ENHMETARECORD, int, LPARAM); 
     13457alias int (*ENHMETAFILEPROC)(HDC, HANDLETABLE*, ENHMETARECORD*, int, LPARAM); 
    1345813458alias int (*ENUMFONTSPROC)(LPLOGFONT, LPTEXTMETRIC, DWORD, LPARAM); 
    1345913459alias int (*FONTENUMPROC)(ENUMLOGFONT*, NEWTEXTMETRIC*, int, LPARAM); 
     
    1575415754 
    1575515755alias DWORD ASSOCF; 
     15756 
     15757// usp10 
     15758//import dwt.dwthelper.bitfield; 
     15759alias void* SCRIPT_STRING_ANALYSIS; 
     15760struct SCRIPT_TABDEF { 
     15761  int cTabStops; 
     15762  int iScale; 
     15763  int* pTabStops; 
     15764  int iTabOrigin; 
     15765} 
     15766 
     15767//struct SCRIPT_ANALYSIS { 
     15768//    mixin(bitfields!( 
     15769//        ushort, "eScript", 10, 
     15770//        bool, "fRTL", 1, 
     15771//        bool, "fLayoutRTL", 1, 
     15772//        bool, "fLinkBefore", 1, 
     15773//        bool, "fLinkAfter", 1, 
     15774//        bool, "fLogicalOrder", 1, 
     15775//        bool, "fNoGlyphIndex", 1)); 
     15776//    SCRIPT_STATE s ; 
     15777//} 
     15778//struct SCRIPT_STATE { 
     15779//    mixin(bitfields!( 
     15780//        ubyte, "uBidiLevel",  5, 
     15781//        bool, "fOverrideDirection", 1, 
     15782//        bool, "fInhibitSymSwap", 1, 
     15783//        bool, "fCharShape", 1, 
     15784//        bool, "fDigitSubstitute", 1, 
     15785//        bool, "fInhibitLigate", 1, 
     15786//        bool, "fDisplayZWG", 1, 
     15787//        bool, "fArabicNumContext", 1, 
     15788//        bool, "fGcpClusters", 1, 
     15789//        bool, "fReserved", 1, 
     15790//        ubyte, "fEngineReserved", 2)); 
     15791//} 
     15792// 
     15793//struct SCRIPT_CONTROL { 
     15794//    mixin(bitfields!( 
     15795//        ushort, "uDefaultLanguage", 16, 
     15796//        bool, "fContextDigits", 1, 
     15797//        bool, "fInvertPreBoundDir", 1, 
     15798//        bool, "fInvertPostBoundDir", 1, 
     15799//        bool, "fLinkStringBefore", 1, 
     15800//        bool, "fLinkStringAfter", 1, 
     15801//        bool, "fNeutralOverride", 1, 
     15802//        bool, "fNumericOverride", 1, 
     15803//        bool, "fLegacyBidiClass", 1, 
     15804//        ubyte, "fReserved", 8)); 
     15805//} 
     15806// 
  • dwt/widgets/Button.d

    r246 r249  
    805805    * fails for browser controls when the browser has focus. 
    806806    */ 
    807     int /*long*/ hDC = gc.handle; 
     807    auto hDC = gc.handle; 
    808808    if (!OS.PrintWindow (hwnd, hDC, 0)) { 
    809809        int flags = OS.PRF_CLIENT | OS.PRF_NONCLIENT | OS.PRF_ERASEBKGND | OS.PRF_CHILDREN; 
  • dwt/widgets/DateTime.d

    r246 r249  
    6868    SYSTEMTIME time; // only used in calendar mode 
    6969    static /+const+/ WNDPROC DateTimeProc; 
    70     static const TCHAR* DateTimeClass = OS.DATETIMEPICK_CLASS.ptr
     70    static const TCHAR[] DateTimeClass = OS.DATETIMEPICK_CLASS
    7171    static /+const+/ WNDPROC CalendarProc; 
    72     static const TCHAR* CalendarClass = OS.MONTHCAL_CLASS.ptr
     72    static const TCHAR[] CalendarClass = OS.MONTHCAL_CLASS
    7373 
    7474    private static bool static_this_completed = false; 
     
    8585            icex.dwICC = OS.ICC_DATE_CLASSES; 
    8686            OS.InitCommonControlsEx (&icex); 
    87     } 
    88     static { //TODO review 
    8987            WNDCLASS lpWndClass; 
    90             OS.GetClassInfo (null, DateTimeClass, &lpWndClass); 
     88            OS.GetClassInfo (null, DateTimeClass.ptr, &lpWndClass); 
    9189            DateTimeProc = lpWndClass.lpfnWndProc; 
    92         /* 
    93         * Feature in Windows.  The date time window class 
    94         * does not include CS_DBLCLKS.  This means that these 
    95         * controls will not get double click messages such as 
    96         * WM_LBUTTONDBLCLK.  The fix is to register a new  
    97         * window class with CS_DBLCLKS. 
    98         *  
    99         * NOTE:  Screen readers look for the exact class name 
    100         * of the control in order to provide the correct kind 
    101         * of assistance.  Therefore, it is critical that the 
    102         * new window class have the same name.  It is possible 
    103         * to register a local window class with the same name 
    104         * as a global class.  Since bits that affect the class 
    105         * are being changed, it is possible that other native 
    106         * code, other than DWT, could create a control with 
    107         * this class name, and fail unexpectedly. 
    108         */ 
    109         int /*long*/ hInstance = OS.GetModuleHandle (null); 
    110         int /*long*/ hHeap = OS.GetProcessHeap (); 
    111         lpWndClass.hInstance = hInstance; 
    112         lpWndClass.style &= ~OS.CS_GLOBALCLASS; 
    113         lpWndClass.style |= OS.CS_DBLCLKS; 
    114         int byteCount = DateTimeClass.length () * TCHAR.sizeof; 
    115         int /*long*/ lpszClassName = OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, byteCount); 
    116         OS.MoveMemory (lpszClassName, DateTimeClass, byteCount); 
    117         lpWndClass.lpszClassName = lpszClassName; 
    118         OS.RegisterClass (lpWndClass); 
    119         OS.HeapFree (hHeap, 0, lpszClassName); 
    120             OS.GetClassInfo (null, CalendarClass, &lpWndClass); 
     90            /* 
     91            * Feature in Windows.  The date time window class 
     92            * does not include CS_DBLCLKS.  This means that these 
     93            * controls will not get double click messages such as 
     94            * WM_LBUTTONDBLCLK.  The fix is to register a new  
     95            * window class with CS_DBLCLKS. 
     96            *  
     97            * NOTE:  Screen readers look for the exact class name 
     98            * of the control in order to provide the correct kind 
     99            * of assistance.  Therefore, it is critical that the 
     100            * new window class have the same name.  It is possible 
     101            * to register a local window class with the same name 
     102            * as a global class.  Since bits that affect the class 
     103            * are being changed, it is possible that other native 
     104            * code, other than DWT, could create a control with 
     105            * this class name, and fail unexpectedly. 
     106            */ 
     107            auto hInstance = OS.GetModuleHandle (null); 
     108            auto hHeap = OS.GetProcessHeap (); 
     109            lpWndClass.hInstance = hInstance; 
     110            lpWndClass.style &= ~OS.CS_GLOBALCLASS; 
     111            lpWndClass.style |= OS.CS_DBLCLKS; 
     112            int byteCount = DateTimeClass.length * TCHAR.sizeof; 
     113            auto lpszClassName = cast(TCHAR*) OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, byteCount); 
     114            OS.MoveMemory (lpszClassName, DateTimeClass.ptr, byteCount); 
     115            lpWndClass.lpszClassName = lpszClassName; 
     116            OS.RegisterClass (&lpWndClass); 
     117            OS.HeapFree (hHeap, 0, lpszClassName); 
     118            OS.GetClassInfo (null, CalendarClass.ptr, &lpWndClass); 
    121119            CalendarProc = lpWndClass.lpfnWndProc; 
    122         /* 
    123         * Feature in Windows.  The date time window class 
    124         * does not include CS_DBLCLKS.  This means that these 
    125         * controls will not get double click messages such as 
    126         * WM_LBUTTONDBLCLK.  The fix is to register a new  
    127         * window class with CS_DBLCLKS. 
    128         *  
    129         * NOTE:  Screen readers look for the exact class name 
    130         * of the control in order to provide the correct kind 
    131         * of assistance.  Therefore, it is critical that the 
    132         * new window class have the same name.  It is possible 
    133         * to register a local window class with the same name 
    134         * as a global class.  Since bits that affect the class 
    135         * are being changed, it is possible that other native 
    136         * code, other than DWT, could create a control with 
    137         * this class name, and fail unexpectedly. 
    138         */ 
    139         int /*long*/ hInstance = OS.GetModuleHandle (null); 
    140         int /*long*/ hHeap = OS.GetProcessHeap (); 
    141         lpWndClass.hInstance = hInstance; 
    142         lpWndClass.style &= ~OS.CS_GLOBALCLASS; 
    143         lpWndClass.style |= OS.CS_DBLCLKS; 
    144         int byteCount = CalendarClass.length () * TCHAR.sizeof; 
    145         int /*long*/ lpszClassName = OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, byteCount); 
    146         OS.MoveMemory (lpszClassName, CalendarClass, byteCount); 
    147         lpWndClass.lpszClassName = lpszClassName; 
    148         OS.RegisterClass (lpWndClass); 
    149         OS.HeapFree (hHeap, 0, lpszClassName); 
     120            /* 
     121            * Feature in Windows.  The date time window class 
     122            * does not include CS_DBLCLKS.  This means that these 
     123            * controls will not get double click messages such as 
     124            * WM_LBUTTONDBLCLK.  The fix is to register a new  
     125            * window class with CS_DBLCLKS. 
     126            *  
     127            * NOTE:  Screen readers look for the exact class name 
     128            * of the control in order to provide the correct kind 
     129            * of assistance.  Therefore, it is critical that the 
     130            * new window class have the same name.  It is possible 
     131            * to register a local window class with the same name 
     132            * as a global class.  Since bits that affect the class 
     133            * are being changed, it is possible that other native 
     134            * code, other than DWT, could create a control with 
     135            * this class name, and fail unexpectedly. 
     136            */ 
     137            hInstance = OS.GetModuleHandle (null); 
     138            hHeap = OS.GetProcessHeap (); 
     139            lpWndClass.hInstance = hInstance; 
     140            lpWndClass.style &= ~OS.CS_GLOBALCLASS; 
     141            lpWndClass.style |= OS.CS_DBLCLKS; 
     142            byteCount = CalendarClass.length * TCHAR.sizeof; 
     143            lpszClassName = cast(TCHAR*)OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, byteCount); 
     144            OS.MoveMemory (lpszClassName, CalendarClass.ptr, byteCount); 
     145            lpWndClass.lpszClassName = lpszClassName; 
     146            OS.RegisterClass (&lpWndClass); 
     147            OS.HeapFree (hHeap, 0, lpszClassName); 
    150148            static_this_completed = true; 
    151149        } 
     
    942940 
    943941override String windowClass () { 
    944     return (style & DWT.CALENDAR) !is 0 ? TCHARzToStr(CalendarClass) : TCHARzToStr(DateTimeClass); 
     942    return (style & DWT.CALENDAR) !is 0 ? TCHARsToStr(CalendarClass) : TCHARsToStr(DateTimeClass); 
    945943} 
    946944 
  • dwt/widgets/Display.d

    r246 r249  
    20772077                    *keyMsg = *msg; 
    20782078                    OS.PostMessage (hwndMessage, SWT_KEYMSG, wParam, cast(int)keyMsg); 
    2079                     switch ((int)/*64*/msg.wParam) { 
     2079                    switch (msg.wParam) { 
    20802080                        case OS.VK_SHIFT: 
    20812081                        case OS.VK_MENU: 
     
    30533053                } 
    30543054            } 
    3055             switch ((int)/*64*/keyMsg.wParam) { 
     3055            switch (keyMsg.wParam) { 
    30563056                case OS.VK_SHIFT: 
    30573057                case OS.VK_MENU: 
     
    30613061                case OS.VK_SCROLL: 
    30623062                    consumed = true; 
     3063                default: 
    30633064            } 
    30643065            if (consumed) { 
  • dwt/widgets/Group.d

    r246 r249  
    2222import dwt.internal.win32.OS; 
    2323import dwt.widgets.Composite; 
     24import dwt.widgets.Control; 
    2425 
    2526import dwt.dwthelper.utils; 
     
    321322} 
    322323 
    323 void printWidget (int /*long*/ hwnd, GC gc) { 
     324void printWidget (HWND hwnd, GC gc) { 
    324325    /* 
    325326    * Bug in Windows.  For some reason, PrintWindow() fails 
     
    329330    * fails for browser controls when the browser has focus. 
    330331    */ 
    331     int /*long*/ hDC = gc.handle; 
     332    auto hDC = gc.handle; 
    332333    if (!OS.PrintWindow (hwnd, hDC, 0)) { 
    333334        /* 
  • dwt/widgets/Table.d

    r246 r249  
    2424import dwt.graphics.Rectangle; 
    2525import dwt.internal.ImageList; 
    26 import dwt.internal.win32.BITMAPINFOHEADER; 
    2726import dwt.internal.win32.OS; 
    2827 
     
    54435442        */ 
    54445443        if ((!OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION (6, 0)) || hooks (DWT.EraseItem) || hooks (DWT.PaintItem)) { 
    5445             int topIndex = (int)/*64*/OS.SendMessage (handle, OS.LVM_GETTOPINDEX, 0, 0); 
    5446             int selection = (int)/*64*/OS.SendMessage (handle, OS.LVM_GETNEXTITEM, topIndex - 1, OS.LVNI_SELECTED); 
     5444            int topIndex = OS.SendMessage (handle, OS.LVM_GETTOPINDEX, 0, 0); 
     5445            int selection = OS.SendMessage (handle, OS.LVM_GETNEXTITEM, topIndex - 1, OS.LVNI_SELECTED); 
    54475446            if (selection is -1) return 0; 
    5448             POINT mousePos = new POINT ()
     5447            POINT mousePos
    54495448            OS.POINTSTOPOINT (mousePos, OS.GetMessagePos ()); 
    5450             OS.MapWindowPoints(0, handle, mousePos, 1); 
    5451             RECT clientRect = new RECT ()
    5452             OS.GetClientRect (handle, clientRect); 
     5449            OS.MapWindowPoints(null, handle, &mousePos, 1); 
     5450            RECT clientRect
     5451            OS.GetClientRect (handle, &clientRect); 
    54535452            TableItem item = _getItem (selection); 
    54545453            RECT rect = item.getBounds (selection, 0, true, true, true); 
     
    54635462                } 
    54645463            } 
    5465             int /*long*/ hRgn = OS.CreateRectRgn (rect.left, rect.top, rect.right, rect.bottom); 
    5466             while ((selection = (int)/*64*/OS.SendMessage (handle, OS.LVM_GETNEXTITEM, selection, OS.LVNI_SELECTED)) !is -1) { 
     5464            auto hRgn = OS.CreateRectRgn (rect.left, rect.top, rect.right, rect.bottom); 
     5465            while ((selection = OS.SendMessage (handle, OS.LVM_GETNEXTITEM, selection, OS.LVNI_SELECTED)) !is -1) { 
    54675466                if (rect.bottom - rect.top > DRAG_IMAGE_SIZE) break; 
    54685467                if (rect.bottom > clientRect.bottom) break; 
    54695468                RECT itemRect = item.getBounds (selection, 0, true, true, true); 
    5470                 int /*long*/ rectRgn = OS.CreateRectRgn (rect.left, itemRect.top, rect.right, itemRect.bottom); 
     5469                auto rectRgn = OS.CreateRectRgn (rect.left, itemRect.top, rect.right, itemRect.bottom); 
    54715470                OS.CombineRgn (hRgn, hRgn, rectRgn, OS.RGN_OR); 
    54725471                OS.DeleteObject (rectRgn); 
    54735472                rect.bottom = itemRect.bottom; 
    54745473            } 
    5475             OS.GetRgnBox (hRgn, rect); 
     5474            OS.GetRgnBox (hRgn, &rect); 
    54765475             
    54775476            /* Create resources */ 
    5478             int /*long*/ hdc = OS.GetDC (handle); 
    5479             int /*long*/ memHdc = OS.CreateCompatibleDC (hdc); 
    5480             BITMAPINFOHEADER bmiHeader = new BITMAPINFOHEADER ()
     5477            auto hdc = OS.GetDC (handle); 
     5478            auto memHdc = OS.CreateCompatibleDC (hdc); 
     5479            BITMAPINFOHEADER bmiHeader
    54815480            bmiHeader.biSize = BITMAPINFOHEADER.sizeof; 
    54825481            bmiHeader.biWidth = rect.right - rect.left; 
     
    54865485            bmiHeader.biCompression = OS.BI_RGB; 
    54875486            byte [] bmi = new byte [BITMAPINFOHEADER.sizeof]; 
    5488             OS.MoveMemory (bmi, bmiHeader, BITMAPINFOHEADER.sizeof); 
    5489             int /*long*/ [] pBits = new int /*long*/ [1]
    5490             int /*long*/ memDib = OS.CreateDIBSection (0, bmi, OS.DIB_RGB_COLORS, pBits, 0, 0); 
    5491             if (memDib is 0) DWT.error (DWT.ERROR_NO_HANDLES); 
    5492             int /*long*/ oldMemBitmap = OS.SelectObject (memHdc, memDib); 
     5487            OS.MoveMemory (bmi.ptr, &bmiHeader, BITMAPINFOHEADER.sizeof); 
     5488            void*[1] pBits
     5489            auto memDib = OS.CreateDIBSection (null, cast(BITMAPINFO*) bmi.ptr, OS.DIB_RGB_COLORS, pBits.ptr, null, 0); 
     5490            if (memDib is null) DWT.error (DWT.ERROR_NO_HANDLES); 
     5491            auto oldMemBitmap = OS.SelectObject (memHdc, memDib); 
    54935492            int colorKey = 0x0000FD; 
    5494             POINT pt = new POINT()
    5495             OS.SetWindowOrgEx (memHdc, rect.left, rect.top, pt); 
    5496             OS.FillRect (memHdc, rect, findBrush (colorKey, OS.BS_SOLID)); 
     5493            POINT pt
     5494            OS.SetWindowOrgEx (memHdc, rect.left, rect.top, &pt); 
     5495            OS.FillRect (memHdc, &rect, findBrush (colorKey, OS.BS_SOLID)); 
    54975496            OS.OffsetRgn (hRgn, -rect.left, -rect.top); 
    54985497            OS.SelectClipRgn (memHdc, hRgn); 
     
    55015500            OS.SelectObject (memHdc, oldMemBitmap); 
    55025501            OS.DeleteDC (memHdc); 
    5503             OS.ReleaseDC (0, hdc); 
     5502            OS.ReleaseDC (null, hdc); 
    55045503            OS.DeleteObject (hRgn); 
    55055504             
    5506             SHDRAGIMAGE shdi = new SHDRAGIMAGE ()
     5505            SHDRAGIMAGE shdi
    55075506            shdi.hbmpDragImage = memDib; 
    55085507            shdi.crColorKey = colorKey; 
     
    55145513                shdi.ptOffset.x = shdi.sizeDragImage.cx - shdi.ptOffset.x;  
    55155514            } 
    5516             OS.MoveMemory (lParam, shdi, SHDRAGIMAGE.sizeof); 
     5515            OS.MoveMemory (cast(void*)lParam, &shdi, SHDRAGIMAGE.sizeof); 
    55175516            return 1; 
    55185517        } 
  • dwt/widgets/Tree.d

    r246 r249  
    2626import dwt.graphics.Rectangle; 
    2727import dwt.internal.ImageList; 
    28 import dwt.internal.win32.BITMAPINFOHEADER; 
    2928import dwt.internal.win32.OS; 
    3029 
     
    57665765        */ 
    57675766        if ((style & DWT.MULTI) !is 0 || hooks (DWT.EraseItem) || hooks (DWT.PaintItem)) { 
    5768             int /*long*/ hItem = OS.SendMessage (handle, OS.TVM_GETNEXTITEM, OS.TVGN_FIRSTVISIBLE, 0); 
     5767            auto hItem = cast(HANDLE) OS.SendMessage (handle, OS.TVM_GETNEXTITEM, OS.TVGN_FIRSTVISIBLE, 0); 
    57695768            TreeItem [] items = new TreeItem [10]; 
    5770             TVITEM tvItem = new TVITEM ()
     5769            TVITEM tvItem
    57715770            tvItem.mask = OS.TVIF_HANDLE | OS.TVIF_PARAM | OS.TVIF_STATE; 
    5772             int count = getSelection (hItem, tvItem, items, 0, 10, false, true); 
     5771            int count = getSelection (hItem, &tvItem, items, 0, 10, false, true); 
    57735772            if (count is 0) return 0; 
    5774             POINT mousePos = new POINT ()
     5773            POINT mousePos
    57755774            OS.POINTSTOPOINT (mousePos, OS.GetMessagePos ()); 
    5776             OS.MapWindowPoints (0, handle, mousePos, 1); 
    5777             RECT clientRect = new RECT ()
    5778             OS.GetClientRect(handle, clientRect); 
    5779             RECT rect = items [0].getBounds (0, true, true, false); 
     5775            OS.MapWindowPoints (null, handle, &mousePos, 1); 
     5776            RECT clientRect
     5777            OS.GetClientRect(handle, &clientRect); 
     5778            RECT rect = *(items [0].getBounds (0, true, true, false)); 
    57805779            if ((style & DWT.FULL_SELECTION) !is 0) { 
    57815780                int width = DRAG_IMAGE_SIZE; 
     
    57885787                } 
    57895788            } 
    5790             int /*long*/ hRgn = OS.CreateRectRgn (rect.left, rect.top, rect.right, rect.bottom); 
     5789            auto hRgn = OS.CreateRectRgn (rect.left, rect.top, rect.right, rect.bottom); 
    57915790            for (int i = 1; i < count; i++) { 
    57925791                if (rect.bottom - rect.top > DRAG_IMAGE_SIZE) break; 
    57935792                if (rect.bottom > clientRect.bottom) break; 
    5794                 RECT itemRect = items[i].getBounds (0, true, true, false); 
     5793                RECT itemRect = *(items[i].getBounds (0, true, true, false)); 
    57955794                if ((style & DWT.FULL_SELECTION) !is 0) { 
    57965795                    itemRect.left = rect.left; 
    57975796                    itemRect.right = rect.right; 
    57985797                } 
    5799                 int /*long*/ rectRgn = OS.CreateRectRgn (itemRect.left, itemRect.top, itemRect.right, itemRect.bottom); 
     5798                auto rectRgn = OS.CreateRectRgn (itemRect.left, itemRect.top, itemRect.right, itemRect.bottom); 
    58005799                OS.CombineRgn (hRgn, hRgn, rectRgn, OS.RGN_OR); 
    58015800                OS.DeleteObject (rectRgn); 
     
    58035802                 
    58045803            } 
    5805             OS.GetRgnBox (hRgn, rect); 
     5804            OS.GetRgnBox (hRgn, &rect); 
    58065805             
    58075806            /* Create resources */ 
    5808             int /*long*/ hdc = OS.GetDC (handle); 
    5809             int /*long*/ memHdc = OS.CreateCompatibleDC (hdc); 
    5810             BITMAPINFOHEADER bmiHeader = new BITMAPINFOHEADER ()
     5807            auto hdc = OS.GetDC (handle); 
     5808            auto memHdc = OS.CreateCompatibleDC (hdc); 
     5809            BITMAPINFOHEADER bmiHeader
    58115810            bmiHeader.biSize = BITMAPINFOHEADER.sizeof; 
    58125811            bmiHeader.biWidth = rect.right - rect.left; 
     
    58165815            bmiHeader.biCompression = OS.BI_RGB; 
    58175816            byte [] bmi = new byte [BITMAPINFOHEADER.sizeof]; 
    5818             OS.MoveMemory (bmi, bmiHeader, BITMAPINFOHEADER.sizeof); 
    5819             int /*long*/ [] pBits = new int /*long*/ [1]
    5820             int /*long*/ memDib = OS.CreateDIBSection (0, bmi, OS.DIB_RGB_COLORS, pBits, 0, 0); 
    5821             if (memDib is 0) DWT.error (DWT.ERROR_NO_HANDLES); 
    5822             int /*long*/ oldMemBitmap = OS.SelectObject (memHdc, memDib); 
     5817            OS.MoveMemory (bmi.ptr, &bmiHeader, BITMAPINFOHEADER.sizeof); 
     5818            void* [1] pBits
     5819            auto memDib = OS.CreateDIBSection (null, cast(BITMAPINFO*) bmi.ptr, OS.DIB_RGB_COLORS, pBits.ptr, null, 0); 
     5820            if (memDib is null) DWT.error (DWT.ERROR_NO_HANDLES); 
     5821            auto oldMemBitmap = OS.SelectObject (memHdc, memDib); 
    58235822            int colorKey = 0x0000FD; 
    5824             POINT pt = new POINT ()
    5825             OS.SetWindowOrgEx (memHdc, rect.left, rect.top, pt); 
    5826             OS.FillRect (memHdc, rect, findBrush (colorKey, OS.BS_SOLID)); 
     5823            POINT pt
     5824            OS.SetWindowOrgEx (memHdc, rect.left, rect.top, &pt); 
     5825            OS.FillRect (memHdc, &rect, findBrush (colorKey, OS.BS_SOLID)); 
    58275826            OS.OffsetRgn (hRgn, -rect.left, -rect.top); 
    58285827            OS.SelectClipRgn (memHdc, hRgn); 
     
    58315830            OS.SelectObject (memHdc, oldMemBitmap); 
    58325831            OS.DeleteDC (memHdc); 
    5833             OS.ReleaseDC (0, hdc); 
     5832            OS.ReleaseDC (null, hdc); 
    58345833            OS.DeleteObject (hRgn); 
    58355834 
    5836             SHDRAGIMAGE shdi = new SHDRAGIMAGE ()
     5835            SHDRAGIMAGE shdi
    58375836            shdi.hbmpDragImage = memDib; 
    58385837            shdi.crColorKey = colorKey; 
     
    58445843                shdi.ptOffset.x = shdi.sizeDragImage.cx - shdi.ptOffset.x;  
    58455844            } 
    5846             OS.MoveMemory (lParam, shdi, SHDRAGIMAGE.sizeof); 
     5845            OS.MoveMemory (cast(void*)lParam, &shdi, SHDRAGIMAGE.sizeof); 
    58475846            return 1; 
    58485847        } 
     
    65076506    ignoreDeselect = ignoreSelect = true; 
    65086507    int /*long*/ code = callWindowProc (handle, OS.WM_LBUTTONDOWN, wParam, lParam); 
    6509     if (!OS.IsWinCE && OS.WIN32_VERSION >= OS.buildVERSION (6, 0)) { 
     6508    if (!OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION (6, 0)) { 
    65106509        if (OS.GetFocus () !is handle) OS.SetFocus (handle); 
    65116510    }