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