Changeset 26

Show
Ignore:
Timestamp:
06/28/04 00:11:30 (4 years ago)
Author:
brad
Message:

Playing around with Version statements.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/0.1/src/dwt/internal/win32/os.d

    r25 r26  
    2929    import dwt.internal.win32.types; 
    3030} 
     31 
     32//version = Unicode; 
    3133 
    3234public class OS { 
     
    4345    static int IsSP; 
    4446    static int IsDBLocale; 
     47     
    4548    const int IsUnicode = 1; 
     49     
    4650    static int WIN32_MAJOR, WIN32_MINOR; 
    4751 
     
    13921396static int CreateFontIndirect (int lplf) { 
    13931397    if (IsUnicode) 
    1394             return CreateFontIndirectW (cast(LOGFONTW*)lplf); 
     1398           return CreateFontIndirectW (lplf); 
    13951399        else 
    1396         return CreateFontIndirectA (cast(LOGFONTA*)lplf); 
     1400           return CreateFontIndirectA (lplf); 
    13971401} 
    13981402 
    13991403static static int CreateFontIndirect (LOGFONT* lplf) { 
    14001404    if (IsUnicode) 
    1401             return CreateFontIndirectW (cast(LOGFONTW*)lplf); 
     1405           return CreateFontIndirectW (lplf); 
    14021406        else 
    1403         return CreateFontIndirectA (cast(LOGFONTA*)lplf); 
     1407           return CreateFontIndirectA (lplf); 
    14041408} 
    14051409 
  • branches/0.1/src/dwt/internal/win32/types.d

    r25 r26  
    2020 
    2121module dwt.internal.win32.types; 
     22 
     23version = Unicode; 
    2224 
    2325/* 
     
    177179 
    178180struct MONITORINFO { 
    179     int     cbSize; 
    180     RECT    rcMonitor; 
    181     RECT    rcWork; 
    182     int     dwFlags; 
     181    int cbSize; 
     182//  RECT rcMonitor; 
     183    int rcMonitor_left; 
     184    int rcMonitor_top; 
     185    int rcMonitor_right; 
     186    int rcMonitor_bottom; 
     187//  RECT rcWork; 
     188    int rcWork_left; 
     189    int rcWork_top; 
     190    int rcWork_right; 
     191    int rcWork_bottom; 
     192    int dwFlags; 
    183193} 
    184194 
     
    381391} 
    382392 
    383 struct NONCLIENTMETRICS { 
    384     int cbSize;  
    385     int iBorderWidth;  
    386     int iScrollWidth;  
    387     int iScrollHeight;  
    388     int iCaptionWidth;  
    389     int iCaptionHeight;  
    390     int iSmCaptionWidth;  
    391     int iSmCaptionHeight; 
    392     int iMenuWidth;  
    393     int iMenuHeight; 
    394 } 
    395  
    396393struct ACCEL { 
    397394    byte fVirt; 
     
    485482} 
    486483 
    487 struct LOGFONT { 
    488     int lfHeight; 
    489     int lfWidth; 
    490     int lfEscapement; 
    491     int lfOrientation; 
    492     int lfWeight; 
    493     byte lfItalic; 
    494     byte lfUnderline; 
    495     byte lfStrikeOut; 
    496     byte lfCharSet; 
    497     byte lfOutPrecision; 
    498     byte lfClipPrecision; 
    499     byte lfQuality; 
    500     byte lfPitchAndFamily; 
    501     // use LOGFONT.size instead of sizeof 
    502     bool isValid; 
     484version(Unicode) { 
     485    alias LOGFONTW LOGFONT; 
     486} else { 
     487    alias LOGFONTA LOGFONT; 
    503488} 
    504489 
     
    519504    //char[OS.LF_FACESIZE] lfFaceName; 
    520505    char[32] lfFaceName; 
     506    bool isValid; 
    521507} 
    522508 
     
    537523    //wchar[OS.LF_FACESIZE] lfFaceName; 
    538524    wchar[32] lfFaceName; 
     525    bool isValid; 
    539526} 
    540527 
     
    604591 
    605592    wchar[80] szText; 
     593} 
     594 
     595/+  With doing the version and alias for LOGFONT, the same thing is not necessary with this struct, as it can now 
     596    just use LOGFONT.  See below the aliases and the A and W (after the end of this comment). 
     597version(Unicode) { 
     598    alias NONCLIENTMETRICSW NONCLIENTMETRICS; 
     599} else { 
     600    alias NONCLIENTMETRICSW NONCLIENTMETRICS; 
     601} 
     602 
     603struct NONCLIENTMETRICSA { 
     604    int cbSize;  
     605    int iBorderWidth;  
     606    int iScrollWidth;  
     607    int iScrollHeight;  
     608    int iCaptionWidth;  
     609    int iCaptionHeight;  
     610    int iSmCaptionWidth;  
     611    int iSmCaptionHeight; 
     612    int iMenuWidth;  
     613    int iMenuHeight; 
     614    LOGFONTA lfCaptionFont; 
     615    LOGFONTA lfSmCaptionFont;  
     616    LOGFONTA lfMenuFont; 
     617    LOGFONTA lfStatusFont; 
     618    LOGFONTA lfMessageFont; 
     619} 
     620 
     621struct NONCLIENTMETRICSW { 
     622    int cbSize;  
     623    int iBorderWidth;  
     624    int iScrollWidth;  
     625    int iScrollHeight;  
     626    int iCaptionWidth;  
     627    int iCaptionHeight;  
     628    int iSmCaptionWidth;  
     629    int iSmCaptionHeight; 
     630    int iMenuWidth;  
     631    int iMenuHeight; 
     632    LOGFONTW lfCaptionFont; 
     633    LOGFONTW lfSmCaptionFont;  
     634    LOGFONTW lfMenuFont; 
     635    LOGFONTW lfStatusFont; 
     636    LOGFONTW lfMessageFont; 
     637} 
     638+/ 
     639 
     640struct NONCLIENTMETRICS { 
     641    int cbSize;  
     642    int iBorderWidth;  
     643    int iScrollWidth;  
     644    int iScrollHeight;  
     645    int iCaptionWidth;  
     646    int iCaptionHeight;  
     647    int iSmCaptionWidth;  
     648    int iSmCaptionHeight; 
     649    int iMenuWidth;  
     650    int iMenuHeight; 
     651    LOGFONT lfCaptionFont; 
     652    LOGFONT lfSmCaptionFont;  
     653    LOGFONT lfMenuFont; 
     654    LOGFONT lfStatusFont; 
     655    LOGFONT lfMessageFont; 
    606656} 
    607657