Update code for alien.data changes

db4
Slava Pestov 2010-12-26 02:08:57 -06:00
parent b0732bcb22
commit 13d6c6a698
3 changed files with 22 additions and 22 deletions

20
basis/io/files/windows/windows.factor Normal file → Executable file
View File

@ -1,15 +1,15 @@
! Copyright (C) 2008 Doug Coleman. ! Copyright (C) 2008 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: accessors alien alien.data alien.c-types alien.data USING: accessors alien alien.c-types alien.data alien.strings
alien.strings alien.syntax arrays assocs classes.struct alien.syntax arrays assocs classes.struct combinators
combinators combinators.short-circuit continuations destructors combinators.short-circuit continuations destructors environment
environment io io.backend io.binary io.buffers io io.backend io.binary io.buffers io.encodings.utf16n io.files
io.encodings.utf16n io.files io.files.private io.files.types io.files.private io.files.types io.pathnames io.ports
io.pathnames io.ports io.streams.c io.streams.null io.timeouts io.streams.c io.streams.null io.timeouts kernel libc literals
kernel libc literals locals make math math.bitwise namespaces locals make math math.bitwise namespaces sequences
sequences specialized-arrays system threads tr windows specialized-arrays system threads tr windows windows.errors
windows.errors windows.handles windows.kernel32 windows.shell32 windows.handles windows.kernel32 windows.shell32 windows.time
windows.time windows.types ; windows.types ;
SPECIALIZED-ARRAY: ushort SPECIALIZED-ARRAY: ushort
IN: io.files.windows IN: io.files.windows

View File

@ -60,14 +60,14 @@ PIXEL-FORMAT-ATTRIBUTE-TABLE: WGL_ARB { $ WGL_SUPPORT_OPENGL_ARB 1 } H{
drop f ; drop f ;
: arb-make-pixel-format ( world attributes -- pf ) : arb-make-pixel-format ( world attributes -- pf )
[ handle>> hDC>> ] dip >WGL_ARB-int-array f 1 { int int } [ handle>> hDC>> ] dip >WGL_ARB-int-array f 1 { c:int c:int }
[ wglChoosePixelFormatARB win32-error=0/f ] with-out-parameters drop ; [ wglChoosePixelFormatARB win32-error=0/f ] with-out-parameters drop ;
: arb-pixel-format-attribute ( pixel-format attribute -- value ) : arb-pixel-format-attribute ( pixel-format attribute -- value )
>WGL_ARB >WGL_ARB
[ drop f ] [ [ drop f ] [
[ [ world>> handle>> hDC>> ] [ handle>> ] bi 0 1 ] dip [ [ world>> handle>> hDC>> ] [ handle>> ] bi 0 1 ] dip
first int <ref> { int } first c:int <ref> { c:int }
[ wglGetPixelFormatAttribivARB win32-error=0/f ] [ wglGetPixelFormatAttribivARB win32-error=0/f ]
with-out-parameters with-out-parameters
] if-empty ; ] if-empty ;
@ -96,7 +96,7 @@ CONSTANT: pfd-flag-map H{
: >pfd ( attributes -- pfd ) : >pfd ( attributes -- pfd )
[ PIXELFORMATDESCRIPTOR <struct> ] dip [ PIXELFORMATDESCRIPTOR <struct> ] dip
{ {
[ drop PIXELFORMATDESCRIPTOR heap-size >>nSize ] [ drop PIXELFORMATDESCRIPTOR c:heap-size >>nSize ]
[ drop 1 >>nVersion ] [ drop 1 >>nVersion ]
[ >pfd-flags >>dwFlags ] [ >pfd-flags >>dwFlags ]
[ drop PFD_TYPE_RGBA >>iPixelType ] [ drop PFD_TYPE_RGBA >>iPixelType ]
@ -122,12 +122,12 @@ CONSTANT: pfd-flag-map H{
: get-pfd ( pixel-format -- pfd ) : get-pfd ( pixel-format -- pfd )
[ world>> handle>> hDC>> ] [ handle>> ] bi [ world>> handle>> hDC>> ] [ handle>> ] bi
PIXELFORMATDESCRIPTOR heap-size PIXELFORMATDESCRIPTOR c:heap-size
PIXELFORMATDESCRIPTOR <struct> PIXELFORMATDESCRIPTOR <struct>
[ DescribePixelFormat win32-error=0/f ] keep ; [ DescribePixelFormat win32-error=0/f ] keep ;
: pfd-flag? ( pfd flag -- ? ) : pfd-flag? ( pfd flag -- ? )
[ dwFlags>> ] dip bitand c-bool> ; [ dwFlags>> ] dip bitand c:c-bool> ;
: (pfd-pixel-format-attribute) ( pfd attribute -- value ) : (pfd-pixel-format-attribute) ( pfd attribute -- value )
{ {
@ -525,7 +525,7 @@ SYMBOL: nc-buttons
: make-TRACKMOUSEEVENT ( hWnd -- alien ) : make-TRACKMOUSEEVENT ( hWnd -- alien )
TRACKMOUSEEVENT <struct> TRACKMOUSEEVENT <struct>
swap >>hwndTrack swap >>hwndTrack
TRACKMOUSEEVENT heap-size >>cbSize ; TRACKMOUSEEVENT c:heap-size >>cbSize ;
: handle-wm-mousemove ( hWnd uMsg wParam lParam -- ) : handle-wm-mousemove ( hWnd uMsg wParam lParam -- )
2nip 2nip
@ -614,7 +614,7 @@ SYMBOL: trace-messages?
! return 0 if you handle the message, else just let DefWindowProc return its val ! return 0 if you handle the message, else just let DefWindowProc return its val
: ui-wndproc ( -- object ) : ui-wndproc ( -- object )
uint { void* uint long long } stdcall [ c:uint { c:void* c:uint c:long c:long } stdcall [
pick pick
trace-messages? get-global trace-messages? get-global
@ -636,7 +636,7 @@ M: windows-ui-backend do-events
:: register-window-class ( class-name-ptr -- ) :: register-window-class ( class-name-ptr -- )
WNDCLASSEX <struct> f GetModuleHandle WNDCLASSEX <struct> f GetModuleHandle
class-name-ptr pick GetClassInfoEx 0 = [ class-name-ptr pick GetClassInfoEx 0 = [
WNDCLASSEX heap-size >>cbSize WNDCLASSEX c:heap-size >>cbSize
flags{ CS_HREDRAW CS_VREDRAW CS_OWNDC } >>style flags{ CS_HREDRAW CS_VREDRAW CS_OWNDC } >>style
ui-wndproc >>lpfnWndProc ui-wndproc >>lpfnWndProc
0 >>cbClsExtra 0 >>cbClsExtra
@ -799,7 +799,7 @@ M: windows-ui-backend system-alert
: fullscreen-RECT ( hwnd -- RECT ) : fullscreen-RECT ( hwnd -- RECT )
MONITOR_DEFAULTTONEAREST MonitorFromWindow MONITOR_DEFAULTTONEAREST MonitorFromWindow
MONITORINFOEX <struct> MONITORINFOEX <struct>
MONITORINFOEX heap-size >>cbSize MONITORINFOEX c:heap-size >>cbSize
[ GetMonitorInfo win32-error=0/f ] keep rcMonitor>> ; [ GetMonitorInfo win32-error=0/f ] keep rcMonitor>> ;
: client-area>RECT ( hwnd -- RECT ) : client-area>RECT ( hwnd -- RECT )

6
basis/windows/com/syntax/syntax.factor Normal file → Executable file
View File

@ -1,6 +1,6 @@
USING: alien alien.c-types alien.accessors alien.parser USING: alien alien.c-types alien.data alien.accessors
effects kernel windows.ole32 parser lexer splitting grouping alien.parser effects kernel windows.ole32 parser lexer splitting
sequences namespaces assocs quotations generalizations grouping sequences namespaces assocs quotations generalizations
accessors words macros alien.syntax fry arrays layouts math accessors words macros alien.syntax fry arrays layouts math
classes.struct windows.kernel32 locals ; classes.struct windows.kernel32 locals ;
FROM: alien.parser.private => parse-pointers return-type-name ; FROM: alien.parser.private => parse-pointers return-type-name ;