Changeset 137


Ignore:
Timestamp:
Mar 7, 2007, 5:36:31 PM (17 years ago)
Author:
イグトランス (egtra)
Message:

#55#73#75とりあえず完了

Location:
Include
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • Include/Classes/System/Drawing/Font.ab

    r104 r137  
    33
    44#require <GdiPlus.ab>
     5#require <Classes/System/Drawing/misc.ab>
    56#require <Classes/System/Drawing/Graphics.ab>
    67
     
    6465    End Sub
    6566
    66     Sub Font(/*IN const*/ familyName As *WCHAR, /*IN*/ emSize As Single)
    67         Font(familyName, emSize, FontStyleRegular, UnitPoint, ByVal 0)
    68     End Sub
    69 
    70     Sub Font(/*IN const*/ familyName As *WCHAR, /*IN*/ emSize As Single,
     67    Sub Font(/*IN const*/ familyName As PCWSTR, /*IN*/ emSize As Single)
     68        Font(familyName, emSize, FontStyleRegular, Unit.Point, ByVal 0)
     69    End Sub
     70
     71    Sub Font(/*IN const*/ familyName As String, /*IN*/ emSize As Single)
     72        Font(familyName, emSize, FontStyleRegular, Unit.Point, ByVal 0)
     73    End Sub
     74
     75    Sub Font(/*IN const*/ familyName As PCWSTR, /*IN*/ emSize As Single,
    7176         /*IN*/ style As Long)
    72         Font(familyName, emSize, style, UnitPoint, ByVal 0)
    73     End Sub
    74 
    75     Sub Font(/*IN const*/ familyName As *WCHAR, /*IN*/ emSize As Single,
     77        Font(familyName, emSize, style, Unit.Point, ByVal 0)
     78    End Sub
     79
     80    Sub Font(/*IN const*/ familyName As String, /*IN*/ emSize As Single,
     81         /*IN*/ style As Long)
     82        Font(familyName, emSize, style, Unit.Point, ByVal 0)
     83    End Sub
     84
     85    Sub Font(/*IN const*/ familyName As PCWSTR, /*IN*/ emSize As Single,
    7686         /*IN*/ style As Long, /*IN*/ unit As GraphicsUnit)
    7787        Font(familyName, emSize, style, unit, ByVal 0)
    7888    End Sub
    7989
    80     Sub Font(/*IN const*/ familyName As *WCHAR, /*IN*/ emSize As Single,
     90    Sub Font(/*IN const*/ familyName As String, /*IN*/ emSize As Single,
     91         /*IN*/ style As Long, /*IN*/ unit As GraphicsUnit)
     92        Font(familyName, emSize, style, unit, ByVal 0)
     93    End Sub
     94
     95    Sub Font(/*IN const*/ familyName As PCWSTR, /*IN*/ emSize As Single,
    8196        /*IN*/ style As Long, /*IN*/ unit As GraphicsUnit,
    8297        /*IN const*/ ByRef fontCollection As FontCollection)
     
    112127    End Sub
    113128
     129    Sub Font(/*IN const*/ familyName As String, /*IN*/ emSize As Single,
     130        /*IN*/ style As Long, /*IN*/ unit As GraphicsUnit,
     131        /*IN const*/ ByRef fontCollection As FontCollection)
     132#ifdef __STRING_IS_NOT_UNICODE
     133        Dim name = _System_MultiByteToWideChar(familyName)
     134        Font(name, emSize, style, unit, fontCollection)
     135        _System_free(name)
     136#else
     137        Font(familyName.Chars, emSize, style, unit, fontCollection)
     138#endif
     139    End Sub
     140
    114141    Const Function GetLogFontA(/*IN const*/ ByRef g As Graphics, /*OUT*/ ByRef lf As LOGFONTA) As Status
    115142        Dim nativeGraphics As *GpGraphics
     
    128155    End Function
    129156
     157    Const Function GetLogFont(/*IN const*/ ByRef g As Graphics, /*OUT*/ ByRef lf As LOGFONTA) As Status
     158        Dim nativeGraphics As *GpGraphics
     159        If VarPtr(g) <> 0 Then
     160            nativeGraphics = g.nativeGraphics
     161        End If
     162#ifdef UNICODE
     163        Return SetStatus(GdipGetLogFontW(nativeFont, nativeGraphics, lf))
     164#else
     165        Return SetStatus(GdipGetLogFontA(nativeFont, nativeGraphics, lf))
     166#endif
     167    End Function
     168
    130169    Const Function Clone() As *Font
    131170        Dim cloneFont = 0 As *GpFont
     
    138177    End Sub
    139178
    140     Const Function IsAvailable() As BOOL
     179    Const Function IsAvailable() As Boolean
    141180        Return nativeFont <> 0
    142181    End Function
     
    150189    End Function
    151190
     191    Const Function SizeInPoints() As Single
     192
    152193    Const Function Unit() As GraphicsUnit
    153194        SetStatus(GdipGetFontUnit(nativeFont, Unit))
     
    158199    End Function
    159200
    160     Const Function Height() As Single
    161         Return GetHeight()
     201    Const Function Height() As Long
     202        Return GetHeight() As Long
    162203    End Function
    163204
     
    187228'   End Function
    188229
     230    Const Function Bold() As Boolean
     231        Dim lf As LOGFONT
     232        GetLogFont(0, lf)
     233        Return lf.lfWeight > FW_BOLD
     234    End Function
     235
     236    Const Function GdiCharSet() As Byte
     237        Dim lf As LOGFONT
     238        GetLogFont(0, lf)
     239        Return lf.lfCharSet
     240    End Function
     241
     242    'Const Function GdiVerticalFont() As Boolean
     243
    189244    Const Function NativeFont() As *GpFont
    190245        Return nativeFont
    191246    End Function
     247
     248    'Const Function IsSystemFont() As Boolean
     249
     250    Const Function Italic() As Boolean
     251        Dim lf As LOGFONT
     252        GetLogFont(0, lf)
     253        Return lf.lfItalic <> FALSE
     254    End Function
     255
     256    Const Function Name() As String
     257#ifdef __STRING_IS_NOT_UNICODE
     258        Dim lf As LOGFONTA
     259        GetLogFontA(0, lf)
     260#else
     261        Dim lf As LOGFONTW
     262        GetLogFontW(0, lf)
     263#endif
     264        Return lf.lfFaceName
     265    End Function
     266
     267    'Const Function SizeInPoint() As Boolean
     268
     269    Const Function NativeFont() As *GpFont
     270        Return nativeFont
     271    End Function
     272
     273    Const Function StrikeOut() As Boolean
     274        Dim lf As LOGFONT
     275        GetLogFont(0, lf)
     276        Return lf.fdwStrikeOut <> FALSE
     277    End Function
     278
     279    Const Function Style() As FontStyle
     280        Dim lf As LOGFONT
     281        GetLogFont(0, lf)
     282        Return (((lf.lfWeight > FW_BOLD) And FontStyle.Bold) Or _
     283            ((lf.lfItatlic <> FALSE) And FontStyle.Italic) Or _
     284            ((lf.fdwStrikeOut <> FALSE) And FontStyle.Strickeout) Or _
     285            ((lf.fdwUnderline <> FALSE) And FontStyle.Underline)) As FontStyle
     286    End Function
     287       
     288    'Const Function SystemFontName() As String
     289
     290    Const Function Underline() As Boolean
     291        Dim lf As LOGFONT
     292        GetLogFont(0, lf)
     293        Return lf.fdwUnderline <> FALSE
     294    End Function
     295
     296    Override Function ToString() As String
     297        Return Name
     298    End Function
     299
     300    Const Function ToHfont() As HFONT
     301        Dim lf As LOGFONT
     302        GetLogFont(ByVal 0, lf)
     303        Return CreateFontIndirect(lf)
     304    End Function
     305
     306    Const Sub ToLogFont(ByRef lf As LOGFONT)
     307        GetLogFont(ByVal 0, lf)
     308    End Sub
     309
     310    Const Sub ToLogFont(ByRef lf As LOGFONT, ByRef g As Graphics)
     311        GetLogFont(g, lf)
     312    End Sub
     313
    192314
    193315Private
  • Include/Classes/System/Drawing/misc.ab

    r104 r137  
    3636End Enum
    3737
     38Enum FontStyle
     39    Regular = 0
     40    Bold = 1
     41    Italic = 2
     42    Strikeout = 4
     43    Underline  = 8
     44End Enum
     45
     46
    3847#endif '__SYSTEM_DRAWING_MISC_AB__
  • Include/OAIdl.ab

    r77 r137  
    14011401    Function /* [local] */ GetContainingTypeLib(
    14021402        /* [out] */ ByRef pTLib As *ITypeLib,
    1403         /* [out] */ ByRef Index As UINT) As HRESULT
    1404 
    1405     Function /* [local] */ void STDMETHODCALLTYPE ReleaseTypeAttr(
    1406         /* [in] */ pTypeAttr As *TYPEATTR) As HRESULT
    1407 
    1408     Function /* [local] */ void STDMETHODCALLTYPE ReleaseFuncDesc(
    1409         /* [in] */ pFuncDesc As *FUNCDESC) As HRESULT
    1410 
    1411     Function /* [local] */ void STDMETHODCALLTYPE ReleaseVarDesc(
    1412         /* [in] */ pVarDesc As *VARDESC) As HRESULT
     1403        /* [out] */ ByRef Index As DWord) As HRESULT
     1404
     1405    Sub /* [local] */ ReleaseTypeAttr(
     1406        /* [in] */ pTypeAttr As *TYPEATTR)
     1407
     1408    Sub /* [local] */ ReleaseFuncDesc(
     1409        /* [in] */ pFuncDesc As *FUNCDESC)
     1410
     1411    Sub /* [local] */ ReleaseVarDesc(
     1412        /* [in] */ pVarDesc As *VARDESC)
    14131413End Interface
    14141414
     
    14521452        /* [out] */ ByRef VarVal As VARIANT) As HRESULT
    14531453    Function GetVarCustData(
    1454         /* [in] */ UINT index,
     1454        /* [in] */ index As DWord,
    14551455        /* [in] */ ByRef guid As GUID,
    14561456        /* [out] */ ByRef VarVal As VARIANT) As HRESULT
    14571457    Function GetImplTypeCustData(
    1458         /* [in] */ UINT index,
     1458        /* [in] */ index As DWord,
    14591459        /* [in] */ ByRef guid As GUID,
    14601460        /* [out] */ ByRef VarVal As VARIANT) As HRESULT
    1461     virtual /* [local] */ HRESULT STDMETHODCALLTYPE GetDocumentation2(
     1461    Function /* [local] */ GetDocumentation2(
    14621462        /* [in] */ memid As MEMBERID,
    14631463        /* [in] */ lcid As LCID,
  • Include/OleAuto.ab

    r42 r137  
    2525'Dummy
    2626Interface ITypeLib
    27     Inherits IUnknown
    28 End Interface
    29 
    30 Interface ITypeInfo
    3127    Inherits IUnknown
    3228End Interface
  • Include/api_gdi.sbp

    r125 r137  
    55#define _INC_GDI
    66
     7#ifdef UNICODE
     8Const _FuncName_CreateFontIndirect = "CreateFontIndirectW"
     9#else
     10Const _FuncName_CreateFontIndirect = "CreateFontIndirectA"
     11#endif
    712
    813Const CLR_INVALID =   &HFFFFFFFF
     
    661666#endif
    662667Declare Function CreateFontIndirectA Lib "gdi32" (ByRef lf As LOGFONTA) As HFONT
    663 Declare Function CreateFontIndirect Lib "gdi32" Alias "CreateFontIndirectA" (ByRef lf As LOGFONT) As HFONT
     668Declare Function CreateFontIndirect Lib "gdi32" Alias _FuncName_CreateFontIndirect (ByRef lf As LOGFONT) As HFONT
    664669
    665670Declare Function CreateHatchBrush Lib "gdi32" (fnStyle As Long, clrref As COLORREF) As HBRUSH
  • Include/api_system.sbp

    r125 r137  
    33#ifndef _INC_SYSTEM
    44#define _INC_SYSTEM
     5
     6#ifdef UNICODE
     7Const _FuncName_lstrcpy = "lstrcpyW"
     8#else
     9Const _FuncName_lstrcpy = "lstrcpyA"
     10#endif
    511
    612
     
    546552Declare Function FreeLibrary Lib "kernel32" (hLibModule As HINSTANCE) As BOOL
    547553Declare Sub FreeLibraryAndExitThread Lib "kernel32" (hModule As HANDLE, dwExitCode As DWord)
    548 Declare Function GetCommandLine Lib "kernel32" Alias "GetCommandLineA" () As BytePtr
     554Declare Function GetCommandLineA Lib "kernel32" () As PCSTR
     555Declare Function GetCommandLineW Lib "kernel32" () As PCWSTR
     556#ifdef UNICODE
     557Declare Function GetCommandLine Lib "kernel32" Alias "GetCommandLineW" () As PCWSTR
     558#else
     559Declare Function GetCommandLine Lib "kernel32" Alias "GetCommandLineA" () As PCSTR
     560#endif
    549561Declare Function GetCompressedFileSize Lib "kernel32" Alias "GetCompressedFileSizeA" (lpFileName As BytePtr, ByRef lpFileSizeHigh As DWord) As DWord
    550562
     
    782794Declare Function lstrcmp Lib "kernel32" Alias "lstrcmpA" (pString1 As PCSTR, pString2 As PCSTR) As Long
    783795Declare Function lstrcmpi Lib "kernel32" Alias "lstrcmpiA" (pString1 As PCSTR, pString2 As PCSTR) As Long
    784 Declare Function lstrcpy Lib "kernel32" Alias "lstrcpyA" (pString1 As PSTR, pString2 As PCSTR) As PSTR
     796Declare Function lstrcpy Lib "kernel32" Alias _FuncName_lstrcpy (pString1 As PTSTR, pString2 As PCTSTR) As PSTR
    785797Declare Function lstrlenA Lib "kernel32" (pString As PCSTR) As Long
    786798Declare Function lstrlenW Lib "kernel32" (pString As PCWSTR) As Long
    787799#ifdef UNICODE
    788 Declare Function lstrlen Lib "kernel32" Alias "lstrlenW" (lpString As PCTSTR) As Long
     800Declare Function lstrlen Lib "kernel32" Alias "lstrlenW" (pString As PCTSTR) As Long
    789801#else
    790 Declare Function lstrlen Lib "kernel32" Alias "lstrlenA" (lpString As PCTSTR) As Long
     802Declare Function lstrlen Lib "kernel32" Alias "lstrlenA" (pString As PCTSTR) As Long
    791803#endif
    792804Declare Sub memcpy Lib "kernel32" Alias "RtlMoveMemory" (pDest As VoidPtr, pSrc As VoidPtr, length As SIZE_T)
  • Include/api_window.sbp

    r119 r137  
    55#define _INC_WINDOW
    66
     7#ifdef UNICODE
     8Const _FuncName_CreateWindowEx = "CreateWindowExW"
     9Const _FuncName_RegisterClassEx = "RegisterClassExW"
     10#else
     11Const _FuncName_CreateWindowEx = "CreateWindowExA"
     12Const _FuncName_RegisterClassEx = "RegisterClassExA"
     13#endif
    714
    815Const CREATEPROCESS_MANIFEST_RESOURCE_ID = 1
     
    3441Const CS_BYTEALIGNWINDOW = &H2000
    3542Const CS_GLOBALCLASS =     &H4000
    36 Type WNDCLASSEX
     43Type WNDCLASSEXA
    3744    cbSize        As DWord
    3845    style         As DWord
     
    4451    hCursor       As HCURSOR
    4552    hbrBackground As HBRUSH
    46     lpszMenuName  As BytePtr
    47     lpszClassName As BytePtr
     53    lpszMenuName  As LPCSTR
     54    lpszClassName As LPCSTR
    4855    hIconSm       As HICON
    4956End Type
    50 
     57Type WNDCLASSEXW
     58    cbSize        As DWord
     59    style         As DWord
     60    lpfnWndProc   As WNDPROC
     61    cbClsExtra    As Long
     62    cbWndExtra    As Long
     63    hInstance     As HINSTANCE
     64    hIcon         As HICON
     65    hCursor       As HCURSOR
     66    hbrBackground As HBRUSH
     67    lpszMenuName  As LPCWSTR
     68    lpszClassName As LPCWSTR
     69    hIconSm       As HICON
     70End Type
     71#ifdef UNICODE
     72TypeDef WNDCLASSEX = WNDCLASSEXW
     73#else
     74TypeDef WNDCLASSEX = WNDCLASSEXA
     75#endif
    5176
    5277'------------------------
     
    311336
    312337Const CW_USEDEFAULT = &H80000000
    313 Declare Function CreateWindowEx Lib "user32" Alias "CreateWindowExA" (dwExStyle As DWord, lpClassName As PCSTR, lpWindowName As PCSTR, dwStyle As DWord, x As Long, y As Long, nWidth As Long, nHeight As Long, hWndParent As HWND, hMenu As HMENU, hInstance As HINSTANCE, lpParm As VoidPtr) As HWND
     338Declare Function CreateWindowEx Lib "user32" Alias _FuncName_CreateWindowEx (dwExStyle As DWord, pClassName As PCTSTR, lpWindowName As PCTSTR, dwStyle As DWord, x As Long, y As Long, nWidth As Long, nHeight As Long, hwndParent As HWND, hmenu As HMENU, hInstance As HINSTANCE, pParm As VoidPtr) As HWND
    314339
    315340Declare Function DefWindowProc Lib "user32" Alias "DefWindowProcA" (hWnd As HWND, wMsg As DWord, wParam As WPARAM, lParam As LPARAM) As LRESULT
     
    862887Declare Function RedrawWindow Lib "user32" (hWnd As HWND, ByRef lprcUpdate As RECT, hrgnUpdate As HRGN, flags As DWord) As BOOL
    863888
    864 Declare Function RegisterClassEx Lib "user32" Alias "RegisterClassExA" (ByRef wcx As WNDCLASSEX) As ATOM
     889Declare Function RegisterClassEx Lib "user32" Alias _FuncName_RegisterClassEx (ByRef wcx As WNDCLASSEX) As ATOM
    865890Declare Function RegisterClipboardFormat Lib "user32" Alias "RegisterClipboardFormatA" (lpszFormat As PCSTR) As DWord
    866891Declare Function RegisterWindowMessage Lib "user32" Alias "RegisterWindowMessageA" (lpString As PCSTR) As DWord
  • Include/basic/function.sbp

    r133 r137  
    11171117Function _System_WideCharToMultiByte(ws As PCWSTR, size As Long, flag As DWord) As PSTR
    11181118    Dim sizeMBS = WideCharToMultiByte(CP_THREAD_ACP, flag, s, size, 0, 0, 0, 0)
    1119     Dim mbs = malloc(sizeMBS) As PSTR
     1119    Dim mbs = _System_malloc(sizeMBS) As PSTR
    11201120    WideCharToMultiByte(CP_THREAD_ACP, flag, s, size, mbs, sizeMBS, 0, 0)
    11211121    Return mbs
     
    11321132Function _System_MultiByteToWideChar(s As PCSTR, size As Long, flag As DWord) As PWSTR
    11331133    Dim sizeMBS = MultiByteToWideChar(CP_THREAD_ACP, flag, s, size, 0, 0)
    1134     Dim mbs = malloc(SizeOf (WCHAR) * sizeMBS) As PWSTR
     1134    Dim mbs = _System_malloc(SizeOf (WCHAR) * sizeMBS) As PWSTR
    11351135    MultiByteToWideChar(CP_THREAD_ACP, flag, s, size, mbs, sizeMBS)
    11361136    Return mbs
  • Include/basic/prompt.sbp

    r132 r137  
    2626End Type
    2727
    28 Dim _PromptSys_LogFont As LOGFONTA 'LOGFONT
     28Dim _PromptSys_LogFont As LOGFONT
    2929Dim _PromptSys_hFont As HFONT
    3030Dim _PromptSys_FontSize As SIZE
     
    257257            End With
    258258            ImmSetCompositionWindow(himc, CompForm)
    259             ImmSetCompositionFontA(himc, _PromptSys_LogFont)
     259            ImmSetCompositionFont(himc, _PromptSys_LogFont)
    260260        End If
    261261        ImmReleaseContext(hwnd, himc)
     
    407407        .lfQuality = DEFAULT_QUALITY
    408408        .lfPitchAndFamily = FIXED_PITCH
    409 #ifdef UNICODE
    410         WideCharToMultiByte(CP_ACP, 0, "MS 明朝", 5, .lfFaceName, LF_FACESIZE, 0, 0)
    411 #else
    412409        lstrcpy(.lfFaceName, "MS 明朝")
    413 #endif
    414     End With
    415 
    416     _PromptSys_hFont = CreateFontIndirectA(_PromptSys_LogFont)
     410    End With
     411
     412    _PromptSys_hFont = CreateFontIndirect(_PromptSys_LogFont)
    417413
    418414    'Critical Section
     
    436432
    437433    'Create Prompt Window
    438     _PromptSys_hWnd = CreateWindowEx(WS_EX_CLIENTEDGE, atom As ULONG_PTR As PCSTR, "BASIC PROMPT",
     434    _PromptSys_hWnd = CreateWindowEx(WS_EX_CLIENTEDGE, atom As ULONG_PTR As PCTSTR, "BASIC PROMPT",
    439435        WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
    440436        0, 0, wcl.hInstance, 0)
Note: See TracChangeset for help on using the changeset viewer.