]> gitweb.factorcode.org Git - factor.git/blob - basis/windows/dwmapi/dwmapi.factor
Updating code to use with-out-parameters
[factor.git] / basis / windows / dwmapi / dwmapi.factor
1 ! (c)2009 Joe Groff bsd license
2 USING: alien alien.c-types alien.data alien.libraries
3 alien.syntax classes.struct kernel math system-info.windows
4 windows.types ;
5 IN: windows.dwmapi
6
7 STRUCT: MARGINS
8     { cxLeftWidth    int }
9     { cxRightWidth   int }
10     { cyTopHeight    int }
11     { cyBottomHeight int } ;
12
13 STRUCT: DWM_BLURBEHIND
14     { dwFlags                DWORD   }
15     { fEnable                BOOL    }
16     { hRgnBlur               HANDLE  }
17     { fTransitionOnMaximized BOOL    } ;
18
19 : <MARGINS> ( l r t b -- MARGINS )
20     MARGINS <struct-boa> ; inline
21
22 : full-window-margins ( -- MARGINS )
23     -1 -1 -1 -1 <MARGINS> ; inline
24
25 << "dwmapi" "dwmapi.dll" stdcall add-library >>
26
27 LIBRARY: dwmapi
28
29 FUNCTION: HRESULT DwmExtendFrameIntoClientArea ( HWND hWnd, MARGINS* pMarInset ) ;
30 FUNCTION: HRESULT DwmEnableBlurBehindWindow ( HWND hWnd, DWM_BLURBEHIND* pBlurBehind ) ;
31 FUNCTION: HRESULT DwmIsCompositionEnabled ( BOOL* pfEnabled ) ;
32
33 CONSTANT: WM_DWMCOMPOSITIONCHANGED HEX: 31E
34
35 : composition-enabled? ( -- ? )
36     windows-major 6 >=
37     [ { bool } [ DwmIsCompositionEnabled drop ] [ ] with-out-parameters ]
38     [ f ] if ;