Changeset 79

Show
Ignore:
Timestamp:
12/24/05 08:40:08 (3 years ago)
Author:
Shawn Liu
Message:

--

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/current/win32/del-intermediate.bat

    r75 r79  
    1 cd import 
     1@rem don't delete the library files in directory 'lib' 
     2cd import\dwt 
    23del *.obj *.map *.rsp *.ksp *.lib *.exe *.def /s /q 
    3 cd .. 
    4 cd packages 
     4cd ..\..\packages\dwt 
    55del *.obj *.map *.rsp *.ksp *.lib *.exe *.def /s /q 
    6 cd .. 
     6cd ..\..\lib 
     7@echo remove the dwt.lib and dwtextra.lib 
     8del dwt.lib dwtd.lib dwtextra.lib dwtextrad.lib 
    79pause 
  • trunk/current/win32/import/.poseidon

    r76 r79  
    44    <comment /> 
    55    <filter>*.d</filter> 
     6    <showemptyfolder>0</showemptyfolder> 
    67    <buildSpec> 
    7         <buildOption>-gui -clean -full -w -unittest -debug -g -version=OLE_COM</buildOption> 
     8        <buildOption>-gui -clean -full -w -unittest -debug -g -version=OLE_COM </buildOption> 
    89        <mainFile>dwt\all.d</mainFile> 
    910    </buildSpec> 
  • trunk/current/win32/import/dwt/extra/make-dwtextra-lib.bat

    r76 r79  
    44 
    55@echo Build release version ... 
    6 build -release -O -clean -inline -w -lib -full -allobj all.d -T\dmd\lib\dwtextra.lib -Xdwt -version=OLE_COM 
     6build -release -O -clean -inline -w -lib -full -allobj all.d -T..\..\..\lib\dwtextra.lib -Xdwt -version=OLE_COM -I..\..\ 
    77 
    88@echo -----------------------------------------       
    99@echo Build debug version ... 
    10 build -debug -g -clean -w -lib -full -allobj all.d -T\dmd\lib\dwtextrad.lib -Xdwt -version=OLE_COM 
     10build -debug -g -clean -w -lib -full -allobj all.d -T..\..\..\lib\dwtextrad.lib -Xdwt -version=OLE_COM -I..\..\ 
    1111 
    1212@echo ----------------------------------------- 
  • trunk/current/win32/import/dwt/extra/scintilla.d

    r76 r79  
    145145 * @author Shawn Liu <shawn666.liu at gmail dot com> 
    146146 */ 
    147 class Scintilla : Scrollable
     147class Scintilla : Control
    148148 
    149149// the C struct, internal use only 
     
    18801880    int directPointer; 
    18811881    boolean _enableDirectFunc = true; 
     1882     
     1883    // used to process DBCS such as Chinese/Japanese/Korea character 
     1884    private boolean ignoreCharacter; 
    18821885 
    18831886/** 
     
    19361939        }); 
    19371940         
    1938         // when the shell disposed, check the instance count  
    1939         getShell().handleDispose(null, delegate(DisposeEvent e) { 
     1941        // when the display disposed, check the instance count  
     1942        getDisplay().handleEvent(null, DWT.Dispose, delegate(Event e) { 
    19401943            // No scintilla instance exists now, safe to free dll 
    1941             if(Scintilla.instCount == 0){ 
     1944            if(Scintilla.instCount == 0 && Scintilla._handleOfDLL !is null){ 
    19421945                OS.FreeLibrary(Scintilla._handleOfDLL); 
    19431946                Scintilla._handleOfDLL = null; 
     
    20962099} 
    20972100 
     2101//LDWTRESULT WM_CHAR_ (int wParam, int lParam) { 
     2102//  if (ignoreCharacter) return null; 
     2103//  LDWTRESULT result = super.WM_CHAR_ (wParam, lParam); 
     2104//  if (result !is null) return result; 
     2105//   
     2106//  return result; 
     2107//} 
     2108 
     2109//LDWTRESULT WM_IME_CHAR_ (int wParam, int lParam) { 
     2110// 
     2111//  /* Process a DBCS character */ 
     2112//  Display display = this.display; 
     2113//  display.lastKey = 0; 
     2114//  display.lastAscii = wParam; 
     2115//  display.lastVirtual = display.lastNull = display.lastDead = false; 
     2116//  if (!super.sendKeyEvent (DWT.KeyDown, OS.WM_IME_CHAR, wParam, lParam)) { 
     2117//      return LDWTRESULT.ZERO; 
     2118//  } 
     2119// 
     2120//  /* 
     2121//  * Feature in Windows.  The Windows text widget uses 
     2122//  * two 2 WM_CHAR's to process a DBCS key instead of 
     2123//  * using WM_IME_CHAR.  The fix is to allow the text 
     2124//  * widget to get the WM_CHAR's but ignore sending 
     2125//  * them to the application. 
     2126//  */ 
     2127//  ignoreCharacter = true; 
     2128//  int result = callWindowProc (OS.WM_IME_CHAR, wParam, lParam); 
     2129//  MSG* msg = new MSG (); 
     2130//  int flags = OS.PM_REMOVE | OS.PM_NOYIELD | OS.PM_QS_INPUT | OS.PM_QS_POSTMESSAGE; 
     2131//  while (OS.PeekMessage (msg, handle, OS.WM_CHAR, OS.WM_CHAR, flags)) { 
     2132//      OS.TranslateMessage (msg); 
     2133//      OS.DispatchMessage (msg); 
     2134//  } 
     2135//  ignoreCharacter = false; 
     2136//   
     2137//  super.sendKeyEvent (DWT.KeyUp, OS.WM_IME_CHAR, wParam, lParam); 
     2138//  // widget could be disposed at this point 
     2139//  display.lastKey = display.lastAscii = 0; 
     2140//  return new LDWTRESULT (result); 
     2141//} 
     2142 
     2143 
    20982144LDWTRESULT wmNotifyChild (int wParam, int lParam)  
    20992145{ 
  • trunk/current/win32/import/dwt/graphics/device.d

    r76 r79  
    6666public abstract class Device : Drawable { 
    6767     
     68    private import std.windows.charset; 
     69    private import std.windows.syserror; 
    6870    /* Debugging */ 
    6971    debug 
     
    523525public static char[] getLastErrorText () { 
    524526    int error = OS.GetLastError(); 
    525     if (error == 0) return "";  
    526     TCHAR* buffer = null; 
    527     int dwFlags = OS.FORMAT_MESSAGE_ALLOCATE_BUFFER | OS.FORMAT_MESSAGE_FROM_SYSTEM | OS.FORMAT_MESSAGE_IGNORE_INSERTS; 
    528     int length = OS.FormatMessage(dwFlags, null, error, OS.LANG_USER_DEFAULT, buffer, 0, null); 
    529     char[] errorNum = (" [GetLastError=") ~ Converter.toHex(error) ~ "] "; 
    530     if (length == 0) return errorNum; 
    531     char[] buffer1 = Converter.TCHARzToStr(buffer, length); 
    532     if ( *buffer != 0)  
    533         OS.LocalFree(cast(HLOCAL)buffer); 
    534     return errorNum ~ buffer1; 
     527    if (error == 0) return ""; 
     528     
     529    // there is bug in phobos sysErrorString(), call fromMBSz() myself  
     530    char[] buffer = std.windows.syserror.sysErrorString(error); 
     531    if(buffer[--$] != '\0') 
     532        buffer ~= '\0'; 
     533    return std.windows.charset.fromMBSz(buffer); 
     534       
     535//  TCHAR* buffer = null; 
     536//  int dwFlags = OS.FORMAT_MESSAGE_ALLOCATE_BUFFER | OS.FORMAT_MESSAGE_FROM_SYSTEM | OS.FORMAT_MESSAGE_IGNORE_INSERTS; 
     537//  int length = OS.FormatMessage(dwFlags, null, error, OS.LANG_USER_DEFAULT, cast(TCHAR*)&buffer, 0, null); 
     538//  char[] errorNum = ("[GetLastError=") ~ Converter.toHex(error) ~ "] "; 
     539//  if (length == 0) return errorNum; 
     540//  char[] buffer1 = Converter.TCHARzToStr(buffer, length); 
     541//  if ( *buffer != 0)  
     542//      OS.LocalFree(cast(HLOCAL)buffer); 
     543//  return errorNum ~ buffer1; 
    535544} 
    536545 
  • trunk/current/win32/import/dwt/internal/converter.d

    r76 r79  
    3737                    char[] result; 
    3838                    int i; 
    39                     wchar* ws = std.utf.toUTF16z(sc); 
    40                     result.length = OS.WideCharToMultiByte(codepage, 0, ws, -1, null, 0, null, null); 
    41                     i = OS.WideCharToMultiByte(codepage, 0, ws, -1, result, result.length, null, null); 
     39                    wchar[] ws = std.utf.toUTF16(sc); 
     40                    result.length = OS.WideCharToMultiByte(codepage, 0, ws, ws.length, null, 0, null, null); 
     41                    i = OS.WideCharToMultiByte(codepage, 0, ws, ws.length, result, result.length, null, null); 
    4242                    assert(i == result.length); 
    4343                    return result; 
     
    5353    static char* StrToMBCSz(char[] sc) 
    5454    {    
    55         char* ret
     55        char* ret = null
    5656        try{ 
    5757            ret = std.windows.charset.toMBSz(sc); 
     
    9595    { 
    9696        wchar[] ws; 
     97        if(sc.length == 0){ 
     98            ws ~= '\0'; 
     99            return ws; 
     100        } 
     101         
    97102        try{ 
    98103            ws = std.utf.toUTF16(sc); 
    99             ws ~= '\0'; 
     104            if(ws[--$] != '\0') 
     105                ws ~= '\0'; 
    100106        }catch(Exception e){ 
    101107            // do nothing 
     
    113119        } 
    114120        // convert MBCS to UTF-8 
     121        if(_length == 0) 
     122            return null; 
    115123        wchar[] wcs = _mbcszToWs(pString, _length, codepage); 
    116124        return std.utf.toUTF8(wcs);  
     
    125133                ++_length;  
    126134        } 
     135        if(_length == 0) 
     136            return null; 
    127137        // convert wchar* to UTF-8 
    128138        wchar[] wcs = pString[0.._length]; 
  • trunk/current/win32/import/dwt/widgets/combo.d

    r76 r79  
    15671567} 
    15681568 
    1569 LDWTRESULT WM_IME_CHAR (int wParam, int lParam) { 
     1569LDWTRESULT WM_IME_CHAR_ (int wParam, int lParam) { 
    15701570 
    15711571    /* Process a DBCS character */ 
  • trunk/current/win32/import/dwt/widgets/text.d

    r76 r79  
    18811881} 
    18821882 
    1883 LDWTRESULT WM_IME_CHAR (int wParam, int lParam) { 
     1883LDWTRESULT WM_IME_CHAR_ (int wParam, int lParam) { 
    18841884 
    18851885    /* Process a DBCS character */ 
  • trunk/current/win32/import/make-dwt-lib.bat

    r76 r79  
    44 
    55@echo Build release version ... 
    6 build -release -clean -inline -w -lib -full -allobj dwt\all.d -T\dmd\lib\dwt.lib -version=OLE_COM 
     6build -release -clean -inline -w -lib -full -allobj dwt\all.d -T..\lib\dwt.lib -version=OLE_COM 
    77 
    88@echo -----------------------------------------       
    99@echo Build debug version ... 
    10 build -debug -g -unittest -clean -w -lib -full -allobj dwt\all.d -T\dmd\lib\dwtd.lib  -version=OLE_COM 
     10build -debug -g -unittest -clean -w -lib -full -allobj dwt\all.d -T..\lib\dwtd.lib  -version=OLE_COM 
    1111 
    1212@echo ----------------------------------------- 
  • trunk/current/win32/import/make-dwtextra-lib.bat

    r76 r79  
    1 cd dwt 
    2 cd extra 
    3 make-dwtextra-lib.bat 
     1cd dwt\extra 
     2call make-dwtextra-lib.bat 
  • trunk/current/win32/packages/dwt/vc/DProject.vcproj

    r76 r79  
    10231023            </File> 
    10241024            <File 
     1025                RelativePath="..\examples\Poseidon\ak\xml\core.d"> 
     1026            </File> 
     1027            <File 
    10251028                RelativePath="..\examples\Poseidon\core\core.d"> 
    1026             </File> 
    1027             <File 
    1028                 RelativePath="..\examples\Poseidon\ak\xml\core.d"> 
    10291029            </File> 
    10301030            <File 
     
    10731073        <File 
    10741074            RelativePath="..\examples\ole_com\BrowserExample.d"> 
    1075         </File> 
    1076         <File 
    1077             RelativePath="..\..\..\..\D\project\ide\core.d"> 
    10781075        </File> 
    10791076        <File 
     
    10841081        </File> 
    10851082        <File 
    1086             RelativePath="..\..\..\..\D\project\Iic\IICProgrammer.d"> 
    1087         </File> 
    1088         <File 
    10891083            RelativePath="..\examples\ole_com\PDFViewer.d"> 
    10901084        </File> 
    10911085        <File 
    10921086            RelativePath="..\examples\scintilla\scintilla_test.d"> 
    1093         </File> 
    1094         <File 
    1095             RelativePath="..\..\..\..\D\project\ide\scintillad.d"> 
    1096         </File> 
    1097         <File 
    1098             RelativePath="..\examples\ole_com\SimpleBrowser.d"> 
    10991087        </File> 
    11001088        <File