Changeset 79
- Timestamp:
- 12/24/05 08:40:08 (3 years ago)
- Files:
-
- trunk/current/win32/del-intermediate.bat (modified) (1 diff)
- trunk/current/win32/import/.poseidon (modified) (1 diff)
- trunk/current/win32/import/dwt/extra/make-dwtextra-lib.bat (modified) (1 diff)
- trunk/current/win32/import/dwt/extra/scintilla.d (modified) (4 diffs)
- trunk/current/win32/import/dwt/graphics/device.d (modified) (2 diffs)
- trunk/current/win32/import/dwt/internal/converter.d (modified) (5 diffs)
- trunk/current/win32/import/dwt/widgets/combo.d (modified) (1 diff)
- trunk/current/win32/import/dwt/widgets/text.d (modified) (1 diff)
- trunk/current/win32/import/make-dwt-lib.bat (modified) (1 diff)
- trunk/current/win32/import/make-dwtextra-lib.bat (modified) (1 diff)
- trunk/current/win32/lib (deleted)
- trunk/current/win32/packages/dwt/examples/Poseidon (deleted)
- trunk/current/win32/packages/dwt/vc/DProject.ncb (modified) (previous)
- trunk/current/win32/packages/dwt/vc/DProject.suo (modified) (previous)
- trunk/current/win32/packages/dwt/vc/DProject.vcproj (modified) (3 diffs)
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' 2 cd import\dwt 2 3 del *.obj *.map *.rsp *.ksp *.lib *.exe *.def /s /q 3 cd .. 4 cd packages 4 cd ..\..\packages\dwt 5 5 del *.obj *.map *.rsp *.ksp *.lib *.exe *.def /s /q 6 cd .. 6 cd ..\..\lib 7 @echo remove the dwt.lib and dwtextra.lib 8 del dwt.lib dwtd.lib dwtextra.lib dwtextrad.lib 7 9 pause trunk/current/win32/import/.poseidon
r76 r79 4 4 <comment /> 5 5 <filter>*.d</filter> 6 <showemptyfolder>0</showemptyfolder> 6 7 <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> 8 9 <mainFile>dwt\all.d</mainFile> 9 10 </buildSpec> trunk/current/win32/import/dwt/extra/make-dwtextra-lib.bat
r76 r79 4 4 5 5 @echo Build release version ... 6 build -release -O -clean -inline -w -lib -full -allobj all.d -T \dmd\lib\dwtextra.lib -Xdwt -version=OLE_COM6 build -release -O -clean -inline -w -lib -full -allobj all.d -T..\..\..\lib\dwtextra.lib -Xdwt -version=OLE_COM -I..\..\ 7 7 8 8 @echo ----------------------------------------- 9 9 @echo Build debug version ... 10 build -debug -g -clean -w -lib -full -allobj all.d -T \dmd\lib\dwtextrad.lib -Xdwt -version=OLE_COM10 build -debug -g -clean -w -lib -full -allobj all.d -T..\..\..\lib\dwtextrad.lib -Xdwt -version=OLE_COM -I..\..\ 11 11 12 12 @echo ----------------------------------------- trunk/current/win32/import/dwt/extra/scintilla.d
r76 r79 145 145 * @author Shawn Liu <shawn666.liu at gmail dot com> 146 146 */ 147 class Scintilla : Scrollable{147 class Scintilla : Control { 148 148 149 149 // the C struct, internal use only … … 1880 1880 int directPointer; 1881 1881 boolean _enableDirectFunc = true; 1882 1883 // used to process DBCS such as Chinese/Japanese/Korea character 1884 private boolean ignoreCharacter; 1882 1885 1883 1886 /** … … 1936 1939 }); 1937 1940 1938 // when the shelldisposed, check the instance count1939 get Shell().handleDispose(null, delegate(DisposeEvent e) {1941 // when the display disposed, check the instance count 1942 getDisplay().handleEvent(null, DWT.Dispose, delegate(Event e) { 1940 1943 // No scintilla instance exists now, safe to free dll 1941 if(Scintilla.instCount == 0 ){1944 if(Scintilla.instCount == 0 && Scintilla._handleOfDLL !is null){ 1942 1945 OS.FreeLibrary(Scintilla._handleOfDLL); 1943 1946 Scintilla._handleOfDLL = null; … … 2096 2099 } 2097 2100 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 2098 2144 LDWTRESULT wmNotifyChild (int wParam, int lParam) 2099 2145 { trunk/current/win32/import/dwt/graphics/device.d
r76 r79 66 66 public abstract class Device : Drawable { 67 67 68 private import std.windows.charset; 69 private import std.windows.syserror; 68 70 /* Debugging */ 69 71 debug … … 523 525 public static char[] getLastErrorText () { 524 526 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; 535 544 } 536 545 trunk/current/win32/import/dwt/internal/converter.d
r76 r79 37 37 char[] result; 38 38 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); 42 42 assert(i == result.length); 43 43 return result; … … 53 53 static char* StrToMBCSz(char[] sc) 54 54 { 55 char* ret ;55 char* ret = null; 56 56 try{ 57 57 ret = std.windows.charset.toMBSz(sc); … … 95 95 { 96 96 wchar[] ws; 97 if(sc.length == 0){ 98 ws ~= '\0'; 99 return ws; 100 } 101 97 102 try{ 98 103 ws = std.utf.toUTF16(sc); 99 ws ~= '\0'; 104 if(ws[--$] != '\0') 105 ws ~= '\0'; 100 106 }catch(Exception e){ 101 107 // do nothing … … 113 119 } 114 120 // convert MBCS to UTF-8 121 if(_length == 0) 122 return null; 115 123 wchar[] wcs = _mbcszToWs(pString, _length, codepage); 116 124 return std.utf.toUTF8(wcs); … … 125 133 ++_length; 126 134 } 135 if(_length == 0) 136 return null; 127 137 // convert wchar* to UTF-8 128 138 wchar[] wcs = pString[0.._length]; trunk/current/win32/import/dwt/widgets/combo.d
r76 r79 1567 1567 } 1568 1568 1569 LDWTRESULT WM_IME_CHAR (int wParam, int lParam) {1569 LDWTRESULT WM_IME_CHAR_ (int wParam, int lParam) { 1570 1570 1571 1571 /* Process a DBCS character */ trunk/current/win32/import/dwt/widgets/text.d
r76 r79 1881 1881 } 1882 1882 1883 LDWTRESULT WM_IME_CHAR (int wParam, int lParam) {1883 LDWTRESULT WM_IME_CHAR_ (int wParam, int lParam) { 1884 1884 1885 1885 /* Process a DBCS character */ trunk/current/win32/import/make-dwt-lib.bat
r76 r79 4 4 5 5 @echo Build release version ... 6 build -release -clean -inline -w -lib -full -allobj dwt\all.d -T \dmd\lib\dwt.lib -version=OLE_COM6 build -release -clean -inline -w -lib -full -allobj dwt\all.d -T..\lib\dwt.lib -version=OLE_COM 7 7 8 8 @echo ----------------------------------------- 9 9 @echo Build debug version ... 10 build -debug -g -unittest -clean -w -lib -full -allobj dwt\all.d -T \dmd\lib\dwtd.lib -version=OLE_COM10 build -debug -g -unittest -clean -w -lib -full -allobj dwt\all.d -T..\lib\dwtd.lib -version=OLE_COM 11 11 12 12 @echo ----------------------------------------- trunk/current/win32/import/make-dwtextra-lib.bat
r76 r79 1 cd dwt 2 cd extra 3 make-dwtextra-lib.bat 1 cd dwt\extra 2 call make-dwtextra-lib.bat trunk/current/win32/packages/dwt/vc/DProject.vcproj
r76 r79 1023 1023 </File> 1024 1024 <File 1025 RelativePath="..\examples\Poseidon\ak\xml\core.d"> 1026 </File> 1027 <File 1025 1028 RelativePath="..\examples\Poseidon\core\core.d"> 1026 </File>1027 <File1028 RelativePath="..\examples\Poseidon\ak\xml\core.d">1029 1029 </File> 1030 1030 <File … … 1073 1073 <File 1074 1074 RelativePath="..\examples\ole_com\BrowserExample.d"> 1075 </File>1076 <File1077 RelativePath="..\..\..\..\D\project\ide\core.d">1078 1075 </File> 1079 1076 <File … … 1084 1081 </File> 1085 1082 <File 1086 RelativePath="..\..\..\..\D\project\Iic\IICProgrammer.d">1087 </File>1088 <File1089 1083 RelativePath="..\examples\ole_com\PDFViewer.d"> 1090 1084 </File> 1091 1085 <File 1092 1086 RelativePath="..\examples\scintilla\scintilla_test.d"> 1093 </File>1094 <File1095 RelativePath="..\..\..\..\D\project\ide\scintillad.d">1096 </File>1097 <File1098 RelativePath="..\examples\ole_com\SimpleBrowser.d">1099 1087 </File> 1100 1088 <File
