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