From 2e4def74ad9278c142d07ffa91f51035dc49cf77 Mon Sep 17 00:00:00 2001 From: marha Date: Fri, 20 Nov 2009 07:14:40 +0000 Subject: Checked in glx of cygwin-aiglx branch of git://anongit.freedesktop.org/~jturney/xserver --- xorg-server/hw/xwin/glx/winpriv.c | 130 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 xorg-server/hw/xwin/glx/winpriv.c (limited to 'xorg-server/hw/xwin/glx/winpriv.c') diff --git a/xorg-server/hw/xwin/glx/winpriv.c b/xorg-server/hw/xwin/glx/winpriv.c new file mode 100644 index 000000000..3260ca95c --- /dev/null +++ b/xorg-server/hw/xwin/glx/winpriv.c @@ -0,0 +1,130 @@ +/* + * Export window information for the Windows-OpenGL GLX implementation. + * + * Authors: Alexander Gottwald + */ + +#ifdef HAVE_XWIN_CONFIG_H +#include +#endif +#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. + */ +void winGetWindowInfo(WindowPtr pWin, winWindowInfoPtr pWinInfo) +{ + /* Sanity check */ + if (pWinInfo == NULL) + return; + + winDebug("%s:%d pWin=%p\n", __FUNCTION__, __LINE__, pWin); + + /* a real window was requested */ + if (pWin != NULL) + { + /* Get the window and screen privates */ + ScreenPtr pScreen = pWin->drawable.pScreen; + winPrivScreenPtr pWinScreen = winGetScreenPriv(pScreen); + winScreenInfoPtr pScreenInfo = NULL; + + if (pWinScreen == NULL) + { + ErrorF("winGetWindowInfo: screen has no privates\n"); + return; + } + + pWinInfo->hwnd = pWinScreen->hwndScreen; + + 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"); + return; + } + + if (pWinPriv->hWnd == NULL) + { + winCreateWindowsWindow(pWin); + ErrorF("winGetWindowInfo: forcing window to exist...\n"); + } + + if (pWinPriv->hWnd != NULL) + { + /* copy window handle */ + pWinInfo->hwnd = pWinPriv->hWnd; + } + + return; + } +#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"); + return; + } + + if (pRLWinPriv->hWnd != NULL) + { + /* copy window handle */ + pWinInfo->hwnd = pRLWinPriv->hWnd; + } + return; + } +#endif + } + else + { + ScreenPtr pScreen = g_ScreenInfo[0].pScreen; + winPrivScreenPtr pWinScreen = winGetScreenPriv(pScreen); + + pWinInfo->hwnd = NULL; + + if (pWinScreen == NULL) + { + ErrorF("winGetWindowInfo: screen has no privates\n"); + return; + } + + ErrorF("winGetWindowInfo: returning root window\n"); + + pWinInfo->hwnd = pWinScreen->hwndScreen; + } + return; +} + +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; +} -- cgit v1.2.3