aboutsummaryrefslogtreecommitdiffstats
path: root/src/nativewindow/native/windows/WindowsDWM.c
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-02-27 18:20:37 +0100
committerSven Gothel <[email protected]>2012-02-27 18:20:37 +0100
commitb7407c39c0d3785f2fc21782d31c439622f0d744 (patch)
tree5ef1fc876f54e182fa8cdea0226f55783c324a2f /src/nativewindow/native/windows/WindowsDWM.c
parentf519190f0cf97eb6b3fda61f4eb8c1f55de43b51 (diff)
NativeWindow: Relax Xinerama dependency / Rename Windows impl subfolder to common name win32 (same as stub_include)
Utilizing dlopen/dlsym in an efficient way relaxes the platform requirement of having Xinerama available. This allows using Nokia N9 MeeGo out of the box.
Diffstat (limited to 'src/nativewindow/native/windows/WindowsDWM.c')
-rw-r--r--src/nativewindow/native/windows/WindowsDWM.c95
1 files changed, 0 insertions, 95 deletions
diff --git a/src/nativewindow/native/windows/WindowsDWM.c b/src/nativewindow/native/windows/WindowsDWM.c
deleted file mode 100644
index cc9ed6d8c..000000000
--- a/src/nativewindow/native/windows/WindowsDWM.c
+++ /dev/null
@@ -1,95 +0,0 @@
-
-#include "WindowsDWM.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-
-// #define VERBOSE_ON 1
-
-#ifdef VERBOSE_ON
- #define DBG_PRINT(args...) fprintf(stderr, args);
-#else
- #define DBG_PRINT(args...)
-#endif
-
-/* GetProcAddress doesn't exist in A/W variants under desktop Windows */
-#ifndef UNDER_CE
-#define GetProcAddressA GetProcAddress
-#endif
-
-typedef HRESULT (WINAPI *DwmEnableCompositionPROCADDR)(UINT uCompositionAction);
-typedef HRESULT (WINAPI *DwmIsCompositionEnabledPROCADDR)(BOOL * pfEnabled);
-typedef HRESULT (WINAPI *DwmEnableBlurBehindWindowPROCADDR)(HWND hWnd, const DWM_BLURBEHIND* pBlurBehind);
-typedef HRESULT (WINAPI *DwmExtendFrameIntoClientAreaPROCADDR)(HWND hwnd, const MARGINS *pMarInset);
-
-static int _init = 0; // 1: init, 2: has DWM extension
-static DwmEnableCompositionPROCADDR _DwmEnableComposition = NULL;
-static DwmIsCompositionEnabledPROCADDR _DwmIsCompositionEnabled = NULL;
-static DwmEnableBlurBehindWindowPROCADDR _DwmEnableBlurBehindWindow = NULL;
-static DwmExtendFrameIntoClientAreaPROCADDR _DwmExtendFrameIntoClientArea = NULL;
-
-static int initWindowsDWM() {
- if(0 == _init) {
- _init = 1;
- HANDLE shell = LoadLibrary(TEXT("dwmapi.dll"));
- if (shell) {
- _DwmEnableComposition = (DwmEnableCompositionPROCADDR) GetProcAddressA (shell, "DwmEnableComposition");
- _DwmIsCompositionEnabled = (DwmIsCompositionEnabledPROCADDR) GetProcAddressA (shell, "DwmIsCompositionEnabled");
- _DwmEnableBlurBehindWindow = (DwmEnableBlurBehindWindowPROCADDR) GetProcAddressA (shell, "DwmEnableBlurBehindWindow");
- _DwmExtendFrameIntoClientArea = (DwmExtendFrameIntoClientAreaPROCADDR) GetProcAddressA (shell, "DwmExtendFrameIntoClientArea");
- if(NULL != _DwmEnableComposition && NULL != _DwmIsCompositionEnabled &&
- NULL != _DwmEnableBlurBehindWindow && NULL != _DwmExtendFrameIntoClientArea) {
- _init = 2;
- }
- }
- // FreeLibrary (shell);
- DBG_PRINT("DWM - initWindowsDWM: %d - s %p, e %p, c %p\n", _init, shell, _DwmEnableBlurBehindWindow, _DwmExtendFrameIntoClientArea);
- }
- return _init;
-}
-
-BOOL DwmIsExtensionAvailable() {
- return (2 == initWindowsDWM()) ? TRUE : FALSE;
-}
-
-BOOL DwmIsCompositionEnabled( ) {
- if(2 == initWindowsDWM()) {
- BOOL fEnabled = FALSE;
- if( 0 == _DwmIsCompositionEnabled(&fEnabled) ) {
- DBG_PRINT("DWM - DwmIsCompositionEnabled: %d\n", fEnabled);
- return fEnabled;
- }
- }
- DBG_PRINT("DWM - DwmIsCompositionEnabled failed\n");
- return FALSE;
-}
-
-BOOL DwmEnableComposition( UINT uCompositionAction ) {
- if(2 == initWindowsDWM()) {
- return 0 == _DwmEnableComposition(uCompositionAction) ? TRUE : FALSE;
- }
- return FALSE;
-}
-
-BOOL DwmEnableBlurBehindWindow(HWND hwnd, const DWM_BLURBEHIND* pBlurBehind) {
- if(2 == initWindowsDWM()) {
- _DwmEnableBlurBehindWindow(hwnd, pBlurBehind);
- DBG_PRINT("DWM - DwmEnableBlurBehindWindow: hwnd %p, f %d, on %d, %p\n",
- (void *)hwnd,
- (int) pBlurBehind->dwFlags,
- (int) pBlurBehind->fEnable,
- (void *)pBlurBehind->hRgnBlur);
- return TRUE;
- }
- DBG_PRINT("DWM - DwmEnableBlurBehindWindow: n/a\n");
- return FALSE;
-}
-
-BOOL DwmExtendFrameIntoClientArea(HWND hwnd, const MARGINS *pMarInset) {
- if(2 == initWindowsDWM()) {
- _DwmExtendFrameIntoClientArea(hwnd, pMarInset);
- return TRUE;
- }
- return FALSE;
-}
-