]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/windows/dwmapi/dwmapi.factor
windows: fix load errors
[factor.git] / basis / windows / dwmapi / dwmapi.factor
index e7e0b4b8efc9e89f882a21cfd14cea313f07a028..60fa5b4d83e8fc8e1e06c24273dfaace5efe9513 100755 (executable)
@@ -1,5 +1,7 @@
 ! (c)2009 Joe Groff bsd license
-USING: alien.c-types alien.libraries alien.syntax classes.struct windows.types ;
+USING: alien alien.c-types alien.data alien.libraries
+alien.syntax classes.struct kernel math system-info.windows
+windows.types ;
 IN: windows.dwmapi
 
 STRUCT: MARGINS
@@ -20,9 +22,17 @@ STRUCT: DWM_BLURBEHIND
 : full-window-margins ( -- MARGINS )
     -1 -1 -1 -1 <MARGINS> ; inline
 
-<< "dwmapi" "dwmapi.dll" "stdcall" add-library >>
+<< "dwmapi" "dwmapi.dll" stdcall add-library >>
 
 LIBRARY: dwmapi
 
 FUNCTION: HRESULT DwmExtendFrameIntoClientArea ( HWND hWnd, MARGINS* pMarInset ) ;
 FUNCTION: HRESULT DwmEnableBlurBehindWindow ( HWND hWnd, DWM_BLURBEHIND* pBlurBehind ) ;
+FUNCTION: HRESULT DwmIsCompositionEnabled ( BOOL* pfEnabled ) ;
+
+CONSTANT: WM_DWMCOMPOSITIONCHANGED HEX: 31E
+
+: composition-enabled? ( -- ? )
+    windows-major 6 >=
+    [ 0 <int> [ DwmIsCompositionEnabled drop ] keep *int c-bool> ]
+    [ f ] if ;