- Timestamp:
- Mar 7, 2007, 5:36:31 PM (18 years ago)
- Location:
- Include
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
Include/Classes/System/Drawing/Font.ab
r104 r137 3 3 4 4 #require <GdiPlus.ab> 5 #require <Classes/System/Drawing/misc.ab> 5 6 #require <Classes/System/Drawing/Graphics.ab> 6 7 … … 64 65 End Sub 65 66 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, 71 76 /*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, 76 86 /*IN*/ style As Long, /*IN*/ unit As GraphicsUnit) 77 87 Font(familyName, emSize, style, unit, ByVal 0) 78 88 End Sub 79 89 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, 81 96 /*IN*/ style As Long, /*IN*/ unit As GraphicsUnit, 82 97 /*IN const*/ ByRef fontCollection As FontCollection) … … 112 127 End Sub 113 128 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 114 141 Const Function GetLogFontA(/*IN const*/ ByRef g As Graphics, /*OUT*/ ByRef lf As LOGFONTA) As Status 115 142 Dim nativeGraphics As *GpGraphics … … 128 155 End Function 129 156 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 130 169 Const Function Clone() As *Font 131 170 Dim cloneFont = 0 As *GpFont … … 138 177 End Sub 139 178 140 Const Function IsAvailable() As B OOL179 Const Function IsAvailable() As Boolean 141 180 Return nativeFont <> 0 142 181 End Function … … 150 189 End Function 151 190 191 Const Function SizeInPoints() As Single 192 152 193 Const Function Unit() As GraphicsUnit 153 194 SetStatus(GdipGetFontUnit(nativeFont, Unit)) … … 158 199 End Function 159 200 160 Const Function Height() As Single161 Return GetHeight() 201 Const Function Height() As Long 202 Return GetHeight() As Long 162 203 End Function 163 204 … … 187 228 ' End Function 188 229 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 189 244 Const Function NativeFont() As *GpFont 190 245 Return nativeFont 191 246 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 192 314 193 315 Private -
Include/Classes/System/Drawing/misc.ab
r104 r137 36 36 End Enum 37 37 38 Enum FontStyle 39 Regular = 0 40 Bold = 1 41 Italic = 2 42 Strikeout = 4 43 Underline = 8 44 End Enum 45 46 38 47 #endif '__SYSTEM_DRAWING_MISC_AB__ -
Include/OAIdl.ab
r77 r137 1401 1401 Function /* [local] */ GetContainingTypeLib( 1402 1402 /* [out] */ ByRef pTLib As *ITypeLib, 1403 /* [out] */ ByRef Index As UINT) As HRESULT1404 1405 Function /* [local] */ void STDMETHODCALLTYPEReleaseTypeAttr(1406 /* [in] */ pTypeAttr As *TYPEATTR) As HRESULT1407 1408 Function /* [local] */ void STDMETHODCALLTYPEReleaseFuncDesc(1409 /* [in] */ pFuncDesc As *FUNCDESC) As HRESULT1410 1411 Function /* [local] */ void STDMETHODCALLTYPEReleaseVarDesc(1412 /* [in] */ pVarDesc As *VARDESC) As HRESULT1403 /* [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) 1413 1413 End Interface 1414 1414 … … 1452 1452 /* [out] */ ByRef VarVal As VARIANT) As HRESULT 1453 1453 Function GetVarCustData( 1454 /* [in] */ UINT index,1454 /* [in] */ index As DWord, 1455 1455 /* [in] */ ByRef guid As GUID, 1456 1456 /* [out] */ ByRef VarVal As VARIANT) As HRESULT 1457 1457 Function GetImplTypeCustData( 1458 /* [in] */ UINT index,1458 /* [in] */ index As DWord, 1459 1459 /* [in] */ ByRef guid As GUID, 1460 1460 /* [out] */ ByRef VarVal As VARIANT) As HRESULT 1461 virtual /* [local] */ HRESULT STDMETHODCALLTYPEGetDocumentation2(1461 Function /* [local] */ GetDocumentation2( 1462 1462 /* [in] */ memid As MEMBERID, 1463 1463 /* [in] */ lcid As LCID, -
Include/OleAuto.ab
r42 r137 25 25 'Dummy 26 26 Interface ITypeLib 27 Inherits IUnknown28 End Interface29 30 Interface ITypeInfo31 27 Inherits IUnknown 32 28 End Interface -
Include/api_gdi.sbp
r125 r137 5 5 #define _INC_GDI 6 6 7 #ifdef UNICODE 8 Const _FuncName_CreateFontIndirect = "CreateFontIndirectW" 9 #else 10 Const _FuncName_CreateFontIndirect = "CreateFontIndirectA" 11 #endif 7 12 8 13 Const CLR_INVALID = &HFFFFFFFF … … 661 666 #endif 662 667 Declare Function CreateFontIndirectA Lib "gdi32" (ByRef lf As LOGFONTA) As HFONT 663 Declare Function CreateFontIndirect Lib "gdi32" Alias "CreateFontIndirectA"(ByRef lf As LOGFONT) As HFONT668 Declare Function CreateFontIndirect Lib "gdi32" Alias _FuncName_CreateFontIndirect (ByRef lf As LOGFONT) As HFONT 664 669 665 670 Declare Function CreateHatchBrush Lib "gdi32" (fnStyle As Long, clrref As COLORREF) As HBRUSH -
Include/api_system.sbp
r125 r137 3 3 #ifndef _INC_SYSTEM 4 4 #define _INC_SYSTEM 5 6 #ifdef UNICODE 7 Const _FuncName_lstrcpy = "lstrcpyW" 8 #else 9 Const _FuncName_lstrcpy = "lstrcpyA" 10 #endif 5 11 6 12 … … 546 552 Declare Function FreeLibrary Lib "kernel32" (hLibModule As HINSTANCE) As BOOL 547 553 Declare Sub FreeLibraryAndExitThread Lib "kernel32" (hModule As HANDLE, dwExitCode As DWord) 548 Declare Function GetCommandLine Lib "kernel32" Alias "GetCommandLineA" () As BytePtr 554 Declare Function GetCommandLineA Lib "kernel32" () As PCSTR 555 Declare Function GetCommandLineW Lib "kernel32" () As PCWSTR 556 #ifdef UNICODE 557 Declare Function GetCommandLine Lib "kernel32" Alias "GetCommandLineW" () As PCWSTR 558 #else 559 Declare Function GetCommandLine Lib "kernel32" Alias "GetCommandLineA" () As PCSTR 560 #endif 549 561 Declare Function GetCompressedFileSize Lib "kernel32" Alias "GetCompressedFileSizeA" (lpFileName As BytePtr, ByRef lpFileSizeHigh As DWord) As DWord 550 562 … … 782 794 Declare Function lstrcmp Lib "kernel32" Alias "lstrcmpA" (pString1 As PCSTR, pString2 As PCSTR) As Long 783 795 Declare 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 PSTR796 Declare Function lstrcpy Lib "kernel32" Alias _FuncName_lstrcpy (pString1 As PTSTR, pString2 As PCTSTR) As PSTR 785 797 Declare Function lstrlenA Lib "kernel32" (pString As PCSTR) As Long 786 798 Declare Function lstrlenW Lib "kernel32" (pString As PCWSTR) As Long 787 799 #ifdef UNICODE 788 Declare Function lstrlen Lib "kernel32" Alias "lstrlenW" ( lpString As PCTSTR) As Long800 Declare Function lstrlen Lib "kernel32" Alias "lstrlenW" (pString As PCTSTR) As Long 789 801 #else 790 Declare Function lstrlen Lib "kernel32" Alias "lstrlenA" ( lpString As PCTSTR) As Long802 Declare Function lstrlen Lib "kernel32" Alias "lstrlenA" (pString As PCTSTR) As Long 791 803 #endif 792 804 Declare Sub memcpy Lib "kernel32" Alias "RtlMoveMemory" (pDest As VoidPtr, pSrc As VoidPtr, length As SIZE_T) -
Include/api_window.sbp
r119 r137 5 5 #define _INC_WINDOW 6 6 7 #ifdef UNICODE 8 Const _FuncName_CreateWindowEx = "CreateWindowExW" 9 Const _FuncName_RegisterClassEx = "RegisterClassExW" 10 #else 11 Const _FuncName_CreateWindowEx = "CreateWindowExA" 12 Const _FuncName_RegisterClassEx = "RegisterClassExA" 13 #endif 7 14 8 15 Const CREATEPROCESS_MANIFEST_RESOURCE_ID = 1 … … 34 41 Const CS_BYTEALIGNWINDOW = &H2000 35 42 Const CS_GLOBALCLASS = &H4000 36 Type WNDCLASSEX 43 Type WNDCLASSEXA 37 44 cbSize As DWord 38 45 style As DWord … … 44 51 hCursor As HCURSOR 45 52 hbrBackground As HBRUSH 46 lpszMenuName As BytePtr47 lpszClassName As BytePtr53 lpszMenuName As LPCSTR 54 lpszClassName As LPCSTR 48 55 hIconSm As HICON 49 56 End Type 50 57 Type 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 70 End Type 71 #ifdef UNICODE 72 TypeDef WNDCLASSEX = WNDCLASSEXW 73 #else 74 TypeDef WNDCLASSEX = WNDCLASSEXA 75 #endif 51 76 52 77 '------------------------ … … 311 336 312 337 Const 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 HWND338 Declare 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 314 339 315 340 Declare Function DefWindowProc Lib "user32" Alias "DefWindowProcA" (hWnd As HWND, wMsg As DWord, wParam As WPARAM, lParam As LPARAM) As LRESULT … … 862 887 Declare Function RedrawWindow Lib "user32" (hWnd As HWND, ByRef lprcUpdate As RECT, hrgnUpdate As HRGN, flags As DWord) As BOOL 863 888 864 Declare Function RegisterClassEx Lib "user32" Alias "RegisterClassExA"(ByRef wcx As WNDCLASSEX) As ATOM889 Declare Function RegisterClassEx Lib "user32" Alias _FuncName_RegisterClassEx (ByRef wcx As WNDCLASSEX) As ATOM 865 890 Declare Function RegisterClipboardFormat Lib "user32" Alias "RegisterClipboardFormatA" (lpszFormat As PCSTR) As DWord 866 891 Declare Function RegisterWindowMessage Lib "user32" Alias "RegisterWindowMessageA" (lpString As PCSTR) As DWord -
Include/basic/function.sbp
r133 r137 1117 1117 Function _System_WideCharToMultiByte(ws As PCWSTR, size As Long, flag As DWord) As PSTR 1118 1118 Dim sizeMBS = WideCharToMultiByte(CP_THREAD_ACP, flag, s, size, 0, 0, 0, 0) 1119 Dim mbs = malloc(sizeMBS) As PSTR1119 Dim mbs = _System_malloc(sizeMBS) As PSTR 1120 1120 WideCharToMultiByte(CP_THREAD_ACP, flag, s, size, mbs, sizeMBS, 0, 0) 1121 1121 Return mbs … … 1132 1132 Function _System_MultiByteToWideChar(s As PCSTR, size As Long, flag As DWord) As PWSTR 1133 1133 Dim sizeMBS = MultiByteToWideChar(CP_THREAD_ACP, flag, s, size, 0, 0) 1134 Dim mbs = malloc(SizeOf (WCHAR) * sizeMBS) As PWSTR1134 Dim mbs = _System_malloc(SizeOf (WCHAR) * sizeMBS) As PWSTR 1135 1135 MultiByteToWideChar(CP_THREAD_ACP, flag, s, size, mbs, sizeMBS) 1136 1136 Return mbs -
Include/basic/prompt.sbp
r132 r137 26 26 End Type 27 27 28 Dim _PromptSys_LogFont As LOGFONT A 'LOGFONT28 Dim _PromptSys_LogFont As LOGFONT 29 29 Dim _PromptSys_hFont As HFONT 30 30 Dim _PromptSys_FontSize As SIZE … … 257 257 End With 258 258 ImmSetCompositionWindow(himc, CompForm) 259 ImmSetCompositionFont A(himc, _PromptSys_LogFont)259 ImmSetCompositionFont(himc, _PromptSys_LogFont) 260 260 End If 261 261 ImmReleaseContext(hwnd, himc) … … 407 407 .lfQuality = DEFAULT_QUALITY 408 408 .lfPitchAndFamily = FIXED_PITCH 409 #ifdef UNICODE410 WideCharToMultiByte(CP_ACP, 0, "MS 明朝", 5, .lfFaceName, LF_FACESIZE, 0, 0)411 #else412 409 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) 417 413 418 414 'Critical Section … … 436 432 437 433 'Create Prompt Window 438 _PromptSys_hWnd = CreateWindowEx(WS_EX_CLIENTEDGE, atom As ULONG_PTR As PC STR, "BASIC PROMPT",434 _PromptSys_hWnd = CreateWindowEx(WS_EX_CLIENTEDGE, atom As ULONG_PTR As PCTSTR, "BASIC PROMPT", 439 435 WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 440 436 0, 0, wcl.hInstance, 0)
Note:
See TracChangeset
for help on using the changeset viewer.