diff options
author | Reinhard Tartler <siretart@tauware.de> | 2011-10-10 17:43:39 +0200 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2011-10-10 17:43:39 +0200 |
commit | f4092abdf94af6a99aff944d6264bc1284e8bdd4 (patch) | |
tree | 2ac1c9cc16ceb93edb2c4382c088dac5aeafdf0f /nx-X11/programs/Xserver/hw/xwin/winpriv.c | |
parent | a840692edc9c6d19cd7c057f68e39c7d95eb767d (diff) | |
download | nx-libs-f4092abdf94af6a99aff944d6264bc1284e8bdd4.tar.gz nx-libs-f4092abdf94af6a99aff944d6264bc1284e8bdd4.tar.bz2 nx-libs-f4092abdf94af6a99aff944d6264bc1284e8bdd4.zip |
Imported nx-X11-3.1.0-1.tar.gznx-X11/3.1.0-1
Summary: Imported nx-X11-3.1.0-1.tar.gz
Keywords:
Imported nx-X11-3.1.0-1.tar.gz
into Git repository
Diffstat (limited to 'nx-X11/programs/Xserver/hw/xwin/winpriv.c')
-rw-r--r-- | nx-X11/programs/Xserver/hw/xwin/winpriv.c | 134 |
1 files changed, 134 insertions, 0 deletions
diff --git a/nx-X11/programs/Xserver/hw/xwin/winpriv.c b/nx-X11/programs/Xserver/hw/xwin/winpriv.c new file mode 100644 index 000000000..29221cf2b --- /dev/null +++ b/nx-X11/programs/Xserver/hw/xwin/winpriv.c @@ -0,0 +1,134 @@ +/* + * 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 +winCreateWindowsWindow (WindowPtr pWin); +/** + * Return size and handles of a window. + * If pWin is NULL, then the information for the root window is requested. + */ +extern 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) + { + /* Initialize the size information */ + RECT rect = { + pWin->drawable.x, + pWin->drawable.y, + pWin->drawable.x + pWin->drawable.width, + pWin->drawable.y + pWin->drawable.height + }, rect_extends; + /* Get the window and screen privates */ + ScreenPtr pScreen = pWin->drawable.pScreen; + winPrivScreenPtr pWinScreen = winGetScreenPriv(pScreen); + winScreenInfoPtr pScreenInfo = NULL; + + rect_extends = rect; + OffsetRect(&rect_extends, -pWin->drawable.x, -pWin->drawable.y); + + if (pWinScreen == NULL) + { + ErrorF("winGetWindowInfo: screen has no privates\n"); + return; + } + + pWinInfo->hwnd = pWinScreen->hwndScreen; + pWinInfo->hrgn = NULL; + pWinInfo->rect = rect; + + + 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); + } + if (pWinPriv->hWnd != NULL) { + + /* copy size and window handle */ + pWinInfo->rect = rect_extends; + pWinInfo->hwnd = pWinPriv->hWnd; + + /* Copy window region */ + if (pWinInfo->hrgn) + DeleteObject(pWinInfo->hrgn); + pWinInfo->hrgn = CreateRectRgn(0,0,0,0); + CombineRgn(pWinInfo->hrgn, pWinPriv->hRgn, pWinPriv->hRgn, + RGN_COPY); + } + + 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 size and window handle */ + pWinInfo->rect = rect_extends; + pWinInfo->hwnd = pRLWinPriv->hWnd; + } + return; + } +#endif + } + else + { + RECT rect = {0, 0, 0, 0}; + ScreenPtr pScreen = g_ScreenInfo[0].pScreen; + winPrivScreenPtr pWinScreen = winGetScreenPriv(pScreen); + + pWinInfo->hwnd = NULL; + pWinInfo->hrgn = NULL; + pWinInfo->rect = rect; + + if (pWinScreen == NULL) + { + ErrorF("winGetWindowInfo: screen has no privates\n"); + return; + } + + ErrorF("winGetWindowInfo: returning root window\n"); + + pWinInfo->hwnd = pWinScreen->hwndScreen; + } + return; +} |