]> gitweb.factorcode.org Git - factor.git/blob - basis/windows/dwmapi/dwmapi.factor
classes.struct: moving to new/boa instead of <struct>/<struct-boa>
[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 C: <MARGINS> MARGINS
15
16 STRUCT: DWM_BLURBEHIND
17     { dwFlags                DWORD   }
18     { fEnable                BOOL    }
19     { hRgnBlur               HANDLE  }
20     { fTransitionOnMaximized BOOL    } ;
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 0x31E
34
35 : composition-enabled? ( -- ? )
36     windows-major 6 >=
37     [ { bool } [ DwmIsCompositionEnabled drop ] with-out-parameters ]
38     [ f ] if ;