2006-11-26 11:13:41 -07:00
|
|
|
/*
|
|
|
|
* Export window information for the Windows-OpenGL GLX implementation.
|
|
|
|
*
|
|
|
|
* Authors: Alexander Gottwald
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_XWIN_CONFIG_H
|
|
|
|
#include <xwin-config.h>
|
|
|
|
#endif
|
|
|
|
#include "win.h"
|
|
|
|
#include "winpriv.h"
|
|
|
|
#include "winwindow.h"
|
|
|
|
|
|
|
|
void
|
2012-06-10 07:21:05 -06:00
|
|
|
winCreateWindowsWindow(WindowPtr pWin);
|
|
|
|
|
2006-11-26 11:13:41 -07:00
|
|
|
/**
|
|
|
|
* Return size and handles of a window.
|
|
|
|
* If pWin is NULL, then the information for the root window is requested.
|
2010-12-05 08:36:02 -07:00
|
|
|
*/
|
2012-06-10 07:21:05 -06:00
|
|
|
HWND
|
|
|
|
winGetWindowInfo(WindowPtr pWin)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
2011-11-05 07:32:40 -06:00
|
|
|
winTrace("%s: pWin %p XID 0x%x\n", __FUNCTION__, pWin, pWin->drawable.id);
|
2006-11-26 11:13:41 -07:00
|
|
|
|
|
|
|
/* a real window was requested */
|
2012-06-10 07:21:05 -06:00
|
|
|
if (pWin != NULL) {
|
2006-11-26 11:13:41 -07:00
|
|
|
/* Get the window and screen privates */
|
|
|
|
ScreenPtr pScreen = pWin->drawable.pScreen;
|
|
|
|
winPrivScreenPtr pWinScreen = winGetScreenPriv(pScreen);
|
|
|
|
winScreenInfoPtr pScreenInfo = NULL;
|
2010-12-05 08:36:02 -07:00
|
|
|
HWND hwnd = NULL;
|
2006-11-26 11:13:41 -07:00
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
if (pWinScreen == NULL) {
|
2006-11-26 11:13:41 -07:00
|
|
|
ErrorF("winGetWindowInfo: screen has no privates\n");
|
2010-12-05 08:36:02 -07:00
|
|
|
return NULL;
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
2010-12-05 08:36:02 -07:00
|
|
|
|
|
|
|
hwnd = pWinScreen->hwndScreen;
|
2006-11-26 11:13:41 -07:00
|
|
|
|
|
|
|
pScreenInfo = pWinScreen->pScreenInfo;
|
|
|
|
#ifdef XWIN_MULTIWINDOW
|
|
|
|
/* check for multiwindow mode */
|
2012-06-10 07:21:05 -06:00
|
|
|
if (pScreenInfo->fMultiWindow) {
|
2006-11-26 11:13:41 -07:00
|
|
|
winWindowPriv(pWin);
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
if (pWinPriv == NULL) {
|
2006-11-26 11:13:41 -07:00
|
|
|
ErrorF("winGetWindowInfo: window has no privates\n");
|
2010-12-05 08:36:02 -07:00
|
|
|
return hwnd;
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
if (pWinPriv->hWnd == NULL) {
|
|
|
|
winCreateWindowsWindow(pWin);
|
|
|
|
ErrorF("winGetWindowInfo: forcing window to exist...\n");
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
2010-12-05 08:36:02 -07:00
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
if (pWinPriv->hWnd != NULL) {
|
2010-12-05 08:36:02 -07:00
|
|
|
/* copy window handle */
|
|
|
|
hwnd = pWinPriv->hWnd;
|
2011-11-05 07:32:40 -06:00
|
|
|
|
|
|
|
/* mark GLX active on that hwnd */
|
|
|
|
pWinPriv->fWglUsed = TRUE;
|
2012-06-10 07:21:05 -06:00
|
|
|
}
|
2010-12-05 08:36:02 -07:00
|
|
|
|
|
|
|
return hwnd;
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#ifdef XWIN_MULTIWINDOWEXTWM
|
|
|
|
/* check for multiwindow external wm mode */
|
2012-06-10 07:21:05 -06:00
|
|
|
if (pScreenInfo->fMWExtWM) {
|
2006-11-26 11:13:41 -07:00
|
|
|
win32RootlessWindowPtr pRLWinPriv
|
2012-06-10 07:21:05 -06:00
|
|
|
= (win32RootlessWindowPtr) RootlessFrameForWindow(pWin, FALSE);
|
2006-11-26 11:13:41 -07:00
|
|
|
|
|
|
|
if (pRLWinPriv == NULL) {
|
|
|
|
ErrorF("winGetWindowInfo: window has no privates\n");
|
2010-12-05 08:36:02 -07:00
|
|
|
return hwnd;
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
2010-12-05 08:36:02 -07:00
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
if (pRLWinPriv->hWnd != NULL) {
|
2010-12-05 08:36:02 -07:00
|
|
|
/* copy window handle */
|
|
|
|
hwnd = pRLWinPriv->hWnd;
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
2010-12-05 08:36:02 -07:00
|
|
|
return hwnd;
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
#endif
|
2010-12-05 08:36:02 -07:00
|
|
|
}
|
2012-06-10 07:21:05 -06:00
|
|
|
else {
|
2006-11-26 11:13:41 -07:00
|
|
|
ScreenPtr pScreen = g_ScreenInfo[0].pScreen;
|
|
|
|
winPrivScreenPtr pWinScreen = winGetScreenPriv(pScreen);
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
if (pWinScreen == NULL) {
|
2006-11-26 11:13:41 -07:00
|
|
|
ErrorF("winGetWindowInfo: screen has no privates\n");
|
2010-12-05 08:36:02 -07:00
|
|
|
return NULL;
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
ErrorF("winGetWindowInfo: returning root window\n");
|
|
|
|
|
2010-12-05 08:36:02 -07:00
|
|
|
return pWinScreen->hwndScreen;
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
2010-12-05 08:36:02 -07:00
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
Bool
|
|
|
|
winCheckScreenAiglxIsSupported(ScreenPtr pScreen)
|
|
|
|
{
|
2012-06-10 07:21:05 -06:00
|
|
|
winPrivScreenPtr pWinScreen = winGetScreenPriv(pScreen);
|
|
|
|
winScreenInfoPtr pScreenInfo = pWinScreen->pScreenInfo;
|
2010-12-05 08:36:02 -07:00
|
|
|
|
|
|
|
#ifdef XWIN_MULTIWINDOW
|
2012-06-10 07:21:05 -06:00
|
|
|
if (pScreenInfo->fMultiWindow)
|
|
|
|
return TRUE;
|
2010-12-05 08:36:02 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef XWIN_MULTIWINDOWEXTWM
|
2012-06-10 07:21:05 -06:00
|
|
|
if (pScreenInfo->fMWExtWM)
|
|
|
|
return TRUE;
|
2010-12-05 08:36:02 -07:00
|
|
|
#endif
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
return FALSE;
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|