! Copyright (C) 2008 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
-USING: accessors alien alien.data alien.c-types alien.data
-alien.strings alien.syntax arrays assocs classes.struct
-combinators combinators.short-circuit continuations destructors
-environment io io.backend io.binary io.buffers
-io.encodings.utf16n io.files io.files.private io.files.types
-io.pathnames io.ports io.streams.c io.streams.null io.timeouts
-kernel libc literals locals make math math.bitwise namespaces
-sequences specialized-arrays system threads tr windows
-windows.errors windows.handles windows.kernel32 windows.shell32
-windows.time windows.types ;
+USING: accessors alien alien.c-types alien.data alien.strings
+alien.syntax arrays assocs classes.struct combinators
+combinators.short-circuit continuations destructors environment
+io io.backend io.binary io.buffers io.encodings.utf16n io.files
+io.files.private io.files.types io.pathnames io.ports
+io.streams.c io.streams.null io.timeouts kernel libc literals
+locals make math math.bitwise namespaces sequences
+specialized-arrays system threads tr windows windows.errors
+windows.handles windows.kernel32 windows.shell32 windows.time
+windows.types ;
SPECIALIZED-ARRAY: ushort
IN: io.files.windows
drop f ;
: 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 ;
: arb-pixel-format-attribute ( pixel-format attribute -- value )
>WGL_ARB
[ drop f ] [
[ [ world>> handle>> hDC>> ] [ handle>> ] bi 0 1 ] dip
- first int <ref> { int }
+ first c:int <ref> { c:int }
[ wglGetPixelFormatAttribivARB win32-error=0/f ]
with-out-parameters
] if-empty ;
: >pfd ( attributes -- pfd )
[ PIXELFORMATDESCRIPTOR <struct> ] dip
{
- [ drop PIXELFORMATDESCRIPTOR heap-size >>nSize ]
+ [ drop PIXELFORMATDESCRIPTOR c:heap-size >>nSize ]
[ drop 1 >>nVersion ]
[ >pfd-flags >>dwFlags ]
[ drop PFD_TYPE_RGBA >>iPixelType ]
: get-pfd ( pixel-format -- pfd )
[ world>> handle>> hDC>> ] [ handle>> ] bi
- PIXELFORMATDESCRIPTOR heap-size
+ PIXELFORMATDESCRIPTOR c:heap-size
PIXELFORMATDESCRIPTOR <struct>
[ DescribePixelFormat win32-error=0/f ] keep ;
: pfd-flag? ( pfd flag -- ? )
- [ dwFlags>> ] dip bitand c-bool> ;
+ [ dwFlags>> ] dip bitand c:c-bool> ;
: (pfd-pixel-format-attribute) ( pfd attribute -- value )
{
: make-TRACKMOUSEEVENT ( hWnd -- alien )
TRACKMOUSEEVENT <struct>
swap >>hwndTrack
- TRACKMOUSEEVENT heap-size >>cbSize ;
+ TRACKMOUSEEVENT c:heap-size >>cbSize ;
: handle-wm-mousemove ( hWnd uMsg wParam lParam -- )
2nip
! return 0 if you handle the message, else just let DefWindowProc return its val
: ui-wndproc ( -- object )
- uint { void* uint long long } stdcall [
+ c:uint { c:void* c:uint c:long c:long } stdcall [
pick
trace-messages? get-global
:: register-window-class ( class-name-ptr -- )
WNDCLASSEX <struct> f GetModuleHandle
class-name-ptr pick GetClassInfoEx 0 = [
- WNDCLASSEX heap-size >>cbSize
+ WNDCLASSEX c:heap-size >>cbSize
flags{ CS_HREDRAW CS_VREDRAW CS_OWNDC } >>style
ui-wndproc >>lpfnWndProc
0 >>cbClsExtra
: fullscreen-RECT ( hwnd -- RECT )
MONITOR_DEFAULTTONEAREST MonitorFromWindow
MONITORINFOEX <struct>
- MONITORINFOEX heap-size >>cbSize
+ MONITORINFOEX c:heap-size >>cbSize
[ GetMonitorInfo win32-error=0/f ] keep rcMonitor>> ;
: client-area>RECT ( hwnd -- RECT )
-USING: alien alien.c-types alien.accessors alien.parser
-effects kernel windows.ole32 parser lexer splitting grouping
-sequences namespaces assocs quotations generalizations
+USING: alien alien.c-types alien.data alien.accessors
+alien.parser effects kernel windows.ole32 parser lexer splitting
+grouping sequences namespaces assocs quotations generalizations
accessors words macros alien.syntax fry arrays layouts math
classes.struct windows.kernel32 locals ;
FROM: alien.parser.private => parse-pointers return-type-name ;