From: Doug Coleman Date: Wed, 10 Dec 2008 06:31:57 +0000 (-0600) Subject: gitter compilin' X-Git-Tag: 0.94~2261^2~9 X-Git-Url: https://gitweb.factorcode.org/gitweb.cgi?p=factor.git;a=commitdiff_plain;h=3e587c2f89811e9434aa7d3fd7b95e1832312cb7 gitter compilin' --- diff --git a/basis/ui/windows/windows.factor b/basis/ui/windows/windows.factor index ab895c10dd..145cba82a3 100755 --- a/basis/ui/windows/windows.factor +++ b/basis/ui/windows/windows.factor @@ -71,7 +71,7 @@ M: pasteboard set-clipboard-contents drop copy ; 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 C: 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 ] 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 + dup rot (bitmap-info) DIB_RGB_COLORS f [ 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 >>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 diff --git a/basis/windows/gdi32/gdi32.factor b/basis/windows/gdi32/gdi32.factor old mode 100644 new mode 100755 index b9ba51844c..2ccd6b39f4 --- a/basis/windows/gdi32/gdi32.factor +++ b/basis/windows/gdi32/gdi32.factor @@ -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 diff --git a/basis/windows/types/types.factor b/basis/windows/types/types.factor old mode 100644 new mode 100755 index 63ee6627c4..8cc18d4039 --- a/basis/windows/types/types.factor +++ b/basis/windows/types/types.factor @@ -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