Merge branch 'master' of git://factorcode.org/git/factor

db4
Bruno Deferrari 2008-06-09 22:17:26 -03:00
commit 051872b147
10 changed files with 94 additions and 79 deletions

16
extra/alias/alias.factor Executable file
View File

@ -0,0 +1,16 @@
USING: words quotations kernel effects sequences parser ;
IN: alias
PREDICATE: alias < word "alias" word-prop ;
M: alias reset-word
[ call-next-method ] [ f "alias" set-word-prop ] bi ;
M: alias stack-effect
word-def first stack-effect ;
: define-alias ( new old -- )
[ 1quotation define-inline ]
[ drop t "alias" set-word-prop ] 2bi ;
: ALIAS: CREATE-WORD scan-word define-alias ; parsing

View File

@ -146,7 +146,7 @@ SYMBOLS: +read-only+ +hidden+ +system+
: win32-file-type ( n -- symbol ) : win32-file-type ( n -- symbol )
FILE_ATTRIBUTE_DIRECTORY mask? +directory+ +regular-file+ ? ; FILE_ATTRIBUTE_DIRECTORY mask? +directory+ +regular-file+ ? ;
: WIN32_FIND_DATA>file-info : WIN32_FIND_DATA>file-info ( WIN32_FIND_DATA -- file-info )
{ {
[ WIN32_FIND_DATA-dwFileAttributes win32-file-type ] [ WIN32_FIND_DATA-dwFileAttributes win32-file-type ]
[ [
@ -167,7 +167,7 @@ SYMBOLS: +read-only+ +hidden+ +system+
FindClose win32-error=0/f FindClose win32-error=0/f
] keep ; ] keep ;
: BY_HANDLE_FILE_INFORMATION>file-info : BY_HANDLE_FILE_INFORMATION>file-info ( HANDLE_FILE_INFORMATION -- file-info )
{ {
[ BY_HANDLE_FILE_INFORMATION-dwFileAttributes win32-file-type ] [ BY_HANDLE_FILE_INFORMATION-dwFileAttributes win32-file-type ]
[ [

View File

@ -5,10 +5,10 @@ windows windows.advapi32 windows.kernel32 io.backend system
accessors locals ; accessors locals ;
IN: io.windows.mmap IN: io.windows.mmap
: create-file-mapping : create-file-mapping ( hFile lpAttributes flProtect dwMaximumSizeHigh dwMaximumSizeLow lpName -- HANDLE )
CreateFileMapping [ win32-error=0/f ] keep <win32-handle> ; CreateFileMapping [ win32-error=0/f ] keep <win32-handle> ;
: map-view-of-file : map-view-of-file ( hFileMappingObject dwDesiredAccess dwFileOffsetHigh dwFileOffsetLow dwNumberOfBytesToMap -- HANDLE )
MapViewOfFile [ win32-error=0/f ] keep ; MapViewOfFile [ win32-error=0/f ] keep ;
:: mmap-open ( path length access-mode create-mode protect access -- handle handle address ) :: mmap-open ( path length access-mode create-mode protect access -- handle handle address )

View File

@ -13,8 +13,11 @@ IN: ui.windows
SINGLETON: windows-ui-backend SINGLETON: windows-ui-backend
: crlf>lf CHAR: \r swap remove ; : crlf>lf ( str -- str' )
: lf>crlf [ [ dup CHAR: \n = [ CHAR: \r , ] when , ] each ] "" make ; CHAR: \r swap remove ;
: lf>crlf ( str -- str' )
[ [ dup CHAR: \n = [ CHAR: \r , ] when , ] each ] "" make ;
: enum-clipboard ( -- seq ) : enum-clipboard ( -- seq )
0 0
@ -127,7 +130,7 @@ SYMBOLS: msg-obj class-name-ptr mouse-captured ;
{ 123 "F12" } { 123 "F12" }
} ; } ;
: key-state-down? : key-state-down? ( key -- ? )
GetKeyState 16 bit? ; GetKeyState 16 bit? ;
: left-shift? ( -- ? ) VK_LSHIFT key-state-down? ; : left-shift? ( -- ? ) VK_LSHIFT key-state-down? ;

11
extra/windows/advapi32/advapi32.factor Normal file → Executable file
View File

@ -1,4 +1,4 @@
USING: alien.syntax kernel math windows.types math.bitfields ; USING: alias alien.syntax kernel math windows.types math.bitfields ;
IN: windows.advapi32 IN: windows.advapi32
LIBRARY: advapi32 LIBRARY: advapi32
@ -336,8 +336,7 @@ FUNCTION: BOOL CryptAcquireContextW ( HCRYPTPROV* phProv,
DWORD dwProvType, DWORD dwProvType,
DWORD dwFlags ) ; DWORD dwFlags ) ;
: CryptAcquireContext ( phProv pszContainer pszProvider dwProvType dwFlags -- BOOL ) ALIAS: CryptAcquireContext CryptAcquireContextW
CryptAcquireContextW ;
! : CryptContextAddRef ; ! : CryptContextAddRef ;
! : CryptCreateHash ; ! : CryptCreateHash ;
@ -498,8 +497,7 @@ FUNCTION: BOOL CryptReleaseContext ( HCRYPTPROV hProv, DWORD dwFlags ) ;
! : GetUserNameA ; ! : GetUserNameA ;
FUNCTION: BOOL GetUserNameW ( LPCTSTR lpBuffer, LPDWORD lpnSize ) ; FUNCTION: BOOL GetUserNameW ( LPCTSTR lpBuffer, LPDWORD lpnSize ) ;
: GetUserName ( lpBuffer lpnSize -- BOOL ) ALIAS: GetUserName GetUserNameW
GetUserNameW ;
! : GetWindowsAccountDomainSid ; ! : GetWindowsAccountDomainSid ;
! : I_ScIsSecurityProcess ; ! : I_ScIsSecurityProcess ;
@ -544,8 +542,7 @@ FUNCTION: BOOL InitializeAcl ( PACL pAcl, DWORD nAclLength, DWORD dwAclRevision
FUNCTION: BOOL LookupPrivilegeValueW ( LPCTSTR lpSystemName, FUNCTION: BOOL LookupPrivilegeValueW ( LPCTSTR lpSystemName,
LPCTSTR lpName, LPCTSTR lpName,
PLUID lpLuid ) ; PLUID lpLuid ) ;
: LookupPrivilegeValue ( lpSystemName lpname lpLuid -- BOOL ) ALIAS: LookupPrivilegeValue LookupPrivilegeValueW
LookupPrivilegeValueW ;
! : LookupSecurityDescriptorPartsA ; ! : LookupSecurityDescriptorPartsA ;
! : LookupSecurityDescriptorPartsW ; ! : LookupSecurityDescriptorPartsW ;

2
extra/windows/gdi32/gdi32.factor Normal file → Executable file
View File

@ -1,7 +1,7 @@
! FUNCTION: AbortDoc ! FUNCTION: AbortDoc
! Copyright (C) 2005, 2006 Doug Coleman. ! Copyright (C) 2005, 2006 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: alien alien.syntax kernel windows.types ; USING: alien alien.syntax kernel windows.types alias ;
IN: windows.gdi32 IN: windows.gdi32
! Stock Logical Objects ! Stock Logical Objects

53
extra/windows/kernel32/kernel32.factor Normal file → Executable file
View File

@ -1,6 +1,6 @@
! Copyright (C) 2005, 2006 Doug Coleman. ! Copyright (C) 2005, 2006 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: alien alien.syntax kernel windows.types ; USING: alien alien.syntax kernel windows.types alias ;
IN: windows.kernel32 IN: windows.kernel32
: MAX_PATH 260 ; inline : MAX_PATH 260 ; inline
@ -594,7 +594,7 @@ FUNCTION: BOOL ConnectNamedPipe ( HANDLE hNamedPipe, LPOVERLAPPED lpOverlapped )
! FUNCTION: CopyFileExA ! FUNCTION: CopyFileExA
! FUNCTION: CopyFileExW ! FUNCTION: CopyFileExW
FUNCTION: BOOL CopyFileW ( LPCTSTR lpExistingFileName, LPCTSTR lpNewFileName, BOOL bFailIfExists ) ; FUNCTION: BOOL CopyFileW ( LPCTSTR lpExistingFileName, LPCTSTR lpNewFileName, BOOL bFailIfExists ) ;
: CopyFile CopyFileW ; inline ALIAS: CopyFile CopyFileW
! FUNCTION: CopyLZFile ! FUNCTION: CopyLZFile
! FUNCTION: CreateActCtxA ! FUNCTION: CreateActCtxA
! FUNCTION: CreateActCtxW ! FUNCTION: CreateActCtxW
@ -603,7 +603,7 @@ FUNCTION: BOOL CopyFileW ( LPCTSTR lpExistingFileName, LPCTSTR lpNewFileName, BO
! FUNCTION: CreateDirectoryExA ! FUNCTION: CreateDirectoryExA
! FUNCTION: CreateDirectoryExW ! FUNCTION: CreateDirectoryExW
FUNCTION: BOOL CreateDirectoryW ( LPCTSTR lpPathName, LPSECURITY_ATTRIBUTES lpSecurityAttribytes ) ; FUNCTION: BOOL CreateDirectoryW ( LPCTSTR lpPathName, LPSECURITY_ATTRIBUTES lpSecurityAttribytes ) ;
: CreateDirectory CreateDirectoryW ; inline ALIAS: CreateDirectory CreateDirectoryW
! FUNCTION: CreateEventA ! FUNCTION: CreateEventA
! FUNCTION: CreateEventW ! FUNCTION: CreateEventW
@ -612,7 +612,7 @@ FUNCTION: BOOL CreateDirectoryW ( LPCTSTR lpPathName, LPSECURITY_ATTRIBUTES lpSe
FUNCTION: HANDLE CreateFileW ( LPCTSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttribures, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile ) ; FUNCTION: HANDLE CreateFileW ( LPCTSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttribures, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile ) ;
: CreateFile CreateFileW ; inline ALIAS: CreateFile CreateFileW
FUNCTION: HANDLE CreateFileMappingW ( HANDLE hFile, FUNCTION: HANDLE CreateFileMappingW ( HANDLE hFile,
LPSECURITY_ATTRIBUTES lpAttributes, LPSECURITY_ATTRIBUTES lpAttributes,
@ -620,7 +620,7 @@ FUNCTION: HANDLE CreateFileMappingW ( HANDLE hFile,
DWORD dwMaximumSizeHigh, DWORD dwMaximumSizeHigh,
DWORD dwMaximumSizeLow, DWORD dwMaximumSizeLow,
LPCTSTR lpName ) ; LPCTSTR lpName ) ;
: CreateFileMapping ( hFile lpAttributes flProtect dwMaximumSizeHigh dwMaximumSizeLow lpName -- HANDLE ) CreateFileMappingW ; ALIAS: CreateFileMapping CreateFileMappingW
! FUNCTION: CreateHardLinkA ! FUNCTION: CreateHardLinkA
! FUNCTION: CreateHardLinkW ! FUNCTION: CreateHardLinkW
@ -636,7 +636,7 @@ FUNCTION: HANDLE CreateIoCompletionPort ( HANDLE hFileHandle, HANDLE hExistingCo
! FUNCTION: CreateMutexW ! FUNCTION: CreateMutexW
! FUNCTION: CreateNamedPipeA ! FUNCTION: CreateNamedPipeA
FUNCTION: HANDLE CreateNamedPipeW ( LPCTSTR lpName, DWORD dwOpenMode, DWORD dwPipeMode, DWORD nMaxInstances, DWORD nOutBufferSize, DWORD nInBufferSize, DWORD nDefaultTimeOut, LPSECURITY_ATTRIBUTES lpSecurityAttributes ) ; FUNCTION: HANDLE CreateNamedPipeW ( LPCTSTR lpName, DWORD dwOpenMode, DWORD dwPipeMode, DWORD nMaxInstances, DWORD nOutBufferSize, DWORD nInBufferSize, DWORD nDefaultTimeOut, LPSECURITY_ATTRIBUTES lpSecurityAttributes ) ;
: CreateNamedPipe ( lpName dwOpenMode dwPipeMode nMaxInstances nOutBufferSize nInBufferSize nDefaultTimeOut lpSecurityAttributes -- HANDLE ) CreateNamedPipeW ; ALIAS: CreateNamedPipe CreateNamedPipeW
! FUNCTION: CreateNlsSecurityDescriptor ! FUNCTION: CreateNlsSecurityDescriptor
FUNCTION: BOOL CreatePipe ( PHANDLE hReadPipe, PHANDLE hWritePipe, LPSECURITY_ATTRIBUTES lpPipeAttributes, DWORD nSize ) ; FUNCTION: BOOL CreatePipe ( PHANDLE hReadPipe, PHANDLE hWritePipe, LPSECURITY_ATTRIBUTES lpPipeAttributes, DWORD nSize ) ;
@ -675,7 +675,7 @@ FUNCTION: BOOL CreateProcessW ( LPCTSTR lpApplicationname,
LPCTSTR lpCurrentDirectory, LPCTSTR lpCurrentDirectory,
LPSTARTUPINFO lpStartupInfo, LPSTARTUPINFO lpStartupInfo,
LPPROCESS_INFORMATION lpProcessInformation ) ; LPPROCESS_INFORMATION lpProcessInformation ) ;
: CreateProcess ( lpApplicationname lpCommandLine lpProcessAttributes lpThreadAttributes bInheritHandles dwCreationFlags lpEnvironment lpCurrentDirectory lpStartupInfo lpProcessInformation -- BOOL ) CreateProcessW ; ALIAS: CreateProcess CreateProcessW
! FUNCTION: CreateProcessInternalA ! FUNCTION: CreateProcessInternalA
! FUNCTION: CreateProcessInternalW ! FUNCTION: CreateProcessInternalW
! FUNCTION: CreateProcessInternalWSecure ! FUNCTION: CreateProcessInternalWSecure
@ -713,7 +713,7 @@ FUNCTION: HANDLE CreateRemoteThread ( HANDLE hProcess,
! FUNCTION: DeleteFiber ! FUNCTION: DeleteFiber
! FUNCTION: DeleteFileA ! FUNCTION: DeleteFileA
FUNCTION: BOOL DeleteFileW ( LPCTSTR lpFileName ) ; FUNCTION: BOOL DeleteFileW ( LPCTSTR lpFileName ) ;
: DeleteFile ( lpFileName -- BOOL ) DeleteFileW ; ALIAS: DeleteFile DeleteFileW
! FUNCTION: DeleteTimerQueue ! FUNCTION: DeleteTimerQueue
! FUNCTION: DeleteTimerQueueEx ! FUNCTION: DeleteTimerQueueEx
! FUNCTION: DeleteTimerQueueTimer ! FUNCTION: DeleteTimerQueueTimer
@ -804,13 +804,12 @@ FUNCTION: BOOL FindCloseChangeNotification ( HANDLE hChangeHandle ) ;
FUNCTION: HANDLE FindFirstChangeNotificationW ( LPCTSTR lpPathName, FUNCTION: HANDLE FindFirstChangeNotificationW ( LPCTSTR lpPathName,
BOOL bWatchSubtree, BOOL bWatchSubtree,
DWORD dwNotifyFilter ) ; DWORD dwNotifyFilter ) ;
: FindFirstChangeNotification ( lpPathName bWatchSubtree dwNotifyFilter -- BOOL ) ALIAS: FindFirstChangeNotification FindFirstChangeNotificationW
FindFirstChangeNotificationW ;
! FUNCTION: FindFirstFileA ! FUNCTION: FindFirstFileA
! FUNCTION: FindFirstFileExA ! FUNCTION: FindFirstFileExA
! FUNCTION: FindFirstFileExW ! FUNCTION: FindFirstFileExW
FUNCTION: HANDLE FindFirstFileW ( LPCTSTR lpFileName, LPWIN32_FIND_DATA lpFindFileData ) ; FUNCTION: HANDLE FindFirstFileW ( LPCTSTR lpFileName, LPWIN32_FIND_DATA lpFindFileData ) ;
: FindFirstFile ( lpFileName lpFindFileData -- HANDLE ) FindFirstFileW ; ALIAS: FindFirstFile FindFirstFileW
! FUNCTION: FindFirstVolumeA ! FUNCTION: FindFirstVolumeA
! FUNCTION: FindFirstVolumeMountPointA ! FUNCTION: FindFirstVolumeMountPointA
! FUNCTION: FindFirstVolumeMountPointW ! FUNCTION: FindFirstVolumeMountPointW
@ -818,7 +817,7 @@ FUNCTION: HANDLE FindFirstFileW ( LPCTSTR lpFileName, LPWIN32_FIND_DATA lpFindFi
FUNCTION: BOOL FindNextChangeNotification ( HANDLE hChangeHandle ) ; FUNCTION: BOOL FindNextChangeNotification ( HANDLE hChangeHandle ) ;
! FUNCTION: FindNextFileA ! FUNCTION: FindNextFileA
FUNCTION: BOOL FindNextFileW ( HANDLE hFindFile, LPWIN32_FIND_DATA lpFindFileData ) ; FUNCTION: BOOL FindNextFileW ( HANDLE hFindFile, LPWIN32_FIND_DATA lpFindFileData ) ;
: FindNextFile ( hFindFile lpFindFileData -- BOOL ) FindNextFileW ; ALIAS: FindNextFile FindNextFileW
! FUNCTION: FindNextVolumeA ! FUNCTION: FindNextVolumeA
! FUNCTION: FindNextVolumeMountPointA ! FUNCTION: FindNextVolumeMountPointA
! FUNCTION: FindNextVolumeMountPointW ! FUNCTION: FindNextVolumeMountPointW
@ -868,7 +867,7 @@ FUNCTION: BOOL FindNextFileW ( HANDLE hFindFile, LPWIN32_FIND_DATA lpFindFileDat
FUNCTION: BOOL GetComputerNameW ( LPTSTR lpBuffer, LPDWORD lpnSize ) ; FUNCTION: BOOL GetComputerNameW ( LPTSTR lpBuffer, LPDWORD lpnSize ) ;
! FUNCTION: GetComputerNameExW ! FUNCTION: GetComputerNameExW
! FUNCTION: GetComputerNameW ! FUNCTION: GetComputerNameW
: GetComputerName ( lpBuffer lpnSize -- BOOL ) GetComputerNameW ; ALIAS: GetComputerName GetComputerNameW
! FUNCTION: GetConsoleAliasA ! FUNCTION: GetConsoleAliasA
! FUNCTION: GetConsoleAliasesA ! FUNCTION: GetConsoleAliasesA
! FUNCTION: GetConsoleAliasesLengthA ! FUNCTION: GetConsoleAliasesLengthA
@ -903,7 +902,7 @@ FUNCTION: BOOL GetComputerNameW ( LPTSTR lpBuffer, LPDWORD lpnSize ) ;
! FUNCTION: GetConsoleScreenBufferInfo ! FUNCTION: GetConsoleScreenBufferInfo
! FUNCTION: GetConsoleSelectionInfo ! FUNCTION: GetConsoleSelectionInfo
FUNCTION: DWORD GetConsoleTitleW ( LPWSTR lpConsoleTitle, DWORD nSize ) ; FUNCTION: DWORD GetConsoleTitleW ( LPWSTR lpConsoleTitle, DWORD nSize ) ;
: GetConsoleTitle ( lpConsoleTitle nSize -- DWORD ) GetConsoleTitleW ; inline ALIAS: GetConsoleTitle GetConsoleTitleW
! FUNCTION: GetConsoleWindow ! FUNCTION: GetConsoleWindow
! FUNCTION: GetCPFileNameFromRegistry ! FUNCTION: GetCPFileNameFromRegistry
! FUNCTION: GetCPInfo ! FUNCTION: GetCPInfo
@ -915,7 +914,7 @@ FUNCTION: DWORD GetConsoleTitleW ( LPWSTR lpConsoleTitle, DWORD nSize ) ;
! FUNCTION: GetCurrentConsoleFont ! FUNCTION: GetCurrentConsoleFont
! FUNCTION: GetCurrentDirectoryA ! FUNCTION: GetCurrentDirectoryA
FUNCTION: BOOL GetCurrentDirectoryW ( DWORD len, LPTSTR buf ) ; FUNCTION: BOOL GetCurrentDirectoryW ( DWORD len, LPTSTR buf ) ;
: GetCurrentDirectory ( len buf -- BOOL ) GetCurrentDirectoryW ; inline ALIAS: GetCurrentDirectory GetCurrentDirectoryW
FUNCTION: HANDLE GetCurrentProcess ( ) ; FUNCTION: HANDLE GetCurrentProcess ( ) ;
FUNCTION: DWORD GetCurrentProcessId ( ) ; FUNCTION: DWORD GetCurrentProcessId ( ) ;
FUNCTION: HANDLE GetCurrentThread ( ) ; FUNCTION: HANDLE GetCurrentThread ( ) ;
@ -952,7 +951,7 @@ FUNCTION: DWORD GetFileAttributesW ( LPCTSTR lpFileName ) ;
FUNCTION: BOOL GetFileAttributesExW ( LPCTSTR lpFileName, GET_FILEEX_INFO_LEVELS fInfoLevelId, LPVOID lpFileInformation ) ; FUNCTION: BOOL GetFileAttributesExW ( LPCTSTR lpFileName, GET_FILEEX_INFO_LEVELS fInfoLevelId, LPVOID lpFileInformation ) ;
: GetFileAttributesEx ( lpFileName fInfoLevelId lpFileInformation -- BOOL ) GetFileAttributesExW ; ALIAS: GetFileAttributesEx GetFileAttributesExW
FUNCTION: BOOL GetFileInformationByHandle ( HANDLE hFile, LPBY_HANDLE_FILE_INFORMATION lpFileInformation ) ; FUNCTION: BOOL GetFileInformationByHandle ( HANDLE hFile, LPBY_HANDLE_FILE_INFORMATION lpFileInformation ) ;
FUNCTION: DWORD GetFileSize ( HANDLE hFile, LPDWORD lpFileSizeHigh ) ; FUNCTION: DWORD GetFileSize ( HANDLE hFile, LPDWORD lpFileSizeHigh ) ;
@ -963,7 +962,7 @@ FUNCTION: DWORD GetFileType ( HANDLE hFile ) ;
! FUNCTION: GetFirmwareEnvironmentVariableW ! FUNCTION: GetFirmwareEnvironmentVariableW
! FUNCTION: GetFullPathNameA ! FUNCTION: GetFullPathNameA
FUNCTION: DWORD GetFullPathNameW ( LPCTSTR lpFileName, DWORD nBufferLength, LPTSTR lpBuffer, LPTSTR* lpFilePart ) ; FUNCTION: DWORD GetFullPathNameW ( LPCTSTR lpFileName, DWORD nBufferLength, LPTSTR lpBuffer, LPTSTR* lpFilePart ) ;
: GetFullPathName ( lpFileName nBufferLength lpBuffer lpFilePart -- DWORD ) GetFullPathNameW ; ALIAS: GetFullPathName GetFullPathNameW
! clear "license.txt" 32768 "char[32768]" <c-object> f over >r GetFullPathName r> swap 2 * head >string . ! clear "license.txt" 32768 "char[32768]" <c-object> f over >r GetFullPathName r> swap 2 * head >string .
@ -986,7 +985,7 @@ FUNCTION: DWORD GetLastError ( ) ;
! FUNCTION: GetModuleFileNameA ! FUNCTION: GetModuleFileNameA
! FUNCTION: GetModuleFileNameW ! FUNCTION: GetModuleFileNameW
FUNCTION: HMODULE GetModuleHandleW ( LPCWSTR lpModuleName ) ; FUNCTION: HMODULE GetModuleHandleW ( LPCWSTR lpModuleName ) ;
: GetModuleHandle ( lpModuleName -- HMODULE ) GetModuleHandleW ; inline ALIAS: GetModuleHandle GetModuleHandleW
! FUNCTION: GetModuleHandleExA ! FUNCTION: GetModuleHandleExA
! FUNCTION: GetModuleHandleExW ! FUNCTION: GetModuleHandleExW
! FUNCTION: GetNamedPipeHandleStateA ! FUNCTION: GetNamedPipeHandleStateA
@ -1052,7 +1051,7 @@ FUNCTION: HANDLE GetStdHandle ( DWORD nStdHandle ) ;
! FUNCTION: GetSystemDefaultUILanguage ! FUNCTION: GetSystemDefaultUILanguage
! FUNCTION: GetSystemDirectoryA ! FUNCTION: GetSystemDirectoryA
FUNCTION: UINT GetSystemDirectoryW ( LPTSTR lpBuffer, UINT uSize ) ; FUNCTION: UINT GetSystemDirectoryW ( LPTSTR lpBuffer, UINT uSize ) ;
: GetSystemDirectory ( lpBuffer uSize -- UINT ) GetSystemDirectoryW ; inline ALIAS: GetSystemDirectory GetSystemDirectoryW
FUNCTION: void GetSystemInfo ( LPSYSTEM_INFO lpSystemInfo ) ; FUNCTION: void GetSystemInfo ( LPSYSTEM_INFO lpSystemInfo ) ;
! FUNCTION: GetSystemPowerStatus ! FUNCTION: GetSystemPowerStatus
! FUNCTION: GetSystemRegistryQuota ! FUNCTION: GetSystemRegistryQuota
@ -1062,7 +1061,7 @@ FUNCTION: void GetSystemTimeAsFileTime ( LPFILETIME lpSystemTimeAsFileTime ) ;
! FUNCTION: GetSystemTimes ! FUNCTION: GetSystemTimes
! FUNCTION: GetSystemWindowsDirectoryA ! FUNCTION: GetSystemWindowsDirectoryA
FUNCTION: UINT GetSystemWindowsDirectoryW ( LPTSTR lpBuffer, UINT uSize ) ; FUNCTION: UINT GetSystemWindowsDirectoryW ( LPTSTR lpBuffer, UINT uSize ) ;
: GetSystemWindowsDirectory ( lpBuffer uSize -- UINT ) GetSystemWindowsDirectoryW ; inline ALIAS: GetSystemWindowsDirectory GetSystemWindowsDirectoryW
! FUNCTION: GetSystemWow64DirectoryA ! FUNCTION: GetSystemWow64DirectoryA
! FUNCTION: GetSystemWow64DirectoryW ! FUNCTION: GetSystemWow64DirectoryW
! FUNCTION: GetTapeParameters ! FUNCTION: GetTapeParameters
@ -1090,7 +1089,7 @@ FUNCTION: DWORD GetTimeZoneInformation ( LPTIME_ZONE_INFORMATION lpTimeZoneInfor
! FUNCTION: GetVDMCurrentDirectories ! FUNCTION: GetVDMCurrentDirectories
FUNCTION: DWORD GetVersion ( ) ; FUNCTION: DWORD GetVersion ( ) ;
FUNCTION: BOOL GetVersionExW ( LPOSVERSIONINFO lpVersionInfo ) ; FUNCTION: BOOL GetVersionExW ( LPOSVERSIONINFO lpVersionInfo ) ;
: GetVersionEx ( lpVersionInfo -- BOOL ) GetVersionExW ; ALIAS: GetVersionEx GetVersionExW
! FUNCTION: GetVolumeInformationA ! FUNCTION: GetVolumeInformationA
! FUNCTION: GetVolumeInformationW ! FUNCTION: GetVolumeInformationW
! FUNCTION: GetVolumeNameForVolumeMountPointA ! FUNCTION: GetVolumeNameForVolumeMountPointA
@ -1101,7 +1100,7 @@ FUNCTION: BOOL GetVersionExW ( LPOSVERSIONINFO lpVersionInfo ) ;
! FUNCTION: GetVolumePathNameW ! FUNCTION: GetVolumePathNameW
! FUNCTION: GetWindowsDirectoryA ! FUNCTION: GetWindowsDirectoryA
FUNCTION: UINT GetWindowsDirectoryW ( LPTSTR lpBuffer, UINT uSize ) ; FUNCTION: UINT GetWindowsDirectoryW ( LPTSTR lpBuffer, UINT uSize ) ;
: GetWindowsDirectory ( lpBuffer uSize -- UINT ) GetWindowsDirectoryW ; inline ALIAS: GetWindowsDirectory GetWindowsDirectoryW
! FUNCTION: GetWriteWatch ! FUNCTION: GetWriteWatch
! FUNCTION: GlobalAddAtomA ! FUNCTION: GlobalAddAtomA
! FUNCTION: GlobalAddAtomW ! FUNCTION: GlobalAddAtomW
@ -1253,7 +1252,7 @@ FUNCTION: LPVOID MapViewOfFileEx ( HANDLE hFileMappingObject,
! FUNCTION: MoveFileExA ! FUNCTION: MoveFileExA
! FUNCTION: MoveFileExW ! FUNCTION: MoveFileExW
FUNCTION: BOOL MoveFileW ( LPCTSTR lpExistingFileName, LPCTSTR lpNewFileName ) ; FUNCTION: BOOL MoveFileW ( LPCTSTR lpExistingFileName, LPCTSTR lpNewFileName ) ;
: MoveFile ( lpExistingFileName lpNewFileName -- BOOL ) MoveFileW ; ALIAS: MoveFile MoveFileW
! FUNCTION: MoveFileWithProgressA ! FUNCTION: MoveFileWithProgressA
! FUNCTION: MoveFileWithProgressW ! FUNCTION: MoveFileWithProgressW
! FUNCTION: MulDiv ! FUNCTION: MulDiv
@ -1271,7 +1270,7 @@ FUNCTION: BOOL MoveFileW ( LPCTSTR lpExistingFileName, LPCTSTR lpNewFileName ) ;
FUNCTION: HANDLE OpenFileMappingW ( DWORD dwDesiredAccess, FUNCTION: HANDLE OpenFileMappingW ( DWORD dwDesiredAccess,
BOOL bInheritHandle, BOOL bInheritHandle,
LPCTSTR lpName ) ; LPCTSTR lpName ) ;
: OpenFileMapping ( dwDesiredAccess bInheritHandle lpName -- HANDLE ) OpenFileMappingW ; ALIAS: OpenFileMapping OpenFileMappingW
! FUNCTION: OpenJobObjectA ! FUNCTION: OpenJobObjectA
! FUNCTION: OpenJobObjectW ! FUNCTION: OpenJobObjectW
! FUNCTION: OpenMutexA ! FUNCTION: OpenMutexA
@ -1341,7 +1340,7 @@ FUNCTION: BOOL ReadProcessMemory ( HANDLE hProcess, void* lpBaseAddress, void* l
! FUNCTION: ReleaseSemaphore ! FUNCTION: ReleaseSemaphore
! FUNCTION: RemoveDirectoryA ! FUNCTION: RemoveDirectoryA
FUNCTION: BOOL RemoveDirectoryW ( LPCTSTR lpPathName ) ; FUNCTION: BOOL RemoveDirectoryW ( LPCTSTR lpPathName ) ;
: RemoveDirectory ( lpPathName -- BOOL ) RemoveDirectoryW ; ALIAS: RemoveDirectory RemoveDirectoryW
! FUNCTION: RemoveLocalAlternateComputerNameA ! FUNCTION: RemoveLocalAlternateComputerNameA
! FUNCTION: RemoveLocalAlternateComputerNameW ! FUNCTION: RemoveLocalAlternateComputerNameW
! FUNCTION: RemoveVectoredExceptionHandler ! FUNCTION: RemoveVectoredExceptionHandler
@ -1405,13 +1404,13 @@ FUNCTION: BOOL RemoveDirectoryW ( LPCTSTR lpPathName ) ;
! FUNCTION: SetConsoleScreenBufferSize ! FUNCTION: SetConsoleScreenBufferSize
FUNCTION: BOOL SetConsoleTextAttribute ( HANDLE hConsoleOutput, WORD wAttributes ) ; FUNCTION: BOOL SetConsoleTextAttribute ( HANDLE hConsoleOutput, WORD wAttributes ) ;
FUNCTION: BOOL SetConsoleTitleW ( LPCWSTR lpConsoleTitle ) ; FUNCTION: BOOL SetConsoleTitleW ( LPCWSTR lpConsoleTitle ) ;
: SetConsoleTitle ( lpConsoleTitle -- BOOL ) SetConsoleTitleW ; ALIAS: SetConsoleTitle SetConsoleTitleW
! FUNCTION: SetConsoleWindowInfo ! FUNCTION: SetConsoleWindowInfo
! FUNCTION: SetCPGlobal ! FUNCTION: SetCPGlobal
! FUNCTION: SetCriticalSectionSpinCount ! FUNCTION: SetCriticalSectionSpinCount
! FUNCTION: SetCurrentDirectoryA ! FUNCTION: SetCurrentDirectoryA
FUNCTION: BOOL SetCurrentDirectoryW ( LPCWSTR lpDirectory ) ; FUNCTION: BOOL SetCurrentDirectoryW ( LPCWSTR lpDirectory ) ;
: SetCurrentDirectory ( lpDirectory -- BOOL ) SetCurrentDirectoryW ; inline ALIAS: SetCurrentDirectory SetCurrentDirectoryW
! FUNCTION: SetDefaultCommConfigA ! FUNCTION: SetDefaultCommConfigA
! FUNCTION: SetDefaultCommConfigW ! FUNCTION: SetDefaultCommConfigW
! FUNCTION: SetDllDirectoryA ! FUNCTION: SetDllDirectoryA

2
extra/windows/opengl32/opengl32.factor Normal file → Executable file
View File

@ -71,7 +71,7 @@ IN: windows.opengl32
: WGL_SWAP_UNDERLAY14 HEX: 20000000 ; inline : WGL_SWAP_UNDERLAY14 HEX: 20000000 ; inline
: WGL_SWAP_UNDERLAY15 HEX: 40000000 ; inline : WGL_SWAP_UNDERLAY15 HEX: 40000000 ; inline
: pfd-dwFlags : pfd-dwFlags ( -- n )
{ PFD_DRAW_TO_WINDOW PFD_SUPPORT_OPENGL PFD_DOUBLEBUFFER } flags ; { PFD_DRAW_TO_WINDOW PFD_SUPPORT_OPENGL PFD_DOUBLEBUFFER } flags ;
! TODO: compare to http://www.nullterminator.net/opengl32.html ! TODO: compare to http://www.nullterminator.net/opengl32.html

62
extra/windows/user32/user32.factor Normal file → Executable file
View File

@ -1,7 +1,7 @@
! Copyright (C) 2005, 2006 Doug Coleman. ! Copyright (C) 2005, 2006 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: alien alien.syntax parser namespaces kernel math USING: alien alien.syntax parser namespaces kernel math
windows.types shuffle math.bitfields ; windows.types shuffle math.bitfields alias ;
IN: windows.user32 IN: windows.user32
! HKL for ActivateKeyboardLayout ! HKL for ActivateKeyboardLayout
@ -32,7 +32,7 @@ IN: windows.user32
: WS_MAXIMIZEBOX HEX: 00010000 ; inline : WS_MAXIMIZEBOX HEX: 00010000 ; inline
! Common window styles ! Common window styles
: WS_OVERLAPPEDWINDOW : WS_OVERLAPPEDWINDOW ( -- n )
{ {
WS_OVERLAPPED WS_OVERLAPPED
WS_CAPTION WS_CAPTION
@ -42,7 +42,7 @@ IN: windows.user32
WS_MAXIMIZEBOX WS_MAXIMIZEBOX
} flags ; foldable } flags ; foldable
: WS_POPUPWINDOW : WS_POPUPWINDOW ( -- n )
{ WS_POPUP WS_BORDER WS_SYSMENU } flags ; foldable { WS_POPUP WS_BORDER WS_SYSMENU } flags ; foldable
: WS_CHILDWINDOW WS_CHILD ; inline : WS_CHILDWINDOW WS_CHILD ; inline
@ -50,7 +50,7 @@ IN: windows.user32
: WS_TILED WS_OVERLAPPED ; inline : WS_TILED WS_OVERLAPPED ; inline
: WS_ICONIC WS_MINIMIZE ; inline : WS_ICONIC WS_MINIMIZE ; inline
: WS_SIZEBOX WS_THICKFRAME ; inline : WS_SIZEBOX WS_THICKFRAME ; inline
: WS_TILEDWINDOW WS_OVERLAPPEDWINDOW ; inline : WS_TILEDWINDOW WS_OVERLAPPEDWINDOW ; inline
! Extended window styles ! Extended window styles
@ -606,14 +606,14 @@ FUNCTION: BOOL CloseClipboard ( ) ;
! FUNCTION: CloseWindowStation ! FUNCTION: CloseWindowStation
! FUNCTION: CopyAcceleratorTableA ! FUNCTION: CopyAcceleratorTableA
FUNCTION: int CopyAcceleratorTableW ( HACCEL hAccelSrc, LPACCEL lpAccelDst, int cAccelEntries ) ; FUNCTION: int CopyAcceleratorTableW ( HACCEL hAccelSrc, LPACCEL lpAccelDst, int cAccelEntries ) ;
: CopyAcceleratorTable CopyAcceleratorTableW ; inline ALIAS: CopyAcceleratorTable CopyAcceleratorTableW
! FUNCTION: CopyIcon ! FUNCTION: CopyIcon
! FUNCTION: CopyImage ! FUNCTION: CopyImage
! FUNCTION: CopyRect ! FUNCTION: CopyRect
! FUNCTION: CountClipboardFormats ! FUNCTION: CountClipboardFormats
! FUNCTION: CreateAcceleratorTableA ! FUNCTION: CreateAcceleratorTableA
FUNCTION: HACCEL CreateAcceleratorTableW ( LPACCEL lpaccl, int cEntries ) ; FUNCTION: HACCEL CreateAcceleratorTableW ( LPACCEL lpaccl, int cEntries ) ;
: CreateAcceleratorTable CreateAcceleratorTableW ; inline ALIAS: CreateAcceleratorTable CreateAcceleratorTableW
! FUNCTION: CreateCaret ! FUNCTION: CreateCaret
! FUNCTION: CreateCursor ! FUNCTION: CreateCursor
! FUNCTION: CreateDesktopA ! FUNCTION: CreateDesktopA
@ -647,9 +647,9 @@ FUNCTION: HWND CreateWindowExW (
HINSTANCE hInstance, HINSTANCE hInstance,
LPVOID lpParam ) ; LPVOID lpParam ) ;
: CreateWindowEx CreateWindowExW ; inline ALIAS: CreateWindowEx CreateWindowExW
: CreateWindow 0 12 -nrot CreateWindowEx ; : CreateWindow 0 12 -nrot CreateWindowEx ; inline
! FUNCTION: CreateWindowStationA ! FUNCTION: CreateWindowStationA
@ -698,7 +698,7 @@ FUNCTION: HWND CreateWindowExW (
! FUNCTION: DefMDIChildProcW ! FUNCTION: DefMDIChildProcW
! FUNCTION: DefRawInputProc ! FUNCTION: DefRawInputProc
FUNCTION: LRESULT DefWindowProcW ( HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam ) ; FUNCTION: LRESULT DefWindowProcW ( HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam ) ;
: DefWindowProc DefWindowProcW ; inline ALIAS: DefWindowProc DefWindowProcW
! FUNCTION: DeleteMenu ! FUNCTION: DeleteMenu
! FUNCTION: DeregisterShellHookWindow ! FUNCTION: DeregisterShellHookWindow
FUNCTION: BOOL DestroyAcceleratorTable ( HACCEL hAccel ) ; FUNCTION: BOOL DestroyAcceleratorTable ( HACCEL hAccel ) ;
@ -717,7 +717,7 @@ FUNCTION: BOOL DestroyWindow ( HWND hWnd ) ;
! FUNCTION: DisableProcessWindowsGhosting ! FUNCTION: DisableProcessWindowsGhosting
FUNCTION: LONG DispatchMessageW ( MSG* lpMsg ) ; FUNCTION: LONG DispatchMessageW ( MSG* lpMsg ) ;
: DispatchMessage DispatchMessageW ; inline ALIAS: DispatchMessage DispatchMessageW
! FUNCTION: DisplayExitWindowsWarnings ! FUNCTION: DisplayExitWindowsWarnings
! FUNCTION: DlgDirListA ! FUNCTION: DlgDirListA
@ -808,14 +808,14 @@ FUNCTION: HWND GetCapture ( ) ;
! FUNCTION: GetCaretBlinkTime ! FUNCTION: GetCaretBlinkTime
! FUNCTION: GetCaretPos ! FUNCTION: GetCaretPos
FUNCTION: BOOL GetClassInfoW ( HINSTANCE hInst, LPCWSTR lpszClass, LPWNDCLASS lpwcx ) ; FUNCTION: BOOL GetClassInfoW ( HINSTANCE hInst, LPCWSTR lpszClass, LPWNDCLASS lpwcx ) ;
: GetClassInfo GetClassInfoW ; ALIAS: GetClassInfo GetClassInfoW
FUNCTION: BOOL GetClassInfoExW ( HINSTANCE hInst, LPCWSTR lpszClass, LPWNDCLASSEX lpwcx ) ; FUNCTION: BOOL GetClassInfoExW ( HINSTANCE hInst, LPCWSTR lpszClass, LPWNDCLASSEX lpwcx ) ;
: GetClassInfoEx GetClassInfoExW ; inline ALIAS: GetClassInfoEx GetClassInfoExW
FUNCTION: ULONG_PTR GetClassLongW ( HWND hWnd, int nIndex ) ; FUNCTION: ULONG_PTR GetClassLongW ( HWND hWnd, int nIndex ) ;
: GetClassLong GetClassLongW ; inline ALIAS: GetClassLong GetClassLongW
: GetClassLongPtr GetClassLongW ; inline ALIAS: GetClassLongPtr GetClassLongW
! FUNCTION: GetClassNameA ! FUNCTION: GetClassNameA
@ -884,7 +884,7 @@ FUNCTION: SHORT GetKeyState ( int nVirtKey ) ;
! FUNCTION: GetMenuStringW ! FUNCTION: GetMenuStringW
FUNCTION: BOOL GetMessageW ( LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax ) ; FUNCTION: BOOL GetMessageW ( LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax ) ;
: GetMessage GetMessageW ; inline ALIAS: GetMessage GetMessageW
! FUNCTION: GetMessageExtraInfo ! FUNCTION: GetMessageExtraInfo
! FUNCTION: GetMessagePos ! FUNCTION: GetMessagePos
@ -1020,11 +1020,11 @@ FUNCTION: HACCEL LoadAcceleratorsW ( HINSTANCE hInstance, LPCTSTR lpTableName )
! FUNCTION: HCURSOR LoadCursorW ( HINSTANCE hInstance, LPCWSTR lpCursorName ) ; ! FUNCTION: HCURSOR LoadCursorW ( HINSTANCE hInstance, LPCWSTR lpCursorName ) ;
FUNCTION: HCURSOR LoadCursorW ( HINSTANCE hInstance, ushort lpCursorName ) ; FUNCTION: HCURSOR LoadCursorW ( HINSTANCE hInstance, ushort lpCursorName ) ;
: LoadCursor LoadCursorW ; inline ALIAS: LoadCursor LoadCursorW
! FUNCTION: HICON LoadIconA ( HINSTANCE hInstance, LPCTSTR lpIconName ) ; ! FUNCTION: HICON LoadIconA ( HINSTANCE hInstance, LPCTSTR lpIconName ) ;
FUNCTION: HICON LoadIconW ( HINSTANCE hInstance, LPCTSTR lpIconName ) ; FUNCTION: HICON LoadIconW ( HINSTANCE hInstance, LPCTSTR lpIconName ) ;
: LoadIcon LoadIconW ; inline ALIAS: LoadIcon LoadIconW
! FUNCTION: LoadImageA ! FUNCTION: LoadImageA
! FUNCTION: LoadImageW ! FUNCTION: LoadImageW
@ -1048,10 +1048,10 @@ FUNCTION: HICON LoadIconW ( HINSTANCE hInstance, LPCTSTR lpIconName ) ;
! FUNCTION: MapDialogRect ! FUNCTION: MapDialogRect
FUNCTION: UINT MapVirtualKeyW ( UINT uCode, UINT uMapType ) ; FUNCTION: UINT MapVirtualKeyW ( UINT uCode, UINT uMapType ) ;
: MapVirtualKey MapVirtualKeyW ; inline ALIAS: MapVirtualKey MapVirtualKeyW
FUNCTION: UINT MapVirtualKeyExW ( UINT uCode, UINT uMapType, HKL dwhkl ) ; FUNCTION: UINT MapVirtualKeyExW ( UINT uCode, UINT uMapType, HKL dwhkl ) ;
: MapVirtualKeyEx MapVirtualKeyExW ; inline ALIAS: MapVirtualKeyEx MapVirtualKeyExW
! FUNCTION: MapWindowPoints ! FUNCTION: MapWindowPoints
! FUNCTION: MB_GetString ! FUNCTION: MB_GetString
@ -1093,9 +1093,9 @@ FUNCTION: int MessageBoxExW (
! FUNCTION: int MessageBoxIndirectW ( MSGBOXPARAMSW* params ) ; ! FUNCTION: int MessageBoxIndirectW ( MSGBOXPARAMSW* params ) ;
: MessageBox MessageBoxW ; ALIAS: MessageBox MessageBoxW
: MessageBoxEx MessageBoxExW ; ALIAS: MessageBoxEx MessageBoxExW
! : MessageBoxIndirect ! : MessageBoxIndirect
! \ MessageBoxIndirectW \ MessageBoxIndirectA unicode-exec ; ! \ MessageBoxIndirectW \ MessageBoxIndirectA unicode-exec ;
@ -1140,7 +1140,7 @@ FUNCTION: BOOL OpenClipboard ( HWND hWndNewOwner ) ;
! FUNCTION: PaintMenuBar ! FUNCTION: PaintMenuBar
FUNCTION: BOOL PeekMessageA ( LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg ) ; FUNCTION: BOOL PeekMessageA ( LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg ) ;
FUNCTION: BOOL PeekMessageW ( LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg ) ; FUNCTION: BOOL PeekMessageW ( LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg ) ;
: PeekMessage PeekMessageW ; ALIAS: PeekMessage PeekMessageW
! FUNCTION: PostMessageA ! FUNCTION: PostMessageA
! FUNCTION: PostMessageW ! FUNCTION: PostMessageW
@ -1166,13 +1166,13 @@ FUNCTION: void PostQuitMessage ( int nExitCode ) ;
! FUNCTION: RecordShutdownReason ! FUNCTION: RecordShutdownReason
! FUNCTION: RedrawWindow ! FUNCTION: RedrawWindow
FUNCTION: ATOM RegisterClassA ( WNDCLASS* lpWndClass) ; FUNCTION: ATOM RegisterClassA ( WNDCLASS* lpWndClass ) ;
FUNCTION: ATOM RegisterClassW ( WNDCLASS* lpWndClass ) ; FUNCTION: ATOM RegisterClassW ( WNDCLASS* lpWndClass ) ;
FUNCTION: ATOM RegisterClassExA ( WNDCLASSEX* lpwcx ) ; FUNCTION: ATOM RegisterClassExA ( WNDCLASSEX* lpwcx ) ;
FUNCTION: ATOM RegisterClassExW ( WNDCLASSEX* lpwcx ) ; FUNCTION: ATOM RegisterClassExW ( WNDCLASSEX* lpwcx ) ;
: RegisterClass RegisterClassW ; ALIAS: RegisterClass RegisterClassW
: RegisterClassEx RegisterClassExW ; ALIAS: RegisterClassEx RegisterClassExW
! FUNCTION: RegisterClipboardFormatA ! FUNCTION: RegisterClipboardFormatA
! FUNCTION: RegisterClipboardFormatW ! FUNCTION: RegisterClipboardFormatW
@ -1208,7 +1208,7 @@ FUNCTION: int ReleaseDC ( HWND hWnd, HDC hDC ) ;
! FUNCTION: SendIMEMessageExW ! FUNCTION: SendIMEMessageExW
! FUNCTION: UINT SendInput ( UINT nInputs, LPINPUT pInputs, int cbSize ) ; ! FUNCTION: UINT SendInput ( UINT nInputs, LPINPUT pInputs, int cbSize ) ;
FUNCTION: LRESULT SendMessageW ( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ) ; FUNCTION: LRESULT SendMessageW ( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ) ;
: SendMessage SendMessageW ; ALIAS: SendMessage SendMessageW
! FUNCTION: SendMessageCallbackA ! FUNCTION: SendMessageCallbackA
! FUNCTION: SendMessageCallbackW ! FUNCTION: SendMessageCallbackW
! FUNCTION: SendMessageTimeoutA ! FUNCTION: SendMessageTimeoutA
@ -1221,8 +1221,8 @@ FUNCTION: HWND SetCapture ( HWND hWnd ) ;
! FUNCTION: SetCaretPos ! FUNCTION: SetCaretPos
FUNCTION: ULONG_PTR SetClassLongW ( HWND hWnd, int nIndex, LONG_PTR dwNewLong ) ; FUNCTION: ULONG_PTR SetClassLongW ( HWND hWnd, int nIndex, LONG_PTR dwNewLong ) ;
: SetClassLongPtr SetClassLongW ; ALIAS: SetClassLongPtr SetClassLongW
: SetClassLong SetClassLongW ; ALIAS: SetClassLong SetClassLongW
! FUNCTION: SetClassWord ! FUNCTION: SetClassWord
FUNCTION: HANDLE SetClipboardData ( UINT uFormat, HANDLE hMem ) ; FUNCTION: HANDLE SetClipboardData ( UINT uFormat, HANDLE hMem ) ;
@ -1243,7 +1243,7 @@ FUNCTION: BOOL SetForegroundWindow ( HWND hWnd ) ;
! FUNCTION: SetKeyboardState ! FUNCTION: SetKeyboardState
! type is ignored ! type is ignored
FUNCTION: void SetLastErrorEx ( DWORD dwErrCode, DWORD dwType ) ; FUNCTION: void SetLastErrorEx ( DWORD dwErrCode, DWORD dwType ) ;
: SetLastError 0 SetLastErrorEx ; : SetLastError 0 SetLastErrorEx ; inline
! FUNCTION: SetLayeredWindowAttributes ! FUNCTION: SetLayeredWindowAttributes
! FUNCTION: SetLogonNotifyWindow ! FUNCTION: SetLogonNotifyWindow
! FUNCTION: SetMenu ! FUNCTION: SetMenu
@ -1330,7 +1330,7 @@ FUNCTION: BOOL TrackMouseEvent ( LPTRACKMOUSEEVENT lpEventTrack ) ;
! FUNCTION: TranslateAccelerator ! FUNCTION: TranslateAccelerator
! FUNCTION: TranslateAcceleratorA ! FUNCTION: TranslateAcceleratorA
FUNCTION: int TranslateAcceleratorW ( HWND hWnd, HACCEL hAccTable, LPMSG lpMsg ) ; FUNCTION: int TranslateAcceleratorW ( HWND hWnd, HACCEL hAccTable, LPMSG lpMsg ) ;
: TranslateAccelerator TranslateAcceleratorW ; inline ALIAS: TranslateAccelerator TranslateAcceleratorW
! FUNCTION: TranslateMDISysAccel ! FUNCTION: TranslateMDISysAccel
FUNCTION: BOOL TranslateMessage ( MSG* lpMsg ) ; FUNCTION: BOOL TranslateMessage ( MSG* lpMsg ) ;
@ -1343,7 +1343,7 @@ FUNCTION: BOOL TranslateMessage ( MSG* lpMsg ) ;
! FUNCTION: UnlockWindowStation ! FUNCTION: UnlockWindowStation
! FUNCTION: UnpackDDElParam ! FUNCTION: UnpackDDElParam
FUNCTION: BOOL UnregisterClassW ( LPCWSTR lpClassName, HINSTANCE hInstance ) ; FUNCTION: BOOL UnregisterClassW ( LPCWSTR lpClassName, HINSTANCE hInstance ) ;
: UnregisterClass UnregisterClassW ; ALIAS: UnregisterClass UnregisterClassW
! FUNCTION: UnregisterDeviceNotification ! FUNCTION: UnregisterDeviceNotification
! FUNCTION: UnregisterHotKey ! FUNCTION: UnregisterHotKey
! FUNCTION: UnregisterMessagePumpHook ! FUNCTION: UnregisterMessagePumpHook

View File

@ -2,7 +2,7 @@
USING: alien alien.c-types alien.strings alien.syntax arrays USING: alien alien.c-types alien.strings alien.syntax arrays
byte-arrays kernel math sequences windows.types windows.kernel32 byte-arrays kernel math sequences windows.types windows.kernel32
windows.errors structs windows math.bitfields ; windows.errors structs windows math.bitfields alias ;
IN: windows.winsock IN: windows.winsock
USE: libc USE: libc
@ -74,7 +74,7 @@ TYPEDEF: void* SOCKET
: AI_PASSIVE 1 ; inline : AI_PASSIVE 1 ; inline
: AI_CANONNAME 2 ; inline : AI_CANONNAME 2 ; inline
: AI_NUMERICHOST 4 ; inline : AI_NUMERICHOST 4 ; inline
: AI_MASK { AI_PASSIVE AI_CANONNAME AI_NUMERICHOST } flags ; : AI_MASK ( -- n ) { AI_PASSIVE AI_CANONNAME AI_NUMERICHOST } flags ;
: NI_NUMERICHOST 1 ; : NI_NUMERICHOST 1 ;
: NI_NUMERICSERV 2 ; : NI_NUMERICSERV 2 ;
@ -138,7 +138,7 @@ C-STRUCT: addrinfo
{ "sockaddr*" "addr" } { "sockaddr*" "addr" }
{ "addrinfo*" "next" } ; { "addrinfo*" "next" } ;
: hostent-addr hostent-addr-list *void* ; ! *uint ; : hostent-addr ( hostent -- addr ) hostent-addr-list *void* ; ! *uint ;
LIBRARY: winsock LIBRARY: winsock
@ -365,7 +365,7 @@ FUNCTION: SOCKET WSASocketW ( int af,
LPWSAPROTOCOL_INFOW lpProtocolInfo, LPWSAPROTOCOL_INFOW lpProtocolInfo,
GROUP g, GROUP g,
DWORD flags ) ; DWORD flags ) ;
: WSASocket WSASocketW ; ALIAS: WSASocket WSASocketW
FUNCTION: DWORD WSAWaitForMultipleEvents ( DWORD cEvents, FUNCTION: DWORD WSAWaitForMultipleEvents ( DWORD cEvents,
WSAEVENT* lphEvents, WSAEVENT* lphEvents,
@ -384,7 +384,7 @@ FUNCTION: void GetAcceptExSockaddrs ( void* a, int b, int c, int d, void* e, voi
: SIO_GET_EXTENSION_FUNCTION_POINTER -939524090 ; inline : SIO_GET_EXTENSION_FUNCTION_POINTER -939524090 ; inline
: WSAID_CONNECTEX : WSAID_CONNECTEX ( -- GUID )
"GUID" <c-object> "GUID" <c-object>
HEX: 25a207b9 over set-GUID-Data1 HEX: 25a207b9 over set-GUID-Data1
HEX: ddf3 over set-GUID-Data2 HEX: ddf3 over set-GUID-Data2