gitter compilin'

db4
Doug Coleman 2008-12-10 00:31:57 -06:00
parent f9332aa907
commit 3e587c2f89
3 changed files with 39 additions and 9 deletions

View File

@ -71,7 +71,7 @@ M: pasteboard set-clipboard-contents drop copy ;
<clipboard> selection set-global ;
TUPLE: win-base hDC hRC ;
TUPLE: win hWnd < win-base world title ;
TUPLE: win < win-base hWnd world title ;
TUPLE: win-offscreen < win-base hBitmap bits ;
C: <win> win
C: <win-offscreen> win-offscreen
@ -495,7 +495,7 @@ M: windows-ui-backend do-events
get-dc dup windowed-pfd-dwFlags setup-pixel-format dup get-rc ;
M: windows-ui-backend (open-window) ( world -- )
[ create-window dup setup-gl ] keep
[ create-window [ setup-gl ] keep ] keep
[ f <win> ] keep
[ swap hWnd>> register-window ] 2keep
dupd (>>handle)
@ -526,7 +526,7 @@ M: win-base flush-gl-context ( handle -- )
: make-offscreen-dc-and-bitmap ( dim -- hDC hBitmap bits )
f CreateCompatibleDC
swap (bitmap-info) DIB_RGB_COLORS f <void*>
dup rot (bitmap-info) DIB_RGB_COLORS f <void*>
[ f 0 CreateDIBSection ] keep *void*
[ 2dup SelectObject drop ] dip ;
@ -540,13 +540,12 @@ M: windows-ui-backend (open-offscreen-buffer) ( world -- )
dup dim>> setup-offscreen-gl <win-offscreen>
>>handle drop ;
M: windows-ui-backend (close-offscreen-buffer) ( handle -- )
[ hDC>> DeleteObject drop ]
[ hDC>> DeleteDC drop ]
[ hBitmap>> DeleteObject drop ] bi ;
M: win-offscreen offscreen-pixels ( handle -- alien )
bits>> ;
! Move window to front
M: windows-ui-backend raise-window* ( world -- )
handle>> [
hWnd>> SetFocus drop

16
basis/windows/gdi32/gdi32.factor Normal file → Executable file
View File

@ -26,6 +26,14 @@ IN: windows.gdi32
: DC_BRUSH 18 ; inline
: DC_PEN 19 ; inline
: BI_RGB 0 ; inline
: BI_RLE8 1 ; inline
: BI_RLE4 2 ; inline
: BI_BITFIELDS 3 ; inline
: DIB_RGB_COLORS 0 ; inline
: DIB_PAL_COLORS 1 ; inline
LIBRARY: gdi32
! FUNCTION: AbortPath
@ -75,13 +83,13 @@ FUNCTION: int ChoosePixelFormat ( HDC hDC, PFD* ppfd ) ;
! FUNCTION: CreateColorSpaceA
! FUNCTION: CreateColorSpaceW
! FUNCTION: CreateCompatibleBitmap
! FUNCTION: CreateCompatibleDC
FUNCTION: HDC CreateCompatibleDC ( HDC hdc ) ;
! FUNCTION: CreateDCA
! FUNCTION: CreateDCW
! FUNCTION: CreateDIBitmap
! FUNCTION: CreateDIBPatternBrush
! FUNCTION: CreateDIBPatternBrushPt
! FUNCTION: CreateDIBSection
FUNCTION: HBITMAP CreateDIBSection ( HDC hdc, BITMAPINFO* pbmi, UINT iUsage, void** ppvBits, HANDLE hSection, DWORD dwOffset ) ;
! FUNCTION: CreateDiscardableBitmap
! FUNCTION: CreateEllipticRgn
! FUNCTION: CreateEllipticRgnIndirect
@ -169,7 +177,7 @@ FUNCTION: HRGN CreateRectRgn ( int x, int y, int w, int h ) ;
! FUNCTION: DdEntry8
! FUNCTION: DdEntry9
! FUNCTION: DeleteColorSpace
! FUNCTION: DeleteDC
FUNCTION: BOOL DeleteDC ( HDC hdc ) ;
! FUNCTION: DeleteEnhMetaFile
! FUNCTION: DeleteMetaFile
FUNCTION: BOOL DeleteObject ( HGDIOBJ hObject ) ;
@ -552,7 +560,7 @@ FUNCTION: HGDIOBJ GetStockObject ( int fnObject ) ;
! FUNCTION: SelectClipPath
FUNCTION: int SelectClipRgn ( HDC hDC, HRGN hrgn ) ;
! FUNCTION: SelectFontLocal
! FUNCTION: SelectObject
FUNCTION: HGDIOBJ SelectObject ( HDC hdc, HGDIOBJ hgdiobj ) ;
! FUNCTION: SelectPalette
! FUNCTION: SetAbortProc
! FUNCTION: SetArcDirection

23
basis/windows/types/types.factor Normal file → Executable file
View File

@ -253,6 +253,29 @@ C-STRUCT: RECT
! { "BYTE[32]" "rgbReserved" }
! ;
C-STRUCT: BITMAPINFOHEADER
{ "DWORD" "biSize" }
{ "LONG" "biWidth" }
{ "LONG" "biHeight" }
{ "WORD" "biPlanes" }
{ "WORD" "biBitCount" }
{ "DWORD" "biCompression" }
{ "DWORD" "biSizeImage" }
{ "LONG" "biXPelsPerMeter" }
{ "LONG" "biYPelsPerMeter" }
{ "DWORD" "biClrUsed" }
{ "DWORD" "biClrImportant" } ;
C-STRUCT: RGBQUAD
{ "BYTE" "rgbBlue" }
{ "BYTE" "rgbGreen" }
{ "BYTE" "rgbRed" }
{ "BYTE" "rgbReserved" } ;
C-STRUCT: BITMAPINFO
{ "BITMAPINFOHEADER" "bmiHeader" }
{ "RGBQUAD[1]" "bmiColors" } ;
TYPEDEF: void* LPPAINTSTRUCT
TYPEDEF: void* PAINTSTRUCT