Changeset 119


Ignore:
Timestamp:
Feb 23, 2007, 11:00:24 PM (17 years ago)
Author:
イグトランス (egtra)
Message:

Unicode (#50) 前準備
Byte→Char (#51) 型名は殆ど完了、ただし中身までは手を付けていないものが多い

Location:
Include
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • Include/Classes/System/IO/Stream.ab

    r115 r119  
     1
     2#require <Classes/System/misc.ab>
    13
    24Class Stream
    3 Public
     5Public 'Protected
    46    Sub Stream():   End Sub
    57Public
    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
     11Public
     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
    1739
    1840Public
     
    2244    Virtual Function EndRead(ByRef asyncResult As IAsyncResult) As Long:    End Function
    2345    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
    3148
     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
    3266Protected
    3367    Virtual Function CreateWaitHandle() As WaitHandle:  End Function
  • Include/Classes/System/String.ab

    r49 r119  
    22    m_Length As Long
    33Public
    4     Chars As LPSTR
     4    Chars As *Char
    55
    66    Sub String()
     
    99    End Sub
    1010
    11     Sub String(initStr As LPSTR)
     11    Sub String(initStr As *Char)
    1212        String()
    1313        Assign(initStr)
     
    2424    End Sub
    2525*/
    26     Sub String(initChar As Byte, length As Long)
     26    Sub String(initChar As Char, length As Long)
    2727        ReSize(length, initChar)
    2828    End Sub
     
    4040    End Function
    4141
    42     Function Operator() As LPSTR
     42    Function Operator() As *Char
    4343        Return Chars
    4444    End Function
     
    4848    End Sub
    4949
    50     Sub Operator = (text As LPSTR)
     50    Sub Operator = (text As *Char)
    5151        Assign(text)
    5252    End Sub
    5353
    54     Function Operator[] (n As Long) As Byte
     54    Function Operator[] (n As Long) As Char
    5555        Return Chars[n]
    5656    End Function
    5757
    58     Sub Operator[]= (n As Long, c As Byte)
     58    Sub Operator[]= (n As Long, c As Char)
    5959        Chars[n] = c
    6060    End Sub
    6161
    62     Function Operator+ (lpszText As LPSTR) As String
     62    Function Operator+ (lpszText As *Char) As String
    6363        Return Concat(lpszText, lstrlen(lpszText))
    6464    End Function
     
    6868    End Function
    6969
    70     Function Operator& (lpszText As LPSTR) As String
     70    Function Operator& (lpszText As *Char) As String
    7171        Dim tempString As String
    7272        tempString=This+lpszText
     
    8888    End Function
    8989
    90     Function Operator== (lpszText As LPSTR) As Long
     90    Function Operator== (lpszText As *Char) As Long
    9191        If lstrcmp(This, lpszText) = 0 Then
    9292            Return _System_TRUE
     
    100100    End Function
    101101
    102     Function Operator<> (lpszText As LPSTR) As Long
     102    Function Operator<> (lpszText As *Char) As Long
    103103        Return lstrcmp(This, lpszText)
    104104    End Function
     
    112112    End Function
    113113
    114     Function Operator< (lpszText As LPSTR) As Long
     114    Function Operator< (lpszText As *Char) As Long
    115115        If lstrcmp(This, lpszText) < 0 Then
    116116            Return _System_TRUE
     
    128128    End Function
    129129
    130     Function Operator> (lpszText As LPSTR) As Long
     130    Function Operator> (lpszText As *Char) As Long
    131131        If lstrcmp(This, lpszText) > 0 Then
    132132            Return _System_TRUE
     
    144144    End Function
    145145
    146     Function Operator<= (lpszText As LPSTR) As Long
     146    Function Operator<= (lpszText As *Char) As Long
    147147        If lstrcmp(This, lpszText) <= 0 Then
    148148            Return _System_TRUE
     
    160160    End Function
    161161
    162     Function Operator>= (lpszText As LPSTR) As Long
     162    Function Operator>= (lpszText As *Char) As Long
    163163        If lstrcmp(This, lpszText) => 0 Then
    164164            Return _System_TRUE
     
    168168    End Function
    169169
    170     Function StrPtr() As LPSTR
     170    Function StrPtr() As *Char
    171171        Return Chars
    172172    End Function
     
    186186    End Sub
    187187
    188     Sub ReSize(allocLength As Long, c As Byte)
     188    Sub ReSize(allocLength As Long, c As Char)
    189189        If allocLength < 0 Then
    190190            Exit Sub
     
    201201    End Sub
    202202
    203     Sub Assign(lpszText As LPSTR, textLength As Long)
     203    Sub Assign(lpszText As *Char, textLength As Long)
    204204        If lpszText = Chars Then Exit Sub
    205205        If AllocStringBuffer(textLength) <> 0 Then
     
    213213    End Sub
    214214
    215     Sub Assign(lpszText As LPSTR)
     215    Sub Assign(lpszText As *Char)
    216216        If lpszText Then
    217217            Assign(lpszText, lstrlen(lpszText))
     
    223223    End Sub
    224224
    225     Sub Append(lpszText As LPSTR, textLength As Long)
     225    Sub Append(lpszText As *Char, textLength As Long)
    226226        Dim prevLen As Long
    227227        prevLen = m_Length
     
    232232    End Sub
    233233
    234     Sub Append(text As LPSTR)
     234    Sub Append(text As *Char)
    235235        Append(text, lstrlen(text))
    236236    End Sub
     
    240240    End Sub
    241241
    242     Function Concat(lpszText As LPSTR, textLength As Long) As String
     242    Function Concat(lpszText As *Char, textLength As Long) As String
    243243        Dim tempString As String
    244244        With tempString
     
    259259    End Function
    260260
    261     Function Contains(lpszText As LPSTR) As BOOL
     261    Function Contains(lpszText As *Char) As BOOL
    262262        If IndexOf(lpszText, 0, m_Length) >= 0 Then
    263263            Return _System_TRUE
     
    267267    End Function
    268268
    269     Function IndexOf(lpszText As LPSTR) As Long
     269    Function IndexOf(lpszText As *Char) As Long
    270270        Return IndexOf(lpszText, 0, m_Length)
    271271    End Function
    272272
    273     Function IndexOf(lpszText As LPSTR, startIndex As Long) As Long
     273    Function IndexOf(lpszText As *Char, startIndex As Long) As Long
    274274        Return IndexOf(lpszText, startIndex, m_Length - startIndex)
    275275    End Function
    276276
    277     Function IndexOf(lpszText As LPSTR, startIndex As Long, count As Long) As Long
     277    Function IndexOf(lpszText As *Char, startIndex As Long, count As Long) As Long
    278278        Dim length As Long
    279279        length = lstrlen(lpszText)
     
    298298    End Function
    299299
    300     Function LastIndexOf(lpszText As LPSTR) As Long
     300    Function LastIndexOf(lpszText As *Char) As Long
    301301        Return LastIndexOf(lpszText, m_Length - 1, m_Length)
    302302    End Function
    303303
    304     Function LastIndexOf(lpszText As LPSTR, startIndex As Long) As Long
    305         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 Long
     304    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
    309309        Dim length As Long
    310310        length = lstrlen(lpszText)
     
    329329    End Function
    330330
    331     Function StartsWith(lpszText As LPSTR) As BOOL
     331    Function StartsWith(lpszText As *Char) As BOOL
    332332        If IndexOf(lpszText) = 0 Then
    333333            Return _System_TRUE
     
    337337    End Function
    338338
    339     Function EndsWith(lpszText As LPSTR) As BOOL
     339    Function EndsWith(lpszText As *Char) As BOOL
    340340        If LastIndexOf(lpszText) = m_Length - lstrlen(lpszText) Then
    341341            Return _System_TRUE
     
    345345    End Function
    346346
    347     Function Insert(startIndex As Long, lpszText As LPSTR) As Long
     347    Function Insert(startIndex As Long, lpszText As *Char) As Long
    348348        Dim length As Long
    349349        length = lstrlen(lpszText)
     
    351351        If startIndex < 0 Or startIndex > m_Length Then Return -1
    352352
    353         Dim newChars As LPSTR
     353        Dim newChars As *Char
    354354        newChars = _System_malloc(length + m_Length + 1)
    355355        If newChars = 0 Then Return -1
     
    391391        If startIndex + count > m_Length Then Return -1
    392392
    393         Dim newChars As LPSTR
     393        Dim newChars As *Char
    394394        newChars = _System_malloc(m_Length - count + 1)
    395395        If newChars = 0 Then Return -1
     
    413413    End Function
    414414
    415     Sub Replace(oldChar As Byte, newChar As Byte)
     415
     416    Sub Replace(oldChar As Char, newChar As Char)
    416417        Dim i As Long
    417418        For i = 0 To ELM(m_Length)
     
    468469    End Sub
    469470
     471    Override Function ToString() As String
     472        Return This
     473    End Function
     474
    470475Private
    471476    ' メモリ確保に失敗すると元の文字列は失われない。(例外安全でいう強い保障)
    472     Function AllocStringBuffer(textLength As Long) As LPSTR
     477    Function AllocStringBuffer(textLength As Long) As *Char
    473478        If textLength < 0 Then
    474479            Return 0
  • Include/Classes/System/Threading/WaitHandle.ab

    r77 r119  
    2121
    2222    Virtual Sub ~WaitHandle()
    23         Close()
     23        CloseHandle(h)
    2424    End Sub
    2525
     
    7070            ExitThread(0)
    7171        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)
    7373    End Function
    7474
  • Include/GdiPlus.ab

    r13 r119  
    33#ifndef GDIPLUS_AB
    44#define GDIPLUS_AB
    5 
    6 TypeDef PDirectDrawSurface7 = VoidPtr '*IDirectDrawSurface7
    75
    86Declare Function GdipAlloc Lib "Gdiplus.dll" (size As SIZE_T) As VoidPtr
  • Include/GdiPlusFlat.ab

    r33 r119  
    33#ifndef __GDIPLUS_FLATAPI_AB__
    44#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
     13TypeDef PDirectDrawSurface7 = VoidPtr '*IDirectDrawSurface7
    514
    615' GraphicsPath APIs
  • Include/GdiPlusGpStubs.ab

    r33 r119  
    44#define __GDIPLUSGPSTUBS_AB__
    55
    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>
    710
    811Class GpGraphics
     
    7578TypeDef GpFillMode = FillMode
    7679TypeDef GpWrapMode = WrapMode
    77 TypeDef GpUnit = Unit
     80TypeDef GpUnit = GraphicsUnit
    7881TypeDef GpCoordinateSpace = CoordinateSpace
    7982TypeDef GpPointF = PointF
  • Include/api_console.sbp

    r1 r119  
    1414Const BACKGROUND_INTENSITY = &H0080
    1515
     16Type COORD
     17    X As Integer
     18    Y As Integer
     19End Type
    1620
    17 Declare Function AllocConsole Lib "kernel32" () As Long
    18 Declare Function FreeConsole Lib "kernel32" () As Long
    1921
    20 Declare Function SetConsoleCursorPosition Lib "kernel32" (hConsoleOutput As HANDLE, dwCursorPosition As DWord) As Long
     22Declare Function AllocConsole Lib "kernel32" () As BOOL
     23Declare Function FreeConsole Lib "kernel32" () As BOOL
     24
     25Declare Function SetConsoleCursorPosition Lib "kernel32" (hConsoleOutput As HANDLE, dwCursorPosition As DWord) As BOOL
    2126
    2227Declare 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  
    484484    lfFaceName[ELM(LF_FACESIZE)] As WCHAR
    485485End Type
     486#ifdef UNICODE
     487TypeDef LOGFONT = LOGFONTW
     488#else
    486489TypeDef LOGFONT = LOGFONTA
     490#endif
    487491Declare Function CreateFontIndirect Lib "gdi32" Alias "CreateFontIndirectA" (ByRef lplf As LOGFONT) As HFONT
    488492
     
    730734
    731735Declare 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
     736Declare Function GetTextExtentPoint32A Lib "gdi32" (hdc As HDC, pString As PCSTR, cbString As Long, ByRef Size As SIZE) As Long
     737Declare Function GetTextExtentPoint32W Lib "gdi32" (hdc As HDC, pString As PCWSTR, cbString As Long, ByRef Size As SIZE) As Long
     738#ifdef UNICODE
     739Declare Function GetTextExtentPoint32 Lib "gdi32" Alias "GetTextExtentPoint32W" (hdc As HDC, pString As PCTSTR, cbString As Long, ByRef Size As SIZE) As Long
     740#else
     741Declare Function GetTextExtentPoint32 Lib "gdi32" Alias "GetTextExtentPoint32A" (hdc As HDC, pString As PCTSTR, cbString As Long, ByRef Size As SIZE) As Long
     742#endif
    733743
    734744Const TMPF_FIXED_PITCH = &H01
     
    836846Declare Function StrokeAndFillPath Lib "gdi32" (hdc As HDC) As Long
    837847Declare 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 
     848Declare Function TextOutA Lib "gdi32" (hdc As HDC, nXStart As Long, nYStart As Long, pString As PCSTR, cbString As Long) As Long
     849Declare Function TextOutW Lib "gdi32" (hdc As HDC, nXStart As Long, nYStart As Long, pString As PCWSTR, cbString As Long) As Long
     850#ifdef UNICODE
     851Declare 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
     853Declare 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
    840855
    841856/* Pixel Format */
  • Include/api_imm.sbp

    r1 r119  
    2020
    2121Declare Function ImmDisableIME Lib "imm32" (idThread As DWord) As BOOL
    22 
     22#ifdef UNICODE
    2323Declare Function ImmGetCompositionString Lib "imm32" Alias "ImmGetCompositionStringA" (hIMC As HIMC, dwIndex As DWord, pBuf As VoidPtr, dwBufLen As DWord) As Long
     24#else
     25Declare Function ImmGetCompositionString Lib "imm32" Alias "ImmGetCompositionStringA" (hIMC As HIMC, dwIndex As DWord, pBuf As VoidPtr, dwBufLen As DWord) As Long
     26#endif
    2427Declare Function ImmGetCompositionStringA Lib "imm32" (hIMC As HIMC, dwIndex As DWord, pBuf As VoidPtr, dwBufLen As DWord) As Long
    2528Declare Function ImmGetCompositionStringW Lib "imm32" (hIMC As HIMC, dwIndex As DWord, pBuf As VoidPtr, dwBufLen As DWord) As Long
     29
     30#ifdef UNICODE
     31Declare Function ImmGetCompositionFont Lib "imm32" Alias "ImmSetCompositionFontW" (hIMC As HIMC, ByRef lf As LOGFONT) As BOOL
     32#else
    2633Declare 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
     35Declare Function ImmGetCompositionFontA Lib "imm32" (hIMC As HIMC, ByRef lf As LOGFONTA) As BOOL
     36Declare Function ImmGetCompositionFontW Lib "imm32" (hIMC As HIMC, ByRef lf As LOGFONTW) As BOOL
    2937Declare Function ImmGetCompositionWindow Lib "imm32" (hIMC As HIMC, ByRef CompForm As COMPOSITIONFORM) As BOOL
    3038
     39#ifdef UNICODE
     40Declare Function ImmSetCompositionFont Lib "imm32" Alias "ImmSetCompositionFontW" (hIMC As HIMC, ByRef lplf As LOGFONT) As Long
     41#else
    3142Declare 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
     44Declare Function ImmSetCompositionFontA Lib "imm32" (hIMC As HIMC, ByRef lplf As LOGFONTA) As Long
     45Declare Function ImmSetCompositionFontW Lib "imm32" (hIMC As HIMC, ByRef lplf As LOGFONTW) As Long
    3446Declare Function ImmSetCompositionWindow Lib "imm32" (hIMC As HIMC, ByRef CompForm As COMPOSITIONFORM) As BOOL
    3547
  • Include/api_system.sbp

    r68 r119  
    779779Declare Function lstrcmpi Lib "kernel32" Alias "lstrcmpiA" (lpString1 As BytePtr, lpString2 As BytePtr) As Long
    780780Declare 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
     781Declare Function lstrlenA Lib "kernel32" (lpString As LPSTR) As Long
     782Declare Function lstrlenW Lib "kernel32" (lpString As LPWSTR) As Long
     783#ifdef UNICODE
     784Declare Function lstrlen Lib "kernel32" Alias "lstrlenA" (lpString As *Char) As Long
     785#else
     786Declare Function lstrlen Lib "kernel32" Alias "lstrlenA" (lpString As *Char) As Long
     787#endif
    782788Declare Sub memcpy Lib "kernel32" Alias "RtlMoveMemory" (pDest As VoidPtr, pSrc As VoidPtr, length As SIZE_T)
    783789Declare Function MoveFile Lib "kernel32" Alias "MoveFileA" (lpExistingFileName As BytePtr, lpNewFileName As BytePtr) As BOOL
  • Include/api_window.sbp

    r77 r119  
    200200Const CF_GDIOBJLAST =      &H03FF
    201201
     202'-------------
     203' Window API Function Names
     204
     205/*
     206CreateWindowEx
     207CallWindowProc
     208DefWindowProc
     209DispatchMessage
     210DrawText
     211DrawTextEx
     212FindWindow
     213FindWindowEx
     214GetClassInfoEx
     215GetClassLong
     216GetClassLongPtr
     217GetClassName
     218GetClipboardFormatName
     219GetDlgItemText
     220GetMenuItemInfo
     221GetMessage
     222GetWindowLong
     223GetWindowLongPtr
     224GetWindowText
     225GetWindowTextLength
     226InsertMenuItem
     227IsCharAlpha
     228IsCharAlphaNumeric
     229IsDialogMessage
     230LoadBitmap
     231LoadCursor
     232LoadCursorFromFile
     233LoadIcon
     234LoadImage
     235PeekMessage
     236PostMessage
     237PostThreadMessage
     238RegisterClassEx
     239RegisterClipboardFormat
     240RegisterWindowMessage
     241RemoveProp
     242SendDlgItemMessage
     243SendMessage
     244SendNotifyMessage
     245SetDlgItemText
     246SetClassLong
     247SetClassLong
     248SetMenuItemInfo
     249SetWindowLong
     250SetWindowLongPtr
     251SetWindowText
     252SystemParametersInfo
     253UnregisterClass
     254wsprintf
     255wvsprintf
     256*/
    202257
    203258'-------------
     
    761816Const MB_RIGHT =                  &H00080000
    762817Const 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
     819Declare Function MessageBox Lib "user32" Alias "MessageBoxW" (hWnd As HWND, pText As PCWSTR, pCaption As PCWSTR, uType As DWord) As Long
     820#else
     821Declare Function MessageBox Lib "user32" Alias "MessageBoxA" (hWnd As HWND, pText As PCSTR, pCaption As PCSTR, uType As DWord) As Long
     822#endif
     823Declare Function MessageBoxW Lib "user32" (hWnd As HWND, pText As PCWSTR, pCaption As PCWSTR, uType As DWord) As Long
     824Declare Function MessageBoxA Lib "user32" (hWnd As HWND, pText As PCSTR, pCaption As PCSTR, uType As DWord) As Long
    765825Const MOUSEEVENTF_MOVE =       &H0001
    766826Const MOUSEEVENTF_LEFTDOWN =   &H0002
  • Include/basic/command.sbp

    r110 r119  
    66
    77
    8 Const _System_Type_Char = 1
     8Const _System_Type_SByte = 1
    99Const _System_Type_Byte = 2
    1010Const _System_Type_Integer = 3
     
    1616Const _System_Type_Single = 9
    1717Const _System_Type_Double = 10
    18 Const _System_Type_String = 11
     18Const _System_Type_Char =   11
     19Const _System_Type_String = 13
     20Const _System_Type_VoidPtr =    14
    1921Const _System_MAX_PARMSNUM = 32-1
    2022
  • Include/basic/function.sbp

    r110 r119  
    514514    End If
    515515End Sub
    516 Function _ecvt(value As Double, count As Long, ByRef dec As Long, ByRef sign As Long) As BytePtr
    517     Dim temp As BytePtr
     516Function _ecvt(value As Double, count As Long, ByRef dec As Long, ByRef sign As Long) As *Char
     517    Dim temp As *Char
    518518    Dim i As Long, i2 As Long
    519519
     
    540540    dec=1
    541541    While value<0.999999999999999  'value<1
    542         value=value*10
    543         dec=dec-1
     542        value *= 10
     543        dec--
    544544    Wend
    545545    While 9.99999999999999<=value  '10<=value
    546         value=value/10
    547         dec=dec+1
     546        value /= 10
     547        dec++
    548548    Wend
    549549
     
    555555    _System_ecvt_buffer[i]=0
    556556
    557     i=i-1
     557    i--
    558558    If value>=5 Then
    559559        '切り上げ処理
     
    562562
    563563    For i=0 To count-1
    564         _System_ecvt_buffer[i]=_System_ecvt_buffer[i]+&H30
     564        _System_ecvt_buffer[i] += &H30
    565565    Next
    566566    _System_ecvt_buffer[i]=0
     
    713713End Function
    714714
    715 Function Val(buf As BytePtr) As Double
     715Function Val(buf As *Char) As Double
    716716    Dim i As Long, i2 As Long, i3 As Long, i4 As Long
    717717    Dim temporary As String
    718     Dim TempPtr As BytePtr
     718    Dim TempPtr As *Char
    719719    Dim dbl As Double
    720720    Dim i64data As Int64
     
    10241024End Function
    10251025
     1026Function _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
     1033End Function
    10261034
    10271035#endif '_INC_FUNCTION
  • Include/basic/prompt.sbp

    r110 r119  
    9999
    100100                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
    101104                If IsDBCSLeadByte(temporary[0]) Then
     105#endif
    102106                    temporary[1]=_PromptSys_Buffer[i][i2+1]
    103107                    temporary[2]=0
     108                    i2++
    104109                Else
    105110                    temporary[1]=0
     
    107112                TextOut(hDC,i2*_PromptSys_FontSize.cx,i*_PromptSys_FontSize.cy,_
    108113                    temporary,lstrlen(temporary))
    109 
    110                 If IsDBCSLeadByte(temporary[0]) Then i2++
    111114            Next
    112115        End If
     
    172175    Dim CompForm As COMPOSITIONFORM
    173176    Dim hGlobal As HGLOBAL
    174     Dim pTemp As BytePtr
    175177
    176178    Select Case message
     
    246248                    hGlobal=GetClipboardData(CF_TEXT)
    247249                    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
    250256                    TempStr=ZeroString(lstrlen(pTemp)+1)
    251257                    lstrcpy(StrPtr(TempStr),pTemp)
    252 
     258#endif
    253259                    lstrcpy((VarPtr(_PromptSys_InputStr[0])+_PromptSys_InputLen) As *Byte,pTemp)
    254260                    _PromptSys_InputLen=_PromptSys_InputLen+lstrlen(pTemp)
     
    337343    _PromptSys_hWnd=CreateWindowEx(WS_EX_CLIENTEDGE,"PROMPT","BASIC PROMPT",WS_OVERLAPPEDWINDOW,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,0,0,GetModuleHandle(0),0)
    338344    ShowWindow(_PromptSys_hWnd,SW_SHOW)
     345    UpdateWindow(_PromptSys_hWnd)
    339346
    340347    Dim msg As MSG, iResult As Long
     
    455462            Case _System_Type_Integer,_System_Type_Word
    456463                SetWord(_System_InputDataPtr[i],Val(buf))
    457             Case _System_Type_Char,_System_Type_Byte
     464            Case _System_Type_SByte,_System_Type_Byte
    458465                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
    460472            Case _System_Type_String
     473            *INPUT_FromPrompt_Type_String
    461474                Dim pTempStr As *String
    462475                pTempStr=_System_InputDataPtr[i] As *String
     
    464477                memcpy(pTempStr->Chars, buf.Chars, pTempStr->Length)
    465478                pTempStr->Chars[pTempStr->Length] = 0
     479            Case 13
     480                Goto *INPUT_FromPrompt_Type_String
    466481        End Select
    467482
  • Include/crt.sbp

    r86 r119  
    44#define _INC_CRT
    55
    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
     7Const _CrtDllName = "msvcrt"
     8#endif
     9
     10Declare Function _beginthread cdecl Lib _CrtDllName (start_address As VoidPtr, stack_size As DWord, arglist As VoidPtr) As HANDLE
     11Declare Function _beginthreadex cdecl Lib _CrtDllName (
    812    security As *SECURITY_ATTRIBUTES,
    913    stack_size As DWord,
     
    1216    initflag As DWord,
    1317    ByRef thrdaddr As DWord) As HANDLE
    14 Declare Sub _endthread cdecl Lib "msvcrt" ()
    15 Declare Sub _endthreadex cdecl Lib "msvcrt" (retval As DWord)
     18Declare Sub _endthread cdecl Lib _CrtDllName ()
     19Declare Sub _endthreadex cdecl Lib _CrtDllName (retval As DWord)
    1620
    17 Declare Function strstr cdecl Lib "msvcrt" (s1 As LPSTR, s2 As LPSTR) As LPSTR
    18 Declare Function memmove cdecl Lib "msvcrt" (dest As VoidPtr, src As VoidPtr, count As SIZE_T) As VoidPtr
    19 Declare Function _mbsstr cdecl Lib "msvcrt" (s1 As LPSTR, s2 As LPSTR) As LPSTR
     21Declare Function strstr cdecl Lib _CrtDllName (s1 As LPSTR, s2 As LPSTR) As LPSTR
     22Declare Function memmove cdecl Lib _CrtDllName (dest As VoidPtr, src As VoidPtr, count As SIZE_T) As VoidPtr
     23Declare Function _mbsstr cdecl Lib _CrtDllName (s1 As LPSTR, s2 As LPSTR) As LPSTR
    2024
    21 Declare Function memcmp CDecl Lib "msvcrt" (buf1 As VoidPtr, buf2 As VoidPtr, c As SIZE_T) As Long
    22 Declare Function memicmp CDecl Lib "msvcrt" Alias "_memicmp" (buf1 As VoidPtr, buf2 As VoidPtr, c As SIZE_T) As Long
     25Declare Function memcmp CDecl Lib _CrtDllName (buf1 As VoidPtr, buf2 As VoidPtr, c As SIZE_T) As Long
     26Declare Function memicmp CDecl Lib _CrtDllName Alias "_memicmp" (buf1 As VoidPtr, buf2 As VoidPtr, c As SIZE_T) As Long
    2327
    2428TypeDef va_list = VoidPtr
    2529
    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
     30Declare Function sprintf CDecl Lib _CrtDllName (buffer As PSTR, format As PCSTR, ...) As Long
     31Declare Function _snprintf CDecl Lib _CrtDllName (buffer As PSTR, count As SIZE_T, format As PCSTR, ...) As Long
     32Declare Function _scprintf CDecl Lib _CrtDllName (format As PCSTR, ...) As Long
     33Declare Function vsprintf CDecl Lib _CrtDllName (buffer As PSTR, format As PCSTR, argptr As va_list) As Long
     34Declare Function _vsnprintf CDecl Lib _CrtDllName (buffer As PSTR, count As SIZE_T, format As PCSTR, argptr As va_list) As Long
     35Declare Function _vscprintf CDecl Lib _CrtDllName (format As PCSTR, argptr As va_list) As Long
     36
     37Declare Function swprintf CDecl Lib _CrtDllName (buffer As PWSTR, format As PCWSTR, ...) As Long
     38Declare Function _snwprintf CDecl Lib _CrtDllName (buffer As PWSTR, count As SIZE_T, format As PCWSTR, ...) As Long
     39Declare Function _scwprintf CDecl Lib _CrtDllName (format As PCWSTR, ...) As Long
     40Declare Function vswprintf CDecl Lib _CrtDllName (buffer As PWSTR, format As PCWSTR, argptr As va_list) As Long
     41Declare Function _vsnwprintf CDecl Lib _CrtDllName (buffer As PWSTR, count As SIZE_T, format As PCWSTR, argptr As va_list) As Long
     42Declare Function _vscwprintf CDecl Lib _CrtDllName (format As PCWSTR, argptr As va_list) As Long
     43#ifdef UNICODE
     44Declare Function _stprintf CDecl Lib _CrtDllName Alias "swprintf" (buffer As PWSTR, format As PCWSTR, ...) As Long
     45Declare Function _sntprintf CDecl Lib _CrtDllName Alias "_snwprintf" (buffer As PWSTR, count As SIZE_T, format As PCWSTR, ...) As Long
     46Declare Function _sctprintf CDecl Lib _CrtDllName Alias "_scwprintf" (format As PCWSTR, ...) As Long
     47Declare Function _vstprintf CDecl Lib _CrtDllName Alias "vswprintf" (buffer As PWSTR, format As PCWSTR, argptr As va_list) As Long
     48Declare Function _vsntprintf CDecl Lib _CrtDllName Alias "_vsnwprintf" (buffer As PWSTR, count As SIZE_T, format As PCWSTR, argptr As va_list) As Long
     49Declare Function _vsctprintf CDecl Lib _CrtDllName Alias "_vscwprintf" (format As PCWSTR, argptr As va_list) As Long
     50#else
     51Declare Function _stprintf CDecl Lib _CrtDllName Alias "sprintf" (buffer As PSTR, format As PCSTR, ...) As Long
     52Declare Function _sntprintf CDecl Lib _CrtDllName Alias "_snprintf" (buffer As PSTR, count As SIZE_T, format As PCSTR, ...) As Long
     53Declare Function _sctprintf CDecl Lib _CrtDllName Alias "_scprintf" (format As PCSTR, ...) As Long
     54Declare Function _vstprintf CDecl Lib _CrtDllName Alias "vsprintf" (buffer As PSTR, format As PCSTR, argptr As va_list) As Long
     55Declare Function _vsntprintf CDecl Lib _CrtDllName Alias "_vsnprintf" (buffer As PSTR, count As SIZE_T, format As PCSTR, argptr As va_list) As Long
     56Declare Function _vsctprintf CDecl Lib _CrtDllName Alias "_vscprintf" (format As PCSTR, argptr As va_list) As Long
     57#endif
    3258
    3359#endif '_INC_CRT
  • Include/system/string.sbp

    r1 r119  
    55#define _INC_BASIC_STRING
    66
    7 Function StrPtr(buf As *Byte) As *Byte
     7Function StrPtr(buf As *Char) As *Char
    88    StrPtr = buf
    99End Function
     
    1515End Function
    1616
    17 Function MakeStr(pBuf As *Byte) As String
     17Function MakeStr(pBuf As *Char) As String
    1818    Dim temp As String(pBuf)
    1919    Return temp
  • Include/windows.sbp

    r74 r119  
    6262TypeDef LPARAM = LONG_PTR
    6363
     64TypeDef TCHAR = Char
    6465
    65 TypeDef PSTR = *Byte
    66 TypeDef PCSTR = *Byte
     66#ifdef UNICODE
     67TypeDef TBYTE = Char
     68
     69TypeDef PSTR = *SByte
     70TypeDef PCSTR = *SByte
     71
     72TypeDef PWSTR = *Char
     73TypeDef PCWSTR = *Char
     74
     75TypeDef PTSTR = PWSTR
     76TypeDef PCTSTR = PCWSTR
     77#else
     78TypeDef TBYTE = Byte
     79
     80TypeDef PSTR = *Char
     81TypeDef PCSTR = *Char
     82
     83TypeDef PWSTR = *WCHAR
     84TypeDef PCWSTR = *WCHAR
     85
     86TypeDef PTSTR = PSTR
     87TypeDef PCTSTR = PCSTR
     88#endif
     89
    6790TypeDef LPSTR = PSTR
    6891TypeDef LPCSTR = PCSTR
    6992
    70 TypeDef PWSTR = *WCHAR
    71 TypeDef PCWSTR = *WCHAR
    7293TypeDef LPWSTR = PWSTR
    7394TypeDef LPCWSTR = PCWSTR
     95
     96TypeDef LPTSTR = PTSTR
     97TypeDef LPCTSTR = PCTSTR
    7498
    7599TypeDef OLECHAR = WCHAR
     
    78102
    79103TypeDef BSTR = LPOLESTR
     104
     105TypeDef UCSCHAR = DWord
     106
     107Const UCSCHAR_INVALID_CHARACTER = &hffffffff As UCSCHAR
     108Const MIN_UCSCHAR = 0 As UCSCHAR
     109Const MAX_UCSCHAR = &h0010ffff As UCSCHAR
    80110
    81111TypeDef LANGID = Word
Note: See TracChangeset for help on using the changeset viewer.