9838b7032e
This is strictly the application of the script 'x-indent-all.sh' from util/modular. Compared to the patch that Daniel posted in January, I've added a few indent flags: -bap -psl -T PrivatePtr -T pmWait -T _XFUNCPROTOBEGIN -T _XFUNCPROTOEND -T _X_EXPORT The typedefs were needed to make the output of sdksyms.sh match the previous output, otherwise, the code is formatted badly enough that sdksyms.sh generates incorrect output. The generated code was compared with the previous version and found to be essentially identical -- "assert" line numbers and BUILD_TIME were the only differences found. The comparison was done with this script: dir1=$1 dir2=$2 for dir in $dir1 $dir2; do (cd $dir && find . -name '*.o' | while read file; do dir=`dirname $file` base=`basename $file .o` dump=$dir/$base.dump objdump -d $file > $dump done) done find $dir1 -name '*.dump' | while read dump; do otherdump=`echo $dump | sed "s;$dir1;$dir2;"` diff -u $dump $otherdump done Signed-off-by: Keith Packard <keithp@keithp.com> Acked-by: Daniel Stone <daniel@fooishbar.org> Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
122 lines
3.1 KiB
C
122 lines
3.1 KiB
C
/*
|
|
* 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.
|
|
*/
|
|
HWND
|
|
winGetWindowInfo(WindowPtr pWin)
|
|
{
|
|
winTrace("%s: pWin %p XID 0x%x\n", __FUNCTION__, pWin, pWin->drawable.id);
|
|
|
|
/* 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;
|
|
HWND hwnd = NULL;
|
|
|
|
if (pWinScreen == NULL) {
|
|
ErrorF("winGetWindowInfo: screen has no privates\n");
|
|
return NULL;
|
|
}
|
|
|
|
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 hwnd;
|
|
}
|
|
|
|
if (pWinPriv->hWnd == NULL) {
|
|
winCreateWindowsWindow(pWin);
|
|
ErrorF("winGetWindowInfo: forcing window to exist...\n");
|
|
}
|
|
|
|
if (pWinPriv->hWnd != NULL) {
|
|
/* copy window handle */
|
|
hwnd = pWinPriv->hWnd;
|
|
|
|
/* mark GLX active on that hwnd */
|
|
pWinPriv->fWglUsed = TRUE;
|
|
}
|
|
|
|
return hwnd;
|
|
}
|
|
#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 hwnd;
|
|
}
|
|
|
|
if (pRLWinPriv->hWnd != NULL) {
|
|
/* copy window handle */
|
|
hwnd = pRLWinPriv->hWnd;
|
|
}
|
|
return hwnd;
|
|
}
|
|
#endif
|
|
}
|
|
else {
|
|
ScreenPtr pScreen = g_ScreenInfo[0].pScreen;
|
|
winPrivScreenPtr pWinScreen = winGetScreenPriv(pScreen);
|
|
|
|
if (pWinScreen == NULL) {
|
|
ErrorF("winGetWindowInfo: screen has no privates\n");
|
|
return NULL;
|
|
}
|
|
|
|
ErrorF("winGetWindowInfo: returning root window\n");
|
|
|
|
return pWinScreen->hwndScreen;
|
|
}
|
|
|
|
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;
|
|
}
|