2004-06-21 15:19:32 +02:00
|
|
|
/*
|
|
|
|
* Export window information for the Windows-OpenGL GLX implementation.
|
|
|
|
*
|
|
|
|
* Authors: Alexander Gottwald
|
|
|
|
*/
|
|
|
|
|
2005-07-05 00:10:43 +02:00
|
|
|
#ifdef HAVE_XWIN_CONFIG_H
|
|
|
|
#include <xwin-config.h>
|
|
|
|
#endif
|
2004-06-21 15:19:32 +02:00
|
|
|
#include "win.h"
|
|
|
|
#include "winpriv.h"
|
|
|
|
#include "winwindow.h"
|
|
|
|
|
|
|
|
void
|
|
|
|
winCreateWindowsWindow (WindowPtr pWin);
|
|
|
|
/**
|
|
|
|
* Return size and handles of a window.
|
|
|
|
* If pWin is NULL, then the information for the root window is requested.
|
2009-11-07 20:28:18 +01:00
|
|
|
*/
|
|
|
|
HWND winGetWindowInfo(WindowPtr pWin)
|
2004-06-21 15:19:32 +02:00
|
|
|
{
|
2009-11-07 20:28:18 +01:00
|
|
|
winDebug("%s: pWin=%p\n", __FUNCTION__, pWin);
|
2004-06-21 15:19:32 +02:00
|
|
|
|
|
|
|
/* a real window was requested */
|
2009-11-07 20:28:18 +01:00
|
|
|
if (pWin != NULL)
|
2004-06-21 15:19:32 +02:00
|
|
|
{
|
|
|
|
/* Get the window and screen privates */
|
|
|
|
ScreenPtr pScreen = pWin->drawable.pScreen;
|
|
|
|
winPrivScreenPtr pWinScreen = winGetScreenPriv(pScreen);
|
|
|
|
winScreenInfoPtr pScreenInfo = NULL;
|
2009-11-07 20:28:18 +01:00
|
|
|
HWND hwnd = NULL;
|
2004-06-21 15:19:32 +02:00
|
|
|
|
2009-11-07 20:28:18 +01:00
|
|
|
if (pWinScreen == NULL)
|
2004-06-21 15:19:32 +02:00
|
|
|
{
|
|
|
|
ErrorF("winGetWindowInfo: screen has no privates\n");
|
2009-11-07 20:28:18 +01:00
|
|
|
return NULL;
|
2004-06-21 15:19:32 +02:00
|
|
|
}
|
2009-11-07 20:28:18 +01:00
|
|
|
|
|
|
|
hwnd = pWinScreen->hwndScreen;
|
2004-06-21 15:19:32 +02:00
|
|
|
|
|
|
|
pScreenInfo = pWinScreen->pScreenInfo;
|
|
|
|
#ifdef XWIN_MULTIWINDOW
|
|
|
|
/* check for multiwindow mode */
|
|
|
|
if (pScreenInfo->fMultiWindow)
|
|
|
|
{
|
|
|
|
winWindowPriv(pWin);
|
|
|
|
|
|
|
|
if (pWinPriv == NULL)
|
|
|
|
{
|
|
|
|
ErrorF("winGetWindowInfo: window has no privates\n");
|
2009-11-07 20:28:18 +01:00
|
|
|
return hwnd;
|
2004-06-21 15:19:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (pWinPriv->hWnd == NULL)
|
|
|
|
{
|
2009-11-07 20:28:18 +01:00
|
|
|
winCreateWindowsWindow(pWin);
|
|
|
|
ErrorF("winGetWindowInfo: forcing window to exist...\n");
|
2004-06-21 15:19:32 +02:00
|
|
|
}
|
2009-11-07 20:28:18 +01:00
|
|
|
|
|
|
|
if (pWinPriv->hWnd != NULL)
|
|
|
|
{
|
|
|
|
/* copy window handle */
|
|
|
|
hwnd = pWinPriv->hWnd;
|
|
|
|
}
|
|
|
|
|
|
|
|
return hwnd;
|
2004-06-21 15:19:32 +02:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#ifdef XWIN_MULTIWINDOWEXTWM
|
|
|
|
/* check for multiwindow external wm mode */
|
|
|
|
if (pScreenInfo->fMWExtWM)
|
|
|
|
{
|
|
|
|
win32RootlessWindowPtr pRLWinPriv
|
|
|
|
= (win32RootlessWindowPtr) RootlessFrameForWindow (pWin, FALSE);
|
|
|
|
|
|
|
|
if (pRLWinPriv == NULL) {
|
|
|
|
ErrorF("winGetWindowInfo: window has no privates\n");
|
2009-11-07 20:28:18 +01:00
|
|
|
return hwnd;
|
2004-06-21 15:19:32 +02:00
|
|
|
}
|
2009-11-07 20:28:18 +01:00
|
|
|
|
2004-06-21 15:19:32 +02:00
|
|
|
if (pRLWinPriv->hWnd != NULL)
|
|
|
|
{
|
2009-11-07 20:28:18 +01:00
|
|
|
/* copy window handle */
|
|
|
|
hwnd = pRLWinPriv->hWnd;
|
2004-06-21 15:19:32 +02:00
|
|
|
}
|
2009-11-07 20:28:18 +01:00
|
|
|
return hwnd;
|
2004-06-21 15:19:32 +02:00
|
|
|
}
|
|
|
|
#endif
|
2009-11-07 20:28:18 +01:00
|
|
|
}
|
|
|
|
else
|
2004-06-21 15:19:32 +02:00
|
|
|
{
|
|
|
|
ScreenPtr pScreen = g_ScreenInfo[0].pScreen;
|
|
|
|
winPrivScreenPtr pWinScreen = winGetScreenPriv(pScreen);
|
|
|
|
|
|
|
|
if (pWinScreen == NULL)
|
|
|
|
{
|
|
|
|
ErrorF("winGetWindowInfo: screen has no privates\n");
|
2009-11-07 20:28:18 +01:00
|
|
|
return NULL;
|
2004-06-21 15:19:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
ErrorF("winGetWindowInfo: returning root window\n");
|
|
|
|
|
2009-11-07 20:28:18 +01:00
|
|
|
return pWinScreen->hwndScreen;
|
2004-06-21 15:19:32 +02:00
|
|
|
}
|
2009-11-07 20:28:18 +01:00
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
Bool
|
|
|
|
winCheckScreenAiglxIsSupported(ScreenPtr pScreen)
|
|
|
|
{
|
|
|
|
winPrivScreenPtr pWinScreen = winGetScreenPriv(pScreen);
|
|
|
|
winScreenInfoPtr pScreenInfo = pWinScreen->pScreenInfo;
|
|
|
|
|
|
|
|
#ifdef XWIN_MULTIWINDOW
|
|
|
|
if (pScreenInfo->fMultiWindow)
|
|
|
|
return TRUE;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef XWIN_MULTIWINDOWEXTWM
|
|
|
|
if (pScreenInfo->fMWExtWM)
|
|
|
|
return TRUE;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
return FALSE;
|
2004-06-21 15:19:32 +02:00
|
|
|
}
|