34 #include "../NativeWindowFromNode.h"
51 return NS_ERROR_NOT_IMPLEMENTED;
55 NS_IMETHODIMP sbNativeWindowManager::GetSupportsResizeDrag(PRBool *aSupportsResizeDrag)
57 NS_ENSURE_ARG_POINTER(aSupportsResizeDrag);
58 *aSupportsResizeDrag = PR_FALSE;
63 NS_IMETHODIMP sbNativeWindowManager::SetMinimumWindowSize(
nsISupports *aWindow, PRInt32 aMinimumWidth, PRInt32 aMinimumHeight)
65 return NS_ERROR_NOT_IMPLEMENTED;
69 NS_IMETHODIMP sbNativeWindowManager::SetMaximumWindowSize(
nsISupports *aWindow, PRInt32 aMaximumWidth, PRInt32 aMaximumHeight)
71 return NS_ERROR_NOT_IMPLEMENTED;
75 NS_IMETHODIMP sbNativeWindowManager::GetSupportsMinimumWindowSize(PRBool *aSupportsMinimumWindowSize)
77 NS_ENSURE_ARG_POINTER(aSupportsMinimumWindowSize);
78 *aSupportsMinimumWindowSize = PR_FALSE;
83 NS_IMETHODIMP sbNativeWindowManager::GetSupportsMaximumWindowSize(PRBool *aSupportsMaximumWindowSize)
85 NS_ENSURE_ARG_POINTER(aSupportsMaximumWindowSize);
86 *aSupportsMaximumWindowSize = PR_FALSE;
91 NS_IMETHODIMP sbNativeWindowManager::SetOnTop(
nsISupports *aWindow, PRBool aOnTop)
93 NS_ENSURE_ARG_POINTER(aWindow);
96 SetWindowPos(window, aOnTop ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0,
97 SWP_NOSIZE | SWP_NOMOVE);
102 NS_IMETHODIMP sbNativeWindowManager::SetShadowing(
nsISupports *aWindow, PRBool aShadowing)
104 NS_ENSURE_ARG_POINTER(aWindow);
107 HMODULE hDll = LoadLibraryW(L
"dwmapi");
120 if(!setWindowAttribute || !extendFrameIntoClientArea) {
121 return NS_ERROR_UNEXPECTED;
124 DWMNCRENDERINGPOLICY ncrp = aShadowing ? DWMNCRP_ENABLED : DWMNCRP_DISABLED;
127 HRESULT hr = setWindowAttribute(window, DWMWA_NCRENDERING_POLICY, &ncrp,
sizeof(ncrp));
128 NS_ENSURE_TRUE(SUCCEEDED(hr), NS_ERROR_UNEXPECTED);
131 MARGINS margins = {1, 0, 0, 0};
134 hr = extendFrameIntoClientArea(window, &margins);
135 NS_ENSURE_TRUE(SUCCEEDED(hr), NS_ERROR_UNEXPECTED);
142 NS_IMETHODIMP sbNativeWindowManager::GetSupportsOnTop(PRBool *aSupportsOnTop)
144 NS_ENSURE_ARG_POINTER(aSupportsOnTop);
146 *aSupportsOnTop = PR_TRUE;
151 NS_IMETHODIMP sbNativeWindowManager::GetSupportsShadowing(PRBool *aSupportsShadowing)
153 NS_ENSURE_ARG_POINTER(aSupportsShadowing);
155 *aSupportsShadowing = PR_TRUE;
NS_IMPL_ISUPPORTS1(sbDeviceCapabilitiesUtils, sbIDeviceCapabilitiesUtils) sbDeviceCapabilitiesUtils
HRESULT(STDAPICALLTYPE * DwmExtendFrameIntoClientArea_t)(HWND, const MARGINS *)
interface to the operating system's window manager This Interfaces to allows JavaScript to talk to th...
static void * get(nsISupports *window)
HRESULT(STDAPICALLTYPE * DwmSetWindowAttributeProc_t)(HWND, DWORD, LPCVOID, DWORD)