Changeset 119
- Timestamp:
- Feb 23, 2007, 11:00:24 PM (18 years ago)
- Location:
- Include
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
Include/Classes/System/IO/Stream.ab
r115 r119 1 2 #require <Classes/System/misc.ab> 1 3 2 4 Class Stream 3 Public 5 Public 'Protected 4 6 Sub Stream(): End Sub 5 7 Public 6 Virtual Function CanRead() As Boolean: End Function 7 Virtual Function CanSeek() As Boolean: End Function 8 Virtual Function CanTimeout() As Boolean: End Function 9 Virtual Function CanWrite() As Boolean: End Function 10 Virtual Function Length() As Int64: End Function 11 Virtual Sub Position(value As Int64): End Sub 12 Virtual Function Position() As Int64: End Function 13 Virtual Sub ReadTimeout(value As Long): End Sub 14 Virtual Function ReadTimeout() As Long: End Function 15 Virtual Sub WriteTimeout(value As Long): End Sub 16 Virtual Function WriteTimeout() As Long: End Function 8 Virtual Sub ~Stream() 9 Close() 10 End Sub 11 Public 12 Abstract Function CanRead() As Boolean 13 Abstract Function CanSeek() As Boolean 14 15 Virtual Function CanTimeout() As Boolean 16 Return True 17 End Function 18 19 Abstract Function CanWrite() As Boolean 20 Abstract Function Length() As Int64 21 Abstract Sub Position(value As Int64) 22 Abstract Function Position() As Int64 23 24 Virtual Sub ReadTimeout(value As Long) 25 ' Throw InvalidOperationException 26 End Sub 27 28 Virtual Function ReadTimeout() As Long 29 ' Throw InvalidOperationException 30 End Function 31 32 Virtual Sub WriteTimeout(value As Long) 33 ' Throw InvalidOperationException 34 End Sub 35 36 Virtual Function WriteTimeout() As Long 37 ' Throw InvalidOperationException 38 End Function 17 39 18 40 Public … … 22 44 Virtual Function EndRead(ByRef asyncResult As IAsyncResult) As Long: End Function 23 45 Virtual Sub EndWrite(ByRef asyncResult As IAsyncResult): End Sub 24 Virtual Sub Flush(): End Sub 25 Virtual Function Read(ByRef buffer[] As Byte, offset As Long, count As Long) As Long: End Function 26 Virtual Function ReadByte() As Long: End Function 27 Virtual Function Seek(offset As Int64, origin As SeekOrigin) As Long: End Function 28 Virtual Sub SetLength(value As Int64): End Sub 29 Virtual Sub Write (ByRef buffer[] As Byte, offset As Long, count As Long): End Sub 30 Virtual Sub WriteByte(value As Byte): End Sub 46 Abstract Sub Flush() 47 Abstract Function Read(ByRef buffer[] As Byte, offset As Long, count As Long) As Long 31 48 49 Virtual Function ReadByte() As Long 50 Dim b As Byte 51 Dim ret = Read(VarPtr(b), 0, 1) 52 If ret <> 0 Then 53 Return b 54 Else 55 Return -1 56 End If 57 End Function 58 59 Abstract Function Seek(offset As Int64, origin As SeekOrigin) As Long 60 Abstract Sub SetLength(value As Int64): End Sub 61 Abstract Sub Write(ByRef buffer[] As Byte, offset As Long, count As Long) 62 63 Virtual Sub WriteByte(b As Byte) 64 Write(VarPtr(b), 0, 1) 65 End Sub 32 66 Protected 33 67 Virtual Function CreateWaitHandle() As WaitHandle: End Function -
Include/Classes/System/String.ab
r49 r119 2 2 m_Length As Long 3 3 Public 4 Chars As LPSTR4 Chars As *Char 5 5 6 6 Sub String() … … 9 9 End Sub 10 10 11 Sub String(initStr As LPSTR)11 Sub String(initStr As *Char) 12 12 String() 13 13 Assign(initStr) … … 24 24 End Sub 25 25 */ 26 Sub String(initChar As Byte, length As Long)26 Sub String(initChar As Char, length As Long) 27 27 ReSize(length, initChar) 28 28 End Sub … … 40 40 End Function 41 41 42 Function Operator() As LPSTR42 Function Operator() As *Char 43 43 Return Chars 44 44 End Function … … 48 48 End Sub 49 49 50 Sub Operator = (text As LPSTR)50 Sub Operator = (text As *Char) 51 51 Assign(text) 52 52 End Sub 53 53 54 Function Operator[] (n As Long) As Byte54 Function Operator[] (n As Long) As Char 55 55 Return Chars[n] 56 56 End Function 57 57 58 Sub Operator[]= (n As Long, c As Byte)58 Sub Operator[]= (n As Long, c As Char) 59 59 Chars[n] = c 60 60 End Sub 61 61 62 Function Operator+ (lpszText As LPSTR) As String62 Function Operator+ (lpszText As *Char) As String 63 63 Return Concat(lpszText, lstrlen(lpszText)) 64 64 End Function … … 68 68 End Function 69 69 70 Function Operator& (lpszText As LPSTR) As String70 Function Operator& (lpszText As *Char) As String 71 71 Dim tempString As String 72 72 tempString=This+lpszText … … 88 88 End Function 89 89 90 Function Operator== (lpszText As LPSTR) As Long90 Function Operator== (lpszText As *Char) As Long 91 91 If lstrcmp(This, lpszText) = 0 Then 92 92 Return _System_TRUE … … 100 100 End Function 101 101 102 Function Operator<> (lpszText As LPSTR) As Long102 Function Operator<> (lpszText As *Char) As Long 103 103 Return lstrcmp(This, lpszText) 104 104 End Function … … 112 112 End Function 113 113 114 Function Operator< (lpszText As LPSTR) As Long114 Function Operator< (lpszText As *Char) As Long 115 115 If lstrcmp(This, lpszText) < 0 Then 116 116 Return _System_TRUE … … 128 128 End Function 129 129 130 Function Operator> (lpszText As LPSTR) As Long130 Function Operator> (lpszText As *Char) As Long 131 131 If lstrcmp(This, lpszText) > 0 Then 132 132 Return _System_TRUE … … 144 144 End Function 145 145 146 Function Operator<= (lpszText As LPSTR) As Long146 Function Operator<= (lpszText As *Char) As Long 147 147 If lstrcmp(This, lpszText) <= 0 Then 148 148 Return _System_TRUE … … 160 160 End Function 161 161 162 Function Operator>= (lpszText As LPSTR) As Long162 Function Operator>= (lpszText As *Char) As Long 163 163 If lstrcmp(This, lpszText) => 0 Then 164 164 Return _System_TRUE … … 168 168 End Function 169 169 170 Function StrPtr() As LPSTR170 Function StrPtr() As *Char 171 171 Return Chars 172 172 End Function … … 186 186 End Sub 187 187 188 Sub ReSize(allocLength As Long, c As Byte)188 Sub ReSize(allocLength As Long, c As Char) 189 189 If allocLength < 0 Then 190 190 Exit Sub … … 201 201 End Sub 202 202 203 Sub Assign(lpszText As LPSTR, textLength As Long)203 Sub Assign(lpszText As *Char, textLength As Long) 204 204 If lpszText = Chars Then Exit Sub 205 205 If AllocStringBuffer(textLength) <> 0 Then … … 213 213 End Sub 214 214 215 Sub Assign(lpszText As LPSTR)215 Sub Assign(lpszText As *Char) 216 216 If lpszText Then 217 217 Assign(lpszText, lstrlen(lpszText)) … … 223 223 End Sub 224 224 225 Sub Append(lpszText As LPSTR, textLength As Long)225 Sub Append(lpszText As *Char, textLength As Long) 226 226 Dim prevLen As Long 227 227 prevLen = m_Length … … 232 232 End Sub 233 233 234 Sub Append(text As LPSTR)234 Sub Append(text As *Char) 235 235 Append(text, lstrlen(text)) 236 236 End Sub … … 240 240 End Sub 241 241 242 Function Concat(lpszText As LPSTR, textLength As Long) As String242 Function Concat(lpszText As *Char, textLength As Long) As String 243 243 Dim tempString As String 244 244 With tempString … … 259 259 End Function 260 260 261 Function Contains(lpszText As LPSTR) As BOOL261 Function Contains(lpszText As *Char) As BOOL 262 262 If IndexOf(lpszText, 0, m_Length) >= 0 Then 263 263 Return _System_TRUE … … 267 267 End Function 268 268 269 Function IndexOf(lpszText As LPSTR) As Long269 Function IndexOf(lpszText As *Char) As Long 270 270 Return IndexOf(lpszText, 0, m_Length) 271 271 End Function 272 272 273 Function IndexOf(lpszText As LPSTR, startIndex As Long) As Long273 Function IndexOf(lpszText As *Char, startIndex As Long) As Long 274 274 Return IndexOf(lpszText, startIndex, m_Length - startIndex) 275 275 End Function 276 276 277 Function IndexOf(lpszText As LPSTR, startIndex As Long, count As Long) As Long277 Function IndexOf(lpszText As *Char, startIndex As Long, count As Long) As Long 278 278 Dim length As Long 279 279 length = lstrlen(lpszText) … … 298 298 End Function 299 299 300 Function LastIndexOf(lpszText As LPSTR) As Long300 Function LastIndexOf(lpszText As *Char) As Long 301 301 Return LastIndexOf(lpszText, m_Length - 1, m_Length) 302 302 End Function 303 303 304 Function LastIndexOf(lpszText As LPSTR, startIndex As Long) As Long305 Return LastIndexOf(lpszText As LPSTR, startIndex, startIndex + 1)306 End Function 307 308 Function LastIndexOf(lpszText As LPSTR, startIndex As Long, count As Long) As Long304 Function LastIndexOf(lpszText As *Char, startIndex As Long) As Long 305 Return LastIndexOf(lpszText As *Char, startIndex, startIndex + 1) 306 End Function 307 308 Function LastIndexOf(lpszText As *Char, startIndex As Long, count As Long) As Long 309 309 Dim length As Long 310 310 length = lstrlen(lpszText) … … 329 329 End Function 330 330 331 Function StartsWith(lpszText As LPSTR) As BOOL331 Function StartsWith(lpszText As *Char) As BOOL 332 332 If IndexOf(lpszText) = 0 Then 333 333 Return _System_TRUE … … 337 337 End Function 338 338 339 Function EndsWith(lpszText As LPSTR) As BOOL339 Function EndsWith(lpszText As *Char) As BOOL 340 340 If LastIndexOf(lpszText) = m_Length - lstrlen(lpszText) Then 341 341 Return _System_TRUE … … 345 345 End Function 346 346 347 Function Insert(startIndex As Long, lpszText As LPSTR) As Long347 Function Insert(startIndex As Long, lpszText As *Char) As Long 348 348 Dim length As Long 349 349 length = lstrlen(lpszText) … … 351 351 If startIndex < 0 Or startIndex > m_Length Then Return -1 352 352 353 Dim newChars As LPSTR353 Dim newChars As *Char 354 354 newChars = _System_malloc(length + m_Length + 1) 355 355 If newChars = 0 Then Return -1 … … 391 391 If startIndex + count > m_Length Then Return -1 392 392 393 Dim newChars As LPSTR393 Dim newChars As *Char 394 394 newChars = _System_malloc(m_Length - count + 1) 395 395 If newChars = 0 Then Return -1 … … 413 413 End Function 414 414 415 Sub Replace(oldChar As Byte, newChar As Byte) 415 416 Sub Replace(oldChar As Char, newChar As Char) 416 417 Dim i As Long 417 418 For i = 0 To ELM(m_Length) … … 468 469 End Sub 469 470 471 Override Function ToString() As String 472 Return This 473 End Function 474 470 475 Private 471 476 ' メモリ確保に失敗すると元の文字列は失われない。(例外安全でいう強い保障) 472 Function AllocStringBuffer(textLength As Long) As LPSTR477 Function AllocStringBuffer(textLength As Long) As *Char 473 478 If textLength < 0 Then 474 479 Return 0 -
Include/Classes/System/Threading/WaitHandle.ab
r77 r119 21 21 22 22 Virtual Sub ~WaitHandle() 23 Close ()23 CloseHandle(h) 24 24 End Sub 25 25 … … 70 70 ExitThread(0) 71 71 End If 72 Return AfterWait(pSignalAndWait(toSignal.Handle, toWaitOn.Handle, millisecondsTimeout As DWord), 1)72 Return WaitHandle.AfterWait(pSignalAndWait(toSignal.Handle, toWaitOn.Handle, millisecondsTimeout As DWord), 1) 73 73 End Function 74 74 -
Include/GdiPlus.ab
r13 r119 3 3 #ifndef GDIPLUS_AB 4 4 #define GDIPLUS_AB 5 6 TypeDef PDirectDrawSurface7 = VoidPtr '*IDirectDrawSurface77 5 8 6 Declare Function GdipAlloc Lib "Gdiplus.dll" (size As SIZE_T) As VoidPtr -
Include/GdiPlusFlat.ab
r33 r119 3 3 #ifndef __GDIPLUS_FLATAPI_AB__ 4 4 #define __GDIPLUS_FLATAPI_AB__ 5 6 #require <GdiPlusEnums.ab> 7 #require <GdiPlusGpStubs.ab> 8 #require <Classes/System/Drawing/misc.ab> 9 #require <Classes/System/Drawing/Imaging/misc.ab> 10 #require <Classes/System/Drawing/Text/misc.ab> 11 #require <Classes/System/Drawing/Imaging/MetafileHeader.ab> 12 13 TypeDef PDirectDrawSurface7 = VoidPtr '*IDirectDrawSurface7 5 14 6 15 ' GraphicsPath APIs -
Include/GdiPlusGpStubs.ab
r33 r119 4 4 #define __GDIPLUSGPSTUBS_AB__ 5 5 6 #include <Classes/System/Drawing/Drawing2D/Matrix.ab> 6 #require <GdiPlusTypes.ab> 7 #require <GdiPlusEnums.ab> 8 #require <Classes/System/Drawing/Drawing2D/misc.ab> 9 #require <Classes/System/Drawing/Drawing2D/Matrix.ab> 7 10 8 11 Class GpGraphics … … 75 78 TypeDef GpFillMode = FillMode 76 79 TypeDef GpWrapMode = WrapMode 77 TypeDef GpUnit = Unit80 TypeDef GpUnit = GraphicsUnit 78 81 TypeDef GpCoordinateSpace = CoordinateSpace 79 82 TypeDef GpPointF = PointF -
Include/api_console.sbp
r1 r119 14 14 Const BACKGROUND_INTENSITY = &H0080 15 15 16 Type COORD 17 X As Integer 18 Y As Integer 19 End Type 16 20 17 Declare Function AllocConsole Lib "kernel32" () As Long18 Declare Function FreeConsole Lib "kernel32" () As Long19 21 20 Declare Function SetConsoleCursorPosition Lib "kernel32" (hConsoleOutput As HANDLE, dwCursorPosition As DWord) As Long 22 Declare Function AllocConsole Lib "kernel32" () As BOOL 23 Declare Function FreeConsole Lib "kernel32" () As BOOL 24 25 Declare Function SetConsoleCursorPosition Lib "kernel32" (hConsoleOutput As HANDLE, dwCursorPosition As DWord) As BOOL 21 26 22 27 Declare Function ReadConsole Lib "kernel32" Alias "ReadConsoleA" (hConsoleInput As HANDLE, pBuffer As VoidPtr, nNumberOfCharsToRead As DWord, ByRef NumberOfCharsRead As DWord, pReserved As VoidPtr) As BOOL -
Include/api_gdi.sbp
r1 r119 484 484 lfFaceName[ELM(LF_FACESIZE)] As WCHAR 485 485 End Type 486 #ifdef UNICODE 487 TypeDef LOGFONT = LOGFONTW 488 #else 486 489 TypeDef LOGFONT = LOGFONTA 490 #endif 487 491 Declare Function CreateFontIndirect Lib "gdi32" Alias "CreateFontIndirectA" (ByRef lplf As LOGFONT) As HFONT 488 492 … … 730 734 731 735 Declare Function GetTextColor Lib "gdi32" (hdc As HDC) As DWord 732 Declare Function GetTextExtentPoint32 Lib "gdi32" Alias "GetTextExtentPoint32A" (hdc As HDC, lpString As BytePtr, cbString As Long, ByRef lpSize As SIZE) As Long 736 Declare Function GetTextExtentPoint32A Lib "gdi32" (hdc As HDC, pString As PCSTR, cbString As Long, ByRef Size As SIZE) As Long 737 Declare Function GetTextExtentPoint32W Lib "gdi32" (hdc As HDC, pString As PCWSTR, cbString As Long, ByRef Size As SIZE) As Long 738 #ifdef UNICODE 739 Declare Function GetTextExtentPoint32 Lib "gdi32" Alias "GetTextExtentPoint32W" (hdc As HDC, pString As PCTSTR, cbString As Long, ByRef Size As SIZE) As Long 740 #else 741 Declare Function GetTextExtentPoint32 Lib "gdi32" Alias "GetTextExtentPoint32A" (hdc As HDC, pString As PCTSTR, cbString As Long, ByRef Size As SIZE) As Long 742 #endif 733 743 734 744 Const TMPF_FIXED_PITCH = &H01 … … 836 846 Declare Function StrokeAndFillPath Lib "gdi32" (hdc As HDC) As Long 837 847 Declare Function StrokePath Lib "gdi32" (DC As DWord) As Long 838 Declare Function TextOut Lib "gdi32" Alias "TextOutA" (hdc As HDC, nXStart As Long, nYStart As Long, lpString As BytePtr, cbString As Long) As Long 839 848 Declare Function TextOutA Lib "gdi32" (hdc As HDC, nXStart As Long, nYStart As Long, pString As PCSTR, cbString As Long) As Long 849 Declare Function TextOutW Lib "gdi32" (hdc As HDC, nXStart As Long, nYStart As Long, pString As PCWSTR, cbString As Long) As Long 850 #ifdef UNICODE 851 Declare Function TextOut Lib "gdi32" Alias "TextOutW" (hdc As HDC, nXStart As Long, nYStart As Long, pString As PCTSTR, cbString As Long) As Long 852 #else 853 Declare Function TextOut Lib "gdi32" Alias "TextOutA" (hdc As HDC, nXStart As Long, nYStart As Long, pString As PCTSTR, cbString As Long) As Long 854 #endif 840 855 841 856 /* Pixel Format */ -
Include/api_imm.sbp
r1 r119 20 20 21 21 Declare Function ImmDisableIME Lib "imm32" (idThread As DWord) As BOOL 22 22 #ifdef UNICODE 23 23 Declare Function ImmGetCompositionString Lib "imm32" Alias "ImmGetCompositionStringA" (hIMC As HIMC, dwIndex As DWord, pBuf As VoidPtr, dwBufLen As DWord) As Long 24 #else 25 Declare Function ImmGetCompositionString Lib "imm32" Alias "ImmGetCompositionStringA" (hIMC As HIMC, dwIndex As DWord, pBuf As VoidPtr, dwBufLen As DWord) As Long 26 #endif 24 27 Declare Function ImmGetCompositionStringA Lib "imm32" (hIMC As HIMC, dwIndex As DWord, pBuf As VoidPtr, dwBufLen As DWord) As Long 25 28 Declare Function ImmGetCompositionStringW Lib "imm32" (hIMC As HIMC, dwIndex As DWord, pBuf As VoidPtr, dwBufLen As DWord) As Long 29 30 #ifdef UNICODE 31 Declare Function ImmGetCompositionFont Lib "imm32" Alias "ImmSetCompositionFontW" (hIMC As HIMC, ByRef lf As LOGFONT) As BOOL 32 #else 26 33 Declare Function ImmGetCompositionFont Lib "imm32" Alias "ImmSetCompositionFontA" (hIMC As HIMC, ByRef lf As LOGFONT) As BOOL 27 Declare Function ImmGetCompositionFontA Lib "imm32" (hIMC As HIMC, ByRef lf As LOGFONT) As BOOL 28 Declare Function ImmGetCompositionFontW Lib "imm32" (hIMC As HIMC, ByRef lf As LOGFONT) As BOOL 34 #endif 35 Declare Function ImmGetCompositionFontA Lib "imm32" (hIMC As HIMC, ByRef lf As LOGFONTA) As BOOL 36 Declare Function ImmGetCompositionFontW Lib "imm32" (hIMC As HIMC, ByRef lf As LOGFONTW) As BOOL 29 37 Declare Function ImmGetCompositionWindow Lib "imm32" (hIMC As HIMC, ByRef CompForm As COMPOSITIONFORM) As BOOL 30 38 39 #ifdef UNICODE 40 Declare Function ImmSetCompositionFont Lib "imm32" Alias "ImmSetCompositionFontW" (hIMC As HIMC, ByRef lplf As LOGFONT) As Long 41 #else 31 42 Declare Function ImmSetCompositionFont Lib "imm32" Alias "ImmSetCompositionFontA" (hIMC As HIMC, ByRef lplf As LOGFONT) As Long 32 Declare Function ImmSetCompositionFontA Lib "imm32" (hIMC As HIMC, ByRef lplf As LOGFONT) As Long 33 Declare Function ImmSetCompositionFontW Lib "imm32" (hIMC As HIMC, ByRef lplf As LOGFONT) As Long 43 #endif 44 Declare Function ImmSetCompositionFontA Lib "imm32" (hIMC As HIMC, ByRef lplf As LOGFONTA) As Long 45 Declare Function ImmSetCompositionFontW Lib "imm32" (hIMC As HIMC, ByRef lplf As LOGFONTW) As Long 34 46 Declare Function ImmSetCompositionWindow Lib "imm32" (hIMC As HIMC, ByRef CompForm As COMPOSITIONFORM) As BOOL 35 47 -
Include/api_system.sbp
r68 r119 779 779 Declare Function lstrcmpi Lib "kernel32" Alias "lstrcmpiA" (lpString1 As BytePtr, lpString2 As BytePtr) As Long 780 780 Declare Function lstrcpy Lib "kernel32" Alias "lstrcpyA" (lpString1 As BytePtr, lpString2 As BytePtr) As BytePtr 781 Declare Function lstrlen Lib "kernel32" Alias "lstrlenA" (lpString As BytePtr) As Long 781 Declare Function lstrlenA Lib "kernel32" (lpString As LPSTR) As Long 782 Declare Function lstrlenW Lib "kernel32" (lpString As LPWSTR) As Long 783 #ifdef UNICODE 784 Declare Function lstrlen Lib "kernel32" Alias "lstrlenA" (lpString As *Char) As Long 785 #else 786 Declare Function lstrlen Lib "kernel32" Alias "lstrlenA" (lpString As *Char) As Long 787 #endif 782 788 Declare Sub memcpy Lib "kernel32" Alias "RtlMoveMemory" (pDest As VoidPtr, pSrc As VoidPtr, length As SIZE_T) 783 789 Declare Function MoveFile Lib "kernel32" Alias "MoveFileA" (lpExistingFileName As BytePtr, lpNewFileName As BytePtr) As BOOL -
Include/api_window.sbp
r77 r119 200 200 Const CF_GDIOBJLAST = &H03FF 201 201 202 '------------- 203 ' Window API Function Names 204 205 /* 206 CreateWindowEx 207 CallWindowProc 208 DefWindowProc 209 DispatchMessage 210 DrawText 211 DrawTextEx 212 FindWindow 213 FindWindowEx 214 GetClassInfoEx 215 GetClassLong 216 GetClassLongPtr 217 GetClassName 218 GetClipboardFormatName 219 GetDlgItemText 220 GetMenuItemInfo 221 GetMessage 222 GetWindowLong 223 GetWindowLongPtr 224 GetWindowText 225 GetWindowTextLength 226 InsertMenuItem 227 IsCharAlpha 228 IsCharAlphaNumeric 229 IsDialogMessage 230 LoadBitmap 231 LoadCursor 232 LoadCursorFromFile 233 LoadIcon 234 LoadImage 235 PeekMessage 236 PostMessage 237 PostThreadMessage 238 RegisterClassEx 239 RegisterClipboardFormat 240 RegisterWindowMessage 241 RemoveProp 242 SendDlgItemMessage 243 SendMessage 244 SendNotifyMessage 245 SetDlgItemText 246 SetClassLong 247 SetClassLong 248 SetMenuItemInfo 249 SetWindowLong 250 SetWindowLongPtr 251 SetWindowText 252 SystemParametersInfo 253 UnregisterClass 254 wsprintf 255 wvsprintf 256 */ 202 257 203 258 '------------- … … 761 816 Const MB_RIGHT = &H00080000 762 817 Const MB_RTLREADING = &H00100000 763 Declare Function MessageBox Lib "user32" Alias "MessageBoxA" (hWnd As HWND, lpText As PCSTR, lpCaption As PCSTR, uType As DWord) As Long 764 818 #ifdef UNICODE 819 Declare Function MessageBox Lib "user32" Alias "MessageBoxW" (hWnd As HWND, pText As PCWSTR, pCaption As PCWSTR, uType As DWord) As Long 820 #else 821 Declare Function MessageBox Lib "user32" Alias "MessageBoxA" (hWnd As HWND, pText As PCSTR, pCaption As PCSTR, uType As DWord) As Long 822 #endif 823 Declare Function MessageBoxW Lib "user32" (hWnd As HWND, pText As PCWSTR, pCaption As PCWSTR, uType As DWord) As Long 824 Declare Function MessageBoxA Lib "user32" (hWnd As HWND, pText As PCSTR, pCaption As PCSTR, uType As DWord) As Long 765 825 Const MOUSEEVENTF_MOVE = &H0001 766 826 Const MOUSEEVENTF_LEFTDOWN = &H0002 -
Include/basic/command.sbp
r110 r119 6 6 7 7 8 Const _System_Type_ Char= 18 Const _System_Type_SByte = 1 9 9 Const _System_Type_Byte = 2 10 10 Const _System_Type_Integer = 3 … … 16 16 Const _System_Type_Single = 9 17 17 Const _System_Type_Double = 10 18 Const _System_Type_String = 11 18 Const _System_Type_Char = 11 19 Const _System_Type_String = 13 20 Const _System_Type_VoidPtr = 14 19 21 Const _System_MAX_PARMSNUM = 32-1 20 22 -
Include/basic/function.sbp
r110 r119 514 514 End If 515 515 End Sub 516 Function _ecvt(value As Double, count As Long, ByRef dec As Long, ByRef sign As Long) As BytePtr517 Dim temp As BytePtr516 Function _ecvt(value As Double, count As Long, ByRef dec As Long, ByRef sign As Long) As *Char 517 Dim temp As *Char 518 518 Dim i As Long, i2 As Long 519 519 … … 540 540 dec=1 541 541 While value<0.999999999999999 'value<1 542 value =value*10543 dec =dec-1542 value *= 10 543 dec-- 544 544 Wend 545 545 While 9.99999999999999<=value '10<=value 546 value =value/10547 dec =dec+1546 value /= 10 547 dec++ 548 548 Wend 549 549 … … 555 555 _System_ecvt_buffer[i]=0 556 556 557 i =i-1557 i-- 558 558 If value>=5 Then 559 559 '切り上げ処理 … … 562 562 563 563 For i=0 To count-1 564 _System_ecvt_buffer[i] =_System_ecvt_buffer[i]+&H30564 _System_ecvt_buffer[i] += &H30 565 565 Next 566 566 _System_ecvt_buffer[i]=0 … … 713 713 End Function 714 714 715 Function Val(buf As BytePtr) As Double715 Function Val(buf As *Char) As Double 716 716 Dim i As Long, i2 As Long, i3 As Long, i4 As Long 717 717 Dim temporary As String 718 Dim TempPtr As BytePtr718 Dim TempPtr As *Char 719 719 Dim dbl As Double 720 720 Dim i64data As Int64 … … 1024 1024 End Function 1025 1025 1026 Function _System_IsSurrogatePair(wcHigh As WCHAR, wcLow As WCHAR) As Boolean 1027 If &hD800 <= wcHigh And wcHigh < &hDC00 Then 1028 If &hDC00 <= wcLow And wcLow < &hE000 Then 1029 Return True 1030 End If 1031 End If 1032 Return False 1033 End Function 1026 1034 1027 1035 #endif '_INC_FUNCTION -
Include/basic/prompt.sbp
r110 r119 99 99 100 100 temporary[0]=_PromptSys_Buffer[i][i2] 101 #ifdef UNICODE 102 If _System_IsSurrogatePair(_PromptSys_Buffer[i][i2], _PromptSys_Buffer[i][i2+1]) Then 103 #else 101 104 If IsDBCSLeadByte(temporary[0]) Then 105 #endif 102 106 temporary[1]=_PromptSys_Buffer[i][i2+1] 103 107 temporary[2]=0 108 i2++ 104 109 Else 105 110 temporary[1]=0 … … 107 112 TextOut(hDC,i2*_PromptSys_FontSize.cx,i*_PromptSys_FontSize.cy,_ 108 113 temporary,lstrlen(temporary)) 109 110 If IsDBCSLeadByte(temporary[0]) Then i2++111 114 Next 112 115 End If … … 172 175 Dim CompForm As COMPOSITIONFORM 173 176 Dim hGlobal As HGLOBAL 174 Dim pTemp As BytePtr175 177 176 178 Select Case message … … 246 248 hGlobal=GetClipboardData(CF_TEXT) 247 249 If hGlobal=0 Then PromptProc=0:Exit Function 248 pTemp=GlobalLock(hGlobal) As *Byte 249 250 Dim pTemp=GlobalLock(hGlobal) As *Byte 251 #ifdef UNICODE 252 Dim tempSizeW = MultiByteToWideChar(CP_ACP, 0, pTemp, -1, 0, 0) + 1 253 TempStr=ZeroString(tempSizeW) 254 MultiByteToWideChar(CP_ACP, 0, pTemp, -1, StrPtr(TempStr), tempSizeW) 255 #else 250 256 TempStr=ZeroString(lstrlen(pTemp)+1) 251 257 lstrcpy(StrPtr(TempStr),pTemp) 252 258 #endif 253 259 lstrcpy((VarPtr(_PromptSys_InputStr[0])+_PromptSys_InputLen) As *Byte,pTemp) 254 260 _PromptSys_InputLen=_PromptSys_InputLen+lstrlen(pTemp) … … 337 343 _PromptSys_hWnd=CreateWindowEx(WS_EX_CLIENTEDGE,"PROMPT","BASIC PROMPT",WS_OVERLAPPEDWINDOW,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,0,0,GetModuleHandle(0),0) 338 344 ShowWindow(_PromptSys_hWnd,SW_SHOW) 345 UpdateWindow(_PromptSys_hWnd) 339 346 340 347 Dim msg As MSG, iResult As Long … … 455 462 Case _System_Type_Integer,_System_Type_Word 456 463 SetWord(_System_InputDataPtr[i],Val(buf)) 457 Case _System_Type_ Char,_System_Type_Byte464 Case _System_Type_SByte,_System_Type_Byte 458 465 SetByte(_System_InputDataPtr[i],Val(buf)) 459 466 Case _System_Type_Char 467 #ifdef UNICODE 468 SetWord(_System_InputDataPtr[i], buf[0]) 469 #else 470 SetByte(_System_InputDataPtr[i], buf[0]) 471 #endif 460 472 Case _System_Type_String 473 *INPUT_FromPrompt_Type_String 461 474 Dim pTempStr As *String 462 475 pTempStr=_System_InputDataPtr[i] As *String … … 464 477 memcpy(pTempStr->Chars, buf.Chars, pTempStr->Length) 465 478 pTempStr->Chars[pTempStr->Length] = 0 479 Case 13 480 Goto *INPUT_FromPrompt_Type_String 466 481 End Select 467 482 -
Include/crt.sbp
r86 r119 4 4 #define _INC_CRT 5 5 6 Declare Function _beginthread cdecl Lib "msvcrt" (start_address As VoidPtr, stack_size As DWord, arglist As VoidPtr) As HANDLE 7 Declare Function _beginthreadex cdecl Lib "msvcrt" ( 6 #ifndef _DEFINE_CRTDLL_NAME 7 Const _CrtDllName = "msvcrt" 8 #endif 9 10 Declare Function _beginthread cdecl Lib _CrtDllName (start_address As VoidPtr, stack_size As DWord, arglist As VoidPtr) As HANDLE 11 Declare Function _beginthreadex cdecl Lib _CrtDllName ( 8 12 security As *SECURITY_ATTRIBUTES, 9 13 stack_size As DWord, … … 12 16 initflag As DWord, 13 17 ByRef thrdaddr As DWord) As HANDLE 14 Declare Sub _endthread cdecl Lib "msvcrt"()15 Declare Sub _endthreadex cdecl Lib "msvcrt"(retval As DWord)18 Declare Sub _endthread cdecl Lib _CrtDllName () 19 Declare Sub _endthreadex cdecl Lib _CrtDllName (retval As DWord) 16 20 17 Declare Function strstr cdecl Lib "msvcrt"(s1 As LPSTR, s2 As LPSTR) As LPSTR18 Declare Function memmove cdecl Lib "msvcrt"(dest As VoidPtr, src As VoidPtr, count As SIZE_T) As VoidPtr19 Declare Function _mbsstr cdecl Lib "msvcrt"(s1 As LPSTR, s2 As LPSTR) As LPSTR21 Declare Function strstr cdecl Lib _CrtDllName (s1 As LPSTR, s2 As LPSTR) As LPSTR 22 Declare Function memmove cdecl Lib _CrtDllName (dest As VoidPtr, src As VoidPtr, count As SIZE_T) As VoidPtr 23 Declare Function _mbsstr cdecl Lib _CrtDllName (s1 As LPSTR, s2 As LPSTR) As LPSTR 20 24 21 Declare Function memcmp CDecl Lib "msvcrt"(buf1 As VoidPtr, buf2 As VoidPtr, c As SIZE_T) As Long22 Declare Function memicmp CDecl Lib "msvcrt"Alias "_memicmp" (buf1 As VoidPtr, buf2 As VoidPtr, c As SIZE_T) As Long25 Declare Function memcmp CDecl Lib _CrtDllName (buf1 As VoidPtr, buf2 As VoidPtr, c As SIZE_T) As Long 26 Declare Function memicmp CDecl Lib _CrtDllName Alias "_memicmp" (buf1 As VoidPtr, buf2 As VoidPtr, c As SIZE_T) As Long 23 27 24 28 TypeDef va_list = VoidPtr 25 29 26 Declare Function sprintf CDecl Lib "msvcrt" (buffer As PSTR, format As PCSTR, ...) As Long 27 Declare Function _snprintf CDecl Lib "msvcrt" (buffer As PSTR, count As SIZE_T, format As PCSTR, ...) As Long 28 Declare Function _scprintf CDecl Lib "msvcrt" (format As PCSTR, ...) As Long 29 Declare Function vsprintf CDecl Lib "msvcrt" (buffer As PSTR, format As PCSTR, argptr As va_list) As Long 30 Declare Function _vsnprintf CDecl Lib "msvcrt" (buffer As PSTR, count As SIZE_T, format As PCSTR, argptr As va_list) As Long 31 Declare Function _vscprintf CDecl Lib "msvcrt" (format As PCSTR, argptr As va_list) As Long 30 Declare Function sprintf CDecl Lib _CrtDllName (buffer As PSTR, format As PCSTR, ...) As Long 31 Declare Function _snprintf CDecl Lib _CrtDllName (buffer As PSTR, count As SIZE_T, format As PCSTR, ...) As Long 32 Declare Function _scprintf CDecl Lib _CrtDllName (format As PCSTR, ...) As Long 33 Declare Function vsprintf CDecl Lib _CrtDllName (buffer As PSTR, format As PCSTR, argptr As va_list) As Long 34 Declare Function _vsnprintf CDecl Lib _CrtDllName (buffer As PSTR, count As SIZE_T, format As PCSTR, argptr As va_list) As Long 35 Declare Function _vscprintf CDecl Lib _CrtDllName (format As PCSTR, argptr As va_list) As Long 36 37 Declare Function swprintf CDecl Lib _CrtDllName (buffer As PWSTR, format As PCWSTR, ...) As Long 38 Declare Function _snwprintf CDecl Lib _CrtDllName (buffer As PWSTR, count As SIZE_T, format As PCWSTR, ...) As Long 39 Declare Function _scwprintf CDecl Lib _CrtDllName (format As PCWSTR, ...) As Long 40 Declare Function vswprintf CDecl Lib _CrtDllName (buffer As PWSTR, format As PCWSTR, argptr As va_list) As Long 41 Declare Function _vsnwprintf CDecl Lib _CrtDllName (buffer As PWSTR, count As SIZE_T, format As PCWSTR, argptr As va_list) As Long 42 Declare Function _vscwprintf CDecl Lib _CrtDllName (format As PCWSTR, argptr As va_list) As Long 43 #ifdef UNICODE 44 Declare Function _stprintf CDecl Lib _CrtDllName Alias "swprintf" (buffer As PWSTR, format As PCWSTR, ...) As Long 45 Declare Function _sntprintf CDecl Lib _CrtDllName Alias "_snwprintf" (buffer As PWSTR, count As SIZE_T, format As PCWSTR, ...) As Long 46 Declare Function _sctprintf CDecl Lib _CrtDllName Alias "_scwprintf" (format As PCWSTR, ...) As Long 47 Declare Function _vstprintf CDecl Lib _CrtDllName Alias "vswprintf" (buffer As PWSTR, format As PCWSTR, argptr As va_list) As Long 48 Declare Function _vsntprintf CDecl Lib _CrtDllName Alias "_vsnwprintf" (buffer As PWSTR, count As SIZE_T, format As PCWSTR, argptr As va_list) As Long 49 Declare Function _vsctprintf CDecl Lib _CrtDllName Alias "_vscwprintf" (format As PCWSTR, argptr As va_list) As Long 50 #else 51 Declare Function _stprintf CDecl Lib _CrtDllName Alias "sprintf" (buffer As PSTR, format As PCSTR, ...) As Long 52 Declare Function _sntprintf CDecl Lib _CrtDllName Alias "_snprintf" (buffer As PSTR, count As SIZE_T, format As PCSTR, ...) As Long 53 Declare Function _sctprintf CDecl Lib _CrtDllName Alias "_scprintf" (format As PCSTR, ...) As Long 54 Declare Function _vstprintf CDecl Lib _CrtDllName Alias "vsprintf" (buffer As PSTR, format As PCSTR, argptr As va_list) As Long 55 Declare Function _vsntprintf CDecl Lib _CrtDllName Alias "_vsnprintf" (buffer As PSTR, count As SIZE_T, format As PCSTR, argptr As va_list) As Long 56 Declare Function _vsctprintf CDecl Lib _CrtDllName Alias "_vscprintf" (format As PCSTR, argptr As va_list) As Long 57 #endif 32 58 33 59 #endif '_INC_CRT -
Include/system/string.sbp
r1 r119 5 5 #define _INC_BASIC_STRING 6 6 7 Function StrPtr(buf As * Byte) As *Byte7 Function StrPtr(buf As *Char) As *Char 8 8 StrPtr = buf 9 9 End Function … … 15 15 End Function 16 16 17 Function MakeStr(pBuf As * Byte) As String17 Function MakeStr(pBuf As *Char) As String 18 18 Dim temp As String(pBuf) 19 19 Return temp -
Include/windows.sbp
r74 r119 62 62 TypeDef LPARAM = LONG_PTR 63 63 64 TypeDef TCHAR = Char 64 65 65 TypeDef PSTR = *Byte 66 TypeDef PCSTR = *Byte 66 #ifdef UNICODE 67 TypeDef TBYTE = Char 68 69 TypeDef PSTR = *SByte 70 TypeDef PCSTR = *SByte 71 72 TypeDef PWSTR = *Char 73 TypeDef PCWSTR = *Char 74 75 TypeDef PTSTR = PWSTR 76 TypeDef PCTSTR = PCWSTR 77 #else 78 TypeDef TBYTE = Byte 79 80 TypeDef PSTR = *Char 81 TypeDef PCSTR = *Char 82 83 TypeDef PWSTR = *WCHAR 84 TypeDef PCWSTR = *WCHAR 85 86 TypeDef PTSTR = PSTR 87 TypeDef PCTSTR = PCSTR 88 #endif 89 67 90 TypeDef LPSTR = PSTR 68 91 TypeDef LPCSTR = PCSTR 69 92 70 TypeDef PWSTR = *WCHAR71 TypeDef PCWSTR = *WCHAR72 93 TypeDef LPWSTR = PWSTR 73 94 TypeDef LPCWSTR = PCWSTR 95 96 TypeDef LPTSTR = PTSTR 97 TypeDef LPCTSTR = PCTSTR 74 98 75 99 TypeDef OLECHAR = WCHAR … … 78 102 79 103 TypeDef BSTR = LPOLESTR 104 105 TypeDef UCSCHAR = DWord 106 107 Const UCSCHAR_INVALID_CHARACTER = &hffffffff As UCSCHAR 108 Const MIN_UCSCHAR = 0 As UCSCHAR 109 Const MAX_UCSCHAR = &h0010ffff As UCSCHAR 80 110 81 111 TypeDef LANGID = Word
Note:
See TracChangeset
for help on using the changeset viewer.