diff options
Diffstat (limited to 'xorg-server/hw/xwin')
101 files changed, 53838 insertions, 21960 deletions
diff --git a/xorg-server/hw/xwin/InitInput.c b/xorg-server/hw/xwin/InitInput.c index 5f51fc457..e01a8f655 100644 --- a/xorg-server/hw/xwin/InitInput.c +++ b/xorg-server/hw/xwin/InitInput.c @@ -32,7 +32,7 @@ #include "win.h"
#include "dixstruct.h"
#include "inputstr.h"
-
+#include <unistd.h>
/*
* Local function prototypes
@@ -40,7 +40,6 @@ #ifdef XWIN_CLIPBOARD
int winProcEstablishConnection(ClientPtr /* client */);
-int winProcQueryTree(ClientPtr /* client */);
int winProcSetSelectionOwner(ClientPtr /* client */);
#endif
@@ -76,15 +75,7 @@ LegalModifier (unsigned int uiKey, DeviceIntPtr pDevice) void
ProcessInputEvents (void)
{
-#if 0
- ErrorF ("ProcessInputEvents\n");
-#endif
-
mieqProcessInputEvents ();
-
-#if 0
- ErrorF ("ProcessInputEvents - returning\n");
-#endif
}
@@ -99,9 +90,7 @@ void DDXRingBell(int volume, int pitch, int duration) void
InitInput (int argc, char *argv[])
{
-#if CYGDEBUG
winDebug ("InitInput\n");
-#endif
#ifdef XWIN_CLIPBOARD
/*
@@ -112,12 +101,6 @@ InitInput (int argc, char *argv[]) winProcEstablishConnectionOrig = InitialVector[2];
InitialVector[2] = winProcEstablishConnection;
}
- if (g_fXdmcpEnabled
- && ProcVector[X_QueryTree] != winProcQueryTree)
- {
- winProcQueryTreeOrig = ProcVector[X_QueryTree];
- ProcVector[X_QueryTree] = winProcQueryTree;
- }
#endif
g_pwinPointer = AddInputDevice (serverClient, winMouseProc, TRUE);
@@ -127,8 +110,8 @@ InitInput (int argc, char *argv[]) mieqInit ();
- /* Initialize the mode key states */
- winInitializeModeKeyStates ();
+ /* Do not nitialize the mode key states here yet since the keyboard device is not started yet
+ winInitializeModeKeyStates (); */
#ifdef HAS_DEVWINDOWS
/* Only open the windows message queue device once */
@@ -148,12 +131,12 @@ InitInput (int argc, char *argv[]) }
#endif
-#if CYGDEBUG
winDebug ("InitInput - returning\n");
-#endif
}
void
CloseInput (void)
{
+ g_pwinPointer=NULL;
+ g_pwinKeyboard=NULL;
}
diff --git a/xorg-server/hw/xwin/InitOutput.c b/xorg-server/hw/xwin/InitOutput.c index 22ef8da76..ae56c51fa 100644 --- a/xorg-server/hw/xwin/InitOutput.c +++ b/xorg-server/hw/xwin/InitOutput.c @@ -1,1111 +1,1120 @@ - -/* - -Copyright 1993, 1998 The Open Group -Copyright (C) Colin Harrison 2005-2008 - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ - -#ifdef HAVE_XWIN_CONFIG_H -#include <xwin-config.h> -#endif -#include "win.h" -#include "winmsg.h" -#include "winconfig.h" -#include "winprefs.h" -#ifdef XWIN_CLIPBOARD -#include "X11/Xlocale.h" -#endif -#ifdef DPMSExtension -#include "dpmsproc.h" -#endif -#ifdef __CYGWIN__ -#include <mntent.h> -#endif -#if defined(WIN32) -#include "xkbsrv.h" -#endif -#ifdef RELOCATE_PROJECTROOT -#include <shlobj.h> -typedef WINAPI HRESULT (*SHGETFOLDERPATHPROC)( - HWND hwndOwner, - int nFolder, - HANDLE hToken, - DWORD dwFlags, - LPTSTR pszPath -); -#endif - -/* - * References to external symbols - */ -#ifdef XWIN_CLIPBOARD -extern Bool g_fUnicodeClipboard; -extern Bool g_fClipboardLaunched; -extern Bool g_fClipboardStarted; -extern pthread_t g_ptClipboardProc; -extern HWND g_hwndClipboard; -extern Bool g_fClipboard; -#endif - - -/* - module handle for dynamically loaded comctl32 library -*/ -static HMODULE g_hmodCommonControls = NULL; - -/* - * Function prototypes - */ - -#ifdef XWIN_CLIPBOARD -static void -winClipboardShutdown (void); -#endif - -#if defined(DDXOSVERRORF) -void -OsVendorVErrorF (const char *pszFormat, va_list va_args); -#endif - -static Bool -winCheckDisplayNumber (void); - -void -winLogCommandLine (int argc, char *argv[]); - -void -winLogVersionInfo (void); - -Bool -winValidateArgs (void); - -#ifdef RELOCATE_PROJECTROOT -const char * -winGetBaseDir(void); -#endif - -/* - * For the depth 24 pixmap we default to 32 bits per pixel, but - * we change this pixmap format later if we detect that the display - * is going to be running at 24 bits per pixel. - * - * FIXME: On second thought, don't DIBs only support 32 bits per pixel? - * DIBs are the underlying bitmap used for DirectDraw surfaces, so it - * seems that all pixmap formats with depth 24 would be 32 bits per pixel. - * Confirm whether depth 24 DIBs can have 24 bits per pixel, then remove/keep - * the bits per pixel adjustment and update this comment to reflect the - * situation. Harold Hunt - 2002/07/02 - */ - -static PixmapFormatRec g_PixmapFormats[] = { - { 1, 1, BITMAP_SCANLINE_PAD }, - { 4, 8, BITMAP_SCANLINE_PAD }, - { 8, 8, BITMAP_SCANLINE_PAD }, - { 15, 16, BITMAP_SCANLINE_PAD }, - { 16, 16, BITMAP_SCANLINE_PAD }, - { 24, 32, BITMAP_SCANLINE_PAD }, - { 32, 32, BITMAP_SCANLINE_PAD } -}; - -const int NUMFORMATS = sizeof (g_PixmapFormats) / sizeof (g_PixmapFormats[0]); - -#ifdef XWIN_CLIPBOARD -static void -winClipboardShutdown (void) -{ - /* Close down clipboard resources */ - if (g_fClipboard && g_fClipboardLaunched && g_fClipboardStarted) - { - /* Synchronously destroy the clipboard window */ - if (g_hwndClipboard != NULL) - { - SendMessage (g_hwndClipboard, WM_DESTROY, 0, 0); - /* NOTE: g_hwndClipboard is set to NULL in winclipboardthread.c */ - } - else - return; - - /* Wait for the clipboard thread to exit */ - pthread_join (g_ptClipboardProc, NULL); - - g_fClipboardLaunched = FALSE; - g_fClipboardStarted = FALSE; - - winDebug ("winClipboardShutdown - Clipboard thread has exited.\n"); - } -} -#endif - -void -ddxPushProviders(void) -{ -#ifdef XWIN_GLX_WINDOWS - if (g_fNativeGl) - { - /* install the native GL provider */ - glxWinPushNativeProvider(); - } -#endif -} - -#if defined(DDXBEFORERESET) -/* - * Called right before KillAllClients when the server is going to reset, - * allows us to shutdown our seperate threads cleanly. - */ - -void -ddxBeforeReset (void) -{ - winDebug ("ddxBeforeReset - Hello\n"); - -#ifdef XWIN_CLIPBOARD - winClipboardShutdown (); -#endif -} -#endif - - -/* See Porting Layer Definition - p. 57 */ -void -ddxGiveUp (void) -{ - int i; - -#if CYGDEBUG - winDebug ("ddxGiveUp\n"); -#endif - - /* Perform per-screen deinitialization */ - for (i = 0; i < g_iNumScreens; ++i) - { - /* Delete the tray icon */ - if (!g_ScreenInfo[i].fNoTrayIcon && g_ScreenInfo[i].pScreen) - winDeleteNotifyIcon (winGetScreenPriv (g_ScreenInfo[i].pScreen)); - } - -#ifdef XWIN_MULTIWINDOW - /* Notify the worker threads we're exiting */ - winDeinitMultiWindowWM (); -#endif - -#ifdef HAS_DEVWINDOWS - /* Close our handle to our message queue */ - if (g_fdMessageQueue != WIN_FD_INVALID) - { - /* Close /dev/windows */ - close (g_fdMessageQueue); - - /* Set the file handle to invalid */ - g_fdMessageQueue = WIN_FD_INVALID; - } -#endif - - if (!g_fLogInited) { - g_pszLogFile = LogInit (g_pszLogFile, NULL); - g_fLogInited = TRUE; - } - LogClose (); - - /* - * At this point we aren't creating any new screens, so - * we are guaranteed to not need the DirectDraw functions. - */ - winReleaseDDProcAddresses(); - - /* Unload our TrackMouseEvent function pointer */ - if (g_hmodCommonControls != NULL) - { - FreeLibrary (g_hmodCommonControls); - g_hmodCommonControls = NULL; - g_fpTrackMouseEvent = (FARPROC) (void (*)(void))NoopDDA; - } - - /* Free concatenated command line */ - free(g_pszCommandLine); - g_pszCommandLine = NULL; - - /* Remove our keyboard hook if it is installed */ - winRemoveKeyboardHookLL (); - - /* Tell Windows that we want to end the app */ - PostQuitMessage (0); -} - - -/* See Porting Layer Definition - p. 57 */ -void -AbortDDX (void) -{ -#if CYGDEBUG - winDebug ("AbortDDX\n"); -#endif - ddxGiveUp (); -} - -#ifdef __CYGWIN__ -/* hasmntopt is currently not implemented for cygwin */ -static const char *winCheckMntOpt(const struct mntent *mnt, const char *opt) -{ - const char *s; - size_t len; - if (mnt == NULL) - return NULL; - if (opt == NULL) - return NULL; - if (mnt->mnt_opts == NULL) - return NULL; - - len = strlen(opt); - s = strstr(mnt->mnt_opts, opt); - if (s == NULL) - return NULL; - if ((s == mnt->mnt_opts || *(s-1) == ',') && (s[len] == 0 || s[len] == ',')) - return (char *)opt; - return NULL; -} - -static void -winCheckMount(void) -{ - FILE *mnt; - struct mntent *ent; - - enum { none = 0, sys_root, user_root, sys_tmp, user_tmp } - level = none, curlevel; - BOOL binary = TRUE; - - mnt = setmntent("/etc/mtab", "r"); - if (mnt == NULL) - { - ErrorF("setmntent failed"); - return; - } - - while ((ent = getmntent(mnt)) != NULL) - { - BOOL system = (winCheckMntOpt(ent, "user") != NULL); - BOOL root = (strcmp(ent->mnt_dir, "/") == 0); - BOOL tmp = (strcmp(ent->mnt_dir, "/tmp") == 0); - - if (system) - { - if (root) - curlevel = sys_root; - else if (tmp) - curlevel = sys_tmp; - else - continue; - } - else - { - if (root) - curlevel = user_root; - else if (tmp) - curlevel = user_tmp; - else - continue; - } - - if (curlevel <= level) - continue; - level = curlevel; - - if ((winCheckMntOpt(ent, "binary") == NULL) && - (winCheckMntOpt(ent, "binmode") == NULL)) - binary = FALSE; - else - binary = TRUE; - } - - if (endmntent(mnt) != 1) - { - ErrorF("endmntent failed"); - return; - } - - if (!binary) - winMsg(X_WARNING, "/tmp mounted in textmode\n"); -} -#else -static void -winCheckMount(void) -{ -} -#endif - -#ifdef RELOCATE_PROJECTROOT -const char * -winGetBaseDir(void) -{ - static BOOL inited = FALSE; - static char buffer[MAX_PATH]; - if (!inited) - { - char *fendptr; - HMODULE module = GetModuleHandle(NULL); - DWORD size = GetModuleFileName(module, buffer, sizeof(buffer)); - if (sizeof(buffer) > 0) - buffer[sizeof(buffer)-1] = 0; - - fendptr = buffer + size; - while (fendptr > buffer) - { - if (*fendptr == '\\' || *fendptr == '/') - { - *fendptr = 0; - break; - } - fendptr--; - } - inited = TRUE; - } - return buffer; -} -#endif - -static void -winFixupPaths (void) -{ - BOOL changed_fontpath = FALSE; - MessageType font_from = X_DEFAULT; -#ifdef RELOCATE_PROJECTROOT - const char *basedir = winGetBaseDir(); - size_t basedirlen = strlen(basedir); -#endif - -#ifdef READ_FONTDIRS - { - /* Open fontpath configuration file */ - FILE *fontdirs = fopen(ETCX11DIR "/font-dirs", "rt"); - if (fontdirs != NULL) - { - char buffer[256]; - int needs_sep = TRUE; - int comment_block = FALSE; - - /* get default fontpath */ - char *fontpath = strdup(defaultFontPath); - size_t size = strlen(fontpath); - - /* read all lines */ - while (!feof(fontdirs)) - { - size_t blen; - char *hashchar; - char *str; - int has_eol = FALSE; - - /* read one line */ - str = fgets(buffer, sizeof(buffer), fontdirs); - if (str == NULL) /* stop on error or eof */ - break; - - if (strchr(str, '\n') != NULL) - has_eol = TRUE; - - /* check if block is continued comment */ - if (comment_block) - { - /* ignore all input */ - *str = 0; - blen = 0; - if (has_eol) /* check if line ended in this block */ - comment_block = FALSE; - } - else - { - /* find comment character. ignore all trailing input */ - hashchar = strchr(str, '#'); - if (hashchar != NULL) - { - *hashchar = 0; - if (!has_eol) /* mark next block as continued comment */ - comment_block = TRUE; - } - } - - /* strip whitespaces from beginning */ - while (*str == ' ' || *str == '\t') - str++; - - /* get size, strip whitespaces from end */ - blen = strlen(str); - while (blen > 0 && (str[blen-1] == ' ' || - str[blen-1] == '\t' || str[blen-1] == '\n')) - { - str[--blen] = 0; - } - - /* still something left to add? */ - if (blen > 0) - { - size_t newsize = size + blen; - /* reserve one character more for ',' */ - if (needs_sep) - newsize++; - - /* allocate memory */ - if (fontpath == NULL) - fontpath = malloc(newsize+1); - else - fontpath = realloc(fontpath, newsize+1); - - /* add separator */ - if (needs_sep) - { - fontpath[size] = ','; - size++; - needs_sep = FALSE; - } - - /* mark next line as new entry */ - if (has_eol) - needs_sep = TRUE; - - /* add block */ - strncpy(fontpath + size, str, blen); - fontpath[newsize] = 0; - size = newsize; - } - } - - /* cleanup */ - fclose(fontdirs); - defaultFontPath = strdup(fontpath); - free(fontpath); - changed_fontpath = TRUE; - font_from = X_CONFIG; - } - } -#endif /* READ_FONTDIRS */ -#ifdef RELOCATE_PROJECTROOT - { - const char *libx11dir = PROJECTROOT "/lib/X11"; - size_t libx11dir_len = strlen(libx11dir); - char *newfp = NULL; - size_t newfp_len = 0; - const char *endptr, *ptr, *oldptr = defaultFontPath; - - endptr = oldptr + strlen(oldptr); - ptr = strchr(oldptr, ','); - if (ptr == NULL) - ptr = endptr; - while (ptr != NULL) - { - size_t oldfp_len = (ptr - oldptr); - size_t newsize = oldfp_len; - char *newpath = malloc(newsize + 1); - strncpy(newpath, oldptr, newsize); - newpath[newsize] = 0; - - - if (strncmp(libx11dir, newpath, libx11dir_len) == 0) - { - char *compose; - newsize = newsize - libx11dir_len + basedirlen; - compose = malloc(newsize + 1); - strcpy(compose, basedir); - strncat(compose, newpath + libx11dir_len, newsize - basedirlen); - compose[newsize] = 0; - free(newpath); - newpath = compose; - } - - oldfp_len = newfp_len; - if (oldfp_len > 0) - newfp_len ++; /* space for separator */ - newfp_len += newsize; - - if (newfp == NULL) - newfp = malloc(newfp_len + 1); - else - newfp = realloc(newfp, newfp_len + 1); - - if (oldfp_len > 0) - { - strcpy(newfp + oldfp_len, ","); - oldfp_len++; - } - strcpy(newfp + oldfp_len, newpath); - - free(newpath); - - if (*ptr == 0) - { - oldptr = ptr; - ptr = NULL; - } else - { - oldptr = ptr + 1; - ptr = strchr(oldptr, ','); - if (ptr == NULL) - ptr = endptr; - } - } - - defaultFontPath = strdup(newfp); - free(newfp); - changed_fontpath = TRUE; - } -#endif /* RELOCATE_PROJECTROOT */ - if (changed_fontpath) - winMsg (font_from, "FontPath set to \"%s\"\n", defaultFontPath); - -#ifdef RELOCATE_PROJECTROOT - if (getenv("XKEYSYMDB") == NULL) - { - char buffer[MAX_PATH]; - snprintf(buffer, sizeof(buffer), "XKEYSYMDB=%s\\XKeysymDB", - basedir); - buffer[sizeof(buffer)-1] = 0; - putenv(buffer); - } - if (getenv("XERRORDB") == NULL) - { - char buffer[MAX_PATH]; - snprintf(buffer, sizeof(buffer), "XERRORDB=%s\\XErrorDB", - basedir); - buffer[sizeof(buffer)-1] = 0; - putenv(buffer); - } - if (getenv("XLOCALEDIR") == NULL) - { - char buffer[MAX_PATH]; - snprintf(buffer, sizeof(buffer), "XLOCALEDIR=%s\\locale", - basedir); - buffer[sizeof(buffer)-1] = 0; - putenv(buffer); - } - if (getenv("HOME") == NULL) - { - HMODULE shfolder; - SHGETFOLDERPATHPROC shgetfolderpath = NULL; - char buffer[MAX_PATH + 5]; - strncpy(buffer, "HOME=", 5); - - /* Try to load SHGetFolderPath from shfolder.dll and shell32.dll */ - - shfolder = LoadLibrary("shfolder.dll"); - /* fallback to shell32.dll */ - if (shfolder == NULL) - shfolder = LoadLibrary("shell32.dll"); - - /* resolve SHGetFolderPath */ - if (shfolder != NULL) - shgetfolderpath = (SHGETFOLDERPATHPROC)GetProcAddress(shfolder, "SHGetFolderPathA"); - - /* query appdata directory */ - if (shgetfolderpath && - shgetfolderpath(NULL, CSIDL_APPDATA|CSIDL_FLAG_CREATE, NULL, 0, - buffer + 5) == 0) - { - putenv(buffer); - } else - { - winMsg (X_ERROR, "Can not determine HOME directory\n"); - } - if (shfolder != NULL) - FreeLibrary(shfolder); - } - if (!g_fLogFileChanged) { - static char buffer[MAX_PATH]; - DWORD size = GetTempPath(sizeof(buffer), buffer); - if (size && size < sizeof(buffer)) - { - snprintf(buffer + size, sizeof(buffer) - size, - "XWin.%s.log", display); - buffer[sizeof(buffer)-1] = 0; - g_pszLogFile = buffer; - winMsg (X_DEFAULT, "Logfile set to \"%s\"\n", g_pszLogFile); - } - } - { - static char xkbbasedir[MAX_PATH]; - - snprintf(xkbbasedir, sizeof(xkbbasedir), "%s\\xkb", basedir); - if (sizeof(xkbbasedir) > 0) - xkbbasedir[sizeof(xkbbasedir)-1] = 0; - XkbBaseDirectory = xkbbasedir; - XkbBinDirectory = basedir; - } -#endif /* RELOCATE_PROJECTROOT */ -} - -void -OsVendorInit (void) -{ - /* Re-initialize global variables on server reset */ - winInitializeGlobals (); - - winFixupPaths(); - -#ifdef DDXOSVERRORF - if (!OsVendorVErrorFProc) - OsVendorVErrorFProc = OsVendorVErrorF; -#endif - - if (!g_fLogInited) { - /* keep this order. If LogInit fails it calls Abort which then calls - * ddxGiveUp where LogInit is called again and creates an infinite - * recursion. If we set g_fLogInited to TRUE before the init we - * avoid the second call - */ - g_fLogInited = TRUE; - g_pszLogFile = LogInit (g_pszLogFile, NULL); - } - LogSetParameter (XLOG_FLUSH, 1); - LogSetParameter (XLOG_VERBOSITY, g_iLogVerbose); - LogSetParameter (XLOG_FILE_VERBOSITY, g_iLogVerbose); - - /* Log the version information */ - if (serverGeneration == 1) - winLogVersionInfo (); - - winCheckMount(); - - /* Add a default screen if no screens were specified */ - if (g_iNumScreens == 0) - { - winDebug ("OsVendorInit - Creating default screen 0\n"); - - /* - * We need to initialize the default screen 0 if no -screen - * arguments were processed. - * - * Add a screen 0 using the defaults set by winInitializeDefaultScreens() - * and any additional default screen parameters given - */ - winInitializeScreens(1); - - /* We have to flag this as an explicit screen, even though it isn't */ - g_ScreenInfo[0].fExplicitScreen = TRUE; - } -} - - -static void -winUseMsg (void) -{ - ErrorF("\n"); - ErrorF("\n"); - ErrorF(EXECUTABLE_NAME " Device Dependent Usage:\n"); - ErrorF("\n"); - -#ifdef XWIN_CLIPBOARD - ErrorF ("-[no]clipboard\n" - "\tEnable [disable] the clipboard integration. Default is enabled.\n"); -#endif - - ErrorF ("-clipupdates num_boxes\n" - "\tUse a clipping region to constrain shadow update blits to\n" - "\tthe updated region when num_boxes, or more, are in the\n" - "\tupdated region.\n"); - -#ifdef XWIN_XF86CONFIG - ErrorF ("-config\n" - "\tSpecify a configuration file.\n"); - - ErrorF ("-configdir\n" - "\tSpecify a configuration directory.\n"); -#endif - - ErrorF ("-depth bits_per_pixel\n" - "\tSpecify an optional bitdepth to use in fullscreen mode\n" - "\twith a DirectDraw engine.\n"); - - ErrorF ("-emulate3buttons [timeout]\n" - "\tEmulate 3 button mouse with an optional timeout in\n" - "\tmilliseconds.\n"); - -#ifdef XWIN_EMULATEPSEUDO - ErrorF ("-emulatepseudo\n" - "\tCreate a depth 8 PseudoColor visual when running in\n" - "\tdepths 15, 16, 24, or 32, collectively known as TrueColor\n" - "\tdepths. The PseudoColor visual does not have correct colors,\n" - "\tand it may crash, but it at least allows you to run your\n" - "\tapplication in TrueColor modes.\n"); -#endif - - ErrorF ("-engine engine_type_id\n" - "\tOverride the server's automatically selected engine type:\n" - "\t\t1 - Shadow GDI\n" - "\t\t2 - Shadow DirectDraw\n" - "\t\t4 - Shadow DirectDraw4 Non-Locking\n" -#ifdef XWIN_PRIMARYFB - "\t\t8 - Primary DirectDraw - obsolete\n" -#endif -#ifdef XWIN_NATIVEGDI - "\t\t16 - Native GDI - experimental\n" -#endif - ); - - ErrorF ("-fullscreen\n" - "\tRun the server in fullscreen mode.\n"); - - ErrorF ("-ignoreinput\n" - "\tIgnore keyboard and mouse input.\n"); - -#ifdef XWIN_MULTIWINDOWEXTWM - ErrorF ("-internalwm\n" - "\tRun the internal window manager.\n"); -#endif - -#ifdef XWIN_XF86CONFIG - ErrorF ("-keyboard\n" - "\tSpecify a keyboard device from the configuration file.\n"); -#endif - - ErrorF ("-[no]keyhook\n" - "\tGrab special Windows keypresses like Alt-Tab or the Menu " - "key.\n"); - - ErrorF ("-lesspointer\n" - "\tHide the windows mouse pointer when it is over any\n" - "\t" EXECUTABLE_NAME " window. This prevents ghost cursors appearing when\n" - "\tthe Windows cursor is drawn on top of the X cursor\n"); - - ErrorF ("-logfile filename\n" - "\tWrite log messages to <filename>.\n"); - - ErrorF ("-logverbose verbosity\n" - "\tSet the verbosity of log messages. [NOTE: Only a few messages\n" - "\trespect the settings yet]\n" - "\t\t0 - only print fatal error.\n" - "\t\t1 - print additional configuration information.\n" - "\t\t2 - print additional runtime information [default].\n" - "\t\t3 - print debugging and tracing information.\n"); - - ErrorF ("-[no]multimonitors or -[no]multiplemonitors\n" - "\tUse the entire virtual screen if multiple\n" - "\tmonitors are present.\n"); - -#ifdef XWIN_MULTIWINDOW - ErrorF ("-multiwindow\n" - "\tRun the server in multi-window mode.\n"); -#endif - -#ifdef XWIN_MULTIWINDOWEXTWM - ErrorF ("-mwextwm\n" - "\tRun the server in multi-window external window manager mode.\n"); -#endif - - ErrorF ("-nodecoration\n" - "\tDo not draw a window border, title bar, etc. Windowed\n" - "\tmode only.\n"); - -#ifdef XWIN_CLIPBOARD - ErrorF ("-nounicodeclipboard\n" - "\tDo not use Unicode clipboard even if on a NT-based platform.\n"); -#endif - - ErrorF ("-refresh rate_in_Hz\n" - "\tSpecify an optional refresh rate to use in fullscreen mode\n" - "\twith a DirectDraw engine.\n"); - - ErrorF ("-resize=none|scrollbars|randr" - "\tIn windowed mode, [don't] allow resizing of the window. 'scrollbars'\n" - "\tmode gives the window scrollbars as needed, 'randr' mode uses the RANR\n" - "\textension to resize the X screen.\n"); - - ErrorF ("-rootless\n" - "\tRun the server in rootless mode.\n"); - - ErrorF ("-screen scr_num [width height [x y] | [[WxH[+X+Y]][@m]] ]\n" - "\tEnable screen scr_num and optionally specify a width and\n" - "\theight and initial position for that screen. Additionally\n" - "\ta monitor number can be specified to start the server on,\n" - "\tat which point, all coordinates become relative to that\n" - "\tmonitor (Not for Windows NT4 and 95). Examples:\n" - "\t -screen 0 800x600+100+100@2 ; 2nd monitor offset 100,100 size 800x600\n" - "\t -screen 0 1024x768@3 ; 3rd monitor size 1024x768\n" - "\t -screen 0 @1 ; on 1st monitor using its full resolution (the default)\n"); - - ErrorF ("-silent-dup-error\n" - "\tIf another instance of " EXECUTABLE_NAME " with the same display number is running\n" - "\texit silently and don't display any error message.\n"); - - ErrorF ("-swcursor\n" - "\tDisable the usage of the Windows cursor and use the X11 software\n" - "\tcursor instead.\n"); - - ErrorF ("-[no]trayicon\n" - "\tDo not create a tray icon. Default is to create one\n" - "\ticon per screen. You can globally disable tray icons with\n" - "\t-notrayicon, then enable it for specific screens with\n" - "\t-trayicon for those screens.\n"); - - ErrorF ("-[no]unixkill\n" - "\tCtrl+Alt+Backspace exits the X Server.\n"); - -#ifdef XWIN_GLX_WINDOWS - ErrorF ("-[no]wgl\n" - "\tEnable the GLX extension to use the native Windows WGL interface for accelerated OpenGL\n"); -#endif - - ErrorF ("-[no]winkill\n" - "\tAlt+F4 exits the X Server.\n"); - - ErrorF ("-xkblayout XKBLayout\n" - "\tEquivalent to XKBLayout in XF86Config files.\n" - "\tFor example: -xkblayout de\n"); - - ErrorF ("-xkbmodel XKBModel\n" - "\tEquivalent to XKBModel in XF86Config files.\n"); - - ErrorF ("-xkboptions XKBOptions\n" - "\tEquivalent to XKBOptions in XF86Config files.\n"); - - ErrorF ("-xkbrules XKBRules\n" - "\tEquivalent to XKBRules in XF86Config files.\n"); - - ErrorF ("-xkbvariant XKBVariant\n" - "\tEquivalent to XKBVariant in XF86Config files.\n" - "\tFor example: -xkbvariant nodeadkeys\n"); -} - -/* See Porting Layer Definition - p. 57 */ -void -ddxUseMsg(void) -{ - /* Set a flag so that FatalError won't give duplicate warning message */ - g_fSilentFatalError = TRUE; - - winUseMsg(); - - /* Log file will not be opened for UseMsg unless we open it now */ - if (!g_fLogInited) { - g_pszLogFile = LogInit (g_pszLogFile, NULL); - g_fLogInited = TRUE; - } - LogClose (); - - /* Notify user where UseMsg text can be found.*/ - if (!g_fNoHelpMessageBox) - winMessageBoxF ("The " PROJECT_NAME " help text has been printed to " - "%s.\n" - "Please open %s to read the help text.\n", - MB_ICONINFORMATION, g_pszLogFile, g_pszLogFile); -} - -/* See Porting Layer Definition - p. 20 */ -/* - * Do any global initialization, then initialize each screen. - * - * NOTE: We use ddxProcessArgument, so we don't need to touch argc and argv - */ - -void -InitOutput (ScreenInfo *screenInfo, int argc, char *argv[]) -{ - int i; - - /* Log the command line */ - winLogCommandLine (argc, argv); - -#if CYGDEBUG - winDebug ("InitOutput\n"); -#endif - - /* Validate command-line arguments */ - if (serverGeneration == 1 && !winValidateArgs ()) - { - FatalError ("InitOutput - Invalid command-line arguments found. " - "Exiting.\n"); - } - - /* Check for duplicate invocation on same display number.*/ - if (serverGeneration == 1 && !winCheckDisplayNumber ()) - { - if (g_fSilentDupError) - g_fSilentFatalError = TRUE; - FatalError ("InitOutput - Duplicate invocation on display " - "number: %s. Exiting.\n", display); - } - -#ifdef XWIN_XF86CONFIG - /* Try to read the xorg.conf-style configuration file */ - if (!winReadConfigfile ()) - winErrorFVerb (1, "InitOutput - Error reading config file\n"); -#else - winMsg(X_INFO, "xorg.conf is not supported\n"); - winMsg(X_INFO, "See http://x.cygwin.com/docs/faq/cygwin-x-faq.html " - "for more information\n"); - winConfigFiles (); -#endif - - /* Load preferences from XWinrc file */ - LoadPreferences(); - - /* Setup global screen info parameters */ - screenInfo->imageByteOrder = IMAGE_BYTE_ORDER; - screenInfo->bitmapScanlinePad = BITMAP_SCANLINE_PAD; - screenInfo->bitmapScanlineUnit = BITMAP_SCANLINE_UNIT; - screenInfo->bitmapBitOrder = BITMAP_BIT_ORDER; - screenInfo->numPixmapFormats = NUMFORMATS; - - /* Describe how we want common pixmap formats padded */ - for (i = 0; i < NUMFORMATS; i++) - { - screenInfo->formats[i] = g_PixmapFormats[i]; - } - - /* Load pointers to DirectDraw functions */ - winGetDDProcAddresses (); - - /* Detect supported engines */ - winDetectSupportedEngines (); - - /* Load common controls library */ - g_hmodCommonControls = LoadLibraryEx ("comctl32.dll", NULL, 0); - - /* Load TrackMouseEvent function pointer */ - g_fpTrackMouseEvent = GetProcAddress (g_hmodCommonControls, - "_TrackMouseEvent"); - if (g_fpTrackMouseEvent == NULL) - { - winErrorFVerb (1, "InitOutput - Could not get pointer to function\n" - "\t_TrackMouseEvent in comctl32.dll. Try installing\n" - "\tInternet Explorer 3.0 or greater if you have not\n" - "\talready.\n"); - - /* Free the library since we won't need it */ - FreeLibrary (g_hmodCommonControls); - g_hmodCommonControls = NULL; - - /* Set function pointer to point to no operation function */ - g_fpTrackMouseEvent = (FARPROC) (void (*)(void))NoopDDA; - } - - /* Store the instance handle */ - g_hInstance = GetModuleHandle (NULL); - - /* Initialize each screen */ - for (i = 0; i < g_iNumScreens; ++i) - { - /* Initialize the screen */ - if (-1 == AddScreen (winScreenInit, argc, argv)) - { - FatalError ("InitOutput - Couldn't add screen %d", i); - } - } - -#if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW) - - /* Generate a cookie used by internal clients for authorization */ - if (g_fXdmcpEnabled || g_fAuthEnabled) - winGenerateAuthorization (); - - /* Perform some one time initialization */ - if (1 == serverGeneration) - { - /* - * setlocale applies to all threads in the current process. - * Apply locale specified in LANG environment variable. - */ - setlocale (LC_ALL, ""); - } -#endif - -#if CYGDEBUG || YES - winDebug ("InitOutput - Returning.\n"); -#endif -} - - -/* - * winCheckDisplayNumber - Check if another instance of Cygwin/X is - * already running on the same display number. If no one exists, - * make a mutex to prevent new instances from running on the same display. - * - * return FALSE if the display number is already used. - */ - -static Bool -winCheckDisplayNumber (void) -{ - int nDisp; - HANDLE mutex; - char name[MAX_PATH]; - char * pszPrefix = '\0'; - OSVERSIONINFO osvi = {0}; - - /* Check display range */ - nDisp = atoi (display); - if (nDisp < 0 || nDisp > 65535) - { - ErrorF ("winCheckDisplayNumber - Bad display number: %d\n", nDisp); - return FALSE; - } - - /* Set first character of mutex name to null */ - name[0] = '\0'; - - /* Get operating system version information */ - osvi.dwOSVersionInfoSize = sizeof (osvi); - GetVersionEx (&osvi); - - /* Want a mutex shared among all terminals on NT > 4.0 */ - if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT - && osvi.dwMajorVersion >= 5) - { - pszPrefix = "Global\\"; - } - - /* Setup Cygwin/X specific part of name */ - snprintf (name, sizeof(name), "%sCYGWINX_DISPLAY:%d", pszPrefix, nDisp); - - /* Windows automatically releases the mutex when this process exits */ - mutex = CreateMutex (NULL, FALSE, name); - if (!mutex) - { - LPVOID lpMsgBuf; - - /* Display a fancy error message */ - FormatMessage (FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, - GetLastError (), - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPTSTR) &lpMsgBuf, - 0, NULL); - ErrorF ("winCheckDisplayNumber - CreateMutex failed: %s\n", - (LPSTR)lpMsgBuf); - LocalFree (lpMsgBuf); - - return FALSE; - } - if (GetLastError () == ERROR_ALREADY_EXISTS) - { - ErrorF ("winCheckDisplayNumber - " - PROJECT_NAME " is already running on display %d\n", - nDisp); - return FALSE; - } - - return TRUE; -} +
+/*
+
+Copyright 1993, 1998 The Open Group
+Copyright (C) Colin Harrison 2005-2008
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization
+from The Open Group.
+
+*/
+
+#ifdef HAVE_XWIN_CONFIG_H
+#include <xwin-config.h>
+#endif
+#include "win.h"
+#include "winmsg.h"
+#include "winconfig.h"
+#include "winprefs.h"
+#ifdef DPMSExtension
+#include "dpmsproc.h"
+#endif
+#include <locale.h>
+#ifdef __CYGWIN__
+#include <mntent.h>
+#endif
+#if defined(WIN32)
+#include "xkbsrv.h"
+#endif
+#ifdef RELOCATE_PROJECTROOT
+#undef Status
+#include <shlobj.h>
+typedef HRESULT (__stdcall * SHGETFOLDERPATHPROC)(
+ HWND hwndOwner,
+ int nFolder,
+ HANDLE hToken,
+ DWORD dwFlags,
+ LPSTR pszPath
+);
+#endif
+
+/*
+ * References to external symbols
+ */
+#ifdef XWIN_CLIPBOARD
+extern Bool g_fUnicodeClipboard;
+extern Bool g_fClipboardLaunched;
+extern Bool g_fClipboardStarted;
+extern pthread_t g_ptClipboardProc;
+extern HWND g_hwndClipboard;
+extern Bool g_fClipboard;
+#endif
+
+
+/*
+ module handle for dynamically loaded comctl32 library
+*/
+static HMODULE g_hmodCommonControls = NULL;
+
+/*
+ * Function prototypes
+ */
+
+#ifdef XWIN_CLIPBOARD
+static void
+winClipboardShutdown (void);
+#endif
+
+#if defined(DDXOSVERRORF)
+void
+OsVendorVErrorF (const char *pszFormat, va_list va_args);
+#endif
+
+static Bool
+winCheckDisplayNumber (void);
+
+void
+winLogCommandLine (int argc, char *argv[]);
+
+void
+winLogVersionInfo (void);
+
+Bool
+winValidateArgs (void);
+
+#ifdef RELOCATE_PROJECTROOT
+const char *
+winGetBaseDir(void);
+#endif
+
+/*
+ * For the depth 24 pixmap we default to 32 bits per pixel, but
+ * we change this pixmap format later if we detect that the display
+ * is going to be running at 24 bits per pixel.
+ *
+ * FIXME: On second thought, don't DIBs only support 32 bits per pixel?
+ * DIBs are the underlying bitmap used for DirectDraw surfaces, so it
+ * seems that all pixmap formats with depth 24 would be 32 bits per pixel.
+ * Confirm whether depth 24 DIBs can have 24 bits per pixel, then remove/keep
+ * the bits per pixel adjustment and update this comment to reflect the
+ * situation. Harold Hunt - 2002/07/02
+ */
+
+static PixmapFormatRec g_PixmapFormats[] = {
+ { 1, 1, BITMAP_SCANLINE_PAD },
+ { 4, 8, BITMAP_SCANLINE_PAD },
+ { 8, 8, BITMAP_SCANLINE_PAD },
+ { 15, 16, BITMAP_SCANLINE_PAD },
+ { 16, 16, BITMAP_SCANLINE_PAD },
+ { 24, 32, BITMAP_SCANLINE_PAD },
+ { 32, 32, BITMAP_SCANLINE_PAD }
+};
+
+const int NUMFORMATS = sizeof (g_PixmapFormats) / sizeof (g_PixmapFormats[0]);
+
+#ifdef XWIN_CLIPBOARD
+static void
+winClipboardShutdown (void)
+{
+ /* Close down clipboard resources */
+ if (g_fClipboard && g_fClipboardLaunched && g_fClipboardStarted)
+ {
+ /* Synchronously destroy the clipboard window */
+ if (g_hwndClipboard != NULL)
+ {
+ g_fClipboardStarted=FALSE; /* This is to avoid dead-locls caused by the clipboard thread still doing some stuff */
+ SendMessage (g_hwndClipboard, WM_DESTROY, 0, 0);
+ /* NOTE: g_hwndClipboard is set to NULL in winclipboardthread.c */
+ }
+ else
+ return;
+
+ /* Wait for the clipboard thread to exit */
+ pthread_join (g_ptClipboardProc, NULL);
+
+ winDebug ("winClipboardShutdown - Clipboard thread has exited.\n");
+ }
+}
+#endif
+
+
+#if defined(DDXBEFORERESET)
+/*
+ * Called right before KillAllClients when the server is going to reset,
+ * allows us to shutdown our seperate threads cleanly.
+ */
+
+void
+ddxBeforeReset (void)
+{
+ winDebug ("ddxBeforeReset - Hello\n");
+
+#ifdef XWIN_CLIPBOARD
+ winClipboardShutdown ();
+#endif
+}
+#endif
+
+
+/* See Porting Layer Definition - p. 57 */
+void
+ddxGiveUp (void)
+{
+ int i;
+
+ winDebug ("ddxGiveUp\n");
+
+ /* Perform per-screen deinitialization */
+ for (i = 0; i < g_iNumScreens; ++i)
+ {
+ /* Delete the tray icon */
+ if (!g_ScreenInfo[i].fNoTrayIcon && g_ScreenInfo[i].pScreen)
+ winDeleteNotifyIcon (winGetScreenPriv (g_ScreenInfo[i].pScreen));
+ }
+
+#ifdef XWIN_MULTIWINDOW
+ /* Notify the worker threads we're exiting */
+ winDeinitMultiWindowWM ();
+#endif
+
+#ifdef HAS_DEVWINDOWS
+ /* Close our handle to our message queue */
+ if (g_fdMessageQueue != WIN_FD_INVALID)
+ {
+ /* Close /dev/windows */
+ close (g_fdMessageQueue);
+
+ /* Set the file handle to invalid */
+ g_fdMessageQueue = WIN_FD_INVALID;
+ }
+#endif
+
+ if (!g_fLogInited) {
+ g_pszLogFile = LogInit (g_pszLogFile, NULL);
+ g_fLogInited = TRUE;
+ }
+ LogClose ();
+
+ /*
+ * At this point we aren't creating any new screens, so
+ * we are guaranteed to not need the DirectDraw functions.
+ */
+ winReleaseDDProcAddresses();
+
+ /* Unload our TrackMouseEvent function pointer */
+ if (g_hmodCommonControls != NULL)
+ {
+ FreeLibrary (g_hmodCommonControls);
+ g_hmodCommonControls = NULL;
+ g_fpTrackMouseEvent = (FARPROC) (void (*)(void))NoopDDA;
+ }
+
+ /* Free concatenated command line */
+ free(g_pszCommandLine);
+ g_pszCommandLine = NULL;
+
+ /* Remove our keyboard hook if it is installed */
+ winRemoveKeyboardHookLL ();
+
+ /* Tell Windows that we want to end the app */
+ PostQuitMessage (0);
+}
+
+
+/* See Porting Layer Definition - p. 57 */
+void
+AbortDDX (void)
+{
+ winDebug ("AbortDDX\n");
+ ddxGiveUp ();
+}
+
+#ifdef __CYGWIN__
+/* hasmntopt is currently not implemented for cygwin */
+static const char *winCheckMntOpt(const struct mntent *mnt, const char *opt)
+{
+ const char *s;
+ size_t len;
+ if (mnt == NULL)
+ return NULL;
+ if (opt == NULL)
+ return NULL;
+ if (mnt->mnt_opts == NULL)
+ return NULL;
+
+ len = strlen(opt);
+ s = strstr(mnt->mnt_opts, opt);
+ if (s == NULL)
+ return NULL;
+ if ((s == mnt->mnt_opts || *(s-1) == ',') && (s[len] == 0 || s[len] == ','))
+ return (char *)opt;
+ return NULL;
+}
+
+static void
+winCheckMount(void)
+{
+ FILE *mnt;
+ struct mntent *ent;
+
+ enum { none = 0, sys_root, user_root, sys_tmp, user_tmp }
+ level = none, curlevel;
+ BOOL binary = TRUE;
+
+ mnt = setmntent("/etc/mtab", "r");
+ if (mnt == NULL)
+ {
+ ErrorF("setmntent failed");
+ return;
+ }
+
+ while ((ent = getmntent(mnt)) != NULL)
+ {
+ BOOL system = (winCheckMntOpt(ent, "user") != NULL);
+ BOOL root = (strcmp(ent->mnt_dir, "/") == 0);
+ BOOL tmp = (strcmp(ent->mnt_dir, "/tmp") == 0);
+
+ if (system)
+ {
+ if (root)
+ curlevel = sys_root;
+ else if (tmp)
+ curlevel = sys_tmp;
+ else
+ continue;
+ }
+ else
+ {
+ if (root)
+ curlevel = user_root;
+ else if (tmp)
+ curlevel = user_tmp;
+ else
+ continue;
+ }
+
+ if (curlevel <= level)
+ continue;
+ level = curlevel;
+
+ if ((winCheckMntOpt(ent, "binary") == NULL) &&
+ (winCheckMntOpt(ent, "binmode") == NULL))
+ binary = FALSE;
+ else
+ binary = TRUE;
+ }
+
+ if (endmntent(mnt) != 1)
+ {
+ ErrorF("endmntent failed");
+ return;
+ }
+
+#ifdef WINDBG
+ if (!binary)
+ winDebug("/tmp mounted in textmode\n");
+#endif
+}
+#else
+static void
+winCheckMount(void)
+{
+}
+#endif
+
+#ifdef RELOCATE_PROJECTROOT
+const char *
+winGetBaseDir(void)
+{
+ static BOOL inited = FALSE;
+ static char buffer[MAX_PATH];
+ if (!inited)
+ {
+ char *fendptr;
+ HMODULE module = GetModuleHandle(NULL);
+ DWORD size = GetModuleFileName(module, buffer, sizeof(buffer));
+ if (sizeof(buffer) > 0)
+ buffer[sizeof(buffer)-1] = 0;
+
+ fendptr = buffer + size;
+ while (fendptr > buffer)
+ {
+ if (*fendptr == '\\' || *fendptr == '/')
+ {
+ *fendptr = 0;
+ break;
+ }
+ fendptr--;
+ }
+ inited = TRUE;
+ }
+ return buffer;
+}
+#endif
+
+static void
+winFixupPaths (void)
+{
+ BOOL changed_fontpath = FALSE;
+ MessageType font_from = X_DEFAULT;
+#ifdef RELOCATE_PROJECTROOT
+ const char *basedir = winGetBaseDir();
+ size_t basedirlen = strlen(basedir);
+#endif
+
+#ifdef READ_FONTDIRS
+ {
+ /* Open fontpath configuration file */
+#if defined WIN32 && defined __MINGW32__
+ static Bool once = False;
+ char buffer[MAX_PATH];
+ snprintf(buffer, sizeof(buffer), "%s\\font-dirs", basedir);
+ buffer[sizeof(buffer)-1] = 0;
+ FILE *fontdirs = fopen(buffer, "rt");
+ if (once) fontdirs = NULL;
+ else once = True;
+#else
+ FILE *fontdirs = fopen(ETCX11DIR "/font-dirs", "rt");
+#endif
+ if (fontdirs != NULL)
+ {
+ char buffer[256];
+ int needs_sep = TRUE;
+ int comment_block = FALSE;
+
+ /* get default fontpath */
+ char *fontpath = strdup(defaultFontPath);
+ size_t size = strlen(fontpath);
+
+ /* read all lines */
+ while (!feof(fontdirs))
+ {
+ size_t blen;
+ char *hashchar;
+ char *str;
+ int has_eol = FALSE;
+
+ /* read one line */
+ str = fgets(buffer, sizeof(buffer), fontdirs);
+ if (str == NULL) /* stop on error or eof */
+ break;
+
+ if (strchr(str, '\n') != NULL)
+ has_eol = TRUE;
+
+ /* check if block is continued comment */
+ if (comment_block)
+ {
+ /* ignore all input */
+ *str = 0;
+ blen = 0;
+ if (has_eol) /* check if line ended in this block */
+ comment_block = FALSE;
+ }
+ else
+ {
+ /* find comment character. ignore all trailing input */
+ hashchar = strchr(str, '#');
+ if (hashchar != NULL)
+ {
+ *hashchar = 0;
+ if (!has_eol) /* mark next block as continued comment */
+ comment_block = TRUE;
+ }
+ }
+
+ /* strip whitespaces from beginning */
+ while (*str == ' ' || *str == '\t')
+ str++;
+
+ /* get size, strip whitespaces from end */
+ blen = strlen(str);
+ while (blen > 0 && (str[blen-1] == ' ' ||
+ str[blen-1] == '\t' || str[blen-1] == '\n'))
+ {
+ str[--blen] = 0;
+ }
+
+ /* still something left to add? */
+ if (blen > 0)
+ {
+ size_t newsize = size + blen;
+ /* reserve one character more for ',' */
+ if (needs_sep)
+ newsize++;
+
+ /* allocate memory */
+ if (fontpath == NULL)
+ fontpath = malloc(newsize+1);
+ else
+ fontpath = realloc(fontpath, newsize+1);
+
+ /* add separator */
+ if (needs_sep)
+ {
+ fontpath[size] = ',';
+ size++;
+ needs_sep = FALSE;
+ }
+
+ /* mark next line as new entry */
+ if (has_eol)
+ needs_sep = TRUE;
+
+ /* add block */
+ strncpy(fontpath + size, str, blen);
+ fontpath[newsize] = 0;
+ size = newsize;
+ }
+ }
+
+ /* cleanup */
+ fclose(fontdirs);
+ defaultFontPath = strdup(fontpath);
+ free(fontpath);
+ changed_fontpath = TRUE;
+ font_from = X_CONFIG;
+ }
+ }
+#endif /* READ_FONTDIRS */
+#ifdef RELOCATE_PROJECTROOT
+ {
+ const char *libx11dir = PROJECTROOT "/lib/X11";
+ size_t libx11dir_len = strlen(libx11dir);
+ char *newfp = NULL;
+ size_t newfp_len = 0;
+ const char *endptr, *ptr, *oldptr = defaultFontPath;
+
+ endptr = oldptr + strlen(oldptr);
+ ptr = strchr(oldptr, ',');
+ if (ptr == NULL)
+ ptr = endptr;
+ while (ptr != NULL)
+ {
+ size_t oldfp_len = (ptr - oldptr);
+ size_t newsize = oldfp_len;
+ char *newpath = malloc(newsize + 1);
+ strncpy(newpath, oldptr, newsize);
+ newpath[newsize] = 0;
+
+
+ if (strncmp(libx11dir, newpath, libx11dir_len) == 0)
+ {
+ char *compose;
+ newsize = newsize - libx11dir_len + basedirlen;
+ compose = malloc(newsize + 1);
+ strcpy(compose, basedir);
+ strncat(compose, newpath + libx11dir_len, newsize - basedirlen);
+ compose[newsize] = 0;
+ free(newpath);
+ newpath = compose;
+ }
+
+ oldfp_len = newfp_len;
+ if (oldfp_len > 0)
+ newfp_len ++; /* space for separator */
+ newfp_len += newsize;
+
+ if (newfp == NULL)
+ newfp = malloc(newfp_len + 1);
+ else
+ newfp = realloc(newfp, newfp_len + 1);
+
+ if (oldfp_len > 0)
+ {
+ strcpy(newfp + oldfp_len, ",");
+ oldfp_len++;
+ }
+ strcpy(newfp + oldfp_len, newpath);
+
+ free(newpath);
+
+ if (*ptr == 0)
+ {
+ oldptr = ptr;
+ ptr = NULL;
+ } else
+ {
+ oldptr = ptr + 1;
+ ptr = strchr(oldptr, ',');
+ if (ptr == NULL)
+ ptr = endptr;
+ }
+ }
+
+ defaultFontPath = strdup(newfp);
+ free(newfp);
+ changed_fontpath = TRUE;
+ }
+#endif /* RELOCATE_PROJECTROOT */
+ if (changed_fontpath)
+ winDebug ("FontPath set to \"%s\"\n", defaultFontPath);
+
+#ifdef RELOCATE_PROJECTROOT
+ if (getenv("XKEYSYMDB") == NULL)
+ {
+ char buffer[MAX_PATH];
+ snprintf(buffer, sizeof(buffer), "XKEYSYMDB=%s\\XKeysymDB",
+ basedir);
+ buffer[sizeof(buffer)-1] = 0;
+ putenv(buffer);
+ }
+ if (getenv("XERRORDB") == NULL)
+ {
+ char buffer[MAX_PATH];
+ snprintf(buffer, sizeof(buffer), "XERRORDB=%s\\XErrorDB",
+ basedir);
+ buffer[sizeof(buffer)-1] = 0;
+ putenv(buffer);
+ }
+ if (getenv("XLOCALEDIR") == NULL)
+ {
+ char buffer[MAX_PATH];
+ snprintf(buffer, sizeof(buffer), "XLOCALEDIR=%s\\locale",
+ basedir);
+ buffer[sizeof(buffer)-1] = 0;
+ putenv(buffer);
+ }
+ if (getenv("XHOSTPREFIX") == NULL)
+ {
+ char buffer[MAX_PATH];
+ snprintf(buffer, sizeof(buffer), "XHOSTPREFIX=%s\\X",
+ basedir);
+ buffer[sizeof(buffer)-1] = 0;
+ putenv(buffer);
+ }
+ if (getenv("HOME") == NULL)
+ {
+ HMODULE shfolder;
+ SHGETFOLDERPATHPROC shgetfolderpath = NULL;
+ char buffer[MAX_PATH + 5];
+ strncpy(buffer, "HOME=", 5);
+
+ /* Try to load SHGetFolderPath from shfolder.dll and shell32.dll */
+
+ shfolder = LoadLibrary("shfolder.dll");
+ /* fallback to shell32.dll */
+ if (shfolder == NULL)
+ shfolder = LoadLibrary("shell32.dll");
+
+ /* resolve SHGetFolderPath */
+ if (shfolder != NULL)
+ shgetfolderpath = (SHGETFOLDERPATHPROC)GetProcAddress(shfolder, "SHGetFolderPathA");
+
+ /* query appdata directory */
+ if (shgetfolderpath &&
+ shgetfolderpath(NULL, CSIDL_APPDATA|CSIDL_FLAG_CREATE, NULL, 0,
+ buffer + 5) == 0)
+ {
+ putenv(buffer);
+ } else
+ {
+ ErrorF ("Can not determine HOME directory\n");
+ }
+ if (shfolder != NULL)
+ FreeLibrary(shfolder);
+ }
+ if (!g_fLogFileChanged) {
+ static char buffer[MAX_PATH];
+ DWORD size = GetTempPath(sizeof(buffer), buffer);
+ if (size && size < sizeof(buffer))
+ {
+ snprintf(buffer + size, sizeof(buffer) - size,
+ "VCXSrv.%s.log", display);
+ buffer[sizeof(buffer)-1] = 0;
+ g_pszLogFile = buffer;
+ GetLongPathName(buffer, buffer, MAX_PATH);
+ winDebug ("Logfile set to \"%s\"\n", g_pszLogFile);
+ }
+ }
+ {
+ static char xkbbasedir[MAX_PATH];
+
+ snprintf(xkbbasedir, sizeof(xkbbasedir), "%s\\xkbdata", basedir);
+ if (sizeof(xkbbasedir) > 0)
+ xkbbasedir[sizeof(xkbbasedir)-1] = 0;
+ XkbBaseDirectory = xkbbasedir;
+ XkbBinDirectory = basedir;
+ }
+#endif /* RELOCATE_PROJECTROOT */
+}
+
+void
+OsVendorInit (void)
+{
+ /* Re-initialize global variables on server reset */
+ winInitializeGlobals ();
+
+ winFixupPaths();
+
+#ifdef DDXOSVERRORF
+ if (!OsVendorVErrorFProc)
+ OsVendorVErrorFProc = OsVendorVErrorF;
+#endif
+
+ if (!g_fLogInited) {
+ /* keep this order. If LogInit fails it calls Abort which then calls
+ * ddxGiveUp where LogInit is called again and creates an infinite
+ * recursion. If we set g_fLogInited to TRUE before the init we
+ * avoid the second call
+ */
+ g_fLogInited = TRUE;
+ g_pszLogFile = LogInit (g_pszLogFile, NULL);
+ }
+ LogSetParameter (XLOG_FLUSH, 1);
+ LogSetParameter (XLOG_VERBOSITY, g_iLogVerbose);
+ LogSetParameter (XLOG_FILE_VERBOSITY, g_iLogVerbose);
+
+ /* Log the version information */
+ if (serverGeneration == 1)
+ winLogVersionInfo ();
+
+ winCheckMount();
+
+ /* Add a default screen if no screens were specified */
+ if (g_iNumScreens == 0)
+ {
+ winDebug ("OsVendorInit - Creating default screen 0\n");
+
+ /*
+ * We need to initialize the default screen 0 if no -screen
+ * arguments were processed.
+ *
+ * Add a screen 0 using the defaults set by winInitializeDefaultScreens()
+ * and any additional default screen parameters given
+ */
+ winInitializeScreens(1);
+
+ /* We have to flag this as an explicit screen, even though it isn't */
+ g_ScreenInfo[0].fExplicitScreen = TRUE;
+ }
+}
+
+
+static void
+winUseMsg (void)
+{
+ ErrorF("\n");
+ ErrorF("\n");
+ ErrorF(EXECUTABLE_NAME " Device Dependent Usage:\n");
+ ErrorF("\n");
+
+#ifdef XWIN_CLIPBOARD
+ ErrorF ("-[no]clipboard\n"
+ "\tEnable [disable] the clipboard integration. Default is enabled.\n");
+ ErrorF ("-[no]clipboardprimary\n"
+ "\t[Do not] map the PRIMARY selection to the windows clipboard.\n"
+ "\tThe CLIPBOARD selection is always mapped if -clipboard is enabled.\n"
+ "\tDefault is mapped.\n");
+#endif
+
+ ErrorF ("-clipupdates num_boxes\n"
+ "\tUse a clipping region to constrain shadow update blits to\n"
+ "\tthe updated region when num_boxes, or more, are in the\n"
+ "\tupdated region.\n");
+
+#ifdef XWIN_XF86CONFIG
+ ErrorF ("-config\n"
+ "\tSpecify a configuration file.\n");
+
+ ErrorF ("-configdir\n"
+ "\tSpecify a configuration directory.\n");
+#endif
+
+ ErrorF ("-depth bits_per_pixel\n"
+ "\tSpecify an optional bitdepth to use in fullscreen mode\n"
+ "\twith a DirectDraw engine.\n");
+
+ ErrorF ("-emulate3buttons [timeout]\n"
+ "\tEmulate 3 button mouse with an optional timeout in\n"
+ "\tmilliseconds.\n");
+
+#ifdef XWIN_EMULATEPSEUDO
+ ErrorF ("-emulatepseudo\n"
+ "\tCreate a depth 8 PseudoColor visual when running in\n"
+ "\tdepths 15, 16, 24, or 32, collectively known as TrueColor\n"
+ "\tdepths. The PseudoColor visual does not have correct colors,\n"
+ "\tand it may crash, but it at least allows you to run your\n"
+ "\tapplication in TrueColor modes.\n");
+#endif
+
+ ErrorF ("-engine engine_type_id\n"
+ "\tOverride the server's automatically selected engine type:\n"
+ "\t\t1 - Shadow GDI\n"
+ "\t\t2 - Shadow DirectDraw\n"
+ "\t\t4 - Shadow DirectDraw4 Non-Locking\n"
+#ifdef XWIN_PRIMARYFB
+ "\t\t8 - Primary DirectDraw - obsolete\n"
+#endif
+#ifdef XWIN_NATIVEGDI
+ "\t\t16 - Native GDI - experimental\n"
+#endif
+ );
+
+ ErrorF ("-fullscreen\n"
+ "\tRun the server in fullscreen mode.\n");
+
+ ErrorF ("-ignoreinput\n"
+ "\tIgnore keyboard and mouse input.\n");
+
+#ifdef XWIN_MULTIWINDOWINTWM
+ ErrorF ("-internalwm\n"
+ "\tRun the internal window manager.\n");
+#endif
+
+#ifdef XWIN_XF86CONFIG
+ ErrorF ("-keyboard\n"
+ "\tSpecify a keyboard device from the configuration file.\n");
+#endif
+
+ ErrorF ("-[no]keyhook\n"
+ "\tGrab special Windows keypresses like Alt-Tab or the Menu "
+ "key.\n");
+
+ ErrorF ("-lesspointer\n"
+ "\tHide the windows mouse pointer when it is over any\n"
+ "\t" EXECUTABLE_NAME " window. This prevents ghost cursors appearing when\n"
+ "\tthe Windows cursor is drawn on top of the X cursor\n");
+
+ ErrorF ("-logfile filename\n"
+ "\tWrite log messages to <filename>.\n");
+
+ ErrorF ("-logverbose verbosity\n"
+ "\tSet the verbosity of log messages. [NOTE: Only a few messages\n"
+ "\trespect the settings yet]\n"
+ "\t\t0 - only print fatal error.\n"
+ "\t\t1 - print additional configuration information.\n"
+ "\t\t2 - print additional runtime information [default].\n"
+ "\t\t3 - print debugging and tracing information.\n");
+
+ ErrorF ("-[no]multimonitors or -[no]multiplemonitors\n"
+ "\tUse the entire virtual screen if multiple\n"
+ "\tmonitors are present.\n");
+
+#ifdef XWIN_MULTIWINDOW
+ ErrorF ("-multiwindow\n"
+ "\tRun the server in multi-window mode.\n");
+#endif
+
+#ifdef XWIN_MULTIWINDOWEXTWM
+ ErrorF ("-mwextwm\n"
+ "\tRun the server in multi-window external window manager mode.\n");
+#endif
+
+ ErrorF ("-nodecoration\n"
+ "\tDo not draw a window border, title bar, etc. Windowed\n"
+ "\tmode only.\n");
+
+#ifdef XWIN_CLIPBOARD
+ ErrorF ("-nounicodeclipboard\n"
+ "\tDo not use Unicode clipboard even if on a NT-based platform.\n");
+#endif
+
+ ErrorF ("-refresh rate_in_Hz\n"
+ "\tSpecify an optional refresh rate to use in fullscreen mode\n"
+ "\twith a DirectDraw engine.\n");
+
+ ErrorF ("-resize=none|scrollbars|randr"
+ "\tIn windowed mode, [don't] allow resizing of the window. 'scrollbars'\n"
+ "\tmode gives the window scrollbars as needed, 'randr' mode uses the RANR\n"
+ "\textension to resize the X screen.\n");
+
+ ErrorF ("-rootless\n"
+ "\tRun the server in rootless mode.\n");
+
+ ErrorF ("-screen scr_num [width height [x y] | [[WxH[+X+Y]][@m]] ]\n"
+ "\tEnable screen scr_num and optionally specify a width and\n"
+ "\theight and initial position for that screen. Additionally\n"
+ "\ta monitor number can be specified to start the server on,\n"
+ "\tat which point, all coordinates become relative to that\n"
+ "\tmonitor (Not for Windows NT4 and 95). Examples:\n"
+ "\t -screen 0 800x600+100+100@2 ; 2nd monitor offset 100,100 size 800x600\n"
+ "\t -screen 0 1024x768@3 ; 3rd monitor size 1024x768\n"
+ "\t -screen 0 @1 ; on 1st monitor using its full resolution (the default)\n");
+
+ ErrorF ("-silent-dup-error\n"
+ "\tIf another instance of " EXECUTABLE_NAME " with the same display number is running\n"
+ "\texit silently and don't display any error message.\n");
+
+ ErrorF ("-swcursor\n"
+ "\tDisable the usage of the Windows cursor and use the X11 software\n"
+ "\tcursor instead.\n");
+
+ ErrorF ("-[no]trayicon\n"
+ "\tDo not create a tray icon. Default is to create one\n"
+ "\ticon per screen. You can globally disable tray icons with\n"
+ "\t-notrayicon, then enable it for specific screens with\n"
+ "\t-trayicon for those screens.\n");
+
+ ErrorF ("-[no]unixkill\n"
+ "\tCtrl+Alt+Backspace exits the X Server.\n");
+
+ ErrorF ("-[no]wgl\n"
+ "\tEnable the GLX extension to use the native Windows WGL interface for accelerated OpenGL\n");
+
+ ErrorF ("-[no]winkill\n"
+ "\tAlt+F4 exits the X Server.\n");
+
+ ErrorF ("-xkblayout XKBLayout\n"
+ "\tEquivalent to XKBLayout in XF86Config files.\n"
+ "\tFor example: -xkblayout de\n");
+
+ ErrorF ("-xkbmodel XKBModel\n"
+ "\tEquivalent to XKBModel in XF86Config files.\n");
+
+ ErrorF ("-xkboptions XKBOptions\n"
+ "\tEquivalent to XKBOptions in XF86Config files.\n");
+
+ ErrorF ("-xkbrules XKBRules\n"
+ "\tEquivalent to XKBRules in XF86Config files.\n");
+
+ ErrorF ("-xkbvariant XKBVariant\n"
+ "\tEquivalent to XKBVariant in XF86Config files.\n"
+ "\tFor example: -xkbvariant nodeadkeys\n");
+}
+
+/* See Porting Layer Definition - p. 57 */
+void
+ddxUseMsg(void)
+{
+ /* Set a flag so that FatalError won't give duplicate warning message */
+ g_fSilentFatalError = TRUE;
+
+ winUseMsg();
+
+ /* Log file will not be opened for UseMsg unless we open it now */
+ if (!g_fLogInited) {
+ g_pszLogFile = LogInit (g_pszLogFile, NULL);
+ g_fLogInited = TRUE;
+ }
+ LogClose ();
+
+ /* Notify user where UseMsg text can be found.*/
+ if (!g_fNoHelpMessageBox)
+ winMessageBoxF ("The " PROJECT_NAME " help text has been printed to "
+ "%s.\n"
+ "Please open %s to read the help text.\n",
+ MB_ICONINFORMATION, g_pszLogFile, g_pszLogFile);
+}
+
+/* See Porting Layer Definition - p. 20 */
+/*
+ * Do any global initialization, then initialize each screen.
+ *
+ * NOTE: We use ddxProcessArgument, so we don't need to touch argc and argv
+ */
+
+void
+InitOutput (ScreenInfo *screenInfo, int argc, char *argv[])
+{
+ int i;
+
+ /* Log the command line */
+ winLogCommandLine (argc, argv);
+
+ winDebug ("InitOutput\n");
+
+ /* Validate command-line arguments */
+ if (serverGeneration == 1 && !winValidateArgs ())
+ {
+ FatalError ("InitOutput - Invalid command-line arguments found. "
+ "Exiting.\n");
+ }
+
+ /* Check for duplicate invocation on same display number.*/
+ if (serverGeneration == 1 && !winCheckDisplayNumber ())
+ {
+ if (g_fSilentDupError)
+ g_fSilentFatalError = TRUE;
+ FatalError ("InitOutput - Duplicate invocation on display "
+ "number: %s. Exiting.\n", display);
+ }
+
+#ifdef XWIN_XF86CONFIG
+ /* Try to read the xorg.conf-style configuration file */
+ if (!winReadConfigfile ())
+ ErrorF ("InitOutput - Error reading config file\n");
+#else
+ winConfigFiles ();
+#endif
+
+ /* Load preferences from XWinrc file */
+ LoadPreferences();
+
+ /* Setup global screen info parameters */
+ screenInfo->imageByteOrder = IMAGE_BYTE_ORDER;
+ screenInfo->bitmapScanlinePad = BITMAP_SCANLINE_PAD;
+ screenInfo->bitmapScanlineUnit = BITMAP_SCANLINE_UNIT;
+ screenInfo->bitmapBitOrder = BITMAP_BIT_ORDER;
+ screenInfo->numPixmapFormats = NUMFORMATS;
+
+ /* Describe how we want common pixmap formats padded */
+ for (i = 0; i < NUMFORMATS; i++)
+ {
+ screenInfo->formats[i] = g_PixmapFormats[i];
+ }
+
+ /* Load pointers to DirectDraw functions */
+ winGetDDProcAddresses ();
+
+ /* Detect supported engines */
+ winDetectSupportedEngines ();
+
+ /* Load common controls library */
+ g_hmodCommonControls = LoadLibraryEx ("comctl32.dll", NULL, 0);
+
+ /* Load TrackMouseEvent function pointer */
+ g_fpTrackMouseEvent = GetProcAddress (g_hmodCommonControls,
+ "_TrackMouseEvent");
+ if (g_fpTrackMouseEvent == NULL)
+ {
+ ErrorF ("InitOutput - Could not get pointer to function\n"
+ "\t_TrackMouseEvent in comctl32.dll. Try installing\n"
+ "\tInternet Explorer 3.0 or greater if you have not\n"
+ "\talready.\n");
+
+ /* Free the library since we won't need it */
+ FreeLibrary (g_hmodCommonControls);
+ g_hmodCommonControls = NULL;
+
+ /* Set function pointer to point to no operation function */
+ g_fpTrackMouseEvent = (FARPROC) (void (*)(void))NoopDDA;
+ }
+
+ /* Store the instance handle */
+ g_hInstance = GetModuleHandle (NULL);
+
+ /* Initialize each screen */
+ for (i = 0; i < g_iNumScreens; ++i)
+ {
+ /* Initialize the screen */
+ if (-1 == AddScreen (winScreenInit, argc, argv))
+ {
+ FatalError ("InitOutput - Couldn't add screen %d", i);
+ }
+ }
+
+#if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW)
+
+ /* Generate a cookie used by internal clients for authorization */
+ if (g_fXdmcpEnabled || g_fAuthEnabled)
+ winGenerateAuthorization ();
+
+ /* Perform some one time initialization */
+ if (1 == serverGeneration)
+ {
+ /*
+ * setlocale applies to all threads in the current process.
+ * Apply locale specified in LANG environment variable.
+ */
+ if (!setlocale (LC_ALL, ""))
+ {
+ ErrorF ("setlocale failed.\n");
+ }
+
+ /* See if X supports the current locale */
+ if (XSupportsLocale () == FALSE)
+ {
+ ErrorF ("Warning: Locale not supported by X, falling back to 'C' locale.\n");
+ setlocale(LC_ALL, "C");
+ }
+
+ }
+#endif
+
+ winDebug ("InitOutput - Returning.\n");
+}
+
+
+/*
+ * winCheckDisplayNumber - Check if another instance of Cygwin/X is
+ * already running on the same display number. If no one exists,
+ * make a mutex to prevent new instances from running on the same display.
+ *
+ * return FALSE if the display number is already used.
+ */
+
+static Bool
+winCheckDisplayNumber (void)
+{
+ int nDisp;
+ HANDLE mutex;
+ char name[MAX_PATH];
+ char * pszPrefix = '\0';
+ OSVERSIONINFO osvi = {0};
+
+ /* Check display range */
+ nDisp = atoi (display);
+ if (nDisp < 0 || nDisp > 59535)
+ {
+ ErrorF ("winCheckDisplayNumber - Bad display number: %d\n", nDisp);
+ return FALSE;
+ }
+
+ /* Set first character of mutex name to null */
+ name[0] = '\0';
+
+ /* Get operating system version information */
+ osvi.dwOSVersionInfoSize = sizeof (osvi);
+ GetVersionEx (&osvi);
+
+ /* Want a mutex shared among all terminals on NT > 4.0 */
+ if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT
+ && osvi.dwMajorVersion >= 5)
+ {
+ pszPrefix = "Global\\";
+ }
+
+ /* Setup Cygwin/X specific part of name */
+ snprintf (name, sizeof(name), "%sCYGWINX_DISPLAY:%d", pszPrefix, nDisp);
+
+ /* Windows automatically releases the mutex when this process exits */
+ mutex = CreateMutex (NULL, FALSE, name);
+ if (!mutex)
+ {
+ LPVOID lpMsgBuf;
+
+ /* Display a fancy error message */
+ FormatMessage (FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_FROM_SYSTEM |
+ FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL,
+ GetLastError (),
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+ (LPTSTR) &lpMsgBuf,
+ 0, NULL);
+ ErrorF ("winCheckDisplayNumber - CreateMutex failed: %s\n",
+ (LPSTR)lpMsgBuf);
+ LocalFree (lpMsgBuf);
+
+ return FALSE;
+ }
+ if (GetLastError () == ERROR_ALREADY_EXISTS)
+ {
+ ErrorF ("winCheckDisplayNumber - "
+ "VCXsrv, Xming or Cygwin/X is already running on display %d\n",
+ nDisp);
+ return FALSE;
+ }
+
+ return TRUE;
+}
diff --git a/xorg-server/hw/xwin/Makefile.am b/xorg-server/hw/xwin/Makefile.am index ce2edb2e6..0afd81883 100644 --- a/xorg-server/hw/xwin/Makefile.am +++ b/xorg-server/hw/xwin/Makefile.am @@ -120,6 +120,7 @@ SRCS = InitInput.c \ winprefs.h \ winresource.h \ winwindow.h \ + windisplay.c \ XWin.rc \ $(top_srcdir)/Xext/dpmsstubs.c \ $(top_srcdir)/Xi/stubs.c \ diff --git a/xorg-server/hw/xwin/XWin.rc b/xorg-server/hw/xwin/XWin.rc index 539bd0e4d..304ba87f1 100644 --- a/xorg-server/hw/xwin/XWin.rc +++ b/xorg-server/hw/xwin/XWin.rc @@ -1,108 +1,116 @@ -/* - *Copyright (C) 2002-2004 Harold L Hunt II All Rights Reserved. - *Copyright (C) 2008 Yaakov Selkowitz All Rights Reserved - * - *Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - *"Software"), to deal in the Software without restriction, including - *without limitation the rights to use, copy, modify, merge, publish, - *distribute, sublicense, and/or sell copies of the Software, and to - *permit persons to whom the Software is furnished to do so, subject to - *the following conditions: - * - *The above copyright notice and this permission notice shall be - *included in all copies or substantial portions of the Software. - * - *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - *NONINFRINGEMENT. IN NO EVENT SHALL HAROLD L HUNT II BE LIABLE FOR - *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - *Except as contained in this notice, the names of the authors - *shall not be used in advertising or otherwise to promote the sale, use - *or other dealings in this Software without prior written authorization - *from the authors. - * - * Authors: Harold L Hunt II, Yaakov Selkowitz - */ - -#include <windows.h> -#include "winresource.h" -#include "xwin-config.h" -#include "version-config.h" - -/* - * Dialogs - */ - -/* About */ -ABOUT_BOX DIALOGEX 32, 32, 260, 105 -STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE | WS_TABSTOP | DS_CENTERMOUSE -CAPTION "About " XVENDORNAMESHORT -FONT 8, "MS Shell Dlg 2" -BEGIN - CONTROL IDI_XWIN, IDC_STATIC, "Static", SS_ICON, 8, 8, 32, 32 - LTEXT XVENDORNAMESHORT " X Server ", IDC_STATIC, 36, 8, 220, 8 - LTEXT VENDOR_MAN_VERSION, IDC_STATIC, 36, 18, 220, 8 - LTEXT BUILDERSTRING, IDC_STATIC, 36, 28, 220, 8 - LTEXT "This software is licensed under the terms of the MIT/X11 License.", IDC_STATIC, 36, 48, 220, 20 - CONTROL __VENDORDWEBSUPPORT__, ID_ABOUT_WEBSITE, "Button", - BS_OWNERDRAW | WS_TABSTOP, 36, 68, 68, 8 - DEFPUSHBUTTON "&OK", IDOK, 105, 85, 50, 15 -END - - -/* Depth change */ - -DEPTH_CHANGE_BOX DIALOGEX 32, 32, 180, 100 -STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE | DS_CENTERMOUSE -FONT 8, "MS Shell Dlg 2" -CAPTION XVENDORNAMESHORT -BEGIN - DEFPUSHBUTTON "Dismiss", IDOK, 66, 80, 50, 14 - CTEXT XVENDORNAMESHORT, IDC_STATIC, 40, 12, 100, 8 - CTEXT "Disruptive screen configuration change.", IDC_STATIC, 7, 40, 166, 8 - CTEXT "Restore previous resolution to use " XVENDORNAMESHORT ".", IDC_STATIC, 7, 52, 166, 8 -END - - -/* Exit */ - -EXIT_DIALOG DIALOGEX 32, 32, 180, 78 -STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE | WS_TABSTOP | DS_CENTERMOUSE -FONT 8, "MS Shell Dlg 2" -CAPTION "Exit " XVENDORNAMESHORT "?" -BEGIN - PUSHBUTTON "E&xit", IDOK, 55, 56, 30, 14 - DEFPUSHBUTTON "&Cancel", IDCANCEL, 95, 56, 30, 14 - CTEXT "E&xiting will close all screens running on this display.", IDC_STATIC, 7, 12, 166, 8 - CTEXT "No information about connected clients available.", IDC_CLIENTS_CONNECTED, 7, 24, 166, 8 - CTEXT "Proceed with shutdown of this display/server?", IDC_STATIC, 7, 36, 166, 8 -END - - -/* - * Menus - */ - -IDM_TRAYICON_MENU MENU -BEGIN - POPUP "TRAYICON_MENU" - BEGIN - MENUITEM "&Hide Root Window", ID_APP_HIDE_ROOT - MENUITEM "&About...", ID_APP_ABOUT - MENUITEM SEPARATOR - MENUITEM "E&xit...", ID_APP_EXIT - END -END - - -/* - * Icons - */ - -IDI_XWIN ICON "X.ico" -CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "XWin.exe.manifest" +/*
+ *Copyright (C) 2002-2004 Harold L Hunt II All Rights Reserved.
+ *Copyright (C) 2008 Yaakov Selkowitz All Rights Reserved
+ *
+ *Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ *"Software"), to deal in the Software without restriction, including
+ *without limitation the rights to use, copy, modify, merge, publish,
+ *distribute, sublicense, and/or sell copies of the Software, and to
+ *permit persons to whom the Software is furnished to do so, subject to
+ *the following conditions:
+ *
+ *The above copyright notice and this permission notice shall be
+ *included in all copies or substantial portions of the Software.
+ *
+ *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *NONINFRINGEMENT. IN NO EVENT SHALL HAROLD L HUNT II BE LIABLE FOR
+ *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+ *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *Except as contained in this notice, the names of the authors
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the authors.
+ *
+ * Authors: Harold L Hunt II, Yaakov Selkowitz
+ */
+
+#include <windows.h>
+#include "winresource.h"
+#include "xwin-config.h"
+
+/*
+ * Dialogs
+ */
+
+/* About */
+ABOUT_BOX DIALOGEX 32, 32, 260, 95
+STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE | WS_TABSTOP | DS_CENTERMOUSE
+CAPTION "About "XVENDORNAMESHORT
+FONT 8, "MS Shell Dlg 2"
+BEGIN
+ CONTROL IDI_XWIN, IDC_STATIC, "Static", SS_ICON, 8, 8, 32, 32
+ LTEXT "VcXsrv X Server ", IDC_STATIC, 36, 8, 220, 8
+ LTEXT "http://www.hc-consult.be", IDC_STATIC, 36, 18, 220, 8
+ LTEXT "marc@hc-consult.be", IDC_STATIC, 36, 28, 220, 8
+ LTEXT "Version 1.10.1.1 (24 May 2011)", IDC_STATIC, 36, 38, 220, 8
+ DEFPUSHBUTTON "OK", IDOK, 105, 75, 50, 15
+END
+
+
+/* Depth change */
+
+DEPTH_CHANGE_BOX DIALOGEX 32, 32, 180, 100
+STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE | DS_CENTERMOUSE
+FONT 8, "MS Shell Dlg 2"
+CAPTION XVENDORNAMESHORT
+BEGIN
+ DEFPUSHBUTTON "Dismiss", IDOK, 66, 80, 50, 14
+ CTEXT XVENDORNAMESHORT, IDC_STATIC, 40, 12, 100, 8
+ CTEXT "Disruptive screen configuration change.", IDC_STATIC, 7, 40, 166, 8
+ CTEXT "Restore previous resolution to use "XVENDORNAMESHORT".", IDC_STATIC, 7, 52, 166, 8
+END
+
+
+/* Exit */
+
+EXIT_DIALOG DIALOGEX 32, 32, 180, 78
+STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE | WS_TABSTOP | DS_CENTERMOUSE
+FONT 8, "MS Shell Dlg 2"
+CAPTION "Exit "XVENDORNAMESHORT"?"
+BEGIN
+ PUSHBUTTON "E&xit", IDOK, 55, 56, 30, 14
+ DEFPUSHBUTTON "&Cancel", IDCANCEL, 95, 56, 30, 14
+ CTEXT "E&xiting will close all screens running on this display.", IDC_STATIC, 7, 12, 166, 8
+ CTEXT "No information about connected clients available.", IDC_CLIENTS_CONNECTED, 7, 24, 166, 8
+ CTEXT "Proceed with shutdown of this display/server?", IDC_STATIC, 7, 36, 166, 8
+END
+
+/* Xdmcp host selection dialog */
+XDMCP_HOSTS DIALOGEX 32, 32, 260, 156
+STYLE DS_SETFONT | DS_CENTERMOUSE | WS_POPUP | WS_VISIBLE | WS_CAPTION
+EXSTYLE WS_EX_NOPARENTNOTIFY
+CAPTION "Select host to connect to"
+FONT 8, "MS Shell Dlg 2", 0, 0, 0x1
+BEGIN
+ DEFPUSHBUTTON "Connect",IDOK,61,132,50,15
+ LISTBOX IDC_HOSTLIST,7,7,245,113,LBS_SORT | LBS_NOINTEGRALHEIGHT | LBS_NOTIFY | WS_VSCROLL | WS_TABSTOP
+ PUSHBUTTON "Cancel",IDCANCEL,147,134,50,14
+END
+
+/*
+ * Menus
+ */
+
+IDM_TRAYICON_MENU MENU
+BEGIN
+ POPUP "TRAYICON_MENU"
+ BEGIN
+ MENUITEM "&Hide Root Window", ID_APP_HIDE_ROOT
+ MENUITEM "&About...", ID_APP_ABOUT
+ MENUITEM SEPARATOR
+ MENUITEM "E&xit...", ID_APP_EXIT
+ END
+END
+
+
+/*
+ * Icons
+ */
+
+IDI_XWIN ICON "X.ico"
+/* CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "XWin.exe.manifest"*/
diff --git a/xorg-server/hw/xwin/ddraw.h b/xorg-server/hw/xwin/ddraw.h deleted file mode 100644 index 2eb7c2674..000000000 --- a/xorg-server/hw/xwin/ddraw.h +++ /dev/null @@ -1,2106 +0,0 @@ -#ifndef __XWIN_DDRAW_H -#define __XWIN_DDRAW_H - -#include <winnt.h> -#include <wingdi.h> -#include <objbase.h> - -#if defined(NONAMELESSUNION) && !defined(DUMMYUNIONNAME1) -#define DUMMYUNIONNAME1 u1 -#endif - -#define ICOM_CALL_( xfn, p, args) (p)->lpVtbl->xfn args - -# ifdef UNICODE -# define WINELIB_NAME_AW(func) func##W -# else -# define WINELIB_NAME_AW(func) func##A -# endif /* UNICODE */ -#define DECL_WINELIB_TYPE_AW(type) typedef WINELIB_NAME_AW(type) type; - -#ifdef __cplusplus -extern "C" { -#endif /* defined(__cplusplus) */ - -#ifndef DIRECTDRAW_VERSION -#define DIRECTDRAW_VERSION 0x0700 -#endif /* DIRECTDRAW_VERSION */ - -/***************************************************************************** - * Predeclare the interfaces - */ -DEFINE_GUID( CLSID_DirectDraw, 0xD7B70EE0,0x4340,0x11CF,0xB0,0x63,0x00,0x20,0xAF,0xC2,0xCD,0x35 ); -DEFINE_GUID( CLSID_DirectDraw7, 0x3C305196,0x50DB,0x11D3,0x9C,0xFE,0x00,0xC0,0x4F,0xD9,0x30,0xC5 ); -DEFINE_GUID( CLSID_DirectDrawClipper, 0x593817A0,0x7DB3,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xb9,0x33,0x56 ); -DEFINE_GUID( IID_IDirectDraw, 0x6C14DB80,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 ); -DEFINE_GUID( IID_IDirectDraw2, 0xB3A6F3E0,0x2B43,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xB9,0x33,0x56 ); -DEFINE_GUID( IID_IDirectDraw4, 0x9c59509a,0x39bd,0x11d1,0x8c,0x4a,0x00,0xc0,0x4f,0xd9,0x30,0xc5 ); -DEFINE_GUID( IID_IDirectDraw7, 0x15e65ec0,0x3b9c,0x11d2,0xb9,0x2f,0x00,0x60,0x97,0x97,0xea,0x5b ); -DEFINE_GUID( IID_IDirectDrawSurface, 0x6C14DB81,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 ); -DEFINE_GUID( IID_IDirectDrawSurface2, 0x57805885,0x6eec,0x11cf,0x94,0x41,0xa8,0x23,0x03,0xc1,0x0e,0x27 ); -DEFINE_GUID( IID_IDirectDrawSurface3, 0xDA044E00,0x69B2,0x11D0,0xA1,0xD5,0x00,0xAA,0x00,0xB8,0xDF,0xBB ); -DEFINE_GUID( IID_IDirectDrawSurface4, 0x0B2B8630,0xAD35,0x11D0,0x8E,0xA6,0x00,0x60,0x97,0x97,0xEA,0x5B ); -DEFINE_GUID( IID_IDirectDrawSurface7, 0x06675a80,0x3b9b,0x11d2,0xb9,0x2f,0x00,0x60,0x97,0x97,0xea,0x5b ); -DEFINE_GUID( IID_IDirectDrawPalette, 0x6C14DB84,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 ); -DEFINE_GUID( IID_IDirectDrawClipper, 0x6C14DB85,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 ); -DEFINE_GUID( IID_IDirectDrawColorControl,0x4B9F0EE0,0x0D7E,0x11D0,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8 ); -DEFINE_GUID( IID_IDirectDrawGammaControl,0x69C11C3E,0xB46B,0x11D1,0xAD,0x7A,0x00,0xC0,0x4F,0xC2,0x9B,0x4E ); - -typedef struct IDirectDraw *LPDIRECTDRAW; -typedef struct IDirectDraw2 *LPDIRECTDRAW2; -typedef struct IDirectDraw4 *LPDIRECTDRAW4; -typedef struct IDirectDraw7 *LPDIRECTDRAW7; -typedef struct IDirectDrawClipper *LPDIRECTDRAWCLIPPER; -typedef struct IDirectDrawPalette *LPDIRECTDRAWPALETTE; -typedef struct IDirectDrawSurface *LPDIRECTDRAWSURFACE; -typedef struct IDirectDrawSurface2 *LPDIRECTDRAWSURFACE2; -typedef struct IDirectDrawSurface3 *LPDIRECTDRAWSURFACE3; -typedef struct IDirectDrawSurface4 *LPDIRECTDRAWSURFACE4; -typedef struct IDirectDrawSurface7 *LPDIRECTDRAWSURFACE7; -typedef struct IDirectDrawColorControl *LPDIRECTDRAWCOLORCONTROL; -typedef struct IDirectDrawGammaControl *LPDIRECTDRAWGAMMACONTROL; - - -#define DDENUMRET_CANCEL 0 -#define DDENUMRET_OK 1 - -#define DD_OK 0 - - -#define _FACDD 0x876 -#define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code ) - -#define DDERR_ALREADYINITIALIZED MAKE_DDHRESULT( 5 ) -#define DDERR_CANNOTATTACHSURFACE MAKE_DDHRESULT( 10 ) -#define DDERR_CANNOTDETACHSURFACE MAKE_DDHRESULT( 20 ) -#define DDERR_CURRENTLYNOTAVAIL MAKE_DDHRESULT( 40 ) -#define DDERR_EXCEPTION MAKE_DDHRESULT( 55 ) -#define DDERR_GENERIC E_FAIL -#define DDERR_HEIGHTALIGN MAKE_DDHRESULT( 90 ) -#define DDERR_INCOMPATIBLEPRIMARY MAKE_DDHRESULT( 95 ) -#define DDERR_INVALIDCAPS MAKE_DDHRESULT( 100 ) -#define DDERR_INVALIDCLIPLIST MAKE_DDHRESULT( 110 ) -#define DDERR_INVALIDMODE MAKE_DDHRESULT( 120 ) -#define DDERR_INVALIDOBJECT MAKE_DDHRESULT( 130 ) -#define DDERR_INVALIDPARAMS E_INVALIDARG -#define DDERR_INVALIDPIXELFORMAT MAKE_DDHRESULT( 145 ) -#define DDERR_INVALIDRECT MAKE_DDHRESULT( 150 ) -#define DDERR_LOCKEDSURFACES MAKE_DDHRESULT( 160 ) -#define DDERR_NO3D MAKE_DDHRESULT( 170 ) -#define DDERR_NOALPHAHW MAKE_DDHRESULT( 180 ) -#define DDERR_NOSTEREOHARDWARE MAKE_DDHRESULT( 181 ) -#define DDERR_NOSURFACELEFT MAKE_DDHRESULT( 182 ) -#define DDERR_NOCLIPLIST MAKE_DDHRESULT( 205 ) -#define DDERR_NOCOLORCONVHW MAKE_DDHRESULT( 210 ) -#define DDERR_NOCOOPERATIVELEVELSET MAKE_DDHRESULT( 212 ) -#define DDERR_NOCOLORKEY MAKE_DDHRESULT( 215 ) -#define DDERR_NOCOLORKEYHW MAKE_DDHRESULT( 220 ) -#define DDERR_NODIRECTDRAWSUPPORT MAKE_DDHRESULT( 222 ) -#define DDERR_NOEXCLUSIVEMODE MAKE_DDHRESULT( 225 ) -#define DDERR_NOFLIPHW MAKE_DDHRESULT( 230 ) -#define DDERR_NOGDI MAKE_DDHRESULT( 240 ) -#define DDERR_NOMIRRORHW MAKE_DDHRESULT( 250 ) -#define DDERR_NOTFOUND MAKE_DDHRESULT( 255 ) -#define DDERR_NOOVERLAYHW MAKE_DDHRESULT( 260 ) -#define DDERR_OVERLAPPINGRECTS MAKE_DDHRESULT( 270 ) -#define DDERR_NORASTEROPHW MAKE_DDHRESULT( 280 ) -#define DDERR_NOROTATIONHW MAKE_DDHRESULT( 290 ) -#define DDERR_NOSTRETCHHW MAKE_DDHRESULT( 310 ) -#define DDERR_NOT4BITCOLOR MAKE_DDHRESULT( 316 ) -#define DDERR_NOT4BITCOLORINDEX MAKE_DDHRESULT( 317 ) -#define DDERR_NOT8BITCOLOR MAKE_DDHRESULT( 320 ) -#define DDERR_NOTEXTUREHW MAKE_DDHRESULT( 330 ) -#define DDERR_NOVSYNCHW MAKE_DDHRESULT( 335 ) -#define DDERR_NOZBUFFERHW MAKE_DDHRESULT( 340 ) -#define DDERR_NOZOVERLAYHW MAKE_DDHRESULT( 350 ) -#define DDERR_OUTOFCAPS MAKE_DDHRESULT( 360 ) -#define DDERR_OUTOFMEMORY E_OUTOFMEMORY -#define DDERR_OUTOFVIDEOMEMORY MAKE_DDHRESULT( 380 ) -#define DDERR_OVERLAYCANTCLIP MAKE_DDHRESULT( 382 ) -#define DDERR_OVERLAYCOLORKEYONLYONEACTIVE MAKE_DDHRESULT( 384 ) -#define DDERR_PALETTEBUSY MAKE_DDHRESULT( 387 ) -#define DDERR_COLORKEYNOTSET MAKE_DDHRESULT( 400 ) -#define DDERR_SURFACEALREADYATTACHED MAKE_DDHRESULT( 410 ) -#define DDERR_SURFACEALREADYDEPENDENT MAKE_DDHRESULT( 420 ) -#define DDERR_SURFACEBUSY MAKE_DDHRESULT( 430 ) -#define DDERR_CANTLOCKSURFACE MAKE_DDHRESULT( 435 ) -#define DDERR_SURFACEISOBSCURED MAKE_DDHRESULT( 440 ) -#define DDERR_SURFACELOST MAKE_DDHRESULT( 450 ) -#define DDERR_SURFACENOTATTACHED MAKE_DDHRESULT( 460 ) -#define DDERR_TOOBIGHEIGHT MAKE_DDHRESULT( 470 ) -#define DDERR_TOOBIGSIZE MAKE_DDHRESULT( 480 ) -#define DDERR_TOOBIGWIDTH MAKE_DDHRESULT( 490 ) -#define DDERR_UNSUPPORTED E_NOTIMPL -#define DDERR_UNSUPPORTEDFORMAT MAKE_DDHRESULT( 510 ) -#define DDERR_UNSUPPORTEDMASK MAKE_DDHRESULT( 520 ) -#define DDERR_INVALIDSTREAM MAKE_DDHRESULT( 521 ) -#define DDERR_VERTICALBLANKINPROGRESS MAKE_DDHRESULT( 537 ) -#define DDERR_WASSTILLDRAWING MAKE_DDHRESULT( 540 ) -#define DDERR_DDSCAPSCOMPLEXREQUIRED MAKE_DDHRESULT( 542 ) -#define DDERR_XALIGN MAKE_DDHRESULT( 560 ) -#define DDERR_INVALIDDIRECTDRAWGUID MAKE_DDHRESULT( 561 ) -#define DDERR_DIRECTDRAWALREADYCREATED MAKE_DDHRESULT( 562 ) -#define DDERR_NODIRECTDRAWHW MAKE_DDHRESULT( 563 ) -#define DDERR_PRIMARYSURFACEALREADYEXISTS MAKE_DDHRESULT( 564 ) -#define DDERR_NOEMULATION MAKE_DDHRESULT( 565 ) -#define DDERR_REGIONTOOSMALL MAKE_DDHRESULT( 566 ) -#define DDERR_CLIPPERISUSINGHWND MAKE_DDHRESULT( 567 ) -#define DDERR_NOCLIPPERATTACHED MAKE_DDHRESULT( 568 ) -#define DDERR_NOHWND MAKE_DDHRESULT( 569 ) -#define DDERR_HWNDSUBCLASSED MAKE_DDHRESULT( 570 ) -#define DDERR_HWNDALREADYSET MAKE_DDHRESULT( 571 ) -#define DDERR_NOPALETTEATTACHED MAKE_DDHRESULT( 572 ) -#define DDERR_NOPALETTEHW MAKE_DDHRESULT( 573 ) -#define DDERR_BLTFASTCANTCLIP MAKE_DDHRESULT( 574 ) -#define DDERR_NOBLTHW MAKE_DDHRESULT( 575 ) -#define DDERR_NODDROPSHW MAKE_DDHRESULT( 576 ) -#define DDERR_OVERLAYNOTVISIBLE MAKE_DDHRESULT( 577 ) -#define DDERR_NOOVERLAYDEST MAKE_DDHRESULT( 578 ) -#define DDERR_INVALIDPOSITION MAKE_DDHRESULT( 579 ) -#define DDERR_NOTAOVERLAYSURFACE MAKE_DDHRESULT( 580 ) -#define DDERR_EXCLUSIVEMODEALREADYSET MAKE_DDHRESULT( 581 ) -#define DDERR_NOTFLIPPABLE MAKE_DDHRESULT( 582 ) -#define DDERR_CANTDUPLICATE MAKE_DDHRESULT( 583 ) -#define DDERR_NOTLOCKED MAKE_DDHRESULT( 584 ) -#define DDERR_CANTCREATEDC MAKE_DDHRESULT( 585 ) -#define DDERR_NODC MAKE_DDHRESULT( 586 ) -#define DDERR_WRONGMODE MAKE_DDHRESULT( 587 ) -#define DDERR_IMPLICITLYCREATED MAKE_DDHRESULT( 588 ) -#define DDERR_NOTPALETTIZED MAKE_DDHRESULT( 589 ) -#define DDERR_UNSUPPORTEDMODE MAKE_DDHRESULT( 590 ) -#define DDERR_NOMIPMAPHW MAKE_DDHRESULT( 591 ) -#define DDERR_INVALIDSURFACETYPE MAKE_DDHRESULT( 592 ) -#define DDERR_NOOPTIMIZEHW MAKE_DDHRESULT( 600 ) -#define DDERR_NOTLOADED MAKE_DDHRESULT( 601 ) -#define DDERR_NOFOCUSWINDOW MAKE_DDHRESULT( 602 ) -#define DDERR_NOTONMIPMAPSUBLEVEL MAKE_DDHRESULT( 603 ) -#define DDERR_DCALREADYCREATED MAKE_DDHRESULT( 620 ) -#define DDERR_NONONLOCALVIDMEM MAKE_DDHRESULT( 630 ) -#define DDERR_CANTPAGELOCK MAKE_DDHRESULT( 640 ) -#define DDERR_CANTPAGEUNLOCK MAKE_DDHRESULT( 660 ) -#define DDERR_NOTPAGELOCKED MAKE_DDHRESULT( 680 ) -#define DDERR_MOREDATA MAKE_DDHRESULT( 690 ) -#define DDERR_EXPIRED MAKE_DDHRESULT( 691 ) -#define DDERR_TESTFINISHED MAKE_DDHRESULT( 692 ) -#define DDERR_NEWMODE MAKE_DDHRESULT( 693 ) -#define DDERR_D3DNOTINITIALIZED MAKE_DDHRESULT( 694 ) -#define DDERR_VIDEONOTACTIVE MAKE_DDHRESULT( 695 ) -#define DDERR_NOMONITORINFORMATION MAKE_DDHRESULT( 696 ) -#define DDERR_NODRIVERSUPPORT MAKE_DDHRESULT( 697 ) -#define DDERR_DEVICEDOESNTOWNSURFACE MAKE_DDHRESULT( 699 ) -#define DDERR_NOTINITIALIZED CO_E_NOTINITIALIZED - -/* dwFlags for Blt* */ -#define DDBLT_ALPHADEST 0x00000001 -#define DDBLT_ALPHADESTCONSTOVERRIDE 0x00000002 -#define DDBLT_ALPHADESTNEG 0x00000004 -#define DDBLT_ALPHADESTSURFACEOVERRIDE 0x00000008 -#define DDBLT_ALPHAEDGEBLEND 0x00000010 -#define DDBLT_ALPHASRC 0x00000020 -#define DDBLT_ALPHASRCCONSTOVERRIDE 0x00000040 -#define DDBLT_ALPHASRCNEG 0x00000080 -#define DDBLT_ALPHASRCSURFACEOVERRIDE 0x00000100 -#define DDBLT_ASYNC 0x00000200 -#define DDBLT_COLORFILL 0x00000400 -#define DDBLT_DDFX 0x00000800 -#define DDBLT_DDROPS 0x00001000 -#define DDBLT_KEYDEST 0x00002000 -#define DDBLT_KEYDESTOVERRIDE 0x00004000 -#define DDBLT_KEYSRC 0x00008000 -#define DDBLT_KEYSRCOVERRIDE 0x00010000 -#define DDBLT_ROP 0x00020000 -#define DDBLT_ROTATIONANGLE 0x00040000 -#define DDBLT_ZBUFFER 0x00080000 -#define DDBLT_ZBUFFERDESTCONSTOVERRIDE 0x00100000 -#define DDBLT_ZBUFFERDESTOVERRIDE 0x00200000 -#define DDBLT_ZBUFFERSRCCONSTOVERRIDE 0x00400000 -#define DDBLT_ZBUFFERSRCOVERRIDE 0x00800000 -#define DDBLT_WAIT 0x01000000 -#define DDBLT_DEPTHFILL 0x02000000 -#define DDBLT_DONOTWAIT 0x08000000 - -/* dwTrans for BltFast */ -#define DDBLTFAST_NOCOLORKEY 0x00000000 -#define DDBLTFAST_SRCCOLORKEY 0x00000001 -#define DDBLTFAST_DESTCOLORKEY 0x00000002 -#define DDBLTFAST_WAIT 0x00000010 -#define DDBLTFAST_DONOTWAIT 0x00000020 - -/* dwFlags for Flip */ -#define DDFLIP_WAIT 0x00000001 -#define DDFLIP_EVEN 0x00000002 /* only valid for overlay */ -#define DDFLIP_ODD 0x00000004 /* only valid for overlay */ -#define DDFLIP_NOVSYNC 0x00000008 -#define DDFLIP_STEREO 0x00000010 -#define DDFLIP_DONOTWAIT 0x00000020 - -/* dwFlags for GetBltStatus */ -#define DDGBS_CANBLT 0x00000001 -#define DDGBS_ISBLTDONE 0x00000002 - -/* dwFlags for IDirectDrawSurface7::GetFlipStatus */ -#define DDGFS_CANFLIP 1L -#define DDGFS_ISFLIPDONE 2L - -/* dwFlags for IDirectDrawSurface7::SetPrivateData */ -#define DDSPD_IUNKNOWNPTR 1L -#define DDSPD_VOLATILE 2L - -/* DDSCAPS.dwCaps */ -/* reserved1, was 3d capable */ -#define DDSCAPS_RESERVED1 0x00000001 -/* surface contains alpha information */ -#define DDSCAPS_ALPHA 0x00000002 -/* this surface is a backbuffer */ -#define DDSCAPS_BACKBUFFER 0x00000004 -/* complex surface structure */ -#define DDSCAPS_COMPLEX 0x00000008 -/* part of surface flipping structure */ -#define DDSCAPS_FLIP 0x00000010 -/* this surface is the frontbuffer surface */ -#define DDSCAPS_FRONTBUFFER 0x00000020 -/* this is a plain offscreen surface */ -#define DDSCAPS_OFFSCREENPLAIN 0x00000040 -/* overlay */ -#define DDSCAPS_OVERLAY 0x00000080 -/* palette objects can be created and attached to us */ -#define DDSCAPS_PALETTE 0x00000100 -/* primary surface (the one the user looks at currently)(right eye)*/ -#define DDSCAPS_PRIMARYSURFACE 0x00000200 -/* primary surface for left eye */ -#define DDSCAPS_PRIMARYSURFACELEFT 0x00000400 -/* surface exists in systemmemory */ -#define DDSCAPS_SYSTEMMEMORY 0x00000800 -/* surface can be used as a texture */ -#define DDSCAPS_TEXTURE 0x00001000 -/* surface may be destination for 3d rendering */ -#define DDSCAPS_3DDEVICE 0x00002000 -/* surface exists in videomemory */ -#define DDSCAPS_VIDEOMEMORY 0x00004000 -/* surface changes immediately visible */ -#define DDSCAPS_VISIBLE 0x00008000 -/* write only surface */ -#define DDSCAPS_WRITEONLY 0x00010000 -/* zbuffer surface */ -#define DDSCAPS_ZBUFFER 0x00020000 -/* has its own DC */ -#define DDSCAPS_OWNDC 0x00040000 -/* surface should be able to receive live video */ -#define DDSCAPS_LIVEVIDEO 0x00080000 -/* should be able to have a hw codec decompress stuff into it */ -#define DDSCAPS_HWCODEC 0x00100000 -/* mode X (320x200 or 320x240) surface */ -#define DDSCAPS_MODEX 0x00200000 -/* one mipmap surface (1 level) */ -#define DDSCAPS_MIPMAP 0x00400000 -#define DDSCAPS_RESERVED2 0x00800000 -/* memory allocation delayed until Load() */ -#define DDSCAPS_ALLOCONLOAD 0x04000000 -/* Indicates that the surface will receive data from a video port */ -#define DDSCAPS_VIDEOPORT 0x08000000 -/* surface is in local videomemory */ -#define DDSCAPS_LOCALVIDMEM 0x10000000 -/* surface is in nonlocal videomemory */ -#define DDSCAPS_NONLOCALVIDMEM 0x20000000 -/* surface is a standard VGA mode surface (NOT ModeX) */ -#define DDSCAPS_STANDARDVGAMODE 0x40000000 -/* optimized? surface */ -#define DDSCAPS_OPTIMIZED 0x80000000 - -typedef struct _DDSCAPS { - DWORD dwCaps; /* capabilities of surface wanted */ -} DDSCAPS,*LPDDSCAPS; - -/* DDSCAPS2.dwCaps2 */ -/* indicates the surface will receive data from a video port using - deinterlacing hardware. */ -#define DDSCAPS2_HARDWAREDEINTERLACE 0x00000002 -/* indicates the surface will be locked very frequently. */ -#define DDSCAPS2_HINTDYNAMIC 0x00000004 -/* indicates surface can be re-ordered or retiled on load() */ -#define DDSCAPS2_HINTSTATIC 0x00000008 -/* indicates surface to be managed by directdraw/direct3D */ -#define DDSCAPS2_TEXTUREMANAGE 0x00000010 -/* reserved bits */ -#define DDSCAPS2_RESERVED1 0x00000020 -#define DDSCAPS2_RESERVED2 0x00000040 -/* indicates surface will never be locked again */ -#define DDSCAPS2_OPAQUE 0x00000080 -/* set at CreateSurface() time to indicate antialising will be used */ -#define DDSCAPS2_HINTANTIALIASING 0x00000100 -/* set at CreateSurface() time to indicate cubic environment map */ -#define DDSCAPS2_CUBEMAP 0x00000200 -/* face flags for cube maps */ -#define DDSCAPS2_CUBEMAP_POSITIVEX 0x00000400 -#define DDSCAPS2_CUBEMAP_NEGATIVEX 0x00000800 -#define DDSCAPS2_CUBEMAP_POSITIVEY 0x00001000 -#define DDSCAPS2_CUBEMAP_NEGATIVEY 0x00002000 -#define DDSCAPS2_CUBEMAP_POSITIVEZ 0x00004000 -#define DDSCAPS2_CUBEMAP_NEGATIVEZ 0x00008000 -/* specifies all faces of a cube for CreateSurface() */ -#define DDSCAPS2_CUBEMAP_ALLFACES ( DDSCAPS2_CUBEMAP_POSITIVEX |\ - DDSCAPS2_CUBEMAP_NEGATIVEX |\ - DDSCAPS2_CUBEMAP_POSITIVEY |\ - DDSCAPS2_CUBEMAP_NEGATIVEY |\ - DDSCAPS2_CUBEMAP_POSITIVEZ |\ - DDSCAPS2_CUBEMAP_NEGATIVEZ ) -/* set for mipmap sublevels on DirectX7 and later. ignored by CreateSurface() */ -#define DDSCAPS2_MIPMAPSUBLEVEL 0x00010000 -/* indicates texture surface to be managed by Direct3D *only* */ -#define DDSCAPS2_D3DTEXTUREMANAGE 0x00020000 -/* indicates managed surface that can safely be lost */ -#define DDSCAPS2_DONOTPERSIST 0x00040000 -/* indicates surface is part of a stereo flipping chain */ -#define DDSCAPS2_STEREOSURFACELEFT 0x00080000 - -typedef struct _DDSCAPS2 { - DWORD dwCaps; /* capabilities of surface wanted */ - DWORD dwCaps2; /* additional capabilities */ - DWORD dwCaps3; /* reserved capabilities */ - DWORD dwCaps4; /* more reserved capabilities */ -} DDSCAPS2,*LPDDSCAPS2; - -#define DD_ROP_SPACE (256/32) /* space required to store ROP array */ - -typedef struct _DDCAPS_DX7 /* DirectX 7 version of caps struct */ -{ - DWORD dwSize; /* size of the DDDRIVERCAPS structure */ - DWORD dwCaps; /* driver specific capabilities */ - DWORD dwCaps2; /* more driver specific capabilites */ - DWORD dwCKeyCaps; /* color key capabilities of the surface */ - DWORD dwFXCaps; /* driver specific stretching and effects capabilites */ - DWORD dwFXAlphaCaps; /* alpha driver specific capabilities */ - DWORD dwPalCaps; /* palette capabilities */ - DWORD dwSVCaps; /* stereo vision capabilities */ - DWORD dwAlphaBltConstBitDepths; /* DDBD_2,4,8 */ - DWORD dwAlphaBltPixelBitDepths; /* DDBD_1,2,4,8 */ - DWORD dwAlphaBltSurfaceBitDepths; /* DDBD_1,2,4,8 */ - DWORD dwAlphaOverlayConstBitDepths; /* DDBD_2,4,8 */ - DWORD dwAlphaOverlayPixelBitDepths; /* DDBD_1,2,4,8 */ - DWORD dwAlphaOverlaySurfaceBitDepths; /* DDBD_1,2,4,8 */ - DWORD dwZBufferBitDepths; /* DDBD_8,16,24,32 */ - DWORD dwVidMemTotal; /* total amount of video memory */ - DWORD dwVidMemFree; /* amount of free video memory */ - DWORD dwMaxVisibleOverlays; /* maximum number of visible overlays */ - DWORD dwCurrVisibleOverlays; /* current number of visible overlays */ - DWORD dwNumFourCCCodes; /* number of four cc codes */ - DWORD dwAlignBoundarySrc; /* source rectangle alignment */ - DWORD dwAlignSizeSrc; /* source rectangle byte size */ - DWORD dwAlignBoundaryDest; /* dest rectangle alignment */ - DWORD dwAlignSizeDest; /* dest rectangle byte size */ - DWORD dwAlignStrideAlign; /* stride alignment */ - DWORD dwRops[DD_ROP_SPACE]; /* ROPS supported */ - DDSCAPS ddsOldCaps; /* old DDSCAPS - superceded for DirectX6+ */ - DWORD dwMinOverlayStretch; /* minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */ - DWORD dwMaxOverlayStretch; /* maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */ - DWORD dwMinLiveVideoStretch; /* minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */ - DWORD dwMaxLiveVideoStretch; /* maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */ - DWORD dwMinHwCodecStretch; /* minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */ - DWORD dwMaxHwCodecStretch; /* maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */ - DWORD dwReserved1; - DWORD dwReserved2; - DWORD dwReserved3; - DWORD dwSVBCaps; /* driver specific capabilities for System->Vmem blts */ - DWORD dwSVBCKeyCaps; /* driver color key capabilities for System->Vmem blts */ - DWORD dwSVBFXCaps; /* driver FX capabilities for System->Vmem blts */ - DWORD dwSVBRops[DD_ROP_SPACE];/* ROPS supported for System->Vmem blts */ - DWORD dwVSBCaps; /* driver specific capabilities for Vmem->System blts */ - DWORD dwVSBCKeyCaps; /* driver color key capabilities for Vmem->System blts */ - DWORD dwVSBFXCaps; /* driver FX capabilities for Vmem->System blts */ - DWORD dwVSBRops[DD_ROP_SPACE];/* ROPS supported for Vmem->System blts */ - DWORD dwSSBCaps; /* driver specific capabilities for System->System blts */ - DWORD dwSSBCKeyCaps; /* driver color key capabilities for System->System blts */ - DWORD dwSSBFXCaps; /* driver FX capabilities for System->System blts */ - DWORD dwSSBRops[DD_ROP_SPACE];/* ROPS supported for System->System blts */ - DWORD dwMaxVideoPorts; /* maximum number of usable video ports */ - DWORD dwCurrVideoPorts; /* current number of video ports used */ - DWORD dwSVBCaps2; /* more driver specific capabilities for System->Vmem blts */ - DWORD dwNLVBCaps; /* driver specific capabilities for non-local->local vidmem blts */ - DWORD dwNLVBCaps2; /* more driver specific capabilities non-local->local vidmem blts */ - DWORD dwNLVBCKeyCaps; /* driver color key capabilities for non-local->local vidmem blts */ - DWORD dwNLVBFXCaps; /* driver FX capabilities for non-local->local blts */ - DWORD dwNLVBRops[DD_ROP_SPACE]; /* ROPS supported for non-local->local blts */ - DDSCAPS2 ddsCaps; /* surface capabilities */ -} DDCAPS_DX7,*LPDDCAPS_DX7; - -typedef struct _DDCAPS_DX6 /* DirectX 6 version of caps struct */ -{ - DWORD dwSize; /* size of the DDDRIVERCAPS structure */ - DWORD dwCaps; /* driver specific capabilities */ - DWORD dwCaps2; /* more driver specific capabilites */ - DWORD dwCKeyCaps; /* color key capabilities of the surface */ - DWORD dwFXCaps; /* driver specific stretching and effects capabilites */ - DWORD dwFXAlphaCaps; /* alpha driver specific capabilities */ - DWORD dwPalCaps; /* palette capabilities */ - DWORD dwSVCaps; /* stereo vision capabilities */ - DWORD dwAlphaBltConstBitDepths; /* DDBD_2,4,8 */ - DWORD dwAlphaBltPixelBitDepths; /* DDBD_1,2,4,8 */ - DWORD dwAlphaBltSurfaceBitDepths; /* DDBD_1,2,4,8 */ - DWORD dwAlphaOverlayConstBitDepths; /* DDBD_2,4,8 */ - DWORD dwAlphaOverlayPixelBitDepths; /* DDBD_1,2,4,8 */ - DWORD dwAlphaOverlaySurfaceBitDepths; /* DDBD_1,2,4,8 */ - DWORD dwZBufferBitDepths; /* DDBD_8,16,24,32 */ - DWORD dwVidMemTotal; /* total amount of video memory */ - DWORD dwVidMemFree; /* amount of free video memory */ - DWORD dwMaxVisibleOverlays; /* maximum number of visible overlays */ - DWORD dwCurrVisibleOverlays; /* current number of visible overlays */ - DWORD dwNumFourCCCodes; /* number of four cc codes */ - DWORD dwAlignBoundarySrc; /* source rectangle alignment */ - DWORD dwAlignSizeSrc; /* source rectangle byte size */ - DWORD dwAlignBoundaryDest; /* dest rectangle alignment */ - DWORD dwAlignSizeDest; /* dest rectangle byte size */ - DWORD dwAlignStrideAlign; /* stride alignment */ - DWORD dwRops[DD_ROP_SPACE]; /* ROPS supported */ - DDSCAPS ddsOldCaps; /* old DDSCAPS - superceded for DirectX6+ */ - DWORD dwMinOverlayStretch; /* minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */ - DWORD dwMaxOverlayStretch; /* maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */ - DWORD dwMinLiveVideoStretch; /* minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */ - DWORD dwMaxLiveVideoStretch; /* maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */ - DWORD dwMinHwCodecStretch; /* minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */ - DWORD dwMaxHwCodecStretch; /* maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */ - DWORD dwReserved1; - DWORD dwReserved2; - DWORD dwReserved3; - DWORD dwSVBCaps; /* driver specific capabilities for System->Vmem blts */ - DWORD dwSVBCKeyCaps; /* driver color key capabilities for System->Vmem blts */ - DWORD dwSVBFXCaps; /* driver FX capabilities for System->Vmem blts */ - DWORD dwSVBRops[DD_ROP_SPACE];/* ROPS supported for System->Vmem blts */ - DWORD dwVSBCaps; /* driver specific capabilities for Vmem->System blts */ - DWORD dwVSBCKeyCaps; /* driver color key capabilities for Vmem->System blts */ - DWORD dwVSBFXCaps; /* driver FX capabilities for Vmem->System blts */ - DWORD dwVSBRops[DD_ROP_SPACE];/* ROPS supported for Vmem->System blts */ - DWORD dwSSBCaps; /* driver specific capabilities for System->System blts */ - DWORD dwSSBCKeyCaps; /* driver color key capabilities for System->System blts */ - DWORD dwSSBFXCaps; /* driver FX capabilities for System->System blts */ - DWORD dwSSBRops[DD_ROP_SPACE];/* ROPS supported for System->System blts */ - DWORD dwMaxVideoPorts; /* maximum number of usable video ports */ - DWORD dwCurrVideoPorts; /* current number of video ports used */ - DWORD dwSVBCaps2; /* more driver specific capabilities for System->Vmem blts */ - DWORD dwNLVBCaps; /* driver specific capabilities for non-local->local vidmem blts */ - DWORD dwNLVBCaps2; /* more driver specific capabilities non-local->local vidmem blts */ - DWORD dwNLVBCKeyCaps; /* driver color key capabilities for non-local->local vidmem blts */ - DWORD dwNLVBFXCaps; /* driver FX capabilities for non-local->local blts */ - DWORD dwNLVBRops[DD_ROP_SPACE]; /* ROPS supported for non-local->local blts */ - /* and one new member for DirectX 6 */ - DDSCAPS2 ddsCaps; /* surface capabilities */ -} DDCAPS_DX6,*LPDDCAPS_DX6; - -typedef struct _DDCAPS_DX5 /* DirectX5 version of caps struct */ -{ - DWORD dwSize; /* size of the DDDRIVERCAPS structure */ - DWORD dwCaps; /* driver specific capabilities */ - DWORD dwCaps2; /* more driver specific capabilites */ - DWORD dwCKeyCaps; /* color key capabilities of the surface */ - DWORD dwFXCaps; /* driver specific stretching and effects capabilites */ - DWORD dwFXAlphaCaps; /* alpha driver specific capabilities */ - DWORD dwPalCaps; /* palette capabilities */ - DWORD dwSVCaps; /* stereo vision capabilities */ - DWORD dwAlphaBltConstBitDepths; /* DDBD_2,4,8 */ - DWORD dwAlphaBltPixelBitDepths; /* DDBD_1,2,4,8 */ - DWORD dwAlphaBltSurfaceBitDepths; /* DDBD_1,2,4,8 */ - DWORD dwAlphaOverlayConstBitDepths; /* DDBD_2,4,8 */ - DWORD dwAlphaOverlayPixelBitDepths; /* DDBD_1,2,4,8 */ - DWORD dwAlphaOverlaySurfaceBitDepths; /* DDBD_1,2,4,8 */ - DWORD dwZBufferBitDepths; /* DDBD_8,16,24,32 */ - DWORD dwVidMemTotal; /* total amount of video memory */ - DWORD dwVidMemFree; /* amount of free video memory */ - DWORD dwMaxVisibleOverlays; /* maximum number of visible overlays */ - DWORD dwCurrVisibleOverlays; /* current number of visible overlays */ - DWORD dwNumFourCCCodes; /* number of four cc codes */ - DWORD dwAlignBoundarySrc; /* source rectangle alignment */ - DWORD dwAlignSizeSrc; /* source rectangle byte size */ - DWORD dwAlignBoundaryDest; /* dest rectangle alignment */ - DWORD dwAlignSizeDest; /* dest rectangle byte size */ - DWORD dwAlignStrideAlign; /* stride alignment */ - DWORD dwRops[DD_ROP_SPACE]; /* ROPS supported */ - DDSCAPS ddsCaps; /* DDSCAPS structure has all the general capabilities */ - DWORD dwMinOverlayStretch; /* minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */ - DWORD dwMaxOverlayStretch; /* maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */ - DWORD dwMinLiveVideoStretch; /* minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */ - DWORD dwMaxLiveVideoStretch; /* maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */ - DWORD dwMinHwCodecStretch; /* minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */ - DWORD dwMaxHwCodecStretch; /* maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */ - DWORD dwReserved1; - DWORD dwReserved2; - DWORD dwReserved3; - DWORD dwSVBCaps; /* driver specific capabilities for System->Vmem blts */ - DWORD dwSVBCKeyCaps; /* driver color key capabilities for System->Vmem blts */ - DWORD dwSVBFXCaps; /* driver FX capabilities for System->Vmem blts */ - DWORD dwSVBRops[DD_ROP_SPACE];/* ROPS supported for System->Vmem blts */ - DWORD dwVSBCaps; /* driver specific capabilities for Vmem->System blts */ - DWORD dwVSBCKeyCaps; /* driver color key capabilities for Vmem->System blts */ - DWORD dwVSBFXCaps; /* driver FX capabilities for Vmem->System blts */ - DWORD dwVSBRops[DD_ROP_SPACE];/* ROPS supported for Vmem->System blts */ - DWORD dwSSBCaps; /* driver specific capabilities for System->System blts */ - DWORD dwSSBCKeyCaps; /* driver color key capabilities for System->System blts */ - DWORD dwSSBFXCaps; /* driver FX capabilities for System->System blts */ - DWORD dwSSBRops[DD_ROP_SPACE];/* ROPS supported for System->System blts */ - /* the following are the new DirectX 5 members */ - DWORD dwMaxVideoPorts; /* maximum number of usable video ports */ - DWORD dwCurrVideoPorts; /* current number of video ports used */ - DWORD dwSVBCaps2; /* more driver specific capabilities for System->Vmem blts */ - DWORD dwNLVBCaps; /* driver specific capabilities for non-local->local vidmem blts */ - DWORD dwNLVBCaps2; /* more driver specific capabilities non-local->local vidmem blts */ - DWORD dwNLVBCKeyCaps; /* driver color key capabilities for non-local->local vidmem blts */ - DWORD dwNLVBFXCaps; /* driver FX capabilities for non-local->local blts */ - DWORD dwNLVBRops[DD_ROP_SPACE]; /* ROPS supported for non-local->local blts */ -} DDCAPS_DX5,*LPDDCAPS_DX5; - -typedef struct _DDCAPS_DX3 /* DirectX3 version of caps struct */ -{ - DWORD dwSize; /* size of the DDDRIVERCAPS structure */ - DWORD dwCaps; /* driver specific capabilities */ - DWORD dwCaps2; /* more driver specific capabilites */ - DWORD dwCKeyCaps; /* color key capabilities of the surface */ - DWORD dwFXCaps; /* driver specific stretching and effects capabilites */ - DWORD dwFXAlphaCaps; /* alpha driver specific capabilities */ - DWORD dwPalCaps; /* palette capabilities */ - DWORD dwSVCaps; /* stereo vision capabilities */ - DWORD dwAlphaBltConstBitDepths; /* DDBD_2,4,8 */ - DWORD dwAlphaBltPixelBitDepths; /* DDBD_1,2,4,8 */ - DWORD dwAlphaBltSurfaceBitDepths; /* DDBD_1,2,4,8 */ - DWORD dwAlphaOverlayConstBitDepths; /* DDBD_2,4,8 */ - DWORD dwAlphaOverlayPixelBitDepths; /* DDBD_1,2,4,8 */ - DWORD dwAlphaOverlaySurfaceBitDepths; /* DDBD_1,2,4,8 */ - DWORD dwZBufferBitDepths; /* DDBD_8,16,24,32 */ - DWORD dwVidMemTotal; /* total amount of video memory */ - DWORD dwVidMemFree; /* amount of free video memory */ - DWORD dwMaxVisibleOverlays; /* maximum number of visible overlays */ - DWORD dwCurrVisibleOverlays; /* current number of visible overlays */ - DWORD dwNumFourCCCodes; /* number of four cc codes */ - DWORD dwAlignBoundarySrc; /* source rectangle alignment */ - DWORD dwAlignSizeSrc; /* source rectangle byte size */ - DWORD dwAlignBoundaryDest; /* dest rectangle alignment */ - DWORD dwAlignSizeDest; /* dest rectangle byte size */ - DWORD dwAlignStrideAlign; /* stride alignment */ - DWORD dwRops[DD_ROP_SPACE]; /* ROPS supported */ - DDSCAPS ddsCaps; /* DDSCAPS structure has all the general capabilities */ - DWORD dwMinOverlayStretch; /* minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */ - DWORD dwMaxOverlayStretch; /* maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */ - DWORD dwMinLiveVideoStretch; /* minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */ - DWORD dwMaxLiveVideoStretch; /* maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */ - DWORD dwMinHwCodecStretch; /* minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */ - DWORD dwMaxHwCodecStretch; /* maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */ - DWORD dwReserved1; - DWORD dwReserved2; - DWORD dwReserved3; - DWORD dwSVBCaps; /* driver specific capabilities for System->Vmem blts */ - DWORD dwSVBCKeyCaps; /* driver color key capabilities for System->Vmem blts */ - DWORD dwSVBFXCaps; /* driver FX capabilities for System->Vmem blts */ - DWORD dwSVBRops[DD_ROP_SPACE];/* ROPS supported for System->Vmem blts */ - DWORD dwVSBCaps; /* driver specific capabilities for Vmem->System blts */ - DWORD dwVSBCKeyCaps; /* driver color key capabilities for Vmem->System blts */ - DWORD dwVSBFXCaps; /* driver FX capabilities for Vmem->System blts */ - DWORD dwVSBRops[DD_ROP_SPACE];/* ROPS supported for Vmem->System blts */ - DWORD dwSSBCaps; /* driver specific capabilities for System->System blts */ - DWORD dwSSBCKeyCaps; /* driver color key capabilities for System->System blts */ - DWORD dwSSBFXCaps; /* driver FX capabilities for System->System blts */ - DWORD dwSSBRops[DD_ROP_SPACE];/* ROPS supported for System->System blts */ - DWORD dwReserved4; - DWORD dwReserved5; - DWORD dwReserved6; -} DDCAPS_DX3,*LPDDCAPS_DX3; - -/* set caps struct according to DIRECTDRAW_VERSION */ - -#if DIRECTDRAW_VERSION <= 0x300 -typedef DDCAPS_DX3 DDCAPS; -#elif DIRECTDRAW_VERSION <= 0x500 -typedef DDCAPS_DX5 DDCAPS; -#elif DIRECTDRAW_VERSION <= 0x600 -typedef DDCAPS_DX6 DDCAPS; -#else -typedef DDCAPS_DX7 DDCAPS; -#endif - -typedef DDCAPS *LPDDCAPS; - -/* DDCAPS.dwCaps */ -#define DDCAPS_3D 0x00000001 -#define DDCAPS_ALIGNBOUNDARYDEST 0x00000002 -#define DDCAPS_ALIGNSIZEDEST 0x00000004 -#define DDCAPS_ALIGNBOUNDARYSRC 0x00000008 -#define DDCAPS_ALIGNSIZESRC 0x00000010 -#define DDCAPS_ALIGNSTRIDE 0x00000020 -#define DDCAPS_BLT 0x00000040 -#define DDCAPS_BLTQUEUE 0x00000080 -#define DDCAPS_BLTFOURCC 0x00000100 -#define DDCAPS_BLTSTRETCH 0x00000200 -#define DDCAPS_GDI 0x00000400 -#define DDCAPS_OVERLAY 0x00000800 -#define DDCAPS_OVERLAYCANTCLIP 0x00001000 -#define DDCAPS_OVERLAYFOURCC 0x00002000 -#define DDCAPS_OVERLAYSTRETCH 0x00004000 -#define DDCAPS_PALETTE 0x00008000 -#define DDCAPS_PALETTEVSYNC 0x00010000 -#define DDCAPS_READSCANLINE 0x00020000 -#define DDCAPS_STEREOVIEW 0x00040000 -#define DDCAPS_VBI 0x00080000 -#define DDCAPS_ZBLTS 0x00100000 -#define DDCAPS_ZOVERLAYS 0x00200000 -#define DDCAPS_COLORKEY 0x00400000 -#define DDCAPS_ALPHA 0x00800000 -#define DDCAPS_COLORKEYHWASSIST 0x01000000 -#define DDCAPS_NOHARDWARE 0x02000000 -#define DDCAPS_BLTCOLORFILL 0x04000000 -#define DDCAPS_BANKSWITCHED 0x08000000 -#define DDCAPS_BLTDEPTHFILL 0x10000000 -#define DDCAPS_CANCLIP 0x20000000 -#define DDCAPS_CANCLIPSTRETCHED 0x40000000 -#define DDCAPS_CANBLTSYSMEM 0x80000000 - -/* DDCAPS.dwCaps2 */ -#define DDCAPS2_CERTIFIED 0x00000001 -#define DDCAPS2_NO2DDURING3DSCENE 0x00000002 -#define DDCAPS2_VIDEOPORT 0x00000004 -#define DDCAPS2_AUTOFLIPOVERLAY 0x00000008 -#define DDCAPS2_CANBOBINTERLEAVED 0x00000010 -#define DDCAPS2_CANBOBNONINTERLEAVED 0x00000020 -#define DDCAPS2_COLORCONTROLOVERLAY 0x00000040 -#define DDCAPS2_COLORCONTROLPRIMARY 0x00000080 -#define DDCAPS2_CANDROPZ16BIT 0x00000100 -#define DDCAPS2_NONLOCALVIDMEM 0x00000200 -#define DDCAPS2_NONLOCALVIDMEMCAPS 0x00000400 -#define DDCAPS2_NOPAGELOCKREQUIRED 0x00000800 -#define DDCAPS2_WIDESURFACES 0x00001000 -#define DDCAPS2_CANFLIPODDEVEN 0x00002000 -#define DDCAPS2_CANBOBHARDWARE 0x00004000 -#define DDCAPS2_COPYFOURCC 0x00008000 -#define DDCAPS2_PRIMARYGAMMA 0x00020000 -#define DDCAPS2_CANRENDERWINDOWED 0x00080000 -#define DDCAPS2_CANCALIBRATEGAMMA 0x00100000 -#define DDCAPS2_FLIPINTERVAL 0x00200000 -#define DDCAPS2_FLIPNOVSYNC 0x00400000 -#define DDCAPS2_CANMANAGETEXTURE 0x00800000 -#define DDCAPS2_TEXMANINNONLOCALVIDMEM 0x01000000 -#define DDCAPS2_STEREO 0x02000000 -#define DDCAPS2_SYSTONONLOCAL_AS_SYSTOLOCAL 0x04000000 - - -/* Set/Get Colour Key Flags */ -#define DDCKEY_COLORSPACE 0x00000001 /* Struct is single colour space */ -#define DDCKEY_DESTBLT 0x00000002 /* To be used as dest for blt */ -#define DDCKEY_DESTOVERLAY 0x00000004 /* To be used as dest for CK overlays */ -#define DDCKEY_SRCBLT 0x00000008 /* To be used as src for blt */ -#define DDCKEY_SRCOVERLAY 0x00000010 /* To be used as src for CK overlays */ - -typedef struct _DDCOLORKEY -{ - DWORD dwColorSpaceLowValue;/* low boundary of color space that is to - * be treated as Color Key, inclusive - */ - DWORD dwColorSpaceHighValue;/* high boundary of color space that is - * to be treated as Color Key, inclusive - */ -} DDCOLORKEY,*LPDDCOLORKEY; - -/* ddCKEYCAPS bits */ -#define DDCKEYCAPS_DESTBLT 0x00000001 -#define DDCKEYCAPS_DESTBLTCLRSPACE 0x00000002 -#define DDCKEYCAPS_DESTBLTCLRSPACEYUV 0x00000004 -#define DDCKEYCAPS_DESTBLTYUV 0x00000008 -#define DDCKEYCAPS_DESTOVERLAY 0x00000010 -#define DDCKEYCAPS_DESTOVERLAYCLRSPACE 0x00000020 -#define DDCKEYCAPS_DESTOVERLAYCLRSPACEYUV 0x00000040 -#define DDCKEYCAPS_DESTOVERLAYONEACTIVE 0x00000080 -#define DDCKEYCAPS_DESTOVERLAYYUV 0x00000100 -#define DDCKEYCAPS_SRCBLT 0x00000200 -#define DDCKEYCAPS_SRCBLTCLRSPACE 0x00000400 -#define DDCKEYCAPS_SRCBLTCLRSPACEYUV 0x00000800 -#define DDCKEYCAPS_SRCBLTYUV 0x00001000 -#define DDCKEYCAPS_SRCOVERLAY 0x00002000 -#define DDCKEYCAPS_SRCOVERLAYCLRSPACE 0x00004000 -#define DDCKEYCAPS_SRCOVERLAYCLRSPACEYUV 0x00008000 -#define DDCKEYCAPS_SRCOVERLAYONEACTIVE 0x00010000 -#define DDCKEYCAPS_SRCOVERLAYYUV 0x00020000 -#define DDCKEYCAPS_NOCOSTOVERLAY 0x00040000 - -typedef struct _DDPIXELFORMAT { - DWORD dwSize; /* 0: size of structure */ - DWORD dwFlags; /* 4: pixel format flags */ - DWORD dwFourCC; /* 8: (FOURCC code) */ - union { - DWORD dwRGBBitCount; /* C: how many bits per pixel */ - DWORD dwYUVBitCount; /* C: how many bits per pixel */ - DWORD dwZBufferBitDepth; /* C: how many bits for z buffers */ - DWORD dwAlphaBitDepth; /* C: how many bits for alpha channels*/ - DWORD dwLuminanceBitCount; - DWORD dwBumpBitCount; - } DUMMYUNIONNAME1; - union { - DWORD dwRBitMask; /* 10: mask for red bit*/ - DWORD dwYBitMask; /* 10: mask for Y bits*/ - DWORD dwStencilBitDepth; - DWORD dwLuminanceBitMask; - DWORD dwBumpDuBitMask; - } DUMMYUNIONNAME2; - union { - DWORD dwGBitMask; /* 14: mask for green bits*/ - DWORD dwUBitMask; /* 14: mask for U bits*/ - DWORD dwZBitMask; - DWORD dwBumpDvBitMask; - } DUMMYUNIONNAME3; - union { - DWORD dwBBitMask; /* 18: mask for blue bits*/ - DWORD dwVBitMask; /* 18: mask for V bits*/ - DWORD dwStencilBitMask; - DWORD dwBumpLuminanceBitMask; - } DUMMYUNIONNAME4; - union { - DWORD dwRGBAlphaBitMask; /* 1C: mask for alpha channel */ - DWORD dwYUVAlphaBitMask; /* 1C: mask for alpha channel */ - DWORD dwLuminanceAlphaBitMask; - DWORD dwRGBZBitMask; /* 1C: mask for Z channel */ - DWORD dwYUVZBitMask; /* 1C: mask for Z channel */ - } DUMMYUNIONNAME5; - /* 20: next structure */ -} DDPIXELFORMAT,*LPDDPIXELFORMAT; - -/* DDCAPS.dwFXCaps */ -#define DDFXCAPS_BLTALPHA 0x00000001 -#define DDFXCAPS_OVERLAYALPHA 0x00000004 -#define DDFXCAPS_BLTARITHSTRETCHYN 0x00000010 -#define DDFXCAPS_BLTARITHSTRETCHY 0x00000020 -#define DDFXCAPS_BLTMIRRORLEFTRIGHT 0x00000040 -#define DDFXCAPS_BLTMIRRORUPDOWN 0x00000080 -#define DDFXCAPS_BLTROTATION 0x00000100 -#define DDFXCAPS_BLTROTATION90 0x00000200 -#define DDFXCAPS_BLTSHRINKX 0x00000400 -#define DDFXCAPS_BLTSHRINKXN 0x00000800 -#define DDFXCAPS_BLTSHRINKY 0x00001000 -#define DDFXCAPS_BLTSHRINKYN 0x00002000 -#define DDFXCAPS_BLTSTRETCHX 0x00004000 -#define DDFXCAPS_BLTSTRETCHXN 0x00008000 -#define DDFXCAPS_BLTSTRETCHY 0x00010000 -#define DDFXCAPS_BLTSTRETCHYN 0x00020000 -#define DDFXCAPS_OVERLAYARITHSTRETCHY 0x00040000 -#define DDFXCAPS_OVERLAYARITHSTRETCHYN 0x00000008 -#define DDFXCAPS_OVERLAYSHRINKX 0x00080000 -#define DDFXCAPS_OVERLAYSHRINKXN 0x00100000 -#define DDFXCAPS_OVERLAYSHRINKY 0x00200000 -#define DDFXCAPS_OVERLAYSHRINKYN 0x00400000 -#define DDFXCAPS_OVERLAYSTRETCHX 0x00800000 -#define DDFXCAPS_OVERLAYSTRETCHXN 0x01000000 -#define DDFXCAPS_OVERLAYSTRETCHY 0x02000000 -#define DDFXCAPS_OVERLAYSTRETCHYN 0x04000000 -#define DDFXCAPS_OVERLAYMIRRORLEFTRIGHT 0x08000000 -#define DDFXCAPS_OVERLAYMIRRORUPDOWN 0x10000000 - -#define DDFXCAPS_OVERLAYFILTER DDFXCAPS_OVERLAYARITHSTRETCHY - -/* DDCAPS.dwFXAlphaCaps */ -#define DDFXALPHACAPS_BLTALPHAEDGEBLEND 0x00000001 -#define DDFXALPHACAPS_BLTALPHAPIXELS 0x00000002 -#define DDFXALPHACAPS_BLTALPHAPIXELSNEG 0x00000004 -#define DDFXALPHACAPS_BLTALPHASURFACES 0x00000008 -#define DDFXALPHACAPS_BLTALPHASURFACESNEG 0x00000010 -#define DDFXALPHACAPS_OVERLAYALPHAEDGEBLEND 0x00000020 -#define DDFXALPHACAPS_OVERLAYALPHAPIXELS 0x00000040 -#define DDFXALPHACAPS_OVERLAYALPHAPIXELSNEG 0x00000080 -#define DDFXALPHACAPS_OVERLAYALPHASURFACES 0x00000100 -#define DDFXALPHACAPS_OVERLAYALPHASURFACESNEG 0x00000200 - -/* DDCAPS.dwPalCaps */ -#define DDPCAPS_4BIT 0x00000001 -#define DDPCAPS_8BITENTRIES 0x00000002 -#define DDPCAPS_8BIT 0x00000004 -#define DDPCAPS_INITIALIZE 0x00000008 -#define DDPCAPS_PRIMARYSURFACE 0x00000010 -#define DDPCAPS_PRIMARYSURFACELEFT 0x00000020 -#define DDPCAPS_ALLOW256 0x00000040 -#define DDPCAPS_VSYNC 0x00000080 -#define DDPCAPS_1BIT 0x00000100 -#define DDPCAPS_2BIT 0x00000200 -#define DDPCAPS_ALPHA 0x00000400 - -/* DDCAPS.dwSVCaps */ -/* the first 4 of these are now obsolete */ -#if DIRECTDRAW_VERSION >= 0x700 /* FIXME: I'm not sure when this switch occured */ -#define DDSVCAPS_RESERVED1 0x00000001 -#define DDSVCAPS_RESERVED2 0x00000002 -#define DDSVCAPS_RESERVED3 0x00000004 -#define DDSVCAPS_RESERVED4 0x00000008 -#else -#define DDSVCAPS_ENIGMA 0x00000001 -#define DDSVCAPS_FLICKER 0x00000002 -#define DDSVCAPS_REDBLUE 0x00000004 -#define DDSVCAPS_SPLIT 0x00000008 -#endif -#define DDSVCAPS_STEREOSEQUENTIAL 0x00000010 - -/* BitDepths */ -#define DDBD_1 0x00004000 -#define DDBD_2 0x00002000 -#define DDBD_4 0x00001000 -#define DDBD_8 0x00000800 -#define DDBD_16 0x00000400 -#define DDBD_24 0x00000200 -#define DDBD_32 0x00000100 - -/* DDOVERLAYFX.dwDDFX */ -#define DDOVERFX_ARITHSTRETCHY 0x00000001 -#define DDOVERFX_MIRRORLEFTRIGHT 0x00000002 -#define DDOVERFX_MIRRORUPDOWN 0x00000004 - -/* UpdateOverlay flags */ -#define DDOVER_ALPHADEST 0x00000001 -#define DDOVER_ALPHADESTCONSTOVERRIDE 0x00000002 -#define DDOVER_ALPHADESTNEG 0x00000004 -#define DDOVER_ALPHADESTSURFACEOVERRIDE 0x00000008 -#define DDOVER_ALPHAEDGEBLEND 0x00000010 -#define DDOVER_ALPHASRC 0x00000020 -#define DDOVER_ALPHASRCCONSTOVERRIDE 0x00000040 -#define DDOVER_ALPHASRCNEG 0x00000080 -#define DDOVER_ALPHASRCSURFACEOVERRIDE 0x00000100 -#define DDOVER_HIDE 0x00000200 -#define DDOVER_KEYDEST 0x00000400 -#define DDOVER_KEYDESTOVERRIDE 0x00000800 -#define DDOVER_KEYSRC 0x00001000 -#define DDOVER_KEYSRCOVERRIDE 0x00002000 -#define DDOVER_SHOW 0x00004000 -#define DDOVER_ADDDIRTYRECT 0x00008000 -#define DDOVER_REFRESHDIRTYRECTS 0x00010000 -#define DDOVER_REFRESHALL 0x00020000 -#define DDOVER_DDFX 0x00080000 -#define DDOVER_AUTOFLIP 0x00100000 -#define DDOVER_BOB 0x00200000 -#define DDOVER_OVERRIDEBOBWEAVE 0x00400000 -#define DDOVER_INTERLEAVED 0x00800000 - -/* DDCOLORKEY.dwFlags */ -#define DDPF_ALPHAPIXELS 0x00000001 -#define DDPF_ALPHA 0x00000002 -#define DDPF_FOURCC 0x00000004 -#define DDPF_PALETTEINDEXED4 0x00000008 -#define DDPF_PALETTEINDEXEDTO8 0x00000010 -#define DDPF_PALETTEINDEXED8 0x00000020 -#define DDPF_RGB 0x00000040 -#define DDPF_COMPRESSED 0x00000080 -#define DDPF_RGBTOYUV 0x00000100 -#define DDPF_YUV 0x00000200 -#define DDPF_ZBUFFER 0x00000400 -#define DDPF_PALETTEINDEXED1 0x00000800 -#define DDPF_PALETTEINDEXED2 0x00001000 -#define DDPF_ZPIXELS 0x00002000 -#define DDPF_STENCILBUFFER 0x00004000 -#define DDPF_ALPHAPREMULT 0x00008000 -#define DDPF_LUMINANCE 0x00020000 -#define DDPF_BUMPLUMINANCE 0x00040000 -#define DDPF_BUMPDUDV 0x00080000 - -/* SetCooperativeLevel dwFlags */ -#define DDSCL_FULLSCREEN 0x00000001 -#define DDSCL_ALLOWREBOOT 0x00000002 -#define DDSCL_NOWINDOWCHANGES 0x00000004 -#define DDSCL_NORMAL 0x00000008 -#define DDSCL_EXCLUSIVE 0x00000010 -#define DDSCL_ALLOWMODEX 0x00000040 -#define DDSCL_SETFOCUSWINDOW 0x00000080 -#define DDSCL_SETDEVICEWINDOW 0x00000100 -#define DDSCL_CREATEDEVICEWINDOW 0x00000200 -#define DDSCL_MULTITHREADED 0x00000400 -#define DDSCL_FPUSETUP 0x00000800 -#define DDSCL_FPUPRESERVE 0x00001000 - - -/* DDSURFACEDESC.dwFlags */ -#define DDSD_CAPS 0x00000001 -#define DDSD_HEIGHT 0x00000002 -#define DDSD_WIDTH 0x00000004 -#define DDSD_PITCH 0x00000008 -#define DDSD_BACKBUFFERCOUNT 0x00000020 -#define DDSD_ZBUFFERBITDEPTH 0x00000040 -#define DDSD_ALPHABITDEPTH 0x00000080 -#define DDSD_LPSURFACE 0x00000800 -#define DDSD_PIXELFORMAT 0x00001000 -#define DDSD_CKDESTOVERLAY 0x00002000 -#define DDSD_CKDESTBLT 0x00004000 -#define DDSD_CKSRCOVERLAY 0x00008000 -#define DDSD_CKSRCBLT 0x00010000 -#define DDSD_MIPMAPCOUNT 0x00020000 -#define DDSD_REFRESHRATE 0x00040000 -#define DDSD_LINEARSIZE 0x00080000 -#define DDSD_TEXTURESTAGE 0x00100000 -#define DDSD_FVF 0x00200000 -#define DDSD_SRCVBHANDLE 0x00400000 -#define DDSD_ALL 0x007ff9ee - -/* EnumSurfaces flags */ -#define DDENUMSURFACES_ALL 0x00000001 -#define DDENUMSURFACES_MATCH 0x00000002 -#define DDENUMSURFACES_NOMATCH 0x00000004 -#define DDENUMSURFACES_CANBECREATED 0x00000008 -#define DDENUMSURFACES_DOESEXIST 0x00000010 - -/* SetDisplayMode flags */ -#define DDSDM_STANDARDVGAMODE 0x00000001 - -/* EnumDisplayModes flags */ -#define DDEDM_REFRESHRATES 0x00000001 -#define DDEDM_STANDARDVGAMODES 0x00000002 - -/* WaitForVerticalDisplay flags */ - -#define DDWAITVB_BLOCKBEGIN 0x00000001 -#define DDWAITVB_BLOCKBEGINEVENT 0x00000002 -#define DDWAITVB_BLOCKEND 0x00000004 - -typedef struct _DDSURFACEDESC -{ - DWORD dwSize; /* 0: size of the DDSURFACEDESC structure*/ - DWORD dwFlags; /* 4: determines what fields are valid*/ - DWORD dwHeight; /* 8: height of surface to be created*/ - DWORD dwWidth; /* C: width of input surface*/ - union { - LONG lPitch; /* 10: distance to start of next line (return value only)*/ - DWORD dwLinearSize; - } DUMMYUNIONNAME1; - DWORD dwBackBufferCount;/* 14: number of back buffers requested*/ - union { - DWORD dwMipMapCount;/* 18:number of mip-map levels requested*/ - DWORD dwZBufferBitDepth;/*18: depth of Z buffer requested*/ - DWORD dwRefreshRate;/* 18:refresh rate (used when display mode is described)*/ - } DUMMYUNIONNAME2; - DWORD dwAlphaBitDepth;/* 1C:depth of alpha buffer requested*/ - DWORD dwReserved; /* 20:reserved*/ - LPVOID lpSurface; /* 24:pointer to the associated surface memory*/ - DDCOLORKEY ddckCKDestOverlay;/* 28: CK for dest overlay use*/ - DDCOLORKEY ddckCKDestBlt; /* 30: CK for destination blt use*/ - DDCOLORKEY ddckCKSrcOverlay;/* 38: CK for source overlay use*/ - DDCOLORKEY ddckCKSrcBlt; /* 40: CK for source blt use*/ - DDPIXELFORMAT ddpfPixelFormat;/* 48: pixel format description of the surface*/ - DDSCAPS ddsCaps; /* 68: direct draw surface caps */ -} DDSURFACEDESC,*LPDDSURFACEDESC; - -typedef struct _DDSURFACEDESC2 -{ - DWORD dwSize; /* 0: size of the DDSURFACEDESC structure*/ - DWORD dwFlags; /* 4: determines what fields are valid*/ - DWORD dwHeight; /* 8: height of surface to be created*/ - DWORD dwWidth; /* C: width of input surface*/ - union { - LONG lPitch; /*10: distance to start of next line (return value only)*/ - DWORD dwLinearSize; /*10: formless late-allocated optimized surface size */ - } DUMMYUNIONNAME1; - DWORD dwBackBufferCount;/* 14: number of back buffers requested*/ - union { - DWORD dwMipMapCount;/* 18:number of mip-map levels requested*/ - DWORD dwRefreshRate;/* 18:refresh rate (used when display mode is described)*/ - DWORD dwSrcVBHandle;/* 18:source used in VB::Optimize */ - } DUMMYUNIONNAME2; - DWORD dwAlphaBitDepth;/* 1C:depth of alpha buffer requested*/ - DWORD dwReserved; /* 20:reserved*/ - LPVOID lpSurface; /* 24:pointer to the associated surface memory*/ - union { - DDCOLORKEY ddckCKDestOverlay; /* 28: CK for dest overlay use*/ - DWORD dwEmptyFaceColor; /* 28: color for empty cubemap faces */ - } DUMMYUNIONNAME3; - DDCOLORKEY ddckCKDestBlt; /* 30: CK for destination blt use*/ - DDCOLORKEY ddckCKSrcOverlay;/* 38: CK for source overlay use*/ - DDCOLORKEY ddckCKSrcBlt; /* 40: CK for source blt use*/ - - union { - DDPIXELFORMAT ddpfPixelFormat;/* 48: pixel format description of the surface*/ - DWORD dwFVF; /* 48: vertex format description of vertex buffers */ - } DUMMYUNIONNAME4; - DDSCAPS2 ddsCaps; /* 68: DDraw surface caps */ - DWORD dwTextureStage; /* 78: stage in multitexture cascade */ -} DDSURFACEDESC2,*LPDDSURFACEDESC2; - -/* DDCOLORCONTROL.dwFlags */ -#define DDCOLOR_BRIGHTNESS 0x00000001 -#define DDCOLOR_CONTRAST 0x00000002 -#define DDCOLOR_HUE 0x00000004 -#define DDCOLOR_SATURATION 0x00000008 -#define DDCOLOR_SHARPNESS 0x00000010 -#define DDCOLOR_GAMMA 0x00000020 -#define DDCOLOR_COLORENABLE 0x00000040 - -typedef struct { - DWORD dwSize; - DWORD dwFlags; - LONG lBrightness; - LONG lContrast; - LONG lHue; - LONG lSaturation; - LONG lSharpness; - LONG lGamma; - LONG lColorEnable; - DWORD dwReserved1; -} DDCOLORCONTROL,*LPDDCOLORCONTROL; - -typedef struct { - WORD red[256]; - WORD green[256]; - WORD blue[256]; -} DDGAMMARAMP,*LPDDGAMMARAMP; - -typedef BOOL CALLBACK (*LPDDENUMCALLBACKA)(GUID *, LPSTR, LPSTR, LPVOID); -typedef BOOL CALLBACK (*LPDDENUMCALLBACKW)(GUID *, LPWSTR, LPWSTR, LPVOID); -DECL_WINELIB_TYPE_AW(LPDDENUMCALLBACK) - -typedef HRESULT CALLBACK (*LPDDENUMMODESCALLBACK)(LPDDSURFACEDESC, LPVOID); -typedef HRESULT CALLBACK (*LPDDENUMMODESCALLBACK2)(LPDDSURFACEDESC2, LPVOID); -typedef HRESULT CALLBACK (*LPDDENUMSURFACESCALLBACK)(LPDIRECTDRAWSURFACE, LPDDSURFACEDESC, LPVOID); -typedef HRESULT CALLBACK (*LPDDENUMSURFACESCALLBACK2)(LPDIRECTDRAWSURFACE4, LPDDSURFACEDESC2, LPVOID); -typedef HRESULT CALLBACK (*LPDDENUMSURFACESCALLBACK7)(LPDIRECTDRAWSURFACE7, LPDDSURFACEDESC2, LPVOID); - -typedef BOOL CALLBACK (*LPDDENUMCALLBACKEXA)(GUID *, LPSTR, LPSTR, LPVOID, HMONITOR); -typedef BOOL CALLBACK (*LPDDENUMCALLBACKEXW)(GUID *, LPWSTR, LPWSTR, LPVOID, HMONITOR); -DECL_WINELIB_TYPE_AW(LPDDENUMCALLBACKEX) - -HRESULT WINAPI DirectDrawEnumerateExA( LPDDENUMCALLBACKEXA lpCallback, LPVOID lpContext, DWORD dwFlags); -HRESULT WINAPI DirectDrawEnumerateExW( LPDDENUMCALLBACKEXW lpCallback, LPVOID lpContext, DWORD dwFlags); -#define DirectDrawEnumerateEx WINELIB_NAME_AW(DirectDrawEnumerateEx) - -/* flags for DirectDrawEnumerateEx */ -#define DDENUM_ATTACHEDSECONDARYDEVICES 0x00000001 -#define DDENUM_DETACHEDSECONDARYDEVICES 0x00000002 -#define DDENUM_NONDISPLAYDEVICES 0x00000004 - -/* flags for DirectDrawCreate or IDirectDraw::Initialize */ -#define DDCREATE_HARDWAREONLY 1L -#define DDCREATE_EMULATIONONLY 2L - -typedef struct _DDBLTFX -{ - DWORD dwSize; /* size of structure */ - DWORD dwDDFX; /* FX operations */ - DWORD dwROP; /* Win32 raster operations */ - DWORD dwDDROP; /* Raster operations new for DirectDraw */ - DWORD dwRotationAngle; /* Rotation angle for blt */ - DWORD dwZBufferOpCode; /* ZBuffer compares */ - DWORD dwZBufferLow; /* Low limit of Z buffer */ - DWORD dwZBufferHigh; /* High limit of Z buffer */ - DWORD dwZBufferBaseDest; /* Destination base value */ - DWORD dwZDestConstBitDepth; /* Bit depth used to specify Z constant for destination */ - union - { - DWORD dwZDestConst; /* Constant to use as Z buffer for dest */ - LPDIRECTDRAWSURFACE lpDDSZBufferDest; /* Surface to use as Z buffer for dest */ - } DUMMYUNIONNAME1; - DWORD dwZSrcConstBitDepth; /* Bit depth used to specify Z constant for source */ - union - { - DWORD dwZSrcConst; /* Constant to use as Z buffer for src */ - LPDIRECTDRAWSURFACE lpDDSZBufferSrc; /* Surface to use as Z buffer for src */ - } DUMMYUNIONNAME2; - DWORD dwAlphaEdgeBlendBitDepth; /* Bit depth used to specify constant for alpha edge blend */ - DWORD dwAlphaEdgeBlend; /* Alpha for edge blending */ - DWORD dwReserved; - DWORD dwAlphaDestConstBitDepth; /* Bit depth used to specify alpha constant for destination */ - union - { - DWORD dwAlphaDestConst; /* Constant to use as Alpha Channel */ - LPDIRECTDRAWSURFACE lpDDSAlphaDest; /* Surface to use as Alpha Channel */ - } DUMMYUNIONNAME3; - DWORD dwAlphaSrcConstBitDepth; /* Bit depth used to specify alpha constant for source */ - union - { - DWORD dwAlphaSrcConst; /* Constant to use as Alpha Channel */ - LPDIRECTDRAWSURFACE lpDDSAlphaSrc; /* Surface to use as Alpha Channel */ - } DUMMYUNIONNAME4; - union - { - DWORD dwFillColor; /* color in RGB or Palettized */ - DWORD dwFillDepth; /* depth value for z-buffer */ - DWORD dwFillPixel; /* pixel val for RGBA or RGBZ */ - LPDIRECTDRAWSURFACE lpDDSPattern; /* Surface to use as pattern */ - } DUMMYUNIONNAME5; - DDCOLORKEY ddckDestColorkey; /* DestColorkey override */ - DDCOLORKEY ddckSrcColorkey; /* SrcColorkey override */ -} DDBLTFX,*LPDDBLTFX; - -/* dwDDFX */ -/* arithmetic stretching along y axis */ -#define DDBLTFX_ARITHSTRETCHY 0x00000001 -/* mirror on y axis */ -#define DDBLTFX_MIRRORLEFTRIGHT 0x00000002 -/* mirror on x axis */ -#define DDBLTFX_MIRRORUPDOWN 0x00000004 -/* do not tear */ -#define DDBLTFX_NOTEARING 0x00000008 -/* 180 degrees clockwise rotation */ -#define DDBLTFX_ROTATE180 0x00000010 -/* 270 degrees clockwise rotation */ -#define DDBLTFX_ROTATE270 0x00000020 -/* 90 degrees clockwise rotation */ -#define DDBLTFX_ROTATE90 0x00000040 -/* dwZBufferLow and dwZBufferHigh specify limits to the copied Z values */ -#define DDBLTFX_ZBUFFERRANGE 0x00000080 -/* add dwZBufferBaseDest to every source z value before compare */ -#define DDBLTFX_ZBUFFERBASEDEST 0x00000100 - -typedef struct _DDOVERLAYFX -{ - DWORD dwSize; /* size of structure */ - DWORD dwAlphaEdgeBlendBitDepth; /* Bit depth used to specify constant for alpha edge blend */ - DWORD dwAlphaEdgeBlend; /* Constant to use as alpha for edge blend */ - DWORD dwReserved; - DWORD dwAlphaDestConstBitDepth; /* Bit depth used to specify alpha constant for destination */ - union - { - DWORD dwAlphaDestConst; /* Constant to use as alpha channel for dest */ - LPDIRECTDRAWSURFACE lpDDSAlphaDest; /* Surface to use as alpha channel for dest */ - } DUMMYUNIONNAME1; - DWORD dwAlphaSrcConstBitDepth; /* Bit depth used to specify alpha constant for source */ - union - { - DWORD dwAlphaSrcConst; /* Constant to use as alpha channel for src */ - LPDIRECTDRAWSURFACE lpDDSAlphaSrc; /* Surface to use as alpha channel for src */ - } DUMMYUNIONNAME2; - DDCOLORKEY dckDestColorkey; /* DestColorkey override */ - DDCOLORKEY dckSrcColorkey; /* DestColorkey override */ - DWORD dwDDFX; /* Overlay FX */ - DWORD dwFlags; /* flags */ -} DDOVERLAYFX,*LPDDOVERLAYFX; - -typedef struct _DDBLTBATCH -{ - LPRECT lprDest; - LPDIRECTDRAWSURFACE lpDDSSrc; - LPRECT lprSrc; - DWORD dwFlags; - LPDDBLTFX lpDDBltFx; -} DDBLTBATCH,*LPDDBLTBATCH; - -#define MAX_DDDEVICEID_STRING 512 - -typedef struct tagDDDEVICEIDENTIFIER { - char szDriver[MAX_DDDEVICEID_STRING]; - char szDescription[MAX_DDDEVICEID_STRING]; - LARGE_INTEGER liDriverVersion; - DWORD dwVendorId; - DWORD dwDeviceId; - DWORD dwSubSysId; - DWORD dwRevision; - GUID guidDeviceIdentifier; -} DDDEVICEIDENTIFIER, * LPDDDEVICEIDENTIFIER; - -typedef struct tagDDDEVICEIDENTIFIER2 { - char szDriver[MAX_DDDEVICEID_STRING]; /* user readable driver name */ - char szDescription[MAX_DDDEVICEID_STRING]; /* user readable description */ - LARGE_INTEGER liDriverVersion; /* driver version */ - DWORD dwVendorId; /* vendor ID, zero if unknown */ - DWORD dwDeviceId; /* chipset ID, zero if unknown */ - DWORD dwSubSysId; /* board ID, zero if unknown */ - DWORD dwRevision; /* chipset version, zero if unknown */ - GUID guidDeviceIdentifier; /* unique ID for this driver/chipset combination */ - DWORD dwWHQLLevel; /* Windows Hardware Quality Lab certification level */ -} DDDEVICEIDENTIFIER2, * LPDDDEVICEIDENTIFIER2; - -/***************************************************************************** - * IDirectDrawPalette interface - */ -#undef INTERFACE -#define INTERFACE IDirectDrawPalette -DECLARE_INTERFACE_(IDirectDrawPalette,IUnknown) -{ - STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - STDMETHOD(GetCaps)(THIS_ LPDWORD lpdwCaps) PURE; - STDMETHOD(GetEntries)(THIS_ DWORD dwFlags, DWORD dwBase, DWORD dwNumEntries, LPPALETTEENTRY lpEntries) PURE; - STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW lpDD, DWORD dwFlags, LPPALETTEENTRY lpDDColorTable) PURE; - STDMETHOD(SetEntries)(THIS_ DWORD dwFlags, DWORD dwStartingEntry, DWORD dwCount, LPPALETTEENTRY lpEntries) PURE; -}; - - /*** IUnknown methods ***/ -#define IDirectDrawPalette_QueryInterface(p,a,b) ICOM_CALL_(QueryInterface,p,(p,a,b)) -#define IDirectDrawPalette_AddRef(p) ICOM_CALL_(AddRef,p,(p)) -#define IDirectDrawPalette_Release(p) ICOM_CALL_(Release,p,(p)) - /*** IDirectDrawPalette methods ***/ -#define IDirectDrawPalette_GetCaps(p,a) ICOM_CALL_(GetCaps,p,(p,a)) -#define IDirectDrawPalette_GetEntries(p,a,b,c,d) ICOM_CALL_(GetEntries,p,(p,a,b,c,d)) -#define IDirectDrawPalette_Initialize(p,a,b,c) ICOM_CALL_(Initialize,p,(p,a,b,c)) -#define IDirectDrawPalette_SetEntries(p,a,b,c,d) ICOM_CALL_(SetEntries,p,(p,a,b,c,d)) - - -/***************************************************************************** - * IDirectDrawClipper interface - */ -#undef INTERFACE -#define INTERFACE IDirectDrawClipper -DECLARE_INTERFACE_(IDirectDrawClipper,IUnknown) -{ - STDMETHOD(QueryInterface)(THIS_ REFIID,LPVOID*) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - STDMETHOD(GetClipList)(THIS_ LPRECT lpRect, LPRGNDATA lpClipList, LPDWORD lpdwSize) PURE; - STDMETHOD(GetHWnd)(THIS_ HWND* lphWnd) PURE; - STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW lpDD, DWORD dwFlags) PURE; - STDMETHOD(IsClipListChanged)(THIS_ BOOL* lpbChanged) PURE; - STDMETHOD(SetClipList)(THIS_ LPRGNDATA lpClipList, DWORD dwFlags) PURE; - STDMETHOD(SetHWnd)(THIS_ DWORD dwFlags, HWND hWnd) PURE; -}; - - /*** IUnknown methods ***/ -#define IDirectDrawClipper_QueryInterface(p,a,b) ICOM_CALL_(QueryInterface,p,(p,a,b)) -#define IDirectDrawClipper_AddRef(p) ICOM_CALL_(AddRef,p,(p)) -#define IDirectDrawClipper_Release(p) ICOM_CALL_(Release,p,(p)) - /*** IDirectDrawClipper methods ***/ -#define IDirectDrawClipper_GetClipList(p,a,b,c) ICOM_CALL_(GetClipList,p,(p,a,b,c)) -#define IDirectDrawClipper_GetHWnd(p,a) ICOM_CALL_(GetHWnd,p,(p,a)) -#define IDirectDrawClipper_Initialize(p,a,b) ICOM_CALL_(Initialize,p,(p,a,b)) -#define IDirectDrawClipper_IsClipListChanged(p,a) ICOM_CALL_(IsClipListChanged,p,(p,a)) -#define IDirectDrawClipper_SetClipList(p,a,b) ICOM_CALL_(SetClipList,p,(p,a,b)) -#define IDirectDrawClipper_SetHWnd(p,a,b) ICOM_CALL_(SetHWnd,p,(p,a,b)) - - -/***************************************************************************** - * IDirectDraw interface - */ -#undef INTERFACE -#define INTERFACE IDirectDraw -DECLARE_INTERFACE_(IDirectDraw,IUnknown) -{ - STDMETHOD(QueryInterface)(THIS_ REFIID,LPVOID*) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - STDMETHOD(Compact)(THIS) PURE; - STDMETHOD(CreateClipper)(THIS_ DWORD dwFlags, LPDIRECTDRAWCLIPPER* lplpDDClipper, IUnknown* pUnkOuter) PURE; - STDMETHOD(CreatePalette)(THIS_ DWORD dwFlags, LPPALETTEENTRY lpColorTable, LPDIRECTDRAWPALETTE* lplpDDPalette, IUnknown* pUnkOuter) PURE; - STDMETHOD(CreateSurface)(THIS_ LPDDSURFACEDESC lpDDSurfaceDesc, LPDIRECTDRAWSURFACE* lplpDDSurface, IUnknown* pUnkOuter) PURE; - STDMETHOD(DuplicateSurface)(THIS_ LPDIRECTDRAWSURFACE lpDDSurface, LPDIRECTDRAWSURFACE* lplpDupDDSurface) PURE; - STDMETHOD(EnumDisplayModes)(THIS_ DWORD dwFlags, LPDDSURFACEDESC lpDDSurfaceDesc, LPVOID lpContext, LPDDENUMMODESCALLBACK lpEnumModesCallback) PURE; - STDMETHOD(EnumSurfaces)(THIS_ DWORD dwFlags, LPDDSURFACEDESC lpDDSD, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpEnumSurfacesCallback) PURE; - STDMETHOD(FlipToGDISurface)(THIS) PURE; - STDMETHOD(GetCaps)(THIS_ LPDDCAPS lpDDDriverCaps, LPDDCAPS lpDDHELCaps) PURE; - STDMETHOD(GetDisplayMode)(THIS_ LPDDSURFACEDESC lpDDSurfaceDesc) PURE; - STDMETHOD(GetFourCCCodes)(THIS_ LPDWORD lpNumCodes, LPDWORD lpCodes) PURE; - STDMETHOD(GetGDISurface)(THIS_ LPDIRECTDRAWSURFACE* lplpGDIDDSurface) PURE; - STDMETHOD(GetMonitorFrequency)(THIS_ LPDWORD lpdwFrequency) PURE; - STDMETHOD(GetScanLine)(THIS_ LPDWORD lpdwScanLine) PURE; - STDMETHOD(GetVerticalBlankStatus)(THIS_ BOOL* lpbIsInVB) PURE; - STDMETHOD(Initialize)(THIS_ GUID* lpGUID) PURE; - STDMETHOD(RestoreDisplayMode)(THIS) PURE; - STDMETHOD(SetCooperativeLevel)(THIS_ HWND hWnd, DWORD dwFlags) PURE; - STDMETHOD(SetDisplayMode)(THIS_ DWORD, DWORD, DWORD) PURE; - STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD dwFlags, HANDLE hEvent) PURE; -}; - - /*** IUnknown methods ***/ -#define IDirectDraw_QueryInterface(p,a,b) ICOM_CALL_(QueryInterface,p,(p,a,b)) -#define IDirectDraw_AddRef(p) ICOM_CALL_(AddRef,p,(p)) -#define IDirectDraw_Release(p) ICOM_CALL_(Release,p,(p)) - /*** IDirectDraw methods ***/ -#define IDirectDraw_Compact(p) ICOM_CALL_(Compact,p,(p)) -#define IDirectDraw_CreateClipper(p,a,b,c) ICOM_CALL_(CreateClipper,p,(p,a,b,c)) -#define IDirectDraw_CreatePalette(p,a,b,c,d) ICOM_CALL_(CreatePalette,p,(p,a,b,c,d)) -#define IDirectDraw_CreateSurface(p,a,b,c) ICOM_CALL_(CreateSurface,p,(p,a,b,c)) -#define IDirectDraw_DuplicateSurface(p,a,b) ICOM_CALL_(DuplicateSurface,p,(p,a,b)) -#define IDirectDraw_EnumDisplayModes(p,a,b,c,d) ICOM_CALL_(EnumDisplayModes,p,(p,a,b,c,d)) -#define IDirectDraw_EnumSurfaces(p,a,b,c,d) ICOM_CALL_(EnumSurfaces,p,(p,a,b,c,d)) -#define IDirectDraw_FlipToGDISurface(p) ICOM_CALL_(FlipToGDISurface,p,(p)) -#define IDirectDraw_GetCaps(p,a,b) ICOM_CALL_(GetCaps,p,(p,a,b)) -#define IDirectDraw_GetDisplayMode(p,a) ICOM_CALL_(GetDisplayMode,p,(p,a)) -#define IDirectDraw_GetFourCCCodes(p,a,b) ICOM_CALL_(GetFourCCCodes,p,(p,a,b)) -#define IDirectDraw_GetGDISurface(p,a) ICOM_CALL_(GetGDISurface,p,(p,a)) -#define IDirectDraw_GetMonitorFrequency(p,a) ICOM_CALL_(GetMonitorFrequency,p,(p,a)) -#define IDirectDraw_GetScanLine(p,a) ICOM_CALL_(GetScanLine,p,(p,a)) -#define IDirectDraw_GetVerticalBlankStatus(p,a) ICOM_CALL_(GetVerticalBlankStatus,p,(p,a)) -#define IDirectDraw_Initialize(p,a) ICOM_CALL_(Initialize,p,(p,a)) -#define IDirectDraw_RestoreDisplayMode(p) ICOM_CALL_(RestoreDisplayMode,p,(p)) -#define IDirectDraw_SetCooperativeLevel(p,a,b) ICOM_CALL_(SetCooperativeLevel,p,(p,a,b)) -#define IDirectDraw_SetDisplayMode(p,a,b,c) ICOM_CALL_(SetDisplayMode,p,(p,a,b,c)) -#define IDirectDraw_WaitForVerticalBlank(p,a,b) ICOM_CALL_(WaitForVerticalBlank,p,(p,a,b)) - - -/* flags for Lock() */ -#define DDLOCK_SURFACEMEMORYPTR 0x00000000 -#define DDLOCK_WAIT 0x00000001 -#define DDLOCK_EVENT 0x00000002 -#define DDLOCK_READONLY 0x00000010 -#define DDLOCK_WRITEONLY 0x00000020 -#define DDLOCK_NOSYSLOCK 0x00000800 - - -/***************************************************************************** - * IDirectDraw2 interface - */ -/* Note: IDirectDraw2 cannot derive from IDirectDraw because the number of - * arguments of SetDisplayMode has changed ! - */ -#undef INTERFACE -#define INTERFACE IDirectDraw2 -DECLARE_INTERFACE_(IDirectDraw2,IUnknown) -{ - STDMETHOD(QueryInterface)(THIS_ REFIID,LPVOID*) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - STDMETHOD(Compact)(THIS) PURE; - STDMETHOD(CreateClipper)(THIS_ DWORD dwFlags, LPDIRECTDRAWCLIPPER* lplpDDClipper, IUnknown* pUnkOuter) PURE; - STDMETHOD(CreatePalette)(THIS_ DWORD dwFlags, LPPALETTEENTRY lpColorTable, LPDIRECTDRAWPALETTE* lplpDDPalette, IUnknown* pUnkOuter) PURE; - STDMETHOD(CreateSurface)(THIS_ LPDDSURFACEDESC lpDDSurfaceDesc, LPDIRECTDRAWSURFACE2* lplpDDSurface, IUnknown* pUnkOuter) PURE; - STDMETHOD(DuplicateSurface)(THIS_ LPDIRECTDRAWSURFACE2 lpDDSurface, LPDIRECTDRAWSURFACE2* lplpDupDDSurface) PURE; - STDMETHOD(EnumDisplayModes)(THIS_ DWORD dwFlags, LPDDSURFACEDESC lpDDSurfaceDesc, LPVOID lpContext, LPDDENUMMODESCALLBACK lpEnumModesCallback) PURE; - STDMETHOD(EnumSurfaces)(THIS_ DWORD dwFlags, LPDDSURFACEDESC lpDDSD, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpEnumSurfacesCallback) PURE; - STDMETHOD(FlipToGDISurface)(THIS) PURE; - STDMETHOD(GetCaps)(THIS_ LPDDCAPS lpDDDriverCaps, LPDDCAPS lpDDHELCaps) PURE; - STDMETHOD(GetDisplayMode)(THIS_ LPDDSURFACEDESC lpDDSurfaceDesc) PURE; - STDMETHOD(GetFourCCCodes)(THIS_ LPDWORD lpNumCodes, LPDWORD lpCodes) PURE; - STDMETHOD(GetGDISurface)(THIS_ LPDIRECTDRAWSURFACE2* lplpGDIDDSurface) PURE; - STDMETHOD(GetMonitorFrequency)(THIS_ LPDWORD lpdwFrequency) PURE; - STDMETHOD(GetScanLine)(THIS_ LPDWORD lpdwScanLine) PURE; - STDMETHOD(GetVerticalBlankStatus)(THIS_ BOOL* lpbIsInVB) PURE; - STDMETHOD(Initialize)(THIS_ GUID* lpGUID) PURE; - STDMETHOD(RestoreDisplayMode)(THIS) PURE; - STDMETHOD(SetCooperativeLevel)(THIS_ HWND hWnd, DWORD dwFlags) PURE; - STDMETHOD(SetDisplayMode)(THIS_ DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwRefreshRate, DWORD dwFlags) PURE; - STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD dwFlags, HANDLE hEvent) PURE; - - STDMETHOD(GetAvailableVidMem)(THIS_ LPDDSCAPS lpDDCaps, LPDWORD lpdwTotal, LPDWORD lpdwFree) PURE; -}; - - /*** IUnknown methods ***/ -#define IDirectDraw2_QueryInterface(p,a,b) ICOM_CALL_(QueryInterface,p,(p,a,b)) -#define IDirectDraw2_AddRef(p) ICOM_CALL_(AddRef,p,(p)) -#define IDirectDraw2_Release(p) ICOM_CALL_(Release,p,(p)) - /*** IDirectDraw methods ***/ -#define IDirectDraw2_Compact(p) ICOM_CALL_(Compact,p,(p)) -#define IDirectDraw2_CreateClipper(p,a,b,c) ICOM_CALL_(CreateClipper,p,(p,a,b,c)) -#define IDirectDraw2_CreatePalette(p,a,b,c,d) ICOM_CALL_(CreatePalette,p,(p,a,b,c,d)) -#define IDirectDraw2_CreateSurface(p,a,b,c) ICOM_CALL_(CreateSurface,p,(p,a,b,c)) -#define IDirectDraw2_DuplicateSurface(p,a,b) ICOM_CALL_(DuplicateSurface,p,(p,a,b)) -#define IDirectDraw2_EnumDisplayModes(p,a,b,c,d) ICOM_CALL_(EnumDisplayModes,p,(p,a,b,c,d)) -#define IDirectDraw2_EnumSurfaces(p,a,b,c,d) ICOM_CALL_(EnumSurfaces,p,(p,a,b,c,d)) -#define IDirectDraw2_FlipToGDISurface(p) ICOM_CALL_(FlipToGDISurface,p,(p)) -#define IDirectDraw2_GetCaps(p,a,b) ICOM_CALL_(GetCaps,p,(p,a,b)) -#define IDirectDraw2_GetDisplayMode(p,a) ICOM_CALL_(GetDisplayMode,p,(p,a)) -#define IDirectDraw2_GetFourCCCodes(p,a,b) ICOM_CALL_(GetFourCCCodes,p,(p,a,b)) -#define IDirectDraw2_GetGDISurface(p,a) ICOM_CALL_(GetGDISurface,p,(p,a)) -#define IDirectDraw2_GetMonitorFrequency(p,a) ICOM_CALL_(GetMonitorFrequency,p,(p,a)) -#define IDirectDraw2_GetScanLine(p,a) ICOM_CALL_(GetScanLine,p,(p,a)) -#define IDirectDraw2_GetVerticalBlankStatus(p,a) ICOM_CALL_(GetVerticalBlankStatus,p,(p,a)) -#define IDirectDraw2_Initialize(p,a) ICOM_CALL_(Initialize,p,(p,a)) -#define IDirectDraw2_RestoreDisplayMode(p) ICOM_CALL_(RestoreDisplayMode,p,(p)) -#define IDirectDraw2_SetCooperativeLevel(p,a,b) ICOM_CALL_(SetCooperativeLevel,p,(p,a,b)) -#define IDirectDraw2_SetDisplayMode(p,a,b,c,d,e) ICOM_CALL_(SetDisplayMode,p,(p,a,b,c,d,e)) -#define IDirectDraw2_WaitForVerticalBlank(p,a,b) ICOM_CALL_(WaitForVerticalBlank,p,(p,a,b)) -/*** IDirectDraw2 methods ***/ -#define IDirectDraw2_GetAvailableVidMem(p,a,b,c) ICOM_CALL_(GetAvailableVidMem,p,(p,a,b,c)) - - -/***************************************************************************** - * IDirectDraw4 interface - */ -#undef INTERFACE -#define INTERFACE IDirectDraw4 -DECLARE_INTERFACE_(IDirectDraw4,IUnknown) -{ - STDMETHOD(QueryInterface)(THIS_ REFIID,LPVOID*) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - STDMETHOD(Compact)(THIS) PURE; - STDMETHOD(CreateClipper)(THIS_ DWORD dwFlags, LPDIRECTDRAWCLIPPER* lplpDDClipper, IUnknown* pUnkOuter) PURE; - STDMETHOD(CreatePalette)(THIS_ DWORD dwFlags, LPPALETTEENTRY lpColorTable, LPDIRECTDRAWPALETTE* lplpDDPalette, IUnknown* pUnkOuter) PURE; - STDMETHOD(CreateSurface)(THIS_ LPDDSURFACEDESC2 lpDDSurfaceDesc, LPDIRECTDRAWSURFACE4* lplpDDSurface, IUnknown* pUnkOuter) PURE; - STDMETHOD(DuplicateSurface)(THIS_ LPDIRECTDRAWSURFACE4 lpDDSurface, LPDIRECTDRAWSURFACE4* lplpDupDDSurface) PURE; - STDMETHOD(EnumDisplayModes)(THIS_ DWORD dwFlags, LPDDSURFACEDESC2 lpDDSurfaceDesc, LPVOID lpContext, LPDDENUMMODESCALLBACK2 lpEnumModesCallback) PURE; - STDMETHOD(EnumSurfaces)(THIS_ DWORD dwFlags, LPDDSURFACEDESC2 lpDDSD, LPVOID lpContext, LPDDENUMSURFACESCALLBACK2 lpEnumSurfacesCallback) PURE; - STDMETHOD(FlipToGDISurface)(THIS) PURE; - STDMETHOD(GetCaps)(THIS_ LPDDCAPS lpDDDriverCaps, LPDDCAPS lpDDHELCaps) PURE; - STDMETHOD(GetDisplayMode)(THIS_ LPDDSURFACEDESC2 lpDDSurfaceDesc) PURE; - STDMETHOD(GetFourCCCodes)(THIS_ LPDWORD lpNumCodes, LPDWORD lpCodes) PURE; - STDMETHOD(GetGDISurface)(THIS_ LPDIRECTDRAWSURFACE4* lplpGDIDDSurface) PURE; - STDMETHOD(GetMonitorFrequency)(THIS_ LPDWORD lpdwFrequency) PURE; - STDMETHOD(GetScanLine)(THIS_ LPDWORD lpdwScanLine) PURE; - STDMETHOD(GetVerticalBlankStatus)(THIS_ BOOL* lpbIsInVB) PURE; - STDMETHOD(Initialize)(THIS_ GUID* lpGUID) PURE; - STDMETHOD(RestoreDisplayMode)(THIS) PURE; - STDMETHOD(SetCooperativeLevel)(THIS_ HWND hWnd, DWORD dwFlags) PURE; - STDMETHOD(SetDisplayMode)(THIS_ DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwRefreshRate, DWORD dwFlags) PURE; - STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD dwFlags, HANDLE hEvent) PURE; - - STDMETHOD(GetAvailableVidMem)(THIS_ LPDDSCAPS2 lpDDCaps, LPDWORD lpdwTotal, LPDWORD lpdwFree) PURE; - - STDMETHOD(GetSurfaceFromDC)(THIS_ HDC , LPDIRECTDRAWSURFACE4* ) PURE; - STDMETHOD(RestoreAllSurfaces)(THIS) PURE; - STDMETHOD(TestCooperativeLevel)(THIS) PURE; - STDMETHOD(GetDeviceIdentifier)(THIS_ LPDDDEVICEIDENTIFIER , DWORD ) PURE; -}; - - /*** IUnknown methods ***/ -#define IDirectDraw4_QueryInterface(p,a,b) ICOM_CALL_(QueryInterface,p,(p,a,b)) -#define IDirectDraw4_AddRef(p) ICOM_CALL_(AddRef,p,(p)) -#define IDirectDraw4_Release(p) ICOM_CALL_(Release,p,(p)) - /*** IDirectDraw methods ***/ -#define IDirectDraw4_Compact(p) ICOM_CALL_(Compact,p,(p)) -#define IDirectDraw4_CreateClipper(p,a,b,c) ICOM_CALL_(CreateClipper,p,(p,a,b,c)) -#define IDirectDraw4_CreatePalette(p,a,b,c,d) ICOM_CALL_(CreatePalette,p,(p,a,b,c,d)) -#define IDirectDraw4_CreateSurface(p,a,b,c) ICOM_CALL_(CreateSurface,p,(p,a,b,c)) -#define IDirectDraw4_DuplicateSurface(p,a,b) ICOM_CALL_(DuplicateSurface,p,(p,a,b)) -#define IDirectDraw4_EnumDisplayModes(p,a,b,c,d) ICOM_CALL_(EnumDisplayModes,p,(p,a,b,c,d)) -#define IDirectDraw4_EnumSurfaces(p,a,b,c,d) ICOM_CALL_(EnumSurfaces,p,(p,a,b,c,d)) -#define IDirectDraw4_FlipToGDISurface(p) ICOM_CALL_(FlipToGDISurface,p,(p)) -#define IDirectDraw4_GetCaps(p,a,b) ICOM_CALL_(GetCaps,p,(p,a,b)) -#define IDirectDraw4_GetDisplayMode(p,a) ICOM_CALL_(GetDisplayMode,p,(p,a)) -#define IDirectDraw4_GetFourCCCodes(p,a,b) ICOM_CALL_(GetFourCCCodes,p,(p,a,b)) -#define IDirectDraw4_GetGDISurface(p,a) ICOM_CALL_(GetGDISurface,p,(p,a)) -#define IDirectDraw4_GetMonitorFrequency(p,a) ICOM_CALL_(GetMonitorFrequency,p,(p,a)) -#define IDirectDraw4_GetScanLine(p,a) ICOM_CALL_(GetScanLine,p,(p,a)) -#define IDirectDraw4_GetVerticalBlankStatus(p,a) ICOM_CALL_(GetVerticalBlankStatus,p,(p,a)) -#define IDirectDraw4_Initialize(p,a) ICOM_CALL_(Initialize,p,(p,a)) -#define IDirectDraw4_RestoreDisplayMode(p) ICOM_CALL_(RestoreDisplayMode,p,(p)) -#define IDirectDraw4_SetCooperativeLevel(p,a,b) ICOM_CALL_(SetCooperativeLevel,p,(p,a,b)) -#define IDirectDraw4_SetDisplayMode(p,a,b,c,d,e) ICOM_CALL_(SetDisplayMode,p,(p,a,b,c,d,e)) -#define IDirectDraw4_WaitForVerticalBlank(p,a,b) ICOM_CALL_(WaitForVerticalBlank,p,(p,a,b)) -/*** IDirectDraw2 methods ***/ -#define IDirectDraw4_GetAvailableVidMem(p,a,b,c) ICOM_CALL_(GetAvailableVidMem,p,(p,a,b,c)) -/*** IDirectDraw4 methods ***/ -#define IDirectDraw4_GetSurfaceFromDC(p,a,b) ICOM_CALL_(GetSurfaceFromDC,p,(p,a,b)) -#define IDirectDraw4_RestoreAllSurfaces(pc) ICOM_CALL_(RestoreAllSurfaces,p,(p)) -#define IDirectDraw4_TestCooperativeLevel(p) ICOM_CALL_(TestCooperativeLevel,p,(p)) -#define IDirectDraw4_GetDeviceIdentifier(p,a,b) ICOM_CALL_(GetDeviceIdentifier,p,(p,a,b)) - - -/***************************************************************************** - * IDirectDraw7 interface - */ -/* Note: IDirectDraw7 cannot derive from IDirectDraw4; it is even documented - * as not interchangeable with earlier DirectDraw interfaces. - */ -#undef INTERFACE -#define INTERFACE IDirectDraw7 -DECLARE_INTERFACE_(IDirectDraw7,IUnknown) -{ - STDMETHOD(QueryInterface)(THIS_ REFIID,LPVOID*) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - STDMETHOD(Compact)(THIS) PURE; - STDMETHOD(CreateClipper)(THIS_ DWORD dwFlags, LPDIRECTDRAWCLIPPER* lplpDDClipper, IUnknown* pUnkOuter) PURE; - STDMETHOD(CreatePalette)(THIS_ DWORD dwFlags, LPPALETTEENTRY lpColorTable, LPDIRECTDRAWPALETTE* lplpDDPalette, IUnknown* pUnkOuter) PURE; - STDMETHOD(CreateSurface)(THIS_ LPDDSURFACEDESC2 lpDDSurfaceDesc, LPDIRECTDRAWSURFACE7* lplpDDSurface, IUnknown* pUnkOuter) PURE; - STDMETHOD(DuplicateSurface)(THIS_ LPDIRECTDRAWSURFACE7 lpDDSurface, LPDIRECTDRAWSURFACE7* lplpDupDDSurface) PURE; - STDMETHOD(EnumDisplayModes)(THIS_ DWORD dwFlags, LPDDSURFACEDESC2 lpDDSurfaceDesc, LPVOID lpContext, LPDDENUMMODESCALLBACK2 lpEnumModesCallback) PURE; - STDMETHOD(EnumSurfaces)(THIS_ DWORD dwFlags, LPDDSURFACEDESC2 lpDDSD, LPVOID lpContext, LPDDENUMSURFACESCALLBACK7 lpEnumSurfacesCallback) PURE; - STDMETHOD(FlipToGDISurface)(THIS) PURE; - STDMETHOD(GetCaps)(THIS_ LPDDCAPS lpDDDriverCaps, LPDDCAPS lpDDHELCaps) PURE; - STDMETHOD(GetDisplayMode)(THIS_ LPDDSURFACEDESC2 lpDDSurfaceDesc) PURE; - STDMETHOD(GetFourCCCodes)(THIS_ LPDWORD lpNumCodes, LPDWORD lpCodes) PURE; - STDMETHOD(GetGDISurface)(THIS_ LPDIRECTDRAWSURFACE7* lplpGDIDDSurface) PURE; - STDMETHOD(GetMonitorFrequency)(THIS_ LPDWORD lpdwFrequency) PURE; - STDMETHOD(GetScanLine)(THIS_ LPDWORD lpdwScanLine) PURE; - STDMETHOD(GetVerticalBlankStatus)(THIS_ BOOL* lpbIsInVB) PURE; - STDMETHOD(Initialize)(THIS_ GUID* lpGUID) PURE; - STDMETHOD(RestoreDisplayMode)(THIS) PURE; - STDMETHOD(SetCooperativeLevel)(THIS_ HWND hWnd, DWORD dwFlags) PURE; - STDMETHOD(SetDisplayMode)(THIS_ DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwRefreshRate, DWORD dwFlags) PURE; - STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD dwFlags, HANDLE hEvent) PURE; - - STDMETHOD(GetAvailableVidMem)(THIS_ LPDDSCAPS2 lpDDCaps, LPDWORD lpdwTotal, LPDWORD lpdwFree) PURE; - - STDMETHOD(GetSurfaceFromDC)(THIS_ HDC , LPDIRECTDRAWSURFACE7* ) PURE; - STDMETHOD(RestoreAllSurfaces)(THIS) PURE; - STDMETHOD(TestCooperativeLevel)(THIS) PURE; - STDMETHOD(GetDeviceIdentifier)(THIS_ LPDDDEVICEIDENTIFIER2 , DWORD ) PURE; - - STDMETHOD(StartModeTest)(THIS_ LPSIZE , DWORD , DWORD ) PURE; - STDMETHOD(EvaluateMode)(THIS_ DWORD , DWORD * ) PURE; -}; - - /*** IUnknown methods ***/ -#define IDirectDraw7_QueryInterface(p,a,b) ICOM_CALL_(QueryInterface,p,(p,a,b)) -#define IDirectDraw7_AddRef(p) ICOM_CALL_(AddRef,p,(p)) -#define IDirectDraw7_Release(p) ICOM_CALL_(Release,p,(p)) - /*** IDirectDraw methods ***/ -#define IDirectDraw7_Compact(p) ICOM_CALL_(Compact,p,(p)) -#define IDirectDraw7_CreateClipper(p,a,b,c) ICOM_CALL_(CreateClipper,p,(p,a,b,c)) -#define IDirectDraw7_CreatePalette(p,a,b,c,d) ICOM_CALL_(CreatePalette,p,(p,a,b,c,d)) -#define IDirectDraw7_CreateSurface(p,a,b,c) ICOM_CALL_(CreateSurface,p,(p,a,b,c)) -#define IDirectDraw7_DuplicateSurface(p,a,b) ICOM_CALL_(DuplicateSurface,p,(p,a,b)) -#define IDirectDraw7_EnumDisplayModes(p,a,b,c,d) ICOM_CALL_(EnumDisplayModes,p,(p,a,b,c,d)) -#define IDirectDraw7_EnumSurfaces(p,a,b,c,d) ICOM_CALL_(EnumSurfaces,p,(p,a,b,c,d)) -#define IDirectDraw7_FlipToGDISurface(p) ICOM_CALL_(FlipToGDISurface,p,(p)) -#define IDirectDraw7_GetCaps(p,a,b) ICOM_CALL_(GetCaps,p,(p,a,b)) -#define IDirectDraw7_GetDisplayMode(p,a) ICOM_CALL_(GetDisplayMode,p,(p,a)) -#define IDirectDraw7_GetFourCCCodes(p,a,b) ICOM_CALL_(GetFourCCCodes,p,(p,a,b)) -#define IDirectDraw7_GetGDISurface(p,a) ICOM_CALL_(GetGDISurface,p,(p,a)) -#define IDirectDraw7_GetMonitorFrequency(p,a) ICOM_CALL_(GetMonitorFrequency,p,(p,a)) -#define IDirectDraw7_GetScanLine(p,a) ICOM_CALL_(GetScanLine,p,(p,a)) -#define IDirectDraw7_GetVerticalBlankStatus(p,a) ICOM_CALL_(GetVerticalBlankStatus,p,(p,a)) -#define IDirectDraw7_Initialize(p,a) ICOM_CALL_(Initialize,p,(p,a)) -#define IDirectDraw7_RestoreDisplayMode(p) ICOM_CALL_(RestoreDisplayMode,p,(p)) -#define IDirectDraw7_SetCooperativeLevel(p,a,b) ICOM_CALL_(SetCooperativeLevel,p,(p,a,b)) -#define IDirectDraw7_SetDisplayMode(p,a,b,c,d,e) ICOM_CALL_(SetDisplayMode,p,(p,a,b,c,d,e)) -#define IDirectDraw7_WaitForVerticalBlank(p,a,b) ICOM_CALL_(WaitForVerticalBlank,p,(p,a,b)) -/*** added in IDirectDraw2 ***/ -#define IDirectDraw7_GetAvailableVidMem(p,a,b,c) ICOM_CALL_(GetAvailableVidMem,p,(p,a,b,c)) -/*** added in IDirectDraw4 ***/ -#define IDirectDraw7_GetSurfaceFromDC(p,a,b) ICOM_CALL_(GetSurfaceFromDC,p,(p,a,b)) -#define IDirectDraw7_RestoreAllSurfaces(p) ICOM_CALL_(RestoreAllSurfaces,p,(p)) -#define IDirectDraw7_TestCooperativeLevel(p) ICOM_CALL_(TestCooperativeLevel,p,(p)) -#define IDirectDraw7_GetDeviceIdentifier(p,a,b) ICOM_CALL_(GetDeviceIdentifier,p,(p,a,b)) -/*** added in IDirectDraw 7 ***/ -#define IDirectDraw7_StartModeTest(p,a,b,c) ICOM_CALL_(StartModeTest,p,(p,a,b,c)) -#define IDirectDraw7_EvaluateMode(p,a,b) ICOM_CALL_(EvaluateMode,p,(p,a,b)) - - -/***************************************************************************** - * IDirectDrawSurface interface - */ -#undef INTERFACE -#define INTERFACE IDirectDrawSurface -DECLARE_INTERFACE_(IDirectDrawSurface,IUnknown) -{ - STDMETHOD(QueryInterface)(THIS_ REFIID,LPVOID*) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE lpDDSAttachedSurface) PURE; - STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT lpRect) PURE; - STDMETHOD(Blt)(THIS_ LPRECT lpDestRect, LPDIRECTDRAWSURFACE lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwFlags, LPDDBLTFX lpDDBltFx) PURE; - STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH lpDDBltBatch, DWORD dwCount, DWORD dwFlags) PURE; - STDMETHOD(BltFast)(THIS_ DWORD dwX, DWORD dwY, LPDIRECTDRAWSURFACE lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwTrans) PURE; - STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD dwFlags, LPDIRECTDRAWSURFACE lpDDSAttachedSurface) PURE; - STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpEnumSurfacesCallback) PURE; - STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD dwFlags, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpfnCallback) PURE; - STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE lpDDSurfaceTargetOverride, DWORD dwFlags) PURE; - STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS lpDDSCaps, LPDIRECTDRAWSURFACE* lplpDDAttachedSurface) PURE; - STDMETHOD(GetBltStatus)(THIS_ DWORD dwFlags) PURE; - STDMETHOD(GetCaps)(THIS_ LPDDSCAPS lpDDSCaps) PURE; - STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER* lplpDDClipper) PURE; - STDMETHOD(GetColorKey)(THIS_ DWORD dwFlags, LPDDCOLORKEY lpDDColorKey) PURE; - STDMETHOD(GetDC)(THIS_ HDC* lphDC) PURE; - STDMETHOD(GetFlipStatus)(THIS_ DWORD dwFlags) PURE; - STDMETHOD(GetOverlayPosition)(THIS_ LPLONG lplX, LPLONG lplY) PURE; - STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE* lplpDDPalette) PURE; - STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT lpDDPixelFormat) PURE; - STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC lpDDSurfaceDesc) PURE; - STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW lpDD, LPDDSURFACEDESC lpDDSurfaceDesc) PURE; - STDMETHOD(IsLost)(THIS) PURE; - STDMETHOD(Lock)(THIS_ LPRECT lpDestRect, LPDDSURFACEDESC lpDDSurfaceDesc, DWORD dwFlags, HANDLE hEvent) PURE; - STDMETHOD(ReleaseDC)(THIS_ HDC hDC) PURE; - STDMETHOD(Restore)(THIS) PURE; - STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER lpDDClipper) PURE; - STDMETHOD(SetColorKey)(THIS_ DWORD dwFlags, LPDDCOLORKEY lpDDColorKey) PURE; - STDMETHOD(SetOverlayPosition)(THIS_ LONG lX, LONG lY) PURE; - STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE lpDDPalette) PURE; - STDMETHOD(Unlock)(THIS_ LPVOID lpSurfaceData) PURE; - STDMETHOD(UpdateOverlay)(THIS_ LPRECT lpSrcRect, LPDIRECTDRAWSURFACE lpDDDestSurface, LPRECT lpDestRect, DWORD dwFlags, LPDDOVERLAYFX lpDDOverlayFx) PURE; - STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD dwFlags) PURE; - STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD dwFlags, LPDIRECTDRAWSURFACE lpDDSReference) PURE; -}; - - /*** IUnknown methods ***/ -#define IDirectDrawSurface_QueryInterface(p,a,b) ICOM_CALL_(QueryInterface,p,(p,a,b)) -#define IDirectDrawSurface_AddRef(p) ICOM_CALL_(AddRef,p,(p)) -#define IDirectDrawSurface_Release(p) ICOM_CALL_(Release,p,(p)) - /*** IDirectDrawSurface methods ***/ -#define IDirectDrawSurface_AddAttachedSurface(p,a) ICOM_CALL_(AddAttachedSurface,p,(p,a)) -#define IDirectDrawSurface_AddOverlayDirtyRect(p,a) ICOM_CALL_(AddOverlayDirtyRect,p,(p,a)) -#define IDirectDrawSurface_Blt(p,a,b,c,d,e) ICOM_CALL_(Blt,p,(p,a,b,c,d,e)) -#define IDirectDrawSurface_BltBatch(p,a,b,c) ICOM_CALL_(BltBatch,p,(p,a,b,c)) -#define IDirectDrawSurface_BltFast(p,a,b,c,d,e) ICOM_CALL_(BltFast,p,(p,a,b,c,d,e)) -#define IDirectDrawSurface_DeleteAttachedSurface(p,a,b) ICOM_CALL_(DeleteAttachedSurface,p,(p,a,b)) -#define IDirectDrawSurface_EnumAttachedSurfaces(p,a,b) ICOM_CALL_(EnumAttachedSurfaces,p,(p,a,b)) -#define IDirectDrawSurface_EnumOverlayZOrders(p,a,b,c) ICOM_CALL_(EnumOverlayZOrders,p,(p,a,b,c)) -#define IDirectDrawSurface_Flip(p,a,b) ICOM_CALL_(Flip,p,(p,a,b)) -#define IDirectDrawSurface_GetAttachedSurface(p,a,b) ICOM_CALL_(GetAttachedSurface,p,(p,a,b)) -#define IDirectDrawSurface_GetBltStatus(p,a) ICOM_CALL_(GetBltStatus,p,(p,a)) -#define IDirectDrawSurface_GetCaps(p,a) ICOM_CALL_(GetCaps,p,(p,a)) -#define IDirectDrawSurface_GetClipper(p,a) ICOM_CALL_(GetClipper,p,(p,a)) -#define IDirectDrawSurface_GetColorKey(p,a,b) ICOM_CALL_(GetColorKey,p,(p,a,b)) -#define IDirectDrawSurface_GetDC(p,a) ICOM_CALL_(GetDC,p,(p,a)) -#define IDirectDrawSurface_GetFlipStatus(p,a) ICOM_CALL_(GetFlipStatus,p,(p,a)) -#define IDirectDrawSurface_GetOverlayPosition(p,a,b) ICOM_CALL_(GetOverlayPosition,p,(p,a,b)) -#define IDirectDrawSurface_GetPalette(p,a) ICOM_CALL_(GetPalette,p,(p,a)) -#define IDirectDrawSurface_GetPixelFormat(p,a) ICOM_CALL_(GetPixelFormat,p,(p,a)) -#define IDirectDrawSurface_GetSurfaceDesc(p,a) ICOM_CALL_(GetSurfaceDesc,p,(p,a)) -#define IDirectDrawSurface_Initialize(p,a,b) ICOM_CALL_(Initialize,p,(p,a,b)) -#define IDirectDrawSurface_IsLost(p) ICOM_CALL_(IsLost,p,(p)) -#define IDirectDrawSurface_Lock(p,a,b,c,d) ICOM_CALL_(Lock,p,(p,a,b,c,d)) -#define IDirectDrawSurface_ReleaseDC(p,a) ICOM_CALL_(ReleaseDC,p,(p,a)) -#define IDirectDrawSurface_Restore(p) ICOM_CALL_(Restore,p,(p)) -#define IDirectDrawSurface_SetClipper(p,a) ICOM_CALL_(SetClipper,p,(p,a)) -#define IDirectDrawSurface_SetColorKey(p,a,b) ICOM_CALL_(SetColorKey,p,(p,a,b)) -#define IDirectDrawSurface_SetOverlayPosition(p,a,b) ICOM_CALL_(SetOverlayPosition,p,(p,a,b)) -#define IDirectDrawSurface_SetPalette(p,a) ICOM_CALL_(SetPalette,p,(p,a)) -#define IDirectDrawSurface_Unlock(p,a) ICOM_CALL_(Unlock,p,(p,a)) -#define IDirectDrawSurface_UpdateOverlay(p,a,b,c,d,e) ICOM_CALL_(UpdateOverlay,p,(p,a,b,c,d,e)) -#define IDirectDrawSurface_UpdateOverlayDisplay(p,a) ICOM_CALL_(UpdateOverlayDisplay,p,(p,a)) -#define IDirectDrawSurface_UpdateOverlayZOrder(p,a,b) ICOM_CALL_(UpdateOverlayZOrder,p,(p,a,b)) - - -/***************************************************************************** - * IDirectDrawSurface2 interface - */ -/* Cannot inherit from IDirectDrawSurface because the LPDIRECTDRAWSURFACE parameters - * have been converted to LPDIRECTDRAWSURFACE2. - */ -#undef INTERFACE -#define INTERFACE IDirectDrawSurface2 -DECLARE_INTERFACE_(IDirectDrawSurface2,IUnknown) -{ - STDMETHOD(QueryInterface)(THIS_ REFIID,LPVOID*) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE2 lpDDSAttachedSurface) PURE; - STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT lpRect) PURE; - STDMETHOD(Blt)(THIS_ LPRECT lpDestRect, LPDIRECTDRAWSURFACE2 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwFlags, LPDDBLTFX lpDDBltFx) PURE; - STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH lpDDBltBatch, DWORD dwCount, DWORD dwFlags) PURE; - STDMETHOD(BltFast)(THIS_ DWORD dwX, DWORD dwY, LPDIRECTDRAWSURFACE2 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwTrans) PURE; - STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD dwFlags, LPDIRECTDRAWSURFACE2 lpDDSAttachedSurface) PURE; - STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpEnumSurfacesCallback) PURE; - STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD dwFlags, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpfnCallback) PURE; - STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE2 lpDDSurfaceTargetOverride, DWORD dwFlags) PURE; - STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS lpDDSCaps, LPDIRECTDRAWSURFACE2* lplpDDAttachedSurface) PURE; - STDMETHOD(GetBltStatus)(THIS_ DWORD dwFlags) PURE; - STDMETHOD(GetCaps)(THIS_ LPDDSCAPS lpDDSCaps) PURE; - STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER* lplpDDClipper) PURE; - STDMETHOD(GetColorKey)(THIS_ DWORD dwFlags, LPDDCOLORKEY lpDDColorKey) PURE; - STDMETHOD(GetDC)(THIS_ HDC* lphDC) PURE; - STDMETHOD(GetFlipStatus)(THIS_ DWORD dwFlags) PURE; - STDMETHOD(GetOverlayPosition)(THIS_ LPLONG lplX, LPLONG lplY) PURE; - STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE* lplpDDPalette) PURE; - STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT lpDDPixelFormat) PURE; - STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC lpDDSurfaceDesc) PURE; - STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW lpDD, LPDDSURFACEDESC lpDDSurfaceDesc) PURE; - STDMETHOD(IsLost)(THIS) PURE; - STDMETHOD(Lock)(THIS_ LPRECT lpDestRect, LPDDSURFACEDESC lpDDSurfaceDesc, DWORD dwFlags, HANDLE hEvent) PURE; - STDMETHOD(ReleaseDC)(THIS_ HDC hDC) PURE; - STDMETHOD(Restore)(THIS) PURE; - STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER lpDDClipper) PURE; - STDMETHOD(SetColorKey)(THIS_ DWORD dwFlags, LPDDCOLORKEY lpDDColorKey) PURE; - STDMETHOD(SetOverlayPosition)(THIS_ LONG lX, LONG lY) PURE; - STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE lpDDPalette) PURE; - STDMETHOD(Unlock)(THIS_ LPVOID lpSurfaceData) PURE; - STDMETHOD(UpdateOverlay)(THIS_ LPRECT lpSrcRect, LPDIRECTDRAWSURFACE2 lpDDDestSurface, LPRECT lpDestRect, DWORD dwFlags, LPDDOVERLAYFX lpDDOverlayFx) PURE; - STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD dwFlags) PURE; - STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD dwFlags, LPDIRECTDRAWSURFACE2 lpDDSReference) PURE; - /* added in v2 */ - STDMETHOD(GetDDInterface)(THIS_ LPVOID* lplpDD) PURE; - STDMETHOD(PageLock)(THIS_ DWORD dwFlags) PURE; - STDMETHOD(PageUnlock)(THIS_ DWORD dwFlags) PURE; -}; - - /*** IUnknown methods ***/ -#define IDirectDrawSurface2_QueryInterface(p,a,b) ICOM_CALL_(QueryInterface,p,(p,a,b)) -#define IDirectDrawSurface2_AddRef(p) ICOM_CALL_(AddRef,p,(p)) -#define IDirectDrawSurface2_Release(p) ICOM_CALL_(Release,p,(p)) -/*** IDirectDrawSurface methods (almost) ***/ -#define IDirectDrawSurface2_AddAttachedSurface(p,a) ICOM_CALL_(AddAttachedSurface,p,(p,a)) -#define IDirectDrawSurface2_AddOverlayDirtyRect(p,a) ICOM_CALL_(AddOverlayDirtyRect,p,(p,a)) -#define IDirectDrawSurface2_Blt(p,a,b,c,d,e) ICOM_CALL_(Blt,p,(p,a,b,c,d,e)) -#define IDirectDrawSurface2_BltBatch(p,a,b,c) ICOM_CALL_(BltBatch,p,(p,a,b,c)) -#define IDirectDrawSurface2_BltFast(p,a,b,c,d,e) ICOM_CALL_(BltFast,p,(p,a,b,c,d,e)) -#define IDirectDrawSurface2_DeleteAttachedSurface(p,a,b) ICOM_CALL_(DeleteAttachedSurface,p,(p,a,b)) -#define IDirectDrawSurface2_EnumAttachedSurfaces(p,a,b) ICOM_CALL_(EnumAttachedSurfaces,p,(p,a,b)) -#define IDirectDrawSurface2_EnumOverlayZOrders(p,a,b,c) ICOM_CALL_(EnumOverlayZOrders,p,(p,a,b,c)) -#define IDirectDrawSurface2_Flip(p,a,b) ICOM_CALL_(Flip,p,(p,a,b)) -#define IDirectDrawSurface2_GetAttachedSurface(p,a,b) ICOM_CALL_(GetAttachedSurface,p,(p,a,b)) -#define IDirectDrawSurface2_GetBltStatus(p,a) ICOM_CALL_(GetBltStatus,p,(p,a)) -#define IDirectDrawSurface2_GetCaps(p,a) ICOM_CALL_(GetCaps,p,(p,a)) -#define IDirectDrawSurface2_GetClipper(p,a) ICOM_CALL_(GetClipper,p,(p,a)) -#define IDirectDrawSurface2_GetColorKey(p,a,b) ICOM_CALL_(GetColorKey,p,(p,a,b)) -#define IDirectDrawSurface2_GetDC(p,a) ICOM_CALL_(GetDC,p,(p,a)) -#define IDirectDrawSurface2_GetFlipStatus(p,a) ICOM_CALL_(GetFlipStatus,p,(p,a)) -#define IDirectDrawSurface2_GetOverlayPosition(p,a,b) ICOM_CALL_(GetOverlayPosition,p,(p,a,b)) -#define IDirectDrawSurface2_GetPalette(p,a) ICOM_CALL_(GetPalette,p,(p,a)) -#define IDirectDrawSurface2_GetPixelFormat(p,a) ICOM_CALL_(GetPixelFormat,p,(p,a)) -#define IDirectDrawSurface2_GetSurfaceDesc(p,a) ICOM_CALL_(GetSurfaceDesc,p,(p,a)) -#define IDirectDrawSurface2_Initialize(p,a,b) ICOM_CALL_(Initialize,p,(p,a,b)) -#define IDirectDrawSurface2_IsLost(p) ICOM_CALL_(IsLost,p,(p)) -#define IDirectDrawSurface2_Lock(p,a,b,c,d) ICOM_CALL_(Lock,p,(p,a,b,c,d)) -#define IDirectDrawSurface2_ReleaseDC(p,a) ICOM_CALL_(ReleaseDC,p,(p,a)) -#define IDirectDrawSurface2_Restore(p) ICOM_CALL_(Restore,p,(p)) -#define IDirectDrawSurface2_SetClipper(p,a) ICOM_CALL_(SetClipper,p,(p,a)) -#define IDirectDrawSurface2_SetColorKey(p,a,b) ICOM_CALL_(SetColorKey,p,(p,a,b)) -#define IDirectDrawSurface2_SetOverlayPosition(p,a,b) ICOM_CALL_(SetOverlayPosition,p,(p,a,b)) -#define IDirectDrawSurface2_SetPalette(p,a) ICOM_CALL_(SetPalette,p,(p,a)) -#define IDirectDrawSurface2_Unlock(p,a) ICOM_CALL_(Unlock,p,(p,a)) -#define IDirectDrawSurface2_UpdateOverlay(p,a,b,c,d,e) ICOM_CALL_(UpdateOverlay,p,(p,a,b,c,d,e)) -#define IDirectDrawSurface2_UpdateOverlayDisplay(p,a) ICOM_CALL_(UpdateOverlayDisplay,p,(p,a)) -#define IDirectDrawSurface2_UpdateOverlayZOrder(p,a,b) ICOM_CALL_(UpdateOverlayZOrder,p,(p,a,b)) -/*** IDirectDrawSurface2 methods ***/ -#define IDirectDrawSurface2_GetDDInterface(p,a) ICOM_CALL_(GetDDInterface,p,(p,a)) -#define IDirectDrawSurface2_PageLock(p,a) ICOM_CALL_(PageLock,p,(p,a)) -#define IDirectDrawSurface2_PageUnlock(p,a) ICOM_CALL_(PageUnlock,p,(p,a)) - - -/***************************************************************************** - * IDirectDrawSurface3 interface - */ -/* Cannot inherit from IDirectDrawSurface2 because the LPDIRECTDRAWSURFACE2 parameters - * have been converted to LPDIRECTDRAWSURFACE3. - */ -#undef INTERFACE -#define INTERFACE IDirectDrawSurface3 -DECLARE_INTERFACE_(IDirectDrawSurface3,IUnknown) -{ - STDMETHOD(QueryInterface)(THIS_ REFIID,LPVOID*) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE3 lpDDSAttachedSurface) PURE; - STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT lpRect) PURE; - STDMETHOD(Blt)(THIS_ LPRECT lpDestRect, LPDIRECTDRAWSURFACE3 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwFlags, LPDDBLTFX lpDDBltFx) PURE; - STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH lpDDBltBatch, DWORD dwCount, DWORD dwFlags) PURE; - STDMETHOD(BltFast)(THIS_ DWORD dwX, DWORD dwY, LPDIRECTDRAWSURFACE3 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwTrans) PURE; - STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD dwFlags, LPDIRECTDRAWSURFACE3 lpDDSAttachedSurface) PURE; - STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpEnumSurfacesCallback) PURE; - STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD dwFlags, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpfnCallback) PURE; - STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE3 lpDDSurfaceTargetOverride, DWORD dwFlags) PURE; - STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS lpDDSCaps, LPDIRECTDRAWSURFACE3* lplpDDAttachedSurface) PURE; - STDMETHOD(GetBltStatus)(THIS_ DWORD dwFlags) PURE; - STDMETHOD(GetCaps)(THIS_ LPDDSCAPS lpDDSCaps) PURE; - STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER* lplpDDClipper) PURE; - STDMETHOD(GetColorKey)(THIS_ DWORD dwFlags, LPDDCOLORKEY lpDDColorKey) PURE; - STDMETHOD(GetDC)(THIS_ HDC* lphDC) PURE; - STDMETHOD(GetFlipStatus)(THIS_ DWORD dwFlags) PURE; - STDMETHOD(GetOverlayPosition)(THIS_ LPLONG lplX, LPLONG lplY) PURE; - STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE* lplpDDPalette) PURE; - STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT lpDDPixelFormat) PURE; - STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC lpDDSurfaceDesc) PURE; - STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW lpDD, LPDDSURFACEDESC lpDDSurfaceDesc) PURE; - STDMETHOD(IsLost)(THIS) PURE; - STDMETHOD(Lock)(THIS_ LPRECT lpDestRect, LPDDSURFACEDESC lpDDSurfaceDesc, DWORD dwFlags, HANDLE hEvent) PURE; - STDMETHOD(ReleaseDC)(THIS_ HDC hDC) PURE; - STDMETHOD(Restore)(THIS) PURE; - STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER lpDDClipper) PURE; - STDMETHOD(SetColorKey)(THIS_ DWORD dwFlags, LPDDCOLORKEY lpDDColorKey) PURE; - STDMETHOD(SetOverlayPosition)(THIS_ LONG lX, LONG lY) PURE; - STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE lpDDPalette) PURE; - STDMETHOD(Unlock)(THIS_ LPVOID lpSurfaceData) PURE; - STDMETHOD(UpdateOverlay)(THIS_ LPRECT lpSrcRect, LPDIRECTDRAWSURFACE3 lpDDDestSurface, LPRECT lpDestRect, DWORD dwFlags, LPDDOVERLAYFX lpDDOverlayFx) PURE; - STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD dwFlags) PURE; - STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD dwFlags, LPDIRECTDRAWSURFACE3 lpDDSReference) PURE; - /* added in v2 */ - STDMETHOD(GetDDInterface)(THIS_ LPVOID* lplpDD) PURE; - STDMETHOD(PageLock)(THIS_ DWORD dwFlags) PURE; - STDMETHOD(PageUnlock)(THIS_ DWORD dwFlags) PURE; - /* added in v3 */ - STDMETHOD(SetSurfaceDesc)(THIS_ LPDDSURFACEDESC lpDDSD, DWORD dwFlags) PURE; -}; - - /*** IUnknown methods ***/ -#define IDirectDrawSurface3_QueryInterface(p,a,b) ICOM_CALL_(QueryInterface,p,(p,a,b)) -#define IDirectDrawSurface3_AddRef(p) ICOM_CALL_(AddRef,p,(p)) -#define IDirectDrawSurface3_Release(p) ICOM_CALL_(Release,p,(p)) -/*** IDirectDrawSurface methods (almost) ***/ -#define IDirectDrawSurface3_AddAttachedSurface(p,a) ICOM_CALL_(AddAttachedSurface,p,(p,a)) -#define IDirectDrawSurface3_AddOverlayDirtyRect(p,a) ICOM_CALL_(AddOverlayDirtyRect,p,(p,a)) -#define IDirectDrawSurface3_Blt(p,a,b,c,d,e) ICOM_CALL_(Blt,p,(p,a,b,c,d,e)) -#define IDirectDrawSurface3_BltBatch(p,a,b,c) ICOM_CALL_(BltBatch,p,(p,a,b,c)) -#define IDirectDrawSurface3_BltFast(p,a,b,c,d,e) ICOM_CALL_(BltFast,p,(p,a,b,c,d,e)) -#define IDirectDrawSurface3_DeleteAttachedSurface(p,a,b) ICOM_CALL_(DeleteAttachedSurface,p,(p,a,b)) -#define IDirectDrawSurface3_EnumAttachedSurfaces(p,a,b) ICOM_CALL_(EnumAttachedSurfaces,p,(p,a,b)) -#define IDirectDrawSurface3_EnumOverlayZOrders(p,a,b,c) ICOM_CALL_(EnumOverlayZOrders,p,(p,a,b,c)) -#define IDirectDrawSurface3_Flip(p,a,b) ICOM_CALL_(Flip,p,(p,a,b)) -#define IDirectDrawSurface3_GetAttachedSurface(p,a,b) ICOM_CALL_(GetAttachedSurface,p,(p,a,b)) -#define IDirectDrawSurface3_GetBltStatus(p,a) ICOM_CALL_(GetBltStatus,p,(p,a)) -#define IDirectDrawSurface3_GetCaps(p,a) ICOM_CALL_(GetCaps,p,(p,a)) -#define IDirectDrawSurface3_GetClipper(p,a) ICOM_CALL_(GetClipper,p,(p,a)) -#define IDirectDrawSurface3_GetColorKey(p,a,b) ICOM_CALL_(GetColorKey,p,(p,a,b)) -#define IDirectDrawSurface3_GetDC(p,a) ICOM_CALL_(GetDC,p,(p,a)) -#define IDirectDrawSurface3_GetFlipStatus(p,a) ICOM_CALL_(GetFlipStatus,p,(p,a)) -#define IDirectDrawSurface3_GetOverlayPosition(p,a,b) ICOM_CALL_(GetOverlayPosition,p,(p,a,b)) -#define IDirectDrawSurface3_GetPalette(p,a) ICOM_CALL_(GetPalette,p,(p,a)) -#define IDirectDrawSurface3_GetPixelFormat(p,a) ICOM_CALL_(GetPixelFormat,p,(p,a)) -#define IDirectDrawSurface3_GetSurfaceDesc(p,a) ICOM_CALL_(GetSurfaceDesc,p,(p,a)) -#define IDirectDrawSurface3_Initialize(p,a,b) ICOM_CALL_(Initialize,p,(p,a,b)) -#define IDirectDrawSurface3_IsLost(p) ICOM_CALL_(IsLost,p,(p)) -#define IDirectDrawSurface3_Lock(p,a,b,c,d) ICOM_CALL_(Lock,p,(p,a,b,c,d)) -#define IDirectDrawSurface3_ReleaseDC(p,a) ICOM_CALL_(ReleaseDC,p,(p,a)) -#define IDirectDrawSurface3_Restore(p) ICOM_CALL_(Restore,p,(p)) -#define IDirectDrawSurface3_SetClipper(p,a) ICOM_CALL_(SetClipper,p,(p,a)) -#define IDirectDrawSurface3_SetColorKey(p,a,b) ICOM_CALL_(SetColorKey,p,(p,a,b)) -#define IDirectDrawSurface3_SetOverlayPosition(p,a,b) ICOM_CALL_(SetOverlayPosition,p,(p,a,b)) -#define IDirectDrawSurface3_SetPalette(p,a) ICOM_CALL_(SetPalette,p,(p,a)) -#define IDirectDrawSurface3_Unlock(p,a) ICOM_CALL_(Unlock,p,(p,a)) -#define IDirectDrawSurface3_UpdateOverlay(p,a,b,c,d,e) ICOM_CALL_(UpdateOverlay,p,(p,a,b,c,d,e)) -#define IDirectDrawSurface3_UpdateOverlayDisplay(p,a) ICOM_CALL_(UpdateOverlayDisplay,p,(p,a)) -#define IDirectDrawSurface3_UpdateOverlayZOrder(p,a,b) ICOM_CALL_(UpdateOverlayZOrder,p,(p,a,b)) -/*** IDirectDrawSurface2 methods ***/ -#define IDirectDrawSurface3_GetDDInterface(p,a) ICOM_CALL_(GetDDInterface,p,(p,a)) -#define IDirectDrawSurface3_PageLock(p,a) ICOM_CALL_(PageLock,p,(p,a)) -#define IDirectDrawSurface3_PageUnlock(p,a) ICOM_CALL_(PageUnlock,p,(p,a)) -/*** IDirectDrawSurface3 methods ***/ -#define IDirectDrawSurface3_SetSurfaceDesc(p,a,b) ICOM_CALL_(SetSurfaceDesc,p,(p,a,b)) - - -/***************************************************************************** - * IDirectDrawSurface4 interface - */ -/* Cannot inherit from IDirectDrawSurface2 because DDSCAPS changed to DDSCAPS2. - */ -#undef INTERFACE -#define INTERFACE IDirectDrawSurface4 -DECLARE_INTERFACE_(IDirectDrawSurface4,IUnknown) -{ - STDMETHOD(QueryInterface)(THIS_ REFIID,LPVOID*) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE4 lpDDSAttachedSurface) PURE; - STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT lpRect) PURE; - STDMETHOD(Blt)(THIS_ LPRECT lpDestRect, LPDIRECTDRAWSURFACE4 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwFlags, LPDDBLTFX lpDDBltFx) PURE; - STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH lpDDBltBatch, DWORD dwCount, DWORD dwFlags) PURE; - STDMETHOD(BltFast)(THIS_ DWORD dwX, DWORD dwY, LPDIRECTDRAWSURFACE4 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwTrans) PURE; - STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD dwFlags, LPDIRECTDRAWSURFACE4 lpDDSAttachedSurface) PURE; - STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpEnumSurfacesCallback) PURE; - STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD dwFlags, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpfnCallback) PURE; - STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE4 lpDDSurfaceTargetOverride, DWORD dwFlags) PURE; - STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS2 lpDDSCaps, LPDIRECTDRAWSURFACE4* lplpDDAttachedSurface) PURE; - STDMETHOD(GetBltStatus)(THIS_ DWORD dwFlags) PURE; - STDMETHOD(GetCaps)(THIS_ LPDDSCAPS2 lpDDSCaps) PURE; - STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER* lplpDDClipper) PURE; - STDMETHOD(GetColorKey)(THIS_ DWORD dwFlags, LPDDCOLORKEY lpDDColorKey) PURE; - STDMETHOD(GetDC)(THIS_ HDC* lphDC) PURE; - STDMETHOD(GetFlipStatus)(THIS_ DWORD dwFlags) PURE; - STDMETHOD(GetOverlayPosition)(THIS_ LPLONG lplX, LPLONG lplY) PURE; - STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE* lplpDDPalette) PURE; - STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT lpDDPixelFormat) PURE; - STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC lpDDSurfaceDesc) PURE; - STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW lpDD, LPDDSURFACEDESC lpDDSurfaceDesc) PURE; - STDMETHOD(IsLost)(THIS) PURE; - STDMETHOD(Lock)(THIS_ LPRECT lpDestRect, LPDDSURFACEDESC lpDDSurfaceDesc, DWORD dwFlags, HANDLE hEvent) PURE; - STDMETHOD(ReleaseDC)(THIS_ HDC hDC) PURE; - STDMETHOD(Restore)(THIS) PURE; - STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER lpDDClipper) PURE; - STDMETHOD(SetColorKey)(THIS_ DWORD dwFlags, LPDDCOLORKEY lpDDColorKey) PURE; - STDMETHOD(SetOverlayPosition)(THIS_ LONG lX, LONG lY) PURE; - STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE lpDDPalette) PURE; - STDMETHOD(Unlock)(THIS_ LPRECT lpSurfaceData) PURE; - STDMETHOD(UpdateOverlay)(THIS_ LPRECT lpSrcRect, LPDIRECTDRAWSURFACE4 lpDDDestSurface, LPRECT lpDestRect, DWORD dwFlags, LPDDOVERLAYFX lpDDOverlayFx) PURE; - STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD dwFlags) PURE; - STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD dwFlags, LPDIRECTDRAWSURFACE4 lpDDSReference) PURE; - /* added in v2 */ - STDMETHOD(GetDDInterface)(THIS_ LPVOID* lplpDD) PURE; - STDMETHOD(PageLock)(THIS_ DWORD dwFlags) PURE; - STDMETHOD(PageUnlock)(THIS_ DWORD dwFlags) PURE; - /* added in v3 */ - STDMETHOD(SetSurfaceDesc)(THIS_ LPDDSURFACEDESC lpDDSD, DWORD dwFlags) PURE; - /* added in v4 */ - STDMETHOD(SetPrivateData)(THIS_ REFGUID , LPVOID , DWORD , DWORD ) PURE; - STDMETHOD(GetPrivateData)(THIS_ REFGUID , LPVOID , LPDWORD ) PURE; - STDMETHOD(FreePrivateData)(THIS_ REFGUID ) PURE; - STDMETHOD(GetUniquenessValue)(THIS_ LPDWORD ) PURE; - STDMETHOD(ChangeUniquenessValue)(THIS) PURE; -}; - - /*** IUnknown methods ***/ -#define IDirectDrawSurface4_QueryInterface(p,a,b) ICOM_CALL_(QueryInterface,p,(p,a,b)) -#define IDirectDrawSurface4_AddRef(p) ICOM_CALL_(AddRef,p,(p)) -#define IDirectDrawSurface4_Release(p) ICOM_CALL_(Release,p,(p)) -/*** IDirectDrawSurface (almost) methods ***/ -#define IDirectDrawSurface4_AddAttachedSurface(p,a) ICOM_CALL_(AddAttachedSurface,p,(p,a)) -#define IDirectDrawSurface4_AddOverlayDirtyRect(p,a) ICOM_CALL_(AddOverlayDirtyRect,p,(p,a)) -#define IDirectDrawSurface4_Blt(p,a,b,c,d,e) ICOM_CALL_(Blt,p,(p,a,b,c,d,e)) -#define IDirectDrawSurface4_BltBatch(p,a,b,c) ICOM_CALL_(BltBatch,p,(p,a,b,c)) -#define IDirectDrawSurface4_BltFast(p,a,b,c,d,e) ICOM_CALL_(BltFast,p,(p,a,b,c,d,e)) -#define IDirectDrawSurface4_DeleteAttachedSurface(p,a,b) ICOM_CALL_(DeleteAttachedSurface,p,(p,a,b)) -#define IDirectDrawSurface4_EnumAttachedSurfaces(p,a,b) ICOM_CALL_(EnumAttachedSurfaces,p,(p,a,b)) -#define IDirectDrawSurface4_EnumOverlayZOrders(p,a,b,c) ICOM_CALL_(EnumOverlayZOrders,p,(p,a,b,c)) -#define IDirectDrawSurface4_Flip(p,a,b) ICOM_CALL_(Flip,p,(p,a,b)) -#define IDirectDrawSurface4_GetAttachedSurface(p,a,b) ICOM_CALL_(GetAttachedSurface,p,(p,a,b)) -#define IDirectDrawSurface4_GetBltStatus(p,a) ICOM_CALL_(GetBltStatus,p,(p,a)) -#define IDirectDrawSurface4_GetCaps(p,a) ICOM_CALL_(GetCaps,p,(p,a)) -#define IDirectDrawSurface4_GetClipper(p,a) ICOM_CALL_(GetClipper,p,(p,a)) -#define IDirectDrawSurface4_GetColorKey(p,a,b) ICOM_CALL_(GetColorKey,p,(p,a,b)) -#define IDirectDrawSurface4_GetDC(p,a) ICOM_CALL_(GetDC,p,(p,a)) -#define IDirectDrawSurface4_GetFlipStatus(p,a) ICOM_CALL_(GetFlipStatus,p,(p,a)) -#define IDirectDrawSurface4_GetOverlayPosition(p,a,b) ICOM_CALL_(GetOverlayPosition,p,(p,a,b)) -#define IDirectDrawSurface4_GetPalette(p,a) ICOM_CALL_(GetPalette,p,(p,a)) -#define IDirectDrawSurface4_GetPixelFormat(p,a) ICOM_CALL_(GetPixelFormat,p,(p,a)) -#define IDirectDrawSurface4_GetSurfaceDesc(p,a) ICOM_CALL_(GetSurfaceDesc,p,(p,a)) -#define IDirectDrawSurface4_Initialize(p,a,b) ICOM_CALL_(Initialize,p,(p,a,b)) -#define IDirectDrawSurface4_IsLost(p) ICOM_CALL_(IsLost,p,(p)) -#define IDirectDrawSurface4_Lock(p,a,b,c,d) ICOM_CALL_(Lock,p,(p,a,b,c,d)) -#define IDirectDrawSurface4_ReleaseDC(p,a) ICOM_CALL_(ReleaseDC,p,(p,a)) -#define IDirectDrawSurface4_Restore(p) ICOM_CALL_(Restore,p,(p)) -#define IDirectDrawSurface4_SetClipper(p,a) ICOM_CALL_(SetClipper,p,(p,a)) -#define IDirectDrawSurface4_SetColorKey(p,a,b) ICOM_CALL_(SetColorKey,p,(p,a,b)) -#define IDirectDrawSurface4_SetOverlayPosition(p,a,b) ICOM_CALL_(SetOverlayPosition,p,(p,a,b)) -#define IDirectDrawSurface4_SetPalette(p,a) ICOM_CALL_(SetPalette,p,(p,a)) -#define IDirectDrawSurface4_Unlock(p,a) ICOM_CALL_(Unlock,p,(p,a)) -#define IDirectDrawSurface4_UpdateOverlay(p,a,b,c,d,e) ICOM_CALL_(UpdateOverlay,p,(p,a,b,c,d,e)) -#define IDirectDrawSurface4_UpdateOverlayDisplay(p,a) ICOM_CALL_(UpdateOverlayDisplay,p,(p,a)) -#define IDirectDrawSurface4_UpdateOverlayZOrder(p,a,b) ICOM_CALL_(UpdateOverlayZOrder,p,(p,a,b)) -/*** IDirectDrawSurface2 methods ***/ -#define IDirectDrawSurface4_GetDDInterface(p,a) ICOM_CALL_(GetDDInterface,p,(p,a)) -#define IDirectDrawSurface4_PageLock(p,a) ICOM_CALL_(PageLock,p,(p,a)) -#define IDirectDrawSurface4_PageUnlock(p,a) ICOM_CALL_(PageUnlock,p,(p,a)) -/*** IDirectDrawSurface3 methods ***/ -#define IDirectDrawSurface4_SetSurfaceDesc(p,a,b) ICOM_CALL_(SetSurfaceDesc,p,(p,a,b)) -/*** IDirectDrawSurface4 methods ***/ -#define IDirectDrawSurface4_SetPrivateData(p,a,b,c,d) ICOM_CALL_(SetPrivateData,p,(p,a,b,c,d)) -#define IDirectDrawSurface4_GetPrivateData(p,a,b,c) ICOM_CALL_(GetPrivateData,p,(p,a,b,c)) -#define IDirectDrawSurface4_FreePrivateData(p,a) ICOM_CALL_(FreePrivateData,p,(p,a)) -#define IDirectDrawSurface4_GetUniquenessValue(p,a) ICOM_CALL_(GetUniquenessValue,p,(p,a)) -#define IDirectDrawSurface4_ChangeUniquenessValue(p) ICOM_CALL_(ChangeUniquenessValue,p,(p)) - - -/***************************************************************************** - * IDirectDrawSurface7 interface - */ -#undef INTERFACE -#define INTERFACE IDirectDrawSurface7 -DECLARE_INTERFACE_(IDirectDrawSurface7,IUnknown) -{ - STDMETHOD(QueryInterface)(THIS_ REFIID,LPVOID*) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE7 lpDDSAttachedSurface) PURE; - STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT lpRect) PURE; - STDMETHOD(Blt)(THIS_ LPRECT lpDestRect, LPDIRECTDRAWSURFACE7 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwFlags, LPDDBLTFX lpDDBltFx) PURE; - STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH lpDDBltBatch, DWORD dwCount, DWORD dwFlags) PURE; - STDMETHOD(BltFast)(THIS_ DWORD dwX, DWORD dwY, LPDIRECTDRAWSURFACE7 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwTrans) PURE; - STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD dwFlags, LPDIRECTDRAWSURFACE7 lpDDSAttachedSurface) PURE; - STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID lpContext, LPDDENUMSURFACESCALLBACK7 lpEnumSurfacesCallback) PURE; - STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD dwFlags, LPVOID lpContext, LPDDENUMSURFACESCALLBACK7 lpfnCallback) PURE; - STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE7 lpDDSurfaceTargetOverride, DWORD dwFlags) PURE; - STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS2 lpDDSCaps, LPDIRECTDRAWSURFACE7* lplpDDAttachedSurface) PURE; - STDMETHOD(GetBltStatus)(THIS_ DWORD dwFlags) PURE; - STDMETHOD(GetCaps)(THIS_ LPDDSCAPS2 lpDDSCaps) PURE; - STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER* lplpDDClipper) PURE; - STDMETHOD(GetColorKey)(THIS_ DWORD dwFlags, LPDDCOLORKEY lpDDColorKey) PURE; - STDMETHOD(GetDC)(THIS_ HDC* lphDC) PURE; - STDMETHOD(GetFlipStatus)(THIS_ DWORD dwFlags) PURE; - STDMETHOD(GetOverlayPosition)(THIS_ LPLONG lplX, LPLONG lplY) PURE; - STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE* lplpDDPalette) PURE; - STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT lpDDPixelFormat) PURE; - STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC2 lpDDSurfaceDesc) PURE; - STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW lpDD, LPDDSURFACEDESC2 lpDDSurfaceDesc) PURE; - STDMETHOD(IsLost)(THIS) PURE; - STDMETHOD(Lock)(THIS_ LPRECT lpDestRect, LPDDSURFACEDESC2 lpDDSurfaceDesc, DWORD dwFlags, HANDLE hEvent) PURE; - STDMETHOD(ReleaseDC)(THIS_ HDC hDC) PURE; - STDMETHOD(Restore)(THIS) PURE; - STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER lpDDClipper) PURE; - STDMETHOD(SetColorKey)(THIS_ DWORD dwFlags, LPDDCOLORKEY lpDDColorKey) PURE; - STDMETHOD(SetOverlayPosition)(THIS_ LONG lX, LONG lY) PURE; - STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE lpDDPalette) PURE; - STDMETHOD(Unlock)(THIS_ LPRECT lpSurfaceData) PURE; - STDMETHOD(UpdateOverlay)(THIS_ LPRECT lpSrcRect, LPDIRECTDRAWSURFACE7 lpDDDestSurface, LPRECT lpDestRect, DWORD dwFlags, LPDDOVERLAYFX lpDDOverlayFx) PURE; - STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD dwFlags) PURE; - STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD dwFlags, LPDIRECTDRAWSURFACE7 lpDDSReference) PURE; - /* added in v2 */ - STDMETHOD(GetDDInterface)(THIS_ LPVOID* lplpDD) PURE; - STDMETHOD(PageLock)(THIS_ DWORD dwFlags) PURE; - STDMETHOD(PageUnlock)(THIS_ DWORD dwFlags) PURE; - /* added in v3 */ - STDMETHOD(SetSurfaceDesc)(THIS_ LPDDSURFACEDESC2 lpDDSD, DWORD dwFlags) PURE; - /* added in v4 */ - STDMETHOD(SetPrivateData)(THIS_ REFGUID , LPVOID , DWORD , DWORD ) PURE; - STDMETHOD(GetPrivateData)(THIS_ REFGUID , LPVOID , LPDWORD ) PURE; - STDMETHOD(FreePrivateData)(THIS_ REFGUID ) PURE; - STDMETHOD(GetUniquenessValue)(THIS_ LPDWORD ) PURE; - STDMETHOD(ChangeUniquenessValue)(THIS) PURE; - /* added in v7 */ - STDMETHOD(SetPriority)(THIS_ DWORD prio) PURE; - STDMETHOD(GetPriority)(THIS_ LPDWORD prio) PURE; - STDMETHOD(SetLOD)(THIS_ DWORD lod) PURE; - STDMETHOD(GetLOD)(THIS_ LPDWORD lod) PURE; -}; - - /*** IUnknown methods ***/ -#define IDirectDrawSurface7_QueryInterface(p,a,b) ICOM_CALL_(QueryInterface,p,(p,a,b)) -#define IDirectDrawSurface7_AddRef(p) ICOM_CALL_(AddRef,p,(p)) -#define IDirectDrawSurface7_Release(p) ICOM_CALL_(Release,p,(p)) -/*** IDirectDrawSurface (almost) methods ***/ -#define IDirectDrawSurface7_AddAttachedSurface(p,a) ICOM_CALL_(AddAttachedSurface,p,(p,a)) -#define IDirectDrawSurface7_AddOverlayDirtyRect(p,a) ICOM_CALL_(AddOverlayDirtyRect,p,(p,a)) -#define IDirectDrawSurface7_Blt(p,a,b,c,d,e) ICOM_CALL_(Blt,p,(p,a,b,c,d,e)) -#define IDirectDrawSurface7_BltBatch(p,a,b,c) ICOM_CALL_(BltBatch,p,(p,a,b,c)) -#define IDirectDrawSurface7_BltFast(p,a,b,c,d,e) ICOM_CALL_(BltFast,p,(p,a,b,c,d,e)) -#define IDirectDrawSurface7_DeleteAttachedSurface(p,a,b) ICOM_CALL_(DeleteAttachedSurface,p,(p,a,b)) -#define IDirectDrawSurface7_EnumAttachedSurfaces(p,a,b) ICOM_CALL_(EnumAttachedSurfaces,p,(p,a,b)) -#define IDirectDrawSurface7_EnumOverlayZOrders(p,a,b,c) ICOM_CALL_(EnumOverlayZOrders,p,(p,a,b,c)) -#define IDirectDrawSurface7_Flip(p,a,b) ICOM_CALL_(Flip,p,(p,a,b)) -#define IDirectDrawSurface7_GetAttachedSurface(p,a,b) ICOM_CALL_(GetAttachedSurface,p,(p,a,b)) -#define IDirectDrawSurface7_GetBltStatus(p,a) ICOM_CALL_(GetBltStatus,p,(p,a)) -#define IDirectDrawSurface7_GetCaps(p,a) ICOM_CALL_(GetCaps,p,(p,a)) -#define IDirectDrawSurface7_GetClipper(p,a) ICOM_CALL_(GetClipper,p,(p,a)) -#define IDirectDrawSurface7_GetColorKey(p,a,b) ICOM_CALL_(GetColorKey,p,(p,a,b)) -#define IDirectDrawSurface7_GetDC(p,a) ICOM_CALL_(GetDC,p,(p,a)) -#define IDirectDrawSurface7_GetFlipStatus(p,a) ICOM_CALL_(GetFlipStatus,p,(p,a)) -#define IDirectDrawSurface7_GetOverlayPosition(p,a,b) ICOM_CALL_(GetOverlayPosition,p,(p,a,b)) -#define IDirectDrawSurface7_GetPalette(p,a) ICOM_CALL_(GetPalette,p,(p,a)) -#define IDirectDrawSurface7_GetPixelFormat(p,a) ICOM_CALL_(GetPixelFormat,p,(p,a)) -#define IDirectDrawSurface7_GetSurfaceDesc(p,a) ICOM_CALL_(GetSurfaceDesc,p,(p,a)) -#define IDirectDrawSurface7_Initialize(p,a,b) ICOM_CALL_(Initialize,p,(p,a,b)) -#define IDirectDrawSurface7_IsLost(p) ICOM_CALL_(IsLost,p,(p)) -#define IDirectDrawSurface7_Lock(p,a,b,c,d) ICOM_CALL_(Lock,p,(p,a,b,c,d)) -#define IDirectDrawSurface7_ReleaseDC(p,a) ICOM_CALL_(ReleaseDC,p,(p,a)) -#define IDirectDrawSurface7_Restore(p) ICOM_CALL_(Restore,p,(p)) -#define IDirectDrawSurface7_SetClipper(p,a) ICOM_CALL_(SetClipper,p,(p,a)) -#define IDirectDrawSurface7_SetColorKey(p,a,b) ICOM_CALL_(SetColorKey,p,(p,a,b)) -#define IDirectDrawSurface7_SetOverlayPosition(p,a,b) ICOM_CALL_(SetOverlayPosition,p,(p,a,b)) -#define IDirectDrawSurface7_SetPalette(p,a) ICOM_CALL_(SetPalette,p,(p,a)) -#define IDirectDrawSurface7_Unlock(p,a) ICOM_CALL_(Unlock,p,(p,a)) -#define IDirectDrawSurface7_UpdateOverlay(p,a,b,c,d,e) ICOM_CALL_(UpdateOverlay,p,(p,a,b,c,d,e)) -#define IDirectDrawSurface7_UpdateOverlayDisplay(p,a) ICOM_CALL_(UpdateOverlayDisplay,p,(p,a)) -#define IDirectDrawSurface7_UpdateOverlayZOrder(p,a,b) ICOM_CALL_(UpdateOverlayZOrder,p,(p,a,b)) -/*** IDirectDrawSurface2 methods ***/ -#define IDirectDrawSurface7_GetDDInterface(p,a) ICOM_CALL_(GetDDInterface,p,(p,a)) -#define IDirectDrawSurface7_PageLock(p,a) ICOM_CALL_(PageLock,p,(p,a)) -#define IDirectDrawSurface7_PageUnlock(p,a) ICOM_CALL_(PageUnlock,p,(p,a)) -/*** IDirectDrawSurface3 methods ***/ -#define IDirectDrawSurface7_SetSurfaceDesc(p,a,b) ICOM_CALL_(SetSurfaceDesc,p,(p,a,b)) -/*** IDirectDrawSurface4 methods ***/ -#define IDirectDrawSurface7_SetPrivateData(p,a,b,c,d) ICOM_CALL_(SetPrivateData,p,(p,a,b,c,d)) -#define IDirectDrawSurface7_GetPrivateData(p,a,b,c) ICOM_CALL_(GetPrivateData,p,(p,a,b,c)) -#define IDirectDrawSurface7_FreePrivateData(p,a) ICOM_CALL_(FreePrivateData,p,(p,a)) -#define IDirectDrawSurface7_GetUniquenessValue(p,a) ICOM_CALL_(GetUniquenessValue,p,(p,a)) -#define IDirectDrawSurface7_ChangeUniquenessValue(p) ICOM_CALL_(ChangeUniquenessValue,p,(p)) -/*** IDirectDrawSurface7 methods ***/ -#define IDirectDrawSurface7_SetPriority(p,a) ICOM_CALL_(SetPriority,p,(p,a)) -#define IDirectDrawSurface7_GetPriority(p,a) ICOM_CALL_(GetPriority,p,(p,a)) -#define IDirectDrawSurface7_SetLOD(p,a) ICOM_CALL_(SetLOD,p,(p,a)) -#define IDirectDrawSurface7_GetLOD(p,a) ICOM_CALL_(GetLOD,p,(p,a)) - -/***************************************************************************** - * IDirectDrawColorControl interface - */ -#undef INTERFACE -#define INTERFACE IDirectDrawColorControl -DECLARE_INTERFACE_(IDirectDrawColorControl,IUnknown) -{ - STDMETHOD(QueryInterface)(THIS_ REFIID,LPVOID*) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - STDMETHOD(GetColorControls)(THIS_ LPDDCOLORCONTROL lpColorControl) PURE; - STDMETHOD(SetColorControls)(THIS_ LPDDCOLORCONTROL lpColorControl) PURE; -}; - - /*** IUnknown methods ***/ -#define IDirectDrawColorControl_QueryInterface(p,a,b) ICOM_CALL_(QueryInterface,p,(p,a,b)) -#define IDirectDrawColorControl_AddRef(p) ICOM_CALL_(AddRef,p,(p)) -#define IDirectDrawColorControl_Release(p) ICOM_CALL_(Release,p,(p)) - /*** IDirectDrawColorControl methods ***/ -#define IDirectDrawColorControl_GetColorControls(p,a) ICOM_CALL_(GetColorControls,p,(p,a)) -#define IDirectDrawColorControl_SetColorControls(p,a) ICOM_CALL_(SetColorControls,p,(p,a)) - -/***************************************************************************** - * IDirectDrawGammaControl interface - */ -#undef INTERFACE -#define INTERFACE IDirectDrawGammaControl -DECLARE_INTERFACE_(IDirectDrawGammaControl,IUnknown) -{ - STDMETHOD(QueryInterface)(THIS_ REFIID,LPVOID*) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - STDMETHOD(GetGammaRamp)(THIS_ DWORD dwFlags, LPDDGAMMARAMP lpGammaRamp) PURE; - STDMETHOD(SetGammaRamp)(THIS_ DWORD dwFlags, LPDDGAMMARAMP lpGammaRamp) PURE; -}; - - /*** IUnknown methods ***/ -#define IDirectDrawGammaControl_QueryInterface(p,a,b) ICOM_CALL_(QueryInterface,p,(p,a,b)) -#define IDirectDrawGammaControl_AddRef(p) ICOM_CALL_(AddRef,p,(p)) -#define IDirectDrawGammaControl_Release(p) ICOM_CALL_(Release,p,(p)) - /*** IDirectDrawGammaControl methods ***/ -#define IDirectDrawGammaControl_GetGammaRamp(p,a,b) ICOM_CALL_(GetGammaRamp,p,(p,a,b)) -#define IDirectDrawGammaControl_SetGammaRamp(p,a,b) ICOM_CALL_(SetGammaRamp,p,(p,a,b)) - - -HRESULT WINAPI DirectDrawCreate(LPGUID,LPDIRECTDRAW*,LPUNKNOWN); -HRESULT WINAPI DirectDrawCreateEx(LPGUID,LPVOID*,REFIID,LPUNKNOWN); -HRESULT WINAPI DirectDrawEnumerateA(LPDDENUMCALLBACKA,LPVOID); -HRESULT WINAPI DirectDrawEnumerateW(LPDDENUMCALLBACKW,LPVOID); -#define DirectDrawEnumerate WINELIB_NAME_AW(DirectDrawEnumerate) -HRESULT WINAPI DirectDrawCreateClipper(DWORD,LPDIRECTDRAWCLIPPER*,LPUNKNOWN); - - -#ifdef __cplusplus -} /* extern "C" */ -#endif /* defined(__cplusplus) */ - -#endif /* __XWIN_DDRAW_H */ diff --git a/xorg-server/hw/xwin/doflexbison.bat b/xorg-server/hw/xwin/doflexbison.bat new file mode 100644 index 000000000..a29508bcb --- /dev/null +++ b/xorg-server/hw/xwin/doflexbison.bat @@ -0,0 +1,18 @@ +@echo off
+setlocal
+
+cd "%~dp0"
+
+set M4=..\..\..\tools\mhmake\m4.exe
+set BISON_PKGDATADIR=../../../tools/mhmake/src/bisondata
+
+set path=..\..\..\tools\mhmake;%path%
+
+..\..\..\tools\mhmake\bison.exe -d -o%1/winprefsyacc.c winprefsyacc.y
+
+copy "..\..\..\tools\mhmake\flex++.exe" flex.exe
+flex.exe -i -o%1/winprefslex.c winprefslex.l
+del flex.exe
+
+endlocal
+
diff --git a/xorg-server/hw/xwin/glx/gen_gl_wrappers.py b/xorg-server/hw/xwin/glx/gen_gl_wrappers.py index d7fe98dec..92eda0885 100644 --- a/xorg-server/hw/xwin/glx/gen_gl_wrappers.py +++ b/xorg-server/hw/xwin/glx/gen_gl_wrappers.py @@ -67,7 +67,7 @@ if dispatchheader : fh = open(dispatchheader) dispatchh = fh.readlines() - dispatch_regex = re.compile(r'#define\sSET_(\S*)\(') + dispatch_regex = re.compile(r'(?:#define|static\s+INLINE\s+void)\s+SET_([^\()]+)\(') for line in dispatchh : line = line.strip() @@ -239,10 +239,12 @@ for w in sorted(wrappers.keys()) : if wrappers[w]['category'].startswith('VERSION_1_0') or wrappers[w]['category'].startswith('VERSION_1_1') : if staticwrappers : print 'static', - print returntype + ' ' + funcname + 'Wrapper(' + arglist + ')' + print returntype + ' __stdcall ' + funcname + 'Wrapper(' + arglist + ')' print '{' + print '#ifdef _DEBUG' print ' if (glxWinDebugSettings.enable' + prefix.upper() + 'callTrace) ErrorF("'+ funcname + '\\n");' print ' glWinDirectProcCalls++;' + print '#endif' if returntype.lower() == 'void' : print ' ' + funcname + '(', else : @@ -257,7 +259,7 @@ for w in sorted(wrappers.keys()) : else: if staticwrappers : print 'static', - print returntype + ' ' + funcname + 'Wrapper(' + arglist + ')' + print returntype + ' __stdcall ' + funcname + 'Wrapper(' + arglist + ')' print '{' stringname = funcname @@ -287,11 +289,15 @@ for w in sorted(wrappers.keys()) : if returntype.lower() == 'void' : print ' RESOLVE(' + pfntypename + ', "' + stringname + '");' + print '#ifdef _DEBUG' print ' if (glxWinDebugSettings.enable' + prefix.upper() + 'callTrace) ErrorF("'+ funcname + '\\n");' + print '#endif' print ' RESOLVED_PROC(' + pfntypename + ')(', else : print ' RESOLVE_RET(' + pfntypename + ', "' + stringname + '", FALSE);' + print '#ifdef _DEBUG' print ' if (glxWinDebugSettings.enable' + prefix.upper() + 'callTrace) ErrorF("'+ funcname + '\\n");' + print '#endif' print ' return RESOLVED_PROC(' + pfntypename + ')(', if arglist != 'void' : @@ -314,6 +320,6 @@ if dispatchheader : if wrappers.has_key(d) : print ' SET_'+ d + '(disp, ' + prefix + d + 'Wrapper);' else : - print '#warning No wrapper for ' + prefix + d + ' !' + print '#pragma message("No wrapper for ' + prefix + d + ' !")' print '}' diff --git a/xorg-server/hw/xwin/glx/gl.spec b/xorg-server/hw/xwin/glx/gl.spec new file mode 100644 index 000000000..86a6064e7 --- /dev/null +++ b/xorg-server/hw/xwin/glx/gl.spec @@ -0,0 +1,31488 @@ +# gl.spec file +# DON'T REMOVE PREVIOUS LINE!!! libspec depends on it! +# +# Copyright (c) 1991-2005 Silicon Graphics, Inc. All Rights Reserved. +# Copyright (c) 2006-2010 The Khronos Group Inc. +# +# This document is licensed under the SGI Free Software B License Version +# 2.0. For details, see http://oss.sgi.com/projects/FreeB/ . +# +# $Revision: 13168 $ on $Date: 2010-12-09 02:18:26 -0800 (Thu, 09 Dec 2010) $ + +required-props: +# Description of a parameter +param: retval retained +# Display list flags +dlflags: notlistable handcode +# GLX implementation flags +glxflags: client-intercept client-handcode server-handcode EXT SGI ignore ARB +# Vector ('v') equivalent form of a command taking 1-4 explicit xyzw/rgba arguments +vectorequiv: * +# Category this function falls in. While there are many categories for +# early GL 1.0 functions, later functions just have a core version +# (e.g. VERSION_major_minor) or extension name for the category. +category: display-list drawing drawing-control feedback framebuf misc modeling pixel-op pixel-rw state-req xform VERSION_1_0 VERSION_1_0_DEPRECATED VERSION_1_1 VERSION_1_1_DEPRECATED VERSION_1_2 VERSION_1_2_DEPRECATED VERSION_1_3 VERSION_1_3_DEPRECATED VERSION_1_4 VERSION_1_4_DEPRECATED VERSION_1_5 VERSION_2_0 VERSION_2_1 VERSION_3_0 VERSION_3_0_DEPRECATED VERSION_3_1 VERSION_3_2 VERSION_3_3 VERSION_4_0 VERSION_4_1 VERSION_4_1_DEPRECATED ATI_element_array ATI_envmap_bumpmap ATI_fragment_shader ATI_pn_triangles ATI_vertex_array_object ATI_vertex_streams EXT_blend_color EXT_blend_minmax EXT_convolution EXT_copy_texture EXT_histogram EXT_polygon_offset EXT_subtexture EXT_texture3D EXT_texture_object EXT_vertex_array EXT_vertex_shader SGIS_detail_texture SGIS_multisample SGIS_pixel_texture ARB_point_parameters EXT_point_parameters SGIS_point_parameters SGIS_sharpen_texture SGIS_texture4D SGIS_texture_filter4 SGIX_async SGIX_flush_raster SGIX_fragment_lighting SGIX_framezoom SGIX_igloo_interface SGIX_instruments SGIX_list_priority SGIX_pixel_texture SGIX_polynomial_ffd SGIX_reference_plane SGIX_sprite SGIX_tag_sample_buffer SGI_color_table ARB_multitexture ARB_multisample ARB_texture_compression ARB_transpose_matrix ARB_vertex_blend ARB_matrix_palette EXT_compiled_vertex_array EXT_cull_vertex EXT_index_func EXT_index_material EXT_draw_range_elements EXT_vertex_weighting INGR_blend_func_separate NV_evaluators NV_fence NV_occlusion_query NV_point_sprite NV_register_combiners NV_register_combiners2 NV_vertex_array_range NV_vertex_program NV_vertex_program1_1_dcc MESA_resize_buffers MESA_window_pos PGI_misc_hints EXT_fog_coord EXT_blend_func_separate EXT_color_subtable EXT_coordinate_frame EXT_light_texture EXT_multi_draw_arrays EXT_paletted_texture EXT_pixel_transform EXT_secondary_color EXT_texture_perturb_normal HP_image_transform IBM_multimode_draw_arrays IBM_vertex_array_lists INTEL_parallel_arrays SUNX_constant_data SUN_global_alpha SUN_mesh_array SUN_triangle_list SUN_vertex 3DFX_tbuffer EXT_multisample SGIS_fog_function SGIS_texture_color_mask ARB_window_pos EXT_stencil_two_side EXT_depth_bounds_test EXT_blend_equation_separate ARB_vertex_program ARB_fragment_program ARB_vertex_buffer_object ARB_occlusion_query ARB_shader_objects ARB_vertex_shader ARB_fragment_shader S3_s3tc ATI_draw_buffers ATI_texture_env_combine3 ATI_texture_float NV_float_buffer NV_fragment_program NV_half_float NV_pixel_data_range NV_primitive_restart NV_texture_expand_normal NV_texture_expand_normal NV_vertex_program2 APPLE_element_array APPLE_fence APPLE_vertex_array_object APPLE_vertex_array_range ATI_draw_buffers NV_fragment_program NV_half_float NV_pixel_data_range NV_primitive_restart ATI_map_object_buffer ATI_separate_stencil ATI_vertex_attrib_array_object ARB_draw_buffers ARB_texture_rectangle ARB_color_buffer_float EXT_framebuffer_object GREMEDY_string_marker EXT_stencil_clear_tag EXT_framebuffer_blit EXT_framebuffer_multisample MESAX_texture_stack EXT_timer_query EXT_gpu_program_parameters APPLE_flush_buffer_range NV_gpu_program4 NV_geometry_program4 EXT_geometry_shader4 NV_vertex_program4 EXT_gpu_shader4 EXT_draw_instanced EXT_texture_buffer_object NV_depth_buffer_float NV_framebuffer_multisample_coverage NV_parameter_buffer_object EXT_draw_buffers2 NV_transform_feedback EXT_bindable_uniform EXT_texture_integer GREMEDY_frame_terminator NV_conditional_render NV_present_video EXT_transform_feedback ARB_depth_buffer_float ARB_draw_instanced ARB_framebuffer_object ARB_framebuffer_sRGB ARB_geometry_shader4 ARB_half_float_vertex ARB_instanced_arrays ARB_map_buffer_range ARB_texture_buffer_object ARB_texture_compression_rgtc ARB_texture_rg ARB_vertex_array_object EXT_direct_state_access EXT_vertex_array_bgra EXT_texture_swizzle NV_explicit_multisample NV_transform_feedback2 ATI_meminfo AMD_performance_monitor AMD_vertex_shader_tesselator EXT_provoking_vertex ARB_uniform_buffer_object ARB_copy_buffer EXT_texture_snorm AMD_draw_buffers_blend APPLE_texture_range APPLE_float_pixels APPLE_vertex_program_evaluators APPLE_aux_depth_stencil APPLE_object_purgeable APPLE_row_bytes ARB_draw_elements_base_vertex ARB_provoking_vertex ARB_sync ARB_texture_multisample ARB_draw_buffers_blend ARB_sample_shading NV_video_capture NV_copy_image EXT_separate_shader_objects NV_parameter_buffer_object2 NV_shader_buffer_load NV_vertex_buffer_unified_memory NV_texture_barrier ARB_shading_language_include ARB_blend_func_extended ARB_sampler_objects ARB_timer_query ARB_vertex_type_2_10_10_10_rev ARB_draw_indirect ARB_gpu_shader_fp64 ARB_shader_subroutine ARB_tessellation_shader ARB_transform_feedback2 ARB_transform_feedback3 AMD_conservative_depth NV_vdpau_interop ARB_ES2_compatibility ARB_get_program_binary ARB_separate_shader_objects ARB_vertex_attrib_64bit ARB_viewport_array ARB_cl_event ARB_debug_output ARB_robustness EXT_shader_image_load_store EXT_vertex_attrib_64bit NV_gpu_shader5 NV_vertex_attrib_integer_64bit AMD_name_gen_delete AMD_debug_output NV_vdpau_interop NV_gpu_program5 + +# Categories for extensions with no functions - need not be included now +# ARB_texture_env_add ARB_texture_cube_map ARB_texture_border_clamp +# ARB_shading_language_100 ARB_texture_non_power_of_two ARB_point_sprite +# ARB_half_float_pixel ARB_texture_float ARB_pixel_buffer_object EXT_abgr +# EXT_texture SGI_color_matrix SGI_texture_color_table EXT_cmyka +# EXT_packed_pixels SGIS_texture_lod EXT_rescale_normal EXT_misc_attribute +# SGIS_generate_mipmap SGIX_clipmap SGIX_shadow SGIS_texture_edge_clamp +# SGIS_texture_border_clamp EXT_blend_subtract EXT_blend_logic_op +# SGIX_async_histogram SGIX_async_pixel SGIX_interlace SGIX_pixel_tiles +# SGIX_texture_select SGIX_texture_multi_buffer SGIX_texture_scale_bias +# SGIX_depth_texture SGIX_fog_offset HP_convolution_border_modes +# SGIX_texture_add_env PGI_vertex_hints EXT_clip_volume_hint +# SGIX_ir_instrument1 SGIX_calligraphic_fragment SGIX_texture_lod_bias +# SGIX_shadow_ambient EXT_index_texture EXT_index_array_formats SGIX_ycrcb +# IBM_rasterpos_clip HP_texture_lighting WIN_phong_shading +# WIN_specular_fog SGIX_blend_alpha_minmax EXT_bgra HP_occlusion_test +# EXT_pixel_transform_color_table EXT_shared_texture_palette +# EXT_separate_specular_color EXT_texture_env REND_screen_coordinates +# EXT_texture_env_combine APPLE_specular_vector APPLE_transform_hint +# SGIX_fog_scale INGR_color_clamp INGR_interlace_read EXT_stencil_wrap +# EXT_422_pixels NV_texgen_reflection SUN_convolution_border_modes +# SUN_slice_accum EXT_texture_env_add EXT_texture_lod_bias +# EXT_texture_filter_anisotropic NV_light_max_exponent NV_fog_distance +# NV_texgen_emboss NV_blend_square NV_texture_env_combine4 +# NV_packed_depth_stencil NV_texture_compression_vtc NV_texture_rectangle +# NV_texture_shader NV_texture_shader2 NV_vertex_array_range2 +# IBM_cull_vertex SGIX_subsample SGIX_ycrcba SGIX_ycrcb_subsample +# SGIX_depth_pass_instrument 3DFX_texture_compression_FXT1 +# 3DFX_multisample SGIX_vertex_preclip SGIX_convolution_accuracy +# SGIX_resample SGIX_scalebias_hint SGIX_texture_coordinate_clamp +# EXT_shadow_funcs MESA_pack_invert MESA_ycbcr_texture EXT_packed_float +# EXT_texture_array EXT_texture_compression_latc +# EXT_texture_compression_rgtc EXT_texture_shared_exponent +# NV_fragment_program4 EXT_framebuffer_sRGB NV_geometry_shader4 +# EXT_vertex_array_bgra ARB_depth_clamp ARB_fragment_coord_conventions +# ARB_seamless_cube_map ARB_vertex_array_bgra ARB_texture_cube_map_array +# ARB_texture_gather ARB_texture_query_lod +# AMD_shader_stencil_export AMD_seamless_cubemap_per_texture + +# Core version in which a function was introduced, or against +# which an extension can be implemented +version: 1.0 1.1 1.2 1.3 1.4 1.5 2.0 2.1 3.0 3.1 3.2 3.3 4.0 4.1 +# Core version in which a function was removed +deprecated: 3.1 +# GLX Single, Rendering, or Vendor Private opcode +glxsingle: * +glxropcode: * +glxvendorpriv: * +# WGL implementation flags (incomplete) +wglflags: client-handcode server-handcode small-data batchable +# Drivers in which this is implemented (very incomplete) +extension: future not_implemented soft WINSOFT NV10 NV20 NV50 +# Function this aliases (indistinguishable to the GL) +alias: * +# Mesa dispatch table offset (incomplete) +offset: * +# These properties are picked up from NVIDIA .spec files, we don't use them +glfflags: * +beginend: * +glxvectorequiv: * +subcategory: * +glextmask: * + +############################################################################### +# +# glxsingle, glxropcode, and other GLX allocations to vendors +# are used here, but the master registry for GLX is in +# /repos/ogl/trunk/doc/registry/extensions.reserved +# +# XFree86 dispatch offsets: 0-645 +# 578-641 NV_vertex_program +# GLS opcodes: 0x0030-0x0269 +# +############################################################################### + +############################################################################### +# +# things to remember when adding an extension command +# +# - append new ARB and non-ARB extensions to the appropriate portion of +# the spec file, in extension number order. +# - leading tabs are suggested. Whitespace of any sort may be used elsewhere. +# - set glxflags to "ignore" until GLX is updated to support the new command +# - add new data types to typemaps/spec2wire.map +# - add extension name in alphabetical order to category list +# - add commands within an extension in spec order +# - use existing command entries as a model (where possible) +# - when reserving new glxropcodes, update extensions.reserved (per above) +# +############################################################################### + +# New type declarations + +passthru: #include <stddef.h> + +passthru: #ifndef GL_VERSION_2_0 +passthru: /* GL type for program/shader text */ +passthru: typedef char GLchar; +passthru: #endif +passthru: +passthru: #ifndef GL_VERSION_1_5 +passthru: /* GL types for handling large vertex buffer objects */ +passthru: typedef ptrdiff_t GLintptr; +passthru: typedef ptrdiff_t GLsizeiptr; +passthru: #endif +passthru: +passthru: #ifndef GL_ARB_vertex_buffer_object +passthru: /* GL types for handling large vertex buffer objects */ +passthru: typedef ptrdiff_t GLintptrARB; +passthru: typedef ptrdiff_t GLsizeiptrARB; +passthru: #endif +passthru: +passthru: #ifndef GL_ARB_shader_objects +passthru: /* GL types for program/shader text and shader object handles */ +passthru: typedef char GLcharARB; +passthru: typedef unsigned int GLhandleARB; +passthru: #endif +passthru: +passthru: /* GL type for "half" precision (s10e5) float data in host memory */ +passthru: #ifndef GL_ARB_half_float_pixel +passthru: typedef unsigned short GLhalfARB; +passthru: #endif +passthru: +passthru: #ifndef GL_NV_half_float +passthru: typedef unsigned short GLhalfNV; +passthru: #endif +passthru: +passthru: #ifndef GLEXT_64_TYPES_DEFINED +passthru: /* This code block is duplicated in glxext.h, so must be protected */ +passthru: #define GLEXT_64_TYPES_DEFINED +passthru: /* Define int32_t, int64_t, and uint64_t types for UST/MSC */ +passthru: /* (as used in the GL_EXT_timer_query extension). */ +passthru: #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +passthru: #include <inttypes.h> +passthru: #elif defined(__sun__) || defined(__digital__) +passthru: #include <inttypes.h> +passthru: #if defined(__STDC__) +passthru: #if defined(__arch64__) || defined(_LP64) +passthru: typedef long int int64_t; +passthru: typedef unsigned long int uint64_t; +passthru: #else +passthru: typedef long long int int64_t; +passthru: typedef unsigned long long int uint64_t; +passthru: #endif /* __arch64__ */ +passthru: #endif /* __STDC__ */ +passthru: #elif defined( __VMS ) || defined(__sgi) +passthru: #include <inttypes.h> +passthru: #elif defined(__SCO__) || defined(__USLC__) +passthru: #include <stdint.h> +passthru: #elif defined(__UNIXOS2__) || defined(__SOL64__) +passthru: typedef long int int32_t; +passthru: typedef long long int int64_t; +passthru: typedef unsigned long long int uint64_t; +passthru: #elif defined(_WIN32) && defined(__GNUC__) +passthru: #include <stdint.h> +passthru: #elif defined(_WIN32) +passthru: typedef __int32 int32_t; +passthru: typedef __int64 int64_t; +passthru: typedef unsigned __int64 uint64_t; +passthru: #else +passthru: /* Fallback if nothing above works */ +passthru: #include <inttypes.h> +passthru: #endif +passthru: #endif +passthru: +passthru: #ifndef GL_EXT_timer_query +passthru: typedef int64_t GLint64EXT; +passthru: typedef uint64_t GLuint64EXT; +passthru: #endif +passthru: +passthru: #ifndef GL_ARB_sync +passthru: typedef int64_t GLint64; +passthru: typedef uint64_t GLuint64; +passthru: typedef struct __GLsync *GLsync; +passthru: #endif +passthru: +passthru: #ifndef GL_ARB_cl_event +passthru: /* These incomplete types let us declare types compatible with OpenCL's cl_context and cl_event */ +passthru: struct _cl_context; +passthru: struct _cl_event; +passthru: #endif +passthru: +passthru: #ifndef GL_ARB_debug_output +passthru: typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam); +passthru: #endif +passthru: +passthru: #ifndef GL_AMD_debug_output +passthru: typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam); +passthru: #endif +passthru: +passthru: #ifndef GL_NV_vdpau_interop +passthru: typedef GLintptr GLvdpauSurfaceNV; +passthru: #endif +passthru: + +############################################################################### +############################################################################### +# +# OpenGL 1.0 commands +# +############################################################################### +############################################################################### + +############################################################################### +# +# drawing-control commands +# +############################################################################### + +CullFace(mode) + return void + param mode CullFaceMode in value + category VERSION_1_0 # old: drawing-control + version 1.0 + glxropcode 79 + offset 152 + +FrontFace(mode) + return void + param mode FrontFaceDirection in value + category VERSION_1_0 # old: drawing-control + version 1.0 + glxropcode 84 + offset 157 + +Hint(target, mode) + return void + param target HintTarget in value + param mode HintMode in value + category VERSION_1_0 # old: drawing-control + version 1.0 + glxropcode 85 + offset 158 + +LineWidth(width) + return void + param width CheckedFloat32 in value + category VERSION_1_0 # old: drawing-control + version 1.0 + glxropcode 95 + offset 168 + +PointSize(size) + return void + param size CheckedFloat32 in value + category VERSION_1_0 # old: drawing-control + version 1.0 + glxropcode 100 + offset 173 + +PolygonMode(face, mode) + return void + param face MaterialFace in value + param mode PolygonMode in value + category VERSION_1_0 # old: drawing-control + version 1.0 + glxropcode 101 + offset 174 + +Scissor(x, y, width, height) + return void + param x WinCoord in value + param y WinCoord in value + param width SizeI in value + param height SizeI in value + category VERSION_1_0 # old: drawing-control + version 1.0 + glxropcode 103 + offset 176 + +TexParameterf(target, pname, param) + return void + param target TextureTarget in value + param pname TextureParameterName in value + param param CheckedFloat32 in value + category VERSION_1_0 # old: drawing-control + version 1.0 + glxropcode 105 + wglflags small-data + offset 178 + +TexParameterfv(target, pname, params) + return void + param target TextureTarget in value + param pname TextureParameterName in value + param params CheckedFloat32 in array [COMPSIZE(pname)] + category VERSION_1_0 # old: drawing-control + version 1.0 + glxropcode 106 + wglflags small-data + offset 179 + +TexParameteri(target, pname, param) + return void + param target TextureTarget in value + param pname TextureParameterName in value + param param CheckedInt32 in value + category VERSION_1_0 # old: drawing-control + version 1.0 + glxropcode 107 + wglflags small-data + offset 180 + +TexParameteriv(target, pname, params) + return void + param target TextureTarget in value + param pname TextureParameterName in value + param params CheckedInt32 in array [COMPSIZE(pname)] + category VERSION_1_0 # old: drawing-control + version 1.0 + glxropcode 108 + wglflags small-data + offset 181 + +TexImage1D(target, level, internalformat, width, border, format, type, pixels) + return void + param target TextureTarget in value + param level CheckedInt32 in value + param internalformat TextureComponentCount in value + param width SizeI in value + param border CheckedInt32 in value + param format PixelFormat in value + param type PixelType in value + param pixels Void in array [COMPSIZE(format/type/width)] + category VERSION_1_0 # old: drawing-control + dlflags handcode + glxflags client-handcode server-handcode + version 1.0 + glxropcode 109 + wglflags client-handcode server-handcode + offset 182 + +TexImage2D(target, level, internalformat, width, height, border, format, type, pixels) + return void + param target TextureTarget in value + param level CheckedInt32 in value + param internalformat TextureComponentCount in value + param width SizeI in value + param height SizeI in value + param border CheckedInt32 in value + param format PixelFormat in value + param type PixelType in value + param pixels Void in array [COMPSIZE(format/type/width/height)] + category VERSION_1_0 # old: drawing-control + dlflags handcode + glxflags client-handcode server-handcode + version 1.0 + glxropcode 110 + wglflags client-handcode server-handcode + offset 183 + +############################################################################### +# +# framebuf commands +# +############################################################################### + +DrawBuffer(mode) + return void + param mode DrawBufferMode in value + category VERSION_1_0 # old: framebuf + version 1.0 + glxropcode 126 + offset 202 + +Clear(mask) + return void + param mask ClearBufferMask in value + category VERSION_1_0 # old: framebuf + version 1.0 + glxropcode 127 + offset 203 + +ClearColor(red, green, blue, alpha) + return void + param red ClampedColorF in value + param green ClampedColorF in value + param blue ClampedColorF in value + param alpha ClampedColorF in value + category VERSION_1_0 # old: framebuf + version 1.0 + glxropcode 130 + offset 206 + +ClearStencil(s) + return void + param s StencilValue in value + category VERSION_1_0 # old: framebuf + version 1.0 + glxropcode 131 + offset 207 + +ClearDepth(depth) + return void + param depth ClampedFloat64 in value + category VERSION_1_0 # old: framebuf + version 1.0 + glxropcode 132 + offset 208 + +StencilMask(mask) + return void + param mask MaskedStencilValue in value + category VERSION_1_0 # old: framebuf + version 1.0 + glxropcode 133 + offset 209 + +ColorMask(red, green, blue, alpha) + return void + param red Boolean in value + param green Boolean in value + param blue Boolean in value + param alpha Boolean in value + category VERSION_1_0 # old: framebuf + version 1.0 + glxropcode 134 + offset 210 + +DepthMask(flag) + return void + param flag Boolean in value + category VERSION_1_0 # old: framebuf + version 1.0 + glxropcode 135 + offset 211 + +############################################################################### +# +# misc commands +# +############################################################################### + +Disable(cap) + return void + param cap EnableCap in value + category VERSION_1_0 # old: misc + version 1.0 + dlflags handcode + glxflags client-handcode client-intercept + glxropcode 138 + offset 214 + +Enable(cap) + return void + param cap EnableCap in value + category VERSION_1_0 # old: misc + version 1.0 + dlflags handcode + glxflags client-handcode client-intercept + glxropcode 139 + offset 215 + +Finish() + return void + dlflags notlistable + glxflags client-handcode server-handcode + category VERSION_1_0 # old: misc + version 1.0 + glxsingle 108 + offset 216 + +Flush() + return void + dlflags notlistable + glxflags client-handcode client-intercept server-handcode + category VERSION_1_0 # old: misc + version 1.0 + glxsingle 142 + offset 217 + +############################################################################### +# +# pixel-op commands +# +############################################################################### + +BlendFunc(sfactor, dfactor) + return void + param sfactor BlendingFactorSrc in value + param dfactor BlendingFactorDest in value + category VERSION_1_0 # old: pixel-op + version 1.0 + glxropcode 160 + offset 241 + +LogicOp(opcode) + return void + param opcode LogicOp in value + category VERSION_1_0 # old: pixel-op + version 1.0 + glxropcode 161 + offset 242 + +StencilFunc(func, ref, mask) + return void + param func StencilFunction in value + param ref ClampedStencilValue in value + param mask MaskedStencilValue in value + category VERSION_1_0 # old: pixel-op + version 1.0 + glxropcode 162 + offset 243 + +StencilOp(fail, zfail, zpass) + return void + param fail StencilOp in value + param zfail StencilOp in value + param zpass StencilOp in value + category VERSION_1_0 # old: pixel-op + version 1.0 + glxropcode 163 + offset 244 + +DepthFunc(func) + return void + param func DepthFunction in value + category VERSION_1_0 # old: pixel-op + version 1.0 + glxropcode 164 + offset 245 + +############################################################################### +# +# pixel-rw commands +# +############################################################################### + +PixelStoref(pname, param) + return void + param pname PixelStoreParameter in value + param param CheckedFloat32 in value + dlflags notlistable + glxflags client-handcode + category VERSION_1_0 # old: pixel-rw + version 1.0 + glxsingle 109 + wglflags batchable + offset 249 + +PixelStorei(pname, param) + return void + param pname PixelStoreParameter in value + param param CheckedInt32 in value + dlflags notlistable + glxflags client-handcode + category VERSION_1_0 # old: pixel-rw + version 1.0 + glxsingle 110 + wglflags batchable + offset 250 + +ReadBuffer(mode) + return void + param mode ReadBufferMode in value + category VERSION_1_0 # old: pixel-rw + version 1.0 + glxropcode 171 + offset 254 + +ReadPixels(x, y, width, height, format, type, pixels) + return void + param x WinCoord in value + param y WinCoord in value + param width SizeI in value + param height SizeI in value + param format PixelFormat in value + param type PixelType in value + param pixels Void out array [COMPSIZE(format/type/width/height)] + category VERSION_1_0 # old: pixel-rw + dlflags notlistable + glxflags client-handcode server-handcode + version 1.0 + glxsingle 111 + wglflags client-handcode server-handcode + offset 256 + +############################################################################### +# +# state-req commands +# +############################################################################### + +GetBooleanv(pname, params) + return void + param pname GetPName in value + param params Boolean out array [COMPSIZE(pname)] + category VERSION_1_0 # old: state-req + dlflags notlistable + glxflags client-handcode + version 1.0 + glxsingle 112 + wglflags small-data + offset 258 + +GetDoublev(pname, params) + return void + param pname GetPName in value + param params Float64 out array [COMPSIZE(pname)] + category VERSION_1_0 # old: state-req + dlflags notlistable + glxflags client-handcode + version 1.0 + glxsingle 114 + wglflags small-data + offset 260 + +GetError() + return ErrorCode + category VERSION_1_0 # old: state-req + dlflags notlistable + glxflags client-handcode + version 1.0 + glxsingle 115 + offset 261 + +GetFloatv(pname, params) + return void + param pname GetPName in value + param params Float32 out array [COMPSIZE(pname)] + category VERSION_1_0 # old: state-req + dlflags notlistable + glxflags client-handcode + version 1.0 + glxsingle 116 + wglflags small-data + offset 262 + +GetIntegerv(pname, params) + return void + param pname GetPName in value + param params Int32 out array [COMPSIZE(pname)] + category VERSION_1_0 # old: state-req + dlflags notlistable + glxflags client-handcode + version 1.0 + glxsingle 117 + wglflags small-data + offset 263 + +GetString(name) + return String + param name StringName in value + category VERSION_1_0 # old: state-req + dlflags notlistable + glxflags client-handcode server-handcode + version 1.0 + glxsingle 129 + wglflags client-handcode server-handcode + offset 275 + +GetTexImage(target, level, format, type, pixels) + return void + param target TextureTarget in value + param level CheckedInt32 in value + param format PixelFormat in value + param type PixelType in value + param pixels Void out array [COMPSIZE(target/level/format/type)] + category VERSION_1_0 # old: state-req + dlflags notlistable + glxflags client-handcode server-handcode + version 1.0 + glxsingle 135 + wglflags client-handcode server-handcode + offset 281 + +GetTexParameterfv(target, pname, params) + return void + param target TextureTarget in value + param pname GetTextureParameter in value + param params Float32 out array [COMPSIZE(pname)] + category VERSION_1_0 # old: state-req + dlflags notlistable + version 1.0 + glxsingle 136 + wglflags small-data + offset 282 + +GetTexParameteriv(target, pname, params) + return void + param target TextureTarget in value + param pname GetTextureParameter in value + param params Int32 out array [COMPSIZE(pname)] + category VERSION_1_0 # old: state-req + dlflags notlistable + version 1.0 + glxsingle 137 + wglflags small-data + offset 283 + +GetTexLevelParameterfv(target, level, pname, params) + return void + param target TextureTarget in value + param level CheckedInt32 in value + param pname GetTextureParameter in value + param params Float32 out array [COMPSIZE(pname)] + category VERSION_1_0 # old: state-req + dlflags notlistable + version 1.0 + glxsingle 138 + wglflags small-data + offset 284 + +GetTexLevelParameteriv(target, level, pname, params) + return void + param target TextureTarget in value + param level CheckedInt32 in value + param pname GetTextureParameter in value + param params Int32 out array [COMPSIZE(pname)] + category VERSION_1_0 # old: state-req + dlflags notlistable + version 1.0 + glxsingle 139 + wglflags small-data + offset 285 + +IsEnabled(cap) + return Boolean + param cap EnableCap in value + category VERSION_1_0 # old: state-req + dlflags notlistable + version 1.0 + glxflags client-handcode client-intercept + glxsingle 140 + offset 286 + +############################################################################### +# +# xform commands +# +############################################################################### + +DepthRange(near, far) + return void + param near ClampedFloat64 in value + param far ClampedFloat64 in value + category VERSION_1_0 # old: xform + version 1.0 + glxropcode 174 + offset 288 + +Viewport(x, y, width, height) + return void + param x WinCoord in value + param y WinCoord in value + param width SizeI in value + param height SizeI in value + category VERSION_1_0 # old: xform + version 1.0 + glxropcode 191 + offset 305 + +############################################################################### +############################################################################### +# +# OpenGL 1.0 deprecated commands +# +############################################################################### +############################################################################### + +# display-list commands + +NewList(list, mode) + return void + param list List in value + param mode ListMode in value + dlflags notlistable + category VERSION_1_0_DEPRECATED # old: display-list + version 1.0 + deprecated 3.1 + glxsingle 101 + wglflags batchable + offset 0 + +EndList() + return void + dlflags notlistable + category VERSION_1_0_DEPRECATED # old: display-list + version 1.0 + deprecated 3.1 + glxsingle 102 + wglflags batchable + offset 1 + +CallList(list) + return void + param list List in value + category VERSION_1_0_DEPRECATED # old: display-list + version 1.0 + deprecated 3.1 + glxropcode 1 + offset 2 + +CallLists(n, type, lists) + return void + param n SizeI in value + param type ListNameType in value + param lists Void in array [COMPSIZE(n/type)] + category VERSION_1_0_DEPRECATED # old: display-list + glxflags client-handcode server-handcode + version 1.0 + deprecated 3.1 + glxropcode 2 + offset 3 + +DeleteLists(list, range) + return void + param list List in value + param range SizeI in value + dlflags notlistable + category VERSION_1_0_DEPRECATED # old: display-list + version 1.0 + deprecated 3.1 + glxsingle 103 + wglflags batchable + offset 4 + +GenLists(range) + return List + param range SizeI in value + dlflags notlistable + category VERSION_1_0_DEPRECATED # old: display-list + version 1.0 + deprecated 3.1 + glxsingle 104 + offset 5 + +ListBase(base) + return void + param base List in value + category VERSION_1_0_DEPRECATED # old: display-list + version 1.0 + deprecated 3.1 + glxropcode 3 + offset 6 + +# drawing commands + +Begin(mode) + return void + param mode BeginMode in value + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 4 + offset 7 + +Bitmap(width, height, xorig, yorig, xmove, ymove, bitmap) + return void + param width SizeI in value + param height SizeI in value + param xorig CoordF in value + param yorig CoordF in value + param xmove CoordF in value + param ymove CoordF in value + param bitmap UInt8 in array [COMPSIZE(width/height)] + category VERSION_1_0_DEPRECATED # old: drawing + dlflags handcode + glxflags client-handcode server-handcode + version 1.0 + deprecated 3.1 + glxropcode 5 + wglflags client-handcode server-handcode + offset 8 + +Color3b(red, green, blue) + return void + param red ColorB in value + param green ColorB in value + param blue ColorB in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv Color3bv + version 1.0 + deprecated 3.1 + offset 9 + +Color3bv(v) + return void + param v ColorB in array [3] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 6 + offset 10 + +Color3d(red, green, blue) + return void + param red ColorD in value + param green ColorD in value + param blue ColorD in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv Color3dv + version 1.0 + deprecated 3.1 + offset 11 + +Color3dv(v) + return void + param v ColorD in array [3] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 7 + offset 12 + +Color3f(red, green, blue) + return void + param red ColorF in value + param green ColorF in value + param blue ColorF in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv Color3fv + version 1.0 + deprecated 3.1 + offset 13 + +Color3fv(v) + return void + param v ColorF in array [3] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 8 + offset 14 + +Color3i(red, green, blue) + return void + param red ColorI in value + param green ColorI in value + param blue ColorI in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv Color3iv + version 1.0 + deprecated 3.1 + offset 15 + +Color3iv(v) + return void + param v ColorI in array [3] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 9 + offset 16 + +Color3s(red, green, blue) + return void + param red ColorS in value + param green ColorS in value + param blue ColorS in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv Color3sv + version 1.0 + deprecated 3.1 + offset 17 + +Color3sv(v) + return void + param v ColorS in array [3] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 10 + offset 18 + +Color3ub(red, green, blue) + return void + param red ColorUB in value + param green ColorUB in value + param blue ColorUB in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv Color3ubv + version 1.0 + deprecated 3.1 + offset 19 + +Color3ubv(v) + return void + param v ColorUB in array [3] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 11 + offset 20 + +Color3ui(red, green, blue) + return void + param red ColorUI in value + param green ColorUI in value + param blue ColorUI in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv Color3uiv + version 1.0 + deprecated 3.1 + offset 21 + +Color3uiv(v) + return void + param v ColorUI in array [3] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 12 + offset 22 + +Color3us(red, green, blue) + return void + param red ColorUS in value + param green ColorUS in value + param blue ColorUS in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv Color3usv + version 1.0 + deprecated 3.1 + offset 23 + +Color3usv(v) + return void + param v ColorUS in array [3] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 13 + offset 24 + +Color4b(red, green, blue, alpha) + return void + param red ColorB in value + param green ColorB in value + param blue ColorB in value + param alpha ColorB in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv Color4bv + version 1.0 + deprecated 3.1 + offset 25 + +Color4bv(v) + return void + param v ColorB in array [4] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 14 + offset 26 + +Color4d(red, green, blue, alpha) + return void + param red ColorD in value + param green ColorD in value + param blue ColorD in value + param alpha ColorD in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv Color4dv + version 1.0 + deprecated 3.1 + offset 27 + +Color4dv(v) + return void + param v ColorD in array [4] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 15 + offset 28 + +Color4f(red, green, blue, alpha) + return void + param red ColorF in value + param green ColorF in value + param blue ColorF in value + param alpha ColorF in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv Color4fv + version 1.0 + deprecated 3.1 + offset 29 + +Color4fv(v) + return void + param v ColorF in array [4] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 16 + offset 30 + +Color4i(red, green, blue, alpha) + return void + param red ColorI in value + param green ColorI in value + param blue ColorI in value + param alpha ColorI in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv Color4iv + version 1.0 + deprecated 3.1 + offset 31 + +Color4iv(v) + return void + param v ColorI in array [4] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 17 + offset 32 + +Color4s(red, green, blue, alpha) + return void + param red ColorS in value + param green ColorS in value + param blue ColorS in value + param alpha ColorS in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv Color4sv + version 1.0 + deprecated 3.1 + offset 33 + +Color4sv(v) + return void + param v ColorS in array [4] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 18 + offset 34 + +Color4ub(red, green, blue, alpha) + return void + param red ColorUB in value + param green ColorUB in value + param blue ColorUB in value + param alpha ColorUB in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv Color4ubv + version 1.0 + deprecated 3.1 + offset 35 + +Color4ubv(v) + return void + param v ColorUB in array [4] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 19 + offset 36 + +Color4ui(red, green, blue, alpha) + return void + param red ColorUI in value + param green ColorUI in value + param blue ColorUI in value + param alpha ColorUI in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv Color4uiv + version 1.0 + deprecated 3.1 + offset 37 + +Color4uiv(v) + return void + param v ColorUI in array [4] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 20 + offset 38 + +Color4us(red, green, blue, alpha) + return void + param red ColorUS in value + param green ColorUS in value + param blue ColorUS in value + param alpha ColorUS in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv Color4usv + version 1.0 + deprecated 3.1 + offset 39 + +Color4usv(v) + return void + param v ColorUS in array [4] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 21 + offset 40 + +EdgeFlag(flag) + return void + param flag Boolean in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv EdgeFlagv + version 1.0 + deprecated 3.1 + offset 41 + +EdgeFlagv(flag) + return void + param flag Boolean in array [1] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 22 + offset 42 + +End() + return void + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 23 + offset 43 + +Indexd(c) + return void + param c ColorIndexValueD in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv Indexdv + version 1.0 + deprecated 3.1 + offset 44 + +Indexdv(c) + return void + param c ColorIndexValueD in array [1] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 24 + offset 45 + +Indexf(c) + return void + param c ColorIndexValueF in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv Indexfv + version 1.0 + deprecated 3.1 + offset 46 + +Indexfv(c) + return void + param c ColorIndexValueF in array [1] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 25 + offset 47 + +Indexi(c) + return void + param c ColorIndexValueI in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv Indexiv + version 1.0 + deprecated 3.1 + offset 48 + +Indexiv(c) + return void + param c ColorIndexValueI in array [1] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 26 + offset 49 + +Indexs(c) + return void + param c ColorIndexValueS in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv Indexsv + version 1.0 + deprecated 3.1 + offset 50 + +Indexsv(c) + return void + param c ColorIndexValueS in array [1] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 27 + offset 51 + +Normal3b(nx, ny, nz) + return void + param nx Int8 in value + param ny Int8 in value + param nz Int8 in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv Normal3bv + version 1.0 + deprecated 3.1 + offset 52 + +Normal3bv(v) + return void + param v Int8 in array [3] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 28 + offset 53 + +Normal3d(nx, ny, nz) + return void + param nx CoordD in value + param ny CoordD in value + param nz CoordD in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv Normal3dv + version 1.0 + deprecated 3.1 + offset 54 + +Normal3dv(v) + return void + param v CoordD in array [3] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 29 + offset 55 + +Normal3f(nx, ny, nz) + return void + param nx CoordF in value + param ny CoordF in value + param nz CoordF in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv Normal3fv + version 1.0 + deprecated 3.1 + offset 56 + +Normal3fv(v) + return void + param v CoordF in array [3] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 30 + offset 57 + +Normal3i(nx, ny, nz) + return void + param nx Int32 in value + param ny Int32 in value + param nz Int32 in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv Normal3iv + version 1.0 + deprecated 3.1 + offset 58 + +Normal3iv(v) + return void + param v Int32 in array [3] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 31 + offset 59 + +Normal3s(nx, ny, nz) + return void + param nx Int16 in value + param ny Int16 in value + param nz Int16 in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv Normal3sv + version 1.0 + deprecated 3.1 + offset 60 + +Normal3sv(v) + return void + param v Int16 in array [3] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 32 + offset 61 + +RasterPos2d(x, y) + return void + param x CoordD in value + param y CoordD in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv RasterPos2dv + version 1.0 + deprecated 3.1 + offset 62 + +RasterPos2dv(v) + return void + param v CoordD in array [2] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 33 + offset 63 + +RasterPos2f(x, y) + return void + param x CoordF in value + param y CoordF in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv RasterPos2fv + version 1.0 + deprecated 3.1 + offset 64 + +RasterPos2fv(v) + return void + param v CoordF in array [2] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 34 + offset 65 + +RasterPos2i(x, y) + return void + param x CoordI in value + param y CoordI in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv RasterPos2iv + version 1.0 + deprecated 3.1 + offset 66 + +RasterPos2iv(v) + return void + param v CoordI in array [2] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 35 + offset 67 + +RasterPos2s(x, y) + return void + param x CoordS in value + param y CoordS in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv RasterPos2sv + version 1.0 + deprecated 3.1 + offset 68 + +RasterPos2sv(v) + return void + param v CoordS in array [2] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 36 + offset 69 + +RasterPos3d(x, y, z) + return void + param x CoordD in value + param y CoordD in value + param z CoordD in value + vectorequiv RasterPos3dv + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + offset 70 + +RasterPos3dv(v) + return void + param v CoordD in array [3] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 37 + offset 71 + +RasterPos3f(x, y, z) + return void + param x CoordF in value + param y CoordF in value + param z CoordF in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv RasterPos3fv + version 1.0 + deprecated 3.1 + offset 72 + +RasterPos3fv(v) + return void + param v CoordF in array [3] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 38 + offset 73 + +RasterPos3i(x, y, z) + return void + param x CoordI in value + param y CoordI in value + param z CoordI in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv RasterPos3iv + version 1.0 + deprecated 3.1 + offset 74 + +RasterPos3iv(v) + return void + param v CoordI in array [3] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 39 + offset 75 + +RasterPos3s(x, y, z) + return void + param x CoordS in value + param y CoordS in value + param z CoordS in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv RasterPos3sv + version 1.0 + deprecated 3.1 + offset 76 + +RasterPos3sv(v) + return void + param v CoordS in array [3] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 40 + offset 77 + +RasterPos4d(x, y, z, w) + return void + param x CoordD in value + param y CoordD in value + param z CoordD in value + param w CoordD in value + vectorequiv RasterPos4dv + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + offset 78 + +RasterPos4dv(v) + return void + param v CoordD in array [4] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 41 + offset 79 + +RasterPos4f(x, y, z, w) + return void + param x CoordF in value + param y CoordF in value + param z CoordF in value + param w CoordF in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv RasterPos4fv + version 1.0 + deprecated 3.1 + offset 80 + +RasterPos4fv(v) + return void + param v CoordF in array [4] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 42 + offset 81 + +RasterPos4i(x, y, z, w) + return void + param x CoordI in value + param y CoordI in value + param z CoordI in value + param w CoordI in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv RasterPos4iv + version 1.0 + deprecated 3.1 + offset 82 + +RasterPos4iv(v) + return void + param v CoordI in array [4] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 43 + offset 83 + +RasterPos4s(x, y, z, w) + return void + param x CoordS in value + param y CoordS in value + param z CoordS in value + param w CoordS in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv RasterPos4sv + version 1.0 + deprecated 3.1 + offset 84 + +RasterPos4sv(v) + return void + param v CoordS in array [4] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 44 + offset 85 + +Rectd(x1, y1, x2, y2) + return void + param x1 CoordD in value + param y1 CoordD in value + param x2 CoordD in value + param y2 CoordD in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv Rectdv + version 1.0 + deprecated 3.1 + offset 86 + +Rectdv(v1, v2) + return void + param v1 CoordD in array [2] + param v2 CoordD in array [2] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 45 + offset 87 + +Rectf(x1, y1, x2, y2) + return void + param x1 CoordF in value + param y1 CoordF in value + param x2 CoordF in value + param y2 CoordF in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv Rectfv + version 1.0 + deprecated 3.1 + offset 88 + +Rectfv(v1, v2) + return void + param v1 CoordF in array [2] + param v2 CoordF in array [2] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 46 + offset 89 + +Recti(x1, y1, x2, y2) + return void + param x1 CoordI in value + param y1 CoordI in value + param x2 CoordI in value + param y2 CoordI in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv Rectiv + version 1.0 + deprecated 3.1 + offset 90 + +Rectiv(v1, v2) + return void + param v1 CoordI in array [2] + param v2 CoordI in array [2] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 47 + offset 91 + +Rects(x1, y1, x2, y2) + return void + param x1 CoordS in value + param y1 CoordS in value + param x2 CoordS in value + param y2 CoordS in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv Rectsv + version 1.0 + deprecated 3.1 + offset 92 + +Rectsv(v1, v2) + return void + param v1 CoordS in array [2] + param v2 CoordS in array [2] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 48 + offset 93 + +TexCoord1d(s) + return void + param s CoordD in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv TexCoord1dv + version 1.0 + deprecated 3.1 + offset 94 + +TexCoord1dv(v) + return void + param v CoordD in array [1] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 49 + offset 95 + +TexCoord1f(s) + return void + param s CoordF in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv TexCoord1fv + version 1.0 + deprecated 3.1 + offset 96 + +TexCoord1fv(v) + return void + param v CoordF in array [1] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 50 + offset 97 + +TexCoord1i(s) + return void + param s CoordI in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv TexCoord1iv + version 1.0 + deprecated 3.1 + offset 98 + +TexCoord1iv(v) + return void + param v CoordI in array [1] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 51 + offset 99 + +TexCoord1s(s) + return void + param s CoordS in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv TexCoord1sv + version 1.0 + deprecated 3.1 + offset 100 + +TexCoord1sv(v) + return void + param v CoordS in array [1] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 52 + offset 101 + +TexCoord2d(s, t) + return void + param s CoordD in value + param t CoordD in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv TexCoord2dv + version 1.0 + deprecated 3.1 + offset 102 + +TexCoord2dv(v) + return void + param v CoordD in array [2] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 53 + offset 103 + +TexCoord2f(s, t) + return void + param s CoordF in value + param t CoordF in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv TexCoord2fv + version 1.0 + deprecated 3.1 + offset 104 + +TexCoord2fv(v) + return void + param v CoordF in array [2] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 54 + offset 105 + +TexCoord2i(s, t) + return void + param s CoordI in value + param t CoordI in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv TexCoord2iv + version 1.0 + deprecated 3.1 + offset 106 + +TexCoord2iv(v) + return void + param v CoordI in array [2] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 55 + offset 107 + +TexCoord2s(s, t) + return void + param s CoordS in value + param t CoordS in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv TexCoord2sv + version 1.0 + deprecated 3.1 + offset 108 + +TexCoord2sv(v) + return void + param v CoordS in array [2] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 56 + offset 109 + +TexCoord3d(s, t, r) + return void + param s CoordD in value + param t CoordD in value + param r CoordD in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv TexCoord3dv + version 1.0 + deprecated 3.1 + offset 110 + +TexCoord3dv(v) + return void + param v CoordD in array [3] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 57 + offset 111 + +TexCoord3f(s, t, r) + return void + param s CoordF in value + param t CoordF in value + param r CoordF in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv TexCoord3fv + version 1.0 + deprecated 3.1 + offset 112 + +TexCoord3fv(v) + return void + param v CoordF in array [3] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 58 + offset 113 + +TexCoord3i(s, t, r) + return void + param s CoordI in value + param t CoordI in value + param r CoordI in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv TexCoord3iv + version 1.0 + deprecated 3.1 + offset 114 + +TexCoord3iv(v) + return void + param v CoordI in array [3] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 59 + offset 115 + +TexCoord3s(s, t, r) + return void + param s CoordS in value + param t CoordS in value + param r CoordS in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv TexCoord3sv + version 1.0 + deprecated 3.1 + offset 116 + +TexCoord3sv(v) + return void + param v CoordS in array [3] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 60 + offset 117 + +TexCoord4d(s, t, r, q) + return void + param s CoordD in value + param t CoordD in value + param r CoordD in value + param q CoordD in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv TexCoord4dv + version 1.0 + deprecated 3.1 + offset 118 + +TexCoord4dv(v) + return void + param v CoordD in array [4] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 61 + offset 119 + +TexCoord4f(s, t, r, q) + return void + param s CoordF in value + param t CoordF in value + param r CoordF in value + param q CoordF in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv TexCoord4fv + version 1.0 + deprecated 3.1 + offset 120 + +TexCoord4fv(v) + return void + param v CoordF in array [4] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 62 + offset 121 + +TexCoord4i(s, t, r, q) + return void + param s CoordI in value + param t CoordI in value + param r CoordI in value + param q CoordI in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv TexCoord4iv + version 1.0 + deprecated 3.1 + offset 122 + +TexCoord4iv(v) + return void + param v CoordI in array [4] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 63 + offset 123 + +TexCoord4s(s, t, r, q) + return void + param s CoordS in value + param t CoordS in value + param r CoordS in value + param q CoordS in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv TexCoord4sv + version 1.0 + deprecated 3.1 + offset 124 + +TexCoord4sv(v) + return void + param v CoordS in array [4] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 64 + offset 125 + +Vertex2d(x, y) + return void + param x CoordD in value + param y CoordD in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv Vertex2dv + version 1.0 + deprecated 3.1 + offset 126 + +Vertex2dv(v) + return void + param v CoordD in array [2] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 65 + offset 127 + +Vertex2f(x, y) + return void + param x CoordF in value + param y CoordF in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv Vertex2fv + version 1.0 + deprecated 3.1 + offset 128 + +Vertex2fv(v) + return void + param v CoordF in array [2] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 66 + offset 129 + +Vertex2i(x, y) + return void + param x CoordI in value + param y CoordI in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv Vertex2iv + version 1.0 + deprecated 3.1 + offset 130 + +Vertex2iv(v) + return void + param v CoordI in array [2] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 67 + offset 131 + +Vertex2s(x, y) + return void + param x CoordS in value + param y CoordS in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv Vertex2sv + version 1.0 + deprecated 3.1 + offset 132 + +Vertex2sv(v) + return void + param v CoordS in array [2] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 68 + offset 133 + +Vertex3d(x, y, z) + return void + param x CoordD in value + param y CoordD in value + param z CoordD in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv Vertex3dv + version 1.0 + deprecated 3.1 + offset 134 + +Vertex3dv(v) + return void + param v CoordD in array [3] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 69 + offset 135 + +Vertex3f(x, y, z) + return void + param x CoordF in value + param y CoordF in value + param z CoordF in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv Vertex3fv + version 1.0 + deprecated 3.1 + offset 136 + +Vertex3fv(v) + return void + param v CoordF in array [3] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 70 + offset 137 + +Vertex3i(x, y, z) + return void + param x CoordI in value + param y CoordI in value + param z CoordI in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv Vertex3iv + version 1.0 + deprecated 3.1 + offset 138 + +Vertex3iv(v) + return void + param v CoordI in array [3] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 71 + offset 139 + +Vertex3s(x, y, z) + return void + param x CoordS in value + param y CoordS in value + param z CoordS in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv Vertex3sv + version 1.0 + deprecated 3.1 + offset 140 + +Vertex3sv(v) + return void + param v CoordS in array [3] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 72 + offset 141 + +Vertex4d(x, y, z, w) + return void + param x CoordD in value + param y CoordD in value + param z CoordD in value + param w CoordD in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv Vertex4dv + version 1.0 + deprecated 3.1 + offset 142 + +Vertex4dv(v) + return void + param v CoordD in array [4] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 73 + offset 143 + +Vertex4f(x, y, z, w) + return void + param x CoordF in value + param y CoordF in value + param z CoordF in value + param w CoordF in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv Vertex4fv + version 1.0 + deprecated 3.1 + offset 144 + +Vertex4fv(v) + return void + param v CoordF in array [4] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 74 + offset 145 + +Vertex4i(x, y, z, w) + return void + param x CoordI in value + param y CoordI in value + param z CoordI in value + param w CoordI in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv Vertex4iv + version 1.0 + deprecated 3.1 + offset 146 + +Vertex4iv(v) + return void + param v CoordI in array [4] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 75 + offset 147 + +Vertex4s(x, y, z, w) + return void + param x CoordS in value + param y CoordS in value + param z CoordS in value + param w CoordS in value + category VERSION_1_0_DEPRECATED # old: drawing + vectorequiv Vertex4sv + version 1.0 + deprecated 3.1 + offset 148 + +Vertex4sv(v) + return void + param v CoordS in array [4] + category VERSION_1_0_DEPRECATED # old: drawing + version 1.0 + deprecated 3.1 + glxropcode 76 + offset 149 + +ClipPlane(plane, equation) + return void + param plane ClipPlaneName in value + param equation Float64 in array [4] + category VERSION_1_0_DEPRECATED # old: drawing-control + version 1.0 + deprecated 3.1 + glxropcode 77 + offset 150 + +ColorMaterial(face, mode) + return void + param face MaterialFace in value + param mode ColorMaterialParameter in value + category VERSION_1_0_DEPRECATED # old: drawing-control + version 1.0 + deprecated 3.1 + glxropcode 78 + offset 151 + +Fogf(pname, param) + return void + param pname FogParameter in value + param param CheckedFloat32 in value + category VERSION_1_0_DEPRECATED # old: drawing-control + version 1.0 + deprecated 3.1 + glxropcode 80 + wglflags small-data + offset 153 + +Fogfv(pname, params) + return void + param pname FogParameter in value + param params CheckedFloat32 in array [COMPSIZE(pname)] + category VERSION_1_0_DEPRECATED # old: drawing-control + version 1.0 + deprecated 3.1 + glxropcode 81 + wglflags small-data + offset 154 + +Fogi(pname, param) + return void + param pname FogParameter in value + param param CheckedInt32 in value + category VERSION_1_0_DEPRECATED # old: drawing-control + version 1.0 + deprecated 3.1 + glxropcode 82 + wglflags small-data + offset 155 + +Fogiv(pname, params) + return void + param pname FogParameter in value + param params CheckedInt32 in array [COMPSIZE(pname)] + category VERSION_1_0_DEPRECATED # old: drawing-control + version 1.0 + deprecated 3.1 + glxropcode 83 + wglflags small-data + offset 156 + +Lightf(light, pname, param) + return void + param light LightName in value + param pname LightParameter in value + param param CheckedFloat32 in value + category VERSION_1_0_DEPRECATED # old: drawing-control + version 1.0 + deprecated 3.1 + glxropcode 86 + wglflags small-data + offset 159 + +Lightfv(light, pname, params) + return void + param light LightName in value + param pname LightParameter in value + param params CheckedFloat32 in array [COMPSIZE(pname)] + category VERSION_1_0_DEPRECATED # old: drawing-control + version 1.0 + deprecated 3.1 + glxropcode 87 + wglflags small-data + offset 160 + +Lighti(light, pname, param) + return void + param light LightName in value + param pname LightParameter in value + param param CheckedInt32 in value + category VERSION_1_0_DEPRECATED # old: drawing-control + version 1.0 + deprecated 3.1 + glxropcode 88 + wglflags small-data + offset 161 + +Lightiv(light, pname, params) + return void + param light LightName in value + param pname LightParameter in value + param params CheckedInt32 in array [COMPSIZE(pname)] + category VERSION_1_0_DEPRECATED # old: drawing-control + version 1.0 + deprecated 3.1 + glxropcode 89 + wglflags small-data + offset 162 + +LightModelf(pname, param) + return void + param pname LightModelParameter in value + param param Float32 in value + category VERSION_1_0_DEPRECATED # old: drawing-control + version 1.0 + deprecated 3.1 + glxropcode 90 + wglflags small-data + offset 163 + +LightModelfv(pname, params) + return void + param pname LightModelParameter in value + param params Float32 in array [COMPSIZE(pname)] + category VERSION_1_0_DEPRECATED # old: drawing-control + version 1.0 + deprecated 3.1 + glxropcode 91 + wglflags small-data + offset 164 + +LightModeli(pname, param) + return void + param pname LightModelParameter in value + param param Int32 in value + category VERSION_1_0_DEPRECATED # old: drawing-control + version 1.0 + deprecated 3.1 + glxropcode 92 + wglflags small-data + offset 165 + +LightModeliv(pname, params) + return void + param pname LightModelParameter in value + param params Int32 in array [COMPSIZE(pname)] + category VERSION_1_0_DEPRECATED # old: drawing-control + version 1.0 + deprecated 3.1 + glxropcode 93 + wglflags small-data + offset 166 + +LineStipple(factor, pattern) + return void + param factor CheckedInt32 in value + param pattern LineStipple in value + category VERSION_1_0_DEPRECATED # old: drawing-control + version 1.0 + deprecated 3.1 + glxropcode 94 + offset 167 + +Materialf(face, pname, param) + return void + param face MaterialFace in value + param pname MaterialParameter in value + param param CheckedFloat32 in value + category VERSION_1_0_DEPRECATED # old: drawing-control + version 1.0 + deprecated 3.1 + glxropcode 96 + wglflags small-data + offset 169 + +Materialfv(face, pname, params) + return void + param face MaterialFace in value + param pname MaterialParameter in value + param params CheckedFloat32 in array [COMPSIZE(pname)] + category VERSION_1_0_DEPRECATED # old: drawing-control + version 1.0 + deprecated 3.1 + glxropcode 97 + wglflags small-data + offset 170 + +Materiali(face, pname, param) + return void + param face MaterialFace in value + param pname MaterialParameter in value + param param CheckedInt32 in value + category VERSION_1_0_DEPRECATED # old: drawing-control + version 1.0 + deprecated 3.1 + glxropcode 98 + wglflags small-data + offset 171 + +Materialiv(face, pname, params) + return void + param face MaterialFace in value + param pname MaterialParameter in value + param params CheckedInt32 in array [COMPSIZE(pname)] + category VERSION_1_0_DEPRECATED # old: drawing-control + version 1.0 + deprecated 3.1 + glxropcode 99 + wglflags small-data + offset 172 + +PolygonStipple(mask) + return void + param mask UInt8 in array [COMPSIZE()] + category VERSION_1_0_DEPRECATED # old: drawing-control + dlflags handcode + glxflags client-handcode server-handcode + version 1.0 + deprecated 3.1 + glxropcode 102 + wglflags client-handcode server-handcode + offset 175 + +ShadeModel(mode) + return void + param mode ShadingModel in value + category VERSION_1_0_DEPRECATED # old: drawing-control + version 1.0 + deprecated 3.1 + glxropcode 104 + offset 177 + +TexEnvf(target, pname, param) + return void + param target TextureEnvTarget in value + param pname TextureEnvParameter in value + param param CheckedFloat32 in value + category VERSION_1_0_DEPRECATED # old: drawing-control + version 1.0 + deprecated 3.1 + glxropcode 111 + wglflags small-data + offset 184 + +TexEnvfv(target, pname, params) + return void + param target TextureEnvTarget in value + param pname TextureEnvParameter in value + param params CheckedFloat32 in array [COMPSIZE(pname)] + category VERSION_1_0_DEPRECATED # old: drawing-control + version 1.0 + deprecated 3.1 + glxropcode 112 + wglflags small-data + offset 185 + +TexEnvi(target, pname, param) + return void + param target TextureEnvTarget in value + param pname TextureEnvParameter in value + param param CheckedInt32 in value + category VERSION_1_0_DEPRECATED # old: drawing-control + version 1.0 + deprecated 3.1 + glxropcode 113 + wglflags small-data + offset 186 + +TexEnviv(target, pname, params) + return void + param target TextureEnvTarget in value + param pname TextureEnvParameter in value + param params CheckedInt32 in array [COMPSIZE(pname)] + category VERSION_1_0_DEPRECATED # old: drawing-control + version 1.0 + deprecated 3.1 + glxropcode 114 + wglflags small-data + offset 187 + +TexGend(coord, pname, param) + return void + param coord TextureCoordName in value + param pname TextureGenParameter in value + param param Float64 in value + category VERSION_1_0_DEPRECATED # old: drawing-control + version 1.0 + deprecated 3.1 + glxropcode 115 + wglflags small-data + offset 188 + +TexGendv(coord, pname, params) + return void + param coord TextureCoordName in value + param pname TextureGenParameter in value + param params Float64 in array [COMPSIZE(pname)] + category VERSION_1_0_DEPRECATED # old: drawing-control + version 1.0 + deprecated 3.1 + glxropcode 116 + wglflags small-data + offset 189 + +TexGenf(coord, pname, param) + return void + param coord TextureCoordName in value + param pname TextureGenParameter in value + param param CheckedFloat32 in value + category VERSION_1_0_DEPRECATED # old: drawing-control + version 1.0 + deprecated 3.1 + glxropcode 117 + wglflags small-data + offset 190 + +TexGenfv(coord, pname, params) + return void + param coord TextureCoordName in value + param pname TextureGenParameter in value + param params CheckedFloat32 in array [COMPSIZE(pname)] + category VERSION_1_0_DEPRECATED # old: drawing-control + version 1.0 + deprecated 3.1 + glxropcode 118 + wglflags small-data + offset 191 + +TexGeni(coord, pname, param) + return void + param coord TextureCoordName in value + param pname TextureGenParameter in value + param param CheckedInt32 in value + category VERSION_1_0_DEPRECATED # old: drawing-control + version 1.0 + deprecated 3.1 + glxropcode 119 + wglflags small-data + offset 192 + +TexGeniv(coord, pname, params) + return void + param coord TextureCoordName in value + param pname TextureGenParameter in value + param params CheckedInt32 in array [COMPSIZE(pname)] + category VERSION_1_0_DEPRECATED # old: drawing-control + version 1.0 + deprecated 3.1 + glxropcode 120 + wglflags small-data + offset 193 + +# feedback commands + +FeedbackBuffer(size, type, buffer) + return void + param size SizeI in value + param type FeedbackType in value + param buffer FeedbackElement out array [size] retained + dlflags notlistable + glxflags client-handcode server-handcode + category VERSION_1_0_DEPRECATED # old: feedback + version 1.0 + deprecated 3.1 + glxsingle 105 + wglflags client-handcode server-handcode batchable + offset 194 + +SelectBuffer(size, buffer) + return void + param size SizeI in value + param buffer SelectName out array [size] retained + dlflags notlistable + glxflags client-handcode server-handcode + category VERSION_1_0_DEPRECATED # old: feedback + version 1.0 + deprecated 3.1 + glxsingle 106 + wglflags client-handcode server-handcode batchable + offset 195 + +RenderMode(mode) + return Int32 + param mode RenderingMode in value + category VERSION_1_0_DEPRECATED # old: feedback + dlflags notlistable + glxflags client-handcode server-handcode + version 1.0 + deprecated 3.1 + glxsingle 107 + wglflags client-handcode server-handcode + offset 196 + +InitNames() + return void + category VERSION_1_0_DEPRECATED # old: feedback + version 1.0 + deprecated 3.1 + glxropcode 121 + offset 197 + +LoadName(name) + return void + param name SelectName in value + category VERSION_1_0_DEPRECATED # old: feedback + version 1.0 + deprecated 3.1 + glxropcode 122 + offset 198 + +PassThrough(token) + return void + param token FeedbackElement in value + category VERSION_1_0_DEPRECATED # old: feedback + version 1.0 + deprecated 3.1 + glxropcode 123 + offset 199 + +PopName() + return void + category VERSION_1_0_DEPRECATED # old: feedback + version 1.0 + deprecated 3.1 + glxropcode 124 + offset 200 + +PushName(name) + return void + param name SelectName in value + category VERSION_1_0_DEPRECATED # old: feedback + version 1.0 + deprecated 3.1 + glxropcode 125 + offset 201 + +ClearAccum(red, green, blue, alpha) + return void + param red Float32 in value + param green Float32 in value + param blue Float32 in value + param alpha Float32 in value + category VERSION_1_0_DEPRECATED # old: framebuf + version 1.0 + deprecated 3.1 + glxropcode 128 + offset 204 + +ClearIndex(c) + return void + param c MaskedColorIndexValueF in value + category VERSION_1_0_DEPRECATED # old: framebuf + version 1.0 + deprecated 3.1 + glxropcode 129 + offset 205 + +IndexMask(mask) + return void + param mask MaskedColorIndexValueI in value + category VERSION_1_0_DEPRECATED # old: framebuf + version 1.0 + deprecated 3.1 + glxropcode 136 + offset 212 + +Accum(op, value) + return void + param op AccumOp in value + param value CoordF in value + category VERSION_1_0_DEPRECATED # old: misc + version 1.0 + deprecated 3.1 + glxropcode 137 + offset 213 + +PopAttrib() + return void + category VERSION_1_0_DEPRECATED # old: misc + version 1.0 + deprecated 3.1 + glxropcode 141 + offset 218 + +PushAttrib(mask) + return void + param mask AttribMask in value + category VERSION_1_0_DEPRECATED # old: misc + version 1.0 + deprecated 3.1 + glxropcode 142 + offset 219 + +# modeling commands + +Map1d(target, u1, u2, stride, order, points) + return void + param target MapTarget in value + param u1 CoordD in value + param u2 CoordD in value + param stride Int32 in value + param order CheckedInt32 in value + param points CoordD in array [COMPSIZE(target/stride/order)] + category VERSION_1_0_DEPRECATED # old: modeling + dlflags handcode + glxflags client-handcode server-handcode + version 1.0 + deprecated 3.1 + glxropcode 143 + wglflags client-handcode server-handcode + offset 220 + +Map1f(target, u1, u2, stride, order, points) + return void + param target MapTarget in value + param u1 CoordF in value + param u2 CoordF in value + param stride Int32 in value + param order CheckedInt32 in value + param points CoordF in array [COMPSIZE(target/stride/order)] + category VERSION_1_0_DEPRECATED # old: modeling + dlflags handcode + glxflags client-handcode server-handcode + version 1.0 + deprecated 3.1 + glxropcode 144 + wglflags client-handcode server-handcode + offset 221 + +Map2d(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points) + return void + param target MapTarget in value + param u1 CoordD in value + param u2 CoordD in value + param ustride Int32 in value + param uorder CheckedInt32 in value + param v1 CoordD in value + param v2 CoordD in value + param vstride Int32 in value + param vorder CheckedInt32 in value + param points CoordD in array [COMPSIZE(target/ustride/uorder/vstride/vorder)] + category VERSION_1_0_DEPRECATED # old: modeling + dlflags handcode + glxflags client-handcode server-handcode + version 1.0 + deprecated 3.1 + glxropcode 145 + wglflags client-handcode server-handcode + offset 222 + +Map2f(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points) + return void + param target MapTarget in value + param u1 CoordF in value + param u2 CoordF in value + param ustride Int32 in value + param uorder CheckedInt32 in value + param v1 CoordF in value + param v2 CoordF in value + param vstride Int32 in value + param vorder CheckedInt32 in value + param points CoordF in array [COMPSIZE(target/ustride/uorder/vstride/vorder)] + category VERSION_1_0_DEPRECATED # old: modeling + dlflags handcode + glxflags client-handcode server-handcode + version 1.0 + deprecated 3.1 + glxropcode 146 + wglflags client-handcode server-handcode + offset 223 + +MapGrid1d(un, u1, u2) + return void + param un Int32 in value + param u1 CoordD in value + param u2 CoordD in value + category VERSION_1_0_DEPRECATED # old: modeling + version 1.0 + deprecated 3.1 + glxropcode 147 + offset 224 + +MapGrid1f(un, u1, u2) + return void + param un Int32 in value + param u1 CoordF in value + param u2 CoordF in value + category VERSION_1_0_DEPRECATED # old: modeling + version 1.0 + deprecated 3.1 + glxropcode 148 + offset 225 + +MapGrid2d(un, u1, u2, vn, v1, v2) + return void + param un Int32 in value + param u1 CoordD in value + param u2 CoordD in value + param vn Int32 in value + param v1 CoordD in value + param v2 CoordD in value + category VERSION_1_0_DEPRECATED # old: modeling + version 1.0 + deprecated 3.1 + glxropcode 149 + offset 226 + +MapGrid2f(un, u1, u2, vn, v1, v2) + return void + param un Int32 in value + param u1 CoordF in value + param u2 CoordF in value + param vn Int32 in value + param v1 CoordF in value + param v2 CoordF in value + category VERSION_1_0_DEPRECATED # old: modeling + version 1.0 + deprecated 3.1 + glxropcode 150 + offset 227 + +EvalCoord1d(u) + return void + param u CoordD in value + category VERSION_1_0_DEPRECATED # old: modeling + vectorequiv EvalCoord1dv + version 1.0 + deprecated 3.1 + offset 228 + +EvalCoord1dv(u) + return void + param u CoordD in array [1] + category VERSION_1_0_DEPRECATED # old: modeling + version 1.0 + deprecated 3.1 + glxropcode 151 + offset 229 + +EvalCoord1f(u) + return void + param u CoordF in value + category VERSION_1_0_DEPRECATED # old: modeling + vectorequiv EvalCoord1fv + version 1.0 + deprecated 3.1 + offset 230 + +EvalCoord1fv(u) + return void + param u CoordF in array [1] + category VERSION_1_0_DEPRECATED # old: modeling + version 1.0 + deprecated 3.1 + glxropcode 152 + offset 231 + +EvalCoord2d(u, v) + return void + param u CoordD in value + param v CoordD in value + category VERSION_1_0_DEPRECATED # old: modeling + vectorequiv EvalCoord2dv + version 1.0 + deprecated 3.1 + offset 232 + +EvalCoord2dv(u) + return void + param u CoordD in array [2] + category VERSION_1_0_DEPRECATED # old: modeling + version 1.0 + deprecated 3.1 + glxropcode 153 + offset 233 + +EvalCoord2f(u, v) + return void + param u CoordF in value + param v CoordF in value + category VERSION_1_0_DEPRECATED # old: modeling + vectorequiv EvalCoord2fv + version 1.0 + deprecated 3.1 + offset 234 + +EvalCoord2fv(u) + return void + param u CoordF in array [2] + category VERSION_1_0_DEPRECATED # old: modeling + version 1.0 + deprecated 3.1 + glxropcode 154 + offset 235 + +EvalMesh1(mode, i1, i2) + return void + param mode MeshMode1 in value + param i1 CheckedInt32 in value + param i2 CheckedInt32 in value + category VERSION_1_0_DEPRECATED # old: modeling + version 1.0 + deprecated 3.1 + glxropcode 155 + offset 236 + +EvalPoint1(i) + return void + param i Int32 in value + category VERSION_1_0_DEPRECATED # old: modeling + version 1.0 + deprecated 3.1 + glxropcode 156 + offset 237 + +EvalMesh2(mode, i1, i2, j1, j2) + return void + param mode MeshMode2 in value + param i1 CheckedInt32 in value + param i2 CheckedInt32 in value + param j1 CheckedInt32 in value + param j2 CheckedInt32 in value + category VERSION_1_0_DEPRECATED # old: modeling + version 1.0 + deprecated 3.1 + glxropcode 157 + offset 238 + +EvalPoint2(i, j) + return void + param i CheckedInt32 in value + param j CheckedInt32 in value + category VERSION_1_0_DEPRECATED # old: modeling + version 1.0 + deprecated 3.1 + glxropcode 158 + offset 239 + +AlphaFunc(func, ref) + return void + param func AlphaFunction in value + param ref ClampedFloat32 in value + category VERSION_1_0_DEPRECATED # old: pixel-op + version 1.0 + deprecated 3.1 + glxropcode 159 + offset 240 + +PixelZoom(xfactor, yfactor) + return void + param xfactor Float32 in value + param yfactor Float32 in value + category VERSION_1_0_DEPRECATED # old: pixel-rw + version 1.0 + deprecated 3.1 + glxropcode 165 + offset 246 + +PixelTransferf(pname, param) + return void + param pname PixelTransferParameter in value + param param CheckedFloat32 in value + category VERSION_1_0_DEPRECATED # old: pixel-rw + version 1.0 + deprecated 3.1 + glxropcode 166 + offset 247 + +PixelTransferi(pname, param) + return void + param pname PixelTransferParameter in value + param param CheckedInt32 in value + category VERSION_1_0_DEPRECATED # old: pixel-rw + version 1.0 + deprecated 3.1 + glxropcode 167 + offset 248 + +PixelMapfv(map, mapsize, values) + return void + param map PixelMap in value + param mapsize CheckedInt32 in value + param values Float32 in array [mapsize] + category VERSION_1_0_DEPRECATED # old: pixel-rw + glxflags client-handcode + version 1.0 + deprecated 3.1 + glxropcode 168 + offset 251 + +PixelMapuiv(map, mapsize, values) + return void + param map PixelMap in value + param mapsize CheckedInt32 in value + param values UInt32 in array [mapsize] + category VERSION_1_0_DEPRECATED # old: pixel-rw + glxflags client-handcode + version 1.0 + deprecated 3.1 + glxropcode 169 + offset 252 + +PixelMapusv(map, mapsize, values) + return void + param map PixelMap in value + param mapsize CheckedInt32 in value + param values UInt16 in array [mapsize] + category VERSION_1_0_DEPRECATED # old: pixel-rw + glxflags client-handcode + version 1.0 + deprecated 3.1 + glxropcode 170 + offset 253 + +CopyPixels(x, y, width, height, type) + return void + param x WinCoord in value + param y WinCoord in value + param width SizeI in value + param height SizeI in value + param type PixelCopyType in value + category VERSION_1_0_DEPRECATED # old: pixel-rw + version 1.0 + deprecated 3.1 + glxropcode 172 + offset 255 + +DrawPixels(width, height, format, type, pixels) + return void + param width SizeI in value + param height SizeI in value + param format PixelFormat in value + param type PixelType in value + param pixels Void in array [COMPSIZE(format/type/width/height)] + category VERSION_1_0_DEPRECATED # old: pixel-rw + dlflags handcode + glxflags client-handcode server-handcode + version 1.0 + deprecated 3.1 + glxropcode 173 + wglflags client-handcode server-handcode + offset 257 + +GetClipPlane(plane, equation) + return void + param plane ClipPlaneName in value + param equation Float64 out array [4] + category VERSION_1_0_DEPRECATED # old: state-req + dlflags notlistable + version 1.0 + deprecated 3.1 + glxsingle 113 + glxflags client-handcode server-handcode + offset 259 + +GetLightfv(light, pname, params) + return void + param light LightName in value + param pname LightParameter in value + param params Float32 out array [COMPSIZE(pname)] + category VERSION_1_0_DEPRECATED # old: state-req + dlflags notlistable + version 1.0 + deprecated 3.1 + glxsingle 118 + wglflags small-data + offset 264 + +GetLightiv(light, pname, params) + return void + param light LightName in value + param pname LightParameter in value + param params Int32 out array [COMPSIZE(pname)] + category VERSION_1_0_DEPRECATED # old: state-req + dlflags notlistable + version 1.0 + deprecated 3.1 + glxsingle 119 + wglflags small-data + offset 265 + +GetMapdv(target, query, v) + return void + param target MapTarget in value + param query GetMapQuery in value + param v Float64 out array [COMPSIZE(target/query)] + category VERSION_1_0_DEPRECATED # old: state-req + dlflags notlistable + version 1.0 + deprecated 3.1 + glxsingle 120 + offset 266 + +GetMapfv(target, query, v) + return void + param target MapTarget in value + param query GetMapQuery in value + param v Float32 out array [COMPSIZE(target/query)] + category VERSION_1_0_DEPRECATED # old: state-req + dlflags notlistable + version 1.0 + deprecated 3.1 + glxsingle 121 + offset 267 + +GetMapiv(target, query, v) + return void + param target MapTarget in value + param query GetMapQuery in value + param v Int32 out array [COMPSIZE(target/query)] + category VERSION_1_0_DEPRECATED # old: state-req + dlflags notlistable + version 1.0 + deprecated 3.1 + glxsingle 122 + offset 268 + +GetMaterialfv(face, pname, params) + return void + param face MaterialFace in value + param pname MaterialParameter in value + param params Float32 out array [COMPSIZE(pname)] + category VERSION_1_0_DEPRECATED # old: state-req + dlflags notlistable + version 1.0 + deprecated 3.1 + glxsingle 123 + wglflags small-data + offset 269 + +GetMaterialiv(face, pname, params) + return void + param face MaterialFace in value + param pname MaterialParameter in value + param params Int32 out array [COMPSIZE(pname)] + category VERSION_1_0_DEPRECATED # old: state-req + dlflags notlistable + version 1.0 + deprecated 3.1 + glxsingle 124 + wglflags small-data + offset 270 + +GetPixelMapfv(map, values) + return void + param map PixelMap in value + param values Float32 out array [COMPSIZE(map)] + category VERSION_1_0_DEPRECATED # old: state-req + dlflags notlistable + version 1.0 + deprecated 3.1 + glxsingle 125 + offset 271 + +GetPixelMapuiv(map, values) + return void + param map PixelMap in value + param values UInt32 out array [COMPSIZE(map)] + category VERSION_1_0_DEPRECATED # old: state-req + dlflags notlistable + version 1.0 + deprecated 3.1 + glxsingle 126 + offset 272 + +GetPixelMapusv(map, values) + return void + param map PixelMap in value + param values UInt16 out array [COMPSIZE(map)] + category VERSION_1_0_DEPRECATED # old: state-req + dlflags notlistable + version 1.0 + deprecated 3.1 + glxsingle 127 + offset 273 + +GetPolygonStipple(mask) + return void + param mask UInt8 out array [COMPSIZE()] + category VERSION_1_0_DEPRECATED # old: state-req + dlflags notlistable + glxflags client-handcode server-handcode + version 1.0 + deprecated 3.1 + glxsingle 128 + wglflags client-handcode server-handcode + offset 274 + +GetTexEnvfv(target, pname, params) + return void + param target TextureEnvTarget in value + param pname TextureEnvParameter in value + param params Float32 out array [COMPSIZE(pname)] + category VERSION_1_0_DEPRECATED # old: state-req + dlflags notlistable + version 1.0 + deprecated 3.1 + glxsingle 130 + wglflags small-data + offset 276 + +GetTexEnviv(target, pname, params) + return void + param target TextureEnvTarget in value + param pname TextureEnvParameter in value + param params Int32 out array [COMPSIZE(pname)] + category VERSION_1_0_DEPRECATED # old: state-req + dlflags notlistable + version 1.0 + deprecated 3.1 + glxsingle 131 + wglflags small-data + offset 277 + +GetTexGendv(coord, pname, params) + return void + param coord TextureCoordName in value + param pname TextureGenParameter in value + param params Float64 out array [COMPSIZE(pname)] + category VERSION_1_0_DEPRECATED # old: state-req + dlflags notlistable + version 1.0 + deprecated 3.1 + glxsingle 132 + wglflags small-data + offset 278 + +GetTexGenfv(coord, pname, params) + return void + param coord TextureCoordName in value + param pname TextureGenParameter in value + param params Float32 out array [COMPSIZE(pname)] + category VERSION_1_0_DEPRECATED # old: state-req + dlflags notlistable + version 1.0 + deprecated 3.1 + glxsingle 133 + wglflags small-data + offset 279 + +GetTexGeniv(coord, pname, params) + return void + param coord TextureCoordName in value + param pname TextureGenParameter in value + param params Int32 out array [COMPSIZE(pname)] + category VERSION_1_0_DEPRECATED # old: state-req + dlflags notlistable + version 1.0 + deprecated 3.1 + glxsingle 134 + wglflags small-data + offset 280 + +IsList(list) + return Boolean + param list List in value + category VERSION_1_0_DEPRECATED # old: state-req + dlflags notlistable + version 1.0 + deprecated 3.1 + glxsingle 141 + offset 287 + +Frustum(left, right, bottom, top, zNear, zFar) + return void + param left Float64 in value + param right Float64 in value + param bottom Float64 in value + param top Float64 in value + param zNear Float64 in value + param zFar Float64 in value + category VERSION_1_0_DEPRECATED # old: xform + version 1.0 + deprecated 3.1 + glxropcode 175 + offset 289 + +LoadIdentity() + return void + category VERSION_1_0_DEPRECATED # old: xform + version 1.0 + deprecated 3.1 + glxropcode 176 + offset 290 + +LoadMatrixf(m) + return void + param m Float32 in array [16] + category VERSION_1_0_DEPRECATED # old: xform + version 1.0 + deprecated 3.1 + glxropcode 177 + offset 291 + +LoadMatrixd(m) + return void + param m Float64 in array [16] + category VERSION_1_0_DEPRECATED # old: xform + version 1.0 + deprecated 3.1 + glxropcode 178 + offset 292 + +MatrixMode(mode) + return void + param mode MatrixMode in value + category VERSION_1_0_DEPRECATED # old: xform + version 1.0 + deprecated 3.1 + glxropcode 179 + offset 293 + +MultMatrixf(m) + return void + param m Float32 in array [16] + category VERSION_1_0_DEPRECATED # old: xform + version 1.0 + deprecated 3.1 + glxropcode 180 + offset 294 + +MultMatrixd(m) + return void + param m Float64 in array [16] + category VERSION_1_0_DEPRECATED # old: xform + version 1.0 + deprecated 3.1 + glxropcode 181 + offset 295 + +Ortho(left, right, bottom, top, zNear, zFar) + return void + param left Float64 in value + param right Float64 in value + param bottom Float64 in value + param top Float64 in value + param zNear Float64 in value + param zFar Float64 in value + category VERSION_1_0_DEPRECATED # old: xform + version 1.0 + deprecated 3.1 + glxropcode 182 + offset 296 + +PopMatrix() + return void + category VERSION_1_0_DEPRECATED # old: xform + version 1.0 + deprecated 3.1 + glxropcode 183 + offset 297 + +PushMatrix() + return void + category VERSION_1_0_DEPRECATED # old: xform + version 1.0 + deprecated 3.1 + glxropcode 184 + offset 298 + +Rotated(angle, x, y, z) + return void + param angle Float64 in value + param x Float64 in value + param y Float64 in value + param z Float64 in value + category VERSION_1_0_DEPRECATED # old: xform + version 1.0 + deprecated 3.1 + glxropcode 185 + offset 299 + +Rotatef(angle, x, y, z) + return void + param angle Float32 in value + param x Float32 in value + param y Float32 in value + param z Float32 in value + category VERSION_1_0_DEPRECATED # old: xform + version 1.0 + deprecated 3.1 + glxropcode 186 + offset 300 + +Scaled(x, y, z) + return void + param x Float64 in value + param y Float64 in value + param z Float64 in value + category VERSION_1_0_DEPRECATED # old: xform + version 1.0 + deprecated 3.1 + glxropcode 187 + offset 301 + +Scalef(x, y, z) + return void + param x Float32 in value + param y Float32 in value + param z Float32 in value + category VERSION_1_0_DEPRECATED # old: xform + version 1.0 + deprecated 3.1 + glxropcode 188 + offset 302 + +Translated(x, y, z) + return void + param x Float64 in value + param y Float64 in value + param z Float64 in value + category VERSION_1_0_DEPRECATED # old: xform + version 1.0 + deprecated 3.1 + glxropcode 189 + offset 303 + +Translatef(x, y, z) + return void + param x Float32 in value + param y Float32 in value + param z Float32 in value + category VERSION_1_0_DEPRECATED # old: xform + version 1.0 + deprecated 3.1 + glxropcode 190 + offset 304 + +############################################################################### +############################################################################### +# +# OpenGL 1.1 commands +# +############################################################################### +############################################################################### + +DrawArrays(mode, first, count) + return void + param mode BeginMode in value + param first Int32 in value + param count SizeI in value + category VERSION_1_1 + dlflags handcode + glxflags client-handcode client-intercept server-handcode + version 1.1 + glxropcode 193 + offset 310 + +DrawElements(mode, count, type, indices) + return void + param mode BeginMode in value + param count SizeI in value + param type DrawElementsType in value + param indices Void in array [COMPSIZE(count/type)] + category VERSION_1_1 + dlflags handcode + glxflags client-handcode client-intercept server-handcode + version 1.1 + offset 311 + +GetPointerv(pname, params) + return void + param pname GetPointervPName in value + param params VoidPointer out array [1] + category VERSION_1_1 + dlflags notlistable + glxflags client-handcode client-intercept server-handcode + version 1.1 + offset 329 + +PolygonOffset(factor, units) + return void + param factor Float32 in value + param units Float32 in value + category VERSION_1_1 + version 1.1 + glxropcode 192 + offset 319 + +# Arguably TexelInternalFormat, not PixelInternalFormat +CopyTexImage1D(target, level, internalformat, x, y, width, border) + return void + param target TextureTarget in value + param level CheckedInt32 in value + param internalformat PixelInternalFormat in value + param x WinCoord in value + param y WinCoord in value + param width SizeI in value + param border CheckedInt32 in value + category VERSION_1_1 + version 1.1 + glxropcode 4119 + glxflags EXT + offset 323 + +# Arguably TexelInternalFormat, not PixelInternalFormat +CopyTexImage2D(target, level, internalformat, x, y, width, height, border) + return void + param target TextureTarget in value + param level CheckedInt32 in value + param internalformat PixelInternalFormat in value + param x WinCoord in value + param y WinCoord in value + param width SizeI in value + param height SizeI in value + param border CheckedInt32 in value + category VERSION_1_1 + version 1.1 + glxropcode 4120 + glxflags EXT + offset 324 + +CopyTexSubImage1D(target, level, xoffset, x, y, width) + return void + param target TextureTarget in value + param level CheckedInt32 in value + param xoffset CheckedInt32 in value + param x WinCoord in value + param y WinCoord in value + param width SizeI in value + category VERSION_1_1 + version 1.1 + glxropcode 4121 + glxflags EXT + offset 325 + +CopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height) + return void + param target TextureTarget in value + param level CheckedInt32 in value + param xoffset CheckedInt32 in value + param yoffset CheckedInt32 in value + param x WinCoord in value + param y WinCoord in value + param width SizeI in value + param height SizeI in value + category VERSION_1_1 + version 1.1 + glxropcode 4122 + glxflags EXT + offset 326 + +TexSubImage1D(target, level, xoffset, width, format, type, pixels) + return void + param target TextureTarget in value + param level CheckedInt32 in value + param xoffset CheckedInt32 in value + param width SizeI in value + param format PixelFormat in value + param type PixelType in value + param pixels Void in array [COMPSIZE(format/type/width)] + category VERSION_1_1 + dlflags handcode + glxflags EXT client-handcode server-handcode + version 1.1 + glxropcode 4099 + offset 332 + +TexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels) + return void + param target TextureTarget in value + param level CheckedInt32 in value + param xoffset CheckedInt32 in value + param yoffset CheckedInt32 in value + param width SizeI in value + param height SizeI in value + param format PixelFormat in value + param type PixelType in value + param pixels Void in array [COMPSIZE(format/type/width/height)] + category VERSION_1_1 + dlflags handcode + glxflags EXT client-handcode server-handcode + version 1.1 + glxropcode 4100 + offset 333 + +BindTexture(target, texture) + return void + param target TextureTarget in value + param texture Texture in value + category VERSION_1_1 + version 1.1 + glxropcode 4117 + glxflags EXT + offset 307 + +DeleteTextures(n, textures) + return void + param n SizeI in value + param textures Texture in array [n] + category VERSION_1_1 + dlflags notlistable + version 1.1 + glxsingle 144 + offset 327 + +GenTextures(n, textures) + return void + param n SizeI in value + param textures Texture out array [n] + category VERSION_1_1 + dlflags notlistable + version 1.1 + glxsingle 145 + offset 328 + +IsTexture(texture) + return Boolean + param texture Texture in value + category VERSION_1_1 + dlflags notlistable + version 1.1 + glxsingle 146 + offset 330 + +############################################################################### +############################################################################### +# +# OpenGL 1.1 deprecated commands +# +############################################################################### +############################################################################### + +ArrayElement(i) + return void + param i Int32 in value + category VERSION_1_1_DEPRECATED + dlflags handcode + glxflags client-handcode client-intercept server-handcode + version 1.1 + deprecated 3.1 + offset 306 + +ColorPointer(size, type, stride, pointer) + return void + param size Int32 in value + param type ColorPointerType in value + param stride SizeI in value + param pointer Void in array [COMPSIZE(size/type/stride)] retained + category VERSION_1_1_DEPRECATED + dlflags notlistable + glxflags client-handcode client-intercept server-handcode + version 1.1 + deprecated 3.1 + offset 308 + +DisableClientState(array) + return void + param array EnableCap in value + category VERSION_1_1_DEPRECATED + version 1.1 + deprecated 3.1 + dlflags notlistable + glxflags client-handcode client-intercept server-handcode + offset 309 + +EdgeFlagPointer(stride, pointer) + return void + param stride SizeI in value + param pointer Void in array [COMPSIZE(stride)] retained + category VERSION_1_1_DEPRECATED + dlflags notlistable + glxflags client-handcode client-intercept server-handcode + version 1.1 + deprecated 3.1 + offset 312 + +EnableClientState(array) + return void + param array EnableCap in value + category VERSION_1_1_DEPRECATED + dlflags notlistable + glxflags client-handcode client-intercept server-handcode + version 1.1 + deprecated 3.1 + offset 313 + +IndexPointer(type, stride, pointer) + return void + param type IndexPointerType in value + param stride SizeI in value + param pointer Void in array [COMPSIZE(type/stride)] retained + category VERSION_1_1_DEPRECATED + dlflags notlistable + glxflags client-handcode client-intercept server-handcode + version 1.1 + deprecated 3.1 + offset 314 + +InterleavedArrays(format, stride, pointer) + return void + param format InterleavedArrayFormat in value + param stride SizeI in value + param pointer Void in array [COMPSIZE(format/stride)] retained + category VERSION_1_1_DEPRECATED + dlflags notlistable + glxflags client-handcode client-intercept server-handcode + version 1.1 + deprecated 3.1 + offset 317 + +NormalPointer(type, stride, pointer) + return void + param type NormalPointerType in value + param stride SizeI in value + param pointer Void in array [COMPSIZE(type/stride)] retained + category VERSION_1_1_DEPRECATED + dlflags notlistable + glxflags client-handcode client-intercept server-handcode + version 1.1 + deprecated 3.1 + offset 318 + +TexCoordPointer(size, type, stride, pointer) + return void + param size Int32 in value + param type TexCoordPointerType in value + param stride SizeI in value + param pointer Void in array [COMPSIZE(size/type/stride)] retained + category VERSION_1_1_DEPRECATED + dlflags notlistable + glxflags client-handcode client-intercept server-handcode + version 1.1 + deprecated 3.1 + offset 320 + +VertexPointer(size, type, stride, pointer) + return void + param size Int32 in value + param type VertexPointerType in value + param stride SizeI in value + param pointer Void in array [COMPSIZE(size/type/stride)] retained + category VERSION_1_1_DEPRECATED + dlflags notlistable + glxflags client-handcode client-intercept server-handcode + version 1.1 + deprecated 3.1 + offset 321 + +AreTexturesResident(n, textures, residences) + return Boolean + param n SizeI in value + param textures Texture in array [n] + param residences Boolean out array [n] + category VERSION_1_1_DEPRECATED + glxsingle 143 + dlflags notlistable + version 1.1 + deprecated 3.1 + offset 322 + +PrioritizeTextures(n, textures, priorities) + return void + param n SizeI in value + param textures Texture in array [n] + param priorities ClampedFloat32 in array [n] + category VERSION_1_1_DEPRECATED + version 1.1 + deprecated 3.1 + glxropcode 4118 + glxflags EXT + offset 331 + +Indexub(c) + return void + param c ColorIndexValueUB in value + category VERSION_1_1_DEPRECATED + vectorequiv Indexubv + version 1.1 + offset 315 + +Indexubv(c) + return void + param c ColorIndexValueUB in array [1] + category VERSION_1_1_DEPRECATED + version 1.1 + glxropcode 194 + offset 316 + +PopClientAttrib() + return void + category VERSION_1_1_DEPRECATED + version 1.1 + deprecated 3.1 + dlflags notlistable + glxflags client-handcode client-intercept server-handcode + offset 334 + +PushClientAttrib(mask) + return void + param mask ClientAttribMask in value + category VERSION_1_1_DEPRECATED + version 1.1 + deprecated 3.1 + dlflags notlistable + glxflags client-handcode client-intercept server-handcode + offset 335 + +############################################################################### +############################################################################### +# +# OpenGL 1.2 commands +# +############################################################################### +############################################################################### + +BlendColor(red, green, blue, alpha) + return void + param red ClampedColorF in value + param green ClampedColorF in value + param blue ClampedColorF in value + param alpha ClampedColorF in value + category VERSION_1_2 + glxflags EXT + version 1.2 + glxropcode 4096 + offset 336 + +BlendEquation(mode) + return void + param mode BlendEquationMode in value + category VERSION_1_2 + glxflags EXT + version 1.2 + glxropcode 4097 + offset 337 + +DrawRangeElements(mode, start, end, count, type, indices) + return void + param mode BeginMode in value + param start UInt32 in value + param end UInt32 in value + param count SizeI in value + param type DrawElementsType in value + param indices Void in array [COMPSIZE(count/type)] + category VERSION_1_2 + dlflags handcode + glxflags client-handcode client-intercept server-handcode + version 1.2 + offset 338 + +# OpenGL 1.2 (EXT_texture3D) commands + +# Arguably TexelInternalFormat, not PixelInternalFormat +TexImage3D(target, level, internalformat, width, height, depth, border, format, type, pixels) + return void + param target TextureTarget in value + param level CheckedInt32 in value + param internalformat TextureComponentCount in value + param width SizeI in value + param height SizeI in value + param depth SizeI in value + param border CheckedInt32 in value + param format PixelFormat in value + param type PixelType in value + param pixels Void in array [COMPSIZE(format/type/width/height/depth)] + category VERSION_1_2 + dlflags handcode + glxflags client-handcode server-handcode EXT + version 1.2 + deprecated 3.1 + glxropcode 4114 + offset 371 + +TexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels) + return void + param target TextureTarget in value + param level CheckedInt32 in value + param xoffset CheckedInt32 in value + param yoffset CheckedInt32 in value + param zoffset CheckedInt32 in value + param width SizeI in value + param height SizeI in value + param depth SizeI in value + param format PixelFormat in value + param type PixelType in value + param pixels Void in array [COMPSIZE(format/type/width/height/depth)] + category VERSION_1_2 + dlflags handcode + glxflags client-handcode server-handcode EXT + version 1.2 + glxropcode 4115 + offset 372 + +# OpenGL 1.2 (EXT_copy_texture) commands (specific to texture3D) + +CopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width, height) + return void + param target TextureTarget in value + param level CheckedInt32 in value + param xoffset CheckedInt32 in value + param yoffset CheckedInt32 in value + param zoffset CheckedInt32 in value + param x WinCoord in value + param y WinCoord in value + param width SizeI in value + param height SizeI in value + category VERSION_1_2 + glxflags EXT + version 1.2 + glxropcode 4123 + offset 373 + +############################################################################### +############################################################################### +# +# OpenGL 1.2 deprecated commands +# +############################################################################### +############################################################################### + +# OpenGL 1.2 (SGI_color_table) commands + +ColorTable(target, internalformat, width, format, type, table) + return void + param target ColorTableTarget in value + param internalformat PixelInternalFormat in value + param width SizeI in value + param format PixelFormat in value + param type PixelType in value + param table Void in array [COMPSIZE(format/type/width)] + category VERSION_1_2_DEPRECATED + dlflags handcode + glxflags client-handcode server-handcode EXT + version 1.2 + deprecated 3.1 + glxropcode 2053 + offset 339 + +ColorTableParameterfv(target, pname, params) + return void + param target ColorTableTarget in value + param pname ColorTableParameterPName in value + param params CheckedFloat32 in array [COMPSIZE(pname)] + category VERSION_1_2_DEPRECATED + glxflags EXT + version 1.2 + deprecated 3.1 + glxropcode 2054 + offset 340 + +ColorTableParameteriv(target, pname, params) + return void + param target ColorTableTarget in value + param pname ColorTableParameterPName in value + param params CheckedInt32 in array [COMPSIZE(pname)] + category VERSION_1_2_DEPRECATED + glxflags EXT + version 1.2 + deprecated 3.1 + glxropcode 2055 + offset 341 + +CopyColorTable(target, internalformat, x, y, width) + return void + param target ColorTableTarget in value + param internalformat PixelInternalFormat in value + param x WinCoord in value + param y WinCoord in value + param width SizeI in value + category VERSION_1_2_DEPRECATED + glxflags EXT + version 1.2 + deprecated 3.1 + glxropcode 2056 + offset 342 + +GetColorTable(target, format, type, table) + return void + param target ColorTableTarget in value + param format PixelFormat in value + param type PixelType in value + param table Void out array [COMPSIZE(target/format/type)] + category VERSION_1_2_DEPRECATED + dlflags notlistable + glxflags client-handcode server-handcode + version 1.2 + deprecated 3.1 + glxsingle 147 + offset 343 + +GetColorTableParameterfv(target, pname, params) + return void + param target ColorTableTarget in value + param pname GetColorTableParameterPName in value + param params Float32 out array [COMPSIZE(pname)] + category VERSION_1_2_DEPRECATED + dlflags notlistable + version 1.2 + deprecated 3.1 + glxsingle 148 + offset 344 + +GetColorTableParameteriv(target, pname, params) + return void + param target ColorTableTarget in value + param pname GetColorTableParameterPName in value + param params Int32 out array [COMPSIZE(pname)] + category VERSION_1_2_DEPRECATED + dlflags notlistable + version 1.2 + deprecated 3.1 + glxsingle 149 + offset 345 + +# OpenGL 1.2 (EXT_color_subtable) commands + +ColorSubTable(target, start, count, format, type, data) + return void + param target ColorTableTarget in value + param start SizeI in value + param count SizeI in value + param format PixelFormat in value + param type PixelType in value + param data Void in array [COMPSIZE(format/type/count)] + category VERSION_1_2_DEPRECATED + dlflags handcode + glxflags client-handcode server-handcode + version 1.2 + deprecated 3.1 + glxropcode 195 + offset 346 + +CopyColorSubTable(target, start, x, y, width) + return void + param target ColorTableTarget in value + param start SizeI in value + param x WinCoord in value + param y WinCoord in value + param width SizeI in value + category VERSION_1_2_DEPRECATED + version 1.2 + deprecated 3.1 + glxropcode 196 + offset 347 + +# OpenGL 1.2 (EXT_convolution) commands + +ConvolutionFilter1D(target, internalformat, width, format, type, image) + return void + param target ConvolutionTarget in value + param internalformat PixelInternalFormat in value + param width SizeI in value + param format PixelFormat in value + param type PixelType in value + param image Void in array [COMPSIZE(format/type/width)] + category VERSION_1_2_DEPRECATED + dlflags handcode + glxflags client-handcode server-handcode EXT + version 1.2 + deprecated 3.1 + glxropcode 4101 + offset 348 + +ConvolutionFilter2D(target, internalformat, width, height, format, type, image) + return void + param target ConvolutionTarget in value + param internalformat PixelInternalFormat in value + param width SizeI in value + param height SizeI in value + param format PixelFormat in value + param type PixelType in value + param image Void in array [COMPSIZE(format/type/width/height)] + category VERSION_1_2_DEPRECATED + dlflags handcode + glxflags client-handcode server-handcode EXT + version 1.2 + deprecated 3.1 + glxropcode 4102 + offset 349 + +ConvolutionParameterf(target, pname, params) + return void + param target ConvolutionTarget in value + param pname ConvolutionParameter in value + param params CheckedFloat32 in value + category VERSION_1_2_DEPRECATED + glxflags EXT + version 1.2 + deprecated 3.1 + glxropcode 4103 + offset 350 + +ConvolutionParameterfv(target, pname, params) + return void + param target ConvolutionTarget in value + param pname ConvolutionParameter in value + param params CheckedFloat32 in array [COMPSIZE(pname)] + category VERSION_1_2_DEPRECATED + glxflags EXT + version 1.2 + deprecated 3.1 + glxropcode 4104 + offset 351 + +ConvolutionParameteri(target, pname, params) + return void + param target ConvolutionTarget in value + param pname ConvolutionParameter in value + param params CheckedInt32 in value + category VERSION_1_2_DEPRECATED + glxflags EXT + version 1.2 + deprecated 3.1 + glxropcode 4105 + offset 352 + +ConvolutionParameteriv(target, pname, params) + return void + param target ConvolutionTarget in value + param pname ConvolutionParameter in value + param params CheckedInt32 in array [COMPSIZE(pname)] + category VERSION_1_2_DEPRECATED + glxflags EXT + version 1.2 + deprecated 3.1 + glxropcode 4106 + offset 353 + +CopyConvolutionFilter1D(target, internalformat, x, y, width) + return void + param target ConvolutionTarget in value + param internalformat PixelInternalFormat in value + param x WinCoord in value + param y WinCoord in value + param width SizeI in value + category VERSION_1_2_DEPRECATED + glxflags EXT + version 1.2 + deprecated 3.1 + glxropcode 4107 + offset 354 + +CopyConvolutionFilter2D(target, internalformat, x, y, width, height) + return void + param target ConvolutionTarget in value + param internalformat PixelInternalFormat in value + param x WinCoord in value + param y WinCoord in value + param width SizeI in value + param height SizeI in value + category VERSION_1_2_DEPRECATED + glxflags EXT + version 1.2 + deprecated 3.1 + glxropcode 4108 + offset 355 + +GetConvolutionFilter(target, format, type, image) + return void + param target ConvolutionTarget in value + param format PixelFormat in value + param type PixelType in value + param image Void out array [COMPSIZE(target/format/type)] + category VERSION_1_2_DEPRECATED + dlflags notlistable + glxflags client-handcode server-handcode + version 1.2 + deprecated 3.1 + glxsingle 150 + offset 356 + +GetConvolutionParameterfv(target, pname, params) + return void + param target ConvolutionTarget in value + param pname GetConvolutionParameterPName in value + param params Float32 out array [COMPSIZE(pname)] + category VERSION_1_2_DEPRECATED + dlflags notlistable + version 1.2 + deprecated 3.1 + glxsingle 151 + offset 357 + +GetConvolutionParameteriv(target, pname, params) + return void + param target ConvolutionTarget in value + param pname GetConvolutionParameterPName in value + param params Int32 out array [COMPSIZE(pname)] + category VERSION_1_2_DEPRECATED + dlflags notlistable + version 1.2 + deprecated 3.1 + glxsingle 152 + offset 358 + +GetSeparableFilter(target, format, type, row, column, span) + return void + param target SeparableTarget in value + param format PixelFormat in value + param type PixelType in value + param row Void out array [COMPSIZE(target/format/type)] + param column Void out array [COMPSIZE(target/format/type)] + param span Void out array [COMPSIZE(target/format/type)] + category VERSION_1_2_DEPRECATED + dlflags notlistable + glxflags client-handcode server-handcode + version 1.2 + deprecated 3.1 + glxsingle 153 + offset 359 + +SeparableFilter2D(target, internalformat, width, height, format, type, row, column) + return void + param target SeparableTarget in value + param internalformat PixelInternalFormat in value + param width SizeI in value + param height SizeI in value + param format PixelFormat in value + param type PixelType in value + param row Void in array [COMPSIZE(target/format/type/width)] + param column Void in array [COMPSIZE(target/format/type/height)] + category VERSION_1_2_DEPRECATED + dlflags handcode + glxflags client-handcode server-handcode EXT + version 1.2 + deprecated 3.1 + glxropcode 4109 + offset 360 + +# OpenGL 1.2 (EXT_histogram) commands + +GetHistogram(target, reset, format, type, values) + return void + param target HistogramTarget in value + param reset Boolean in value + param format PixelFormat in value + param type PixelType in value + param values Void out array [COMPSIZE(target/format/type)] + category VERSION_1_2_DEPRECATED + dlflags notlistable + glxflags client-handcode server-handcode + version 1.2 + deprecated 3.1 + glxsingle 154 + offset 361 + +GetHistogramParameterfv(target, pname, params) + return void + param target HistogramTarget in value + param pname GetHistogramParameterPName in value + param params Float32 out array [COMPSIZE(pname)] + category VERSION_1_2_DEPRECATED + dlflags notlistable + version 1.2 + deprecated 3.1 + glxsingle 155 + offset 362 + +GetHistogramParameteriv(target, pname, params) + return void + param target HistogramTarget in value + param pname GetHistogramParameterPName in value + param params Int32 out array [COMPSIZE(pname)] + category VERSION_1_2_DEPRECATED + dlflags notlistable + version 1.2 + deprecated 3.1 + glxsingle 156 + offset 363 + +GetMinmax(target, reset, format, type, values) + return void + param target MinmaxTarget in value + param reset Boolean in value + param format PixelFormat in value + param type PixelType in value + param values Void out array [COMPSIZE(target/format/type)] + category VERSION_1_2_DEPRECATED + dlflags notlistable + glxflags client-handcode server-handcode + version 1.2 + deprecated 3.1 + glxsingle 157 + offset 364 + +GetMinmaxParameterfv(target, pname, params) + return void + param target MinmaxTarget in value + param pname GetMinmaxParameterPName in value + param params Float32 out array [COMPSIZE(pname)] + category VERSION_1_2_DEPRECATED + dlflags notlistable + version 1.2 + deprecated 3.1 + glxsingle 158 + offset 365 + +GetMinmaxParameteriv(target, pname, params) + return void + param target MinmaxTarget in value + param pname GetMinmaxParameterPName in value + param params Int32 out array [COMPSIZE(pname)] + category VERSION_1_2_DEPRECATED + dlflags notlistable + version 1.2 + deprecated 3.1 + glxsingle 159 + offset 366 + +Histogram(target, width, internalformat, sink) + return void + param target HistogramTarget in value + param width SizeI in value + param internalformat PixelInternalFormat in value + param sink Boolean in value + category VERSION_1_2_DEPRECATED + dlflags handcode + glxflags EXT + version 1.2 + deprecated 3.1 + glxropcode 4110 + offset 367 + +Minmax(target, internalformat, sink) + return void + param target MinmaxTarget in value + param internalformat PixelInternalFormat in value + param sink Boolean in value + category VERSION_1_2_DEPRECATED + glxflags EXT + version 1.2 + deprecated 3.1 + glxropcode 4111 + offset 368 + +ResetHistogram(target) + return void + param target HistogramTarget in value + category VERSION_1_2_DEPRECATED + glxflags EXT + version 1.2 + deprecated 3.1 + glxropcode 4112 + offset 369 + +ResetMinmax(target) + return void + param target MinmaxTarget in value + category VERSION_1_2_DEPRECATED + glxflags EXT + version 1.2 + deprecated 3.1 + glxropcode 4113 + offset 370 + +############################################################################### +############################################################################### +# +# OpenGL 1.3 commands +# +############################################################################### +############################################################################### + +# OpenGL 1.3 (ARB_multitexture) commands + +ActiveTexture(texture) + return void + param texture TextureUnit in value + category VERSION_1_3 + glxflags ARB + version 1.3 + glxropcode 197 + offset 374 + +# OpenGL 1.3 (ARB_multisample) commands + +SampleCoverage(value, invert) + return void + param value ClampedFloat32 in value + param invert Boolean in value + category VERSION_1_3 + glxflags ARB + version 1.3 + glxropcode 229 + offset 412 + +# OpenGL 1.3 (ARB_texture_compression) commands + +# Arguably TexelInternalFormat, not PixelInternalFormat +CompressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, data) + return void + param target TextureTarget in value + param level CheckedInt32 in value + param internalformat PixelInternalFormat in value + param width SizeI in value + param height SizeI in value + param depth SizeI in value + param border CheckedInt32 in value + param imageSize SizeI in value + param data CompressedTextureARB in array [imageSize] + category VERSION_1_3 + dlflags handcode + glxflags ARB client-handcode server-handcode + version 1.3 + glxropcode 216 + wglflags client-handcode server-handcode + offset 554 + +# Arguably TexelInternalFormat, not PixelInternalFormat +CompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data) + return void + param target TextureTarget in value + param level CheckedInt32 in value + param internalformat PixelInternalFormat in value + param width SizeI in value + param height SizeI in value + param border CheckedInt32 in value + param imageSize SizeI in value + param data CompressedTextureARB in array [imageSize] + category VERSION_1_3 + dlflags handcode + glxflags ARB client-handcode server-handcode + version 1.3 + glxropcode 215 + wglflags client-handcode server-handcode + offset 555 + +# Arguably TexelInternalFormat, not PixelInternalFormat +CompressedTexImage1D(target, level, internalformat, width, border, imageSize, data) + return void + param target TextureTarget in value + param level CheckedInt32 in value + param internalformat PixelInternalFormat in value + param width SizeI in value + param border CheckedInt32 in value + param imageSize SizeI in value + param data CompressedTextureARB in array [imageSize] + category VERSION_1_3 + dlflags handcode + glxflags ARB client-handcode server-handcode + version 1.3 + glxropcode 214 + wglflags client-handcode server-handcode + offset 556 + +CompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data) + return void + param target TextureTarget in value + param level CheckedInt32 in value + param xoffset CheckedInt32 in value + param yoffset CheckedInt32 in value + param zoffset CheckedInt32 in value + param width SizeI in value + param height SizeI in value + param depth SizeI in value + param format PixelFormat in value + param imageSize SizeI in value + param data CompressedTextureARB in array [imageSize] + category VERSION_1_3 + dlflags handcode + glxflags ARB client-handcode server-handcode + version 1.3 + glxropcode 219 + wglflags client-handcode server-handcode + offset 557 + +CompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data) + return void + param target TextureTarget in value + param level CheckedInt32 in value + param xoffset CheckedInt32 in value + param yoffset CheckedInt32 in value + param width SizeI in value + param height SizeI in value + param format PixelFormat in value + param imageSize SizeI in value + param data CompressedTextureARB in array [imageSize] + category VERSION_1_3 + dlflags handcode + glxflags ARB client-handcode server-handcode + version 1.3 + glxropcode 218 + wglflags client-handcode server-handcode + offset 558 + +CompressedTexSubImage1D(target, level, xoffset, width, format, imageSize, data) + return void + param target TextureTarget in value + param level CheckedInt32 in value + param xoffset CheckedInt32 in value + param width SizeI in value + param format PixelFormat in value + param imageSize SizeI in value + param data CompressedTextureARB in array [imageSize] + category VERSION_1_3 + dlflags handcode + glxflags ARB client-handcode server-handcode + version 1.3 + glxropcode 217 + wglflags client-handcode server-handcode + offset 559 + +GetCompressedTexImage(target, level, img) + return void + param target TextureTarget in value + param level CheckedInt32 in value + param img CompressedTextureARB out array [COMPSIZE(target/level)] + category VERSION_1_3 + dlflags notlistable + glxflags ARB client-handcode server-handcode + version 1.3 + glxsingle 160 + wglflags client-handcode server-handcode + offset 560 + +############################################################################### +############################################################################### +# +# OpenGL 1.3 deprecated commands +# +############################################################################### +############################################################################### + +ClientActiveTexture(texture) + return void + param texture TextureUnit in value + category VERSION_1_3_DEPRECATED + dlflags notlistable + glxflags ARB client-handcode client-intercept server-handcode + version 1.3 + deprecated 3.1 + offset 375 + +MultiTexCoord1d(target, s) + return void + param target TextureUnit in value + param s CoordD in value + category VERSION_1_3_DEPRECATED + glxflags ARB + version 1.3 + deprecated 3.1 + vectorequiv MultiTexCoord1dv + offset 376 + +MultiTexCoord1dv(target, v) + return void + param target TextureUnit in value + param v CoordD in array [1] + category VERSION_1_3_DEPRECATED + glxflags ARB + version 1.3 + deprecated 3.1 + glxropcode 198 + offset 377 + +MultiTexCoord1f(target, s) + return void + param target TextureUnit in value + param s CoordF in value + category VERSION_1_3_DEPRECATED + glxflags ARB + version 1.3 + deprecated 3.1 + vectorequiv MultiTexCoord1fv + offset 378 + +MultiTexCoord1fv(target, v) + return void + param target TextureUnit in value + param v CoordF in array [1] + category VERSION_1_3_DEPRECATED + glxflags ARB + version 1.3 + deprecated 3.1 + glxropcode 199 + offset 379 + +MultiTexCoord1i(target, s) + return void + param target TextureUnit in value + param s CoordI in value + category VERSION_1_3_DEPRECATED + glxflags ARB + version 1.3 + deprecated 3.1 + vectorequiv MultiTexCoord1iv + offset 380 + +MultiTexCoord1iv(target, v) + return void + param target TextureUnit in value + param v CoordI in array [1] + category VERSION_1_3_DEPRECATED + glxflags ARB + version 1.3 + deprecated 3.1 + glxropcode 200 + offset 381 + +MultiTexCoord1s(target, s) + return void + param target TextureUnit in value + param s CoordS in value + category VERSION_1_3_DEPRECATED + glxflags ARB + version 1.3 + deprecated 3.1 + vectorequiv MultiTexCoord1sv + offset 382 + +MultiTexCoord1sv(target, v) + return void + param target TextureUnit in value + param v CoordS in array [1] + category VERSION_1_3_DEPRECATED + glxflags ARB + version 1.3 + deprecated 3.1 + glxropcode 201 + offset 383 + +MultiTexCoord2d(target, s, t) + return void + param target TextureUnit in value + param s CoordD in value + param t CoordD in value + category VERSION_1_3_DEPRECATED + glxflags ARB + version 1.3 + deprecated 3.1 + vectorequiv MultiTexCoord2dv + offset 384 + +MultiTexCoord2dv(target, v) + return void + param target TextureUnit in value + param v CoordD in array [2] + category VERSION_1_3_DEPRECATED + glxflags ARB + version 1.3 + deprecated 3.1 + glxropcode 202 + offset 385 + +MultiTexCoord2f(target, s, t) + return void + param target TextureUnit in value + param s CoordF in value + param t CoordF in value + category VERSION_1_3_DEPRECATED + glxflags ARB + version 1.3 + deprecated 3.1 + vectorequiv MultiTexCoord2fv + offset 386 + +MultiTexCoord2fv(target, v) + return void + param target TextureUnit in value + param v CoordF in array [2] + category VERSION_1_3_DEPRECATED + glxflags ARB + version 1.3 + deprecated 3.1 + glxropcode 203 + offset 387 + +MultiTexCoord2i(target, s, t) + return void + param target TextureUnit in value + param s CoordI in value + param t CoordI in value + category VERSION_1_3_DEPRECATED + glxflags ARB + version 1.3 + deprecated 3.1 + vectorequiv MultiTexCoord2iv + offset 388 + +MultiTexCoord2iv(target, v) + return void + param target TextureUnit in value + param v CoordI in array [2] + category VERSION_1_3_DEPRECATED + glxflags ARB + version 1.3 + deprecated 3.1 + glxropcode 204 + offset 389 + +MultiTexCoord2s(target, s, t) + return void + param target TextureUnit in value + param s CoordS in value + param t CoordS in value + category VERSION_1_3_DEPRECATED + glxflags ARB + version 1.3 + deprecated 3.1 + vectorequiv MultiTexCoord2sv + offset 390 + +MultiTexCoord2sv(target, v) + return void + param target TextureUnit in value + param v CoordS in array [2] + category VERSION_1_3_DEPRECATED + glxflags ARB + version 1.3 + deprecated 3.1 + glxropcode 205 + offset 391 + +MultiTexCoord3d(target, s, t, r) + return void + param target TextureUnit in value + param s CoordD in value + param t CoordD in value + param r CoordD in value + category VERSION_1_3_DEPRECATED + glxflags ARB + version 1.3 + deprecated 3.1 + vectorequiv MultiTexCoord3dv + offset 392 + +MultiTexCoord3dv(target, v) + return void + param target TextureUnit in value + param v CoordD in array [3] + category VERSION_1_3_DEPRECATED + glxflags ARB + version 1.3 + deprecated 3.1 + glxropcode 206 + offset 393 + +MultiTexCoord3f(target, s, t, r) + return void + param target TextureUnit in value + param s CoordF in value + param t CoordF in value + param r CoordF in value + category VERSION_1_3_DEPRECATED + glxflags ARB + version 1.3 + deprecated 3.1 + vectorequiv MultiTexCoord3fv + offset 394 + +MultiTexCoord3fv(target, v) + return void + param target TextureUnit in value + param v CoordF in array [3] + category VERSION_1_3_DEPRECATED + glxflags ARB + version 1.3 + deprecated 3.1 + glxropcode 207 + offset 395 + +MultiTexCoord3i(target, s, t, r) + return void + param target TextureUnit in value + param s CoordI in value + param t CoordI in value + param r CoordI in value + category VERSION_1_3_DEPRECATED + glxflags ARB + version 1.3 + deprecated 3.1 + vectorequiv MultiTexCoord3iv + offset 396 + +MultiTexCoord3iv(target, v) + return void + param target TextureUnit in value + param v CoordI in array [3] + category VERSION_1_3_DEPRECATED + glxflags ARB + version 1.3 + deprecated 3.1 + glxropcode 208 + offset 397 + +MultiTexCoord3s(target, s, t, r) + return void + param target TextureUnit in value + param s CoordS in value + param t CoordS in value + param r CoordS in value + category VERSION_1_3_DEPRECATED + glxflags ARB + version 1.3 + deprecated 3.1 + vectorequiv MultiTexCoord3sv + offset 398 + +MultiTexCoord3sv(target, v) + return void + param target TextureUnit in value + param v CoordS in array [3] + category VERSION_1_3_DEPRECATED + version 1.3 + deprecated 3.1 + glxflags ARB + glxropcode 209 + offset 399 + +MultiTexCoord4d(target, s, t, r, q) + return void + param target TextureUnit in value + param s CoordD in value + param t CoordD in value + param r CoordD in value + param q CoordD in value + category VERSION_1_3_DEPRECATED + glxflags ARB + version 1.3 + deprecated 3.1 + vectorequiv MultiTexCoord4dv + offset 400 + +MultiTexCoord4dv(target, v) + return void + param target TextureUnit in value + param v CoordD in array [4] + category VERSION_1_3_DEPRECATED + glxflags ARB + version 1.3 + deprecated 3.1 + glxropcode 210 + offset 401 + +MultiTexCoord4f(target, s, t, r, q) + return void + param target TextureUnit in value + param s CoordF in value + param t CoordF in value + param r CoordF in value + param q CoordF in value + category VERSION_1_3_DEPRECATED + glxflags ARB + version 1.3 + deprecated 3.1 + vectorequiv MultiTexCoord4fv + offset 402 + +MultiTexCoord4fv(target, v) + return void + param target TextureUnit in value + param v CoordF in array [4] + category VERSION_1_3_DEPRECATED + glxflags ARB + version 1.3 + deprecated 3.1 + glxropcode 211 + offset 403 + +MultiTexCoord4i(target, s, t, r, q) + return void + param target TextureUnit in value + param s CoordI in value + param t CoordI in value + param r CoordI in value + param q CoordI in value + category VERSION_1_3_DEPRECATED + glxflags ARB + version 1.3 + deprecated 3.1 + vectorequiv MultiTexCoord4iv + offset 404 + +MultiTexCoord4iv(target, v) + return void + param target TextureUnit in value + param v CoordI in array [4] + category VERSION_1_3_DEPRECATED + glxflags ARB + version 1.3 + deprecated 3.1 + glxropcode 212 + offset 405 + +MultiTexCoord4s(target, s, t, r, q) + return void + param target TextureUnit in value + param s CoordS in value + param t CoordS in value + param r CoordS in value + param q CoordS in value + category VERSION_1_3_DEPRECATED + glxflags ARB + version 1.3 + deprecated 3.1 + vectorequiv MultiTexCoord4sv + offset 406 + +MultiTexCoord4sv(target, v) + return void + param target TextureUnit in value + param v CoordS in array [4] + category VERSION_1_3_DEPRECATED + glxflags ARB + version 1.3 + deprecated 3.1 + glxropcode 213 + offset 407 + +# OpenGL 1.3 (ARB_transpose_matrix) commands + +LoadTransposeMatrixf(m) + return void + param m Float32 in array [16] + category VERSION_1_3_DEPRECATED + glxflags ARB client-handcode client-intercept server-handcode + version 1.3 + deprecated 3.1 + offset 408 + +LoadTransposeMatrixd(m) + return void + param m Float64 in array [16] + category VERSION_1_3_DEPRECATED + glxflags ARB client-handcode client-intercept server-handcode + version 1.3 + deprecated 3.1 + offset 409 + +MultTransposeMatrixf(m) + return void + param m Float32 in array [16] + category VERSION_1_3_DEPRECATED + glxflags ARB client-handcode client-intercept server-handcode + version 1.3 + deprecated 3.1 + offset 410 + +MultTransposeMatrixd(m) + return void + param m Float64 in array [16] + category VERSION_1_3_DEPRECATED + glxflags ARB client-handcode client-intercept server-handcode + version 1.3 + deprecated 3.1 + offset 411 + +############################################################################### +############################################################################### +# +# OpenGL 1.4 commands +# +############################################################################### +############################################################################### + +# OpenGL 1.4 (EXT_blend_func_separate) commands + +BlendFuncSeparate(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha) + return void + param sfactorRGB BlendFuncSeparateParameterEXT in value + param dfactorRGB BlendFuncSeparateParameterEXT in value + param sfactorAlpha BlendFuncSeparateParameterEXT in value + param dfactorAlpha BlendFuncSeparateParameterEXT in value + category VERSION_1_4 + glxropcode 4134 + version 1.4 + extension + offset 537 + +# OpenGL 1.4 (EXT_multi_draw_arrays) commands + +# first and count are really 'in' +MultiDrawArrays(mode, first, count, primcount) + return void + param mode BeginMode in value + param first Int32 in array [COMPSIZE(count)] + param count SizeI in array [COMPSIZE(primcount)] + param primcount SizeI in value + category VERSION_1_4 + version 1.4 + glxropcode ? + offset 644 + +MultiDrawElements(mode, count, type, indices, primcount) + return void + param mode BeginMode in value + param count SizeI in array [COMPSIZE(primcount)] + param type DrawElementsType in value + param indices VoidPointer in array [COMPSIZE(primcount)] + param primcount SizeI in value + category VERSION_1_4 + version 1.4 + glxropcode ? + offset 645 + +# OpenGL 1.4 (ARB_point_parameters, NV_point_sprite) commands + +PointParameterf(pname, param) + return void + param pname PointParameterNameARB in value + param param CheckedFloat32 in value + category VERSION_1_4 + version 1.4 + glxropcode 2065 + extension + offset 458 + +PointParameterfv(pname, params) + return void + param pname PointParameterNameARB in value + param params CheckedFloat32 in array [COMPSIZE(pname)] + category VERSION_1_4 + version 1.4 + glxropcode 2066 + extension + offset 459 + +PointParameteri(pname, param) + return void + param pname PointParameterNameARB in value + param param Int32 in value + category VERSION_1_4 + version 1.4 + extension soft WINSOFT NV20 + glxropcode 4221 + offset 642 + +PointParameteriv(pname, params) + return void + param pname PointParameterNameARB in value + param params Int32 in array [COMPSIZE(pname)] + category VERSION_1_4 + version 1.4 + extension soft WINSOFT NV20 + glxropcode 4222re + offset 643 + +############################################################################### +############################################################################### +# +# OpenGL 1.4 deprecated commands +# +############################################################################### +############################################################################### + +# OpenGL 1.4 (EXT_fog_coord) commands + +FogCoordf(coord) + return void + param coord CoordF in value + category VERSION_1_4_DEPRECATED + vectorequiv FogCoordfv + version 1.4 + deprecated 3.1 + offset 545 + +FogCoordfv(coord) + return void + param coord CoordF in array [1] + category VERSION_1_4_DEPRECATED + version 1.4 + deprecated 3.1 + glxropcode 4124 + offset 546 + +FogCoordd(coord) + return void + param coord CoordD in value + category VERSION_1_4_DEPRECATED + vectorequiv FogCoorddv + version 1.4 + deprecated 3.1 + offset 547 + +FogCoorddv(coord) + return void + param coord CoordD in array [1] + category VERSION_1_4_DEPRECATED + version 1.4 + deprecated 3.1 + glxropcode 4125 + offset 548 + +FogCoordPointer(type, stride, pointer) + return void + param type FogPointerTypeEXT in value + param stride SizeI in value + param pointer Void in array [COMPSIZE(type/stride)] retained + category VERSION_1_4_DEPRECATED + dlflags notlistable + version 1.4 + deprecated 3.1 + glxflags client-handcode server-handcode + offset 549 + +# OpenGL 1.4 (EXT_secondary_color) commands + +SecondaryColor3b(red, green, blue) + return void + param red ColorB in value + param green ColorB in value + param blue ColorB in value + category VERSION_1_4_DEPRECATED + vectorequiv SecondaryColor3bv + version 1.4 + deprecated 3.1 + offset 561 + +SecondaryColor3bv(v) + return void + param v ColorB in array [3] + category VERSION_1_4_DEPRECATED + version 1.4 + deprecated 3.1 + glxropcode 4126 + offset 562 + +SecondaryColor3d(red, green, blue) + return void + param red ColorD in value + param green ColorD in value + param blue ColorD in value + category VERSION_1_4_DEPRECATED + vectorequiv SecondaryColor3dv + version 1.4 + deprecated 3.1 + offset 563 + +SecondaryColor3dv(v) + return void + param v ColorD in array [3] + category VERSION_1_4_DEPRECATED + version 1.4 + deprecated 3.1 + glxropcode 4130 + offset 564 + +SecondaryColor3f(red, green, blue) + return void + param red ColorF in value + param green ColorF in value + param blue ColorF in value + category VERSION_1_4_DEPRECATED + vectorequiv SecondaryColor3fv + version 1.4 + deprecated 3.1 + offset 565 + +SecondaryColor3fv(v) + return void + param v ColorF in array [3] + category VERSION_1_4_DEPRECATED + version 1.4 + deprecated 3.1 + glxropcode 4129 + offset 566 + +SecondaryColor3i(red, green, blue) + return void + param red ColorI in value + param green ColorI in value + param blue ColorI in value + category VERSION_1_4_DEPRECATED + vectorequiv SecondaryColor3iv + version 1.4 + deprecated 3.1 + offset 567 + +SecondaryColor3iv(v) + return void + param v ColorI in array [3] + category VERSION_1_4_DEPRECATED + version 1.4 + deprecated 3.1 + glxropcode 4128 + offset 568 + +SecondaryColor3s(red, green, blue) + return void + param red ColorS in value + param green ColorS in value + param blue ColorS in value + category VERSION_1_4_DEPRECATED + vectorequiv SecondaryColor3sv + version 1.4 + deprecated 3.1 + offset 569 + +SecondaryColor3sv(v) + return void + param v ColorS in array [3] + category VERSION_1_4_DEPRECATED + version 1.4 + deprecated 3.1 + glxropcode 4127 + offset 570 + +SecondaryColor3ub(red, green, blue) + return void + param red ColorUB in value + param green ColorUB in value + param blue ColorUB in value + category VERSION_1_4_DEPRECATED + vectorequiv SecondaryColor3ubv + version 1.4 + deprecated 3.1 + offset 571 + +SecondaryColor3ubv(v) + return void + param v ColorUB in array [3] + category VERSION_1_4_DEPRECATED + version 1.4 + deprecated 3.1 + glxropcode 4131 + offset 572 + +SecondaryColor3ui(red, green, blue) + return void + param red ColorUI in value + param green ColorUI in value + param blue ColorUI in value + category VERSION_1_4_DEPRECATED + vectorequiv SecondaryColor3uiv + version 1.4 + deprecated 3.1 + offset 573 + +SecondaryColor3uiv(v) + return void + param v ColorUI in array [3] + category VERSION_1_4_DEPRECATED + version 1.4 + deprecated 3.1 + glxropcode 4133 + offset 574 + +SecondaryColor3us(red, green, blue) + return void + param red ColorUS in value + param green ColorUS in value + param blue ColorUS in value + category VERSION_1_4_DEPRECATED + vectorequiv SecondaryColor3usv + version 1.4 + deprecated 3.1 + offset 575 + +SecondaryColor3usv(v) + return void + param v ColorUS in array [3] + category VERSION_1_4_DEPRECATED + version 1.4 + deprecated 3.1 + glxropcode 4132 + offset 576 + +SecondaryColorPointer(size, type, stride, pointer) + return void + param size Int32 in value + param type ColorPointerType in value + param stride SizeI in value + param pointer Void in array [COMPSIZE(size/type/stride)] retained + category VERSION_1_4_DEPRECATED + dlflags notlistable + glxflags client-handcode server-handcode + version 1.4 + deprecated 3.1 + extension + offset 577 + +# OpenGL 1.4 (ARB_window_pos) commands +# Note: all WindowPos* entry points use glxropcode ropcode 230, with 3 float parameters + +WindowPos2d(x, y) + return void + param x CoordD in value + param y CoordD in value + category VERSION_1_4_DEPRECATED + vectorequiv WindowPos2dv + version 1.4 + deprecated 3.1 + offset 513 + +WindowPos2dv(v) + return void + param v CoordD in array [2] + category VERSION_1_4_DEPRECATED + version 1.4 + deprecated 3.1 + glxropcode 230 + glxflags client-handcode server-handcode + offset 514 + +WindowPos2f(x, y) + return void + param x CoordF in value + param y CoordF in value + category VERSION_1_4_DEPRECATED + vectorequiv WindowPos2fv + version 1.4 + deprecated 3.1 + offset 515 + +WindowPos2fv(v) + return void + param v CoordF in array [2] + category VERSION_1_4_DEPRECATED + version 1.4 + deprecated 3.1 + glxropcode 230 + glxflags client-handcode server-handcode + offset 516 + +WindowPos2i(x, y) + return void + param x CoordI in value + param y CoordI in value + category VERSION_1_4_DEPRECATED + vectorequiv WindowPos2iv + version 1.4 + deprecated 3.1 + offset 517 + +WindowPos2iv(v) + return void + param v CoordI in array [2] + category VERSION_1_4_DEPRECATED + version 1.4 + deprecated 3.1 + glxropcode 230 + glxflags client-handcode server-handcode + offset 518 + +WindowPos2s(x, y) + return void + param x CoordS in value + param y CoordS in value + category VERSION_1_4_DEPRECATED + vectorequiv WindowPos2sv + version 1.4 + deprecated 3.1 + offset 519 + +WindowPos2sv(v) + return void + param v CoordS in array [2] + category VERSION_1_4_DEPRECATED + version 1.4 + deprecated 3.1 + glxropcode 230 + glxflags client-handcode server-handcode + offset 520 + +WindowPos3d(x, y, z) + return void + param x CoordD in value + param y CoordD in value + param z CoordD in value + vectorequiv WindowPos3dv + category VERSION_1_4_DEPRECATED + version 1.4 + deprecated 3.1 + offset 521 + +WindowPos3dv(v) + return void + param v CoordD in array [3] + category VERSION_1_4_DEPRECATED + version 1.4 + deprecated 3.1 + glxropcode 230 + glxflags client-handcode server-handcode + offset 522 + +WindowPos3f(x, y, z) + return void + param x CoordF in value + param y CoordF in value + param z CoordF in value + category VERSION_1_4_DEPRECATED + vectorequiv WindowPos3fv + version 1.4 + deprecated 3.1 + offset 523 + +WindowPos3fv(v) + return void + param v CoordF in array [3] + category VERSION_1_4_DEPRECATED + version 1.4 + deprecated 3.1 + glxropcode 230 + glxflags client-handcode server-handcode + offset 524 + +WindowPos3i(x, y, z) + return void + param x CoordI in value + param y CoordI in value + param z CoordI in value + category VERSION_1_4_DEPRECATED + vectorequiv WindowPos3iv + version 1.4 + deprecated 3.1 + offset 525 + +WindowPos3iv(v) + return void + param v CoordI in array [3] + category VERSION_1_4_DEPRECATED + version 1.4 + deprecated 3.1 + glxropcode 230 + glxflags client-handcode server-handcode + offset 526 + +WindowPos3s(x, y, z) + return void + param x CoordS in value + param y CoordS in value + param z CoordS in value + category VERSION_1_4_DEPRECATED + vectorequiv WindowPos3sv + version 1.4 + deprecated 3.1 + offset 527 + +WindowPos3sv(v) + return void + param v CoordS in array [3] + category VERSION_1_4_DEPRECATED + version 1.4 + deprecated 3.1 + glxropcode 230 + glxflags client-handcode server-handcode + offset 528 + +############################################################################### +############################################################################### +# +# OpenGL 1.5 commands +# +############################################################################### +############################################################################### + +# OpenGL 1.5 (ARB_occlusion_query) commands + +GenQueries(n, ids) + return void + param n SizeI in value + param ids UInt32 out array [n] + category VERSION_1_5 + version 1.5 + extension + glxsingle 162 + glxflags ignore + offset 700 + +DeleteQueries(n, ids) + return void + param n SizeI in value + param ids UInt32 in array [n] + category VERSION_1_5 + version 1.5 + extension + glxsingle 161 + glxflags ignore + offset 701 + +IsQuery(id) + return Boolean + param id UInt32 in value + category VERSION_1_5 + version 1.5 + extension + glxsingle 163 + glxflags ignore + offset 702 + +BeginQuery(target, id) + return void + param target GLenum in value + param id UInt32 in value + category VERSION_1_5 + version 1.5 + extension + glxropcode 231 + glxflags ignore + offset 703 + +EndQuery(target) + return void + param target GLenum in value + category VERSION_1_5 + version 1.5 + extension + glxropcode 232 + glxflags ignore + offset 704 + +GetQueryiv(target, pname, params) + return void + param target GLenum in value + param pname GLenum in value + param params Int32 out array [pname] + category VERSION_1_5 + dlflags notlistable + version 1.5 + extension + glxsingle 164 + glxflags ignore + offset 705 + +GetQueryObjectiv(id, pname, params) + return void + param id UInt32 in value + param pname GLenum in value + param params Int32 out array [pname] + category VERSION_1_5 + dlflags notlistable + version 1.5 + extension + glxsingle 165 + glxflags ignore + offset 706 + +GetQueryObjectuiv(id, pname, params) + return void + param id UInt32 in value + param pname GLenum in value + param params UInt32 out array [pname] + category VERSION_1_5 + dlflags notlistable + version 1.5 + extension + glxsingle 166 + glxflags ignore + offset 707 + +# OpenGL 1.5 (ARB_vertex_buffer_object) commands + +BindBuffer(target, buffer) + return void + param target BufferTargetARB in value + param buffer UInt32 in value + category VERSION_1_5 + version 1.5 + extension + glxropcode ? + glxflags ignore + offset 688 + +DeleteBuffers(n, buffers) + return void + param n SizeI in value + param buffers ConstUInt32 in array [n] + category VERSION_1_5 + version 1.5 + extension + glxropcode ? + glxflags ignore + offset 691 + +GenBuffers(n, buffers) + return void + param n SizeI in value + param buffers UInt32 out array [n] + category VERSION_1_5 + version 1.5 + extension + glxropcode ? + glxflags ignore + offset 692 + +IsBuffer(buffer) + return Boolean + param buffer UInt32 in value + category VERSION_1_5 + version 1.5 + extension + glxropcode ? + glxflags ignore + offset 696 + +BufferData(target, size, data, usage) + return void + param target BufferTargetARB in value + param size BufferSize in value + param data ConstVoid in array [size] + param usage BufferUsageARB in value + category VERSION_1_5 + version 1.5 + extension + glxropcode ? + glxflags ignore + offset 689 + +BufferSubData(target, offset, size, data) + return void + param target BufferTargetARB in value + param offset BufferOffset in value + param size BufferSize in value + param data ConstVoid in array [size] + category VERSION_1_5 + version 1.5 + extension + glxropcode ? + glxflags ignore + offset 690 + +GetBufferSubData(target, offset, size, data) + return void + param target BufferTargetARB in value + param offset BufferOffset in value + param size BufferSize in value + param data Void out array [size] + category VERSION_1_5 + dlflags notlistable + version 1.5 + extension + glxsingle ? + glxflags ignore + offset 695 + +MapBuffer(target, access) + return VoidPointer + param target BufferTargetARB in value + param access BufferAccessARB in value + category VERSION_1_5 + version 1.5 + extension + glxropcode ? + glxflags ignore + offset 697 + +UnmapBuffer(target) + return Boolean + param target BufferTargetARB in value + category VERSION_1_5 + version 1.5 + extension + glxropcode ? + glxflags ignore + offset 698 + +GetBufferParameteriv(target, pname, params) + return void + param target BufferTargetARB in value + param pname BufferPNameARB in value + param params Int32 out array [COMPSIZE(pname)] + category VERSION_1_5 + dlflags notlistable + version 1.5 + extension + glxsingle ? + glxflags ignore + offset 693 + +GetBufferPointerv(target, pname, params) + return void + param target BufferTargetARB in value + param pname BufferPointerNameARB in value + param params VoidPointer out array [1] + category VERSION_1_5 + dlflags notlistable + version 1.5 + extension + glxsingle ? + glxflags ignore + offset 694 + +# OpenGL 1.5 (EXT_shadow_funcs) commands - none + + +############################################################################### +############################################################################### +# +# OpenGL 2.0 commands +# +############################################################################### +############################################################################### + +# OpenGL 2.0 (EXT_blend_equation_separate) commands + +BlendEquationSeparate(modeRGB, modeAlpha) + return void + param modeRGB BlendEquationModeEXT in value + param modeAlpha BlendEquationModeEXT in value + category VERSION_2_0 + version 2.0 + extension + glxropcode 4228 + +# OpenGL 2.0 (ARB_draw_buffers) commands + +DrawBuffers(n, bufs) + return void + param n SizeI in value + param bufs DrawBufferModeATI in array [n] + category VERSION_2_0 + version 2.0 + extension + glxropcode 233 + glxflags ignore + offset ? + +# OpenGL 2.0 (ARB_stencil_two_side) commands + +StencilOpSeparate(face, sfail, dpfail, dppass) + return void + param face StencilFaceDirection in value + param sfail StencilOp in value + param dpfail StencilOp in value + param dppass StencilOp in value + category VERSION_2_0 + version 2.0 + extension + glxropcode ? + glxflags ignore + offset ? + +StencilFuncSeparate(face, func, ref, mask) + return void + param face StencilFaceDirection in value + param func StencilFunction in value + param ref ClampedStencilValue in value + param mask MaskedStencilValue in value + category VERSION_2_0 + version 2.0 + extension + glxropcode ? + glxflags ignore + offset ? + +StencilMaskSeparate(face, mask) + return void + param face StencilFaceDirection in value + param mask MaskedStencilValue in value + category VERSION_2_0 + version 2.0 + extension + glxropcode ? + glxflags ignore + offset ? + +# OpenGL 2.0 (ARB_shader_objects / ARB_vertex_shader / ARB_fragment_shader) commands + +AttachShader(program, shader) + return void + param program UInt32 in value + param shader UInt32 in value + category VERSION_2_0 + version 2.0 + extension + glxropcode ? + glxflags ignore + offset ? + +BindAttribLocation(program, index, name) + return void + param program UInt32 in value + param index UInt32 in value + param name Char in array [] + category VERSION_2_0 + version 2.0 + extension + glxropcode ? + glxflags ignore + offset ? + +CompileShader(shader) + return void + param shader UInt32 in value + category VERSION_2_0 + version 2.0 + extension + glxropcode ? + glxflags ignore + offset ? + +CreateProgram() + return UInt32 + category VERSION_2_0 + version 2.0 + extension + glxropcode ? + glxflags ignore + offset ? + +CreateShader(type) + return UInt32 + param type GLenum in value + category VERSION_2_0 + version 2.0 + extension + glxropcode ? + glxflags ignore + offset ? + +DeleteProgram(program) + return void + param program UInt32 in value + category VERSION_2_0 + version 2.0 + extension + glxropcode ? + glxflags ignore + offset ? + +DeleteShader(shader) + return void + param shader UInt32 in value + category VERSION_2_0 + version 2.0 + extension + glxropcode ? + glxflags ignore + offset ? + +DetachShader(program, shader) + return void + param program UInt32 in value + param shader UInt32 in value + category VERSION_2_0 + version 2.0 + extension + glxropcode ? + glxflags ignore + offset ? + +DisableVertexAttribArray(index) + return void + param index UInt32 in value + dlflags notlistable + category VERSION_2_0 + version 2.0 + extension soft WINSOFT NV10 + glxflags ignore + offset 666 + +EnableVertexAttribArray(index) + return void + param index UInt32 in value + dlflags notlistable + category VERSION_2_0 + version 2.0 + extension soft WINSOFT NV10 + glxflags ignore + offset 665 + +GetActiveAttrib(program, index, bufSize, length, size, type, name) + return void + param program UInt32 in value + param index UInt32 in value + param bufSize SizeI in value + param length SizeI out array [1] + param size Int32 out array [1] + param type GLenum out array [1] + param name Char out array [] + category VERSION_2_0 + dlflags notlistable + version 2.0 + extension + glxsingle ? + glxflags ignore + offset ? + +GetActiveUniform(program, index, bufSize, length, size, type, name) + return void + param program UInt32 in value + param index UInt32 in value + param bufSize SizeI in value + param length SizeI out array [1] + param size Int32 out array [1] + param type GLenum out array [1] + param name Char out array [] + category VERSION_2_0 + dlflags notlistable + version 2.0 + extension + glxsingle ? + glxflags ignore + offset ? + +GetAttachedShaders(program, maxCount, count, obj) + return void + param program UInt32 in value + param maxCount SizeI in value + param count SizeI out array [1] + param obj UInt32 out array [count] + category VERSION_2_0 + dlflags notlistable + version 2.0 + extension + glxsingle ? + glxflags ignore + offset ? + +GetAttribLocation(program, name) + return Int32 + param program UInt32 in value + param name Char in array [] + category VERSION_2_0 + dlflags notlistable + version 2.0 + extension + glxsingle ? + glxflags ignore + offset ? + +GetProgramiv(program, pname, params) + return void + param program UInt32 in value + param pname GLenum in value + param params Int32 out array [pname] + category VERSION_2_0 + dlflags notlistable + version 2.0 + extension + glxsingle ? + glxflags ignore + offset ? + +GetProgramInfoLog(program, bufSize, length, infoLog) + return void + param program UInt32 in value + param bufSize SizeI in value + param length SizeI out array [1] + param infoLog Char out array [length] + category VERSION_2_0 + dlflags notlistable + version 2.0 + extension + glxsingle ? + glxflags ignore + offset ? + +GetShaderiv(shader, pname, params) + return void + param shader UInt32 in value + param pname GLenum in value + param params Int32 out array [pname] + category VERSION_2_0 + dlflags notlistable + version 2.0 + extension + glxsingle ? + glxflags ignore + offset ? + +GetShaderInfoLog(shader, bufSize, length, infoLog) + return void + param shader UInt32 in value + param bufSize SizeI in value + param length SizeI out array [1] + param infoLog Char out array [length] + category VERSION_2_0 + dlflags notlistable + version 2.0 + extension + glxsingle ? + glxflags ignore + offset ? + +GetShaderSource(shader, bufSize, length, source) + return void + param shader UInt32 in value + param bufSize SizeI in value + param length SizeI out array [1] + param source Char out array [length] + category VERSION_2_0 + dlflags notlistable + version 2.0 + extension + glxsingle ? + glxflags ignore + offset ? + +GetUniformLocation(program, name) + return Int32 + param program UInt32 in value + param name Char in array [] + category VERSION_2_0 + dlflags notlistable + version 2.0 + extension + glxsingle ? + glxflags ignore + offset ? + +GetUniformfv(program, location, params) + return void + param program UInt32 in value + param location Int32 in value + param params Float32 out array [COMPSIZE(location)] + category VERSION_2_0 + dlflags notlistable + version 2.0 + extension + glxsingle ? + glxflags ignore + offset ? + +GetUniformiv(program, location, params) + return void + param program UInt32 in value + param location Int32 in value + param params Int32 out array [COMPSIZE(location)] + category VERSION_2_0 + dlflags notlistable + version 2.0 + extension + glxsingle ? + glxflags ignore + offset ? + +GetVertexAttribdv(index, pname, params) + return void + param index UInt32 in value + param pname VertexAttribPropertyARB in value + param params Float64 out array [4] + dlflags notlistable + category VERSION_2_0 + version 2.0 + extension soft WINSOFT NV10 + glxvendorpriv 1301 + offset 588 + +GetVertexAttribfv(index, pname, params) + return void + param index UInt32 in value + param pname VertexAttribPropertyARB in value + param params Float32 out array [4] + dlflags notlistable + category VERSION_2_0 + version 2.0 + extension soft WINSOFT NV10 + glxvendorpriv 1302 + offset 589 + +GetVertexAttribiv(index, pname, params) + return void + param index UInt32 in value + param pname VertexAttribPropertyARB in value + param params Int32 out array [4] + dlflags notlistable + category VERSION_2_0 + version 2.0 + extension soft WINSOFT NV10 + glxvendorpriv 1303 + offset 590 + +GetVertexAttribPointerv(index, pname, pointer) + return void + param index UInt32 in value + param pname VertexAttribPointerPropertyARB in value + param pointer VoidPointer out array [1] + dlflags notlistable + category VERSION_2_0 + version 2.0 + extension soft WINSOFT NV10 + glxflags ignore + offset 591 + +IsProgram(program) + return Boolean + param program UInt32 in value + dlflags notlistable + category VERSION_2_0 + version 2.0 + extension soft WINSOFT NV10 + glxvendorpriv 1304 + offset 592 + +IsShader(shader) + return Boolean + param shader UInt32 in value + dlflags notlistable + category VERSION_2_0 + version 2.0 + extension soft WINSOFT NV10 + glxvendorpriv ? + offset ? + +LinkProgram(program) + return void + param program UInt32 in value + category VERSION_2_0 + version 2.0 + extension + glxropcode ? + glxflags ignore + offset ? + +ShaderSource(shader, count, string, length) + return void + param shader UInt32 in value + param count SizeI in value + param string CharPointer in array [count] + param length Int32 in array [1] + category VERSION_2_0 + version 2.0 + extension + glxropcode ? + glxflags ignore + offset ? + +UseProgram(program) + return void + param program UInt32 in value + category VERSION_2_0 + version 2.0 + extension + glxropcode ? + glxflags ignore + offset ? + +Uniform1f(location, v0) + return void + param location Int32 in value + param v0 Float32 in value + category VERSION_2_0 + version 2.0 + extension + glxropcode ? + glxflags ignore + offset ? + +Uniform2f(location, v0, v1) + return void + param location Int32 in value + param v0 Float32 in value + param v1 Float32 in value + category VERSION_2_0 + version 2.0 + extension + glxropcode ? + glxflags ignore + offset ? + +Uniform3f(location, v0, v1, v2) + return void + param location Int32 in value + param v0 Float32 in value + param v1 Float32 in value + param v2 Float32 in value + category VERSION_2_0 + version 2.0 + extension + glxropcode ? + glxflags ignore + offset ? + +Uniform4f(location, v0, v1, v2, v3) + return void + param location Int32 in value + param v0 Float32 in value + param v1 Float32 in value + param v2 Float32 in value + param v3 Float32 in value + category VERSION_2_0 + version 2.0 + extension + glxropcode ? + glxflags ignore + offset ? + +Uniform1i(location, v0) + return void + param location Int32 in value + param v0 Int32 in value + category VERSION_2_0 + version 2.0 + extension + glxropcode ? + glxflags ignore + offset ? + +Uniform2i(location, v0, v1) + return void + param location Int32 in value + param v0 Int32 in value + param v1 Int32 in value + category VERSION_2_0 + version 2.0 + extension + glxropcode ? + glxflags ignore + offset ? + +Uniform3i(location, v0, v1, v2) + return void + param location Int32 in value + param v0 Int32 in value + param v1 Int32 in value + param v2 Int32 in value + category VERSION_2_0 + version 2.0 + extension + glxropcode ? + glxflags ignore + offset ? + +Uniform4i(location, v0, v1, v2, v3) + return void + param location Int32 in value + param v0 Int32 in value + param v1 Int32 in value + param v2 Int32 in value + param v3 Int32 in value + category VERSION_2_0 + version 2.0 + extension + glxropcode ? + glxflags ignore + offset ? + +Uniform1fv(location, count, value) + return void + param location Int32 in value + param count SizeI in value + param value Float32 in array [count] + category VERSION_2_0 + version 2.0 + extension + glxropcode ? + glxflags ignore + offset ? + +Uniform2fv(location, count, value) + return void + param location Int32 in value + param count SizeI in value + param value Float32 in array [count] + category VERSION_2_0 + version 2.0 + extension + glxropcode ? + glxflags ignore + offset ? + +Uniform3fv(location, count, value) + return void + param location Int32 in value + param count SizeI in value + param value Float32 in array [count] + category VERSION_2_0 + version 2.0 + extension + glxropcode ? + glxflags ignore + offset ? + +Uniform4fv(location, count, value) + return void + param location Int32 in value + param count SizeI in value + param value Float32 in array [count] + category VERSION_2_0 + version 2.0 + extension + glxropcode ? + glxflags ignore + offset ? + +Uniform1iv(location, count, value) + return void + param location Int32 in value + param count SizeI in value + param value Int32 in array [count] + category VERSION_2_0 + version 2.0 + extension + glxropcode ? + glxflags ignore + offset ? + +Uniform2iv(location, count, value) + return void + param location Int32 in value + param count SizeI in value + param value Int32 in array [count] + category VERSION_2_0 + version 2.0 + extension + glxropcode ? + glxflags ignore + offset ? + +Uniform3iv(location, count, value) + return void + param location Int32 in value + param count SizeI in value + param value Int32 in array [count] + category VERSION_2_0 + version 2.0 + extension + glxropcode ? + glxflags ignore + offset ? + +Uniform4iv(location, count, value) + return void + param location Int32 in value + param count SizeI in value + param value Int32 in array [count] + category VERSION_2_0 + version 2.0 + extension + glxropcode ? + glxflags ignore + offset ? + +UniformMatrix2fv(location, count, transpose, value) + return void + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float32 in array [count] + category VERSION_2_0 + version 2.0 + extension + glxropcode ? + glxflags ignore + offset ? + +UniformMatrix3fv(location, count, transpose, value) + return void + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float32 in array [count] + category VERSION_2_0 + version 2.0 + extension + glxropcode ? + glxflags ignore + offset ? + +UniformMatrix4fv(location, count, transpose, value) + return void + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float32 in array [count] + category VERSION_2_0 + version 2.0 + extension + glxropcode ? + glxflags ignore + offset ? + +ValidateProgram(program) + return void + param program UInt32 in value + category VERSION_2_0 + version 2.0 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexAttrib1d(index, x) + return void + param index UInt32 in value + param x Float64 in value + category VERSION_2_0 + version 2.0 + deprecated 3.1 + vectorequiv VertexAttrib1dv + extension soft WINSOFT NV10 + glxflags ignore + offset 603 + +VertexAttrib1dv(index, v) + return void + param index UInt32 in value + param v Float64 in array [1] + category VERSION_2_0 + version 2.0 + deprecated 3.1 + extension soft WINSOFT NV10 + glxropcode 4197 + offset 604 + +VertexAttrib1f(index, x) + return void + param index UInt32 in value + param x Float32 in value + category VERSION_2_0 + version 2.0 + deprecated 3.1 + vectorequiv VertexAttrib1fv + extension soft WINSOFT NV10 + glxflags ignore + offset 605 + +VertexAttrib1fv(index, v) + return void + param index UInt32 in value + param v Float32 in array [1] + category VERSION_2_0 + version 2.0 + deprecated 3.1 + extension soft WINSOFT NV10 + glxropcode 4193 + offset 606 + +VertexAttrib1s(index, x) + return void + param index UInt32 in value + param x Int16 in value + category VERSION_2_0 + version 2.0 + deprecated 3.1 + vectorequiv VertexAttrib1sv + extension soft WINSOFT NV10 + glxflags ignore + offset 607 + +VertexAttrib1sv(index, v) + return void + param index UInt32 in value + param v Int16 in array [1] + category VERSION_2_0 + version 2.0 + deprecated 3.1 + extension soft WINSOFT NV10 + glxropcode 4189 + offset 608 + +VertexAttrib2d(index, x, y) + return void + param index UInt32 in value + param x Float64 in value + param y Float64 in value + category VERSION_2_0 + version 2.0 + deprecated 3.1 + vectorequiv VertexAttrib2dv + extension soft WINSOFT NV10 + glxflags ignore + offset 609 + +VertexAttrib2dv(index, v) + return void + param index UInt32 in value + param v Float64 in array [2] + category VERSION_2_0 + version 2.0 + deprecated 3.1 + extension soft WINSOFT NV10 + glxropcode 4198 + offset 610 + +VertexAttrib2f(index, x, y) + return void + param index UInt32 in value + param x Float32 in value + param y Float32 in value + category VERSION_2_0 + version 2.0 + deprecated 3.1 + vectorequiv VertexAttrib2fv + extension soft WINSOFT NV10 + glxflags ignore + offset 611 + +VertexAttrib2fv(index, v) + return void + param index UInt32 in value + param v Float32 in array [2] + category VERSION_2_0 + version 2.0 + deprecated 3.1 + extension soft WINSOFT NV10 + glxropcode 4194 + offset 612 + +VertexAttrib2s(index, x, y) + return void + param index UInt32 in value + param x Int16 in value + param y Int16 in value + category VERSION_2_0 + version 2.0 + deprecated 3.1 + vectorequiv VertexAttrib2sv + extension soft WINSOFT NV10 + glxflags ignore + offset 613 + +VertexAttrib2sv(index, v) + return void + param index UInt32 in value + param v Int16 in array [2] + category VERSION_2_0 + version 2.0 + deprecated 3.1 + extension soft WINSOFT NV10 + glxropcode 4190 + offset 614 + +VertexAttrib3d(index, x, y, z) + return void + param index UInt32 in value + param x Float64 in value + param y Float64 in value + param z Float64 in value + category VERSION_2_0 + version 2.0 + deprecated 3.1 + vectorequiv VertexAttrib3dv + extension soft WINSOFT NV10 + glxflags ignore + offset 615 + +VertexAttrib3dv(index, v) + return void + param index UInt32 in value + param v Float64 in array [3] + category VERSION_2_0 + version 2.0 + deprecated 3.1 + extension soft WINSOFT NV10 + glxropcode 4199 + offset 616 + +VertexAttrib3f(index, x, y, z) + return void + param index UInt32 in value + param x Float32 in value + param y Float32 in value + param z Float32 in value + category VERSION_2_0 + version 2.0 + deprecated 3.1 + vectorequiv VertexAttrib3fv + extension soft WINSOFT NV10 + glxflags ignore + offset 617 + +VertexAttrib3fv(index, v) + return void + param index UInt32 in value + param v Float32 in array [3] + category VERSION_2_0 + version 2.0 + deprecated 3.1 + extension soft WINSOFT NV10 + glxropcode 4195 + offset 618 + +VertexAttrib3s(index, x, y, z) + return void + param index UInt32 in value + param x Int16 in value + param y Int16 in value + param z Int16 in value + category VERSION_2_0 + version 2.0 + deprecated 3.1 + vectorequiv VertexAttrib3sv + extension soft WINSOFT NV10 + glxflags ignore + offset 619 + +VertexAttrib3sv(index, v) + return void + param index UInt32 in value + param v Int16 in array [3] + category VERSION_2_0 + version 2.0 + deprecated 3.1 + extension soft WINSOFT NV10 + glxropcode 4191 + offset 620 + +VertexAttrib4Nbv(index, v) + return void + param index UInt32 in value + param v Int8 in array [4] + category VERSION_2_0 + version 2.0 + deprecated 3.1 + extension soft WINSOFT NV10 + glxflags ignore + offset 659 + +VertexAttrib4Niv(index, v) + return void + param index UInt32 in value + param v Int32 in array [4] + category VERSION_2_0 + version 2.0 + deprecated 3.1 + extension soft WINSOFT NV10 + glxflags ignore + offset 661 + +VertexAttrib4Nsv(index, v) + return void + param index UInt32 in value + param v Int16 in array [4] + category VERSION_2_0 + version 2.0 + deprecated 3.1 + extension soft WINSOFT NV10 + glxflags ignore + offset 660 + +VertexAttrib4Nub(index, x, y, z, w) + return void + param index UInt32 in value + param x UInt8 in value + param y UInt8 in value + param z UInt8 in value + param w UInt8 in value + category VERSION_2_0 + version 2.0 + deprecated 3.1 + extension soft WINSOFT NV10 + glxflags ignore + offset 627 + +VertexAttrib4Nubv(index, v) + return void + param index UInt32 in value + param v UInt8 in array [4] + category VERSION_2_0 + version 2.0 + deprecated 3.1 + extension soft WINSOFT NV10 + glxflags ignore + glxropcode 4201 + offset 628 + +VertexAttrib4Nuiv(index, v) + return void + param index UInt32 in value + param v UInt32 in array [4] + category VERSION_2_0 + version 2.0 + deprecated 3.1 + extension soft WINSOFT NV10 + glxflags ignore + offset 663 + +VertexAttrib4Nusv(index, v) + return void + param index UInt32 in value + param v UInt16 in array [4] + category VERSION_2_0 + version 2.0 + deprecated 3.1 + extension soft WINSOFT NV10 + glxflags ignore + offset 662 + +VertexAttrib4bv(index, v) + return void + param index UInt32 in value + param v Int8 in array [4] + category VERSION_2_0 + version 2.0 + deprecated 3.1 + extension soft WINSOFT NV10 + glxflags ignore + offset 654 + +VertexAttrib4d(index, x, y, z, w) + return void + param index UInt32 in value + param x Float64 in value + param y Float64 in value + param z Float64 in value + param w Float64 in value + category VERSION_2_0 + version 2.0 + deprecated 3.1 + vectorequiv VertexAttrib4dv + extension soft WINSOFT NV10 + glxflags ignore + offset 621 + +VertexAttrib4dv(index, v) + return void + param index UInt32 in value + param v Float64 in array [4] + category VERSION_2_0 + version 2.0 + deprecated 3.1 + extension soft WINSOFT NV10 + glxropcode 4200 + offset 622 + +VertexAttrib4f(index, x, y, z, w) + return void + param index UInt32 in value + param x Float32 in value + param y Float32 in value + param z Float32 in value + param w Float32 in value + category VERSION_2_0 + version 2.0 + deprecated 3.1 + vectorequiv VertexAttrib4fv + extension soft WINSOFT NV10 + glxflags ignore + offset 623 + +VertexAttrib4fv(index, v) + return void + param index UInt32 in value + param v Float32 in array [4] + category VERSION_2_0 + version 2.0 + deprecated 3.1 + extension soft WINSOFT NV10 + glxropcode 4196 + offset 624 + +VertexAttrib4iv(index, v) + return void + param index UInt32 in value + param v Int32 in array [4] + category VERSION_2_0 + version 2.0 + deprecated 3.1 + extension soft WINSOFT NV10 + glxflags ignore + offset 655 + +VertexAttrib4s(index, x, y, z, w) + return void + param index UInt32 in value + param x Int16 in value + param y Int16 in value + param z Int16 in value + param w Int16 in value + category VERSION_2_0 + version 2.0 + deprecated 3.1 + vectorequiv VertexAttrib4sv + extension soft WINSOFT NV10 + glxflags ignore + offset 625 + +VertexAttrib4sv(index, v) + return void + param index UInt32 in value + param v Int16 in array [4] + category VERSION_2_0 + version 2.0 + deprecated 3.1 + extension soft WINSOFT NV10 + glxflags ignore + glxropcode 4192 + offset 626 + +VertexAttrib4ubv(index, v) + return void + param index UInt32 in value + param v UInt8 in array [4] + category VERSION_2_0 + version 2.0 + deprecated 3.1 + extension soft WINSOFT NV10 + glxflags ignore + offset 656 + +VertexAttrib4uiv(index, v) + return void + param index UInt32 in value + param v UInt32 in array [4] + category VERSION_2_0 + version 2.0 + deprecated 3.1 + extension soft WINSOFT NV10 + glxflags ignore + offset 658 + +VertexAttrib4usv(index, v) + return void + param index UInt32 in value + param v UInt16 in array [4] + category VERSION_2_0 + version 2.0 + deprecated 3.1 + extension soft WINSOFT NV10 + glxflags ignore + offset 657 + +VertexAttribPointer(index, size, type, normalized, stride, pointer) + return void + param index UInt32 in value + param size Int32 in value + param type VertexAttribPointerTypeARB in value + param normalized Boolean in value + param stride SizeI in value + param pointer Void in array [COMPSIZE(size/type/stride)] retained + dlflags notlistable + category VERSION_2_0 + version 2.0 + extension soft WINSOFT NV10 + glxflags ignore + offset 664 + + +############################################################################### +############################################################################### +# +# OpenGL 2.1 commands +# +############################################################################### +############################################################################### + +# OpenGL 2.1 (ARB_pixel_buffer_object) commands - none + +# OpenGL 2.1 (EXT_texture_sRGB) commands - none + +# New commands in OpenGL 2.1 + +UniformMatrix2x3fv(location, count, transpose, value) + return void + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float32 in array [6] + category VERSION_2_1 + version 2.1 + extension + glxropcode ? + glxflags ignore + offset ? + +UniformMatrix3x2fv(location, count, transpose, value) + return void + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float32 in array [6] + category VERSION_2_1 + version 2.1 + extension + glxropcode ? + glxflags ignore + offset ? + +UniformMatrix2x4fv(location, count, transpose, value) + return void + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float32 in array [8] + category VERSION_2_1 + version 2.1 + extension + glxropcode ? + glxflags ignore + offset ? + +UniformMatrix4x2fv(location, count, transpose, value) + return void + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float32 in array [8] + category VERSION_2_1 + version 2.1 + extension + glxropcode ? + glxflags ignore + offset ? + +UniformMatrix3x4fv(location, count, transpose, value) + return void + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float32 in array [12] + category VERSION_2_1 + version 2.1 + extension + glxropcode ? + glxflags ignore + offset ? + +UniformMatrix4x3fv(location, count, transpose, value) + return void + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float32 in array [12] + category VERSION_2_1 + version 2.1 + extension + glxropcode ? + glxflags ignore + offset ? + +############################################################################### +############################################################################### +# +# OpenGL 3.0 commands +# +############################################################################### +############################################################################### + +# OpenGL 3.0 (EXT_draw_buffers2) commands + +ColorMaski(index, r, g, b, a) + return void + param index UInt32 in value + param r Boolean in value + param g Boolean in value + param b Boolean in value + param a Boolean in value + category VERSION_3_0 + version 3.0 + extension + glxflags ignore + glfflags ignore + +GetBooleani_v(target, index, data) + return void + param target GLenum in value + param index UInt32 in value + param data Boolean out array [COMPSIZE(target)] + category VERSION_3_0 + version 3.0 + extension + dlflags notlistable + glxflags ignore + glfflags ignore + +GetIntegeri_v(target, index, data) + return void + param target GLenum in value + param index UInt32 in value + param data Int32 out array [COMPSIZE(target)] + category VERSION_3_0 + version 3.0 + extension + dlflags notlistable + glxflags ignore + glfflags ignore + +Enablei(target, index) + return void + param target GLenum in value + param index UInt32 in value + category VERSION_3_0 + version 3.0 + extension + glxflags ignore + glfflags ignore + +Disablei(target, index) + return void + param target GLenum in value + param index UInt32 in value + category VERSION_3_0 + version 3.0 + extension + glxflags ignore + glfflags ignore + +IsEnabledi(target, index) + return Boolean + param target GLenum in value + param index UInt32 in value + category VERSION_3_0 + version 3.0 + extension + dlflags notlistable + glxflags ignore + glfflags ignore + +# OpenGL 3.0 (EXT_transform_feedback) commands + +BeginTransformFeedback(primitiveMode) + return void + param primitiveMode GLenum in value + category VERSION_3_0 + version 3.0 + extension + dlflags notlistable + glxflags ignore + glfflags ignore + +EndTransformFeedback() + return void + category VERSION_3_0 + version 3.0 + extension + dlflags notlistable + glxflags ignore + glfflags ignore + +BindBufferRange(target, index, buffer, offset, size) + return void + param target GLenum in value + param index UInt32 in value + param buffer UInt32 in value + param offset BufferOffset in value + param size BufferSize in value + category VERSION_3_0 + version 3.0 + extension + dlflags notlistable + glxflags ignore + glfflags ignore + +BindBufferBase(target, index, buffer) + return void + param target GLenum in value + param index UInt32 in value + param buffer UInt32 in value + category VERSION_3_0 + version 3.0 + extension + dlflags notlistable + glxflags ignore + glfflags ignore + +TransformFeedbackVaryings(program, count, varyings, bufferMode) + return void + param program UInt32 in value + param count SizeI in value + param varyings CharPointer in array [count] + param bufferMode GLenum in value + category VERSION_3_0 + version 3.0 + extension + dlflags notlistable + glxflags ignore + glfflags ignore + +GetTransformFeedbackVarying(program, index, bufSize, length, size, type, name) + return void + param program UInt32 in value + param index UInt32 in value + param bufSize SizeI in value + param length SizeI out array [1] + param size SizeI out array [1] + param type GLenum out array [1] + param name Char out array [COMPSIZE(length)] + category VERSION_3_0 + dlflags notlistable + version 3.0 + extension + glfflags ignore + glxflags ignore + +ClampColor(target, clamp) + return void + param target ClampColorTargetARB in value + param clamp ClampColorModeARB in value + category VERSION_3_0 + version 3.0 + extension + glxropcode 234 + glxflags ignore + offset ? + +BeginConditionalRender(id, mode) + return void + param id UInt32 in value + param mode TypeEnum in value + category VERSION_3_0 + version 3.0 + glfflags ignore + glxflags ignore + +EndConditionalRender() + return void + category VERSION_3_0 + version 3.0 + glfflags ignore + glxflags ignore + +VertexAttribIPointer(index, size, type, stride, pointer) + return void + param index UInt32 in value + param size Int32 in value + param type VertexAttribEnum in value + param stride SizeI in value + param pointer Void in array [COMPSIZE(size/type/stride)] retained + category VERSION_3_0 + version 3.0 + dlflags notlistable + extension + glfflags ignore + glxflags ignore + +GetVertexAttribIiv(index, pname, params) + return void + param index UInt32 in value + param pname VertexAttribEnum in value + param params Int32 out array [1] + category VERSION_3_0 + version 3.0 + dlflags notlistable + extension + glfflags ignore + glxflags ignore + +GetVertexAttribIuiv(index, pname, params) + return void + param index UInt32 in value + param pname VertexAttribEnum in value + param params UInt32 out array [1] + category VERSION_3_0 + version 3.0 + dlflags notlistable + extension + glfflags ignore + glxflags ignore + +# OpenGL 3.0 (NV_vertex_program4) commands + +VertexAttribI1i(index, x) + return void + param index UInt32 in value + param x Int32 in value + category VERSION_3_0 + version 3.0 + deprecated 3.1 + beginend allow-inside + vectorequiv VertexAttribI1iv + glxvectorequiv VertexAttribI1iv + extension + glfflags ignore + glxflags ignore + +VertexAttribI2i(index, x, y) + return void + param index UInt32 in value + param x Int32 in value + param y Int32 in value + category VERSION_3_0 + version 3.0 + deprecated 3.1 + beginend allow-inside + vectorequiv VertexAttribI2iv + glxvectorequiv VertexAttribI2iv + extension + glfflags ignore + glxflags ignore + +VertexAttribI3i(index, x, y, z) + return void + param index UInt32 in value + param x Int32 in value + param y Int32 in value + param z Int32 in value + category VERSION_3_0 + version 3.0 + deprecated 3.1 + beginend allow-inside + vectorequiv VertexAttribI3iv + glxvectorequiv VertexAttribI3iv + extension + glfflags ignore + glxflags ignore + +VertexAttribI4i(index, x, y, z, w) + return void + param index UInt32 in value + param x Int32 in value + param y Int32 in value + param z Int32 in value + param w Int32 in value + category VERSION_3_0 + version 3.0 + deprecated 3.1 + beginend allow-inside + vectorequiv VertexAttribI4iv + glxvectorequiv VertexAttribI4iv + extension + glfflags ignore + glxflags ignore + +VertexAttribI1ui(index, x) + return void + param index UInt32 in value + param x UInt32 in value + category VERSION_3_0 + version 3.0 + deprecated 3.1 + beginend allow-inside + vectorequiv VertexAttribI1uiv + glxvectorequiv VertexAttribI1uiv + extension + glfflags ignore + glxflags ignore + +VertexAttribI2ui(index, x, y) + return void + param index UInt32 in value + param x UInt32 in value + param y UInt32 in value + category VERSION_3_0 + version 3.0 + deprecated 3.1 + beginend allow-inside + vectorequiv VertexAttribI2uiv + glxvectorequiv VertexAttribI2uiv + extension + glfflags ignore + glxflags ignore + +VertexAttribI3ui(index, x, y, z) + return void + param index UInt32 in value + param x UInt32 in value + param y UInt32 in value + param z UInt32 in value + category VERSION_3_0 + version 3.0 + deprecated 3.1 + beginend allow-inside + vectorequiv VertexAttribI3uiv + glxvectorequiv VertexAttribI3uiv + extension + glfflags ignore + glxflags ignore + +VertexAttribI4ui(index, x, y, z, w) + return void + param index UInt32 in value + param x UInt32 in value + param y UInt32 in value + param z UInt32 in value + param w UInt32 in value + category VERSION_3_0 + version 3.0 + deprecated 3.1 + beginend allow-inside + vectorequiv VertexAttribI4uiv + glxvectorequiv VertexAttribI4uiv + extension + glfflags ignore + glxflags ignore + +VertexAttribI1iv(index, v) + return void + param index UInt32 in value + param v Int32 in array [1] + category VERSION_3_0 + version 3.0 + deprecated 3.1 + beginend allow-inside + extension + glfflags ignore + glxflags ignore + +VertexAttribI2iv(index, v) + return void + param index UInt32 in value + param v Int32 in array [2] + category VERSION_3_0 + version 3.0 + deprecated 3.1 + beginend allow-inside + extension + glfflags ignore + glxflags ignore + +VertexAttribI3iv(index, v) + return void + param index UInt32 in value + param v Int32 in array [3] + category VERSION_3_0 + version 3.0 + deprecated 3.1 + beginend allow-inside + extension + glfflags ignore + glxflags ignore + +VertexAttribI4iv(index, v) + return void + param index UInt32 in value + param v Int32 in array [4] + category VERSION_3_0 + version 3.0 + deprecated 3.1 + beginend allow-inside + extension + glfflags ignore + glxflags ignore + +VertexAttribI1uiv(index, v) + return void + param index UInt32 in value + param v UInt32 in array [1] + category VERSION_3_0 + version 3.0 + deprecated 3.1 + beginend allow-inside + extension + glfflags ignore + glxflags ignore + +VertexAttribI2uiv(index, v) + return void + param index UInt32 in value + param v UInt32 in array [2] + category VERSION_3_0 + version 3.0 + deprecated 3.1 + beginend allow-inside + extension + glfflags ignore + glxflags ignore + +VertexAttribI3uiv(index, v) + return void + param index UInt32 in value + param v UInt32 in array [3] + category VERSION_3_0 + version 3.0 + deprecated 3.1 + beginend allow-inside + extension + glfflags ignore + glxflags ignore + +VertexAttribI4uiv(index, v) + return void + param index UInt32 in value + param v UInt32 in array [4] + category VERSION_3_0 + version 3.0 + deprecated 3.1 + beginend allow-inside + extension + glfflags ignore + glxflags ignore + +VertexAttribI4bv(index, v) + return void + param index UInt32 in value + param v Int8 in array [4] + category VERSION_3_0 + version 3.0 + deprecated 3.1 + beginend allow-inside + extension + glfflags ignore + glxflags ignore + +VertexAttribI4sv(index, v) + return void + param index UInt32 in value + param v Int16 in array [4] + category VERSION_3_0 + version 3.0 + deprecated 3.1 + beginend allow-inside + extension + glfflags ignore + glxflags ignore + +VertexAttribI4ubv(index, v) + return void + param index UInt32 in value + param v UInt8 in array [4] + category VERSION_3_0 + version 3.0 + deprecated 3.1 + beginend allow-inside + extension + glfflags ignore + glxflags ignore + +VertexAttribI4usv(index, v) + return void + param index UInt32 in value + param v UInt16 in array [4] + category VERSION_3_0 + version 3.0 + deprecated 3.1 + beginend allow-inside + extension + glfflags ignore + glxflags ignore + +# OpenGL 3.0 (EXT_gpu_shader4) commands + +GetUniformuiv(program, location, params) + return void + param program UInt32 in value + param location Int32 in value + param params UInt32 out array [COMPSIZE(program/location)] + category VERSION_3_0 + dlflags notlistable + version 3.0 + extension + glfflags ignore + glxflags ignore + +BindFragDataLocation(program, color, name) + return void + param program UInt32 in value + param color UInt32 in value + param name Char in array [COMPSIZE(name)] + category VERSION_3_0 + dlflags notlistable + version 3.0 + extension + glfflags ignore + glxflags ignore + +GetFragDataLocation(program, name) + return Int32 + param program UInt32 in value + param name Char in array [COMPSIZE(name)] + category VERSION_3_0 + dlflags notlistable + version 3.0 + extension + glfflags ignore + glxflags ignore + +Uniform1ui(location, v0) + return void + param location Int32 in value + param v0 UInt32 in value + category VERSION_3_0 + version 3.0 + extension + glfflags ignore + glxflags ignore + +Uniform2ui(location, v0, v1) + return void + param location Int32 in value + param v0 UInt32 in value + param v1 UInt32 in value + category VERSION_3_0 + version 3.0 + extension + glfflags ignore + glxflags ignore + +Uniform3ui(location, v0, v1, v2) + return void + param location Int32 in value + param v0 UInt32 in value + param v1 UInt32 in value + param v2 UInt32 in value + category VERSION_3_0 + version 3.0 + extension + glfflags ignore + glxflags ignore + +Uniform4ui(location, v0, v1, v2, v3) + return void + param location Int32 in value + param v0 UInt32 in value + param v1 UInt32 in value + param v2 UInt32 in value + param v3 UInt32 in value + category VERSION_3_0 + version 3.0 + extension + glfflags ignore + glxflags ignore + +Uniform1uiv(location, count, value) + return void + param location Int32 in value + param count SizeI in value + param value UInt32 in array [count] + category VERSION_3_0 + version 3.0 + extension + glfflags ignore + glxflags ignore + +Uniform2uiv(location, count, value) + return void + param location Int32 in value + param count SizeI in value + param value UInt32 in array [count*2] + category VERSION_3_0 + version 3.0 + extension + glfflags ignore + glxflags ignore + +Uniform3uiv(location, count, value) + return void + param location Int32 in value + param count SizeI in value + param value UInt32 in array [count*3] + category VERSION_3_0 + version 3.0 + extension + glfflags ignore + glxflags ignore + +Uniform4uiv(location, count, value) + return void + param location Int32 in value + param count SizeI in value + param value UInt32 in array [count*4] + category VERSION_3_0 + version 3.0 + extension + glfflags ignore + glxflags ignore + +# OpenGL 3.0 (EXT_texture_integer) commands + +TexParameterIiv(target, pname, params) + return void + param target TextureTarget in value + param pname TextureParameterName in value + param params Int32 in array [COMPSIZE(pname)] + category VERSION_3_0 + version 3.0 + extension + glfflags ignore + glxflags ignore + +TexParameterIuiv(target, pname, params) + return void + param target TextureTarget in value + param pname TextureParameterName in value + param params UInt32 in array [COMPSIZE(pname)] + category VERSION_3_0 + version 3.0 + extension + glfflags ignore + glxflags ignore + +GetTexParameterIiv(target, pname, params) + return void + param target TextureTarget in value + param pname GetTextureParameter in value + param params Int32 out array [COMPSIZE(pname)] + category VERSION_3_0 + dlflags notlistable + version 3.0 + extension + glfflags ignore + glxflags ignore + +GetTexParameterIuiv(target, pname, params) + return void + param target TextureTarget in value + param pname GetTextureParameter in value + param params UInt32 out array [COMPSIZE(pname)] + category VERSION_3_0 + dlflags notlistable + version 3.0 + extension + glfflags ignore + glxflags ignore + +# New commands in OpenGL 3.0 + +ClearBufferiv(buffer, drawbuffer, value) + return void + param buffer GLenum in value + param drawbuffer DrawBufferName in value + param value Int32 in array [COMPSIZE(buffer)] + category VERSION_3_0 + version 3.0 + extension + glfflags ignore + glxflags ignore + +ClearBufferuiv(buffer, drawbuffer, value) + return void + param buffer GLenum in value + param drawbuffer DrawBufferName in value + param value UInt32 in array [COMPSIZE(buffer)] + category VERSION_3_0 + version 3.0 + extension + glfflags ignore + glxflags ignore + +ClearBufferfv(buffer, drawbuffer, value) + return void + param buffer GLenum in value + param drawbuffer DrawBufferName in value + param value Float32 in array [COMPSIZE(buffer)] + category VERSION_3_0 + version 3.0 + extension + glfflags ignore + glxflags ignore + +ClearBufferfi(buffer, drawbuffer, depth, stencil) + return void + param buffer GLenum in value + param drawbuffer DrawBufferName in value + param depth Float32 in value + param stencil Int32 in value + category VERSION_3_0 + version 3.0 + extension + glfflags ignore + glxflags ignore + +GetStringi(name, index) + return String + param name GLenum in value + param index UInt32 in value + category VERSION_3_0 + version 3.0 + extension + dlflags notlistable + glxflags client-handcode server-handcode + glfflags ignore + glxsingle ? + +passthru: /* OpenGL 3.0 also reuses entry points from these extensions: */ +passthru: /* ARB_framebuffer_object */ +passthru: /* ARB_map_buffer_range */ +passthru: /* ARB_vertex_array_object */ + +############################################################################### +############################################################################### +# +# OpenGL 3.0 deprecated commands +# +############################################################################### +############################################################################### + +# (none - VertexAttribI* were moved back into non-deprecated) + + +############################################################################### +############################################################################### +# +# OpenGL 3.1 commands +# +############################################################################### +############################################################################### + +# New commands in OpenGL 3.1 - none + +# OpenGL 3.1 (ARB_draw_instanced) commands + +DrawArraysInstanced(mode, first, count, primcount) + return void + param mode BeginMode in value + param first Int32 in value + param count SizeI in value + param primcount SizeI in value + category VERSION_3_1 + version 3.1 + extension + dlflags notlistable + vectorequiv ArrayElement + glfflags ignore + glxflags ignore + +DrawElementsInstanced(mode, count, type, indices, primcount) + return void + param mode BeginMode in value + param count SizeI in value + param type DrawElementsType in value + param indices Void in array [COMPSIZE(count/type)] + param primcount SizeI in value + category VERSION_3_1 + version 3.1 + extension + dlflags notlistable + vectorequiv ArrayElement + glfflags ignore + glxflags ignore + +# OpenGL 3.1 (ARB_texture_buffer_object) commands + +TexBuffer(target, internalformat, buffer) + return void + param target TextureTarget in value + param internalformat GLenum in value + param buffer UInt32 in value + category VERSION_3_1 + version 3.1 + extension + glfflags ignore + glxflags ignore + +# OpenGL 3.1 (ARB_texture_rectangle) commands - none + +# OpenGL 3.1 (SNORM texture) commands - none + +# OpenGL 3.1 (NV_primitive_restart) commands +# This is *not* an alias of PrimitiveRestartIndexNV, since it sets +# server instead of client state. + +PrimitiveRestartIndex(index) + return void + param index UInt32 in value + category VERSION_3_1 + version 3.1 + extension + glxropcode ? + glxflags ignore + offset ? + +passthru: /* OpenGL 3.1 also reuses entry points from these extensions: */ +passthru: /* ARB_copy_buffer */ +passthru: /* ARB_uniform_buffer_object */ + + +############################################################################### +############################################################################### +# +# OpenGL 3.2 commands +# +############################################################################### +############################################################################### + +# New commands in OpenGL 3.2 + +GetInteger64i_v(target, index, data) + return void + param target GLenum in value + param index UInt32 in value + param data Int64 out array [COMPSIZE(target)] + category VERSION_3_2 + version 3.2 + extension + dlflags notlistable + glxflags ignore + glfflags ignore + + +GetBufferParameteri64v(target, pname, params) + return void + param target BufferTargetARB in value + param pname BufferPNameARB in value + param params Int64 out array [COMPSIZE(pname)] + category VERSION_3_2 + dlflags notlistable + version 3.2 + extension + glxsingle ? + glxflags ignore + +# OpenGL 3.2 (ARB_depth_clamp) commands - none +# OpenGL 3.2 (ARB_fragment_coord_conventions) commands - none + +# OpenGL 3.2 (ARB_geometry_shader4) commands +# ProgramParameteriARB was NOT promoted to core 3.2, but +# IS part of core 4.1 through other ARB extensions. + +FramebufferTexture(target, attachment, texture, level) + return void + param target GLenum in value + param attachment GLenum in value + param texture UInt32 in value + param level Int32 in value + category VERSION_3_2 + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +# FramebufferTextureLayer already declared in ARB_framebuffer_object +# FramebufferTextureLayer(target, attachment, texture, level, layer) + +# Not promoted to the core along with the rest +# FramebufferTextureFace(target, attachment, texture, level, face) + +# OpenGL 3.2 (ARB_seamless_cube_map) commands - none +# OpenGL 3.2 (ARB_vertex_array_bgra) commands - none + +passthru: /* OpenGL 3.2 also reuses entry points from these extensions: */ +passthru: /* ARB_draw_elements_base_vertex */ +passthru: /* ARB_provoking_vertex */ +passthru: /* ARB_sync */ +passthru: /* ARB_texture_multisample */ + + +############################################################################### +############################################################################### +# +# OpenGL 3.3 commands +# +############################################################################### +############################################################################### + +# New commands in OpenGL 3.3 + +# OpenGL 3.3 (ARB_instanced_arrays) commands + +VertexAttribDivisor(index, divisor) + return void + param index UInt32 in value + param divisor UInt32 in value + category VERSION_3_3 + version 1.1 + extension + glfflags ignore + glxflags ignore + +passthru: /* OpenGL 3.3 also reuses entry points from these extensions: */ +passthru: /* ARB_blend_func_extended */ +passthru: /* ARB_sampler_objects */ +passthru: /* ARB_explicit_attrib_location, but it has none */ +passthru: /* ARB_occlusion_query2 (no entry points) */ +passthru: /* ARB_shader_bit_encoding (no entry points) */ +passthru: /* ARB_texture_rgb10_a2ui (no entry points) */ +passthru: /* ARB_texture_swizzle (no entry points) */ +passthru: /* ARB_timer_query */ +passthru: /* ARB_vertex_type_2_10_10_10_rev */ + + +############################################################################### +############################################################################### +# +# OpenGL 4.0 commands +# +############################################################################### +############################################################################### + +# New commands in OpenGL 4.0 - none + +# OpenGL 4.0 (ARB_sample_shading) commands + +MinSampleShading(value) + return void + param value ClampedColorF in value + category VERSION_4_0 + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +# OpenGL 4.0 (ARB_draw_buffers_blend) commands + +BlendEquationi(buf, mode) + return void + param buf UInt32 in value + param mode GLenum in value + category VERSION_4_0 + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +BlendEquationSeparatei(buf, modeRGB, modeAlpha) + return void + param buf UInt32 in value + param modeRGB GLenum in value + param modeAlpha GLenum in value + category VERSION_4_0 + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +BlendFunci(buf, src, dst) + return void + param buf UInt32 in value + param src GLenum in value + param dst GLenum in value + category VERSION_4_0 + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +BlendFuncSeparatei(buf, srcRGB, dstRGB, srcAlpha, dstAlpha) + return void + param buf UInt32 in value + param srcRGB GLenum in value + param dstRGB GLenum in value + param srcAlpha GLenum in value + param dstAlpha GLenum in value + category VERSION_4_0 + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +passthru: /* OpenGL 4.0 also reuses entry points from these extensions: */ +passthru: /* ARB_texture_query_lod (no entry points) */ +passthru: /* ARB_draw_indirect */ +passthru: /* ARB_gpu_shader5 (no entry points) */ +passthru: /* ARB_gpu_shader_fp64 */ +passthru: /* ARB_shader_subroutine */ +passthru: /* ARB_tessellation_shader */ +passthru: /* ARB_texture_buffer_object_rgb32 (no entry points) */ +passthru: /* ARB_texture_cube_map_array (no entry points) */ +passthru: /* ARB_texture_gather (no entry points) */ +passthru: /* ARB_transform_feedback2 */ +passthru: /* ARB_transform_feedback3 */ + + +############################################################################### +############################################################################### +# +# OpenGL 4.1 commands +# +############################################################################### +############################################################################### + +# New commands in OpenGL 4.1 - none +newcategory: VERSION_4_1 + +passthru: /* OpenGL 4.1 also reuses entry points from these extensions: */ +passthru: /* ARB_ES2_compatibility */ +passthru: /* ARB_get_program_binary */ +passthru: /* ARB_separate_shader_objects */ +passthru: /* ARB_shader_precision (no entry points) */ +passthru: /* ARB_vertex_attrib_64bit */ +passthru: /* ARB_viewport_array */ + + +############################################################################### +############################################################################### +# +# ARB extensions, in order by ARB extension number +# +############################################################################### +############################################################################### + +############################################################################### +# +# ARB Extension #1 +# ARB_multitexture commands +# +############################################################################### + +ActiveTextureARB(texture) + return void + param texture TextureUnit in value + category ARB_multitexture + glxflags ARB + version 1.2 + glxropcode 197 + alias ActiveTexture + +ClientActiveTextureARB(texture) + return void + param texture TextureUnit in value + category ARB_multitexture + dlflags notlistable + glxflags ARB client-handcode client-intercept server-handcode + version 1.2 + alias ClientActiveTexture + +MultiTexCoord1dARB(target, s) + return void + param target TextureUnit in value + param s CoordD in value + category ARB_multitexture + glxflags ARB + version 1.2 + vectorequiv MultiTexCoord1dv + +MultiTexCoord1dvARB(target, v) + return void + param target TextureUnit in value + param v CoordD in array [1] + category ARB_multitexture + glxflags ARB + version 1.2 + glxropcode 198 + alias MultiTexCoord1dv + +MultiTexCoord1fARB(target, s) + return void + param target TextureUnit in value + param s CoordF in value + category ARB_multitexture + glxflags ARB + version 1.2 + vectorequiv MultiTexCoord1fv + +MultiTexCoord1fvARB(target, v) + return void + param target TextureUnit in value + param v CoordF in array [1] + category ARB_multitexture + glxflags ARB + version 1.2 + glxropcode 199 + alias MultiTexCoord1fv + +MultiTexCoord1iARB(target, s) + return void + param target TextureUnit in value + param s CoordI in value + category ARB_multitexture + glxflags ARB + version 1.2 + vectorequiv MultiTexCoord1iv + +MultiTexCoord1ivARB(target, v) + return void + param target TextureUnit in value + param v CoordI in array [1] + category ARB_multitexture + glxflags ARB + version 1.2 + glxropcode 200 + alias MultiTexCoord1iv + +MultiTexCoord1sARB(target, s) + return void + param target TextureUnit in value + param s CoordS in value + category ARB_multitexture + glxflags ARB + version 1.2 + vectorequiv MultiTexCoord1sv + +MultiTexCoord1svARB(target, v) + return void + param target TextureUnit in value + param v CoordS in array [1] + category ARB_multitexture + glxflags ARB + version 1.2 + glxropcode 201 + alias MultiTexCoord1sv + +MultiTexCoord2dARB(target, s, t) + return void + param target TextureUnit in value + param s CoordD in value + param t CoordD in value + category ARB_multitexture + glxflags ARB + version 1.2 + vectorequiv MultiTexCoord2dv + +MultiTexCoord2dvARB(target, v) + return void + param target TextureUnit in value + param v CoordD in array [2] + category ARB_multitexture + glxflags ARB + version 1.2 + glxropcode 202 + alias MultiTexCoord2dv + +MultiTexCoord2fARB(target, s, t) + return void + param target TextureUnit in value + param s CoordF in value + param t CoordF in value + category ARB_multitexture + glxflags ARB + version 1.2 + vectorequiv MultiTexCoord2fv + +MultiTexCoord2fvARB(target, v) + return void + param target TextureUnit in value + param v CoordF in array [2] + category ARB_multitexture + glxflags ARB + version 1.2 + glxropcode 203 + alias MultiTexCoord2fv + +MultiTexCoord2iARB(target, s, t) + return void + param target TextureUnit in value + param s CoordI in value + param t CoordI in value + category ARB_multitexture + glxflags ARB + version 1.2 + vectorequiv MultiTexCoord2iv + +MultiTexCoord2ivARB(target, v) + return void + param target TextureUnit in value + param v CoordI in array [2] + category ARB_multitexture + glxflags ARB + version 1.2 + glxropcode 204 + alias MultiTexCoord2iv + +MultiTexCoord2sARB(target, s, t) + return void + param target TextureUnit in value + param s CoordS in value + param t CoordS in value + category ARB_multitexture + glxflags ARB + version 1.2 + vectorequiv MultiTexCoord2sv + +MultiTexCoord2svARB(target, v) + return void + param target TextureUnit in value + param v CoordS in array [2] + category ARB_multitexture + glxflags ARB + version 1.2 + glxropcode 205 + alias MultiTexCoord2sv + +MultiTexCoord3dARB(target, s, t, r) + return void + param target TextureUnit in value + param s CoordD in value + param t CoordD in value + param r CoordD in value + category ARB_multitexture + glxflags ARB + version 1.2 + vectorequiv MultiTexCoord3dv + +MultiTexCoord3dvARB(target, v) + return void + param target TextureUnit in value + param v CoordD in array [3] + category ARB_multitexture + glxflags ARB + version 1.2 + glxropcode 206 + alias MultiTexCoord3dv + +MultiTexCoord3fARB(target, s, t, r) + return void + param target TextureUnit in value + param s CoordF in value + param t CoordF in value + param r CoordF in value + category ARB_multitexture + glxflags ARB + version 1.2 + vectorequiv MultiTexCoord3fv + +MultiTexCoord3fvARB(target, v) + return void + param target TextureUnit in value + param v CoordF in array [3] + category ARB_multitexture + glxflags ARB + version 1.2 + glxropcode 207 + alias MultiTexCoord3fv + +MultiTexCoord3iARB(target, s, t, r) + return void + param target TextureUnit in value + param s CoordI in value + param t CoordI in value + param r CoordI in value + category ARB_multitexture + glxflags ARB + version 1.2 + vectorequiv MultiTexCoord3iv + +MultiTexCoord3ivARB(target, v) + return void + param target TextureUnit in value + param v CoordI in array [3] + category ARB_multitexture + glxflags ARB + version 1.2 + glxropcode 208 + alias MultiTexCoord3iv + +MultiTexCoord3sARB(target, s, t, r) + return void + param target TextureUnit in value + param s CoordS in value + param t CoordS in value + param r CoordS in value + category ARB_multitexture + glxflags ARB + version 1.2 + vectorequiv MultiTexCoord3sv + +MultiTexCoord3svARB(target, v) + return void + param target TextureUnit in value + param v CoordS in array [3] + category ARB_multitexture + version 1.2 + glxflags ARB + glxropcode 209 + alias MultiTexCoord3sv + +MultiTexCoord4dARB(target, s, t, r, q) + return void + param target TextureUnit in value + param s CoordD in value + param t CoordD in value + param r CoordD in value + param q CoordD in value + category ARB_multitexture + glxflags ARB + version 1.2 + vectorequiv MultiTexCoord4dv + +MultiTexCoord4dvARB(target, v) + return void + param target TextureUnit in value + param v CoordD in array [4] + category ARB_multitexture + glxflags ARB + version 1.2 + glxropcode 210 + alias MultiTexCoord4dv + +MultiTexCoord4fARB(target, s, t, r, q) + return void + param target TextureUnit in value + param s CoordF in value + param t CoordF in value + param r CoordF in value + param q CoordF in value + category ARB_multitexture + glxflags ARB + version 1.2 + vectorequiv MultiTexCoord4fv + +MultiTexCoord4fvARB(target, v) + return void + param target TextureUnit in value + param v CoordF in array [4] + category ARB_multitexture + glxflags ARB + version 1.2 + glxropcode 211 + alias MultiTexCoord4fv + +MultiTexCoord4iARB(target, s, t, r, q) + return void + param target TextureUnit in value + param s CoordI in value + param t CoordI in value + param r CoordI in value + param q CoordI in value + category ARB_multitexture + glxflags ARB + version 1.2 + vectorequiv MultiTexCoord4iv + +MultiTexCoord4ivARB(target, v) + return void + param target TextureUnit in value + param v CoordI in array [4] + category ARB_multitexture + glxflags ARB + version 1.2 + glxropcode 212 + alias MultiTexCoord4iv + +MultiTexCoord4sARB(target, s, t, r, q) + return void + param target TextureUnit in value + param s CoordS in value + param t CoordS in value + param r CoordS in value + param q CoordS in value + category ARB_multitexture + glxflags ARB + version 1.2 + vectorequiv MultiTexCoord4sv + +MultiTexCoord4svARB(target, v) + return void + param target TextureUnit in value + param v CoordS in array [4] + category ARB_multitexture + glxflags ARB + version 1.2 + glxropcode 213 + alias MultiTexCoord4sv + +################################################################################ +# +# ARB Extension #2 - GLX_ARB_get_proc_address +# +############################################################################### + +################################################################################ +# +# ARB Extension #3 +# ARB_transpose_matrix commands +# +############################################################################### + +LoadTransposeMatrixfARB(m) + return void + param m Float32 in array [16] + category ARB_transpose_matrix + glxflags ARB client-handcode client-intercept server-handcode + version 1.2 + alias LoadTransposeMatrixf + +LoadTransposeMatrixdARB(m) + return void + param m Float64 in array [16] + category ARB_transpose_matrix + glxflags ARB client-handcode client-intercept server-handcode + version 1.2 + alias LoadTransposeMatrixd + +MultTransposeMatrixfARB(m) + return void + param m Float32 in array [16] + category ARB_transpose_matrix + glxflags ARB client-handcode client-intercept server-handcode + version 1.2 + alias MultTransposeMatrixf + +MultTransposeMatrixdARB(m) + return void + param m Float64 in array [16] + category ARB_transpose_matrix + glxflags ARB client-handcode client-intercept server-handcode + version 1.2 + alias MultTransposeMatrixd + +################################################################################ +# +# ARB Extension #4 - WGL_ARB_buffer_region +# +############################################################################### + +################################################################################ +# +# ARB Extension #5 +# ARB_multisample commands +# +############################################################################### + +SampleCoverageARB(value, invert) + return void + param value ClampedFloat32 in value + param invert Boolean in value + category ARB_multisample + glxflags ARB + version 1.2 + alias SampleCoverage + +################################################################################ +# +# ARB Extension #6 +# ARB_texture_env_add commands +# +############################################################################### + +# (none) +newcategory: ARB_texture_env_add + +################################################################################ +# +# ARB Extension #7 +# ARB_texture_cube_map commands +# +############################################################################### + +# (none) +newcategory: ARB_texture_cube_map + +################################################################################ +# +# ARB Extension #8 - WGL_ARB_extensions_string +# ARB Extension #9 - WGL_ARB_pixel_format commands +# ARB Extension #10 - WGL_ARB_make_current_read commands +# ARB Extension #11 - WGL_ARB_pbuffer +# +############################################################################### + +################################################################################ +# +# ARB Extension #12 +# ARB_texture_compression commands +# +############################################################################### + +# Arguably TexelInternalFormat, not PixelInternalFormat +CompressedTexImage3DARB(target, level, internalformat, width, height, depth, border, imageSize, data) + return void + param target TextureTarget in value + param level CheckedInt32 in value + param internalformat PixelInternalFormat in value + param width SizeI in value + param height SizeI in value + param depth SizeI in value + param border CheckedInt32 in value + param imageSize SizeI in value + param data CompressedTextureARB in array [imageSize] + category ARB_texture_compression + dlflags handcode + glxflags ARB client-handcode server-handcode + version 1.2 + glxropcode 216 + alias CompressedTexImage3D + wglflags client-handcode server-handcode + +# Arguably TexelInternalFormat, not PixelInternalFormat +CompressedTexImage2DARB(target, level, internalformat, width, height, border, imageSize, data) + return void + param target TextureTarget in value + param level CheckedInt32 in value + param internalformat PixelInternalFormat in value + param width SizeI in value + param height SizeI in value + param border CheckedInt32 in value + param imageSize SizeI in value + param data CompressedTextureARB in array [imageSize] + category ARB_texture_compression + dlflags handcode + glxflags ARB client-handcode server-handcode + version 1.2 + glxropcode 215 + alias CompressedTexImage2D + wglflags client-handcode server-handcode + +# Arguably TexelInternalFormat, not PixelInternalFormat +CompressedTexImage1DARB(target, level, internalformat, width, border, imageSize, data) + return void + param target TextureTarget in value + param level CheckedInt32 in value + param internalformat PixelInternalFormat in value + param width SizeI in value + param border CheckedInt32 in value + param imageSize SizeI in value + param data CompressedTextureARB in array [imageSize] + category ARB_texture_compression + dlflags handcode + glxflags ARB client-handcode server-handcode + version 1.2 + glxropcode 214 + alias CompressedTexImage1D + wglflags client-handcode server-handcode + +CompressedTexSubImage3DARB(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data) + return void + param target TextureTarget in value + param level CheckedInt32 in value + param xoffset CheckedInt32 in value + param yoffset CheckedInt32 in value + param zoffset CheckedInt32 in value + param width SizeI in value + param height SizeI in value + param depth SizeI in value + param format PixelFormat in value + param imageSize SizeI in value + param data CompressedTextureARB in array [imageSize] + category ARB_texture_compression + dlflags handcode + glxflags ARB client-handcode server-handcode + version 1.2 + glxropcode 219 + alias CompressedTexSubImage3D + wglflags client-handcode server-handcode + +CompressedTexSubImage2DARB(target, level, xoffset, yoffset, width, height, format, imageSize, data) + return void + param target TextureTarget in value + param level CheckedInt32 in value + param xoffset CheckedInt32 in value + param yoffset CheckedInt32 in value + param width SizeI in value + param height SizeI in value + param format PixelFormat in value + param imageSize SizeI in value + param data CompressedTextureARB in array [imageSize] + category ARB_texture_compression + dlflags handcode + glxflags ARB client-handcode server-handcode + version 1.2 + glxropcode 218 + alias CompressedTexSubImage2D + wglflags client-handcode server-handcode + +CompressedTexSubImage1DARB(target, level, xoffset, width, format, imageSize, data) + return void + param target TextureTarget in value + param level CheckedInt32 in value + param xoffset CheckedInt32 in value + param width SizeI in value + param format PixelFormat in value + param imageSize SizeI in value + param data CompressedTextureARB in array [imageSize] + category ARB_texture_compression + dlflags handcode + glxflags ARB client-handcode server-handcode + version 1.2 + glxropcode 217 + alias CompressedTexSubImage1D + wglflags client-handcode server-handcode + +GetCompressedTexImageARB(target, level, img) + return void + param target TextureTarget in value + param level CheckedInt32 in value + param img CompressedTextureARB out array [COMPSIZE(target/level)] + category ARB_texture_compression + dlflags notlistable + glxflags ARB client-handcode server-handcode + version 1.2 + glxsingle 160 + alias GetCompressedTexImage + wglflags client-handcode server-handcode + +################################################################################ +# +# ARB Extension #13 +# ARB_texture_border_clamp commands +# +############################################################################### + +# (none) +newcategory: ARB_texture_border_clamp + +############################################################################### +# +# ARB Extension #14 +# ARB_point_parameters commands +# +############################################################################### + +PointParameterfARB(pname, param) + return void + param pname PointParameterNameARB in value + param param CheckedFloat32 in value + category ARB_point_parameters + version 1.0 + glxflags ARB + glxropcode 2065 + extension + alias PointParameterf + +PointParameterfvARB(pname, params) + return void + param pname PointParameterNameARB in value + param params CheckedFloat32 in array [COMPSIZE(pname)] + category ARB_point_parameters + version 1.0 + glxflags ARB + glxropcode 2066 + extension + alias PointParameterfv + +################################################################################ +# +# ARB Extension #15 +# ARB_vertex_blend commands +# +############################################################################### + +WeightbvARB(size, weights) + return void + param size Int32 in value + param weights Int8 in array [size] + category ARB_vertex_blend + version 1.1 + extension + glxropcode 220 + glxflags ignore + offset ? + +WeightsvARB(size, weights) + return void + param size Int32 in value + param weights Int16 in array [size] + category ARB_vertex_blend + version 1.1 + extension + glxropcode 222 + glxflags ignore + offset ? + +WeightivARB(size, weights) + return void + param size Int32 in value + param weights Int32 in array [size] + category ARB_vertex_blend + version 1.1 + extension + glxropcode 224 + glxflags ignore + offset ? + +WeightfvARB(size, weights) + return void + param size Int32 in value + param weights Float32 in array [size] + category ARB_vertex_blend + version 1.1 + extension + glxropcode 227 + glxflags ignore + offset ? + +WeightdvARB(size, weights) + return void + param size Int32 in value + param weights Float64 in array [size] + category ARB_vertex_blend + version 1.1 + extension + glxropcode 228 + glxflags ignore + offset ? + +WeightubvARB(size, weights) + return void + param size Int32 in value + param weights UInt8 in array [size] + category ARB_vertex_blend + version 1.1 + extension + glxropcode 221 + glxflags ignore + offset ? + +WeightusvARB(size, weights) + return void + param size Int32 in value + param weights UInt16 in array [size] + category ARB_vertex_blend + version 1.1 + extension + glxropcode 223 + glxflags ignore + offset ? + +WeightuivARB(size, weights) + return void + param size Int32 in value + param weights UInt32 in array [size] + category ARB_vertex_blend + version 1.1 + extension + glxropcode 225 + glxflags ignore + offset ? + +WeightPointerARB(size, type, stride, pointer) + return void + param size Int32 in value + param type WeightPointerTypeARB in value + param stride SizeI in value + param pointer Void in array [COMPSIZE(type/stride)] retained + category ARB_vertex_blend + version 1.1 + extension + dlflags notlistable + glxflags ignore + offset ? + +VertexBlendARB(count) + return void + param count Int32 in value + category ARB_vertex_blend + version 1.1 + extension + glxropcode 226 + glxflags ignore + offset ? + +################################################################################ +# +# ARB Extension #16 +# ARB_matrix_palette commands +# +############################################################################### + +CurrentPaletteMatrixARB(index) + return void + param index Int32 in value + category ARB_matrix_palette + version 1.1 + extension + glxropcode 4329 + glxflags ignore + offset ? + +MatrixIndexubvARB(size, indices) + return void + param size Int32 in value + param indices UInt8 in array [size] + category ARB_matrix_palette + version 1.1 + extension + glxropcode 4326 + glxflags ignore + offset ? + +MatrixIndexusvARB(size, indices) + return void + param size Int32 in value + param indices UInt16 in array [size] + category ARB_matrix_palette + version 1.1 + extension + glxropcode 4327 + glxflags ignore + offset ? + +MatrixIndexuivARB(size, indices) + return void + param size Int32 in value + param indices UInt32 in array [size] + category ARB_matrix_palette + version 1.1 + extension + glxropcode 4328 + glxflags ignore + offset ? + +MatrixIndexPointerARB(size, type, stride, pointer) + return void + param size Int32 in value + param type MatrixIndexPointerTypeARB in value + param stride SizeI in value + param pointer Void in array [COMPSIZE(type/stride)] retained + category ARB_matrix_palette + version 1.1 + extension + dlflags notlistable + glxflags ignore + offset ? + +################################################################################ +# +# ARB Extension #17 +# ARB_texture_env_combine commands +# +############################################################################### + +# (none) +newcategory: ARB_texture_env_combine + +################################################################################ +# +# ARB Extension #18 +# ARB_texture_env_crossbar commands +# +############################################################################### + +# (none) +newcategory: ARB_texture_env_crossbar + +################################################################################ +# +# ARB Extension #19 +# ARB_texture_env_dot3 commands +# +############################################################################### + +# (none) +newcategory: ARB_texture_env_dot3 + +############################################################################### +# +# ARB Extension #20 - WGL_ARB_render_texture +# +############################################################################### + +############################################################################### +# +# ARB Extension #21 +# ARB_texture_mirrored_repeat commands +# +############################################################################### + +# (none) +newcategory: ARB_texture_mirrored_repeat + +############################################################################### +# +# ARB Extension #22 +# ARB_depth_texture commands +# +############################################################################### + +# (none) +newcategory: ARB_depth_texture + +############################################################################### +# +# ARB Extension #23 +# ARB_shadow commands +# +############################################################################### + +# (none) +newcategory: ARB_shadow + +############################################################################### +# +# ARB Extension #24 +# ARB_shadow_ambient commands +# +############################################################################### + +# (none) +newcategory: ARB_shadow_ambient + +############################################################################### +# +# ARB Extension #25 +# ARB_window_pos commands +# Note: all entry points use glxropcode ropcode 230, with 3 float parameters +# +############################################################################### + +WindowPos2dARB(x, y) + return void + param x CoordD in value + param y CoordD in value + category ARB_window_pos + vectorequiv WindowPos2dvARB + version 1.0 + alias WindowPos2d + +WindowPos2dvARB(v) + return void + param v CoordD in array [2] + category ARB_window_pos + version 1.0 + glxropcode 230 + glxflags client-handcode server-handcode + alias WindowPos2dv + +WindowPos2fARB(x, y) + return void + param x CoordF in value + param y CoordF in value + category ARB_window_pos + vectorequiv WindowPos2fvARB + version 1.0 + alias WindowPos2f + +WindowPos2fvARB(v) + return void + param v CoordF in array [2] + category ARB_window_pos + version 1.0 + glxropcode 230 + glxflags client-handcode server-handcode + alias WindowPos2fv + +WindowPos2iARB(x, y) + return void + param x CoordI in value + param y CoordI in value + category ARB_window_pos + vectorequiv WindowPos2ivARB + version 1.0 + alias WindowPos2i + +WindowPos2ivARB(v) + return void + param v CoordI in array [2] + category ARB_window_pos + version 1.0 + glxropcode 230 + glxflags client-handcode server-handcode + alias WindowPos2iv + +WindowPos2sARB(x, y) + return void + param x CoordS in value + param y CoordS in value + category ARB_window_pos + vectorequiv WindowPos2svARB + version 1.0 + alias WindowPos2s + +WindowPos2svARB(v) + return void + param v CoordS in array [2] + category ARB_window_pos + version 1.0 + glxropcode 230 + glxflags client-handcode server-handcode + alias WindowPos2sv + +WindowPos3dARB(x, y, z) + return void + param x CoordD in value + param y CoordD in value + param z CoordD in value + vectorequiv WindowPos3dvARB + category ARB_window_pos + version 1.0 + alias WindowPos3d + +WindowPos3dvARB(v) + return void + param v CoordD in array [3] + category ARB_window_pos + version 1.0 + glxropcode 230 + glxflags client-handcode server-handcode + alias WindowPos3dv + +WindowPos3fARB(x, y, z) + return void + param x CoordF in value + param y CoordF in value + param z CoordF in value + category ARB_window_pos + vectorequiv WindowPos3fvARB + version 1.0 + alias WindowPos3f + +WindowPos3fvARB(v) + return void + param v CoordF in array [3] + category ARB_window_pos + version 1.0 + glxropcode 230 + glxflags client-handcode server-handcode + alias WindowPos3fv + +WindowPos3iARB(x, y, z) + return void + param x CoordI in value + param y CoordI in value + param z CoordI in value + category ARB_window_pos + vectorequiv WindowPos3ivARB + version 1.0 + alias WindowPos3i + +WindowPos3ivARB(v) + return void + param v CoordI in array [3] + category ARB_window_pos + version 1.0 + glxropcode 230 + glxflags client-handcode server-handcode + alias WindowPos3iv + +WindowPos3sARB(x, y, z) + return void + param x CoordS in value + param y CoordS in value + param z CoordS in value + category ARB_window_pos + vectorequiv WindowPos3svARB + version 1.0 + alias WindowPos3s + +WindowPos3svARB(v) + return void + param v CoordS in array [3] + category ARB_window_pos + version 1.0 + glxropcode 230 + glxflags client-handcode server-handcode + alias WindowPos3sv + +############################################################################### +# +# ARB Extension #26 +# ARB_vertex_program commands +# +############################################################################### + +VertexAttrib1dARB(index, x) + return void + param index UInt32 in value + param x Float64 in value + category ARB_vertex_program + version 1.3 + vectorequiv VertexAttrib1dvARB + extension soft WINSOFT NV10 + alias VertexAttrib1d + +VertexAttrib1dvARB(index, v) + return void + param index UInt32 in value + param v Float64 in array [1] + category ARB_vertex_program + version 1.3 + extension soft WINSOFT NV10 + glxropcode 4197 + alias VertexAttrib1dv + +VertexAttrib1fARB(index, x) + return void + param index UInt32 in value + param x Float32 in value + category ARB_vertex_program + version 1.3 + vectorequiv VertexAttrib1fvARB + extension soft WINSOFT NV10 + alias VertexAttrib1f + +VertexAttrib1fvARB(index, v) + return void + param index UInt32 in value + param v Float32 in array [1] + category ARB_vertex_program + version 1.3 + extension soft WINSOFT NV10 + glxropcode 4193 + alias VertexAttrib1fv + +VertexAttrib1sARB(index, x) + return void + param index UInt32 in value + param x Int16 in value + category ARB_vertex_program + version 1.3 + vectorequiv VertexAttrib1svARB + extension soft WINSOFT NV10 + alias VertexAttrib1s + +VertexAttrib1svARB(index, v) + return void + param index UInt32 in value + param v Int16 in array [1] + category ARB_vertex_program + version 1.3 + extension soft WINSOFT NV10 + glxropcode 4189 + alias VertexAttrib1sv + +VertexAttrib2dARB(index, x, y) + return void + param index UInt32 in value + param x Float64 in value + param y Float64 in value + category ARB_vertex_program + version 1.3 + vectorequiv VertexAttrib2dvARB + extension soft WINSOFT NV10 + alias VertexAttrib2d + +VertexAttrib2dvARB(index, v) + return void + param index UInt32 in value + param v Float64 in array [2] + category ARB_vertex_program + version 1.3 + extension soft WINSOFT NV10 + glxropcode 4198 + alias VertexAttrib2dv + +VertexAttrib2fARB(index, x, y) + return void + param index UInt32 in value + param x Float32 in value + param y Float32 in value + category ARB_vertex_program + version 1.3 + vectorequiv VertexAttrib2fvARB + extension soft WINSOFT NV10 + alias VertexAttrib2f + +VertexAttrib2fvARB(index, v) + return void + param index UInt32 in value + param v Float32 in array [2] + category ARB_vertex_program + version 1.3 + extension soft WINSOFT NV10 + glxropcode 4194 + alias VertexAttrib2fv + +VertexAttrib2sARB(index, x, y) + return void + param index UInt32 in value + param x Int16 in value + param y Int16 in value + category ARB_vertex_program + version 1.3 + vectorequiv VertexAttrib2svARB + extension soft WINSOFT NV10 + alias VertexAttrib2s + +VertexAttrib2svARB(index, v) + return void + param index UInt32 in value + param v Int16 in array [2] + category ARB_vertex_program + version 1.3 + extension soft WINSOFT NV10 + glxropcode 4190 + alias VertexAttrib2sv + +VertexAttrib3dARB(index, x, y, z) + return void + param index UInt32 in value + param x Float64 in value + param y Float64 in value + param z Float64 in value + category ARB_vertex_program + version 1.3 + vectorequiv VertexAttrib3dvARB + extension soft WINSOFT NV10 + alias VertexAttrib3d + +VertexAttrib3dvARB(index, v) + return void + param index UInt32 in value + param v Float64 in array [3] + category ARB_vertex_program + version 1.3 + extension soft WINSOFT NV10 + glxropcode 4199 + alias VertexAttrib3dv + +VertexAttrib3fARB(index, x, y, z) + return void + param index UInt32 in value + param x Float32 in value + param y Float32 in value + param z Float32 in value + category ARB_vertex_program + version 1.3 + vectorequiv VertexAttrib3fvARB + extension soft WINSOFT NV10 + alias VertexAttrib3f + +VertexAttrib3fvARB(index, v) + return void + param index UInt32 in value + param v Float32 in array [3] + category ARB_vertex_program + version 1.3 + extension soft WINSOFT NV10 + glxropcode 4195 + alias VertexAttrib3fv + +VertexAttrib3sARB(index, x, y, z) + return void + param index UInt32 in value + param x Int16 in value + param y Int16 in value + param z Int16 in value + category ARB_vertex_program + version 1.3 + vectorequiv VertexAttrib3svARB + extension soft WINSOFT NV10 + alias VertexAttrib3s + +VertexAttrib3svARB(index, v) + return void + param index UInt32 in value + param v Int16 in array [3] + category ARB_vertex_program + version 1.3 + extension soft WINSOFT NV10 + glxropcode 4191 + alias VertexAttrib3sv + +VertexAttrib4NbvARB(index, v) + return void + param index UInt32 in value + param v Int8 in array [4] + category ARB_vertex_program + version 1.3 + extension soft WINSOFT NV10 + alias VertexAttrib4Nbv + +VertexAttrib4NivARB(index, v) + return void + param index UInt32 in value + param v Int32 in array [4] + category ARB_vertex_program + version 1.3 + extension soft WINSOFT NV10 + alias VertexAttrib4Niv + +VertexAttrib4NsvARB(index, v) + return void + param index UInt32 in value + param v Int16 in array [4] + category ARB_vertex_program + version 1.3 + extension soft WINSOFT NV10 + alias VertexAttrib4Nsv + +VertexAttrib4NubARB(index, x, y, z, w) + return void + param index UInt32 in value + param x UInt8 in value + param y UInt8 in value + param z UInt8 in value + param w UInt8 in value + category ARB_vertex_program + version 1.3 + extension soft WINSOFT NV10 + alias VertexAttrib4Nub + +VertexAttrib4NubvARB(index, v) + return void + param index UInt32 in value + param v UInt8 in array [4] + category ARB_vertex_program + version 1.3 + extension soft WINSOFT NV10 + glxropcode 4201 + alias VertexAttrib4Nubv + +VertexAttrib4NuivARB(index, v) + return void + param index UInt32 in value + param v UInt32 in array [4] + category ARB_vertex_program + version 1.3 + extension soft WINSOFT NV10 + alias VertexAttrib4Nuiv + +VertexAttrib4NusvARB(index, v) + return void + param index UInt32 in value + param v UInt16 in array [4] + category ARB_vertex_program + version 1.3 + extension soft WINSOFT NV10 + alias VertexAttrib4Nusv + +VertexAttrib4bvARB(index, v) + return void + param index UInt32 in value + param v Int8 in array [4] + category ARB_vertex_program + version 1.3 + extension soft WINSOFT NV10 + alias VertexAttrib4bv + +VertexAttrib4dARB(index, x, y, z, w) + return void + param index UInt32 in value + param x Float64 in value + param y Float64 in value + param z Float64 in value + param w Float64 in value + category ARB_vertex_program + version 1.3 + vectorequiv VertexAttrib4dvARB + extension soft WINSOFT NV10 + alias VertexAttrib4d + +VertexAttrib4dvARB(index, v) + return void + param index UInt32 in value + param v Float64 in array [4] + category ARB_vertex_program + version 1.3 + extension soft WINSOFT NV10 + glxropcode 4200 + alias VertexAttrib4dv + +VertexAttrib4fARB(index, x, y, z, w) + return void + param index UInt32 in value + param x Float32 in value + param y Float32 in value + param z Float32 in value + param w Float32 in value + category ARB_vertex_program + version 1.3 + vectorequiv VertexAttrib4fvARB + extension soft WINSOFT NV10 + alias VertexAttrib4f + +VertexAttrib4fvARB(index, v) + return void + param index UInt32 in value + param v Float32 in array [4] + category ARB_vertex_program + version 1.3 + extension soft WINSOFT NV10 + glxropcode 4196 + alias VertexAttrib4fv + +VertexAttrib4ivARB(index, v) + return void + param index UInt32 in value + param v Int32 in array [4] + category ARB_vertex_program + version 1.3 + extension soft WINSOFT NV10 + alias VertexAttrib4iv + +VertexAttrib4sARB(index, x, y, z, w) + return void + param index UInt32 in value + param x Int16 in value + param y Int16 in value + param z Int16 in value + param w Int16 in value + category ARB_vertex_program + version 1.3 + vectorequiv VertexAttrib4svARB + extension soft WINSOFT NV10 + alias VertexAttrib4s + +VertexAttrib4svARB(index, v) + return void + param index UInt32 in value + param v Int16 in array [4] + category ARB_vertex_program + version 1.3 + extension soft WINSOFT NV10 + glxropcode 4192 + alias VertexAttrib4sv + +VertexAttrib4ubvARB(index, v) + return void + param index UInt32 in value + param v UInt8 in array [4] + category ARB_vertex_program + version 1.3 + extension soft WINSOFT NV10 + alias VertexAttrib4ubv + +VertexAttrib4uivARB(index, v) + return void + param index UInt32 in value + param v UInt32 in array [4] + category ARB_vertex_program + version 1.3 + extension soft WINSOFT NV10 + alias VertexAttrib4uiv + +VertexAttrib4usvARB(index, v) + return void + param index UInt32 in value + param v UInt16 in array [4] + category ARB_vertex_program + version 1.3 + extension soft WINSOFT NV10 + alias VertexAttrib4usv + +VertexAttribPointerARB(index, size, type, normalized, stride, pointer) + return void + param index UInt32 in value + param size Int32 in value + param type VertexAttribPointerTypeARB in value + param normalized Boolean in value + param stride SizeI in value + param pointer Void in array [COMPSIZE(size/type/stride)] retained + dlflags notlistable + category ARB_vertex_program + version 1.3 + extension soft WINSOFT NV10 + alias VertexAttribPointer + +EnableVertexAttribArrayARB(index) + return void + param index UInt32 in value + dlflags notlistable + category ARB_vertex_program + version 1.3 + extension soft WINSOFT NV10 + alias EnableVertexAttribArray + +DisableVertexAttribArrayARB(index) + return void + param index UInt32 in value + dlflags notlistable + category ARB_vertex_program + version 1.3 + extension soft WINSOFT NV10 + alias DisableVertexAttribArray + +ProgramStringARB(target, format, len, string) + return void + param target ProgramTargetARB in value + param format ProgramFormatARB in value + param len SizeI in value + param string Void in array [len] + category ARB_vertex_program + version 1.3 + extension soft WINSOFT NV10 + glxflags ignore + offset 667 + +BindProgramARB(target, program) + return void + param target ProgramTargetARB in value + param program UInt32 in value + category ARB_vertex_program + version 1.3 + extension soft WINSOFT NV10 + glxropcode 4180 + offset 579 + +DeleteProgramsARB(n, programs) + return void + param n SizeI in value + param programs UInt32 in array [n] + dlflags notlistable + category ARB_vertex_program + version 1.3 + extension soft WINSOFT NV10 + glxvendorpriv 1294 + offset 580 + +GenProgramsARB(n, programs) + return void + param n SizeI in value + param programs UInt32 out array [n] + dlflags notlistable + category ARB_vertex_program + version 1.3 + extension soft WINSOFT NV10 + glxvendorpriv 1295 + offset 582 + +ProgramEnvParameter4dARB(target, index, x, y, z, w) + return void + param target ProgramTargetARB in value + param index UInt32 in value + param x Float64 in value + param y Float64 in value + param z Float64 in value + param w Float64 in value + category ARB_vertex_program + version 1.3 + vectorequiv ProgramEnvParameter4dvARB + extension soft WINSOFT NV10 + glxflags ignore + offset 668 + +ProgramEnvParameter4dvARB(target, index, params) + return void + param target ProgramTargetARB in value + param index UInt32 in value + param params Float64 in array [4] + category ARB_vertex_program + version 1.3 + extension soft WINSOFT NV10 + glxflags ignore + offset 669 + +ProgramEnvParameter4fARB(target, index, x, y, z, w) + return void + param target ProgramTargetARB in value + param index UInt32 in value + param x Float32 in value + param y Float32 in value + param z Float32 in value + param w Float32 in value + category ARB_vertex_program + version 1.3 + vectorequiv ProgramEnvParameter4fvARB + extension soft WINSOFT NV10 + glxflags ignore + offset 670 + +ProgramEnvParameter4fvARB(target, index, params) + return void + param target ProgramTargetARB in value + param index UInt32 in value + param params Float32 in array [4] + category ARB_vertex_program + version 1.3 + extension soft WINSOFT NV10 + glxflags ignore + offset 671 + +ProgramLocalParameter4dARB(target, index, x, y, z, w) + return void + param target ProgramTargetARB in value + param index UInt32 in value + param x Float64 in value + param y Float64 in value + param z Float64 in value + param w Float64 in value + category ARB_vertex_program + version 1.3 + vectorequiv ProgramLocalParameter4dvARB + extension soft WINSOFT NV10 + glxflags ignore + offset 672 + +ProgramLocalParameter4dvARB(target, index, params) + return void + param target ProgramTargetARB in value + param index UInt32 in value + param params Float64 in array [4] + category ARB_vertex_program + version 1.3 + extension soft WINSOFT NV10 + glxflags ignore + offset 673 + +ProgramLocalParameter4fARB(target, index, x, y, z, w) + return void + param target ProgramTargetARB in value + param index UInt32 in value + param x Float32 in value + param y Float32 in value + param z Float32 in value + param w Float32 in value + category ARB_vertex_program + version 1.3 + vectorequiv ProgramLocalParameter4fvARB + extension soft WINSOFT NV10 + glxflags ignore + offset 674 + +ProgramLocalParameter4fvARB(target, index, params) + return void + param target ProgramTargetARB in value + param index UInt32 in value + param params Float32 in array [4] + category ARB_vertex_program + version 1.3 + extension soft WINSOFT NV10 + glxflags ignore + offset 675 + +GetProgramEnvParameterdvARB(target, index, params) + return void + param target ProgramTargetARB in value + param index UInt32 in value + param params Float64 out array [4] + dlflags notlistable + category ARB_vertex_program + version 1.3 + extension soft WINSOFT NV10 + glxflags ignore + offset 676 + +GetProgramEnvParameterfvARB(target, index, params) + return void + param target ProgramTargetARB in value + param index UInt32 in value + param params Float32 out array [4] + dlflags notlistable + category ARB_vertex_program + version 1.3 + extension soft WINSOFT NV10 + glxflags ignore + offset 677 + +GetProgramLocalParameterdvARB(target, index, params) + return void + param target ProgramTargetARB in value + param index UInt32 in value + param params Float64 out array [4] + dlflags notlistable + category ARB_vertex_program + version 1.3 + extension soft WINSOFT NV10 + glxflags ignore + offset 678 + +GetProgramLocalParameterfvARB(target, index, params) + return void + param target ProgramTargetARB in value + param index UInt32 in value + param params Float32 out array [4] + dlflags notlistable + category ARB_vertex_program + version 1.3 + extension soft WINSOFT NV10 + glxflags ignore + offset 679 + +GetProgramivARB(target, pname, params) + return void + param target ProgramTargetARB in value + param pname ProgramPropertyARB in value + param params Int32 out array [1] + dlflags notlistable + category ARB_vertex_program + version 1.3 + extension soft WINSOFT NV10 + glxflags ignore + offset 680 + +GetProgramStringARB(target, pname, string) + return void + param target ProgramTargetARB in value + param pname ProgramStringPropertyARB in value + param string Void out array [COMPSIZE(target,pname)] + dlflags notlistable + category ARB_vertex_program + version 1.3 + extension soft WINSOFT NV10 + glxflags ignore + offset 681 + +GetVertexAttribdvARB(index, pname, params) + return void + param index UInt32 in value + param pname VertexAttribPropertyARB in value + param params Float64 out array [4] + dlflags notlistable + category ARB_vertex_program + version 1.3 + extension soft WINSOFT NV10 + glxvendorpriv 1301 + alias GetVertexAttribdv + +GetVertexAttribfvARB(index, pname, params) + return void + param index UInt32 in value + param pname VertexAttribPropertyARB in value + param params Float32 out array [4] + dlflags notlistable + category ARB_vertex_program + version 1.3 + extension soft WINSOFT NV10 + glxvendorpriv 1302 + alias GetVertexAttribfv + +GetVertexAttribivARB(index, pname, params) + return void + param index UInt32 in value + param pname VertexAttribPropertyARB in value + param params Int32 out array [4] + dlflags notlistable + category ARB_vertex_program + version 1.3 + extension soft WINSOFT NV10 + glxvendorpriv 1303 + alias GetVertexAttribiv + +GetVertexAttribPointervARB(index, pname, pointer) + return void + param index UInt32 in value + param pname VertexAttribPointerPropertyARB in value + param pointer VoidPointer out array [1] + dlflags notlistable + category ARB_vertex_program + version 1.3 + extension soft WINSOFT NV10 + glxflags ignore + alias GetVertexAttribPointerv + +IsProgramARB(program) + return Boolean + param program UInt32 in value + dlflags notlistable + category ARB_vertex_program + version 1.3 + extension soft WINSOFT NV10 + glxvendorpriv 1304 + alias IsProgram + + +############################################################################### +# +# ARB Extension #27 +# ARB_fragment_program commands +# +############################################################################### + +# All ARB_fragment_program entry points are shared with ARB_vertex_program, +# and are only included in that #define block, for now. +newcategory: ARB_fragment_program +passthru: /* All ARB_fragment_program entry points are shared with ARB_vertex_program. */ + +############################################################################### +# +# ARB Extension #28 +# ARB_vertex_buffer_object commands +# +############################################################################### + +BindBufferARB(target, buffer) + return void + param target BufferTargetARB in value + param buffer UInt32 in value + category ARB_vertex_buffer_object + version 1.2 + extension + alias BindBuffer + +DeleteBuffersARB(n, buffers) + return void + param n SizeI in value + param buffers ConstUInt32 in array [n] + category ARB_vertex_buffer_object + version 1.2 + extension + alias DeleteBuffers + +GenBuffersARB(n, buffers) + return void + param n SizeI in value + param buffers UInt32 out array [n] + category ARB_vertex_buffer_object + version 1.2 + extension + alias GenBuffers + +IsBufferARB(buffer) + return Boolean + param buffer UInt32 in value + category ARB_vertex_buffer_object + version 1.2 + extension + alias IsBuffer + +BufferDataARB(target, size, data, usage) + return void + param target BufferTargetARB in value + param size BufferSizeARB in value + param data ConstVoid in array [size] + param usage BufferUsageARB in value + category ARB_vertex_buffer_object + version 1.2 + extension + alias BufferData + +BufferSubDataARB(target, offset, size, data) + return void + param target BufferTargetARB in value + param offset BufferOffsetARB in value + param size BufferSizeARB in value + param data ConstVoid in array [size] + category ARB_vertex_buffer_object + version 1.2 + extension + alias BufferSubData + +GetBufferSubDataARB(target, offset, size, data) + return void + param target BufferTargetARB in value + param offset BufferOffsetARB in value + param size BufferSizeARB in value + param data Void out array [size] + category ARB_vertex_buffer_object + dlflags notlistable + version 1.2 + extension + alias GetBufferSubData + +MapBufferARB(target, access) + return VoidPointer + param target BufferTargetARB in value + param access BufferAccessARB in value + category ARB_vertex_buffer_object + version 1.2 + extension + alias MapBuffer + +UnmapBufferARB(target) + return Boolean + param target BufferTargetARB in value + category ARB_vertex_buffer_object + version 1.2 + extension + alias UnmapBuffer + +GetBufferParameterivARB(target, pname, params) + return void + param target BufferTargetARB in value + param pname BufferPNameARB in value + param params Int32 out array [COMPSIZE(pname)] + category ARB_vertex_buffer_object + dlflags notlistable + version 1.2 + extension + alias GetBufferParameteriv + +GetBufferPointervARB(target, pname, params) + return void + param target BufferTargetARB in value + param pname BufferPointerNameARB in value + param params VoidPointer out array [1] + category ARB_vertex_buffer_object + dlflags notlistable + version 1.2 + extension + alias GetBufferPointerv + +############################################################################### +# +# ARB Extension #29 +# ARB_occlusion_query commands +# +############################################################################### + +GenQueriesARB(n, ids) + return void + param n SizeI in value + param ids UInt32 out array [n] + category ARB_occlusion_query + version 1.5 + extension + alias GenQueries + +DeleteQueriesARB(n, ids) + return void + param n SizeI in value + param ids UInt32 in array [n] + category ARB_occlusion_query + version 1.5 + extension + alias DeleteQueries + +IsQueryARB(id) + return Boolean + param id UInt32 in value + category ARB_occlusion_query + version 1.5 + extension + alias IsQuery + +BeginQueryARB(target, id) + return void + param target GLenum in value + param id UInt32 in value + category ARB_occlusion_query + version 1.5 + extension + alias BeginQuery + +EndQueryARB(target) + return void + param target GLenum in value + category ARB_occlusion_query + version 1.5 + extension + alias EndQuery + +GetQueryivARB(target, pname, params) + return void + param target GLenum in value + param pname GLenum in value + param params Int32 out array [pname] + category ARB_occlusion_query + dlflags notlistable + version 1.5 + extension + alias GetQueryiv + +GetQueryObjectivARB(id, pname, params) + return void + param id UInt32 in value + param pname GLenum in value + param params Int32 out array [pname] + category ARB_occlusion_query + dlflags notlistable + version 1.5 + extension + alias GetQueryObjectiv + +GetQueryObjectuivARB(id, pname, params) + return void + param id UInt32 in value + param pname GLenum in value + param params UInt32 out array [pname] + category ARB_occlusion_query + dlflags notlistable + version 1.5 + extension + alias GetQueryObjectuiv + +############################################################################### +# +# ARB Extension #30 +# ARB_shader_objects commands +# +############################################################################### + +DeleteObjectARB(obj) + return void + param obj handleARB in value + category ARB_shader_objects + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +GetHandleARB(pname) + return handleARB + param pname GLenum in value + category ARB_shader_objects + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +DetachObjectARB(containerObj, attachedObj) + return void + param containerObj handleARB in value + param attachedObj handleARB in value + category ARB_shader_objects + version 1.2 + extension + glxropcode ? + glxflags ignore + alias DetachShader + +CreateShaderObjectARB(shaderType) + return handleARB + param shaderType GLenum in value + category ARB_shader_objects + version 1.2 + extension + glxropcode ? + glxflags ignore + alias CreateShader + +ShaderSourceARB(shaderObj, count, string, length) + return void + param shaderObj handleARB in value + param count SizeI in value + param string charPointerARB in array [count] + param length Int32 in array [1] + category ARB_shader_objects + version 1.2 + extension + glxropcode ? + glxflags ignore + alias ShaderSource + +CompileShaderARB(shaderObj) + return void + param shaderObj handleARB in value + category ARB_shader_objects + version 1.2 + extension + glxropcode ? + glxflags ignore + alias CompileShader + +CreateProgramObjectARB() + return handleARB + category ARB_shader_objects + version 1.2 + extension + glxropcode ? + glxflags ignore + alias CreateProgram + +AttachObjectARB(containerObj, obj) + return void + param containerObj handleARB in value + param obj handleARB in value + category ARB_shader_objects + version 1.2 + extension + glxropcode ? + glxflags ignore + alias AttachShader + +LinkProgramARB(programObj) + return void + param programObj handleARB in value + category ARB_shader_objects + version 1.2 + extension + glxropcode ? + glxflags ignore + alias LinkProgram + +UseProgramObjectARB(programObj) + return void + param programObj handleARB in value + category ARB_shader_objects + version 1.2 + extension + glxropcode ? + glxflags ignore + alias UseProgram + +ValidateProgramARB(programObj) + return void + param programObj handleARB in value + category ARB_shader_objects + version 1.2 + extension + glxropcode ? + glxflags ignore + alias ValidateProgram + +Uniform1fARB(location, v0) + return void + param location Int32 in value + param v0 Float32 in value + category ARB_shader_objects + version 1.2 + extension + glxropcode ? + glxflags ignore + alias Uniform1f + +Uniform2fARB(location, v0, v1) + return void + param location Int32 in value + param v0 Float32 in value + param v1 Float32 in value + category ARB_shader_objects + version 1.2 + extension + glxropcode ? + glxflags ignore + alias Uniform2f + +Uniform3fARB(location, v0, v1, v2) + return void + param location Int32 in value + param v0 Float32 in value + param v1 Float32 in value + param v2 Float32 in value + category ARB_shader_objects + version 1.2 + extension + glxropcode ? + glxflags ignore + alias Uniform3f + +Uniform4fARB(location, v0, v1, v2, v3) + return void + param location Int32 in value + param v0 Float32 in value + param v1 Float32 in value + param v2 Float32 in value + param v3 Float32 in value + category ARB_shader_objects + version 1.2 + extension + glxropcode ? + glxflags ignore + alias Uniform4f + +Uniform1iARB(location, v0) + return void + param location Int32 in value + param v0 Int32 in value + category ARB_shader_objects + version 1.2 + extension + glxropcode ? + glxflags ignore + alias Uniform1i + +Uniform2iARB(location, v0, v1) + return void + param location Int32 in value + param v0 Int32 in value + param v1 Int32 in value + category ARB_shader_objects + version 1.2 + extension + glxropcode ? + glxflags ignore + alias Uniform2i + +Uniform3iARB(location, v0, v1, v2) + return void + param location Int32 in value + param v0 Int32 in value + param v1 Int32 in value + param v2 Int32 in value + category ARB_shader_objects + version 1.2 + extension + glxropcode ? + glxflags ignore + alias Uniform3i + +Uniform4iARB(location, v0, v1, v2, v3) + return void + param location Int32 in value + param v0 Int32 in value + param v1 Int32 in value + param v2 Int32 in value + param v3 Int32 in value + category ARB_shader_objects + version 1.2 + extension + glxropcode ? + glxflags ignore + alias Uniform4i + +Uniform1fvARB(location, count, value) + return void + param location Int32 in value + param count SizeI in value + param value Float32 in array [count] + category ARB_shader_objects + version 1.2 + extension + glxropcode ? + glxflags ignore + alias Uniform1fv + +Uniform2fvARB(location, count, value) + return void + param location Int32 in value + param count SizeI in value + param value Float32 in array [count] + category ARB_shader_objects + version 1.2 + extension + glxropcode ? + glxflags ignore + alias Uniform2fv + +Uniform3fvARB(location, count, value) + return void + param location Int32 in value + param count SizeI in value + param value Float32 in array [count] + category ARB_shader_objects + version 1.2 + extension + glxropcode ? + glxflags ignore + alias Uniform3fv + +Uniform4fvARB(location, count, value) + return void + param location Int32 in value + param count SizeI in value + param value Float32 in array [count] + category ARB_shader_objects + version 1.2 + extension + glxropcode ? + glxflags ignore + alias Uniform4fv + +Uniform1ivARB(location, count, value) + return void + param location Int32 in value + param count SizeI in value + param value Int32 in array [count] + category ARB_shader_objects + version 1.2 + extension + glxropcode ? + glxflags ignore + alias Uniform1iv + +Uniform2ivARB(location, count, value) + return void + param location Int32 in value + param count SizeI in value + param value Int32 in array [count] + category ARB_shader_objects + version 1.2 + extension + glxropcode ? + glxflags ignore + alias Uniform2iv + +Uniform3ivARB(location, count, value) + return void + param location Int32 in value + param count SizeI in value + param value Int32 in array [count] + category ARB_shader_objects + version 1.2 + extension + glxropcode ? + glxflags ignore + alias Uniform3iv + +Uniform4ivARB(location, count, value) + return void + param location Int32 in value + param count SizeI in value + param value Int32 in array [count] + category ARB_shader_objects + version 1.2 + extension + glxropcode ? + glxflags ignore + alias Uniform4iv + +UniformMatrix2fvARB(location, count, transpose, value) + return void + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float32 in array [count] + category ARB_shader_objects + version 1.2 + extension + glxropcode ? + glxflags ignore + alias UniformMatrix2fv + +UniformMatrix3fvARB(location, count, transpose, value) + return void + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float32 in array [count] + category ARB_shader_objects + version 1.2 + extension + glxropcode ? + glxflags ignore + alias UniformMatrix3fv + +UniformMatrix4fvARB(location, count, transpose, value) + return void + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float32 in array [count] + category ARB_shader_objects + version 1.2 + extension + glxropcode ? + glxflags ignore + alias UniformMatrix4fv + +GetObjectParameterfvARB(obj, pname, params) + return void + param obj handleARB in value + param pname GLenum in value + param params Float32 out array [pname] + category ARB_shader_objects + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +GetObjectParameterivARB(obj, pname, params) + return void + param obj handleARB in value + param pname GLenum in value + param params Int32 out array [pname] + category ARB_shader_objects + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +GetInfoLogARB(obj, maxLength, length, infoLog) + return void + param obj handleARB in value + param maxLength SizeI in value + param length SizeI out array [1] + param infoLog charARB out array [length] + category ARB_shader_objects + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +GetAttachedObjectsARB(containerObj, maxCount, count, obj) + return void + param containerObj handleARB in value + param maxCount SizeI in value + param count SizeI out array [1] + param obj handleARB out array [count] + category ARB_shader_objects + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + alias GetAttachedShaders + +GetUniformLocationARB(programObj, name) + return Int32 + param programObj handleARB in value + param name charARB in array [] + category ARB_shader_objects + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + alias GetUniformLocation + +GetActiveUniformARB(programObj, index, maxLength, length, size, type, name) + return void + param programObj handleARB in value + param index UInt32 in value + param maxLength SizeI in value + param length SizeI out array [1] + param size Int32 out array [1] + param type GLenum out array [1] + param name charARB out array [] + category ARB_shader_objects + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + alias GetActiveUniform + +GetUniformfvARB(programObj, location, params) + return void + param programObj handleARB in value + param location Int32 in value + param params Float32 out array [COMPSIZE(location)] + category ARB_shader_objects + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + alias GetUniformfv + +GetUniformivARB(programObj, location, params) + return void + param programObj handleARB in value + param location Int32 in value + param params Int32 out array [COMPSIZE(location)] + category ARB_shader_objects + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + alias GetUniformiv + +GetShaderSourceARB(obj, maxLength, length, source) + return void + param obj handleARB in value + param maxLength SizeI in value + param length SizeI out array [1] + param source charARB out array [length] + category ARB_shader_objects + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + alias GetShaderSource + + +############################################################################### +# +# ARB Extension #31 +# ARB_vertex_shader commands +# +############################################################################### + +BindAttribLocationARB(programObj, index, name) + return void + param programObj handleARB in value + param index UInt32 in value + param name charARB in array [] + category ARB_vertex_shader + version 1.2 + extension + glxropcode ? + glxflags ignore + alias BindAttribLocation + +GetActiveAttribARB(programObj, index, maxLength, length, size, type, name) + return void + param programObj handleARB in value + param index UInt32 in value + param maxLength SizeI in value + param length SizeI out array [1] + param size Int32 out array [1] + param type GLenum out array [1] + param name charARB out array [] + category ARB_vertex_shader + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + alias GetActiveAttrib + +GetAttribLocationARB(programObj, name) + return Int32 + param programObj handleARB in value + param name charARB in array [] + category ARB_vertex_shader + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + alias GetAttribLocation + +############################################################################### +# +# ARB Extension #32 +# ARB_fragment_shader commands +# +############################################################################### + +# (none) +newcategory: ARB_fragment_shader + +############################################################################### +# +# ARB Extension #33 +# ARB_shading_language_100 commands +# +############################################################################### + +# (none) +newcategory: ARB_shading_language_100 + +############################################################################### +# +# ARB Extension #34 +# ARB_texture_non_power_of_two commands +# +############################################################################### + +# (none) +newcategory: ARB_texture_non_power_of_two + +############################################################################### +# +# ARB Extension #35 +# ARB_point_sprite commands +# +############################################################################### + +# (none) +newcategory: ARB_point_sprite + +############################################################################### +# +# ARB Extension #36 +# ARB_fragment_program_shadow commands +# +############################################################################### + +# (none) +newcategory: ARB_fragment_program_shadow + +############################################################################### +# +# ARB Extension #37 +# ARB_draw_buffers commands +# +############################################################################### + +DrawBuffersARB(n, bufs) + return void + param n SizeI in value + param bufs DrawBufferModeATI in array [n] + category ARB_draw_buffers + version 1.5 + extension + alias DrawBuffers + +############################################################################### +# +# ARB Extension #38 +# ARB_texture_rectangle commands +# +############################################################################### + +# (none) +newcategory: ARB_texture_rectangle + +############################################################################### +# +# ARB Extension #39 +# ARB_color_buffer_float commands +# +############################################################################### + +ClampColorARB(target, clamp) + return void + param target ClampColorTargetARB in value + param clamp ClampColorModeARB in value + category ARB_color_buffer_float + version 1.5 + extension + glxropcode 234 + glxflags ignore + alias ClampColor + +############################################################################### +# +# ARB Extension #40 +# ARB_half_float_pixel commands +# +############################################################################### + +# (none) +newcategory: ARB_half_float_pixel + +############################################################################### +# +# ARB Extension #41 +# ARB_texture_float commands +# +############################################################################### + +# (none) +newcategory: ARB_texture_float + +############################################################################### +# +# ARB Extension #42 +# ARB_pixel_buffer_object commands +# +############################################################################### + +# (none) +newcategory: ARB_pixel_buffer_object + +############################################################################### +# +# ARB Extension #43 +# ARB_depth_buffer_float commands (also OpenGL 3.0) +# +############################################################################### + +# (none) +newcategory: ARB_depth_buffer_float + +############################################################################### +# +# ARB Extension #44 +# ARB_draw_instanced commands +# +############################################################################### + +DrawArraysInstancedARB(mode, first, count, primcount) + return void + param mode BeginMode in value + param first Int32 in value + param count SizeI in value + param primcount SizeI in value + category ARB_draw_instanced + version 2.0 + extension soft WINSOFT + dlflags notlistable + vectorequiv ArrayElement + glfflags ignore + glxflags ignore + alias DrawArraysInstanced + +DrawElementsInstancedARB(mode, count, type, indices, primcount) + return void + param mode BeginMode in value + param count SizeI in value + param type DrawElementsType in value + param indices Void in array [COMPSIZE(count/type)] + param primcount SizeI in value + category ARB_draw_instanced + version 2.0 + extension soft WINSOFT + dlflags notlistable + vectorequiv ArrayElement + glfflags ignore + glxflags ignore + alias DrawElementsInstanced + +############################################################################### +# +# ARB Extension #45 +# ARB_framebuffer_object commands (also OpenGL 3.0) +# +############################################################################### + +# Promoted from EXT_framebuffer_object +IsRenderbuffer(renderbuffer) + return Boolean + param renderbuffer UInt32 in value + category ARB_framebuffer_object + version 3.0 + extension + glxvendorpriv 1422 + glxflags ignore + offset ? + +# GLX opcode changed so it can be differentiated from BindRenderbufferEXT +# (see ARB_framebuffer_object extension spec revision 23) +BindRenderbuffer(target, renderbuffer) + return void + param target RenderbufferTarget in value + param renderbuffer UInt32 in value + category ARB_framebuffer_object + version 3.0 + extension + glxropcode 235 + glxflags ignore + offset ? + +DeleteRenderbuffers(n, renderbuffers) + return void + param n SizeI in value + param renderbuffers UInt32 in array [n] + category ARB_framebuffer_object + version 3.0 + extension + glxropcode 4317 + glxflags ignore + offset ? + +GenRenderbuffers(n, renderbuffers) + return void + param n SizeI in value + param renderbuffers UInt32 out array [n] + category ARB_framebuffer_object + version 3.0 + extension + glxvendorpriv 1423 + glxflags ignore + offset ? + +RenderbufferStorage(target, internalformat, width, height) + return void + param target RenderbufferTarget in value + param internalformat GLenum in value + param width SizeI in value + param height SizeI in value + category ARB_framebuffer_object + version 3.0 + extension + glxropcode 4318 + glxflags ignore + offset ? + +GetRenderbufferParameteriv(target, pname, params) + return void + param target RenderbufferTarget in value + param pname GLenum in value + param params Int32 out array [COMPSIZE(pname)] + category ARB_framebuffer_object + dlflags notlistable + version 3.0 + extension + glxvendorpriv 1424 + glxflags ignore + offset ? + +IsFramebuffer(framebuffer) + return Boolean + param framebuffer UInt32 in value + category ARB_framebuffer_object + version 3.0 + extension + glxvendorpriv 1425 + glxflags ignore + offset ? + +# GLX opcode changed so it can be differentiated from BindFramebufferEXT +# (see ARB_framebuffer_object extension spec revision 23) +BindFramebuffer(target, framebuffer) + return void + param target FramebufferTarget in value + param framebuffer UInt32 in value + category ARB_framebuffer_object + version 3.0 + extension + glxropcode 236 + glxflags ignore + offset ? + +DeleteFramebuffers(n, framebuffers) + return void + param n SizeI in value + param framebuffers UInt32 in array [n] + category ARB_framebuffer_object + version 3.0 + extension + glxropcode 4320 + glxflags ignore + offset ? + +GenFramebuffers(n, framebuffers) + return void + param n SizeI in value + param framebuffers UInt32 out array [n] + category ARB_framebuffer_object + version 3.0 + extension + glxvendorpriv 1426 + glxflags ignore + offset ? + +CheckFramebufferStatus(target) + return GLenum + param target FramebufferTarget in value + category ARB_framebuffer_object + version 3.0 + extension + glxvendorpriv 1427 + glxflags ignore + offset ? + +FramebufferTexture1D(target, attachment, textarget, texture, level) + return void + param target FramebufferTarget in value + param attachment FramebufferAttachment in value + param textarget GLenum in value + param texture UInt32 in value + param level Int32 in value + category ARB_framebuffer_object + version 3.0 + extension + glxropcode 4321 + glxflags ignore + offset ? + +FramebufferTexture2D(target, attachment, textarget, texture, level) + return void + param target FramebufferTarget in value + param attachment FramebufferAttachment in value + param textarget GLenum in value + param texture UInt32 in value + param level Int32 in value + category ARB_framebuffer_object + version 3.0 + extension + glxropcode 4322 + glxflags ignore + offset ? + +FramebufferTexture3D(target, attachment, textarget, texture, level, zoffset) + return void + param target FramebufferTarget in value + param attachment FramebufferAttachment in value + param textarget GLenum in value + param texture UInt32 in value + param level Int32 in value + param zoffset Int32 in value + category ARB_framebuffer_object + version 3.0 + extension + glxropcode 4323 + glxflags ignore + offset ? + +FramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer) + return void + param target FramebufferTarget in value + param attachment FramebufferAttachment in value + param renderbuffertarget RenderbufferTarget in value + param renderbuffer UInt32 in value + category ARB_framebuffer_object + version 3.0 + extension + glxropcode 4324 + glxflags ignore + offset ? + +GetFramebufferAttachmentParameteriv(target, attachment, pname, params) + return void + param target FramebufferTarget in value + param attachment FramebufferAttachment in value + param pname GLenum in value + param params Int32 out array [COMPSIZE(pname)] + category ARB_framebuffer_object + dlflags notlistable + version 3.0 + extension + glxvendorpriv 1428 + glxflags ignore + offset ? + +GenerateMipmap(target) + return void + param target GLenum in value + category ARB_framebuffer_object + version 3.0 + extension + glxropcode 4325 + glxflags ignore + offset ? + +# Promoted from EXT_framebuffer_blit +BlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter) + return void + param srcX0 Int32 in value + param srcY0 Int32 in value + param srcX1 Int32 in value + param srcY1 Int32 in value + param dstX0 Int32 in value + param dstY0 Int32 in value + param dstX1 Int32 in value + param dstY1 Int32 in value + param mask ClearBufferMask in value + param filter GLenum in value + category ARB_framebuffer_object + version 3.0 + glxropcode 4330 + offset ? + +# Promoted from EXT_framebuffer_multisample +RenderbufferStorageMultisample(target, samples, internalformat, width, height) + return void + param target GLenum in value + param samples SizeI in value + param internalformat GLenum in value + param width SizeI in value + param height SizeI in value + category ARB_framebuffer_object + version 3.0 + glxropcode 4331 + offset ? + +# Promoted from ARB_geometry_shader4 +FramebufferTextureLayer(target, attachment, texture, level, layer) + return void + param target FramebufferTarget in value + param attachment FramebufferAttachment in value + param texture Texture in value + param level CheckedInt32 in value + param layer CheckedInt32 in value + category ARB_framebuffer_object + version 3.0 + extension soft WINSOFT + dlflags notlistable + glfflags ignore + glxropcode 237 + offset ? + + +############################################################################### +# +# ARB Extension #46 +# ARB_framebuffer_sRGB commands (also OpenGL 3.0) +# +############################################################################### + +# (none) +newcategory: ARB_framebuffer_sRGB + +############################################################################### +# +# ARB Extension #47 +# ARB_geometry_shader4 commands +# +############################################################################### + +ProgramParameteriARB(program, pname, value) + return void + param program UInt32 in value + param pname ProgramParameterPName in value + param value Int32 in value + category ARB_geometry_shader4 + version 3.0 + extension soft WINSOFT + glfflags ignore + glxflags ignore + alias ProgramParameteri + +FramebufferTextureARB(target, attachment, texture, level) + return void + param target FramebufferTarget in value + param attachment FramebufferAttachment in value + param texture Texture in value + param level CheckedInt32 in value + category ARB_geometry_shader4 + version 3.0 + extension soft WINSOFT + dlflags notlistable + glfflags ignore + glxflags ignore + +FramebufferTextureLayerARB(target, attachment, texture, level, layer) + return void + param target FramebufferTarget in value + param attachment FramebufferAttachment in value + param texture Texture in value + param level CheckedInt32 in value + param layer CheckedInt32 in value + category ARB_geometry_shader4 + version 3.0 + extension soft WINSOFT + dlflags notlistable + glfflags ignore + glxflags ignore + alias FramebufferTextureLayer + +FramebufferTextureFaceARB(target, attachment, texture, level, face) + return void + param target FramebufferTarget in value + param attachment FramebufferAttachment in value + param texture Texture in value + param level CheckedInt32 in value + param face TextureTarget in value + category ARB_geometry_shader4 + version 3.0 + extension soft WINSOFT + dlflags notlistable + glfflags ignore + glxflags ignore + +############################################################################### +# +# ARB Extension #48 +# ARB_half_float_vertex commands (also OpenGL 3.0) +# +############################################################################### + +# (none) +newcategory: ARB_half_float_vertex + +############################################################################### +# +# ARB Extension #49 +# ARB_instanced_arrays commands +# +############################################################################### + +VertexAttribDivisorARB(index, divisor) + return void + param index UInt32 in value + param divisor UInt32 in value + category ARB_instanced_arrays + version 2.0 + extension + glfflags ignore + glxflags ignore + +############################################################################### +# +# ARB Extension #50 +# ARB_map_buffer_range commands (also OpenGL 3.0) +# +############################################################################### + +MapBufferRange(target, offset, length, access) + return VoidPointer + param target BufferTargetARB in value + param offset BufferOffset in value + param length BufferSize in value + param access BufferAccessMask in value + category ARB_map_buffer_range + version 3.0 + extension + glxropcode ? + glxflags ignore + offset ? + +# Promoted from APPLE_flush_buffer_range +FlushMappedBufferRange(target, offset, length) + return void + param target BufferTargetARB in value + param offset BufferOffset in value + param length BufferSize in value + category ARB_map_buffer_range + version 3.0 + extension + glxropcode ? + glxflags ignore + offset ? + +############################################################################### +# +# ARB Extension #51 +# ARB_texture_buffer_object commands +# +############################################################################### + +TexBufferARB(target, internalformat, buffer) + return void + param target TextureTarget in value + param internalformat GLenum in value + param buffer UInt32 in value + category ARB_texture_buffer_object + version 3.0 + extension soft WINSOFT NV50 + glfflags ignore + alias TexBuffer + +############################################################################### +# +# ARB Extension #52 +# ARB_texture_compression_rgtc commands (also OpenGL 3.0) +# +############################################################################### + +# (none) +newcategory: ARB_texture_compression_rgtc + +############################################################################### +# +# ARB Extension #53 +# ARB_texture_rg commands (also OpenGL 3.0) +# +############################################################################### + +# (none) +newcategory: ARB_texture_rg + +############################################################################### +# +# ARB Extension #54 +# ARB_vertex_array_object commands (also OpenGL 3.0) +# +############################################################################### + +# Promoted from APPLE_vertex_array_object +BindVertexArray(array) + return void + param array UInt32 in value + category ARB_vertex_array_object + version 3.0 + extension + glxropcode ? + glxflags ignore + offset ? + +DeleteVertexArrays(n, arrays) + return void + param n SizeI in value + param arrays UInt32 in array [n] + category ARB_vertex_array_object + version 3.0 + extension + glxropcode ? + glxflags ignore + offset ? + +GenVertexArrays(n, arrays) + return void + param n SizeI in value + param arrays UInt32 out array [n] + category ARB_vertex_array_object + version 3.0 + extension + glxropcode ? + glxflags ignore + offset ? + +IsVertexArray(array) + return Boolean + param array UInt32 in value + category ARB_vertex_array_object + version 3.0 + extension + glxropcode ? + glxflags ignore + offset ? + +############################################################################### +# +# ARB Extension #55 - WGL_ARB_create_context +# ARB Extension #56 - GLX_ARB_create_context +# +############################################################################### + +############################################################################### +# +# ARB Extension #57 +# ARB_uniform_buffer_object commands +# +############################################################################### + +GetUniformIndices(program, uniformCount, uniformNames, uniformIndices) + return void + param program UInt32 in value + param uniformCount SizeI in value + param uniformNames CharPointer in array [COMPSIZE(uniformCount)] + param uniformIndices UInt32 out array [COMPSIZE(uniformCount)] + category ARB_uniform_buffer_object + dlflags notlistable + version 2.0 + extension + glxsingle ? + glxflags ignore + offset ? + +GetActiveUniformsiv(program, uniformCount, uniformIndices, pname, params) + return void + param program UInt32 in value + param uniformCount SizeI in value + param uniformIndices UInt32 in array [COMPSIZE(uniformCount)] + param pname GLenum in value + param params Int32 out array [COMPSIZE(pname)] + category ARB_uniform_buffer_object + dlflags notlistable + version 2.0 + extension + glxsingle ? + glxflags ignore + offset ? + +GetActiveUniformName(program, uniformIndex, bufSize, length, uniformName) + return void + param program UInt32 in value + param uniformIndex UInt32 in value + param bufSize SizeI in value + param length SizeI out array [1] + param uniformName Char out array [bufSize] + category ARB_uniform_buffer_object + dlflags notlistable + version 2.0 + extension + glxsingle ? + glxflags ignore + offset ? + +GetUniformBlockIndex(program, uniformBlockName) + return UInt32 + param program UInt32 in value + param uniformBlockName Char in array [COMPSIZE()] + category ARB_uniform_buffer_object + dlflags notlistable + version 2.0 + extension + glxsingle ? + glxflags ignore + offset ? + +GetActiveUniformBlockiv(program, uniformBlockIndex, pname, params) + return void + param program UInt32 in value + param uniformBlockIndex UInt32 in value + param pname GLenum in value + param params Int32 out array [COMPSIZE(pname)] + category ARB_uniform_buffer_object + dlflags notlistable + version 2.0 + extension + glxsingle ? + glxflags ignore + offset ? + +GetActiveUniformBlockName(program, uniformBlockIndex, bufSize, length, uniformBlockName) + return void + param program UInt32 in value + param uniformBlockIndex UInt32 in value + param bufSize SizeI in value + param length SizeI out array [1] + param uniformBlockName Char out array [bufSize] + category ARB_uniform_buffer_object + dlflags notlistable + version 2.0 + extension + glxsingle ? + glxflags ignore + offset ? + +UniformBlockBinding(program, uniformBlockIndex, uniformBlockBinding) + return void + param program UInt32 in value + param uniformBlockIndex UInt32 in value + param uniformBlockBinding UInt32 in value + category ARB_uniform_buffer_object + version 2.0 + extension + glxropcode ? + glxflags ignore + offset ? + + +############################################################################### +# +# ARB Extension #58 +# ARB_compatibility commands +# +############################################################################### + +# (none) +newcategory: ARB_compatibility + +############################################################################### +# +# ARB Extension #59 +# ARB_copy_buffer commands +# +############################################################################### + +CopyBufferSubData(readTarget, writeTarget, readOffset, writeOffset, size) + return void + param readTarget GLenum in value + param writeTarget GLenum in value + param readOffset BufferOffset in value + param writeOffset BufferOffset in value + param size BufferSize in value + category ARB_copy_buffer + version 3.0 + extension + glxropcode ? + glxflags ignore + offset ? + +############################################################################### +# +# ARB Extension #60 +# ARB_shader_texture_lod commands +# +############################################################################### + +# (none) +newcategory: ARB_shader_texture_lod + +############################################################################### +# +# ARB Extension #61 +# ARB_depth_clamp commands +# +############################################################################### + +# (none) +newcategory: ARB_depth_clamp + +############################################################################### +# +# ARB Extension #62 +# ARB_draw_elements_base_vertex commands +# +############################################################################### + +DrawElementsBaseVertex(mode, count, type, indices, basevertex) + return void + param mode GLenum in value + param count SizeI in value + param type DrawElementsType in value + param indices Void in array [COMPSIZE(count/type)] + param basevertex Int32 in value + category ARB_draw_elements_base_vertex + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +DrawRangeElementsBaseVertex(mode, start, end, count, type, indices, basevertex) + return void + param mode GLenum in value + param start UInt32 in value + param end UInt32 in value + param count SizeI in value + param type DrawElementsType in value + param indices Void in array [COMPSIZE(count/type)] + param basevertex Int32 in value + category ARB_draw_elements_base_vertex + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +DrawElementsInstancedBaseVertex(mode, count, type, indices, primcount, basevertex) + return void + param mode GLenum in value + param count SizeI in value + param type DrawElementsType in value + param indices Void in array [COMPSIZE(count/type)] + param primcount SizeI in value + param basevertex Int32 in value + category ARB_draw_elements_base_vertex + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +MultiDrawElementsBaseVertex(mode, count, type, indices, primcount, basevertex) + return void + param mode GLenum in value + param count SizeI in array [COMPSIZE(primcount)] + param type DrawElementsType in value + param indices VoidPointer in array [COMPSIZE(primcount)] + param primcount SizeI in value + param basevertex Int32 in array [COMPSIZE(primcount)] + category ARB_draw_elements_base_vertex + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +############################################################################### +# +# ARB Extension #63 +# ARB_fragment_coord_conventions commands +# +############################################################################### + +# (none) +newcategory: ARB_fragment_coord_conventions + +############################################################################### +# +# ARB Extension #64 +# ARB_provoking_vertex commands +# +############################################################################### + +ProvokingVertex(mode) + return void + param mode GLenum in value + category ARB_provoking_vertex + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +############################################################################### +# +# ARB Extension #65 +# ARB_seamless_cube_map commands +# +############################################################################### + +# (none) +newcategory: ARB_seamless_cube_map + +############################################################################### +# +# ARB Extension #66 +# ARB_sync commands +# +############################################################################### + +FenceSync(condition, flags) + return sync + param condition GLenum in value + param flags GLbitfield in value + category ARB_sync + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +IsSync(sync) + return Boolean + param sync sync in value + category ARB_sync + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +DeleteSync(sync) + return void + param sync sync in value + category ARB_sync + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +ClientWaitSync(sync, flags, timeout) + return GLenum + param sync sync in value + param flags GLbitfield in value + param timeout UInt64 in value + category ARB_sync + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +WaitSync(sync, flags, timeout) + return void + param sync sync in value + param flags GLbitfield in value + param timeout UInt64 in value + category ARB_sync + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +GetInteger64v(pname, params) + return void + param pname GLenum in value + param params Int64 out array [COMPSIZE(pname)] + category ARB_sync + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +GetSynciv(sync, pname, bufSize, length, values) + return void + param sync sync in value + param pname GLenum in value + param bufSize SizeI in value + param length SizeI out array [1] + param values Int32 out array [length] + category ARB_sync + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +############################################################################### +# +# ARB Extension #67 +# ARB_texture_multisample commands +# +############################################################################### + +TexImage2DMultisample(target, samples, internalformat, width, height, fixedsamplelocations) + return void + param target GLenum in value + param samples SizeI in value + param internalformat Int32 in value + param width SizeI in value + param height SizeI in value + param fixedsamplelocations Boolean in value + category ARB_texture_multisample + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +TexImage3DMultisample(target, samples, internalformat, width, height, depth, fixedsamplelocations) + return void + param target GLenum in value + param samples SizeI in value + param internalformat Int32 in value + param width SizeI in value + param height SizeI in value + param depth SizeI in value + param fixedsamplelocations Boolean in value + category ARB_texture_multisample + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +GetMultisamplefv(pname, index, val) + return void + param pname GLenum in value + param index UInt32 in value + param val Float32 out array [COMPSIZE(pname)] + category ARB_texture_multisample + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +SampleMaski(index, mask) + return void + param index UInt32 in value + param mask GLbitfield in value + category ARB_texture_multisample + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +############################################################################### +# +# ARB Extension #68 +# ARB_vertex_array_bgra commands +# +############################################################################### + +# (none) +newcategory: ARB_vertex_array_bgra + +############################################################################### +# +# ARB Extension #69 +# ARB_draw_buffers_blend commands +# +############################################################################### + +BlendEquationiARB(buf, mode) + return void + param buf UInt32 in value + param mode GLenum in value + category ARB_draw_buffers_blend + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + alias BlendEquationi + +BlendEquationSeparateiARB(buf, modeRGB, modeAlpha) + return void + param buf UInt32 in value + param modeRGB GLenum in value + param modeAlpha GLenum in value + category ARB_draw_buffers_blend + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + alias BlendEquationSeparatei + +BlendFunciARB(buf, src, dst) + return void + param buf UInt32 in value + param src GLenum in value + param dst GLenum in value + category ARB_draw_buffers_blend + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + alias BlendFunci + +BlendFuncSeparateiARB(buf, srcRGB, dstRGB, srcAlpha, dstAlpha) + return void + param buf UInt32 in value + param srcRGB GLenum in value + param dstRGB GLenum in value + param srcAlpha GLenum in value + param dstAlpha GLenum in value + category ARB_draw_buffers_blend + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + alias BlendFuncSeparatei + +############################################################################### +# +# ARB Extension #70 +# ARB_sample_shading commands +# +############################################################################### + +MinSampleShadingARB(value) + return void + param value ClampedColorF in value + category ARB_sample_shading + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + alias MinSampleShading + +############################################################################### +# +# ARB Extension #71 +# ARB_texture_cube_map_array commands +# +############################################################################### + +# (none) +newcategory: ARB_texture_cube_map_array + +############################################################################### +# +# ARB Extension #72 +# ARB_texture_gather commands +# +############################################################################### + +# (none) +newcategory: ARB_texture_gather + +############################################################################### +# +# ARB Extension #73 +# ARB_texture_query_lod commands +# +############################################################################### + +# (none) +newcategory: ARB_texture_query_lod + +############################################################################### +# +# ARB Extension #74 - WGL_ARB_create_context_profile +# ARB Extension #75 - GLX_ARB_create_context_profile +# +############################################################################### + +############################################################################### +# +# ARB Extension #76 +# ARB_shading_language_include commands +# +############################################################################### + +NamedStringARB(type, namelen, name, stringlen, string) + return void + param type GLenum in value + param namelen Int32 in value + param name Char in array [namelen] + param stringlen Int32 in value + param string Char in array [stringlen] + category ARB_shading_language_include + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +DeleteNamedStringARB(namelen, name) + return void + param namelen Int32 in value + param name Char in array [namelen] + category ARB_shading_language_include + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +CompileShaderIncludeARB(shader, count, path, length) + return void + param shader UInt32 in value + param count SizeI in value + param path CharPointer in array [count] + param length Int32 in array [count] + category ARB_shading_language_include + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +IsNamedStringARB(namelen, name) + return Boolean + param namelen Int32 in value + param name Char in array [namelen] + category ARB_shading_language_include + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +GetNamedStringARB(namelen, name, bufSize, stringlen, string) + return void + param namelen Int32 in value + param name Char in array [namelen] + param bufSize SizeI in value + param stringlen Int32 out array [1] + param string Char out array [bufSize] + category ARB_shading_language_include + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +GetNamedStringivARB(namelen, name, pname, params) + return void + param namelen Int32 in value + param name Char in array [namelen] + param pname GLenum in value + param params Int32 out array [COMPSIZE(pname)] + category ARB_shading_language_include + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +############################################################################### +# +# ARB Extension #77 +# ARB_texture_compression_bptc commands +# +############################################################################### + +# (none) +newcategory: ARB_texture_compression_bptc + +############################################################################### +# +# ARB Extension #78 +# ARB_blend_func_extended commands +# +############################################################################### + +BindFragDataLocationIndexed(program, colorNumber, index, name) + return void + param program UInt32 in value + param colorNumber UInt32 in value + param index UInt32 in value + param name Char in array [] + category ARB_blend_func_extended + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +GetFragDataIndex(program, name) + return Int32 + param program UInt32 in value + param name Char in array [] + category ARB_blend_func_extended + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +############################################################################### +# +# ARB Extension #79 +# ARB_explicit_attrib_location commands +# +############################################################################### + +# (none) +newcategory: ARB_explicit_attrib_location + +############################################################################### +# +# ARB Extension #80 +# ARB_occlusion_query2 commands +# +############################################################################### + +# (none) +newcategory: ARB_occlusion_query2 + +############################################################################### +# +# ARB Extension #81 +# ARB_sampler_objects commands +# +############################################################################### + +GenSamplers(count, samplers) + return void + param count SizeI in value + param samplers UInt32 out array [count] + category ARB_sampler_objects + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +DeleteSamplers(count, samplers) + return void + param count SizeI in value + param samplers UInt32 in array [count] + category ARB_sampler_objects + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +IsSampler(sampler) + return Boolean + param sampler UInt32 in value + category ARB_sampler_objects + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +BindSampler(unit, sampler) + return void + param unit UInt32 in value + param sampler UInt32 in value + category ARB_sampler_objects + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +SamplerParameteri(sampler, pname, param) + return void + param sampler UInt32 in value + param pname GLenum in value + param param Int32 in value + category ARB_sampler_objects + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +SamplerParameteriv(sampler, pname, param) + return void + param sampler UInt32 in value + param pname GLenum in value + param param Int32 in array [COMPSIZE(pname)] + category ARB_sampler_objects + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +SamplerParameterf(sampler, pname, param) + return void + param sampler UInt32 in value + param pname GLenum in value + param param Float32 in value + category ARB_sampler_objects + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +SamplerParameterfv(sampler, pname, param) + return void + param sampler UInt32 in value + param pname GLenum in value + param param Float32 in array [COMPSIZE(pname)] + category ARB_sampler_objects + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +SamplerParameterIiv(sampler, pname, param) + return void + param sampler UInt32 in value + param pname GLenum in value + param param Int32 in array [COMPSIZE(pname)] + category ARB_sampler_objects + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +SamplerParameterIuiv(sampler, pname, param) + return void + param sampler UInt32 in value + param pname GLenum in value + param param UInt32 in array [COMPSIZE(pname)] + category ARB_sampler_objects + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +GetSamplerParameteriv(sampler, pname, params) + return void + param sampler UInt32 in value + param pname GLenum in value + param params Int32 out array [COMPSIZE(pname)] + category ARB_sampler_objects + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +GetSamplerParameterIiv(sampler, pname, params) + return void + param sampler UInt32 in value + param pname GLenum in value + param params Int32 out array [COMPSIZE(pname)] + category ARB_sampler_objects + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +GetSamplerParameterfv(sampler, pname, params) + return void + param sampler UInt32 in value + param pname GLenum in value + param params Float32 out array [COMPSIZE(pname)] + category ARB_sampler_objects + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +GetSamplerParameterIuiv(sampler, pname, params) + return void + param sampler UInt32 in value + param pname GLenum in value + param params UInt32 out array [COMPSIZE(pname)] + category ARB_sampler_objects + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +############################################################################### +# +# ARB Extension #82 +# ARB_shader_bit_encoding commands +# +############################################################################### + +# (none) +newcategroy: ARB_shader_bit_encoding + +############################################################################### +# +# ARB Extension #83 +# ARB_texture_rgb10_a2ui commands +# +############################################################################### + +# (none) +newcategory: ARB_texture_rgb10_a2ui + +############################################################################### +# +# ARB Extension #84 +# ARB_texture_swizzle commands +# +############################################################################### + +# (none) +newcategory: ARB_texture_swizzle + +############################################################################### +# +# ARB Extension #85 +# ARB_timer_query commands +# +############################################################################### + +QueryCounter(id, target) + return void + param id UInt32 in value + param target GLenum in value + category ARB_timer_query + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +GetQueryObjecti64v(id, pname, params) + return void + param id UInt32 in value + param pname GLenum in value + param params Int64 out array [COMPSIZE(pname)] + category ARB_timer_query + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +GetQueryObjectui64v(id, pname, params) + return void + param id UInt32 in value + param pname GLenum in value + param params UInt64 out array [COMPSIZE(pname)] + category ARB_timer_query + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +############################################################################### +# +# ARB Extension #86 +# ARB_vertex_type_2_10_10_10_rev commands +# +############################################################################### + +VertexP2ui(type, value) + return void + param type GLenum in value + param value UInt32 in value + category ARB_vertex_type_2_10_10_10_rev + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexP2uiv(type, value) + return void + param type GLenum in value + param value UInt32 in array [1] + category ARB_vertex_type_2_10_10_10_rev + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexP3ui(type, value) + return void + param type GLenum in value + param value UInt32 in value + category ARB_vertex_type_2_10_10_10_rev + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexP3uiv(type, value) + return void + param type GLenum in value + param value UInt32 in array [1] + category ARB_vertex_type_2_10_10_10_rev + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexP4ui(type, value) + return void + param type GLenum in value + param value UInt32 in value + category ARB_vertex_type_2_10_10_10_rev + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexP4uiv(type, value) + return void + param type GLenum in value + param value UInt32 in array [1] + category ARB_vertex_type_2_10_10_10_rev + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +TexCoordP1ui(type, coords) + return void + param type GLenum in value + param coords UInt32 in value + category ARB_vertex_type_2_10_10_10_rev + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +TexCoordP1uiv(type, coords) + return void + param type GLenum in value + param coords UInt32 in array [1] + category ARB_vertex_type_2_10_10_10_rev + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +TexCoordP2ui(type, coords) + return void + param type GLenum in value + param coords UInt32 in value + category ARB_vertex_type_2_10_10_10_rev + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +TexCoordP2uiv(type, coords) + return void + param type GLenum in value + param coords UInt32 in array [1] + category ARB_vertex_type_2_10_10_10_rev + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +TexCoordP3ui(type, coords) + return void + param type GLenum in value + param coords UInt32 in value + category ARB_vertex_type_2_10_10_10_rev + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +TexCoordP3uiv(type, coords) + return void + param type GLenum in value + param coords UInt32 in array [1] + category ARB_vertex_type_2_10_10_10_rev + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +TexCoordP4ui(type, coords) + return void + param type GLenum in value + param coords UInt32 in value + category ARB_vertex_type_2_10_10_10_rev + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +TexCoordP4uiv(type, coords) + return void + param type GLenum in value + param coords UInt32 in array [1] + category ARB_vertex_type_2_10_10_10_rev + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +MultiTexCoordP1ui(texture, type, coords) + return void + param texture GLenum in value + param type GLenum in value + param coords UInt32 in value + category ARB_vertex_type_2_10_10_10_rev + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +MultiTexCoordP1uiv(texture, type, coords) + return void + param texture GLenum in value + param type GLenum in value + param coords UInt32 in array [1] + category ARB_vertex_type_2_10_10_10_rev + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +MultiTexCoordP2ui(texture, type, coords) + return void + param texture GLenum in value + param type GLenum in value + param coords UInt32 in value + category ARB_vertex_type_2_10_10_10_rev + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +MultiTexCoordP2uiv(texture, type, coords) + return void + param texture GLenum in value + param type GLenum in value + param coords UInt32 in array [1] + category ARB_vertex_type_2_10_10_10_rev + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +MultiTexCoordP3ui(texture, type, coords) + return void + param texture GLenum in value + param type GLenum in value + param coords UInt32 in value + category ARB_vertex_type_2_10_10_10_rev + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +MultiTexCoordP3uiv(texture, type, coords) + return void + param texture GLenum in value + param type GLenum in value + param coords UInt32 in array [1] + category ARB_vertex_type_2_10_10_10_rev + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +MultiTexCoordP4ui(texture, type, coords) + return void + param texture GLenum in value + param type GLenum in value + param coords UInt32 in value + category ARB_vertex_type_2_10_10_10_rev + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +MultiTexCoordP4uiv(texture, type, coords) + return void + param texture GLenum in value + param type GLenum in value + param coords UInt32 in array [1] + category ARB_vertex_type_2_10_10_10_rev + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +NormalP3ui(type, coords) + return void + param type GLenum in value + param coords UInt32 in value + category ARB_vertex_type_2_10_10_10_rev + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +NormalP3uiv(type, coords) + return void + param type GLenum in value + param coords UInt32 in array [1] + category ARB_vertex_type_2_10_10_10_rev + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +ColorP3ui(type, color) + return void + param type GLenum in value + param color UInt32 in value + category ARB_vertex_type_2_10_10_10_rev + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +ColorP3uiv(type, color) + return void + param type GLenum in value + param color UInt32 in array [1] + category ARB_vertex_type_2_10_10_10_rev + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +ColorP4ui(type, color) + return void + param type GLenum in value + param color UInt32 in value + category ARB_vertex_type_2_10_10_10_rev + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +ColorP4uiv(type, color) + return void + param type GLenum in value + param color UInt32 in array [1] + category ARB_vertex_type_2_10_10_10_rev + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +SecondaryColorP3ui(type, color) + return void + param type GLenum in value + param color UInt32 in value + category ARB_vertex_type_2_10_10_10_rev + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +SecondaryColorP3uiv(type, color) + return void + param type GLenum in value + param color UInt32 in array [1] + category ARB_vertex_type_2_10_10_10_rev + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexAttribP1ui(index, type, normalized, value) + return void + param index UInt32 in value + param type GLenum in value + param normalized Boolean in value + param value UInt32 in value + category ARB_vertex_type_2_10_10_10_rev + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexAttribP1uiv(index, type, normalized, value) + return void + param index UInt32 in value + param type GLenum in value + param normalized Boolean in value + param value UInt32 in array [1] + category ARB_vertex_type_2_10_10_10_rev + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexAttribP2ui(index, type, normalized, value) + return void + param index UInt32 in value + param type GLenum in value + param normalized Boolean in value + param value UInt32 in value + category ARB_vertex_type_2_10_10_10_rev + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexAttribP2uiv(index, type, normalized, value) + return void + param index UInt32 in value + param type GLenum in value + param normalized Boolean in value + param value UInt32 in array [1] + category ARB_vertex_type_2_10_10_10_rev + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexAttribP3ui(index, type, normalized, value) + return void + param index UInt32 in value + param type GLenum in value + param normalized Boolean in value + param value UInt32 in value + category ARB_vertex_type_2_10_10_10_rev + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexAttribP3uiv(index, type, normalized, value) + return void + param index UInt32 in value + param type GLenum in value + param normalized Boolean in value + param value UInt32 in array [1] + category ARB_vertex_type_2_10_10_10_rev + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexAttribP4ui(index, type, normalized, value) + return void + param index UInt32 in value + param type GLenum in value + param normalized Boolean in value + param value UInt32 in value + category ARB_vertex_type_2_10_10_10_rev + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexAttribP4uiv(index, type, normalized, value) + return void + param index UInt32 in value + param type GLenum in value + param normalized Boolean in value + param value UInt32 in array [1] + category ARB_vertex_type_2_10_10_10_rev + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +############################################################################### +# +# ARB Extension #87 +# ARB_draw_indirect commands +# +############################################################################### + +DrawArraysIndirect(mode, indirect) + return void + param mode GLenum in value + param indirect Void in array [] + category ARB_draw_indirect + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +DrawElementsIndirect(mode, type, indirect) + return void + param mode GLenum in value + param type GLenum in value + param indirect Void in array [] + category ARB_draw_indirect + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +############################################################################### +# +# ARB Extension #88 +# ARB_gpu_shader5 commands +# +############################################################################### + +# (none) +newcategory: ARB_gpu_shader5 + +############################################################################### +# +# ARB Extension #89 +# ARB_gpu_shader_fp64 commands +# +############################################################################### + +Uniform1d(location, x) + return void + param location Int32 in value + param x Float64 in value + category ARB_gpu_shader_fp64 + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +Uniform2d(location, x, y) + return void + param location Int32 in value + param x Float64 in value + param y Float64 in value + category ARB_gpu_shader_fp64 + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +Uniform3d(location, x, y, z) + return void + param location Int32 in value + param x Float64 in value + param y Float64 in value + param z Float64 in value + category ARB_gpu_shader_fp64 + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +Uniform4d(location, x, y, z, w) + return void + param location Int32 in value + param x Float64 in value + param y Float64 in value + param z Float64 in value + param w Float64 in value + category ARB_gpu_shader_fp64 + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +Uniform1dv(location, count, value) + return void + param location Int32 in value + param count SizeI in value + param value Float64 in array [count] + category ARB_gpu_shader_fp64 + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +Uniform2dv(location, count, value) + return void + param location Int32 in value + param count SizeI in value + param value Float64 in array [count] + category ARB_gpu_shader_fp64 + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +Uniform3dv(location, count, value) + return void + param location Int32 in value + param count SizeI in value + param value Float64 in array [count] + category ARB_gpu_shader_fp64 + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +Uniform4dv(location, count, value) + return void + param location Int32 in value + param count SizeI in value + param value Float64 in array [count] + category ARB_gpu_shader_fp64 + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +UniformMatrix2dv(location, count, transpose, value) + return void + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float64 in array [count] + category ARB_gpu_shader_fp64 + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +UniformMatrix3dv(location, count, transpose, value) + return void + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float64 in array [count] + category ARB_gpu_shader_fp64 + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +UniformMatrix4dv(location, count, transpose, value) + return void + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float64 in array [count] + category ARB_gpu_shader_fp64 + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +UniformMatrix2x3dv(location, count, transpose, value) + return void + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float64 in array [count] + category ARB_gpu_shader_fp64 + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +UniformMatrix2x4dv(location, count, transpose, value) + return void + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float64 in array [count] + category ARB_gpu_shader_fp64 + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +UniformMatrix3x2dv(location, count, transpose, value) + return void + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float64 in array [count] + category ARB_gpu_shader_fp64 + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +UniformMatrix3x4dv(location, count, transpose, value) + return void + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float64 in array [count] + category ARB_gpu_shader_fp64 + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +UniformMatrix4x2dv(location, count, transpose, value) + return void + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float64 in array [count] + category ARB_gpu_shader_fp64 + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +UniformMatrix4x3dv(location, count, transpose, value) + return void + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float64 in array [count] + category ARB_gpu_shader_fp64 + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +GetUniformdv(program, location, params) + return void + param program UInt32 in value + param location Int32 in value + param params Float64 out array [COMPSIZE(location)] + category ARB_gpu_shader_fp64 + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +############################################################################### +# +# ARB Extension #90 +# ARB_shader_subroutine commands +# +############################################################################### + +GetSubroutineUniformLocation(program, shadertype, name) + return Int32 + param program UInt32 in value + param shadertype GLenum in value + param name Char in array [] + category ARB_shader_subroutine + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +GetSubroutineIndex(program, shadertype, name) + return UInt32 + param program UInt32 in value + param shadertype GLenum in value + param name Char in array [] + category ARB_shader_subroutine + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +GetActiveSubroutineUniformiv(program, shadertype, index, pname, values) + return void + param program UInt32 in value + param shadertype GLenum in value + param index UInt32 in value + param pname GLenum in value + param values Int32 out array [COMPSIZE(pname)] + category ARB_shader_subroutine + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +GetActiveSubroutineUniformName(program, shadertype, index, bufsize, length, name) + return void + param program UInt32 in value + param shadertype GLenum in value + param index UInt32 in value + param bufsize SizeI in value + param length SizeI out array [1] + param name Char out array [bufsize] + category ARB_shader_subroutine + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +GetActiveSubroutineName(program, shadertype, index, bufsize, length, name) + return void + param program UInt32 in value + param shadertype GLenum in value + param index UInt32 in value + param bufsize SizeI in value + param length SizeI out array [1] + param name Char out array [bufsize] + category ARB_shader_subroutine + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +UniformSubroutinesuiv(shadertype, count, indices) + return void + param shadertype GLenum in value + param count SizeI in value + param indices UInt32 in array [count] + category ARB_shader_subroutine + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +GetUniformSubroutineuiv(shadertype, location, params) + return void + param shadertype GLenum in value + param location Int32 in value + param params UInt32 out array [1] + category ARB_shader_subroutine + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +GetProgramStageiv(program, shadertype, pname, values) + return void + param program UInt32 in value + param shadertype GLenum in value + param pname GLenum in value + param values Int32 out array [1] + category ARB_shader_subroutine + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +############################################################################### +# +# ARB Extension #91 +# ARB_tessellation_shader commands +# +############################################################################### + +PatchParameteri(pname, value) + return void + param pname GLenum in value + param value Int32 in value + category ARB_tessellation_shader + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +PatchParameterfv(pname, values) + return void + param pname GLenum in value + param values Float32 in array [COMPSIZE(pname)] + category ARB_tessellation_shader + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +############################################################################### +# +# ARB Extension #92 +# ARB_texture_buffer_object_rgb32 commands +# +############################################################################### + +# (none) +newcategory: ARB_texture_buffer_object_rgb32 + +############################################################################### +# +# ARB Extension #93 +# ARB_transform_feedback2 commands +# +############################################################################### + +BindTransformFeedback(target, id) + return void + param target GLenum in value + param id UInt32 in value + category ARB_transform_feedback2 + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +DeleteTransformFeedbacks(n, ids) + return void + param n SizeI in value + param ids UInt32 in array [n] + category ARB_transform_feedback2 + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +GenTransformFeedbacks(n, ids) + return void + param n SizeI in value + param ids UInt32 out array [n] + category ARB_transform_feedback2 + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +IsTransformFeedback(id) + return Boolean + param id UInt32 in value + category ARB_transform_feedback2 + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +PauseTransformFeedback() + return void + category ARB_transform_feedback2 + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +ResumeTransformFeedback() + return void + category ARB_transform_feedback2 + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +DrawTransformFeedback(mode, id) + return void + param mode GLenum in value + param id UInt32 in value + category ARB_transform_feedback2 + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +############################################################################### +# +# ARB Extension #94 +# ARB_transform_feedback3 commands +# +############################################################################### + +DrawTransformFeedbackStream(mode, id, stream) + return void + param mode GLenum in value + param id UInt32 in value + param stream UInt32 in value + category ARB_transform_feedback3 + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +BeginQueryIndexed(target, index, id) + return void + param target GLenum in value + param index UInt32 in value + param id UInt32 in value + category ARB_transform_feedback3 + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +EndQueryIndexed(target, index) + return void + param target GLenum in value + param index UInt32 in value + category ARB_transform_feedback3 + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +GetQueryIndexediv(target, index, pname, params) + return void + param target GLenum in value + param index UInt32 in value + param pname GLenum in value + param params Int32 out array [COMPSIZE(pname)] + category ARB_transform_feedback3 + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +############################################################################### +# +# ARB Extension #95 +# ARB_ES2_compatibility commands +# +############################################################################### + +ReleaseShaderCompiler() + return void + category ARB_ES2_compatibility + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ShaderBinary(count, shaders, binaryformat, binary, length) + return void + param count SizeI in value + param shaders UInt32 in array [count] + param binaryformat GLenum in value + param binary Void in array [length] + param length SizeI in value + category ARB_ES2_compatibility + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +GetShaderPrecisionFormat(shadertype, precisiontype, range, precision) + return void + param shadertype GLenum in value + param precisiontype GLenum in value + param range Int32 out array [2] + param precision Int32 out array [2] + category ARB_ES2_compatibility + dlflags notlistable + version 4.1 + extension + glxsingle ? + glxflags ignore + offset ? + +DepthRangef(n, f) + return void + param n ClampedFloat32 in value + param f ClampedFloat32 in value + category ARB_ES2_compatibility + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ClearDepthf(d) + return void + param d ClampedFloat32 in value + category ARB_ES2_compatibility + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +############################################################################### +# +# ARB Extension #96 +# ARB_get_program_binary commands +# +############################################################################### + +GetProgramBinary(program, bufSize, length, binaryFormat, binary) + return void + param program UInt32 in value + param bufSize SizeI in value + param length SizeI out array [1] + param binaryFormat GLenum out array [1] + param binary Void out array [COMPSIZE(length)] + category ARB_get_program_binary + dlflags notlistable + version 4.1 + extension + glxsingle ? + glxflags ignore + offset ? + +ProgramBinary(program, binaryFormat, binary, length) + return void + param program UInt32 in value + param binaryFormat GLenum in value + param binary Void in array [length] + param length SizeI in value + category ARB_get_program_binary + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramParameteri(program, pname, value) + return void + param program UInt32 in value + param pname ProgramParameterPName in value + param value Int32 in value + category ARB_get_program_binary + version 3.0 + extension soft WINSOFT + glfflags ignore + glxflags ignore + +############################################################################### +# +# ARB Extension #97 +# ARB_separate_shader_objects commands +# +############################################################################### + +UseProgramStages(pipeline, stages, program) + return void + param pipeline UInt32 in value + param stages GLbitfield in value + param program UInt32 in value + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ActiveShaderProgram(pipeline, program) + return void + param pipeline UInt32 in value + param program UInt32 in value + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +CreateShaderProgramv(type, count, strings) + return UInt32 + param type GLenum in value + param count SizeI in value + param strings CharPointer in array [count] + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +BindProgramPipeline(pipeline) + return void + param pipeline UInt32 in value + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +DeleteProgramPipelines(n, pipelines) + return void + param n SizeI in value + param pipelines UInt32 in array [n] + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +GenProgramPipelines(n, pipelines) + return void + param n SizeI in value + param pipelines UInt32 out array [n] + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +IsProgramPipeline(pipeline) + return Boolean + param pipeline UInt32 in value + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +#@ ProgramParameteri also in ARB_get_program_binary + +GetProgramPipelineiv(pipeline, pname, params) + return void + param pipeline UInt32 in value + param pname GLenum in value + param params Int32 out array [COMPSIZE(pname)] + category ARB_separate_shader_objects + dlflags notlistable + version 4.1 + extension + glxsingle ? + glxflags ignore + offset ? + +ProgramUniform1i(program, location, v0) + return void + param program UInt32 in value + param location Int32 in value + param v0 Int32 in value + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniform1iv(program, location, count, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param value Int32 in array [1] + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniform1f(program, location, v0) + return void + param program UInt32 in value + param location Int32 in value + param v0 Float32 in value + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniform1fv(program, location, count, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param value Float32 in array [1] + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniform1d(program, location, v0) + return void + param program UInt32 in value + param location Int32 in value + param v0 Float64 in value + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniform1dv(program, location, count, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param value Float64 in array [1] + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniform1ui(program, location, v0) + return void + param program UInt32 in value + param location Int32 in value + param v0 UInt32 in value + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniform1uiv(program, location, count, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param value UInt32 in array [1] + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniform2i(program, location, v0, v1) + return void + param program UInt32 in value + param location Int32 in value + param v0 Int32 in value + param v1 Int32 in value + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniform2iv(program, location, count, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param value Int32 in array [2] + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniform2f(program, location, v0, v1) + return void + param program UInt32 in value + param location Int32 in value + param v0 Float32 in value + param v1 Float32 in value + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniform2fv(program, location, count, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param value Float32 in array [2] + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniform2d(program, location, v0, v1) + return void + param program UInt32 in value + param location Int32 in value + param v0 Float64 in value + param v1 Float64 in value + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniform2dv(program, location, count, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param value Float64 in array [2] + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniform2ui(program, location, v0, v1) + return void + param program UInt32 in value + param location Int32 in value + param v0 UInt32 in value + param v1 UInt32 in value + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniform2uiv(program, location, count, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param value UInt32 in array [2] + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniform3i(program, location, v0, v1, v2) + return void + param program UInt32 in value + param location Int32 in value + param v0 Int32 in value + param v1 Int32 in value + param v2 Int32 in value + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniform3iv(program, location, count, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param value Int32 in array [3] + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniform3f(program, location, v0, v1, v2) + return void + param program UInt32 in value + param location Int32 in value + param v0 Float32 in value + param v1 Float32 in value + param v2 Float32 in value + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniform3fv(program, location, count, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param value Float32 in array [3] + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniform3d(program, location, v0, v1, v2) + return void + param program UInt32 in value + param location Int32 in value + param v0 Float64 in value + param v1 Float64 in value + param v2 Float64 in value + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniform3dv(program, location, count, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param value Float64 in array [3] + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniform3ui(program, location, v0, v1, v2) + return void + param program UInt32 in value + param location Int32 in value + param v0 UInt32 in value + param v1 UInt32 in value + param v2 UInt32 in value + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniform3uiv(program, location, count, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param value UInt32 in array [3] + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniform4i(program, location, v0, v1, v2, v3) + return void + param program UInt32 in value + param location Int32 in value + param v0 Int32 in value + param v1 Int32 in value + param v2 Int32 in value + param v3 Int32 in value + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniform4iv(program, location, count, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param value Int32 in array [4] + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniform4f(program, location, v0, v1, v2, v3) + return void + param program UInt32 in value + param location Int32 in value + param v0 Float32 in value + param v1 Float32 in value + param v2 Float32 in value + param v3 Float32 in value + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniform4fv(program, location, count, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param value Float32 in array [4] + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniform4d(program, location, v0, v1, v2, v3) + return void + param program UInt32 in value + param location Int32 in value + param v0 Float64 in value + param v1 Float64 in value + param v2 Float64 in value + param v3 Float64 in value + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniform4dv(program, location, count, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param value Float64 in array [4] + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniform4ui(program, location, v0, v1, v2, v3) + return void + param program UInt32 in value + param location Int32 in value + param v0 UInt32 in value + param v1 UInt32 in value + param v2 UInt32 in value + param v3 UInt32 in value + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniform4uiv(program, location, count, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param value UInt32 in array [4] + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniformMatrix2fv(program, location, count, transpose, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float32 in array [2] + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniformMatrix3fv(program, location, count, transpose, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float32 in array [3] + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniformMatrix4fv(program, location, count, transpose, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float32 in array [4] + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniformMatrix2dv(program, location, count, transpose, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float64 in array [2] + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniformMatrix3dv(program, location, count, transpose, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float64 in array [3] + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniformMatrix4dv(program, location, count, transpose, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float64 in array [4] + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniformMatrix2x3fv(program, location, count, transpose, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float32 in array [count] + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniformMatrix3x2fv(program, location, count, transpose, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float32 in array [count] + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniformMatrix2x4fv(program, location, count, transpose, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float32 in array [count] + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniformMatrix4x2fv(program, location, count, transpose, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float32 in array [count] + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniformMatrix3x4fv(program, location, count, transpose, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float32 in array [count] + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniformMatrix4x3fv(program, location, count, transpose, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float32 in array [count] + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniformMatrix2x3dv(program, location, count, transpose, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float64 in array [count] + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniformMatrix3x2dv(program, location, count, transpose, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float64 in array [count] + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniformMatrix2x4dv(program, location, count, transpose, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float64 in array [count] + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniformMatrix4x2dv(program, location, count, transpose, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float64 in array [count] + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniformMatrix3x4dv(program, location, count, transpose, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float64 in array [count] + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniformMatrix4x3dv(program, location, count, transpose, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float64 in array [count] + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ValidateProgramPipeline(pipeline) + return void + param pipeline UInt32 in value + category ARB_separate_shader_objects + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +GetProgramPipelineInfoLog(pipeline, bufSize, length, infoLog) + return void + param pipeline UInt32 in value + param bufSize SizeI in value + param length SizeI out array [1] + param infoLog Char out array [COMPSIZE(length)] + category ARB_separate_shader_objects + dlflags notlistable + version 4.1 + extension + glxsingle ? + glxflags ignore + offset ? + +############################################################################### +# +# ARB Extension #98 +# ARB_shader_precision commands +# +############################################################################### + +############################################################################### +# +# ARB Extension #99 +# ARB_vertex_attrib_64bit commands +# +############################################################################### + +VertexAttribL1d(index, x) + return void + param index UInt32 in value + param x Float64 in value + category ARB_vertex_attrib_64bit + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexAttribL2d(index, x, y) + return void + param index UInt32 in value + param x Float64 in value + param y Float64 in value + category ARB_vertex_attrib_64bit + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexAttribL3d(index, x, y, z) + return void + param index UInt32 in value + param x Float64 in value + param y Float64 in value + param z Float64 in value + category ARB_vertex_attrib_64bit + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexAttribL4d(index, x, y, z, w) + return void + param index UInt32 in value + param x Float64 in value + param y Float64 in value + param z Float64 in value + param w Float64 in value + category ARB_vertex_attrib_64bit + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexAttribL1dv(index, v) + return void + param index UInt32 in value + param v Float64 in array [1] + category ARB_vertex_attrib_64bit + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexAttribL2dv(index, v) + return void + param index UInt32 in value + param v Float64 in array [2] + category ARB_vertex_attrib_64bit + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexAttribL3dv(index, v) + return void + param index UInt32 in value + param v Float64 in array [3] + category ARB_vertex_attrib_64bit + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexAttribL4dv(index, v) + return void + param index UInt32 in value + param v Float64 in array [4] + category ARB_vertex_attrib_64bit + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexAttribLPointer(index, size, type, stride, pointer) + return void + param index UInt32 in value + param size Int32 in value + param type GLenum in value + param stride SizeI in value + param pointer Void in array [size] + category ARB_vertex_attrib_64bit + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +GetVertexAttribLdv(index, pname, params) + return void + param index UInt32 in value + param pname GLenum in value + param params Float64 out array [COMPSIZE(pname)] + category ARB_vertex_attrib_64bit + dlflags notlistable + version 4.1 + extension + glxsingle ? + glxflags ignore + offset ? + +#@ VertexArrayVertexAttribLOffsetEXT also in EXT_vertex_attrib_64bit + +############################################################################### +# +# ARB Extension #100 +# ARB_viewport_array commands +# +############################################################################### + +ViewportArrayv(first, count, v) + return void + param first UInt32 in value + param count SizeI in value + param v Float32 in array [COMPSIZE(count)] + category ARB_viewport_array + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ViewportIndexedf(index, x, y, w, h) + return void + param index UInt32 in value + param x Float32 in value + param y Float32 in value + param w Float32 in value + param h Float32 in value + category ARB_viewport_array + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ViewportIndexedfv(index, v) + return void + param index UInt32 in value + param v Float32 in array [4] + category ARB_viewport_array + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ScissorArrayv(first, count, v) + return void + param first UInt32 in value + param count SizeI in value + param v Int32 in array [COMPSIZE(count)] + category ARB_viewport_array + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ScissorIndexed(index, left, bottom, width, height) + return void + param index UInt32 in value + param left Int32 in value + param bottom Int32 in value + param width SizeI in value + param height SizeI in value + category ARB_viewport_array + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ScissorIndexedv(index, v) + return void + param index UInt32 in value + param v Int32 in array [4] + category ARB_viewport_array + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +DepthRangeArrayv(first, count, v) + return void + param first UInt32 in value + param count SizeI in value + param v ClampedFloat64 in array [COMPSIZE(count)] + category ARB_viewport_array + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +DepthRangeIndexed(index, n, f) + return void + param index UInt32 in value + param n ClampedFloat64 in value + param f ClampedFloat64 in value + category ARB_viewport_array + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +GetFloati_v(target, index, data) + return void + param target GLenum in value + param index UInt32 in value + param data Float32 out array [COMPSIZE(target)] + category ARB_viewport_array + dlflags notlistable + version 4.1 + extension + glxsingle ? + glxflags ignore + offset ? + +GetDoublei_v(target, index, data) + return void + param target GLenum in value + param index UInt32 in value + param data Float64 out array [COMPSIZE(target)] + category ARB_viewport_array + dlflags notlistable + version 4.1 + extension + glxsingle ? + glxflags ignore + offset ? + +############################################################################### +# +# ARB Extension #101 - GLX_ARB_create_context_robustness +# ARB Extension #102 - WGL_ARB_create_context_robustness +# +############################################################################### + +############################################################################### +# +# ARB Extension #103 +# ARB_cl_event commands +# +############################################################################### + +CreateSyncFromCLeventARB(context, event, flags) + return sync + param context cl_context in value + param event cl_event in value + param flags GLbitfield in value + category ARB_cl_event + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +############################################################################### +# +# ARB Extension #104 +# ARB_debug_output commands +# +############################################################################### + +DebugMessageControlARB(source, type, severity, count, ids, enabled) + return void + param source GLenum in value + param type GLenum in value + param severity GLenum in value + param count SizeI in value + param ids UInt32 in array [count] + param enabled Boolean in value + category ARB_debug_output + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +DebugMessageInsertARB(source, type, id, severity, length, buf) + return void + param source GLenum in value + param type GLenum in value + param id UInt32 in value + param severity GLenum in value + param length SizeI in value + param buf Char in array [length] + category ARB_debug_output + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +DebugMessageCallbackARB(callback, userParam) + return void + param callback GLDEBUGPROCARB in value + param userParam Void in array [COMPSIZE(callback)] + category ARB_debug_output + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +GetDebugMessageLogARB(count, bufsize, sources, types, ids, severities, lengths, messageLog) + return UInt32 + param count UInt32 in value + param bufsize SizeI in value + param sources GLenum out array [count] + param types GLenum out array [count] + param ids UInt32 out array [count] + param severities GLenum out array [count] + param lengths SizeI out array [count] + param messageLog Char out array [COMPSIZE(lengths)] + category ARB_debug_output + dlflags notlistable + version 4.1 + extension + glxsingle ? + glxflags ignore + offset ? + +#@ GetPointerv is redeclared in this extension + +############################################################################### +# +# ARB Extension #105 +# ARB_robustness commands +# +############################################################################### + +GetGraphicsResetStatusARB() + return GLenum + category ARB_robustness + dlflags notlistable + version 4.1 + extension + glxsingle ? + glxflags ignore + offset ? + +GetnMapdvARB(target, query, bufSize, v) + return void + param target GLenum in value + param query GLenum in value + param bufSize SizeI in value + param v Float64 out array [bufSize] + category ARB_robustness + dlflags notlistable + version 4.1 + extension + glxsingle ? + glxflags ignore + offset ? + +GetnMapfvARB(target, query, bufSize, v) + return void + param target GLenum in value + param query GLenum in value + param bufSize SizeI in value + param v Float32 out array [bufSize] + category ARB_robustness + dlflags notlistable + version 4.1 + extension + glxsingle ? + glxflags ignore + offset ? + +GetnMapivARB(target, query, bufSize, v) + return void + param target GLenum in value + param query GLenum in value + param bufSize SizeI in value + param v Int32 out array [bufSize] + category ARB_robustness + dlflags notlistable + version 4.1 + extension + glxsingle ? + glxflags ignore + offset ? + +GetnPixelMapfvARB(map, bufSize, values) + return void + param map GLenum in value + param bufSize SizeI in value + param values Float32 out array [bufSize] + category ARB_robustness + dlflags notlistable + version 4.1 + extension + glxsingle ? + glxflags ignore + offset ? + +GetnPixelMapuivARB(map, bufSize, values) + return void + param map GLenum in value + param bufSize SizeI in value + param values UInt32 out array [bufSize] + category ARB_robustness + dlflags notlistable + version 4.1 + extension + glxsingle ? + glxflags ignore + offset ? + +GetnPixelMapusvARB(map, bufSize, values) + return void + param map GLenum in value + param bufSize SizeI in value + param values UInt16 out array [bufSize] + category ARB_robustness + dlflags notlistable + version 4.1 + extension + glxsingle ? + glxflags ignore + offset ? + +GetnPolygonStippleARB(bufSize, pattern) + return void + param bufSize SizeI in value + param pattern UInt8 out array [bufSize] + category ARB_robustness + dlflags notlistable + version 4.1 + extension + glxsingle ? + glxflags ignore + offset ? + +GetnColorTableARB(target, format, type, bufSize, table) + return void + param target GLenum in value + param format GLenum in value + param type GLenum in value + param bufSize SizeI in value + param table Void out array [bufSize] + category ARB_robustness + dlflags notlistable + version 4.1 + extension + glxsingle ? + glxflags ignore + offset ? + +GetnConvolutionFilterARB(target, format, type, bufSize, image) + return void + param target GLenum in value + param format GLenum in value + param type GLenum in value + param bufSize SizeI in value + param image Void out array [bufSize] + category ARB_robustness + dlflags notlistable + version 4.1 + extension + glxsingle ? + glxflags ignore + offset ? + +GetnSeparableFilterARB(target, format, type, rowBufSize, row, columnBufSize, column, span) + return void + param target GLenum in value + param format GLenum in value + param type GLenum in value + param rowBufSize SizeI in value + param row Void out array [rowBufSize] + param columnBufSize SizeI in value + param column Void out array [columnBufSize] + param span Void out array [0] + category ARB_robustness + dlflags notlistable + version 4.1 + extension + glxsingle ? + glxflags ignore + offset ? + +GetnHistogramARB(target, reset, format, type, bufSize, values) + return void + param target GLenum in value + param reset Boolean in value + param format GLenum in value + param type GLenum in value + param bufSize SizeI in value + param values Void out array [bufSize] + category ARB_robustness + dlflags notlistable + version 4.1 + extension + glxsingle ? + glxflags ignore + offset ? + +GetnMinmaxARB(target, reset, format, type, bufSize, values) + return void + param target GLenum in value + param reset Boolean in value + param format GLenum in value + param type GLenum in value + param bufSize SizeI in value + param values Void out array [bufSize] + category ARB_robustness + dlflags notlistable + version 4.1 + extension + glxsingle ? + glxflags ignore + offset ? + +GetnTexImageARB(target, level, format, type, bufSize, img) + return void + param target GLenum in value + param level Int32 in value + param format GLenum in value + param type GLenum in value + param bufSize SizeI in value + param img Void out array [bufSize] + category ARB_robustness + dlflags notlistable + version 4.1 + extension + glxsingle ? + glxflags ignore + offset ? + +ReadnPixelsARB(x, y, width, height, format, type, bufSize, data) + return void + param x Int32 in value + param y Int32 in value + param width SizeI in value + param height SizeI in value + param format GLenum in value + param type GLenum in value + param bufSize SizeI in value + param data Void out array [bufSize] + category ARB_robustness + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +GetnCompressedTexImageARB(target, lod, bufSize, img) + return void + param target GLenum in value + param lod Int32 in value + param bufSize SizeI in value + param img Void out array [bufSize] + category ARB_robustness + dlflags notlistable + version 4.1 + extension + glxsingle ? + glxflags ignore + offset ? + +GetnUniformfvARB(program, location, bufSize, params) + return void + param program UInt32 in value + param location Int32 in value + param bufSize SizeI in value + param params Float32 out array [bufSize] + category ARB_robustness + dlflags notlistable + version 4.1 + extension + glxsingle ? + glxflags ignore + offset ? + +GetnUniformivARB(program, location, bufSize, params) + return void + param program UInt32 in value + param location Int32 in value + param bufSize SizeI in value + param params Int32 out array [bufSize] + category ARB_robustness + dlflags notlistable + version 4.1 + extension + glxsingle ? + glxflags ignore + offset ? + +GetnUniformuivARB(program, location, bufSize, params) + return void + param program UInt32 in value + param location Int32 in value + param bufSize SizeI in value + param params UInt32 out array [bufSize] + category ARB_robustness + dlflags notlistable + version 4.1 + extension + glxsingle ? + glxflags ignore + offset ? + +GetnUniformdvARB(program, location, bufSize, params) + return void + param program UInt32 in value + param location Int32 in value + param bufSize SizeI in value + param params Float64 out array [bufSize] + category ARB_robustness + dlflags notlistable + version 4.1 + extension + glxsingle ? + glxflags ignore + offset ? + +############################################################################### +# +# ARB Extension #106 +# ARB_shader_stencil_export commands +# +############################################################################### + +# (none) +newcategory: ARB_shader_stencil_export + + +############################################################################### +############################################################################### +# +# Non-ARB extensions, in order by registry extension number +# +############################################################################### +############################################################################### + +############################################################################### +# +# Extension #1 +# EXT_abgr commands +# +############################################################################### + +# (none) +newcategory: EXT_abgr + +############################################################################### +# +# Extension #2 +# EXT_blend_color commands +# +############################################################################### + +BlendColorEXT(red, green, blue, alpha) + return void + param red ClampedColorF in value + param green ClampedColorF in value + param blue ClampedColorF in value + param alpha ClampedColorF in value + category EXT_blend_color + version 1.0 + glxropcode 4096 + glxflags EXT + extension soft + alias BlendColor + +############################################################################### +# +# Extension #3 +# EXT_polygon_offset commands +# +############################################################################### + +PolygonOffsetEXT(factor, bias) + return void + param factor Float32 in value + param bias Float32 in value + category EXT_polygon_offset + version 1.0 + glxropcode 4098 + glxflags EXT + extension soft + offset 414 + +############################################################################### +# +# Extension #4 +# EXT_texture commands +# +############################################################################### + +# (none) +newcategory: EXT_texture + +############################################################################### +# +# Extension #5 - skipped +# +############################################################################### + +############################################################################### +# +# Extension #6 +# EXT_texture3D commands +# +############################################################################### + +# Arguably TexelInternalFormat, not PixelInternalFormat +TexImage3DEXT(target, level, internalformat, width, height, depth, border, format, type, pixels) + return void + param target TextureTarget in value + param level CheckedInt32 in value + param internalformat PixelInternalFormat in value + param width SizeI in value + param height SizeI in value + param depth SizeI in value + param border CheckedInt32 in value + param format PixelFormat in value + param type PixelType in value + param pixels Void in array [COMPSIZE(format/type/width/height/depth)] + category EXT_texture3D + dlflags handcode + glxflags client-handcode server-handcode EXT + version 1.0 + glxropcode 4114 + extension + alias TexImage3D + +TexSubImage3DEXT(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels) + return void + param target TextureTarget in value + param level CheckedInt32 in value + param xoffset CheckedInt32 in value + param yoffset CheckedInt32 in value + param zoffset CheckedInt32 in value + param width SizeI in value + param height SizeI in value + param depth SizeI in value + param format PixelFormat in value + param type PixelType in value + param pixels Void in array [COMPSIZE(format/type/width/height/depth)] + category EXT_texture3D + dlflags handcode + glxflags client-handcode server-handcode EXT + version 1.0 + glxropcode 4115 + extension + alias TexSubImage3D + +############################################################################### +# +# Extension #7 +# SGIS_texture_filter4 commands +# +############################################################################### + +GetTexFilterFuncSGIS(target, filter, weights) + return void + param target TextureTarget in value + param filter TextureFilterSGIS in value + param weights Float32 out array [COMPSIZE(target/filter)] + category SGIS_texture_filter4 + dlflags notlistable + version 1.0 + glxflags SGI + glxvendorpriv 4101 + extension + offset 415 + +TexFilterFuncSGIS(target, filter, n, weights) + return void + param target TextureTarget in value + param filter TextureFilterSGIS in value + param n SizeI in value + param weights Float32 in array [n] + category SGIS_texture_filter4 + glxflags SGI + version 1.0 + glxropcode 2064 + extension + offset 416 + +############################################################################### +# +# Extension #8 - skipped +# +############################################################################### + +############################################################################### +# +# Extension #9 +# EXT_subtexture commands +# +############################################################################### + +TexSubImage1DEXT(target, level, xoffset, width, format, type, pixels) + return void + param target TextureTarget in value + param level CheckedInt32 in value + param xoffset CheckedInt32 in value + param width SizeI in value + param format PixelFormat in value + param type PixelType in value + param pixels Void in array [COMPSIZE(format/type/width)] + category EXT_subtexture + dlflags handcode + glxflags client-handcode server-handcode EXT + version 1.0 + glxropcode 4099 + extension + alias TexSubImage1D + +TexSubImage2DEXT(target, level, xoffset, yoffset, width, height, format, type, pixels) + return void + param target TextureTarget in value + param level CheckedInt32 in value + param xoffset CheckedInt32 in value + param yoffset CheckedInt32 in value + param width SizeI in value + param height SizeI in value + param format PixelFormat in value + param type PixelType in value + param pixels Void in array [COMPSIZE(format/type/width/height)] + category EXT_subtexture + dlflags handcode + glxflags client-handcode server-handcode EXT + version 1.0 + glxropcode 4100 + extension + alias TexSubImage2D + +############################################################################### +# +# Extension #10 +# EXT_copy_texture commands +# +############################################################################### + +# Arguably TexelInternalFormat, not PixelInternalFormat +CopyTexImage1DEXT(target, level, internalformat, x, y, width, border) + return void + param target TextureTarget in value + param level CheckedInt32 in value + param internalformat PixelInternalFormat in value + param x WinCoord in value + param y WinCoord in value + param width SizeI in value + param border CheckedInt32 in value + category EXT_copy_texture + version 1.0 + glxflags EXT + glxropcode 4119 + extension + alias CopyTexImage1D + +# Arguably TexelInternalFormat, not PixelInternalFormat +CopyTexImage2DEXT(target, level, internalformat, x, y, width, height, border) + return void + param target TextureTarget in value + param level CheckedInt32 in value + param internalformat PixelInternalFormat in value + param x WinCoord in value + param y WinCoord in value + param width SizeI in value + param height SizeI in value + param border CheckedInt32 in value + category EXT_copy_texture + version 1.0 + glxflags EXT + glxropcode 4120 + extension + alias CopyTexImage2D + +CopyTexSubImage1DEXT(target, level, xoffset, x, y, width) + return void + param target TextureTarget in value + param level CheckedInt32 in value + param xoffset CheckedInt32 in value + param x WinCoord in value + param y WinCoord in value + param width SizeI in value + category EXT_copy_texture + version 1.0 + glxflags EXT + glxropcode 4121 + extension + alias CopyTexSubImage1D + +CopyTexSubImage2DEXT(target, level, xoffset, yoffset, x, y, width, height) + return void + param target TextureTarget in value + param level CheckedInt32 in value + param xoffset CheckedInt32 in value + param yoffset CheckedInt32 in value + param x WinCoord in value + param y WinCoord in value + param width SizeI in value + param height SizeI in value + category EXT_copy_texture + version 1.0 + glxflags EXT + glxropcode 4122 + extension + alias CopyTexSubImage2D + +CopyTexSubImage3DEXT(target, level, xoffset, yoffset, zoffset, x, y, width, height) + return void + param target TextureTarget in value + param level CheckedInt32 in value + param xoffset CheckedInt32 in value + param yoffset CheckedInt32 in value + param zoffset CheckedInt32 in value + param x WinCoord in value + param y WinCoord in value + param width SizeI in value + param height SizeI in value + category EXT_copy_texture + version 1.0 + glxflags EXT + glxropcode 4123 + extension + alias CopyTexSubImage3D + +############################################################################### +# +# Extension #11 +# EXT_histogram commands +# +############################################################################### + +GetHistogramEXT(target, reset, format, type, values) + return void + param target HistogramTargetEXT in value + param reset Boolean in value + param format PixelFormat in value + param type PixelType in value + param values Void out array [COMPSIZE(target/format/type)] + category EXT_histogram + dlflags notlistable + glxflags client-handcode server-handcode EXT + version 1.0 + glxvendorpriv 5 + extension + offset 417 + +GetHistogramParameterfvEXT(target, pname, params) + return void + param target HistogramTargetEXT in value + param pname GetHistogramParameterPNameEXT in value + param params Float32 out array [COMPSIZE(pname)] + category EXT_histogram + dlflags notlistable + version 1.0 + glxvendorpriv 6 + glxflags EXT + extension + offset 418 + +GetHistogramParameterivEXT(target, pname, params) + return void + param target HistogramTargetEXT in value + param pname GetHistogramParameterPNameEXT in value + param params Int32 out array [COMPSIZE(pname)] + category EXT_histogram + dlflags notlistable + version 1.0 + glxvendorpriv 7 + glxflags EXT + extension + offset 419 + +GetMinmaxEXT(target, reset, format, type, values) + return void + param target MinmaxTargetEXT in value + param reset Boolean in value + param format PixelFormat in value + param type PixelType in value + param values Void out array [COMPSIZE(target/format/type)] + category EXT_histogram + dlflags notlistable + glxflags client-handcode server-handcode EXT + version 1.0 + glxvendorpriv 8 + extension + offset 420 + +GetMinmaxParameterfvEXT(target, pname, params) + return void + param target MinmaxTargetEXT in value + param pname GetMinmaxParameterPNameEXT in value + param params Float32 out array [COMPSIZE(pname)] + category EXT_histogram + dlflags notlistable + version 1.0 + glxvendorpriv 9 + glxflags EXT + extension + offset 421 + +GetMinmaxParameterivEXT(target, pname, params) + return void + param target MinmaxTargetEXT in value + param pname GetMinmaxParameterPNameEXT in value + param params Int32 out array [COMPSIZE(pname)] + category EXT_histogram + dlflags notlistable + version 1.0 + glxvendorpriv 10 + glxflags EXT + extension + offset 422 + +HistogramEXT(target, width, internalformat, sink) + return void + param target HistogramTargetEXT in value + param width SizeI in value + param internalformat PixelInternalFormat in value + param sink Boolean in value + category EXT_histogram + version 1.0 + glxropcode 4110 + glxflags EXT + extension + alias Histogram + +MinmaxEXT(target, internalformat, sink) + return void + param target MinmaxTargetEXT in value + param internalformat PixelInternalFormat in value + param sink Boolean in value + category EXT_histogram + version 1.0 + glxropcode 4111 + glxflags EXT + extension + alias Minmax + +ResetHistogramEXT(target) + return void + param target HistogramTargetEXT in value + category EXT_histogram + version 1.0 + glxropcode 4112 + glxflags EXT + extension + alias ResetHistogram + +ResetMinmaxEXT(target) + return void + param target MinmaxTargetEXT in value + category EXT_histogram + version 1.0 + glxropcode 4113 + glxflags EXT + extension + alias ResetMinmax + +############################################################################### +# +# Extension #12 +# EXT_convolution commands +# +############################################################################### + +ConvolutionFilter1DEXT(target, internalformat, width, format, type, image) + return void + param target ConvolutionTargetEXT in value + param internalformat PixelInternalFormat in value + param width SizeI in value + param format PixelFormat in value + param type PixelType in value + param image Void in array [COMPSIZE(format/type/width)] + category EXT_convolution + dlflags handcode + glxflags client-handcode server-handcode EXT + version 1.0 + glxropcode 4101 + extension + alias ConvolutionFilter1D + +ConvolutionFilter2DEXT(target, internalformat, width, height, format, type, image) + return void + param target ConvolutionTargetEXT in value + param internalformat PixelInternalFormat in value + param width SizeI in value + param height SizeI in value + param format PixelFormat in value + param type PixelType in value + param image Void in array [COMPSIZE(format/type/width/height)] + category EXT_convolution + dlflags handcode + glxflags client-handcode server-handcode EXT + version 1.0 + glxropcode 4102 + extension + alias ConvolutionFilter2D + +ConvolutionParameterfEXT(target, pname, params) + return void + param target ConvolutionTargetEXT in value + param pname ConvolutionParameterEXT in value + param params CheckedFloat32 in value + category EXT_convolution + version 1.0 + glxropcode 4103 + glxflags EXT + extension + alias ConvolutionParameterf + +ConvolutionParameterfvEXT(target, pname, params) + return void + param target ConvolutionTargetEXT in value + param pname ConvolutionParameterEXT in value + param params CheckedFloat32 in array [COMPSIZE(pname)] + category EXT_convolution + version 1.0 + glxropcode 4104 + glxflags EXT + extension + alias ConvolutionParameterfv + +ConvolutionParameteriEXT(target, pname, params) + return void + param target ConvolutionTargetEXT in value + param pname ConvolutionParameterEXT in value + param params CheckedInt32 in value + category EXT_convolution + version 1.0 + glxropcode 4105 + glxflags EXT + extension + alias ConvolutionParameteri + +ConvolutionParameterivEXT(target, pname, params) + return void + param target ConvolutionTargetEXT in value + param pname ConvolutionParameterEXT in value + param params CheckedInt32 in array [COMPSIZE(pname)] + category EXT_convolution + version 1.0 + glxropcode 4106 + glxflags EXT + extension + alias ConvolutionParameteriv + +CopyConvolutionFilter1DEXT(target, internalformat, x, y, width) + return void + param target ConvolutionTargetEXT in value + param internalformat PixelInternalFormat in value + param x WinCoord in value + param y WinCoord in value + param width SizeI in value + category EXT_convolution + version 1.0 + glxropcode 4107 + glxflags EXT + extension + alias CopyConvolutionFilter1D + +CopyConvolutionFilter2DEXT(target, internalformat, x, y, width, height) + return void + param target ConvolutionTargetEXT in value + param internalformat PixelInternalFormat in value + param x WinCoord in value + param y WinCoord in value + param width SizeI in value + param height SizeI in value + category EXT_convolution + version 1.0 + glxropcode 4108 + glxflags EXT + extension + alias CopyConvolutionFilter2D + +GetConvolutionFilterEXT(target, format, type, image) + return void + param target ConvolutionTargetEXT in value + param format PixelFormat in value + param type PixelType in value + param image Void out array [COMPSIZE(target/format/type)] + category EXT_convolution + dlflags notlistable + glxflags client-handcode server-handcode EXT + version 1.0 + glxvendorpriv 1 + extension + offset 423 + +GetConvolutionParameterfvEXT(target, pname, params) + return void + param target ConvolutionTargetEXT in value + param pname ConvolutionParameterEXT in value + param params Float32 out array [COMPSIZE(pname)] + category EXT_convolution + dlflags notlistable + version 1.0 + glxvendorpriv 2 + glxflags EXT + extension + offset 424 + +GetConvolutionParameterivEXT(target, pname, params) + return void + param target ConvolutionTargetEXT in value + param pname ConvolutionParameterEXT in value + param params Int32 out array [COMPSIZE(pname)] + category EXT_convolution + dlflags notlistable + version 1.0 + glxvendorpriv 3 + glxflags EXT + extension + offset 425 + +GetSeparableFilterEXT(target, format, type, row, column, span) + return void + param target SeparableTargetEXT in value + param format PixelFormat in value + param type PixelType in value + param row Void out array [COMPSIZE(target/format/type)] + param column Void out array [COMPSIZE(target/format/type)] + param span Void out array [COMPSIZE(target/format/type)] + category EXT_convolution + dlflags notlistable + glxflags client-handcode server-handcode EXT + version 1.0 + glxvendorpriv 4 + extension + offset 426 + +SeparableFilter2DEXT(target, internalformat, width, height, format, type, row, column) + return void + param target SeparableTargetEXT in value + param internalformat PixelInternalFormat in value + param width SizeI in value + param height SizeI in value + param format PixelFormat in value + param type PixelType in value + param row Void in array [COMPSIZE(target/format/type/width)] + param column Void in array [COMPSIZE(target/format/type/height)] + category EXT_convolution + dlflags handcode + glxflags client-handcode server-handcode EXT + version 1.0 + glxropcode 4109 + extension + alias SeparableFilter2D + +############################################################################### +# +# Extension #13 +# SGI_color_matrix commands +# +############################################################################### + +# (none) +newcategory: SGI_color_matrix + +############################################################################### +# +# Extension #14 +# SGI_color_table commands +# +############################################################################### + +ColorTableSGI(target, internalformat, width, format, type, table) + return void + param target ColorTableTargetSGI in value + param internalformat PixelInternalFormat in value + param width SizeI in value + param format PixelFormat in value + param type PixelType in value + param table Void in array [COMPSIZE(format/type/width)] + category SGI_color_table + dlflags handcode + glxflags client-handcode server-handcode SGI + version 1.0 + glxropcode 2053 + extension + alias ColorTable + +ColorTableParameterfvSGI(target, pname, params) + return void + param target ColorTableTargetSGI in value + param pname ColorTableParameterPNameSGI in value + param params CheckedFloat32 in array [COMPSIZE(pname)] + category SGI_color_table + version 1.0 + glxropcode 2054 + glxflags SGI + extension + alias ColorTableParameterfv + +ColorTableParameterivSGI(target, pname, params) + return void + param target ColorTableTargetSGI in value + param pname ColorTableParameterPNameSGI in value + param params CheckedInt32 in array [COMPSIZE(pname)] + category SGI_color_table + version 1.0 + glxropcode 2055 + glxflags SGI + extension + alias ColorTableParameteriv + +CopyColorTableSGI(target, internalformat, x, y, width) + return void + param target ColorTableTargetSGI in value + param internalformat PixelInternalFormat in value + param x WinCoord in value + param y WinCoord in value + param width SizeI in value + category SGI_color_table + version 1.0 + glxropcode 2056 + glxflags SGI + extension + alias CopyColorTable + +GetColorTableSGI(target, format, type, table) + return void + param target ColorTableTargetSGI in value + param format PixelFormat in value + param type PixelType in value + param table Void out array [COMPSIZE(target/format/type)] + category SGI_color_table + dlflags notlistable + glxflags client-handcode server-handcode SGI + version 1.0 + glxvendorpriv 4098 + extension + offset 427 + +GetColorTableParameterfvSGI(target, pname, params) + return void + param target ColorTableTargetSGI in value + param pname GetColorTableParameterPNameSGI in value + param params Float32 out array [COMPSIZE(pname)] + category SGI_color_table + dlflags notlistable + version 1.0 + glxflags SGI + glxvendorpriv 4099 + extension + offset 428 + +GetColorTableParameterivSGI(target, pname, params) + return void + param target ColorTableTargetSGI in value + param pname GetColorTableParameterPNameSGI in value + param params Int32 out array [COMPSIZE(pname)] + category SGI_color_table + dlflags notlistable + version 1.0 + glxflags SGI + glxvendorpriv 4100 + extension + offset 429 + +############################################################################### +# +# Extension #15 +# SGIX_pixel_texture commands +# +############################################################################### + +PixelTexGenSGIX(mode) + return void + param mode PixelTexGenModeSGIX in value + category SGIX_pixel_texture + version 1.0 + glxflags SGI + glxropcode 2059 + extension + offset 430 + +############################################################################### +# +# Extension #15 (variant) +# SGIS_pixel_texture commands +# Both SGIS and SGIX forms have extension #15! +# +############################################################################### + +PixelTexGenParameteriSGIS(pname, param) + return void + param pname PixelTexGenParameterNameSGIS in value + param param CheckedInt32 in value + category SGIS_pixel_texture + version 1.0 + extension + glxropcode ? + glxflags ignore + offset 431 + +PixelTexGenParameterivSGIS(pname, params) + return void + param pname PixelTexGenParameterNameSGIS in value + param params CheckedInt32 in array [COMPSIZE(pname)] + category SGIS_pixel_texture + version 1.0 + extension + glxropcode ? + glxflags ignore + offset 432 + +PixelTexGenParameterfSGIS(pname, param) + return void + param pname PixelTexGenParameterNameSGIS in value + param param CheckedFloat32 in value + category SGIS_pixel_texture + version 1.0 + extension + glxropcode ? + glxflags ignore + offset 433 + +PixelTexGenParameterfvSGIS(pname, params) + return void + param pname PixelTexGenParameterNameSGIS in value + param params CheckedFloat32 in array [COMPSIZE(pname)] + category SGIS_pixel_texture + version 1.0 + extension + glxropcode ? + glxflags ignore + offset 434 + +GetPixelTexGenParameterivSGIS(pname, params) + return void + param pname PixelTexGenParameterNameSGIS in value + param params CheckedInt32 out array [COMPSIZE(pname)] + dlflags notlistable + category SGIS_pixel_texture + version 1.0 + extension + glxvendorpriv ? + glxflags ignore + offset 435 + +GetPixelTexGenParameterfvSGIS(pname, params) + return void + param pname PixelTexGenParameterNameSGIS in value + param params CheckedFloat32 out array [COMPSIZE(pname)] + dlflags notlistable + category SGIS_pixel_texture + version 1.0 + extension + glxvendorpriv ? + glxflags ignore + offset 436 + +############################################################################### +# +# Extension #16 +# SGIS_texture4D commands +# +############################################################################### + +TexImage4DSGIS(target, level, internalformat, width, height, depth, size4d, border, format, type, pixels) + return void + param target TextureTarget in value + param level CheckedInt32 in value + param internalformat PixelInternalFormat in value + param width SizeI in value + param height SizeI in value + param depth SizeI in value + param size4d SizeI in value + param border CheckedInt32 in value + param format PixelFormat in value + param type PixelType in value + param pixels Void in array [COMPSIZE(format/type/width/height/depth/size4d)] + category SGIS_texture4D + dlflags handcode + glxflags client-handcode server-handcode SGI + version 1.0 + glxropcode 2057 + extension + offset 437 + +TexSubImage4DSGIS(target, level, xoffset, yoffset, zoffset, woffset, width, height, depth, size4d, format, type, pixels) + return void + param target TextureTarget in value + param level CheckedInt32 in value + param xoffset CheckedInt32 in value + param yoffset CheckedInt32 in value + param zoffset CheckedInt32 in value + param woffset CheckedInt32 in value + param width SizeI in value + param height SizeI in value + param depth SizeI in value + param size4d SizeI in value + param format PixelFormat in value + param type PixelType in value + param pixels Void in array [COMPSIZE(format/type/width/height/depth/size4d)] + category SGIS_texture4D + dlflags handcode + glxflags client-handcode server-handcode SGI + version 1.0 + glxropcode 2058 + extension + offset 438 + +############################################################################### +# +# Extension #17 +# SGI_texture_color_table commands +# +############################################################################### + +# (none) +newcategory: SGI_texture_color_table + +############################################################################### +# +# Extension #18 +# EXT_cmyka commands +# +############################################################################### + +# (none) +newcategory: EXT_cmyka + +############################################################################### +# +# Extension #19 - skipped +# +############################################################################### + +############################################################################### +# +# Extension #20 +# EXT_texture_object commands +# +############################################################################### + +AreTexturesResidentEXT(n, textures, residences) + return Boolean + param n SizeI in value + param textures Texture in array [n] + param residences Boolean out array [n] + category EXT_texture_object + glxflags EXT + glxvendorpriv 11 + dlflags notlistable + version 1.0 + extension + offset 439 + +BindTextureEXT(target, texture) + return void + param target TextureTarget in value + param texture Texture in value + category EXT_texture_object + version 1.0 + glxflags EXT + glxropcode 4117 + extension + alias BindTexture + +DeleteTexturesEXT(n, textures) + return void + param n SizeI in value + param textures Texture in array [n] + category EXT_texture_object + dlflags notlistable + version 1.0 + glxflags EXT + glxvendorpriv 12 + extension + offset 561 + +GenTexturesEXT(n, textures) + return void + param n SizeI in value + param textures Texture out array [n] + category EXT_texture_object + dlflags notlistable + version 1.0 + glxflags EXT + glxvendorpriv 13 + extension + offset 440 + +IsTextureEXT(texture) + return Boolean + param texture Texture in value + category EXT_texture_object + dlflags notlistable + version 1.0 + glxflags EXT + glxvendorpriv 14 + extension + offset 441 + +PrioritizeTexturesEXT(n, textures, priorities) + return void + param n SizeI in value + param textures Texture in array [n] + param priorities ClampedFloat32 in array [n] + category EXT_texture_object + glxflags EXT + version 1.0 + glxropcode 4118 + extension + alias PrioritizeTextures + +############################################################################### +# +# Extension #21 +# SGIS_detail_texture commands +# +############################################################################### + +DetailTexFuncSGIS(target, n, points) + return void + param target TextureTarget in value + param n SizeI in value + param points Float32 in array [n*2] + category SGIS_detail_texture + glxflags SGI + version 1.0 + glxropcode 2051 + extension + offset 442 + +GetDetailTexFuncSGIS(target, points) + return void + param target TextureTarget in value + param points Float32 out array [COMPSIZE(target)] + category SGIS_detail_texture + dlflags notlistable + version 1.0 + glxflags SGI + glxvendorpriv 4096 + extension + offset 443 + +############################################################################### +# +# Extension #22 +# SGIS_sharpen_texture commands +# +############################################################################### + +SharpenTexFuncSGIS(target, n, points) + return void + param target TextureTarget in value + param n SizeI in value + param points Float32 in array [n*2] + category SGIS_sharpen_texture + glxflags SGI + version 1.0 + glxropcode 2052 + extension + offset 444 + +GetSharpenTexFuncSGIS(target, points) + return void + param target TextureTarget in value + param points Float32 out array [COMPSIZE(target)] + category SGIS_sharpen_texture + dlflags notlistable + version 1.0 + glxflags SGI + glxvendorpriv 4097 + extension + offset 445 + +############################################################################### +# +# EXT_packed_pixels commands +# Extension #23 +# +############################################################################### + +# (none) +newcategory: EXT_packed_pixels + +############################################################################### +# +# Extension #24 +# SGIS_texture_lod commands +# +############################################################################### + +# (none) +newcategory: SGIS_texture_lod + +############################################################################### +# +# Extension #25 +# SGIS_multisample commands +# +############################################################################### + +SampleMaskSGIS(value, invert) + return void + param value ClampedFloat32 in value + param invert Boolean in value + category SGIS_multisample + version 1.1 + glxropcode 2048 + glxflags SGI + extension + alias SampleMaskEXT + +SamplePatternSGIS(pattern) + return void + param pattern SamplePatternSGIS in value + category SGIS_multisample + version 1.0 + glxropcode 2049 + glxflags SGI + extension + alias SamplePatternEXT + +############################################################################### +# +# Extension #26 - no specification? +# +############################################################################### + +############################################################################### +# +# Extension #27 +# EXT_rescale_normal commands +# +############################################################################### + +# (none) +newcategory: EXT_rescale_normal + +############################################################################### +# +# Extension #28 - GLX_EXT_visual_info +# Extension #29 - skipped +# +############################################################################### + +############################################################################### +# +# Extension #30 +# EXT_vertex_array commands +# +############################################################################### + +ArrayElementEXT(i) + return void + param i Int32 in value + category EXT_vertex_array + dlflags handcode + glxflags client-handcode server-handcode EXT + version 1.0 + extension + alias ArrayElement + +ColorPointerEXT(size, type, stride, count, pointer) + return void + param size Int32 in value + param type ColorPointerType in value + param stride SizeI in value + param count SizeI in value + param pointer Void in array [COMPSIZE(size/type/stride/count)] retained + category EXT_vertex_array + dlflags notlistable + glxflags client-handcode server-handcode EXT + version 1.0 + extension + offset 448 + +DrawArraysEXT(mode, first, count) + return void + param mode BeginMode in value + param first Int32 in value + param count SizeI in value + category EXT_vertex_array + dlflags handcode + glxflags client-handcode server-handcode EXT + version 1.0 + glxropcode 4116 + extension + alias DrawArrays + +EdgeFlagPointerEXT(stride, count, pointer) + return void + param stride SizeI in value + param count SizeI in value + param pointer Boolean in array [COMPSIZE(stride/count)] retained + category EXT_vertex_array + dlflags notlistable + glxflags client-handcode server-handcode EXT + version 1.0 + extension + offset 449 + +GetPointervEXT(pname, params) + return void + param pname GetPointervPName in value + param params VoidPointer out array [1] + category EXT_vertex_array + dlflags notlistable + glxflags client-handcode server-handcode EXT + version 1.0 + extension + alias GetPointerv + +IndexPointerEXT(type, stride, count, pointer) + return void + param type IndexPointerType in value + param stride SizeI in value + param count SizeI in value + param pointer Void in array [COMPSIZE(type/stride/count)] retained + category EXT_vertex_array + dlflags notlistable + glxflags client-handcode server-handcode EXT + version 1.0 + extension + offset 450 + +NormalPointerEXT(type, stride, count, pointer) + return void + param type NormalPointerType in value + param stride SizeI in value + param count SizeI in value + param pointer Void in array [COMPSIZE(type/stride/count)] retained + category EXT_vertex_array + dlflags notlistable + glxflags client-handcode server-handcode EXT + version 1.0 + extension + offset 451 + +TexCoordPointerEXT(size, type, stride, count, pointer) + return void + param size Int32 in value + param type TexCoordPointerType in value + param stride SizeI in value + param count SizeI in value + param pointer Void in array [COMPSIZE(size/type/stride/count)] retained + category EXT_vertex_array + dlflags notlistable + glxflags client-handcode server-handcode EXT + version 1.0 + extension + offset 452 + +VertexPointerEXT(size, type, stride, count, pointer) + return void + param size Int32 in value + param type VertexPointerType in value + param stride SizeI in value + param count SizeI in value + param pointer Void in array [COMPSIZE(size/type/stride/count)] retained + category EXT_vertex_array + dlflags notlistable + glxflags client-handcode server-handcode EXT + version 1.0 + extension + offset 453 + +############################################################################### +# +# Extension #31 +# EXT_misc_attribute commands +# +############################################################################### + +# (none) +newcategory: EXT_misc_attribute + +############################################################################### +# +# Extension #32 +# SGIS_generate_mipmap commands +# +############################################################################### + +# (none) +newcategory: SGIS_generate_mipmap + +############################################################################### +# +# Extension #33 +# SGIX_clipmap commands +# +############################################################################### + +# (none) +newcategory: SGIX_clipmap + +############################################################################### +# +# Extension #34 +# SGIX_shadow commands +# +############################################################################### + +# (none) +newcategory: SGIX_shadow + +############################################################################### +# +# Extension #35 +# SGIS_texture_edge_clamp commands +# +############################################################################### + +# (none) +newcategory: SGIS_texture_edge_clamp + +############################################################################### +# +# Extension #36 +# SGIS_texture_border_clamp commands +# +############################################################################### + +# (none) +newcategory: SGIS_texture_border_clamp + +############################################################################### +# +# Extension #37 +# EXT_blend_minmax commands +# +############################################################################### + +BlendEquationEXT(mode) + return void + param mode BlendEquationModeEXT in value + category EXT_blend_minmax + version 1.0 + glxropcode 4097 + glxflags EXT + extension soft + alias BlendEquation + +############################################################################### +# +# Extension #38 +# EXT_blend_subtract commands +# +############################################################################### + +# (none) +newcategory: EXT_blend_subtract + +############################################################################### +# +# Extension #39 +# EXT_blend_logic_op commands +# +############################################################################### + +# (none) +newcategory: EXT_blend_logic_op + +############################################################################### +# +# Extension #40 - GLX_SGI_swap_control +# Extension #41 - GLX_SGI_video_sync +# Extension #42 - GLX_SGI_make_current_read +# Extension #43 - GLX_SGIX_video_source +# Extension #44 - GLX_EXT_visual_rating +# +############################################################################### + +############################################################################### +# +# Extension #45 +# SGIX_interlace commands +# +############################################################################### + +# (none) +newcategory: SGIX_interlace + +############################################################################### +# +# Extension #46 +# SGIX_pixel_tiles commands +# +############################################################################### + +# (none) +newcategory: SGIX_pixel_tiles + +############################################################################### +# +# Extension #47 - GLX_EXT_import_context +# Extension #48 - skipped +# Extension #49 - GLX_SGIX_fbconfig +# Extension #50 - GLX_SGIX_pbuffer +# +############################################################################### + +############################################################################### +# +# Extension #51 +# SGIX_texture_select commands +# +############################################################################### + +# (none) +newcategory: SGIX_texture_select + +############################################################################### +# +# Extension #52 +# SGIX_sprite commands +# +############################################################################### + +SpriteParameterfSGIX(pname, param) + return void + param pname SpriteParameterNameSGIX in value + param param CheckedFloat32 in value + category SGIX_sprite + version 1.0 + glxflags SGI + glxropcode 2060 + extension + offset 454 + +SpriteParameterfvSGIX(pname, params) + return void + param pname SpriteParameterNameSGIX in value + param params CheckedFloat32 in array [COMPSIZE(pname)] + category SGIX_sprite + version 1.0 + glxflags SGI + glxropcode 2061 + extension + offset 455 + +SpriteParameteriSGIX(pname, param) + return void + param pname SpriteParameterNameSGIX in value + param param CheckedInt32 in value + category SGIX_sprite + version 1.0 + glxflags SGI + glxropcode 2062 + extension + offset 456 + +SpriteParameterivSGIX(pname, params) + return void + param pname SpriteParameterNameSGIX in value + param params CheckedInt32 in array [COMPSIZE(pname)] + category SGIX_sprite + version 1.0 + glxflags SGI + glxropcode 2063 + extension + offset 457 + +############################################################################### +# +# Extension #53 +# SGIX_texture_multi_buffer commands +# +############################################################################### + +# (none) +newcategory: SGIX_texture_multi_buffer + +############################################################################### +# +# Extension #54 +# EXT_point_parameters / SGIS_point_parameters commands +# +############################################################################### + +PointParameterfEXT(pname, param) + return void + param pname PointParameterNameARB in value + param param CheckedFloat32 in value + category EXT_point_parameters + version 1.0 + glxflags SGI + extension + alias PointParameterfARB + +PointParameterfvEXT(pname, params) + return void + param pname PointParameterNameARB in value + param params CheckedFloat32 in array [COMPSIZE(pname)] + category EXT_point_parameters + version 1.0 + glxflags SGI + extension + alias PointParameterfvARB + +PointParameterfSGIS(pname, param) + return void + param pname PointParameterNameARB in value + param param CheckedFloat32 in value + category SGIS_point_parameters + version 1.0 + glxflags SGI + extension + alias PointParameterfARB + +PointParameterfvSGIS(pname, params) + return void + param pname PointParameterNameARB in value + param params CheckedFloat32 in array [COMPSIZE(pname)] + category SGIS_point_parameters + version 1.0 + glxflags SGI + extension + alias PointParameterfvARB + +############################################################################### +# +# Extension #55 +# SGIX_instruments commands +# +############################################################################### + +GetInstrumentsSGIX() + return Int32 + dlflags notlistable + category SGIX_instruments + version 1.0 + glxflags SGI + glxvendorpriv 4102 + extension + offset 460 + +InstrumentsBufferSGIX(size, buffer) + return void + param size SizeI in value + param buffer Int32 out array [size] retained + dlflags notlistable + category SGIX_instruments + version 1.0 + glxflags SGI + glxvendorpriv 4103 + extension + offset 461 + +PollInstrumentsSGIX(marker_p) + return Int32 + param marker_p Int32 out array [1] + dlflags notlistable + category SGIX_instruments + version 1.0 + glxflags SGI + glxvendorpriv 4104 + extension + offset 462 + +ReadInstrumentsSGIX(marker) + return void + param marker Int32 in value + category SGIX_instruments + version 1.0 + glxflags SGI + glxropcode 2077 + extension + offset 463 + +StartInstrumentsSGIX() + return void + category SGIX_instruments + version 1.0 + glxflags SGI + glxropcode 2069 + extension + offset 464 + +StopInstrumentsSGIX(marker) + return void + param marker Int32 in value + category SGIX_instruments + version 1.0 + glxflags SGI + glxropcode 2070 + extension + offset 465 + +############################################################################### +# +# Extension #56 +# SGIX_texture_scale_bias commands +# +############################################################################### + +# (none) +newcategory: SGIX_texture_scale_bias + +############################################################################### +# +# Extension #57 +# SGIX_framezoom commands +# +############################################################################### + +FrameZoomSGIX(factor) + return void + param factor CheckedInt32 in value + category SGIX_framezoom + version 1.0 + glxflags SGI + glxropcode 2072 + extension + offset 466 + +############################################################################### +# +# Extension #58 +# SGIX_tag_sample_buffer commands +# +############################################################################### + +TagSampleBufferSGIX() + return void + category SGIX_tag_sample_buffer + version 1.0 + glxropcode 2050 + glxflags SGI + extension + offset 467 + +############################################################################### +# +# Extension #59 +# SGIX_polynomial_ffd commands +# +############################################################################### + +DeformationMap3dSGIX(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, w1, w2, wstride, worder, points) + return void + param target FfdTargetSGIX in value + param u1 CoordD in value + param u2 CoordD in value + param ustride Int32 in value + param uorder CheckedInt32 in value + param v1 CoordD in value + param v2 CoordD in value + param vstride Int32 in value + param vorder CheckedInt32 in value + param w1 CoordD in value + param w2 CoordD in value + param wstride Int32 in value + param worder CheckedInt32 in value + param points CoordD in array [COMPSIZE(target/ustride/uorder/vstride/vorder/wstride/worder)] + dlflags handcode + category SGIX_polynomial_ffd + version 1.0 + glxflags SGI ignore + glxropcode 2073 + extension + offset ? + +DeformationMap3fSGIX(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, w1, w2, wstride, worder, points) + return void + param target FfdTargetSGIX in value + param u1 CoordF in value + param u2 CoordF in value + param ustride Int32 in value + param uorder CheckedInt32 in value + param v1 CoordF in value + param v2 CoordF in value + param vstride Int32 in value + param vorder CheckedInt32 in value + param w1 CoordF in value + param w2 CoordF in value + param wstride Int32 in value + param worder CheckedInt32 in value + param points CoordF in array [COMPSIZE(target/ustride/uorder/vstride/vorder/wstride/worder)] + category SGIX_polynomial_ffd + dlflags handcode + version 1.0 + glxflags SGI ignore + glxropcode 2074 + extension + offset ? + +DeformSGIX(mask) + return void + param mask FfdMaskSGIX in value + category SGIX_polynomial_ffd + version 1.0 + glxflags SGI ignore + glxropcode 2075 + extension + offset ? + +LoadIdentityDeformationMapSGIX(mask) + return void + param mask FfdMaskSGIX in value + category SGIX_polynomial_ffd + version 1.0 + glxflags SGI ignore + glxropcode 2076 + extension + offset ? + +############################################################################### +# +# Extension #60 +# SGIX_reference_plane commands +# +############################################################################### + +ReferencePlaneSGIX(equation) + return void + param equation Float64 in array [4] + category SGIX_reference_plane + version 1.0 + glxflags SGI + glxropcode 2071 + extension + offset 468 + +############################################################################### +# +# Extension #61 +# SGIX_flush_raster commands +# +############################################################################### + +FlushRasterSGIX() + return void + category SGIX_flush_raster + version 1.0 + dlflags notlistable + glxflags SGI + glxvendorpriv 4105 + extension + offset 469 + +############################################################################### +# +# Extension #62 - GLX_SGIX_cushion +# +############################################################################### + +############################################################################### +# +# Extension #63 +# SGIX_depth_texture commands +# +############################################################################### + +# (none) +newcategory: SGIX_depth_texture + +############################################################################### +# +# Extension #64 +# SGIS_fog_function commands +# +############################################################################### + +FogFuncSGIS(n, points) + return void + param n SizeI in value + param points Float32 in array [n*2] + category SGIS_fog_function + version 1.1 + glxflags SGI + glxropcode 2067 + extension + offset + +# Need to insert GLX information +GetFogFuncSGIS(points) + return void + param points Float32 out array [COMPSIZE()] + category SGIS_fog_function + version 1.1 + dlflags notlistable + glxflags ignore + extension + offset + +############################################################################### +# +# Extension #65 +# SGIX_fog_offset commands +# +############################################################################### + +# (none) +newcategory: SGIX_fog_offset + +############################################################################### +# +# Extension #66 +# HP_image_transform commands +# +############################################################################### + +ImageTransformParameteriHP(target, pname, param) + return void + param target ImageTransformTargetHP in value + param pname ImageTransformPNameHP in value + param param Int32 in value + category HP_image_transform + version 1.1 + glxropcode ? + offset ? + +ImageTransformParameterfHP(target, pname, param) + return void + param target ImageTransformTargetHP in value + param pname ImageTransformPNameHP in value + param param Float32 in value + category HP_image_transform + version 1.1 + glxropcode ? + offset ? + +ImageTransformParameterivHP(target, pname, params) + return void + param target ImageTransformTargetHP in value + param pname ImageTransformPNameHP in value + param params Int32 in array [COMPSIZE(pname)] + category HP_image_transform + version 1.1 + glxropcode ? + offset ? + +ImageTransformParameterfvHP(target, pname, params) + return void + param target ImageTransformTargetHP in value + param pname ImageTransformPNameHP in value + param params Float32 in array [COMPSIZE(pname)] + category HP_image_transform + version 1.1 + glxropcode ? + offset ? + +GetImageTransformParameterivHP(target, pname, params) + return void + param target ImageTransformTargetHP in value + param pname ImageTransformPNameHP in value + param params Int32 out array [COMPSIZE(pname)] + dlflags notlistable + category HP_image_transform + version 1.1 + glxropcode ? + offset ? + +GetImageTransformParameterfvHP(target, pname, params) + return void + param target ImageTransformTargetHP in value + param pname ImageTransformPNameHP in value + param params Float32 out array [COMPSIZE(pname)] + category HP_image_transform + version 1.1 + glxropcode ? + offset ? + +############################################################################### +# +# Extension #67 +# HP_convolution_border_modes commands +# +############################################################################### + +# (none) +newcategory: HP_convolution_border_modes + +############################################################################### +# +# Extension #68 +# INGR_palette_buffer commands +# +############################################################################### + +#@ (Intergraph hasn't provided a spec) + +############################################################################### +# +# Extension #69 +# SGIX_texture_add_env commands +# +############################################################################### + +# (none) +newcategory: SGIX_texture_add_env + +############################################################################### +# +# Extension #70 - skipped +# Extension #71 - skipped +# Extension #72 - skipped +# Extension #73 - skipped +# +############################################################################### + +############################################################################### +# +# Extension #74 +# EXT_color_subtable commands +# +# This was probably never actually shipped as an EXT - just written up as a +# reference for OpenGL 1.2 ARB_imaging. +# +############################################################################### + +ColorSubTableEXT(target, start, count, format, type, data) + return void + param target ColorTableTarget in value + param start SizeI in value + param count SizeI in value + param format PixelFormat in value + param type PixelType in value + param data Void in array [COMPSIZE(format/type/count)] + category EXT_color_subtable + version 1.2 + alias ColorSubTable + +CopyColorSubTableEXT(target, start, x, y, width) + return void + param target ColorTableTarget in value + param start SizeI in value + param x WinCoord in value + param y WinCoord in value + param width SizeI in value + category EXT_color_subtable + version 1.2 + alias CopyColorSubTable + +############################################################################### +# +# Extension #75 - GLU_EXT_object_space_tess +# +############################################################################### + +############################################################################### +# +# Extension #76 +# PGI_vertex_hints commands +# +############################################################################### + +# (none) +newcategory: PGI_vertex_hints + +############################################################################### +# +# Extension #77 +# PGI_misc_hints commands +# +############################################################################### + +HintPGI(target, mode) + return void + param target HintTargetPGI in value + param mode Int32 in value + category PGI_misc_hints + version 1.1 + offset 544 + +############################################################################### +# +# Extension #78 +# EXT_paletted_texture commands +# +############################################################################### + +ColorTableEXT(target, internalFormat, width, format, type, table) + return void + param target ColorTableTarget in value + param internalFormat PixelInternalFormat in value + param width SizeI in value + param format PixelFormat in value + param type PixelType in value + param table Void in array [COMPSIZE(format/type/width)] + category EXT_paletted_texture + version 1.1 + alias ColorTable + +GetColorTableEXT(target, format, type, data) + return void + param target ColorTableTarget in value + param format PixelFormat in value + param type PixelType in value + param data Void out array [COMPSIZE(target/format/type)] + category EXT_paletted_texture + version 1.1 + offset 550 + +GetColorTableParameterivEXT(target, pname, params) + return void + param target ColorTableTarget in value + param pname GetColorTableParameterPName in value + param params Int32 out array [COMPSIZE(pname)] + category EXT_paletted_texture + version 1.1 + offset 551 + +GetColorTableParameterfvEXT(target, pname, params) + return void + param target ColorTableTarget in value + param pname GetColorTableParameterPName in value + param params Float32 out array [COMPSIZE(pname)] + category EXT_paletted_texture + version 1.1 + offset 552 + +############################################################################### +# +# Extension #79 +# EXT_clip_volume_hint commands +# +############################################################################### + +# (none) +newcategory: EXT_clip_volume_hint + +############################################################################### +# +# Extension #80 +# SGIX_list_priority commands +# +############################################################################### + +# @@@ Needs vendorpriv opcodes assigned +GetListParameterfvSGIX(list, pname, params) + return void + param list List in value + param pname ListParameterName in value + param params CheckedFloat32 out array [COMPSIZE(pname)] + dlflags notlistable + glxflags ignore + category SGIX_list_priority + version 1.0 + glxvendorpriv ? + extension + offset 470 + +# @@@ Needs vendorpriv opcodes assigned +GetListParameterivSGIX(list, pname, params) + return void + param list List in value + param pname ListParameterName in value + param params CheckedInt32 out array [COMPSIZE(pname)] + dlflags notlistable + glxflags ignore + category SGIX_list_priority + version 1.0 + glxvendorpriv ? + extension + offset 471 + +ListParameterfSGIX(list, pname, param) + return void + param list List in value + param pname ListParameterName in value + param param CheckedFloat32 in value + dlflags notlistable + glxflags ignore + category SGIX_list_priority + version 1.0 + glxropcode 2078 + extension + offset 472 + +ListParameterfvSGIX(list, pname, params) + return void + param list List in value + param pname ListParameterName in value + param params CheckedFloat32 in array [COMPSIZE(pname)] + dlflags notlistable + glxflags ignore + category SGIX_list_priority + version 1.0 + glxropcode 2079 + extension + offset 473 + +ListParameteriSGIX(list, pname, param) + return void + param list List in value + param pname ListParameterName in value + param param CheckedInt32 in value + dlflags notlistable + glxflags ignore + category SGIX_list_priority + version 1.0 + glxropcode 2080 + extension + offset 474 + +ListParameterivSGIX(list, pname, params) + return void + param list List in value + param pname ListParameterName in value + param params CheckedInt32 in array [COMPSIZE(pname)] + dlflags notlistable + glxflags ignore + category SGIX_list_priority + version 1.0 + glxropcode 2081 + extension + offset 475 + +############################################################################### +# +# Extension #81 +# SGIX_ir_instrument1 commands +# +############################################################################### + +# (none) +newcategory: SGIX_ir_instrument1 + +############################################################################### +# +# Extension #82 +# SGIX_calligraphic_fragment commands +# +############################################################################### + +# (none) +newcategory: SGIX_calligraphic_fragment + +############################################################################### +# +# Extension #83 - GLX_SGIX_video_resize +# +############################################################################### + +############################################################################### +# +# Extension #84 +# SGIX_texture_lod_bias commands +# +############################################################################### + +# (none) +newcategory: SGIX_texture_lod_bias + +############################################################################### +# +# Extension #85 - skipped +# Extension #86 - GLX_SGIX_dmbuffer +# Extension #87 - skipped +# Extension #88 - skipped +# Extension #89 - skipped +# +############################################################################### + +############################################################################### +# +# Extension #90 +# SGIX_shadow_ambient commands +# +############################################################################### + +# (none) +newcategory: SGIX_shadow_ambient + +############################################################################### +# +# Extension #91 - GLX_SGIX_swap_group +# Extension #92 - GLX_SGIX_swap_barrier +# +############################################################################### + +############################################################################### +# +# Extension #93 +# EXT_index_texture commands +# +############################################################################### + +# (none) +newcategory: EXT_index_texture + +############################################################################### +# +# Extension #94 +# EXT_index_material commands +# +############################################################################### + +IndexMaterialEXT(face, mode) + return void + param face MaterialFace in value + param mode IndexMaterialParameterEXT in value + category EXT_index_material + version 1.1 + extension soft + glxflags ignore + offset 538 + +############################################################################### +# +# Extension #95 +# EXT_index_func commands +# +############################################################################### + +IndexFuncEXT(func, ref) + return void + param func IndexFunctionEXT in value + param ref ClampedFloat32 in value + category EXT_index_func + version 1.1 + extension soft + glxflags ignore + offset 539 + +############################################################################### +# +# Extension #96 +# EXT_index_array_formats commands +# +############################################################################### + +# (none) +newcategory: EXT_index_array_formats + +############################################################################### +# +# Extension #97 +# EXT_compiled_vertex_array commands +# +############################################################################### + +LockArraysEXT(first, count) + return void + param first Int32 in value + param count SizeI in value + category EXT_compiled_vertex_array + version 1.1 + dlflags notlistable + extension soft + glxflags ignore + offset 540 + +UnlockArraysEXT() + return void + category EXT_compiled_vertex_array + version 1.1 + dlflags notlistable + extension soft + glxflags ignore + offset 541 + +############################################################################### +# +# Extension #98 +# EXT_cull_vertex commands +# +############################################################################### + +CullParameterdvEXT(pname, params) + return void + param pname CullParameterEXT in value + param params Float64 out array [4] + category EXT_cull_vertex + version 1.1 + dlflags notlistable + extension soft + glxflags ignore + offset 542 + +CullParameterfvEXT(pname, params) + return void + param pname CullParameterEXT in value + param params Float32 out array [4] + category EXT_cull_vertex + version 1.1 + dlflags notlistable + extension soft + glxflags ignore + offset 543 + +############################################################################### +# +# Extension #99 - skipped +# Extension #100 - GLU_EXT_nurbs_tessellator +# +############################################################################### + +############################################################################### +# +# Extension #101 +# SGIX_ycrcb commands +# +############################################################################### + +# (none) +newcategory: SGIX_ycrcb + +############################################################################### +# +# Extension #102 +# SGIX_fragment_lighting commands +# +############################################################################### + +FragmentColorMaterialSGIX(face, mode) + return void + param face MaterialFace in value + param mode MaterialParameter in value + category SGIX_fragment_lighting + glxflags ignore + version 1.0 + extension + offset 476 + +FragmentLightfSGIX(light, pname, param) + return void + param light FragmentLightNameSGIX in value + param pname FragmentLightParameterSGIX in value + param param CheckedFloat32 in value + category SGIX_fragment_lighting + glxflags ignore + version 1.0 + extension + offset 477 + +FragmentLightfvSGIX(light, pname, params) + return void + param light FragmentLightNameSGIX in value + param pname FragmentLightParameterSGIX in value + param params CheckedFloat32 in array [COMPSIZE(pname)] + category SGIX_fragment_lighting + glxflags ignore + version 1.0 + extension + offset 478 + +FragmentLightiSGIX(light, pname, param) + return void + param light FragmentLightNameSGIX in value + param pname FragmentLightParameterSGIX in value + param param CheckedInt32 in value + category SGIX_fragment_lighting + glxflags ignore + version 1.0 + extension + offset 479 + +FragmentLightivSGIX(light, pname, params) + return void + param light FragmentLightNameSGIX in value + param pname FragmentLightParameterSGIX in value + param params CheckedInt32 in array [COMPSIZE(pname)] + category SGIX_fragment_lighting + glxflags ignore + version 1.0 + extension + offset 480 + +FragmentLightModelfSGIX(pname, param) + return void + param pname FragmentLightModelParameterSGIX in value + param param CheckedFloat32 in value + category SGIX_fragment_lighting + glxflags ignore + version 1.0 + extension + offset 481 + +FragmentLightModelfvSGIX(pname, params) + return void + param pname FragmentLightModelParameterSGIX in value + param params CheckedFloat32 in array [COMPSIZE(pname)] + category SGIX_fragment_lighting + glxflags ignore + version 1.0 + extension + offset 482 + +FragmentLightModeliSGIX(pname, param) + return void + param pname FragmentLightModelParameterSGIX in value + param param CheckedInt32 in value + category SGIX_fragment_lighting + glxflags ignore + version 1.0 + extension + offset 483 + +FragmentLightModelivSGIX(pname, params) + return void + param pname FragmentLightModelParameterSGIX in value + param params CheckedInt32 in array [COMPSIZE(pname)] + category SGIX_fragment_lighting + glxflags ignore + version 1.0 + extension + offset 484 + +FragmentMaterialfSGIX(face, pname, param) + return void + param face MaterialFace in value + param pname MaterialParameter in value + param param CheckedFloat32 in value + category SGIX_fragment_lighting + glxflags ignore + version 1.0 + extension + offset 485 + +FragmentMaterialfvSGIX(face, pname, params) + return void + param face MaterialFace in value + param pname MaterialParameter in value + param params CheckedFloat32 in array [COMPSIZE(pname)] + category SGIX_fragment_lighting + glxflags ignore + version 1.0 + extension + offset 486 + +FragmentMaterialiSGIX(face, pname, param) + return void + param face MaterialFace in value + param pname MaterialParameter in value + param param CheckedInt32 in value + category SGIX_fragment_lighting + glxflags ignore + version 1.0 + extension + offset 487 + +FragmentMaterialivSGIX(face, pname, params) + return void + param face MaterialFace in value + param pname MaterialParameter in value + param params CheckedInt32 in array [COMPSIZE(pname)] + category SGIX_fragment_lighting + glxflags ignore + version 1.0 + extension + offset 488 + +GetFragmentLightfvSGIX(light, pname, params) + return void + param light FragmentLightNameSGIX in value + param pname FragmentLightParameterSGIX in value + param params Float32 out array [COMPSIZE(pname)] + category SGIX_fragment_lighting + dlflags notlistable + glxflags ignore + version 1.0 + extension + offset 489 + +GetFragmentLightivSGIX(light, pname, params) + return void + param light FragmentLightNameSGIX in value + param pname FragmentLightParameterSGIX in value + param params Int32 out array [COMPSIZE(pname)] + category SGIX_fragment_lighting + dlflags notlistable + glxflags ignore + version 1.0 + extension + offset 490 + +GetFragmentMaterialfvSGIX(face, pname, params) + return void + param face MaterialFace in value + param pname MaterialParameter in value + param params Float32 out array [COMPSIZE(pname)] + category SGIX_fragment_lighting + dlflags notlistable + glxflags ignore + version 1.0 + extension + offset 491 + +GetFragmentMaterialivSGIX(face, pname, params) + return void + param face MaterialFace in value + param pname MaterialParameter in value + param params Int32 out array [COMPSIZE(pname)] + category SGIX_fragment_lighting + dlflags notlistable + glxflags ignore + version 1.0 + extension + offset 492 + +LightEnviSGIX(pname, param) + return void + param pname LightEnvParameterSGIX in value + param param CheckedInt32 in value + category SGIX_fragment_lighting + glxflags ignore + version 1.0 + extension + offset 493 + +############################################################################### +# +# Extension #103 - skipped +# Extension #104 - skipped +# Extension #105 - skipped +# Extension #106 - skipped +# Extension #107 - skipped +# Extension #108 - skipped +# Extension #109 - skipped +# +############################################################################### + +############################################################################### +# +# Extension #110 +# IBM_rasterpos_clip commands +# +############################################################################### + +# (none) +newcategory: IBM_rasterpos_clip + +############################################################################### +# +# Extension #111 +# HP_texture_lighting commands +# +############################################################################### + +# (none) +newcategory: HP_texture_lighting + +############################################################################### +# +# Extension #112 +# EXT_draw_range_elements commands +# +############################################################################### + +# Spec entries to be written +DrawRangeElementsEXT(mode, start, end, count, type, indices) + return void + param mode BeginMode in value + param start UInt32 in value + param end UInt32 in value + param count SizeI in value + param type DrawElementsType in value + param indices Void in array [COMPSIZE(count/type)] + category EXT_draw_range_elements + dlflags handcode + glxflags client-handcode client-intercept server-handcode + version 1.1 + alias DrawRangeElements + +############################################################################### +# +# Extension #113 +# WIN_phong_shading commands +# +############################################################################### + +# (none) +newcategory: WIN_phong_shading + +############################################################################### +# +# Extension #114 +# WIN_specular_fog commands +# +############################################################################### + +# (none) +newcategory: WIN_specular_fog + +############################################################################### +# +# Extension #115 - skipped +# Extension #116 - skipped +# +############################################################################### + +############################################################################### +# +# Extension #117 +# EXT_light_texture commands +# +############################################################################### + +# Spec entries to be written +ApplyTextureEXT(mode) + return void + param mode LightTextureModeEXT in value + category EXT_light_texture + version 1.1 + glxropcode ? + offset ? + +TextureLightEXT(pname) + return void + param pname LightTexturePNameEXT in value + category EXT_light_texture + version 1.1 + glxropcode ? + offset ? + +TextureMaterialEXT(face, mode) + return void + param face MaterialFace in value + param mode MaterialParameter in value + category EXT_light_texture + version 1.1 + glxropcode ? + offset ? + +############################################################################### +# +# Extension #118 - skipped +# +############################################################################### + +############################################################################### +# +# Extension #119 +# SGIX_blend_alpha_minmax commands +# +############################################################################### + +# (none) +newcategory: SGIX_blend_alpha_minmax + +############################################################################### +# +# Extension #120 - skipped +# Extension #121 - skipped +# Extension #122 - skipped +# Extension #123 - skipped +# Extension #124 - skipped +# Extension #125 - skipped +# Extension #126 - skipped +# Extension #127 - skipped +# Extension #128 - skipped +# +############################################################################### + +############################################################################### +# +# Extension #129 +# EXT_bgra commands +# +############################################################################### + +# (none) +newcategory: EXT_bgra + +############################################################################### +# +# Extension #130 - skipped +# Extension #131 - skipped +# +############################################################################### + +############################################################################### +# +# Extension #132 +# SGIX_async commands +# +############################################################################### + +AsyncMarkerSGIX(marker) + return void + param marker UInt32 in value + category SGIX_async + version 1.0 + glxflags ignore + extension + offset ? + +FinishAsyncSGIX(markerp) + return Int32 + param markerp UInt32 out array [1] + category SGIX_async + version 1.0 + dlflags notlistable + glxflags ignore + extension + offset ? + +PollAsyncSGIX(markerp) + return Int32 + param markerp UInt32 out array [1] + category SGIX_async + version 1.0 + dlflags notlistable + glxflags ignore + extension + offset ? + +GenAsyncMarkersSGIX(range) + return UInt32 + param range SizeI in value + category SGIX_async + version 1.0 + dlflags notlistable + glxflags ignore + extension + offset ? + +DeleteAsyncMarkersSGIX(marker, range) + return void + param marker UInt32 in value + param range SizeI in value + category SGIX_async + version 1.0 + dlflags notlistable + glxflags ignore + extension + offset ? + +IsAsyncMarkerSGIX(marker) + return Boolean + param marker UInt32 in value + category SGIX_async + version 1.0 + dlflags notlistable + glxflags ignore + extension + offset ? + +############################################################################### +# +# Extension #133 +# SGIX_async_pixel commands +# +############################################################################### + +# (none) +newcategory: SGIX_async_pixel + +############################################################################### +# +# Extension #134 +# SGIX_async_histogram commands +# +############################################################################### + +# (none) +newcategory: SGIX_async_histogram + +############################################################################### +# +# Extension #135 - skipped (INTEL_texture_scissor was never implemented) +# +############################################################################### + +############################################################################### +# +# Extension #136 +# INTEL_parallel_arrays commands +# +############################################################################### + +VertexPointervINTEL(size, type, pointer) + return void + param size Int32 in value + param type VertexPointerType in value + param pointer VoidPointer in array [4] retained + category INTEL_parallel_arrays + dlflags notlistable + glxflags client-handcode server-handcode EXT + version 1.1 + offset ? + +NormalPointervINTEL(type, pointer) + return void + param type NormalPointerType in value + param pointer VoidPointer in array [4] retained + category INTEL_parallel_arrays + dlflags notlistable + glxflags client-handcode server-handcode EXT + version 1.1 + offset ? + +ColorPointervINTEL(size, type, pointer) + return void + param size Int32 in value + param type VertexPointerType in value + param pointer VoidPointer in array [4] retained + category INTEL_parallel_arrays + dlflags notlistable + glxflags client-handcode server-handcode EXT + version 1.1 + offset ? + +TexCoordPointervINTEL(size, type, pointer) + return void + param size Int32 in value + param type VertexPointerType in value + param pointer VoidPointer in array [4] retained + category INTEL_parallel_arrays + dlflags notlistable + glxflags client-handcode server-handcode EXT + version 1.1 + offset ? + + +############################################################################### +# +# Extension #137 +# HP_occlusion_test commands +# +############################################################################### + +# (none) +newcategory: HP_occlusion_test + +############################################################################### +# +# Extension #138 +# EXT_pixel_transform commands +# +############################################################################### + +PixelTransformParameteriEXT(target, pname, param) + return void + param target PixelTransformTargetEXT in value + param pname PixelTransformPNameEXT in value + param param Int32 in value + category EXT_pixel_transform + version 1.1 + glxropcode ? + offset ? + +PixelTransformParameterfEXT(target, pname, param) + return void + param target PixelTransformTargetEXT in value + param pname PixelTransformPNameEXT in value + param param Float32 in value + category EXT_pixel_transform + version 1.1 + glxropcode ? + offset ? + +PixelTransformParameterivEXT(target, pname, params) + return void + param target PixelTransformTargetEXT in value + param pname PixelTransformPNameEXT in value + param params Int32 in array [1] + category EXT_pixel_transform + version 1.1 + glxropcode ? + offset ? + +PixelTransformParameterfvEXT(target, pname, params) + return void + param target PixelTransformTargetEXT in value + param pname PixelTransformPNameEXT in value + param params Float32 in array [1] + category EXT_pixel_transform + version 1.1 + glxropcode ? + offset ? + +############################################################################### +# +# Extension #139 +# EXT_pixel_transform_color_table commands +# +############################################################################### + +# (none) +newcategory: EXT_pixel_transform_color_table + +############################################################################### +# +# Extension #140 - skipped +# +############################################################################### + +############################################################################### +# +# Extension #141 +# EXT_shared_texture_palette commands +# +############################################################################### + +# (none) +newcategory: EXT_shared_texture_palette + +############################################################################### +# +# Extension #142 - GLX_SGIS_blended_overlay +# Extension #143 - GLX_SGIS_shared_multisample +# +############################################################################### + +############################################################################### +# +# Extension #144 +# EXT_separate_specular_color commands +# +############################################################################### + +# (none) +newcategory: EXT_separate_specular_color + +############################################################################### +# +# Extension #145 +# EXT_secondary_color commands +# +############################################################################### + +SecondaryColor3bEXT(red, green, blue) + return void + param red ColorB in value + param green ColorB in value + param blue ColorB in value + category EXT_secondary_color + vectorequiv SecondaryColor3bvEXT + version 1.1 + alias SecondaryColor3b + +SecondaryColor3bvEXT(v) + return void + param v ColorB in array [3] + category EXT_secondary_color + version 1.1 + glxropcode 4126 + alias SecondaryColor3bv + +SecondaryColor3dEXT(red, green, blue) + return void + param red ColorD in value + param green ColorD in value + param blue ColorD in value + category EXT_secondary_color + vectorequiv SecondaryColor3dvEXT + version 1.1 + alias SecondaryColor3d + +SecondaryColor3dvEXT(v) + return void + param v ColorD in array [3] + category EXT_secondary_color + version 1.1 + glxropcode 4130 + alias SecondaryColor3dv + +SecondaryColor3fEXT(red, green, blue) + return void + param red ColorF in value + param green ColorF in value + param blue ColorF in value + category EXT_secondary_color + vectorequiv SecondaryColor3fvEXT + version 1.1 + alias SecondaryColor3f + +SecondaryColor3fvEXT(v) + return void + param v ColorF in array [3] + category EXT_secondary_color + version 1.1 + glxropcode 4129 + alias SecondaryColor3fv + +SecondaryColor3iEXT(red, green, blue) + return void + param red ColorI in value + param green ColorI in value + param blue ColorI in value + category EXT_secondary_color + vectorequiv SecondaryColor3ivEXT + version 1.1 + alias SecondaryColor3i + +SecondaryColor3ivEXT(v) + return void + param v ColorI in array [3] + category EXT_secondary_color + version 1.1 + glxropcode 4128 + offset 568 + alias SecondaryColor3iv + +SecondaryColor3sEXT(red, green, blue) + return void + param red ColorS in value + param green ColorS in value + param blue ColorS in value + category EXT_secondary_color + vectorequiv SecondaryColor3svEXT + version 1.1 + alias SecondaryColor3s + +SecondaryColor3svEXT(v) + return void + param v ColorS in array [3] + category EXT_secondary_color + version 1.1 + glxropcode 4127 + alias SecondaryColor3sv + +SecondaryColor3ubEXT(red, green, blue) + return void + param red ColorUB in value + param green ColorUB in value + param blue ColorUB in value + category EXT_secondary_color + vectorequiv SecondaryColor3ubvEXT + version 1.1 + alias SecondaryColor3ub + +SecondaryColor3ubvEXT(v) + return void + param v ColorUB in array [3] + category EXT_secondary_color + version 1.1 + glxropcode 4131 + alias SecondaryColor3ubv + +SecondaryColor3uiEXT(red, green, blue) + return void + param red ColorUI in value + param green ColorUI in value + param blue ColorUI in value + category EXT_secondary_color + vectorequiv SecondaryColor3uivEXT + version 1.1 + alias SecondaryColor3ui + +SecondaryColor3uivEXT(v) + return void + param v ColorUI in array [3] + category EXT_secondary_color + version 1.1 + glxropcode 4133 + alias SecondaryColor3uiv + +SecondaryColor3usEXT(red, green, blue) + return void + param red ColorUS in value + param green ColorUS in value + param blue ColorUS in value + category EXT_secondary_color + vectorequiv SecondaryColor3usvEXT + version 1.1 + alias SecondaryColor3us + +SecondaryColor3usvEXT(v) + return void + param v ColorUS in array [3] + category EXT_secondary_color + version 1.1 + glxropcode 4132 + alias SecondaryColor3usv + +SecondaryColorPointerEXT(size, type, stride, pointer) + return void + param size Int32 in value + param type ColorPointerType in value + param stride SizeI in value + param pointer Void in array [COMPSIZE(size/type/stride)] retained + category EXT_secondary_color + dlflags notlistable + glxflags client-handcode server-handcode EXT + version 1.1 + extension + alias SecondaryColorPointer + +############################################################################### +# +# Extension #146 +# EXT_texture_env commands +# +############################################################################### + +# Dead extension - never implemented (removed from registry!) +# (none) +# newcategory: EXT_texture_env + +############################################################################### +# +# Extension #147 +# EXT_texture_perturb_normal commands +# +############################################################################### + +TextureNormalEXT(mode) + return void + param mode TextureNormalModeEXT in value + category EXT_texture_perturb_normal + version 1.1 + glxropcode ? + offset ? + +############################################################################### +# +# Extension #148 +# EXT_multi_draw_arrays commands +# +############################################################################### + +# first and count are really 'in' +MultiDrawArraysEXT(mode, first, count, primcount) + return void + param mode BeginMode in value + param first Int32 in array [COMPSIZE(primcount)] + param count SizeI in array [COMPSIZE(primcount)] + param primcount SizeI in value + category EXT_multi_draw_arrays + version 1.1 + glxropcode ? + alias MultiDrawArrays + +MultiDrawElementsEXT(mode, count, type, indices, primcount) + return void + param mode BeginMode in value + param count SizeI in array [COMPSIZE(primcount)] + param type DrawElementsType in value + param indices VoidPointer in array [COMPSIZE(primcount)] + param primcount SizeI in value + category EXT_multi_draw_arrays + version 1.1 + glxropcode ? + alias MultiDrawElements + +############################################################################### +# +# Extension #149 +# EXT_fog_coord commands +# +############################################################################### + +FogCoordfEXT(coord) + return void + param coord CoordF in value + category EXT_fog_coord + vectorequiv FogCoordfvEXT + version 1.1 + alias FogCoordf + +FogCoordfvEXT(coord) + return void + param coord CoordF in array [1] + category EXT_fog_coord + version 1.1 + glxropcode 4124 + alias FogCoordfv + +FogCoorddEXT(coord) + return void + param coord CoordD in value + category EXT_fog_coord + vectorequiv FogCoorddvEXT + version 1.1 + alias FogCoordd + +FogCoorddvEXT(coord) + return void + param coord CoordD in array [1] + category EXT_fog_coord + version 1.1 + glxropcode 4125 + alias FogCoorddv + +FogCoordPointerEXT(type, stride, pointer) + return void + param type FogPointerTypeEXT in value + param stride SizeI in value + param pointer Void in array [COMPSIZE(type/stride)] retained + category EXT_fog_coord + dlflags notlistable + version 1.1 + glxflags client-handcode server-handcode EXT + alias FogCoordPointer + +############################################################################### +# +# Extension #150 - skipped +# Extension #151 - skipped +# Extension #152 - skipped +# Extension #153 - skipped +# Extension #154 - skipped +# +############################################################################### + +############################################################################### +# +# Extension #155 +# REND_screen_coordinates commands +# +############################################################################### + +# (none) +newcategory: REND_screen_coordinates + +############################################################################### +# +# Extension #156 +# EXT_coordinate_frame commands +# +############################################################################### + +Tangent3bEXT(tx, ty, tz) + return void + param tx Int8 in value + param ty Int8 in value + param tz Int8 in value + category EXT_coordinate_frame + vectorequiv Tangent3bvEXT + version 1.1 + offset ? + +Tangent3bvEXT(v) + return void + param v Int8 in array [3] + category EXT_coordinate_frame + version 1.1 + glxropcode ? + offset ? + +Tangent3dEXT(tx, ty, tz) + return void + param tx CoordD in value + param ty CoordD in value + param tz CoordD in value + category EXT_coordinate_frame + vectorequiv Tangent3dvEXT + version 1.1 + offset ? + +Tangent3dvEXT(v) + return void + param v CoordD in array [3] + category EXT_coordinate_frame + version 1.1 + glxropcode ? + offset ? + +Tangent3fEXT(tx, ty, tz) + return void + param tx CoordF in value + param ty CoordF in value + param tz CoordF in value + category EXT_coordinate_frame + vectorequiv Tangent3fvEXT + version 1.1 + offset ? + +Tangent3fvEXT(v) + return void + param v CoordF in array [3] + category EXT_coordinate_frame + version 1.1 + glxropcode ? + offset ? + +Tangent3iEXT(tx, ty, tz) + return void + param tx Int32 in value + param ty Int32 in value + param tz Int32 in value + category EXT_coordinate_frame + vectorequiv Tangent3ivEXT + version 1.1 + offset ? + +Tangent3ivEXT(v) + return void + param v Int32 in array [3] + category EXT_coordinate_frame + version 1.1 + glxropcode ? + offset ? + +Tangent3sEXT(tx, ty, tz) + return void + param tx Int16 in value + param ty Int16 in value + param tz Int16 in value + category EXT_coordinate_frame + vectorequiv Tangent3svEXT + version 1.1 + offset ? + +Tangent3svEXT(v) + return void + param v Int16 in array [3] + category EXT_coordinate_frame + version 1.1 + glxropcode ? + offset ? + +Binormal3bEXT(bx, by, bz) + return void + param bx Int8 in value + param by Int8 in value + param bz Int8 in value + category EXT_coordinate_frame + vectorequiv Binormal3bvEXT + version 1.1 + offset ? + +Binormal3bvEXT(v) + return void + param v Int8 in array [3] + category EXT_coordinate_frame + version 1.1 + glxropcode ? + offset ? + +Binormal3dEXT(bx, by, bz) + return void + param bx CoordD in value + param by CoordD in value + param bz CoordD in value + category EXT_coordinate_frame + vectorequiv Binormal3dvEXT + version 1.1 + offset ? + +Binormal3dvEXT(v) + return void + param v CoordD in array [3] + category EXT_coordinate_frame + version 1.1 + glxropcode ? + offset ? + +Binormal3fEXT(bx, by, bz) + return void + param bx CoordF in value + param by CoordF in value + param bz CoordF in value + category EXT_coordinate_frame + vectorequiv Binormal3fvEXT + version 1.1 + offset ? + +Binormal3fvEXT(v) + return void + param v CoordF in array [3] + category EXT_coordinate_frame + version 1.1 + glxropcode ? + offset ? + +Binormal3iEXT(bx, by, bz) + return void + param bx Int32 in value + param by Int32 in value + param bz Int32 in value + category EXT_coordinate_frame + vectorequiv Binormal3ivEXT + version 1.1 + offset ? + +Binormal3ivEXT(v) + return void + param v Int32 in array [3] + category EXT_coordinate_frame + version 1.1 + glxropcode ? + offset ? + +Binormal3sEXT(bx, by, bz) + return void + param bx Int16 in value + param by Int16 in value + param bz Int16 in value + category EXT_coordinate_frame + vectorequiv Binormal3svEXT + version 1.1 + offset ? + +Binormal3svEXT(v) + return void + param v Int16 in array [3] + category EXT_coordinate_frame + version 1.1 + glxropcode ? + offset ? + +TangentPointerEXT(type, stride, pointer) + return void + param type TangentPointerTypeEXT in value + param stride SizeI in value + param pointer Void in array [COMPSIZE(type/stride)] retained + category EXT_coordinate_frame + dlflags notlistable + glxflags client-handcode client-intercept server-handcode + version 1.1 + offset ? + +BinormalPointerEXT(type, stride, pointer) + return void + param type BinormalPointerTypeEXT in value + param stride SizeI in value + param pointer Void in array [COMPSIZE(type/stride)] retained + category EXT_coordinate_frame + dlflags notlistable + glxflags client-handcode client-intercept server-handcode + version 1.1 + offset ? + +############################################################################### +# +# Extension #157 - skipped +# +############################################################################### + +############################################################################### +# +# Extension #158 +# EXT_texture_env_combine commands +# +############################################################################### + +# (none) +newcategory: EXT_texture_env_combine + +############################################################################### +# +# Extension #159 +# APPLE_specular_vector commands +# +############################################################################### + +# (none) +newcategory: APPLE_specular_vector + +############################################################################### +# +# Extension #160 +# APPLE_transform_hint commands +# +############################################################################### + +# (none) +newcategory: APPLE_transform_hint + +############################################################################### +# +# Extension #161 +# SGIX_fog_scale commands +# +############################################################################### + +# (none) +newcategory: SGIX_fog_scale + +############################################################################### +# +# Extension #162 - skipped +# +############################################################################### + +############################################################################### +# +# Extension #163 +# SUNX_constant_data commands +# +############################################################################### + +FinishTextureSUNX() + return void + category SUNX_constant_data + version 1.1 + glxropcode ? + offset ? + +############################################################################### +# +# Extension #164 +# SUN_global_alpha commands +# +############################################################################### + +GlobalAlphaFactorbSUN(factor) + return void + param factor Int8 in value + category SUN_global_alpha + version 1.1 + glxropcode ? + offset ? + +GlobalAlphaFactorsSUN(factor) + return void + param factor Int16 in value + category SUN_global_alpha + version 1.1 + glxropcode ? + offset ? + +GlobalAlphaFactoriSUN(factor) + return void + param factor Int32 in value + category SUN_global_alpha + version 1.1 + glxropcode ? + offset ? + +GlobalAlphaFactorfSUN(factor) + return void + param factor Float32 in value + category SUN_global_alpha + version 1.1 + glxropcode ? + offset ? + +GlobalAlphaFactordSUN(factor) + return void + param factor Float64 in value + category SUN_global_alpha + version 1.1 + glxropcode ? + offset ? + +GlobalAlphaFactorubSUN(factor) + return void + param factor UInt8 in value + category SUN_global_alpha + version 1.1 + glxropcode ? + offset ? + +GlobalAlphaFactorusSUN(factor) + return void + param factor UInt16 in value + category SUN_global_alpha + version 1.1 + glxropcode ? + offset ? + +GlobalAlphaFactoruiSUN(factor) + return void + param factor UInt32 in value + category SUN_global_alpha + version 1.1 + glxropcode ? + offset ? + +############################################################################### +# +# Extension #165 +# SUN_triangle_list commands +# +############################################################################### + +ReplacementCodeuiSUN(code) + return void + param code UInt32 in value + category SUN_triangle_list + version 1.1 + glxropcode ? + offset ? + +ReplacementCodeusSUN(code) + return void + param code UInt16 in value + category SUN_triangle_list + version 1.1 + glxropcode ? + offset ? + +ReplacementCodeubSUN(code) + return void + param code UInt8 in value + category SUN_triangle_list + version 1.1 + glxropcode ? + offset ? + +ReplacementCodeuivSUN(code) + return void + param code UInt32 in array [COMPSIZE()] + category SUN_triangle_list + version 1.1 + glxropcode ? + offset ? + +ReplacementCodeusvSUN(code) + return void + param code UInt16 in array [COMPSIZE()] + category SUN_triangle_list + version 1.1 + glxropcode ? + offset ? + +ReplacementCodeubvSUN(code) + return void + param code UInt8 in array [COMPSIZE()] + category SUN_triangle_list + version 1.1 + glxropcode ? + offset ? + +ReplacementCodePointerSUN(type, stride, pointer) + return void + param type ReplacementCodeTypeSUN in value + param stride SizeI in value + param pointer VoidPointer in array [COMPSIZE(type/stride)] retained + category SUN_triangle_list + version 1.1 + glxropcode ? + offset ? + +############################################################################### +# +# Extension #166 +# SUN_vertex commands +# +############################################################################### + +Color4ubVertex2fSUN(r, g, b, a, x, y) + return void + param r UInt8 in value + param g UInt8 in value + param b UInt8 in value + param a UInt8 in value + param x Float32 in value + param y Float32 in value + category SUN_vertex + version 1.1 + glxropcode ? + offset ? + +Color4ubVertex2fvSUN(c, v) + return void + param c UInt8 in array [4] + param v Float32 in array [2] + category SUN_vertex + version 1.1 + glxropcode ? + offset ? + +Color4ubVertex3fSUN(r, g, b, a, x, y, z) + return void + param r UInt8 in value + param g UInt8 in value + param b UInt8 in value + param a UInt8 in value + param x Float32 in value + param y Float32 in value + param z Float32 in value + category SUN_vertex + version 1.1 + glxropcode ? + offset ? + +Color4ubVertex3fvSUN(c, v) + return void + param c UInt8 in array [4] + param v Float32 in array [3] + category SUN_vertex + version 1.1 + glxropcode ? + offset ? + +Color3fVertex3fSUN(r, g, b, x, y, z) + return void + param r Float32 in value + param g Float32 in value + param b Float32 in value + param x Float32 in value + param y Float32 in value + param z Float32 in value + category SUN_vertex + version 1.1 + glxropcode ? + offset ? + +Color3fVertex3fvSUN(c, v) + return void + param c Float32 in array [3] + param v Float32 in array [3] + category SUN_vertex + version 1.1 + glxropcode ? + offset ? + +Normal3fVertex3fSUN(nx, ny, nz, x, y, z) + return void + param nx Float32 in value + param ny Float32 in value + param nz Float32 in value + param x Float32 in value + param y Float32 in value + param z Float32 in value + category SUN_vertex + version 1.1 + glxropcode ? + offset ? + +Normal3fVertex3fvSUN(n, v) + return void + param n Float32 in array [3] + param v Float32 in array [3] + category SUN_vertex + version 1.1 + glxropcode ? + offset ? + +Color4fNormal3fVertex3fSUN(r, g, b, a, nx, ny, nz, x, y, z) + return void + param r Float32 in value + param g Float32 in value + param b Float32 in value + param a Float32 in value + param nx Float32 in value + param ny Float32 in value + param nz Float32 in value + param x Float32 in value + param y Float32 in value + param z Float32 in value + category SUN_vertex + version 1.1 + glxropcode ? + offset ? + +Color4fNormal3fVertex3fvSUN(c, n, v) + return void + param c Float32 in array [4] + param n Float32 in array [3] + param v Float32 in array [3] + category SUN_vertex + version 1.1 + glxropcode ? + offset ? + +TexCoord2fVertex3fSUN(s, t, x, y, z) + return void + param s Float32 in value + param t Float32 in value + param x Float32 in value + param y Float32 in value + param z Float32 in value + category SUN_vertex + version 1.1 + glxropcode ? + offset ? + +TexCoord2fVertex3fvSUN(tc, v) + return void + param tc Float32 in array [2] + param v Float32 in array [3] + category SUN_vertex + version 1.1 + glxropcode ? + offset ? + +TexCoord4fVertex4fSUN(s, t, p, q, x, y, z, w) + return void + param s Float32 in value + param t Float32 in value + param p Float32 in value + param q Float32 in value + param x Float32 in value + param y Float32 in value + param z Float32 in value + param w Float32 in value + category SUN_vertex + version 1.1 + glxropcode ? + offset ? + +TexCoord4fVertex4fvSUN(tc, v) + return void + param tc Float32 in array [4] + param v Float32 in array [4] + category SUN_vertex + version 1.1 + glxropcode ? + offset ? + +TexCoord2fColor4ubVertex3fSUN(s, t, r, g, b, a, x, y, z) + return void + param s Float32 in value + param t Float32 in value + param r UInt8 in value + param g UInt8 in value + param b UInt8 in value + param a UInt8 in value + param x Float32 in value + param y Float32 in value + param z Float32 in value + category SUN_vertex + version 1.1 + glxropcode ? + offset ? + +TexCoord2fColor4ubVertex3fvSUN(tc, c, v) + return void + param tc Float32 in array [2] + param c UInt8 in array [4] + param v Float32 in array [3] + category SUN_vertex + version 1.1 + glxropcode ? + offset ? + +TexCoord2fColor3fVertex3fSUN(s, t, r, g, b, x, y, z) + return void + param s Float32 in value + param t Float32 in value + param r Float32 in value + param g Float32 in value + param b Float32 in value + param x Float32 in value + param y Float32 in value + param z Float32 in value + category SUN_vertex + version 1.1 + glxropcode ? + offset ? + +TexCoord2fColor3fVertex3fvSUN(tc, c, v) + return void + param tc Float32 in array [2] + param c Float32 in array [3] + param v Float32 in array [3] + category SUN_vertex + version 1.1 + glxropcode ? + offset ? + +TexCoord2fNormal3fVertex3fSUN(s, t, nx, ny, nz, x, y, z) + return void + param s Float32 in value + param t Float32 in value + param nx Float32 in value + param ny Float32 in value + param nz Float32 in value + param x Float32 in value + param y Float32 in value + param z Float32 in value + category SUN_vertex + version 1.1 + glxropcode ? + offset ? + +TexCoord2fNormal3fVertex3fvSUN(tc, n, v) + return void + param tc Float32 in array [2] + param n Float32 in array [3] + param v Float32 in array [3] + category SUN_vertex + version 1.1 + glxropcode ? + offset ? + +TexCoord2fColor4fNormal3fVertex3fSUN(s, t, r, g, b, a, nx, ny, nz, x, y, z) + return void + param s Float32 in value + param t Float32 in value + param r Float32 in value + param g Float32 in value + param b Float32 in value + param a Float32 in value + param nx Float32 in value + param ny Float32 in value + param nz Float32 in value + param x Float32 in value + param y Float32 in value + param z Float32 in value + category SUN_vertex + version 1.1 + glxropcode ? + offset ? + +TexCoord2fColor4fNormal3fVertex3fvSUN(tc, c, n, v) + return void + param tc Float32 in array [2] + param c Float32 in array [4] + param n Float32 in array [3] + param v Float32 in array [3] + category SUN_vertex + version 1.1 + glxropcode ? + offset ? + +TexCoord4fColor4fNormal3fVertex4fSUN(s, t, p, q, r, g, b, a, nx, ny, nz, x, y, z, w) + return void + param s Float32 in value + param t Float32 in value + param p Float32 in value + param q Float32 in value + param r Float32 in value + param g Float32 in value + param b Float32 in value + param a Float32 in value + param nx Float32 in value + param ny Float32 in value + param nz Float32 in value + param x Float32 in value + param y Float32 in value + param z Float32 in value + param w Float32 in value + category SUN_vertex + version 1.1 + glxropcode ? + offset ? + +TexCoord4fColor4fNormal3fVertex4fvSUN(tc, c, n, v) + return void + param tc Float32 in array [4] + param c Float32 in array [4] + param n Float32 in array [3] + param v Float32 in array [4] + category SUN_vertex + version 1.1 + glxropcode ? + offset ? + +ReplacementCodeuiVertex3fSUN(rc, x, y, z) + return void + param rc ReplacementCodeSUN in value + param x Float32 in value + param y Float32 in value + param z Float32 in value + category SUN_vertex + version 1.1 + glxropcode ? + offset ? + +ReplacementCodeuiVertex3fvSUN(rc, v) + return void + param rc ReplacementCodeSUN in array [1] + param v Float32 in array [3] + category SUN_vertex + version 1.1 + glxropcode ? + offset ? + +ReplacementCodeuiColor4ubVertex3fSUN(rc, r, g, b, a, x, y, z) + return void + param rc ReplacementCodeSUN in value + param r UInt8 in value + param g UInt8 in value + param b UInt8 in value + param a UInt8 in value + param x Float32 in value + param y Float32 in value + param z Float32 in value + category SUN_vertex + version 1.1 + glxropcode ? + offset ? + +ReplacementCodeuiColor4ubVertex3fvSUN(rc, c, v) + return void + param rc ReplacementCodeSUN in array [1] + param c UInt8 in array [4] + param v Float32 in array [3] + category SUN_vertex + version 1.1 + glxropcode ? + offset ? + +ReplacementCodeuiColor3fVertex3fSUN(rc, r, g, b, x, y, z) + return void + param rc ReplacementCodeSUN in value + param r Float32 in value + param g Float32 in value + param b Float32 in value + param x Float32 in value + param y Float32 in value + param z Float32 in value + category SUN_vertex + version 1.1 + glxropcode ? + offset ? + +ReplacementCodeuiColor3fVertex3fvSUN(rc, c, v) + return void + param rc ReplacementCodeSUN in array [1] + param c Float32 in array [3] + param v Float32 in array [3] + category SUN_vertex + version 1.1 + glxropcode ? + offset ? + +ReplacementCodeuiNormal3fVertex3fSUN(rc, nx, ny, nz, x, y, z) + return void + param rc ReplacementCodeSUN in value + param nx Float32 in value + param ny Float32 in value + param nz Float32 in value + param x Float32 in value + param y Float32 in value + param z Float32 in value + category SUN_vertex + version 1.1 + glxropcode ? + offset ? + +ReplacementCodeuiNormal3fVertex3fvSUN(rc, n, v) + return void + param rc ReplacementCodeSUN in array [1] + param n Float32 in array [3] + param v Float32 in array [3] + category SUN_vertex + version 1.1 + glxropcode ? + offset ? + +ReplacementCodeuiColor4fNormal3fVertex3fSUN(rc, r, g, b, a, nx, ny, nz, x, y, z) + return void + param rc ReplacementCodeSUN in value + param r Float32 in value + param g Float32 in value + param b Float32 in value + param a Float32 in value + param nx Float32 in value + param ny Float32 in value + param nz Float32 in value + param x Float32 in value + param y Float32 in value + param z Float32 in value + category SUN_vertex + version 1.1 + glxropcode ? + offset ? + +ReplacementCodeuiColor4fNormal3fVertex3fvSUN(rc, c, n, v) + return void + param rc ReplacementCodeSUN in array [1] + param c Float32 in array [4] + param n Float32 in array [3] + param v Float32 in array [3] + category SUN_vertex + version 1.1 + glxropcode ? + offset ? + +ReplacementCodeuiTexCoord2fVertex3fSUN(rc, s, t, x, y, z) + return void + param rc ReplacementCodeSUN in value + param s Float32 in value + param t Float32 in value + param x Float32 in value + param y Float32 in value + param z Float32 in value + category SUN_vertex + version 1.1 + glxropcode ? + offset ? + +ReplacementCodeuiTexCoord2fVertex3fvSUN(rc, tc, v) + return void + param rc ReplacementCodeSUN in array [1] + param tc Float32 in array [2] + param v Float32 in array [3] + category SUN_vertex + version 1.1 + glxropcode ? + offset ? + +ReplacementCodeuiTexCoord2fNormal3fVertex3fSUN(rc, s, t, nx, ny, nz, x, y, z) + return void + param rc ReplacementCodeSUN in value + param s Float32 in value + param t Float32 in value + param nx Float32 in value + param ny Float32 in value + param nz Float32 in value + param x Float32 in value + param y Float32 in value + param z Float32 in value + category SUN_vertex + version 1.1 + glxropcode ? + offset ? + +ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN(rc, tc, n, v) + return void + param rc ReplacementCodeSUN in array [1] + param tc Float32 in array [2] + param n Float32 in array [3] + param v Float32 in array [3] + category SUN_vertex + version 1.1 + glxropcode ? + offset ? + +ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN(rc, s, t, r, g, b, a, nx, ny, nz, x, y, z) + return void + param rc ReplacementCodeSUN in value + param s Float32 in value + param t Float32 in value + param r Float32 in value + param g Float32 in value + param b Float32 in value + param a Float32 in value + param nx Float32 in value + param ny Float32 in value + param nz Float32 in value + param x Float32 in value + param y Float32 in value + param z Float32 in value + category SUN_vertex + version 1.1 + glxropcode ? + offset ? + +ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN(rc, tc, c, n, v) + return void + param rc ReplacementCodeSUN in array [1] + param tc Float32 in array [2] + param c Float32 in array [4] + param n Float32 in array [3] + param v Float32 in array [3] + category SUN_vertex + version 1.1 + glxropcode ? + offset ? + +############################################################################### +# +# Extension #167 - WGL_EXT_display_color_table +# Extension #168 - WGL_EXT_extensions_string +# Extension #169 - WGL_EXT_make_current_read +# Extension #170 - WGL_EXT_pixel_format +# Extension #171 - WGL_EXT_pbuffer +# Extension #172 - WGL_EXT_swap_control +# +############################################################################### + +############################################################################### +# +# Extension #173 +# EXT_blend_func_separate commands (also INGR_blend_func_separate) +# +############################################################################### + +BlendFuncSeparateEXT(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha) + return void + param sfactorRGB BlendFuncSeparateParameterEXT in value + param dfactorRGB BlendFuncSeparateParameterEXT in value + param sfactorAlpha BlendFuncSeparateParameterEXT in value + param dfactorAlpha BlendFuncSeparateParameterEXT in value + category EXT_blend_func_separate + glxropcode 4134 + version 1.0 + extension + alias BlendFuncSeparate + +BlendFuncSeparateINGR(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha) + return void + param sfactorRGB BlendFuncSeparateParameterEXT in value + param dfactorRGB BlendFuncSeparateParameterEXT in value + param sfactorAlpha BlendFuncSeparateParameterEXT in value + param dfactorAlpha BlendFuncSeparateParameterEXT in value + category INGR_blend_func_separate + glxropcode 4134 + version 1.0 + extension + alias BlendFuncSeparateEXT + +############################################################################### +# +# Extension #174 +# INGR_color_clamp commands +# +############################################################################### + +# (none) +newcategory: INGR_color_clamp + +############################################################################### +# +# Extension #175 +# INGR_interlace_read commands +# +############################################################################### + +# (none) +newcategory: INGR_interlace_read + +############################################################################### +# +# Extension #176 +# EXT_stencil_wrap commands +# +############################################################################### + +# (none) +newcategory: EXT_stencil_wrap + +############################################################################### +# +# Extension #177 - skipped +# +############################################################################### + +############################################################################### +# +# Extension #178 +# EXT_422_pixels commands +# +############################################################################### + +# (none) +newcategory: EXT_422_pixels + +############################################################################### +# +# Extension #179 +# NV_texgen_reflection commands +# +############################################################################### + +# (none) +newcategory: NV_texgen_reflection + +############################################################################### +# +# Extension #??? +# @ EXT_texture_cube_map commands +# +############################################################################### + +# (none) + +############################################################################### +# +# Extension #180 - skipped +# Extension #181 - skipped +# +############################################################################### + +############################################################################### +# +# Extension #182 +# SUN_convolution_border_modes commands +# +############################################################################### + +# (none) +newcategory: SUN_convolution_border_modes + +############################################################################### +# +# Extension #183 - GLX_SUN_get_transparent_index +# Extension #184 - skipped +# +############################################################################### + +############################################################################### +# +# Extension #185 +# EXT_texture_env_add commands +# +############################################################################### + +# (none) +newcategory: EXT_texture_env_add + +############################################################################### +# +# Extension #186 +# EXT_texture_lod_bias commands +# +############################################################################### + +# (none) +newcategory: EXT_texture_lod_bias + +############################################################################### +# +# Extension #187 +# EXT_texture_filter_anisotropic commands +# +############################################################################### + +# (none) +newcategory: EXT_texture_filter_anisotropic + +############################################################################### +# +# Extension #188 +# EXT_vertex_weighting commands +# +############################################################################### + +# GLX stuff to be written +VertexWeightfEXT(weight) + return void + param weight Float32 in value + category EXT_vertex_weighting + vectorequiv VertexWeightfvEXT + version 1.1 + extension soft WINSOFT NV10 + glxflags ignore + offset 494 + +VertexWeightfvEXT(weight) + return void + param weight Float32 in array [1] + category EXT_vertex_weighting + version 1.1 + extension soft WINSOFT NV10 + glxropcode 4135 + glxflags ignore + offset 495 + +VertexWeightPointerEXT(size, type, stride, pointer) + return void + param size SizeI in value + param type VertexWeightPointerTypeEXT in value + param stride SizeI in value + param pointer Void in array [COMPSIZE(type/stride)] retained + category EXT_vertex_weighting + version 1.1 + extension soft WINSOFT NV10 + dlflags notlistable + glxflags ignore + offset 496 + +############################################################################### +# +# Extension #189 +# NV_light_max_exponent commands +# +############################################################################### + +# (none) +newcategory: NV_light_max_exponent + +############################################################################### +# +# Extension #190 +# NV_vertex_array_range commands +# +############################################################################### + +FlushVertexArrayRangeNV() + return void + category NV_vertex_array_range + version 1.1 + extension soft WINSOFT NV10 + dlflags notlistable + glxflags client-handcode server-handcode ignore + offset 497 + +VertexArrayRangeNV(length, pointer) + return void + param length SizeI in value + param pointer Void in array [COMPSIZE(length)] retained + category NV_vertex_array_range + version 1.1 + extension soft WINSOFT NV10 + dlflags notlistable + glxflags client-handcode server-handcode ignore + offset 498 + +############################################################################### +# +# Extension #191 +# NV_register_combiners commands +# +############################################################################### + +CombinerParameterfvNV(pname, params) + return void + param pname CombinerParameterNV in value + param params CheckedFloat32 in array [COMPSIZE(pname)] + category NV_register_combiners + version 1.1 + extension soft WINSOFT NV10 + glxropcode 4137 + glxflags ignore + offset 499 + +CombinerParameterfNV(pname, param) + return void + param pname CombinerParameterNV in value + param param Float32 in value + category NV_register_combiners + version 1.1 + extension soft WINSOFT NV10 + glxropcode 4136 + glxflags ignore + offset 500 + +CombinerParameterivNV(pname, params) + return void + param pname CombinerParameterNV in value + param params CheckedInt32 in array [COMPSIZE(pname)] + category NV_register_combiners + version 1.1 + extension soft WINSOFT NV10 + glxropcode 4139 + glxflags ignore + offset 501 + +CombinerParameteriNV(pname, param) + return void + param pname CombinerParameterNV in value + param param Int32 in value + category NV_register_combiners + version 1.1 + extension soft WINSOFT NV10 + glxropcode 4138 + glxflags ignore + offset 502 + +CombinerInputNV(stage, portion, variable, input, mapping, componentUsage) + return void + param stage CombinerStageNV in value + param portion CombinerPortionNV in value + param variable CombinerVariableNV in value + param input CombinerRegisterNV in value + param mapping CombinerMappingNV in value + param componentUsage CombinerComponentUsageNV in value + category NV_register_combiners + version 1.1 + extension soft WINSOFT NV10 + glxropcode 4140 + glxflags ignore + offset 503 + +CombinerOutputNV(stage, portion, abOutput, cdOutput, sumOutput, scale, bias, abDotProduct, cdDotProduct, muxSum) + return void + param stage CombinerStageNV in value + param portion CombinerPortionNV in value + param abOutput CombinerRegisterNV in value + param cdOutput CombinerRegisterNV in value + param sumOutput CombinerRegisterNV in value + param scale CombinerScaleNV in value + param bias CombinerBiasNV in value + param abDotProduct Boolean in value + param cdDotProduct Boolean in value + param muxSum Boolean in value + category NV_register_combiners + version 1.1 + extension soft WINSOFT NV10 + glxropcode 4141 + glxflags ignore + offset 504 + +FinalCombinerInputNV(variable, input, mapping, componentUsage) + return void + param variable CombinerVariableNV in value + param input CombinerRegisterNV in value + param mapping CombinerMappingNV in value + param componentUsage CombinerComponentUsageNV in value + category NV_register_combiners + version 1.1 + extension soft WINSOFT NV10 + glxropcode 4142 + glxflags ignore + offset 505 + +GetCombinerInputParameterfvNV(stage, portion, variable, pname, params) + return void + param stage CombinerStageNV in value + param portion CombinerPortionNV in value + param variable CombinerVariableNV in value + param pname CombinerParameterNV in value + param params Float32 out array [COMPSIZE(pname)] + dlflags notlistable + category NV_register_combiners + version 1.1 + extension soft WINSOFT NV10 + glxvendorpriv 1270 + glxflags ignore + offset 506 + +GetCombinerInputParameterivNV(stage, portion, variable, pname, params) + return void + param stage CombinerStageNV in value + param portion CombinerPortionNV in value + param variable CombinerVariableNV in value + param pname CombinerParameterNV in value + param params Int32 out array [COMPSIZE(pname)] + dlflags notlistable + category NV_register_combiners + version 1.1 + extension soft WINSOFT NV10 + glxvendorpriv 1271 + glxflags ignore + offset 507 + +GetCombinerOutputParameterfvNV(stage, portion, pname, params) + return void + param stage CombinerStageNV in value + param portion CombinerPortionNV in value + param pname CombinerParameterNV in value + param params Float32 out array [COMPSIZE(pname)] + dlflags notlistable + category NV_register_combiners + version 1.1 + extension soft WINSOFT NV10 + glxvendorpriv 1272 + glxflags ignore + offset 508 + +GetCombinerOutputParameterivNV(stage, portion, pname, params) + return void + param stage CombinerStageNV in value + param portion CombinerPortionNV in value + param pname CombinerParameterNV in value + param params Int32 out array [COMPSIZE(pname)] + dlflags notlistable + category NV_register_combiners + version 1.1 + extension soft WINSOFT NV10 + glxvendorpriv 1273 + glxflags ignore + offset 509 + +GetFinalCombinerInputParameterfvNV(variable, pname, params) + return void + param variable CombinerVariableNV in value + param pname CombinerParameterNV in value + param params Float32 out array [COMPSIZE(pname)] + dlflags notlistable + category NV_register_combiners + version 1.1 + extension soft WINSOFT NV10 + glxvendorpriv 1274 + glxflags ignore + offset 510 + +GetFinalCombinerInputParameterivNV(variable, pname, params) + return void + param variable CombinerVariableNV in value + param pname CombinerParameterNV in value + param params Int32 out array [COMPSIZE(pname)] + dlflags notlistable + category NV_register_combiners + version 1.1 + extension soft WINSOFT NV10 + glxvendorpriv 1275 + glxflags ignore + offset 511 + +############################################################################### +# +# Extension #192 +# NV_fog_distance commands +# +############################################################################### + +# (none) +newcategory: NV_fog_distance + +############################################################################### +# +# Extension #193 +# NV_texgen_emboss commands +# +############################################################################### + +# (none) +newcategory: NV_texgen_emboss + +############################################################################### +# +# Extension #194 +# NV_blend_square commands +# +############################################################################### + +# (none) +newcategory: NV_blend_square + +############################################################################### +# +# Extension #195 +# NV_texture_env_combine4 commands +# +############################################################################### + +# (none) +newcategory: NV_texture_env_combine4 + +############################################################################### +# +# Extension #196 +# MESA_resize_buffers commands +# +############################################################################### + +ResizeBuffersMESA() + return void + category MESA_resize_buffers + version 1.0 + glxropcode ? + offset 512 + +############################################################################### +# +# Extension #197 +# MESA_window_pos commands +# +# Note that the 2- and 3-component versions are now aliases of ARB +# entry points. +# +############################################################################### + +WindowPos2dMESA(x, y) + return void + param x CoordD in value + param y CoordD in value + category MESA_window_pos + vectorequiv WindowPos2dvMESA + version 1.0 + alias WindowPos2dARB + +WindowPos2dvMESA(v) + return void + param v CoordD in array [2] + category MESA_window_pos + version 1.0 + glxropcode ? + alias WindowPos2dvARB + +WindowPos2fMESA(x, y) + return void + param x CoordF in value + param y CoordF in value + category MESA_window_pos + vectorequiv WindowPos2fvMESA + version 1.0 + alias WindowPos2fARB + +WindowPos2fvMESA(v) + return void + param v CoordF in array [2] + category MESA_window_pos + version 1.0 + glxropcode ? + alias WindowPos2fvARB + +WindowPos2iMESA(x, y) + return void + param x CoordI in value + param y CoordI in value + category MESA_window_pos + vectorequiv WindowPos2ivMESA + version 1.0 + alias WindowPos2iARB + +WindowPos2ivMESA(v) + return void + param v CoordI in array [2] + category MESA_window_pos + version 1.0 + glxropcode ? + alias WindowPos2ivARB + +WindowPos2sMESA(x, y) + return void + param x CoordS in value + param y CoordS in value + category MESA_window_pos + vectorequiv WindowPos2svMESA + version 1.0 + alias WindowPos2sARB + +WindowPos2svMESA(v) + return void + param v CoordS in array [2] + category MESA_window_pos + version 1.0 + glxropcode ? + alias WindowPos2svARB + +WindowPos3dMESA(x, y, z) + return void + param x CoordD in value + param y CoordD in value + param z CoordD in value + vectorequiv WindowPos3dvMESA + category MESA_window_pos + version 1.0 + alias WindowPos3dARB + +WindowPos3dvMESA(v) + return void + param v CoordD in array [3] + category MESA_window_pos + version 1.0 + glxropcode ? + alias WindowPos3dvARB + +WindowPos3fMESA(x, y, z) + return void + param x CoordF in value + param y CoordF in value + param z CoordF in value + category MESA_window_pos + vectorequiv WindowPos3fvMESA + version 1.0 + alias WindowPos3fARB + +WindowPos3fvMESA(v) + return void + param v CoordF in array [3] + category MESA_window_pos + version 1.0 + glxropcode ? + alias WindowPos3fvARB + +WindowPos3iMESA(x, y, z) + return void + param x CoordI in value + param y CoordI in value + param z CoordI in value + category MESA_window_pos + vectorequiv WindowPos3ivMESA + version 1.0 + alias WindowPos3iARB + +WindowPos3ivMESA(v) + return void + param v CoordI in array [3] + category MESA_window_pos + version 1.0 + glxropcode ? + alias WindowPos3ivARB + +WindowPos3sMESA(x, y, z) + return void + param x CoordS in value + param y CoordS in value + param z CoordS in value + category MESA_window_pos + vectorequiv WindowPos3svMESA + version 1.0 + alias WindowPos3sARB + +WindowPos3svMESA(v) + return void + param v CoordS in array [3] + category MESA_window_pos + version 1.0 + glxropcode ? + alias WindowPos3svARB + +WindowPos4dMESA(x, y, z, w) + return void + param x CoordD in value + param y CoordD in value + param z CoordD in value + param w CoordD in value + vectorequiv WindowPos4dvMESA + category MESA_window_pos + version 1.0 + offset 529 + +WindowPos4dvMESA(v) + return void + param v CoordD in array [4] + category MESA_window_pos + version 1.0 + glxropcode ? + offset 530 + +WindowPos4fMESA(x, y, z, w) + return void + param x CoordF in value + param y CoordF in value + param z CoordF in value + param w CoordF in value + category MESA_window_pos + vectorequiv WindowPos4fvMESA + version 1.0 + offset 531 + +WindowPos4fvMESA(v) + return void + param v CoordF in array [4] + category MESA_window_pos + version 1.0 + glxropcode ? + offset 532 + +WindowPos4iMESA(x, y, z, w) + return void + param x CoordI in value + param y CoordI in value + param z CoordI in value + param w CoordI in value + category MESA_window_pos + vectorequiv WindowPos4ivMESA + version 1.0 + offset 533 + +WindowPos4ivMESA(v) + return void + param v CoordI in array [4] + category MESA_window_pos + version 1.0 + glxropcode ? + offset 534 + +WindowPos4sMESA(x, y, z, w) + return void + param x CoordS in value + param y CoordS in value + param z CoordS in value + param w CoordS in value + category MESA_window_pos + vectorequiv WindowPos4svMESA + version 1.0 + offset 535 + +WindowPos4svMESA(v) + return void + param v CoordS in array [4] + category MESA_window_pos + version 1.0 + glxropcode ? + offset 536 + +############################################################################### +# +# Extension #198 +# EXT_texture_compression_s3tc commands +# +############################################################################### + +#@@ (none yet) + +############################################################################### +# +# Extension #199 +# IBM_cull_vertex commands +# +############################################################################### + +# (none) +newcategory: IBM_cull_vertex + +############################################################################### +# +# Extension #200 +# IBM_multimode_draw_arrays commands +# +############################################################################### + +MultiModeDrawArraysIBM(mode, first, count, primcount, modestride) + return void + param mode BeginMode in array [COMPSIZE(primcount)] + param first Int32 in array [COMPSIZE(primcount)] + param count SizeI in array [COMPSIZE(primcount)] + param primcount SizeI in value + param modestride Int32 in value + category IBM_multimode_draw_arrays + version 1.1 + glxropcode ? + offset 708 + + +MultiModeDrawElementsIBM(mode, count, type, indices, primcount, modestride) + return void + param mode BeginMode in array [COMPSIZE(primcount)] + param count SizeI in array [COMPSIZE(primcount)] + param type DrawElementsType in value + param indices ConstVoidPointer in array [COMPSIZE(primcount)] + param primcount SizeI in value + param modestride Int32 in value + category IBM_multimode_draw_arrays + version 1.1 + glxropcode ? + offset 709 + +############################################################################### +# +# Extension #201 +# IBM_vertex_array_lists commands +# +############################################################################### + +ColorPointerListIBM(size, type, stride, pointer, ptrstride) + return void + param size Int32 in value + param type ColorPointerType in value + param stride Int32 in value + param pointer VoidPointer in array [COMPSIZE(size/type/stride)] retained + param ptrstride Int32 in value + category IBM_vertex_array_lists + version 1.1 + glxropcode ? + offset ? + +SecondaryColorPointerListIBM(size, type, stride, pointer, ptrstride) + return void + param size Int32 in value + param type SecondaryColorPointerTypeIBM in value + param stride Int32 in value + param pointer VoidPointer in array [COMPSIZE(size/type/stride)] retained + param ptrstride Int32 in value + category IBM_vertex_array_lists + version 1.1 + glxropcode ? + offset ? + +EdgeFlagPointerListIBM(stride, pointer, ptrstride) + return void + param stride Int32 in value + param pointer BooleanPointer in array [COMPSIZE(stride)] retained + param ptrstride Int32 in value + category IBM_vertex_array_lists + version 1.1 + glxropcode ? + offset ? + +FogCoordPointerListIBM(type, stride, pointer, ptrstride) + return void + param type FogPointerTypeIBM in value + param stride Int32 in value + param pointer VoidPointer in array [COMPSIZE(type/stride)] retained + param ptrstride Int32 in value + category IBM_vertex_array_lists + version 1.1 + glxropcode ? + offset ? + +IndexPointerListIBM(type, stride, pointer, ptrstride) + return void + param type IndexPointerType in value + param stride Int32 in value + param pointer VoidPointer in array [COMPSIZE(type/stride)] retained + param ptrstride Int32 in value + category IBM_vertex_array_lists + version 1.1 + glxropcode ? + offset ? + +NormalPointerListIBM(type, stride, pointer, ptrstride) + return void + param type NormalPointerType in value + param stride Int32 in value + param pointer VoidPointer in array [COMPSIZE(type/stride)] retained + param ptrstride Int32 in value + category IBM_vertex_array_lists + version 1.1 + glxropcode ? + offset ? + +TexCoordPointerListIBM(size, type, stride, pointer, ptrstride) + return void + param size Int32 in value + param type TexCoordPointerType in value + param stride Int32 in value + param pointer VoidPointer in array [COMPSIZE(size/type/stride)] retained + param ptrstride Int32 in value + category IBM_vertex_array_lists + version 1.1 + glxropcode ? + offset ? + +VertexPointerListIBM(size, type, stride, pointer, ptrstride) + return void + param size Int32 in value + param type VertexPointerType in value + param stride Int32 in value + param pointer VoidPointer in array [COMPSIZE(size/type/stride)] retained + param ptrstride Int32 in value + category IBM_vertex_array_lists + version 1.1 + glxropcode ? + offset ? + +############################################################################### +# +# Extension #202 +# SGIX_subsample commands +# +############################################################################### + +# (none) +newcategory: SGIX_subsample + +############################################################################### +# +# Extension #203 +# SGIX_ycrcba commands +# +############################################################################### + +# (none) +newcategory: SGIX_ycrcba + +############################################################################### +# +# Extension #204 +# SGIX_ycrcb_subsample commands +# +############################################################################### + +# (none) +newcategory: SGIX_ycrcb_subsample + +############################################################################### +# +# Extension #205 +# SGIX_depth_pass_instrument commands +# +############################################################################### + +# (none) +newcategory: SGIX_depth_pass_instrument + +############################################################################### +# +# Extension #206 +# 3DFX_texture_compression_FXT1 commands +# +############################################################################### + +# (none) +newcategory: 3DFX_texture_compression_FXT1 + +############################################################################### +# +# Extension #207 +# 3DFX_multisample commands +# +############################################################################### + +# (none) +newcategory: 3DFX_multisample + +############################################################################### +# +# Extension #208 +# 3DFX_tbuffer commands +# +############################################################################### + +TbufferMask3DFX(mask) + return void + param mask UInt32 in value + category 3DFX_tbuffer + version 1.2 + glxropcode ? + offset 553 + +############################################################################### +# +# Extension #209 +# EXT_multisample commands +# +############################################################################### + +SampleMaskEXT(value, invert) + return void + param value ClampedFloat32 in value + param invert Boolean in value + category EXT_multisample + version 1.0 + glxropcode ? + extension + offset 446 + +SamplePatternEXT(pattern) + return void + param pattern SamplePatternEXT in value + category EXT_multisample + version 1.0 + glxropcode ? + glxflags + extension + offset 447 + +############################################################################### +# +# Extension #210 +# SGIX_vertex_preclip commands +# +############################################################################### + +# (none) +newcategory: SGIX_vertex_preclip + +############################################################################### +# +# Extension #211 +# SGIX_convolution_accuracy commands +# +############################################################################### + +# (none) +newcategory: SGIX_convolution_accuracy + +############################################################################### +# +# Extension #212 +# SGIX_resample commands +# +############################################################################### + +# (none) +newcategory: SGIX_resample + +############################################################################### +# +# Extension #213 +# SGIS_point_line_texgen commands +# +############################################################################### + +# (none) +newcategory: SGIS_point_line_texgen + +############################################################################### +# +# Extension #214 +# SGIS_texture_color_mask commands +# +############################################################################### + +TextureColorMaskSGIS(red, green, blue, alpha) + return void + param red Boolean in value + param green Boolean in value + param blue Boolean in value + param alpha Boolean in value + category SGIS_texture_color_mask + version 1.1 + glxropcode 2082 + extension + offset ? + +############################################################################### +# +# Extension #215 - GLX_MESA_copy_sub_buffer +# Extension #216 - GLX_MESA_pixmap_colormap +# Extension #217 - GLX_MESA_release_buffers +# Extension #218 - GLX_MESA_set_3dfx_mode +# +############################################################################### + +############################################################################### +# +# Extension #219 +# SGIX_igloo_interface commands +# +############################################################################### + +IglooInterfaceSGIX(pname, params) + return void + dlflags notlistable + param pname IglooFunctionSelectSGIX in value + param params IglooParameterSGIX in array [COMPSIZE(pname)] + category SGIX_igloo_interface + version 1.0 + glxflags SGI ignore + extension + glxropcode 200 + offset ? + +############################################################################### +# +# Extension #220 +# EXT_texture_env_dot3 commands +# +############################################################################### + +# (none) +newcategory: EXT_texture_env_dot3 + +############################################################################### +# +# Extension #221 +# ATI_texture_mirror_once commands +# +############################################################################### +# (none) +newcategory: ATI_texture_mirror_once + +############################################################################### +# +# Extension #222 +# NV_fence commands +# +############################################################################### + +DeleteFencesNV(n, fences) + return void + param n SizeI in value + param fences FenceNV in array [n] + category NV_fence + dlflags notlistable + version 1.2 + extension soft WINSOFT NV10 + glxvendorpriv 1276 + glxflags ignore + offset 647 + +GenFencesNV(n, fences) + return void + param n SizeI in value + param fences FenceNV out array [n] + category NV_fence + dlflags notlistable + version 1.2 + extension soft WINSOFT NV10 + glxvendorpriv 1277 + glxflags ignore + offset 648 + +IsFenceNV(fence) + return Boolean + param fence FenceNV in value + category NV_fence + dlflags notlistable + version 1.2 + extension soft WINSOFT NV10 + glxvendorpriv 1278 + glxflags ignore + offset 649 + +TestFenceNV(fence) + return Boolean + param fence FenceNV in value + category NV_fence + dlflags notlistable + version 1.2 + extension soft WINSOFT NV10 + glxvendorpriv 1279 + glxflags ignore + offset 650 + +GetFenceivNV(fence, pname, params) + return void + param fence FenceNV in value + param pname FenceParameterNameNV in value + param params Int32 out array [COMPSIZE(pname)] + category NV_fence + dlflags notlistable + version 1.2 + extension soft WINSOFT NV10 + glxvendorpriv 1280 + glxflags ignore + offset 651 + +FinishFenceNV(fence) + return void + param fence FenceNV in value + category NV_fence + dlflags notlistable + version 1.2 + extension soft WINSOFT NV10 + glxvendorpriv 1312 + glxflags ignore + offset 652 + +SetFenceNV(fence, condition) + return void + param fence FenceNV in value + param condition FenceConditionNV in value + category NV_fence + version 1.2 + extension soft WINSOFT NV10 + glxflags ignore + offset 653 + +############################################################################### +# +# Extension #225 +# NV_evaluators commands +# +############################################################################### + +MapControlPointsNV(target, index, type, ustride, vstride, uorder, vorder, packed, points) + return void + param target EvalTargetNV in value + param index UInt32 in value + param type MapTypeNV in value + param ustride SizeI in value + param vstride SizeI in value + param uorder CheckedInt32 in value + param vorder CheckedInt32 in value + param packed Boolean in value + param points Void in array [COMPSIZE(target/uorder/vorder)] + category NV_evaluators + dlflags handcode + version 1.1 + extension soft WINSOFT NV10 + glxflags ignore + offset ? + +MapParameterivNV(target, pname, params) + return void + param target EvalTargetNV in value + param pname MapParameterNV in value + param params CheckedInt32 in array [COMPSIZE(target/pname)] + category NV_evaluators + version 1.1 + extension soft WINSOFT NV10 + glxflags ignore + offset ? + +MapParameterfvNV(target, pname, params) + return void + param target EvalTargetNV in value + param pname MapParameterNV in value + param params CheckedFloat32 in array [COMPSIZE(target/pname)] + category NV_evaluators + version 1.1 + extension soft WINSOFT NV10 + glxflags ignore + offset ? + +GetMapControlPointsNV(target, index, type, ustride, vstride, packed, points) + return void + param target EvalTargetNV in value + param index UInt32 in value + param type MapTypeNV in value + param ustride SizeI in value + param vstride SizeI in value + param packed Boolean in value + param points Void out array [COMPSIZE(target)] + category NV_evaluators + dlflags notlistable + version 1.1 + extension soft WINSOFT NV10 + glxflags ignore + offset ? + +GetMapParameterivNV(target, pname, params) + return void + param target EvalTargetNV in value + param pname MapParameterNV in value + param params Int32 out array [COMPSIZE(target/pname)] + category NV_evaluators + dlflags notlistable + version 1.1 + extension soft WINSOFT NV10 + glxflags ignore + offset ? + +GetMapParameterfvNV(target, pname, params) + return void + param target EvalTargetNV in value + param pname MapParameterNV in value + param params Float32 out array [COMPSIZE(target/pname)] + category NV_evaluators + dlflags notlistable + version 1.1 + extension soft WINSOFT NV10 + glxflags ignore + offset ? + +GetMapAttribParameterivNV(target, index, pname, params) + return void + param target EvalTargetNV in value + param index UInt32 in value + param pname MapAttribParameterNV in value + param params Int32 out array [COMPSIZE(pname)] + category NV_evaluators + dlflags notlistable + version 1.1 + extension soft WINSOFT NV10 + glxflags ignore + offset ? + +GetMapAttribParameterfvNV(target, index, pname, params) + return void + param target EvalTargetNV in value + param index UInt32 in value + param pname MapAttribParameterNV in value + param params Float32 out array [COMPSIZE(pname)] + category NV_evaluators + dlflags notlistable + version 1.1 + extension soft WINSOFT NV10 + glxflags ignore + offset ? + +EvalMapsNV(target, mode) + return void + param target EvalTargetNV in value + param mode EvalMapsModeNV in value + category NV_evaluators + version 1.1 + extension soft WINSOFT NV10 + glxflags ignore + offset ? + +############################################################################### +# +# Extension #226 +# NV_packed_depth_stencil commands +# +############################################################################### + +# (none) +newcategory: NV_packed_depth_stencil + +############################################################################### +# +# Extension #227 +# NV_register_combiners2 commands +# +############################################################################### + +CombinerStageParameterfvNV(stage, pname, params) + return void + param stage CombinerStageNV in value + param pname CombinerParameterNV in value + param params CheckedFloat32 in array [COMPSIZE(pname)] + category NV_register_combiners2 + version 1.1 + extension + glxflags ignore + offset ? + +GetCombinerStageParameterfvNV(stage, pname, params) + return void + param stage CombinerStageNV in value + param pname CombinerParameterNV in value + param params Float32 out array [COMPSIZE(pname)] + dlflags notlistable + category NV_register_combiners2 + version 1.1 + extension + glxflags ignore + offset ? + +############################################################################### +# +# Extension #228 +# NV_texture_compression_vtc commands +# +############################################################################### + +# (none) +newcategory: NV_texture_compression_vtc + +############################################################################### +# +# Extension #229 +# NV_texture_rectangle commands +# +############################################################################### + +# (none) +newcategory: NV_texture_rectangle + +############################################################################### +# +# Extension #230 +# NV_texture_shader commands +# +############################################################################### + +# (none) +newcategory: NV_texture_shader + +############################################################################### +# +# Extension #231 +# NV_texture_shader2 commands +# +############################################################################### + +# (none) +newcategory: NV_texture_shader2 + +############################################################################### +# +# Extension #232 +# NV_vertex_array_range2 commands +# +############################################################################### + +# (none) +newcategory: NV_vertex_array_range2 + +############################################################################### +# +# Extension #233 +# NV_vertex_program commands +# +############################################################################### + +AreProgramsResidentNV(n, programs, residences) + return Boolean + param n SizeI in value + param programs UInt32 in array [n] + param residences Boolean out array [n] + category NV_vertex_program + dlflags notlistable + version 1.2 + extension soft WINSOFT NV10 + glxflags ignore + glxvendorpriv 1293 + offset 578 + +BindProgramNV(target, id) + return void + param target VertexAttribEnumNV in value + param id UInt32 in value + category NV_vertex_program + version 1.2 + extension soft WINSOFT NV10 + glxropcode 4180 + alias BindProgramARB + +DeleteProgramsNV(n, programs) + return void + param n SizeI in value + param programs UInt32 in array [n] + category NV_vertex_program + dlflags notlistable + version 1.2 + extension soft WINSOFT NV10 + glxvendorpriv 1294 + alias DeleteProgramsARB + +ExecuteProgramNV(target, id, params) + return void + param target VertexAttribEnumNV in value + param id UInt32 in value + param params Float32 in array [4] + category NV_vertex_program + version 1.2 + extension soft WINSOFT NV10 + glxflags ignore + glxropcode 4181 + offset 581 + +GenProgramsNV(n, programs) + return void + param n SizeI in value + param programs UInt32 out array [n] + category NV_vertex_program + dlflags notlistable + version 1.2 + extension soft WINSOFT NV10 + glxvendorpriv 1295 + alias GenProgramsARB + +GetProgramParameterdvNV(target, index, pname, params) + return void + param target VertexAttribEnumNV in value + param index UInt32 in value + param pname VertexAttribEnumNV in value + param params Float64 out array [4] + category NV_vertex_program + dlflags notlistable + version 1.2 + extension soft WINSOFT NV10 + glxflags ignore + glxvendorpriv 1297 + offset 583 + +GetProgramParameterfvNV(target, index, pname, params) + return void + param target VertexAttribEnumNV in value + param index UInt32 in value + param pname VertexAttribEnumNV in value + param params Float32 out array [4] + category NV_vertex_program + dlflags notlistable + version 1.2 + extension soft WINSOFT NV10 + glxflags ignore + glxvendorpriv 1296 + offset 584 + +# GetProgramParameterSigneddvNV(target, index, pname, params) +# return void +# param target VertexAttribEnumNV in value +# param index Int32 in value +# param pname VertexAttribEnumNV in value +# param params Float64 out array [4] +# category NV_vertex_program1_1_dcc +# dlflags notlistable +# version 1.2 +# extension soft WINSOFT NV20 +# glxflags ignore +# offset ? +# +# GetProgramParameterSignedfvNV(target, index, pname, params) +# return void +# param target VertexAttribEnumNV in value +# param index Int32 in value +# param pname VertexAttribEnumNV in value +# param params Float32 out array [4] +# category NV_vertex_program1_1_dcc +# dlflags notlistable +# version 1.2 +# extension soft WINSOFT NV20 +# glxflags ignore +# offset ? + +GetProgramivNV(id, pname, params) + return void + param id UInt32 in value + param pname VertexAttribEnumNV in value + param params Int32 out array [4] + category NV_vertex_program + dlflags notlistable + version 1.2 + extension soft WINSOFT NV10 + glxflags ignore + glxvendorpriv 1298 + offset 585 + +GetProgramStringNV(id, pname, program) + return void + param id UInt32 in value + param pname VertexAttribEnumNV in value + param program ProgramCharacterNV out array [COMPSIZE(id/pname)] + category NV_vertex_program + dlflags notlistable + version 1.2 + extension soft WINSOFT NV10 + glxflags ignore + glxvendorpriv 1299 + offset 586 + +GetTrackMatrixivNV(target, address, pname, params) + return void + param target VertexAttribEnumNV in value + param address UInt32 in value + param pname VertexAttribEnumNV in value + param params Int32 out array [1] + category NV_vertex_program + dlflags notlistable + version 1.2 + extension soft WINSOFT NV10 + glxflags ignore + glxvendorpriv 1300 + offset 587 + +GetVertexAttribdvNV(index, pname, params) + return void + param index UInt32 in value + param pname VertexAttribEnumNV in value + param params Float64 out array [1] + category NV_vertex_program + dlflags notlistable + version 1.2 + extension soft WINSOFT NV10 + glxvendorpriv 1301 + alias GetVertexAttribdv + +GetVertexAttribfvNV(index, pname, params) + return void + param index UInt32 in value + param pname VertexAttribEnumNV in value + param params Float32 out array [1] + category NV_vertex_program + dlflags notlistable + version 1.2 + extension soft WINSOFT NV10 + glxvendorpriv 1302 + alias GetVertexAttribfv + +GetVertexAttribivNV(index, pname, params) + return void + param index UInt32 in value + param pname VertexAttribEnumNV in value + param params Int32 out array [1] + category NV_vertex_program + dlflags notlistable + version 1.2 + extension soft WINSOFT NV10 + glxvendorpriv 1303 + alias GetVertexAttribiv + +GetVertexAttribPointervNV(index, pname, pointer) + return void + param index UInt32 in value + param pname VertexAttribEnumNV in value + param pointer VoidPointer out array [1] + category NV_vertex_program + dlflags notlistable + version 1.2 + extension soft WINSOFT NV10 + glxflags ignore + alias GetVertexAttribPointerv + +IsProgramNV(id) + return Boolean + param id UInt32 in value + category NV_vertex_program + dlflags notlistable + version 1.2 + extension soft WINSOFT NV10 + glxvendorpriv 1304 + alias IsProgram + +LoadProgramNV(target, id, len, program) + return void + param target VertexAttribEnumNV in value + param id UInt32 in value + param len SizeI in value + param program UInt8 in array [len] + category NV_vertex_program + version 1.2 + extension soft WINSOFT NV10 + glxropcode 4183 + offset 593 + +ProgramParameter4dNV(target, index, x, y, z, w) + return void + param target VertexAttribEnumNV in value + param index UInt32 in value + param x Float64 in value + param y Float64 in value + param z Float64 in value + param w Float64 in value + category NV_vertex_program + version 1.2 + vectorequiv ProgramParameter4dvNV + extension soft WINSOFT NV10 + offset 594 + +ProgramParameter4dvNV(target, index, v) + return void + param target VertexAttribEnumNV in value + param index UInt32 in value + param v Float64 in array [4] + category NV_vertex_program + version 1.2 + extension soft WINSOFT NV10 + glxropcode 4185 + offset 595 + +ProgramParameter4fNV(target, index, x, y, z, w) + return void + param target VertexAttribEnumNV in value + param index UInt32 in value + param x Float32 in value + param y Float32 in value + param z Float32 in value + param w Float32 in value + category NV_vertex_program + version 1.2 + vectorequiv ProgramParameter4fvNV + extension soft WINSOFT NV10 + offset 596 + +ProgramParameter4fvNV(target, index, v) + return void + param target VertexAttribEnumNV in value + param index UInt32 in value + param v Float32 in array [4] + category NV_vertex_program + version 1.2 + extension soft WINSOFT NV10 + glxropcode 4184 + offset 597 + +#??? 'count' was SizeI in the latest NVIDIA gl.spec, but UInt32 in the +#??? extension specification in the registry. +ProgramParameters4dvNV(target, index, count, v) + return void + param target VertexAttribEnumNV in value + param index UInt32 in value + param count SizeI in value + param v Float64 in array [count*4] + category NV_vertex_program + version 1.2 + extension soft WINSOFT NV10 + glxropcode 4187 + offset 598 + +ProgramParameters4fvNV(target, index, count, v) + return void + param target VertexAttribEnumNV in value + param index UInt32 in value + param count SizeI in value + param v Float32 in array [count*4] + category NV_vertex_program + version 1.2 + extension soft WINSOFT NV10 + glxropcode 4186 + offset 599 + +# ProgramParameterSigned4dNV(target, index, x, y, z, w) +# return void +# param target VertexAttribEnumNV in value +# param index Int32 in value +# param x Float64 in value +# param y Float64 in value +# param z Float64 in value +# param w Float64 in value +# category NV_vertex_program1_1_dcc +# version 1.2 +# vectorequiv ProgramParameterSigned4dvNV +# extension soft WINSOFT NV20 +# offset ? +# +# ProgramParameterSigned4dvNV(target, index, v) +# return void +# param target VertexAttribEnumNV in value +# param index Int32 in value +# param v Float64 in array [4] +# category NV_vertex_program1_1_dcc +# version 1.2 +# extension soft WINSOFT NV20 +# glxflags ignore +# offset ? +# +# ProgramParameterSigned4fNV(target, index, x, y, z, w) +# return void +# param target VertexAttribEnumNV in value +# param index Int32 in value +# param x Float32 in value +# param y Float32 in value +# param z Float32 in value +# param w Float32 in value +# category NV_vertex_program1_1_dcc +# version 1.2 +# vectorequiv ProgramParameterSigned4fvNV +# extension soft WINSOFT NV20 +# offset ? +# +# ProgramParameterSigned4fvNV(target, index, v) +# return void +# param target VertexAttribEnumNV in value +# param index Int32 in value +# param v Float32 in array [4] +# category NV_vertex_program1_1_dcc +# version 1.2 +# extension soft WINSOFT NV20 +# glxflags ignore +# offset ? +# +# ProgramParametersSigned4dvNV(target, index, count, v) +# return void +# param target VertexAttribEnumNV in value +# param index Int32 in value +# param count SizeI in value +# param v Float64 in array [count*4] +# category NV_vertex_program1_1_dcc +# version 1.2 +# extension soft WINSOFT NV20 +# glxflags ignore +# offset ? +# +# ProgramParametersSigned4fvNV(target, index, count, v) +# return void +# param target VertexAttribEnumNV in value +# param index Int32 in value +# param count SizeI in value +# param v Float32 in array [count*4] +# category NV_vertex_program1_1_dcc +# version 1.2 +# extension soft WINSOFT NV20 +# glxflags ignore +# offset ? + +RequestResidentProgramsNV(n, programs) + return void + param n SizeI in value + param programs UInt32 in array [n] + category NV_vertex_program + version 1.2 + extension soft WINSOFT NV10 + glxropcode 4182 + offset 600 + +TrackMatrixNV(target, address, matrix, transform) + return void + param target VertexAttribEnumNV in value + param address UInt32 in value + param matrix VertexAttribEnumNV in value + param transform VertexAttribEnumNV in value + category NV_vertex_program + version 1.2 + extension soft WINSOFT NV10 + glxropcode 4188 + offset 601 + +VertexAttribPointerNV(index, fsize, type, stride, pointer) + return void + param index UInt32 in value + param fsize Int32 in value + param type VertexAttribEnumNV in value + param stride SizeI in value + param pointer Void in array [COMPSIZE(fsize/type/stride)] retained + category NV_vertex_program + dlflags notlistable + version 1.2 + extension soft WINSOFT NV10 + glxflags ignore + offset 602 + +VertexAttrib1dNV(index, x) + return void + param index UInt32 in value + param x Float64 in value + category NV_vertex_program + version 1.2 + vectorequiv VertexAttrib1dvNV + extension soft WINSOFT NV10 + alias VertexAttrib1d + +VertexAttrib1dvNV(index, v) + return void + param index UInt32 in value + param v Float64 in array [1] + category NV_vertex_program + version 1.2 + extension soft WINSOFT NV10 + glxropcode 4197 + alias VertexAttrib1dv + +VertexAttrib1fNV(index, x) + return void + param index UInt32 in value + param x Float32 in value + category NV_vertex_program + version 1.2 + vectorequiv VertexAttrib1fvNV + extension soft WINSOFT NV10 + alias VertexAttrib1f + +VertexAttrib1fvNV(index, v) + return void + param index UInt32 in value + param v Float32 in array [1] + category NV_vertex_program + version 1.2 + extension soft WINSOFT NV10 + glxropcode 4193 + alias VertexAttrib1fv + +VertexAttrib1sNV(index, x) + return void + param index UInt32 in value + param x Int16 in value + category NV_vertex_program + version 1.2 + vectorequiv VertexAttrib1svNV + extension soft WINSOFT NV10 + alias VertexAttrib1s + +VertexAttrib1svNV(index, v) + return void + param index UInt32 in value + param v Int16 in array [1] + category NV_vertex_program + version 1.2 + extension soft WINSOFT NV10 + glxropcode 4189 + alias VertexAttrib1sv + +VertexAttrib2dNV(index, x, y) + return void + param index UInt32 in value + param x Float64 in value + param y Float64 in value + category NV_vertex_program + version 1.2 + vectorequiv VertexAttrib2dvNV + extension soft WINSOFT NV10 + alias VertexAttrib2d + +VertexAttrib2dvNV(index, v) + return void + param index UInt32 in value + param v Float64 in array [2] + category NV_vertex_program + version 1.2 + extension soft WINSOFT NV10 + glxropcode 4198 + alias VertexAttrib2dv + +VertexAttrib2fNV(index, x, y) + return void + param index UInt32 in value + param x Float32 in value + param y Float32 in value + category NV_vertex_program + version 1.2 + vectorequiv VertexAttrib2fvNV + extension soft WINSOFT NV10 + alias VertexAttrib2f + +VertexAttrib2fvNV(index, v) + return void + param index UInt32 in value + param v Float32 in array [2] + category NV_vertex_program + version 1.2 + extension soft WINSOFT NV10 + glxropcode 4194 + alias VertexAttrib2fv + +VertexAttrib2sNV(index, x, y) + return void + param index UInt32 in value + param x Int16 in value + param y Int16 in value + category NV_vertex_program + version 1.2 + vectorequiv VertexAttrib2svNV + extension soft WINSOFT NV10 + alias VertexAttrib2s + +VertexAttrib2svNV(index, v) + return void + param index UInt32 in value + param v Int16 in array [2] + category NV_vertex_program + version 1.2 + extension soft WINSOFT NV10 + glxropcode 4190 + alias VertexAttrib2sv + +VertexAttrib3dNV(index, x, y, z) + return void + param index UInt32 in value + param x Float64 in value + param y Float64 in value + param z Float64 in value + category NV_vertex_program + version 1.2 + vectorequiv VertexAttrib3dvNV + extension soft WINSOFT NV10 + alias VertexAttrib3d + +VertexAttrib3dvNV(index, v) + return void + param index UInt32 in value + param v Float64 in array [3] + category NV_vertex_program + version 1.2 + extension soft WINSOFT NV10 + glxropcode 4199 + alias VertexAttrib3dv + +VertexAttrib3fNV(index, x, y, z) + return void + param index UInt32 in value + param x Float32 in value + param y Float32 in value + param z Float32 in value + category NV_vertex_program + version 1.2 + vectorequiv VertexAttrib3fvNV + extension soft WINSOFT NV10 + alias VertexAttrib3f + +VertexAttrib3fvNV(index, v) + return void + param index UInt32 in value + param v Float32 in array [3] + category NV_vertex_program + version 1.2 + extension soft WINSOFT NV10 + glxropcode 4195 + alias VertexAttrib3fv + +VertexAttrib3sNV(index, x, y, z) + return void + param index UInt32 in value + param x Int16 in value + param y Int16 in value + param z Int16 in value + category NV_vertex_program + version 1.2 + vectorequiv VertexAttrib3svNV + extension soft WINSOFT NV10 + alias VertexAttrib3s + +VertexAttrib3svNV(index, v) + return void + param index UInt32 in value + param v Int16 in array [3] + category NV_vertex_program + version 1.2 + extension soft WINSOFT NV10 + glxropcode 4191 + alias VertexAttrib3sv + +VertexAttrib4dNV(index, x, y, z, w) + return void + param index UInt32 in value + param x Float64 in value + param y Float64 in value + param z Float64 in value + param w Float64 in value + category NV_vertex_program + version 1.2 + vectorequiv VertexAttrib4dvNV + extension soft WINSOFT NV10 + alias VertexAttrib4d + +VertexAttrib4dvNV(index, v) + return void + param index UInt32 in value + param v Float64 in array [4] + category NV_vertex_program + version 1.2 + extension soft WINSOFT NV10 + glxropcode 4200 + alias VertexAttrib4dv + +VertexAttrib4fNV(index, x, y, z, w) + return void + param index UInt32 in value + param x Float32 in value + param y Float32 in value + param z Float32 in value + param w Float32 in value + category NV_vertex_program + version 1.2 + vectorequiv VertexAttrib4fvNV + extension soft WINSOFT NV10 + alias VertexAttrib4f + +VertexAttrib4fvNV(index, v) + return void + param index UInt32 in value + param v Float32 in array [4] + category NV_vertex_program + version 1.2 + extension soft WINSOFT NV10 + glxropcode 4196 + alias VertexAttrib4fv + +VertexAttrib4sNV(index, x, y, z, w) + return void + param index UInt32 in value + param x Int16 in value + param y Int16 in value + param z Int16 in value + param w Int16 in value + category NV_vertex_program + version 1.2 + vectorequiv VertexAttrib4svNV + extension soft WINSOFT NV10 + alias VertexAttrib4s + +VertexAttrib4svNV(index, v) + return void + param index UInt32 in value + param v Int16 in array [4] + category NV_vertex_program + version 1.2 + extension soft WINSOFT NV10 + glxropcode 4192 + alias VertexAttrib4sv + +VertexAttrib4ubNV(index, x, y, z, w) + return void + param index UInt32 in value + param x ColorUB in value + param y ColorUB in value + param z ColorUB in value + param w ColorUB in value + category NV_vertex_program + version 1.2 + extension soft WINSOFT NV10 + vectorequiv VertexAttrib4ubvNV + alias VertexAttrib4Nub + +VertexAttrib4ubvNV(index, v) + return void + param index UInt32 in value + param v ColorUB in array [4] + category NV_vertex_program + version 1.2 + extension soft WINSOFT NV10 + glxropcode 4201 + alias VertexAttrib4Nubv + +VertexAttribs1dvNV(index, count, v) + return void + param index UInt32 in value + param count SizeI in value + param v Float64 in array [count] + category NV_vertex_program + dlflags handcode + version 1.2 + extension soft WINSOFT NV10 + glxropcode 4210 + offset 629 + +VertexAttribs1fvNV(index, count, v) + return void + param index UInt32 in value + param count SizeI in value + param v Float32 in array [count] + category NV_vertex_program + dlflags handcode + version 1.2 + extension soft WINSOFT NV10 + glxropcode 4206 + offset 630 + +VertexAttribs1svNV(index, count, v) + return void + param index UInt32 in value + param count SizeI in value + param v Int16 in array [count] + category NV_vertex_program + dlflags handcode + version 1.2 + extension soft WINSOFT NV10 + glxropcode 4202 + offset 631 + +VertexAttribs2dvNV(index, count, v) + return void + param index UInt32 in value + param count SizeI in value + param v Float64 in array [count*2] + category NV_vertex_program + dlflags handcode + version 1.2 + extension soft WINSOFT NV10 + glxropcode 4211 + offset 632 + +VertexAttribs2fvNV(index, count, v) + return void + param index UInt32 in value + param count SizeI in value + param v Float32 in array [count*2] + category NV_vertex_program + dlflags handcode + version 1.2 + extension soft WINSOFT NV10 + glxropcode 4207 + offset 633 + +VertexAttribs2svNV(index, count, v) + return void + param index UInt32 in value + param count SizeI in value + param v Int16 in array [count*2] + category NV_vertex_program + dlflags handcode + version 1.2 + extension soft WINSOFT NV10 + glxropcode 4203 + offset 634 + +VertexAttribs3dvNV(index, count, v) + return void + param index UInt32 in value + param count SizeI in value + param v Float64 in array [count*3] + category NV_vertex_program + dlflags handcode + version 1.2 + extension soft WINSOFT NV10 + glxropcode 4212 + offset 635 + +VertexAttribs3fvNV(index, count, v) + return void + param index UInt32 in value + param count SizeI in value + param v Float32 in array [count*3] + category NV_vertex_program + dlflags handcode + version 1.2 + extension soft WINSOFT NV10 + glxropcode 4208 + offset 636 + +VertexAttribs3svNV(index, count, v) + return void + param index UInt32 in value + param count SizeI in value + param v Int16 in array [count*3] + category NV_vertex_program + dlflags handcode + version 1.2 + extension soft WINSOFT NV10 + glxropcode 4204 + offset 637 + +VertexAttribs4dvNV(index, count, v) + return void + param index UInt32 in value + param count SizeI in value + param v Float64 in array [count*4] + category NV_vertex_program + dlflags handcode + version 1.2 + extension soft WINSOFT NV10 + glxropcode 4213 + offset 638 + +VertexAttribs4fvNV(index, count, v) + return void + param index UInt32 in value + param count SizeI in value + param v Float32 in array [count*4] + category NV_vertex_program + dlflags handcode + version 1.2 + extension soft WINSOFT NV10 + glxropcode 4209 + offset 639 + +VertexAttribs4svNV(index, count, v) + return void + param index UInt32 in value + param count SizeI in value + param v Int16 in array [count*4] + category NV_vertex_program + dlflags handcode + version 1.2 + extension soft WINSOFT NV10 + glxropcode 4205 + offset 640 + +VertexAttribs4ubvNV(index, count, v) + return void + param index UInt32 in value + param count SizeI in value + param v ColorUB in array [count*4] + category NV_vertex_program + dlflags handcode + version 1.2 + extension soft WINSOFT NV10 + glxropcode 4214 + offset 641 + + +############################################################################### +# +# Extension #234 - GLX_SGIX_visual_select_group +# +############################################################################### + +############################################################################### +# +# Extension #235 +# SGIX_texture_coordinate_clamp commands +# +############################################################################### + +# (none) +newcategory: SGIX_texture_coordinate_clamp + +############################################################################### +# +# Extension #236 +# SGIX_scalebias_hint commands +# +############################################################################### + +# (none) +newcategory: SGIX_scalebias_hint + +############################################################################### +# +# Extension #237 - GLX_OML_swap_method commands +# Extension #238 - GLX_OML_sync_control commands +# +############################################################################### + +############################################################################### +# +# Extension #239 +# OML_interlace commands +# +############################################################################### + +# (none) +newcategory: OML_interlace + +############################################################################### +# +# Extension #240 +# OML_subsample commands +# +############################################################################### + +# (none) +newcategory: OML_subsample + +############################################################################### +# +# Extension #241 +# OML_resample commands +# +############################################################################### + +# (none) +newcategory: OML_resample + +############################################################################### +# +# Extension #242 - WGL_OML_sync_control commands +# +############################################################################### + +############################################################################### +# +# Extension #243 +# NV_copy_depth_to_color commands +# +############################################################################### + +# (none) +newcategory: NV_copy_depth_to_color + +############################################################################### +# +# Extension #244 +# ATI_envmap_bumpmap commands +# +############################################################################### + +TexBumpParameterivATI(pname, param) + return void + param pname TexBumpParameterATI in value + param param Int32 in array [COMPSIZE(pname)] + category ATI_envmap_bumpmap + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +TexBumpParameterfvATI(pname, param) + return void + param pname TexBumpParameterATI in value + param param Float32 in array [COMPSIZE(pname)] + category ATI_envmap_bumpmap + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +GetTexBumpParameterivATI(pname, param) + return void + param pname GetTexBumpParameterATI in value + param param Int32 out array [COMPSIZE(pname)] + category ATI_envmap_bumpmap + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +GetTexBumpParameterfvATI(pname, param) + return void + param pname GetTexBumpParameterATI in value + param param Float32 out array [COMPSIZE(pname)] + category ATI_envmap_bumpmap + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +############################################################################### +# +# Extension #245 +# ATI_fragment_shader commands +# +############################################################################### + +GenFragmentShadersATI(range) + return UInt32 + param range UInt32 in value + category ATI_fragment_shader + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +BindFragmentShaderATI(id) + return void + param id UInt32 in value + category ATI_fragment_shader + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +DeleteFragmentShaderATI(id) + return void + param id UInt32 in value + category ATI_fragment_shader + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +BeginFragmentShaderATI() + return void + category ATI_fragment_shader + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +EndFragmentShaderATI() + return void + category ATI_fragment_shader + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +PassTexCoordATI(dst, coord, swizzle) + return void + param dst UInt32 in value + param coord UInt32 in value + param swizzle SwizzleOpATI in value + category ATI_fragment_shader + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +SampleMapATI(dst, interp, swizzle) + return void + param dst UInt32 in value + param interp UInt32 in value + param swizzle SwizzleOpATI in value + category ATI_fragment_shader + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +ColorFragmentOp1ATI(op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod) + return void + param op FragmentOpATI in value + param dst UInt32 in value + param dstMask UInt32 in value + param dstMod UInt32 in value + param arg1 UInt32 in value + param arg1Rep UInt32 in value + param arg1Mod UInt32 in value + category ATI_fragment_shader + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +ColorFragmentOp2ATI(op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod) + return void + param op FragmentOpATI in value + param dst UInt32 in value + param dstMask UInt32 in value + param dstMod UInt32 in value + param arg1 UInt32 in value + param arg1Rep UInt32 in value + param arg1Mod UInt32 in value + param arg2 UInt32 in value + param arg2Rep UInt32 in value + param arg2Mod UInt32 in value + category ATI_fragment_shader + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +ColorFragmentOp3ATI(op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod, arg3, arg3Rep, arg3Mod) + return void + param op FragmentOpATI in value + param dst UInt32 in value + param dstMask UInt32 in value + param dstMod UInt32 in value + param arg1 UInt32 in value + param arg1Rep UInt32 in value + param arg1Mod UInt32 in value + param arg2 UInt32 in value + param arg2Rep UInt32 in value + param arg2Mod UInt32 in value + param arg3 UInt32 in value + param arg3Rep UInt32 in value + param arg3Mod UInt32 in value + category ATI_fragment_shader + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +AlphaFragmentOp1ATI(op, dst, dstMod, arg1, arg1Rep, arg1Mod) + return void + param op FragmentOpATI in value + param dst UInt32 in value + param dstMod UInt32 in value + param arg1 UInt32 in value + param arg1Rep UInt32 in value + param arg1Mod UInt32 in value + category ATI_fragment_shader + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +AlphaFragmentOp2ATI(op, dst, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod) + return void + param op FragmentOpATI in value + param dst UInt32 in value + param dstMod UInt32 in value + param arg1 UInt32 in value + param arg1Rep UInt32 in value + param arg1Mod UInt32 in value + param arg2 UInt32 in value + param arg2Rep UInt32 in value + param arg2Mod UInt32 in value + category ATI_fragment_shader + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +AlphaFragmentOp3ATI(op, dst, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod, arg3, arg3Rep, arg3Mod) + return void + param op FragmentOpATI in value + param dst UInt32 in value + param dstMod UInt32 in value + param arg1 UInt32 in value + param arg1Rep UInt32 in value + param arg1Mod UInt32 in value + param arg2 UInt32 in value + param arg2Rep UInt32 in value + param arg2Mod UInt32 in value + param arg3 UInt32 in value + param arg3Rep UInt32 in value + param arg3Mod UInt32 in value + category ATI_fragment_shader + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +SetFragmentShaderConstantATI(dst, value) + return void + param dst UInt32 in value + param value ConstFloat32 in array [4] + category ATI_fragment_shader + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +############################################################################### +# +# Extension #246 +# ATI_pn_triangles commands +# +############################################################################### + +PNTrianglesiATI(pname, param) + return void + param pname PNTrianglesPNameATI in value + param param Int32 in value + category ATI_pn_triangles + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +PNTrianglesfATI(pname, param) + return void + param pname PNTrianglesPNameATI in value + param param Float32 in value + category ATI_pn_triangles + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +############################################################################### +# +# Extension #247 +# ATI_vertex_array_object commands +# +############################################################################### + +NewObjectBufferATI(size, pointer, usage) + return UInt32 + param size SizeI in value + param pointer ConstVoid in array [size] + param usage ArrayObjectUsageATI in value + category ATI_vertex_array_object + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +IsObjectBufferATI(buffer) + return Boolean + param buffer UInt32 in value + category ATI_vertex_array_object + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +UpdateObjectBufferATI(buffer, offset, size, pointer, preserve) + return void + param buffer UInt32 in value + param offset UInt32 in value + param size SizeI in value + param pointer ConstVoid in array [size] + param preserve PreserveModeATI in value + category ATI_vertex_array_object + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +GetObjectBufferfvATI(buffer, pname, params) + return void + param buffer UInt32 in value + param pname ArrayObjectPNameATI in value + param params Float32 out array [1] + category ATI_vertex_array_object + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +GetObjectBufferivATI(buffer, pname, params) + return void + param buffer UInt32 in value + param pname ArrayObjectPNameATI in value + param params Int32 out array [1] + category ATI_vertex_array_object + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +FreeObjectBufferATI(buffer) + return void + param buffer UInt32 in value + category ATI_vertex_array_object + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +ArrayObjectATI(array, size, type, stride, buffer, offset) + return void + param array EnableCap in value + param size Int32 in value + param type ScalarType in value + param stride SizeI in value + param buffer UInt32 in value + param offset UInt32 in value + category ATI_vertex_array_object + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +GetArrayObjectfvATI(array, pname, params) + return void + param array EnableCap in value + param pname ArrayObjectPNameATI in value + param params Float32 out array [1] + category ATI_vertex_array_object + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +GetArrayObjectivATI(array, pname, params) + return void + param array EnableCap in value + param pname ArrayObjectPNameATI in value + param params Int32 out array [1] + category ATI_vertex_array_object + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +VariantArrayObjectATI(id, type, stride, buffer, offset) + return void + param id UInt32 in value + param type ScalarType in value + param stride SizeI in value + param buffer UInt32 in value + param offset UInt32 in value + category ATI_vertex_array_object + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +GetVariantArrayObjectfvATI(id, pname, params) + return void + param id UInt32 in value + param pname ArrayObjectPNameATI in value + param params Float32 out array [1] + category ATI_vertex_array_object + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +GetVariantArrayObjectivATI(id, pname, params) + return void + param id UInt32 in value + param pname ArrayObjectPNameATI in value + param params Int32 out array [1] + category ATI_vertex_array_object + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +############################################################################### +# +# Extension #248 +# EXT_vertex_shader commands +# +############################################################################### + +BeginVertexShaderEXT() + return void + category EXT_vertex_shader + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +EndVertexShaderEXT() + return void + category EXT_vertex_shader + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +BindVertexShaderEXT(id) + return void + param id UInt32 in value + category EXT_vertex_shader + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +GenVertexShadersEXT(range) + return UInt32 + param range UInt32 in value + category EXT_vertex_shader + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +DeleteVertexShaderEXT(id) + return void + param id UInt32 in value + category EXT_vertex_shader + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +ShaderOp1EXT(op, res, arg1) + return void + param op VertexShaderOpEXT in value + param res UInt32 in value + param arg1 UInt32 in value + category EXT_vertex_shader + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +ShaderOp2EXT(op, res, arg1, arg2) + return void + param op VertexShaderOpEXT in value + param res UInt32 in value + param arg1 UInt32 in value + param arg2 UInt32 in value + category EXT_vertex_shader + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +ShaderOp3EXT(op, res, arg1, arg2, arg3) + return void + param op VertexShaderOpEXT in value + param res UInt32 in value + param arg1 UInt32 in value + param arg2 UInt32 in value + param arg3 UInt32 in value + category EXT_vertex_shader + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +SwizzleEXT(res, in, outX, outY, outZ, outW) + return void + param res UInt32 in value + param in UInt32 in value + param outX VertexShaderCoordOutEXT in value + param outY VertexShaderCoordOutEXT in value + param outZ VertexShaderCoordOutEXT in value + param outW VertexShaderCoordOutEXT in value + category EXT_vertex_shader + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +WriteMaskEXT(res, in, outX, outY, outZ, outW) + return void + param res UInt32 in value + param in UInt32 in value + param outX VertexShaderWriteMaskEXT in value + param outY VertexShaderWriteMaskEXT in value + param outZ VertexShaderWriteMaskEXT in value + param outW VertexShaderWriteMaskEXT in value + category EXT_vertex_shader + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +InsertComponentEXT(res, src, num) + return void + param res UInt32 in value + param src UInt32 in value + param num UInt32 in value + category EXT_vertex_shader + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +ExtractComponentEXT(res, src, num) + return void + param res UInt32 in value + param src UInt32 in value + param num UInt32 in value + category EXT_vertex_shader + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +GenSymbolsEXT(datatype, storagetype, range, components) + return UInt32 + param datatype DataTypeEXT in value + param storagetype VertexShaderStorageTypeEXT in value + param range ParameterRangeEXT in value + param components UInt32 in value + category EXT_vertex_shader + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +SetInvariantEXT(id, type, addr) + return void + param id UInt32 in value + param type ScalarType in value + param addr Void in array [COMPSIZE(id/type)] + category EXT_vertex_shader + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +SetLocalConstantEXT(id, type, addr) + return void + param id UInt32 in value + param type ScalarType in value + param addr Void in array [COMPSIZE(id/type)] + category EXT_vertex_shader + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VariantbvEXT(id, addr) + return void + param id UInt32 in value + param addr Int8 in array [COMPSIZE(id)] + category EXT_vertex_shader + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VariantsvEXT(id, addr) + return void + param id UInt32 in value + param addr Int16 in array [COMPSIZE(id)] + category EXT_vertex_shader + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VariantivEXT(id, addr) + return void + param id UInt32 in value + param addr Int32 in array [COMPSIZE(id)] + category EXT_vertex_shader + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VariantfvEXT(id, addr) + return void + param id UInt32 in value + param addr Float32 in array [COMPSIZE(id)] + category EXT_vertex_shader + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VariantdvEXT(id, addr) + return void + param id UInt32 in value + param addr Float64 in array [COMPSIZE(id)] + category EXT_vertex_shader + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VariantubvEXT(id, addr) + return void + param id UInt32 in value + param addr UInt8 in array [COMPSIZE(id)] + category EXT_vertex_shader + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VariantusvEXT(id, addr) + return void + param id UInt32 in value + param addr UInt16 in array [COMPSIZE(id)] + category EXT_vertex_shader + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VariantuivEXT(id, addr) + return void + param id UInt32 in value + param addr UInt32 in array [COMPSIZE(id)] + category EXT_vertex_shader + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VariantPointerEXT(id, type, stride, addr) + return void + param id UInt32 in value + param type ScalarType in value + param stride UInt32 in value + param addr Void in array [COMPSIZE(id/type/stride)] + category EXT_vertex_shader + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +EnableVariantClientStateEXT(id) + return void + param id UInt32 in value + category EXT_vertex_shader + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +DisableVariantClientStateEXT(id) + return void + param id UInt32 in value + category EXT_vertex_shader + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +BindLightParameterEXT(light, value) + return UInt32 + param light LightName in value + param value LightParameter in value + category EXT_vertex_shader + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +BindMaterialParameterEXT(face, value) + return UInt32 + param face MaterialFace in value + param value MaterialParameter in value + category EXT_vertex_shader + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +BindTexGenParameterEXT(unit, coord, value) + return UInt32 + param unit TextureUnit in value + param coord TextureCoordName in value + param value TextureGenParameter in value + category EXT_vertex_shader + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +BindTextureUnitParameterEXT(unit, value) + return UInt32 + param unit TextureUnit in value + param value VertexShaderTextureUnitParameter in value + category EXT_vertex_shader + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +BindParameterEXT(value) + return UInt32 + param value VertexShaderParameterEXT in value + category EXT_vertex_shader + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +IsVariantEnabledEXT(id, cap) + return Boolean + param id UInt32 in value + param cap VariantCapEXT in value + category EXT_vertex_shader + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +GetVariantBooleanvEXT(id, value, data) + return void + param id UInt32 in value + param value GetVariantValueEXT in value + param data Boolean out array [COMPSIZE(id)] + category EXT_vertex_shader + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +GetVariantIntegervEXT(id, value, data) + return void + param id UInt32 in value + param value GetVariantValueEXT in value + param data Int32 out array [COMPSIZE(id)] + category EXT_vertex_shader + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +GetVariantFloatvEXT(id, value, data) + return void + param id UInt32 in value + param value GetVariantValueEXT in value + param data Float32 out array [COMPSIZE(id)] + category EXT_vertex_shader + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +GetVariantPointervEXT(id, value, data) + return void + param id UInt32 in value + param value GetVariantValueEXT in value + param data VoidPointer out array [COMPSIZE(id)] + category EXT_vertex_shader + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +GetInvariantBooleanvEXT(id, value, data) + return void + param id UInt32 in value + param value GetVariantValueEXT in value + param data Boolean out array [COMPSIZE(id)] + category EXT_vertex_shader + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +GetInvariantIntegervEXT(id, value, data) + return void + param id UInt32 in value + param value GetVariantValueEXT in value + param data Int32 out array [COMPSIZE(id)] + category EXT_vertex_shader + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +GetInvariantFloatvEXT(id, value, data) + return void + param id UInt32 in value + param value GetVariantValueEXT in value + param data Float32 out array [COMPSIZE(id)] + category EXT_vertex_shader + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +GetLocalConstantBooleanvEXT(id, value, data) + return void + param id UInt32 in value + param value GetVariantValueEXT in value + param data Boolean out array [COMPSIZE(id)] + category EXT_vertex_shader + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +GetLocalConstantIntegervEXT(id, value, data) + return void + param id UInt32 in value + param value GetVariantValueEXT in value + param data Int32 out array [COMPSIZE(id)] + category EXT_vertex_shader + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +GetLocalConstantFloatvEXT(id, value, data) + return void + param id UInt32 in value + param value GetVariantValueEXT in value + param data Float32 out array [COMPSIZE(id)] + category EXT_vertex_shader + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +############################################################################### +# +# Extension #249 +# ATI_vertex_streams commands +# +############################################################################### + +VertexStream1sATI(stream, x) + return void + param stream VertexStreamATI in value + param x Int16 in value + category ATI_vertex_streams + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexStream1svATI(stream, coords) + return void + param stream VertexStreamATI in value + param coords Int16 in array [1] + category ATI_vertex_streams + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexStream1iATI(stream, x) + return void + param stream VertexStreamATI in value + param x Int32 in value + category ATI_vertex_streams + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexStream1ivATI(stream, coords) + return void + param stream VertexStreamATI in value + param coords Int32 in array [1] + category ATI_vertex_streams + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexStream1fATI(stream, x) + return void + param stream VertexStreamATI in value + param x Float32 in value + category ATI_vertex_streams + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexStream1fvATI(stream, coords) + return void + param stream VertexStreamATI in value + param coords Float32 in array [1] + category ATI_vertex_streams + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexStream1dATI(stream, x) + return void + param stream VertexStreamATI in value + param x Float64 in value + category ATI_vertex_streams + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexStream1dvATI(stream, coords) + return void + param stream VertexStreamATI in value + param coords Float64 in array [1] + category ATI_vertex_streams + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexStream2sATI(stream, x, y) + return void + param stream VertexStreamATI in value + param x Int16 in value + param y Int16 in value + category ATI_vertex_streams + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexStream2svATI(stream, coords) + return void + param stream VertexStreamATI in value + param coords Int16 in array [2] + category ATI_vertex_streams + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexStream2iATI(stream, x, y) + return void + param stream VertexStreamATI in value + param x Int32 in value + param y Int32 in value + category ATI_vertex_streams + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexStream2ivATI(stream, coords) + return void + param stream VertexStreamATI in value + param coords Int32 in array [2] + category ATI_vertex_streams + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexStream2fATI(stream, x, y) + return void + param stream VertexStreamATI in value + param x Float32 in value + param y Float32 in value + category ATI_vertex_streams + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexStream2fvATI(stream, coords) + return void + param stream VertexStreamATI in value + param coords Float32 in array [2] + category ATI_vertex_streams + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexStream2dATI(stream, x, y) + return void + param stream VertexStreamATI in value + param x Float64 in value + param y Float64 in value + category ATI_vertex_streams + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexStream2dvATI(stream, coords) + return void + param stream VertexStreamATI in value + param coords Float64 in array [2] + category ATI_vertex_streams + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexStream3sATI(stream, x, y, z) + return void + param stream VertexStreamATI in value + param x Int16 in value + param y Int16 in value + param z Int16 in value + category ATI_vertex_streams + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexStream3svATI(stream, coords) + return void + param stream VertexStreamATI in value + param coords Int16 in array [3] + category ATI_vertex_streams + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexStream3iATI(stream, x, y, z) + return void + param stream VertexStreamATI in value + param x Int32 in value + param y Int32 in value + param z Int32 in value + category ATI_vertex_streams + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexStream3ivATI(stream, coords) + return void + param stream VertexStreamATI in value + param coords Int32 in array [3] + category ATI_vertex_streams + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexStream3fATI(stream, x, y, z) + return void + param stream VertexStreamATI in value + param x Float32 in value + param y Float32 in value + param z Float32 in value + category ATI_vertex_streams + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexStream3fvATI(stream, coords) + return void + param stream VertexStreamATI in value + param coords Float32 in array [3] + category ATI_vertex_streams + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexStream3dATI(stream, x, y, z) + return void + param stream VertexStreamATI in value + param x Float64 in value + param y Float64 in value + param z Float64 in value + category ATI_vertex_streams + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexStream3dvATI(stream, coords) + return void + param stream VertexStreamATI in value + param coords Float64 in array [3] + category ATI_vertex_streams + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexStream4sATI(stream, x, y, z, w) + return void + param stream VertexStreamATI in value + param x Int16 in value + param y Int16 in value + param z Int16 in value + param w Int16 in value + category ATI_vertex_streams + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexStream4svATI(stream, coords) + return void + param stream VertexStreamATI in value + param coords Int16 in array [4] + category ATI_vertex_streams + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexStream4iATI(stream, x, y, z, w) + return void + param stream VertexStreamATI in value + param x Int32 in value + param y Int32 in value + param z Int32 in value + param w Int32 in value + category ATI_vertex_streams + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexStream4ivATI(stream, coords) + return void + param stream VertexStreamATI in value + param coords Int32 in array [4] + category ATI_vertex_streams + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexStream4fATI(stream, x, y, z, w) + return void + param stream VertexStreamATI in value + param x Float32 in value + param y Float32 in value + param z Float32 in value + param w Float32 in value + category ATI_vertex_streams + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexStream4fvATI(stream, coords) + return void + param stream VertexStreamATI in value + param coords Float32 in array [4] + category ATI_vertex_streams + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexStream4dATI(stream, x, y, z, w) + return void + param stream VertexStreamATI in value + param x Float64 in value + param y Float64 in value + param z Float64 in value + param w Float64 in value + category ATI_vertex_streams + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexStream4dvATI(stream, coords) + return void + param stream VertexStreamATI in value + param coords Float64 in array [4] + category ATI_vertex_streams + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +NormalStream3bATI(stream, nx, ny, nz) + return void + param stream VertexStreamATI in value + param nx Int8 in value + param ny Int8 in value + param nz Int8 in value + category ATI_vertex_streams + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +NormalStream3bvATI(stream, coords) + return void + param stream VertexStreamATI in value + param coords Int8 in array [3] + category ATI_vertex_streams + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +NormalStream3sATI(stream, nx, ny, nz) + return void + param stream VertexStreamATI in value + param nx Int16 in value + param ny Int16 in value + param nz Int16 in value + category ATI_vertex_streams + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +NormalStream3svATI(stream, coords) + return void + param stream VertexStreamATI in value + param coords Int16 in array [3] + category ATI_vertex_streams + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +NormalStream3iATI(stream, nx, ny, nz) + return void + param stream VertexStreamATI in value + param nx Int32 in value + param ny Int32 in value + param nz Int32 in value + category ATI_vertex_streams + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +NormalStream3ivATI(stream, coords) + return void + param stream VertexStreamATI in value + param coords Int32 in array [3] + category ATI_vertex_streams + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +NormalStream3fATI(stream, nx, ny, nz) + return void + param stream VertexStreamATI in value + param nx Float32 in value + param ny Float32 in value + param nz Float32 in value + category ATI_vertex_streams + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +NormalStream3fvATI(stream, coords) + return void + param stream VertexStreamATI in value + param coords Float32 in array [3] + category ATI_vertex_streams + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +NormalStream3dATI(stream, nx, ny, nz) + return void + param stream VertexStreamATI in value + param nx Float64 in value + param ny Float64 in value + param nz Float64 in value + category ATI_vertex_streams + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +NormalStream3dvATI(stream, coords) + return void + param stream VertexStreamATI in value + param coords Float64 in array [3] + category ATI_vertex_streams + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +ClientActiveVertexStreamATI(stream) + return void + param stream VertexStreamATI in value + category ATI_vertex_streams + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexBlendEnviATI(pname, param) + return void + param pname VertexStreamATI in value + param param Int32 in value + category ATI_vertex_streams + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexBlendEnvfATI(pname, param) + return void + param pname VertexStreamATI in value + param param Float32 in value + category ATI_vertex_streams + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +############################################################################### +# +# Extension #250 - WGL_I3D_digital_video_control +# Extension #251 - WGL_I3D_gamma +# Extension #252 - WGL_I3D_genlock +# Extension #253 - WGL_I3D_image_buffer +# Extension #254 - WGL_I3D_swap_frame_lock +# Extension #255 - WGL_I3D_swap_frame_usage +# +############################################################################### + +############################################################################### +# +# Extension #256 +# ATI_element_array commands +# +############################################################################### + +ElementPointerATI(type, pointer) + return void + param type ElementPointerTypeATI in value + param pointer Void in array [COMPSIZE(type)] retained + category ATI_element_array + dlflags notlistable + glxflags client-handcode client-intercept server-handcode + version 1.2 + offset ? + +DrawElementArrayATI(mode, count) + return void + param mode BeginMode in value + param count SizeI in value + category ATI_element_array + dlflags handcode + glxflags client-handcode client-intercept server-handcode + version 1.2 + offset ? + +DrawRangeElementArrayATI(mode, start, end, count) + return void + param mode BeginMode in value + param start UInt32 in value + param end UInt32 in value + param count SizeI in value + category ATI_element_array + dlflags handcode + glxflags client-handcode client-intercept server-handcode + version 1.2 + offset ? + +############################################################################### +# +# Extension #257 +# SUN_mesh_array commands +# +############################################################################### + +DrawMeshArraysSUN(mode, first, count, width) + return void + param mode BeginMode in value + param first Int32 in value + param count SizeI in value + param width SizeI in value + category SUN_mesh_array + dlflags handcode + glxflags client-handcode client-intercept server-handcode + version 1.1 + glxropcode ? + offset ? + +############################################################################### +# +# Extension #258 +# SUN_slice_accum commands +# +############################################################################### + +# (none) +newcategory: SUN_slice_accum + +############################################################################### +# +# Extension #259 +# NV_multisample_filter_hint commands +# +############################################################################### + +# (none) +newcategory: NV_multisample_filter_hint + +############################################################################### +# +# Extension #260 +# NV_depth_clamp commands +# +############################################################################### + +# (none) +newcategory: NV_depth_clamp + +############################################################################### +# +# Extension #261 +# NV_occlusion_query commands +# +############################################################################### + +GenOcclusionQueriesNV(n, ids) + return void + param n SizeI in value + param ids UInt32 out array [n] + dlflags notlistable + category NV_occlusion_query + version 1.2 + extension soft WINSOFT NV20 + glxflags ignore + +DeleteOcclusionQueriesNV(n, ids) + return void + param n SizeI in value + param ids UInt32 in array [n] + dlflags notlistable + category NV_occlusion_query + version 1.2 + extension soft WINSOFT NV20 + glxflags ignore + +IsOcclusionQueryNV(id) + return Boolean + param id UInt32 in value + dlflags notlistable + category NV_occlusion_query + version 1.2 + extension soft WINSOFT NV20 + glxflags ignore + +BeginOcclusionQueryNV(id) + return void + param id UInt32 in value + category NV_occlusion_query + version 1.2 + extension soft WINSOFT NV20 + glxflags ignore + +EndOcclusionQueryNV() + return void + category NV_occlusion_query + version 1.2 + extension soft WINSOFT NV20 + glxflags ignore + +GetOcclusionQueryivNV(id, pname, params) + return void + param id UInt32 in value + param pname OcclusionQueryParameterNameNV in value + param params Int32 out array [COMPSIZE(pname)] + dlflags notlistable + category NV_occlusion_query + version 1.2 + extension soft WINSOFT NV20 + glxflags ignore + +GetOcclusionQueryuivNV(id, pname, params) + return void + param id UInt32 in value + param pname OcclusionQueryParameterNameNV in value + param params UInt32 out array [COMPSIZE(pname)] + dlflags notlistable + category NV_occlusion_query + version 1.2 + extension soft WINSOFT NV20 + glxflags ignore + +############################################################################### +# +# Extension #262 +# NV_point_sprite commands +# +############################################################################### + +PointParameteriNV(pname, param) + return void + param pname PointParameterNameARB in value + param param Int32 in value + category NV_point_sprite + version 1.2 + extension soft WINSOFT NV20 + glxropcode 4221 + alias PointParameteri + +PointParameterivNV(pname, params) + return void + param pname PointParameterNameARB in value + param params Int32 in array [COMPSIZE(pname)] + category NV_point_sprite + version 1.2 + extension soft WINSOFT NV20 + glxropcode 4222 + alias PointParameteriv + +############################################################################### +# +# Extension #263 - WGL_NV_render_depth_texture +# Extension #264 - WGL_NV_render_texture_rectangle +# +############################################################################### + +############################################################################### +# +# Extension #265 +# NV_texture_shader3 commands +# +############################################################################### + +# (none) +newcategory: NV_texture_shader3 + +############################################################################### +# +# Extension #266 +# NV_vertex_program1_1 commands +# +############################################################################### + +# (none) +newcategory: NV_vertex_program1_1 + +############################################################################### +# +# Extension #267 +# EXT_shadow_funcs commands +# +############################################################################### + +# (none) +newcategory: EXT_shadow_funcs + +############################################################################### +# +# Extension #268 +# EXT_stencil_two_side commands +# +############################################################################### + +ActiveStencilFaceEXT(face) + return void + param face StencilFaceDirection in value + category EXT_stencil_two_side + version 1.3 + glxropcode 4220 + offset 646 + +############################################################################### +# +# Extension #269 +# ATI_text_fragment_shader commands +# +############################################################################### + +# Uses ARB_vertex_program entry points +newcategory: ATI_text_fragment_shader + +############################################################################### +# +# Extension #270 +# APPLE_client_storage commands +# +############################################################################### + +# (none) +newcategory: APPLE_client_storage + +############################################################################### +# +# Extension #271 +# APPLE_element_array commands +# +############################################################################### + +# @@ Need to verify/add GLX protocol + +# @@@ like #256 ATI_element_array +ElementPointerAPPLE(type, pointer) + return void + param type ElementPointerTypeATI in value + param pointer Void in array [type] + category APPLE_element_array + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +DrawElementArrayAPPLE(mode, first, count) + return void + param mode BeginMode in value + param first Int32 in value + param count SizeI in value + category APPLE_element_array + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +DrawRangeElementArrayAPPLE(mode, start, end, first, count) + return void + param mode BeginMode in value + param start UInt32 in value + param end UInt32 in value + param first Int32 in value + param count SizeI in value + category APPLE_element_array + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +MultiDrawElementArrayAPPLE(mode, first, count, primcount) + return void + param mode BeginMode in value + param first Int32 in array [primcount] + param count SizeI in array [primcount] + param primcount SizeI in value + category APPLE_element_array + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +MultiDrawRangeElementArrayAPPLE(mode, start, end, first, count, primcount) + return void + param mode BeginMode in value + param start UInt32 in value + param end UInt32 in value + param first Int32 in array [primcount] + param count SizeI in array [primcount] + param primcount SizeI in value + category APPLE_element_array + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +############################################################################### +# +# Extension #272 +# APPLE_fence commands +# +############################################################################### + +# @@ Need to verify/add GLX protocol + +# @@@ like #222 NV_fence +GenFencesAPPLE(n, fences) + return void + param n SizeI in value + param fences FenceNV out array [n] + category APPLE_fence + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +DeleteFencesAPPLE(n, fences) + return void + param n SizeI in value + param fences FenceNV in array [n] + category APPLE_fence + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +SetFenceAPPLE(fence) + return void + param fence FenceNV in value + category APPLE_fence + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +IsFenceAPPLE(fence) + return Boolean + param fence FenceNV in value + category APPLE_fence + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +TestFenceAPPLE(fence) + return Boolean + param fence FenceNV in value + category APPLE_fence + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +FinishFenceAPPLE(fence) + return void + param fence FenceNV in value + category APPLE_fence + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +TestObjectAPPLE(object, name) + return Boolean + param object ObjectTypeAPPLE in value + param name UInt32 in value + category APPLE_fence + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +FinishObjectAPPLE(object, name) + return void + param object ObjectTypeAPPLE in value + param name Int32 in value + category APPLE_fence + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +############################################################################### +# +# Extension #273 +# APPLE_vertex_array_object commands +# +############################################################################### + +BindVertexArrayAPPLE(array) + return void + param array UInt32 in value + category APPLE_vertex_array_object + version 1.2 + extension + glxropcode ? + glxflags ignore + alias BindVertexArray + +DeleteVertexArraysAPPLE(n, arrays) + return void + param n SizeI in value + param arrays UInt32 in array [n] + category APPLE_vertex_array_object + version 1.2 + extension + glxropcode ? + glxflags ignore + alias DeleteVertexArrays + +GenVertexArraysAPPLE(n, arrays) + return void + param n SizeI in value + param arrays UInt32 out array [n] + category APPLE_vertex_array_object + version 1.2 + extension + glxropcode ? + glxflags ignore + alias GenVertexArray + +IsVertexArrayAPPLE(array) + return Boolean + param array UInt32 in value + category APPLE_vertex_array_object + version 1.2 + extension + glxropcode ? + glxflags ignore + alias IsVertexArray + +############################################################################### +# +# Extension #274 +# APPLE_vertex_array_range commands +# +############################################################################### + +# @@ Need to verify/add GLX protocol + +# @@@ like #190 NV_vertex_array_range, +VertexArrayRangeAPPLE(length, pointer) + return void + param length SizeI in value + param pointer Void out array [length] + category APPLE_vertex_array_range + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +FlushVertexArrayRangeAPPLE(length, pointer) + return void + param length SizeI in value + param pointer Void out array [length] + category APPLE_vertex_array_range + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexArrayParameteriAPPLE(pname, param) + return void + param pname VertexArrayPNameAPPLE in value + param param Int32 in value + category APPLE_vertex_array_range + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +############################################################################### +# +# Extension #275 +# APPLE_ycbcr_422 commands +# +############################################################################### + +# (none) +newcategory: APPLE_ycbcr_422 + +############################################################################### +# +# Extension #276 +# S3_s3tc commands +# +############################################################################### + +# (none) +newcategory: S3_s3tc + +############################################################################### +# +# Extension #277 +# ATI_draw_buffers commands +# +############################################################################### + +DrawBuffersATI(n, bufs) + return void + param n SizeI in value + param bufs DrawBufferModeATI in array [n] + category ATI_draw_buffers + version 1.2 + extension + glxropcode 233 + alias DrawBuffers + +############################################################################### +# +# Extension #278 - WGL_ATI_pixel_format_float +# +############################################################################### +newcategory: ATI_pixel_format_float +passthru: /* This is really a WGL extension, but defines some associated GL enums. +passthru: * ATI does not export "GL_ATI_pixel_format_float" in the GL_EXTENSIONS string. +passthru: */ + +############################################################################### +# +# Extension #279 +# ATI_texture_env_combine3 commands +# +############################################################################### + +# (none) +newcategory: ATI_texture_env_combine3 + +############################################################################### +# +# Extension #280 +# ATI_texture_float commands +# +############################################################################### + +# (none) +newcategory: ATI_texture_float + +############################################################################### +# +# Extension #281 (also WGL_NV_float_buffer) +# NV_float_buffer commands +# +############################################################################### + +# (none) +newcategory: NV_float_buffer + +############################################################################### +# +# Extension #282 +# NV_fragment_program commands +# +############################################################################### + +# @@ Need to verify/add GLX protocol + +# Some NV_fragment_program entry points are shared with ARB_vertex_program, +# and are only included in that #define block, for now. +newcategory: NV_fragment_program +passthru: /* Some NV_fragment_program entry points are shared with ARB_vertex_program. */ + +ProgramNamedParameter4fNV(id, len, name, x, y, z, w) + return void + param id UInt32 in value + param len SizeI in value + param name UInt8 in array [1] + param x Float32 in value + param y Float32 in value + param z Float32 in value + param w Float32 in value + category NV_fragment_program + version 1.2 + extension + glxropcode ? + glxflags ignore + offset 682 + +ProgramNamedParameter4dNV(id, len, name, x, y, z, w) + return void + param id UInt32 in value + param len SizeI in value + param name UInt8 in array [1] + param x Float64 in value + param y Float64 in value + param z Float64 in value + param w Float64 in value + category NV_fragment_program + version 1.2 + extension + glxropcode ? + glxflags ignore + offset 683 + +ProgramNamedParameter4fvNV(id, len, name, v) + return void + param id UInt32 in value + param len SizeI in value + param name UInt8 in array [1] + param v Float32 in array [4] + category NV_fragment_program + version 1.2 + extension + glxropcode ? + glxflags ignore + offset 684 + +ProgramNamedParameter4dvNV(id, len, name, v) + return void + param id UInt32 in value + param len SizeI in value + param name UInt8 in array [1] + param v Float64 in array [4] + category NV_fragment_program + version 1.2 + extension + glxropcode ? + glxflags ignore + offset 685 + +GetProgramNamedParameterfvNV(id, len, name, params) + return void + param id UInt32 in value + param len SizeI in value + param name UInt8 in array [1] + param params Float32 out array [4] + category NV_fragment_program + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset 686 + +GetProgramNamedParameterdvNV(id, len, name, params) + return void + param id UInt32 in value + param len SizeI in value + param name UInt8 in array [1] + param params Float64 out array [4] + category NV_fragment_program + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset 687 + +############################################################################### +# +# Extension #283 +# NV_half_float commands +# +############################################################################### + +# @@ Need to verify/add GLX protocol + +Vertex2hNV(x, y) + return void + param x Half16NV in value + param y Half16NV in value + category NV_half_float + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +Vertex2hvNV(v) + return void + param v Half16NV in array [2] + category NV_half_float + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +Vertex3hNV(x, y, z) + return void + param x Half16NV in value + param y Half16NV in value + param z Half16NV in value + category NV_half_float + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +Vertex3hvNV(v) + return void + param v Half16NV in array [3] + category NV_half_float + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +Vertex4hNV(x, y, z, w) + return void + param x Half16NV in value + param y Half16NV in value + param z Half16NV in value + param w Half16NV in value + category NV_half_float + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +Vertex4hvNV(v) + return void + param v Half16NV in array [4] + category NV_half_float + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +Normal3hNV(nx, ny, nz) + return void + param nx Half16NV in value + param ny Half16NV in value + param nz Half16NV in value + category NV_half_float + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +Normal3hvNV(v) + return void + param v Half16NV in array [3] + category NV_half_float + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +Color3hNV(red, green, blue) + return void + param red Half16NV in value + param green Half16NV in value + param blue Half16NV in value + category NV_half_float + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +Color3hvNV(v) + return void + param v Half16NV in array [3] + category NV_half_float + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +Color4hNV(red, green, blue, alpha) + return void + param red Half16NV in value + param green Half16NV in value + param blue Half16NV in value + param alpha Half16NV in value + category NV_half_float + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +Color4hvNV(v) + return void + param v Half16NV in array [4] + category NV_half_float + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +TexCoord1hNV(s) + return void + param s Half16NV in value + category NV_half_float + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +TexCoord1hvNV(v) + return void + param v Half16NV in array [1] + category NV_half_float + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +TexCoord2hNV(s, t) + return void + param s Half16NV in value + param t Half16NV in value + category NV_half_float + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +TexCoord2hvNV(v) + return void + param v Half16NV in array [2] + category NV_half_float + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +TexCoord3hNV(s, t, r) + return void + param s Half16NV in value + param t Half16NV in value + param r Half16NV in value + category NV_half_float + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +TexCoord3hvNV(v) + return void + param v Half16NV in array [3] + category NV_half_float + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +TexCoord4hNV(s, t, r, q) + return void + param s Half16NV in value + param t Half16NV in value + param r Half16NV in value + param q Half16NV in value + category NV_half_float + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +TexCoord4hvNV(v) + return void + param v Half16NV in array [4] + category NV_half_float + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +MultiTexCoord1hNV(target, s) + return void + param target TextureUnit in value + param s Half16NV in value + category NV_half_float + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +MultiTexCoord1hvNV(target, v) + return void + param target TextureUnit in value + param v Half16NV in array [1] + category NV_half_float + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +MultiTexCoord2hNV(target, s, t) + return void + param target TextureUnit in value + param s Half16NV in value + param t Half16NV in value + category NV_half_float + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +MultiTexCoord2hvNV(target, v) + return void + param target TextureUnit in value + param v Half16NV in array [2] + category NV_half_float + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +MultiTexCoord3hNV(target, s, t, r) + return void + param target TextureUnit in value + param s Half16NV in value + param t Half16NV in value + param r Half16NV in value + category NV_half_float + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +MultiTexCoord3hvNV(target, v) + return void + param target TextureUnit in value + param v Half16NV in array [3] + category NV_half_float + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +MultiTexCoord4hNV(target, s, t, r, q) + return void + param target TextureUnit in value + param s Half16NV in value + param t Half16NV in value + param r Half16NV in value + param q Half16NV in value + category NV_half_float + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +MultiTexCoord4hvNV(target, v) + return void + param target TextureUnit in value + param v Half16NV in array [4] + category NV_half_float + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +FogCoordhNV(fog) + return void + param fog Half16NV in value + category NV_half_float + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +FogCoordhvNV(fog) + return void + param fog Half16NV in array [1] + category NV_half_float + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +SecondaryColor3hNV(red, green, blue) + return void + param red Half16NV in value + param green Half16NV in value + param blue Half16NV in value + category NV_half_float + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +SecondaryColor3hvNV(v) + return void + param v Half16NV in array [3] + category NV_half_float + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexWeighthNV(weight) + return void + param weight Half16NV in value + category NV_half_float + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexWeighthvNV(weight) + return void + param weight Half16NV in array [1] + category NV_half_float + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexAttrib1hNV(index, x) + return void + param index UInt32 in value + param x Half16NV in value + category NV_half_float + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexAttrib1hvNV(index, v) + return void + param index UInt32 in value + param v Half16NV in array [1] + category NV_half_float + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexAttrib2hNV(index, x, y) + return void + param index UInt32 in value + param x Half16NV in value + param y Half16NV in value + category NV_half_float + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexAttrib2hvNV(index, v) + return void + param index UInt32 in value + param v Half16NV in array [2] + category NV_half_float + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexAttrib3hNV(index, x, y, z) + return void + param index UInt32 in value + param x Half16NV in value + param y Half16NV in value + param z Half16NV in value + category NV_half_float + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexAttrib3hvNV(index, v) + return void + param index UInt32 in value + param v Half16NV in array [3] + category NV_half_float + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexAttrib4hNV(index, x, y, z, w) + return void + param index UInt32 in value + param x Half16NV in value + param y Half16NV in value + param z Half16NV in value + param w Half16NV in value + category NV_half_float + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexAttrib4hvNV(index, v) + return void + param index UInt32 in value + param v Half16NV in array [4] + category NV_half_float + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexAttribs1hvNV(index, n, v) + return void + param index UInt32 in value + param n SizeI in value + param v Half16NV in array [n] + category NV_half_float + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexAttribs2hvNV(index, n, v) + return void + param index UInt32 in value + param n SizeI in value + param v Half16NV in array [n] + category NV_half_float + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexAttribs3hvNV(index, n, v) + return void + param index UInt32 in value + param n SizeI in value + param v Half16NV in array [n] + category NV_half_float + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexAttribs4hvNV(index, n, v) + return void + param index UInt32 in value + param n SizeI in value + param v Half16NV in array [n] + category NV_half_float + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +############################################################################### +# +# Extension #284 +# NV_pixel_data_range commands +# +############################################################################### + +# @@ Need to verify/add GLX protocol + +PixelDataRangeNV(target, length, pointer) + return void + param target PixelDataRangeTargetNV in value + param length SizeI in value + param pointer Void out array [length] + category NV_pixel_data_range + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +FlushPixelDataRangeNV(target) + return void + param target PixelDataRangeTargetNV in value + category NV_pixel_data_range + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +############################################################################### +# +# Extension #285 +# NV_primitive_restart commands +# +############################################################################### + +# @@ Need to verify/add GLX protocol + +PrimitiveRestartNV() + return void + category NV_primitive_restart + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +PrimitiveRestartIndexNV(index) + return void + param index UInt32 in value + category NV_primitive_restart + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + + +############################################################################### +# +# Extension #286 +# NV_texture_expand_normal commands +# +############################################################################### + +# (none) +newcategory: NV_texture_expand_normal + +############################################################################### +# +# Extension #287 +# NV_vertex_program2 commands +# +############################################################################### + +# (none) +newcategory: NV_vertex_program2 + +############################################################################### +# +# Extension #288 +# ATI_map_object_buffer commands +# +############################################################################### + +# @@ Need to verify/add GLX protocol + +MapObjectBufferATI(buffer) + return VoidPointer + param buffer UInt32 in value + category ATI_map_object_buffer + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +UnmapObjectBufferATI(buffer) + return void + param buffer UInt32 in value + category ATI_map_object_buffer + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +############################################################################### +# +# Extension #289 +# ATI_separate_stencil commands +# +############################################################################### + +# @@ Need to verify/add GLX protocol + +StencilOpSeparateATI(face, sfail, dpfail, dppass) + return void + param face StencilFaceDirection in value + param sfail StencilOp in value + param dpfail StencilOp in value + param dppass StencilOp in value + category ATI_separate_stencil + version 1.2 + extension + glxropcode ? + glxflags ignore + alias StencilOpSeparate + +StencilFuncSeparateATI(frontfunc, backfunc, ref, mask) + return void + param frontfunc StencilFunction in value + param backfunc StencilFunction in value + param ref ClampedStencilValue in value + param mask MaskedStencilValue in value + category ATI_separate_stencil + version 1.2 + extension + glxropcode ? + glxflags ignore + alias StencilFuncSeparate + +############################################################################### +# +# Extension #290 +# ATI_vertex_attrib_array_object commands +# +############################################################################### + +# @@ Need to verify/add GLX protocol + +VertexAttribArrayObjectATI(index, size, type, normalized, stride, buffer, offset) + return void + param index UInt32 in value + param size Int32 in value + param type VertexAttribPointerTypeARB in value + param normalized Boolean in value + param stride SizeI in value + param buffer UInt32 in value + param offset UInt32 in value + category ATI_vertex_attrib_array_object + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +GetVertexAttribArrayObjectfvATI(index, pname, params) + return void + param index UInt32 in value + param pname ArrayObjectPNameATI in value + param params Float32 out array [pname] + category ATI_vertex_attrib_array_object + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +GetVertexAttribArrayObjectivATI(index, pname, params) + return void + param index UInt32 in value + param pname ArrayObjectPNameATI in value + param params Int32 out array [pname] + category ATI_vertex_attrib_array_object + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +############################################################################### +# +# Extension #291 - OpenGL ES only, not in glext.h +# OES_byte_coordinates commands +# +############################################################################### + +# void Vertex{234}bOES(T coords) +# void Vertex{234}bvOES(T *coords) +# void TexCoord{1234}bOES(T coords) +# void TexCoord{1234}bvOES(T *coords) +# void MultiTexCoord{1234}bOES(enum texture, T coords) +# void MultiTexCoord{1234}bvOES(enum texture, T *coords) +# All are handcode - mapped to non-byte GLX protocol on client side + +# newcategory: OES_byte_coordinates + +############################################################################### +# +# Extension #292 - OpenGL ES only, not in glext.h +# OES_fixed_point commands +# +############################################################################### + +# Too many to list in just a comment - see spec in the extension registry +# All are handcode - mapped to non-byte GLX protocol on client side + +# newcategory: OES_fixed_point + +############################################################################### +# +# Extension #293 - OpenGL ES only, not in glext.h +# OES_single_precision commands +# +############################################################################### + +# void DepthRangefOES(clampf n, clampf f) +# void FrustumfOES(float l, float r, float b, float t, float n, float f) +# void OrthofOES(float l, float r, float b, float t, float n, float f) +# void ClipPlanefOES(enum plane, const float* equation) +# void glClearDepthfOES(clampd depth) +# GLX ropcodes 4308-4312 (not respectively, see extension spec) +# void GetClipPlanefOES(enum plane, float* equation) +# GLX vendor private 1421 + +# newcategory: OES_single_precision + +############################################################################### +# +# Extension #294 - OpenGL ES only, not in glext.h +# OES_compressed_paletted_texture commands +# +############################################################################### + +# (none) +# newcategory: OES_compressed_paletted_texture + +############################################################################### +# +# Extension #295 - This is an OpenGL ES extension, but also implemented in Mesa +# OES_read_format commands +# +############################################################################### + +# (none) +newcategory: OES_read_format + +############################################################################### +# +# Extension #296 - OpenGL ES only, not in glext.h +# OES_query_matrix commands +# +############################################################################### + +# bitfield queryMatrixxOES(fixed mantissa[16], int exponent[16]) +# All are handcode - mapped to non-byte GLX protocol on client side + +# newcategory: OES_query_matrix + +############################################################################### +# +# Extension #297 +# EXT_depth_bounds_test commands +# +############################################################################### + +DepthBoundsEXT(zmin, zmax) + return void + param zmin ClampedFloat64 in value + param zmax ClampedFloat64 in value + category EXT_depth_bounds_test + version 1.2 + extension + glxropcode 4229 + offset 699 + +############################################################################### +# +# Extension #298 +# EXT_texture_mirror_clamp commands +# +############################################################################### + +# (none) +newcategory: EXT_texture_mirror_clamp + +############################################################################### +# +# Extension #299 +# EXT_blend_equation_separate commands +# +############################################################################### + +BlendEquationSeparateEXT(modeRGB, modeAlpha) + return void + param modeRGB BlendEquationModeEXT in value + param modeAlpha BlendEquationModeEXT in value + category EXT_blend_equation_separate + version 1.2 + extension + glxropcode 4228 + alias BlendEquationSeparate + +############################################################################### +# +# Extension #300 +# MESA_pack_invert commands +# +############################################################################### + +# (none) +newcategory: MESA_pack_invert + +############################################################################### +# +# Extension #301 +# MESA_ycbcr_texture commands +# +############################################################################### + +# (none) +newcategory: MESA_ycbcr_texture + +############################################################################### +# +# Extension #301 +# MESA_ycbcr_texture commands +# +############################################################################### + +# (none) +newcategory: MESA_ycbcr_texture + +############################################################################### +# +# Extension #302 +# EXT_pixel_buffer_object commands +# +############################################################################### + +# (none) +newcategory: EXT_pixel_buffer_object + +############################################################################### +# +# Extension #303 +# NV_fragment_program_option commands +# +############################################################################### + +# (none) +newcategory: NV_fragment_program_option + +############################################################################### +# +# Extension #304 +# NV_fragment_program2 commands +# +############################################################################### + +# (none) +newcategory: NV_fragment_program2 + +############################################################################### +# +# Extension #305 +# NV_vertex_program2_option commands +# +############################################################################### + +# (none) +newcategory: NV_vertex_program2_option + +############################################################################### +# +# Extension #306 +# NV_vertex_program3 commands +# +############################################################################### + +# (none) +newcategory: NV_vertex_program3 + +############################################################################### +# +# Extension #307 - GLX_SGIX_hyperpipe commands +# Extension #308 - GLX_MESA_agp_offset commands +# Extension #309 - GL_EXT_texture_compression_dxt1 (OpenGL ES only, subset of _st3c version) +# +############################################################################### + +# (none) +# newcategory: EXT_texture_compression_dxt1 + +############################################################################### +# +# Extension #310 +# EXT_framebuffer_object commands +# +############################################################################### + +IsRenderbufferEXT(renderbuffer) + return Boolean + param renderbuffer UInt32 in value + category EXT_framebuffer_object + version 1.2 + extension + glxvendorpriv 1422 + glxflags ignore + alias IsRenderbuffer + +# Not aliased to BindRenderbuffer +BindRenderbufferEXT(target, renderbuffer) + return void + param target RenderbufferTarget in value + param renderbuffer UInt32 in value + category EXT_framebuffer_object + version 1.2 + extension + glxropcode 4316 + glxflags ignore + +DeleteRenderbuffersEXT(n, renderbuffers) + return void + param n SizeI in value + param renderbuffers UInt32 in array [n] + category EXT_framebuffer_object + version 1.2 + extension + glxropcode 4317 + glxflags ignore + alias DeleteRenderbuffers + +GenRenderbuffersEXT(n, renderbuffers) + return void + param n SizeI in value + param renderbuffers UInt32 out array [n] + category EXT_framebuffer_object + version 1.2 + extension + glxvendorpriv 1423 + glxflags ignore + alias GenRenderbuffers + +RenderbufferStorageEXT(target, internalformat, width, height) + return void + param target RenderbufferTarget in value + param internalformat GLenum in value + param width SizeI in value + param height SizeI in value + category EXT_framebuffer_object + version 1.2 + extension + glxropcode 4318 + glxflags ignore + alias RenderbufferStorage + +GetRenderbufferParameterivEXT(target, pname, params) + return void + param target RenderbufferTarget in value + param pname GLenum in value + param params Int32 out array [COMPSIZE(pname)] + category EXT_framebuffer_object + dlflags notlistable + version 1.2 + extension + glxvendorpriv 1424 + glxflags ignore + alias GetRenderbufferParameteriv + +IsFramebufferEXT(framebuffer) + return Boolean + param framebuffer UInt32 in value + category EXT_framebuffer_object + version 1.2 + extension + glxvendorpriv 1425 + glxflags ignore + alias IsFramebuffer + +# Not aliased to BindFramebuffer +BindFramebufferEXT(target, framebuffer) + return void + param target FramebufferTarget in value + param framebuffer UInt32 in value + category EXT_framebuffer_object + version 1.2 + extension + glxropcode 4319 + glxflags ignore + +DeleteFramebuffersEXT(n, framebuffers) + return void + param n SizeI in value + param framebuffers UInt32 in array [n] + category EXT_framebuffer_object + version 1.2 + extension + glxropcode 4320 + glxflags ignore + alias DeleteFramebuffers + +GenFramebuffersEXT(n, framebuffers) + return void + param n SizeI in value + param framebuffers UInt32 out array [n] + category EXT_framebuffer_object + version 1.2 + extension + glxvendorpriv 1426 + glxflags ignore + alias GenFramebuffers + +CheckFramebufferStatusEXT(target) + return GLenum + param target FramebufferTarget in value + category EXT_framebuffer_object + version 1.2 + extension + glxvendorpriv 1427 + glxflags ignore + alias CheckFramebufferStatus + +FramebufferTexture1DEXT(target, attachment, textarget, texture, level) + return void + param target FramebufferTarget in value + param attachment FramebufferAttachment in value + param textarget GLenum in value + param texture UInt32 in value + param level Int32 in value + category EXT_framebuffer_object + version 1.2 + extension + glxropcode 4321 + glxflags ignore + alias FramebufferTexture1D + +FramebufferTexture2DEXT(target, attachment, textarget, texture, level) + return void + param target FramebufferTarget in value + param attachment FramebufferAttachment in value + param textarget GLenum in value + param texture UInt32 in value + param level Int32 in value + category EXT_framebuffer_object + version 1.2 + extension + glxropcode 4322 + glxflags ignore + alias FramebufferTexture2D + +FramebufferTexture3DEXT(target, attachment, textarget, texture, level, zoffset) + return void + param target FramebufferTarget in value + param attachment FramebufferAttachment in value + param textarget GLenum in value + param texture UInt32 in value + param level Int32 in value + param zoffset Int32 in value + category EXT_framebuffer_object + version 1.2 + extension + glxropcode 4323 + glxflags ignore + alias FramebufferTexture3D + +FramebufferRenderbufferEXT(target, attachment, renderbuffertarget, renderbuffer) + return void + param target FramebufferTarget in value + param attachment FramebufferAttachment in value + param renderbuffertarget RenderbufferTarget in value + param renderbuffer UInt32 in value + category EXT_framebuffer_object + version 1.2 + extension + glxropcode 4324 + glxflags ignore + alias FramebufferRenderbuffer + +GetFramebufferAttachmentParameterivEXT(target, attachment, pname, params) + return void + param target FramebufferTarget in value + param attachment FramebufferAttachment in value + param pname GLenum in value + param params Int32 out array [COMPSIZE(pname)] + category EXT_framebuffer_object + dlflags notlistable + version 1.2 + extension + glxvendorpriv 1428 + glxflags ignore + alias GetFramebufferAttachmentParameteriv + +GenerateMipmapEXT(target) + return void + param target GLenum in value + category EXT_framebuffer_object + version 1.2 + extension + glxropcode 4325 + glxflags ignore + alias GenerateMipmap + + +############################################################################### +# +# Extension #311 +# GREMEDY_string_marker commands +# +############################################################################### + +StringMarkerGREMEDY(len, string) + return void + param len SizeI in value + param string Void in array [len] + category GREMEDY_string_marker + version 1.0 + extension + glxflags ignore + offset ? + +############################################################################### +# +# Extension #312 +# EXT_packed_depth_stencil commands +# +############################################################################### + +# (none) +newcategory: EXT_packed_depth_stencil + +############################################################################### +# +# Extension #313 - WGL_3DL_stereo_control +# +############################################################################### + +############################################################################### +# +# Extension #314 +# EXT_stencil_clear_tag commands +# +############################################################################### + +StencilClearTagEXT(stencilTagBits, stencilClearTag) + return void + param stencilTagBits SizeI in value + param stencilClearTag UInt32 in value + category EXT_stencil_clear_tag + version 1.5 + extension + glxropcode 4223 + glxflags ignore + offset ? + +############################################################################### +# +# Extension #315 +# EXT_texture_sRGB commands +# +############################################################################### + +# (none) +newcategory: EXT_texture_sRGB + +############################################################################### +# +# Extension #316 +# EXT_framebuffer_blit commands +# +############################################################################### + +BlitFramebufferEXT(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter) + return void + param srcX0 Int32 in value + param srcY0 Int32 in value + param srcX1 Int32 in value + param srcY1 Int32 in value + param dstX0 Int32 in value + param dstY0 Int32 in value + param dstX1 Int32 in value + param dstY1 Int32 in value + param mask ClearBufferMask in value + param filter GLenum in value + category EXT_framebuffer_blit + version 1.5 + glxropcode 4330 + alias BlitFramebuffer + +############################################################################### +# +# Extension #317 +# EXT_framebuffer_multisample commands +# +############################################################################### + +RenderbufferStorageMultisampleEXT(target, samples, internalformat, width, height) + return void + param target GLenum in value + param samples SizeI in value + param internalformat GLenum in value + param width SizeI in value + param height SizeI in value + category EXT_framebuffer_multisample + version 1.5 + glxropcode 4331 + alias RenderbufferStorageMultisample + +############################################################################### +# +# Extension #318 +# MESAX_texture_stack commands +# +############################################################################### + +# (none) +newcategory: MESAX_texture_stack + +############################################################################### +# +# Extension #319 +# EXT_timer_query commands +# +############################################################################### + +GetQueryObjecti64vEXT(id, pname, params) + return void + param id UInt32 in value + param pname GLenum in value + param params Int64EXT out array [pname] + category EXT_timer_query + dlflags notlistable + version 1.5 + glxvendorpriv 1328 + glxflags ignore + offset ? + +GetQueryObjectui64vEXT(id, pname, params) + return void + param id UInt32 in value + param pname GLenum in value + param params UInt64EXT out array [pname] + category EXT_timer_query + dlflags notlistable + version 1.5 + glxvendorpriv 1329 + glxflags ignore + offset ? + +############################################################################### +# +# Extension #320 +# EXT_gpu_program_parameters commands +# +############################################################################### + +ProgramEnvParameters4fvEXT(target, index, count, params) + return void + param target ProgramTargetARB in value + param index UInt32 in value + param count SizeI in value + param params Float32 in array [count*4] + category EXT_gpu_program_parameters + version 1.2 + glxropcode 4281 + offset ? + +ProgramLocalParameters4fvEXT(target, index, count, params) + return void + param target ProgramTargetARB in value + param index UInt32 in value + param count SizeI in value + param params Float32 in array [count*4] + category EXT_gpu_program_parameters + version 1.2 + glxropcode 4282 + offset ? + +############################################################################### +# +# Extension #321 +# APPLE_flush_buffer_range commands +# +############################################################################### + +BufferParameteriAPPLE(target, pname, param) + return void + param target GLenum in value + param pname GLenum in value + param param Int32 in value + category APPLE_flush_buffer_range + version 1.5 + extension + glxropcode ? + glxflags ignore + offset ? + +FlushMappedBufferRangeAPPLE(target, offset, size) + return void + param target GLenum in value + param offset BufferOffset in value + param size BufferSize in value + category APPLE_flush_buffer_range + version 1.5 + extension + glxropcode ? + glxflags ignore + alias FlushMappedBufferRange + +############################################################################### +# +# Extension #322 +# NV_gpu_program4 commands +# +############################################################################### + +ProgramLocalParameterI4iNV(target, index, x, y, z, w) + return void + param target ProgramTarget in value + param index UInt32 in value + param x Int32 in value + param y Int32 in value + param z Int32 in value + param w Int32 in value + category NV_gpu_program4 + version 1.3 + vectorequiv ProgramLocalParameterI4ivNV + glxvectorequiv ProgramLocalParameterI4ivNV + extension soft WINSOFT NV50 + glfflags ignore + glxflags ignore + +ProgramLocalParameterI4ivNV(target, index, params) + return void + param target ProgramTarget in value + param index UInt32 in value + param params Int32 in array [4] + category NV_gpu_program4 + version 1.3 + extension soft WINSOFT NV50 + glfflags ignore + glxflags ignore + +ProgramLocalParametersI4ivNV(target, index, count, params) + return void + param target ProgramTarget in value + param index UInt32 in value + param count SizeI in value + param params Int32 in array [count*4] + category NV_gpu_program4 + version 1.3 + extension soft WINSOFT NV50 + glfflags ignore + glxflags ignore + +ProgramLocalParameterI4uiNV(target, index, x, y, z, w) + return void + param target ProgramTarget in value + param index UInt32 in value + param x UInt32 in value + param y UInt32 in value + param z UInt32 in value + param w UInt32 in value + category NV_gpu_program4 + version 1.3 + vectorequiv ProgramLocalParameterI4uivNV + glxvectorequiv ProgramLocalParameterI4uivNV + extension soft WINSOFT NV50 + glfflags ignore + glxflags ignore + +ProgramLocalParameterI4uivNV(target, index, params) + return void + param target ProgramTarget in value + param index UInt32 in value + param params UInt32 in array [4] + category NV_gpu_program4 + version 1.3 + extension soft WINSOFT NV50 + glfflags ignore + glxflags ignore + +ProgramLocalParametersI4uivNV(target, index, count, params) + return void + param target ProgramTarget in value + param index UInt32 in value + param count SizeI in value + param params UInt32 in array [count*4] + category NV_gpu_program4 + version 1.3 + extension soft WINSOFT NV50 + glfflags ignore + glxflags ignore + +ProgramEnvParameterI4iNV(target, index, x, y, z, w) + return void + param target ProgramTarget in value + param index UInt32 in value + param x Int32 in value + param y Int32 in value + param z Int32 in value + param w Int32 in value + category NV_gpu_program4 + version 1.3 + vectorequiv ProgramEnvParameterI4ivNV + glxvectorequiv ProgramEnvParameterI4ivNV + extension soft WINSOFT NV50 + glfflags ignore + glxflags ignore + +ProgramEnvParameterI4ivNV(target, index, params) + return void + param target ProgramTarget in value + param index UInt32 in value + param params Int32 in array [4] + category NV_gpu_program4 + version 1.3 + extension soft WINSOFT NV50 + glfflags ignore + glxflags ignore + +ProgramEnvParametersI4ivNV(target, index, count, params) + return void + param target ProgramTarget in value + param index UInt32 in value + param count SizeI in value + param params Int32 in array [count*4] + category NV_gpu_program4 + version 1.3 + extension soft WINSOFT NV50 + glfflags ignore + glxflags ignore + +ProgramEnvParameterI4uiNV(target, index, x, y, z, w) + return void + param target ProgramTarget in value + param index UInt32 in value + param x UInt32 in value + param y UInt32 in value + param z UInt32 in value + param w UInt32 in value + category NV_gpu_program4 + version 1.3 + vectorequiv ProgramEnvParameterI4uivNV + glxvectorequiv ProgramEnvParameterI4uivNV + extension soft WINSOFT NV50 + glfflags ignore + glxflags ignore + +ProgramEnvParameterI4uivNV(target, index, params) + return void + param target ProgramTarget in value + param index UInt32 in value + param params UInt32 in array [4] + category NV_gpu_program4 + version 1.3 + extension soft WINSOFT NV50 + glfflags ignore + glxflags ignore + +ProgramEnvParametersI4uivNV(target, index, count, params) + return void + param target ProgramTarget in value + param index UInt32 in value + param count SizeI in value + param params UInt32 in array [count*4] + category NV_gpu_program4 + version 1.3 + extension soft WINSOFT NV50 + glfflags ignore + glxflags ignore + +GetProgramLocalParameterIivNV(target, index, params) + return void + param target ProgramTarget in value + param index UInt32 in value + param params Int32 out array [4] + dlflags notlistable + category NV_gpu_program4 + version 1.3 + extension soft WINSOFT NV50 + glfflags ignore + glxflags ignore + +GetProgramLocalParameterIuivNV(target, index, params) + return void + param target ProgramTarget in value + param index UInt32 in value + param params UInt32 out array [4] + dlflags notlistable + category NV_gpu_program4 + version 1.3 + extension soft WINSOFT NV50 + glfflags ignore + glxflags ignore + +GetProgramEnvParameterIivNV(target, index, params) + return void + param target ProgramTarget in value + param index UInt32 in value + param params Int32 out array [4] + dlflags notlistable + category NV_gpu_program4 + version 1.3 + extension soft WINSOFT NV50 + glfflags ignore + glxflags ignore + +GetProgramEnvParameterIuivNV(target, index, params) + return void + param target ProgramTarget in value + param index UInt32 in value + param params UInt32 out array [4] + dlflags notlistable + category NV_gpu_program4 + version 1.3 + extension soft WINSOFT NV50 + glfflags ignore + glxflags ignore + +############################################################################### +# +# Extension #323 +# NV_geometry_program4 commands +# +############################################################################### + +ProgramVertexLimitNV(target, limit) + return void + param target ProgramTarget in value + param limit Int32 in value + category NV_geometry_program4 + version 2.0 + extension soft WINSOFT + glfflags ignore + glxflags ignore + +FramebufferTextureEXT(target, attachment, texture, level) + return void + param target FramebufferTarget in value + param attachment FramebufferAttachment in value + param texture Texture in value + param level CheckedInt32 in value + category NV_geometry_program4 + version 2.0 + extension soft WINSOFT + dlflags notlistable + glfflags ignore + glxflags ignore + alias FramebufferTextureARB + +FramebufferTextureLayerEXT(target, attachment, texture, level, layer) + return void + param target FramebufferTarget in value + param attachment FramebufferAttachment in value + param texture Texture in value + param level CheckedInt32 in value + param layer CheckedInt32 in value + category NV_geometry_program4 + version 2.0 + extension soft WINSOFT + dlflags notlistable + glfflags ignore + glxflags ignore + alias FramebufferTextureLayer + +FramebufferTextureFaceEXT(target, attachment, texture, level, face) + return void + param target FramebufferTarget in value + param attachment FramebufferAttachment in value + param texture Texture in value + param level CheckedInt32 in value + param face TextureTarget in value + category NV_geometry_program4 + version 2.0 + extension soft WINSOFT + dlflags notlistable + glfflags ignore + glxflags ignore + alias FramebufferTextureFaceARB + +############################################################################### +# +# Extension #324 +# EXT_geometry_shader4 commands +# +############################################################################### + +ProgramParameteriEXT(program, pname, value) + return void + param program UInt32 in value + param pname ProgramParameterPName in value + param value Int32 in value + category EXT_geometry_shader4 + version 2.0 + extension soft WINSOFT + glfflags ignore + glxflags ignore + alias ProgramParameteriARB + +############################################################################### +# +# Extension #325 +# NV_vertex_program4 commands +# +############################################################################### + +VertexAttribI1iEXT(index, x) + return void + param index UInt32 in value + param x Int32 in value + category NV_vertex_program4 + beginend allow-inside + vectorequiv VertexAttribI1ivEXT + glxvectorequiv VertexAttribI1ivEXT + extension soft WINSOFT NV10 + glfflags ignore + glxflags ignore + alias VertexAttribI1i + +VertexAttribI2iEXT(index, x, y) + return void + param index UInt32 in value + param x Int32 in value + param y Int32 in value + category NV_vertex_program4 + beginend allow-inside + vectorequiv VertexAttribI2ivEXT + glxvectorequiv VertexAttribI2ivEXT + extension soft WINSOFT NV10 + glfflags ignore + glxflags ignore + alias VertexAttribI2i + +VertexAttribI3iEXT(index, x, y, z) + return void + param index UInt32 in value + param x Int32 in value + param y Int32 in value + param z Int32 in value + category NV_vertex_program4 + beginend allow-inside + vectorequiv VertexAttribI3ivEXT + glxvectorequiv VertexAttribI3ivEXT + extension soft WINSOFT NV10 + glfflags ignore + glxflags ignore + alias VertexAttribI3i + +VertexAttribI4iEXT(index, x, y, z, w) + return void + param index UInt32 in value + param x Int32 in value + param y Int32 in value + param z Int32 in value + param w Int32 in value + category NV_vertex_program4 + beginend allow-inside + vectorequiv VertexAttribI4ivEXT + glxvectorequiv VertexAttribI4ivEXT + extension soft WINSOFT NV10 + glfflags ignore + glxflags ignore + alias VertexAttribI4i + +VertexAttribI1uiEXT(index, x) + return void + param index UInt32 in value + param x UInt32 in value + category NV_vertex_program4 + beginend allow-inside + vectorequiv VertexAttribI1uivEXT + glxvectorequiv VertexAttribI1uivEXT + extension soft WINSOFT NV10 + glfflags ignore + glxflags ignore + alias VertexAttribI1ui + +VertexAttribI2uiEXT(index, x, y) + return void + param index UInt32 in value + param x UInt32 in value + param y UInt32 in value + category NV_vertex_program4 + beginend allow-inside + vectorequiv VertexAttribI2uivEXT + glxvectorequiv VertexAttribI2uivEXT + extension soft WINSOFT NV10 + glfflags ignore + glxflags ignore + alias VertexAttribI2ui + +VertexAttribI3uiEXT(index, x, y, z) + return void + param index UInt32 in value + param x UInt32 in value + param y UInt32 in value + param z UInt32 in value + category NV_vertex_program4 + beginend allow-inside + vectorequiv VertexAttribI3uivEXT + glxvectorequiv VertexAttribI3uivEXT + extension soft WINSOFT NV10 + glfflags ignore + glxflags ignore + alias VertexAttribI3ui + +VertexAttribI4uiEXT(index, x, y, z, w) + return void + param index UInt32 in value + param x UInt32 in value + param y UInt32 in value + param z UInt32 in value + param w UInt32 in value + category NV_vertex_program4 + beginend allow-inside + vectorequiv VertexAttribI4uivEXT + glxvectorequiv VertexAttribI4uivEXT + extension soft WINSOFT NV10 + glfflags ignore + glxflags ignore + alias VertexAttribI4ui + +VertexAttribI1ivEXT(index, v) + return void + param index UInt32 in value + param v Int32 in array [1] + category NV_vertex_program4 + beginend allow-inside + extension soft WINSOFT NV10 + glfflags ignore + glxflags ignore + alias VertexAttribI1iv + +VertexAttribI2ivEXT(index, v) + return void + param index UInt32 in value + param v Int32 in array [2] + category NV_vertex_program4 + beginend allow-inside + extension soft WINSOFT NV10 + glfflags ignore + glxflags ignore + alias VertexAttribI2iv + +VertexAttribI3ivEXT(index, v) + return void + param index UInt32 in value + param v Int32 in array [3] + category NV_vertex_program4 + beginend allow-inside + extension soft WINSOFT NV10 + glfflags ignore + glxflags ignore + alias VertexAttribI3iv + +VertexAttribI4ivEXT(index, v) + return void + param index UInt32 in value + param v Int32 in array [4] + category NV_vertex_program4 + beginend allow-inside + extension soft WINSOFT NV10 + glfflags ignore + glxflags ignore + alias VertexAttribI4iv + +VertexAttribI1uivEXT(index, v) + return void + param index UInt32 in value + param v UInt32 in array [1] + category NV_vertex_program4 + beginend allow-inside + extension soft WINSOFT NV10 + glfflags ignore + glxflags ignore + alias VertexAttribI1uiv + +VertexAttribI2uivEXT(index, v) + return void + param index UInt32 in value + param v UInt32 in array [2] + category NV_vertex_program4 + beginend allow-inside + extension soft WINSOFT NV10 + glfflags ignore + glxflags ignore + alias VertexAttribI2uiv + +VertexAttribI3uivEXT(index, v) + return void + param index UInt32 in value + param v UInt32 in array [3] + category NV_vertex_program4 + beginend allow-inside + extension soft WINSOFT NV10 + glfflags ignore + glxflags ignore + alias VertexAttribI3uiv + +VertexAttribI4uivEXT(index, v) + return void + param index UInt32 in value + param v UInt32 in array [4] + category NV_vertex_program4 + beginend allow-inside + extension soft WINSOFT NV10 + glfflags ignore + glxflags ignore + alias VertexAttribI4uiv + +VertexAttribI4bvEXT(index, v) + return void + param index UInt32 in value + param v Int8 in array [4] + category NV_vertex_program4 + beginend allow-inside + extension soft WINSOFT NV10 + glfflags ignore + glxflags ignore + alias VertexAttribI4bv + +VertexAttribI4svEXT(index, v) + return void + param index UInt32 in value + param v Int16 in array [4] + category NV_vertex_program4 + beginend allow-inside + extension soft WINSOFT NV10 + glfflags ignore + glxflags ignore + alias VertexAttribI4sv + +VertexAttribI4ubvEXT(index, v) + return void + param index UInt32 in value + param v UInt8 in array [4] + category NV_vertex_program4 + beginend allow-inside + extension soft WINSOFT NV10 + glfflags ignore + glxflags ignore + alias VertexAttribI4ubv + +VertexAttribI4usvEXT(index, v) + return void + param index UInt32 in value + param v UInt16 in array [4] + category NV_vertex_program4 + beginend allow-inside + extension soft WINSOFT NV10 + glfflags ignore + glxflags ignore + alias VertexAttribI4usv + +VertexAttribIPointerEXT(index, size, type, stride, pointer) + return void + param index UInt32 in value + param size Int32 in value + param type VertexAttribEnum in value + param stride SizeI in value + param pointer Void in array [COMPSIZE(size/type/stride)] retained + category NV_vertex_program4 + dlflags notlistable + extension soft WINSOFT NV10 + glfflags ignore + glxflags ignore + alias VertexAttribIPointer + +GetVertexAttribIivEXT(index, pname, params) + return void + param index UInt32 in value + param pname VertexAttribEnum in value + param params Int32 out array [1] + category NV_vertex_program4 + dlflags notlistable + extension soft WINSOFT NV10 + glfflags ignore + glxflags ignore + alias GetVertexAttribIiv + +GetVertexAttribIuivEXT(index, pname, params) + return void + param index UInt32 in value + param pname VertexAttribEnum in value + param params UInt32 out array [1] + category NV_vertex_program4 + dlflags notlistable + extension soft WINSOFT NV10 + glfflags ignore + glxflags ignore + alias GetVertexAttribIuiv + +############################################################################### +# +# Extension #326 +# EXT_gpu_shader4 commands +# +############################################################################### + +GetUniformuivEXT(program, location, params) + return void + param program UInt32 in value + param location Int32 in value + param params UInt32 out array [COMPSIZE(program/location)] + category EXT_gpu_shader4 + dlflags notlistable + version 2.0 + extension soft WINSOFT + glfflags ignore + glxflags ignore + alias GetUniformuiv + +BindFragDataLocationEXT(program, color, name) + return void + param program UInt32 in value + param color UInt32 in value + param name Char in array [COMPSIZE(name)] + category EXT_gpu_shader4 + dlflags notlistable + version 2.0 + extension soft WINSOFT + glfflags ignore + glxflags ignore + alias BindFragDataLocation + +GetFragDataLocationEXT(program, name) + return Int32 + param program UInt32 in value + param name Char in array [COMPSIZE(name)] + category EXT_gpu_shader4 + dlflags notlistable + version 2.0 + extension soft WINSOFT + glfflags ignore + glxflags ignore + alias GetFragDataLocation + +Uniform1uiEXT(location, v0) + return void + param location Int32 in value + param v0 UInt32 in value + category EXT_gpu_shader4 + version 2.0 + extension soft WINSOFT + glfflags ignore + glxflags ignore + alias Uniform1ui + +Uniform2uiEXT(location, v0, v1) + return void + param location Int32 in value + param v0 UInt32 in value + param v1 UInt32 in value + category EXT_gpu_shader4 + version 2.0 + extension soft WINSOFT + glfflags ignore + glxflags ignore + alias Uniform2ui + +Uniform3uiEXT(location, v0, v1, v2) + return void + param location Int32 in value + param v0 UInt32 in value + param v1 UInt32 in value + param v2 UInt32 in value + category EXT_gpu_shader4 + version 2.0 + extension soft WINSOFT + glfflags ignore + glxflags ignore + alias Uniform3ui + +Uniform4uiEXT(location, v0, v1, v2, v3) + return void + param location Int32 in value + param v0 UInt32 in value + param v1 UInt32 in value + param v2 UInt32 in value + param v3 UInt32 in value + category EXT_gpu_shader4 + version 2.0 + extension soft WINSOFT + glfflags ignore + glxflags ignore + alias Uniform4ui + +Uniform1uivEXT(location, count, value) + return void + param location Int32 in value + param count SizeI in value + param value UInt32 in array [count] + category EXT_gpu_shader4 + version 2.0 + extension soft WINSOFT + glfflags ignore + glxflags ignore + alias Uniform1uiv + +Uniform2uivEXT(location, count, value) + return void + param location Int32 in value + param count SizeI in value + param value UInt32 in array [count*2] + category EXT_gpu_shader4 + version 2.0 + extension soft WINSOFT + glfflags ignore + glxflags ignore + alias Uniform2uiv + +Uniform3uivEXT(location, count, value) + return void + param location Int32 in value + param count SizeI in value + param value UInt32 in array [count*3] + category EXT_gpu_shader4 + version 2.0 + extension soft WINSOFT + glfflags ignore + glxflags ignore + alias Uniform3uiv + +Uniform4uivEXT(location, count, value) + return void + param location Int32 in value + param count SizeI in value + param value UInt32 in array [count*4] + category EXT_gpu_shader4 + version 2.0 + extension soft WINSOFT + glfflags ignore + glxflags ignore + alias Uniform4uiv + +############################################################################### +# +# Extension #327 +# EXT_draw_instanced commands +# +############################################################################### + +DrawArraysInstancedEXT(mode, start, count, primcount) + return void + param mode BeginMode in value + param start Int32 in value + param count SizeI in value + param primcount SizeI in value + category EXT_draw_instanced + version 2.0 + extension soft WINSOFT + dlflags notlistable + vectorequiv ArrayElement + glfflags ignore + glxflags ignore + alias DrawArraysInstancedARB + +DrawElementsInstancedEXT(mode, count, type, indices, primcount) + return void + param mode BeginMode in value + param count SizeI in value + param type DrawElementsType in value + param indices Void in array [COMPSIZE(count/type)] + param primcount SizeI in value + category EXT_draw_instanced + version 2.0 + extension soft WINSOFT + dlflags notlistable + vectorequiv ArrayElement + glfflags ignore + glxflags ignore + alias DrawElementsInstancedARB + +############################################################################### +# +# Extension #328 +# EXT_packed_float commands +# +############################################################################### + +# (none) +newcategory: EXT_packed_float + +############################################################################### +# +# Extension #329 +# EXT_texture_array commands +# +############################################################################### + +# (none) +newcategory: EXT_texture_array + +############################################################################### +# +# Extension #330 +# EXT_texture_buffer_object commands +# +############################################################################### + +TexBufferEXT(target, internalformat, buffer) + return void + param target TextureTarget in value + param internalformat GLenum in value + param buffer UInt32 in value + category EXT_texture_buffer_object + version 2.0 + extension soft WINSOFT NV50 + glfflags ignore + glxflags ignore + alias TexBufferARB + +############################################################################### +# +# Extension #331 +# EXT_texture_compression_latc commands +# +############################################################################### + +# (none) +newcategory: EXT_texture_compression_latc + +############################################################################### +# +# Extension #332 +# EXT_texture_compression_rgtc commands +# +############################################################################### + +# (none) +newcategory: EXT_texture_compression_rgtc + +############################################################################### +# +# Extension #333 +# EXT_texture_shared_exponent commands +# +############################################################################### + +# (none) +newcategory: EXT_texture_shared_exponent + +############################################################################### +# +# Extension #334 +# NV_depth_buffer_float commands +# +############################################################################### + +DepthRangedNV(zNear, zFar) + return void + param zNear Float64 in value + param zFar Float64 in value + category NV_depth_buffer_float + extension soft WINSOFT NV50 + version 2.0 + glfflags ignore + glxflags ignore + +ClearDepthdNV(depth) + return void + param depth Float64 in value + category NV_depth_buffer_float + extension soft WINSOFT NV50 + version 2.0 + glfflags ignore + glxflags ignore + +DepthBoundsdNV(zmin, zmax) + return void + param zmin Float64 in value + param zmax Float64 in value + category NV_depth_buffer_float + extension soft WINSOFT NV50 + version 2.0 + glfflags ignore + glxflags ignore + +############################################################################### +# +# Extension #335 +# NV_fragment_program4 commands +# +############################################################################### + +# (none) +newcategory: NV_fragment_program4 + +############################################################################### +# +# Extension #336 +# NV_framebuffer_multisample_coverage commands +# +############################################################################### + +RenderbufferStorageMultisampleCoverageNV(target, coverageSamples, colorSamples, internalformat, width, height) + return void + param target RenderbufferTarget in value + param coverageSamples SizeI in value + param colorSamples SizeI in value + param internalformat PixelInternalFormat in value + param width SizeI in value + param height SizeI in value + category NV_framebuffer_multisample_coverage + version 1.5 + extension soft WINSOFT + dlflags notlistable + glfflags ignore + glxflags ignore + +############################################################################### +# +# Extension #337 +# EXT_framebuffer_sRGB commands +# +############################################################################### + +# (none) +newcategory: EXT_framebuffer_sRGB + +############################################################################### +# +# Extension #338 +# NV_geometry_shader4 commands +# +############################################################################### + +# (none) +newcategory: NV_geometry_shader4 + +############################################################################### +# +# Extension #339 +# NV_parameter_buffer_object commands +# +############################################################################### + +ProgramBufferParametersfvNV(target, buffer, index, count, params) + return void + param target ProgramTarget in value + param buffer UInt32 in value + param index UInt32 in value + param count SizeI in value + param params Float32 in array [count] + category NV_parameter_buffer_object + version 1.2 + extension soft WINSOFT NV50 + glfflags ignore + glxflags ignore + +ProgramBufferParametersIivNV(target, buffer, index, count, params) + return void + param target ProgramTarget in value + param buffer UInt32 in value + param index UInt32 in value + param count SizeI in value + param params Int32 in array [count] + category NV_parameter_buffer_object + version 1.2 + extension soft WINSOFT NV50 + glfflags ignore + glxflags ignore + +ProgramBufferParametersIuivNV(target, buffer, index, count, params) + return void + param target ProgramTarget in value + param buffer UInt32 in value + param index UInt32 in value + param count SizeI in value + param params UInt32 in array [count] + category NV_parameter_buffer_object + version 1.2 + extension soft WINSOFT NV50 + glfflags ignore + glxflags ignore + +############################################################################### +# +# Extension #340 +# EXT_draw_buffers2 commands +# +############################################################################### + +ColorMaskIndexedEXT(index, r, g, b, a) + return void + param index UInt32 in value + param r Boolean in value + param g Boolean in value + param b Boolean in value + param a Boolean in value + category EXT_draw_buffers2 + version 2.0 + glxflags ignore + glfflags ignore + extension soft WINSOFT + alias ColorMaski + +GetBooleanIndexedvEXT(target, index, data) + return void + param target GLenum in value + param index UInt32 in value + param data Boolean out array [COMPSIZE(target)] + category EXT_draw_buffers2 + version 2.0 + dlflags notlistable + glxflags ignore + glfflags ignore + extension soft WINSOFT + alias GetBooleani_v + +GetIntegerIndexedvEXT(target, index, data) + return void + param target GLenum in value + param index UInt32 in value + param data Int32 out array [COMPSIZE(target)] + category EXT_draw_buffers2 + version 2.0 + dlflags notlistable + glxflags ignore + glfflags ignore + extension soft WINSOFT + alias GetIntegeri_v + +EnableIndexedEXT(target, index) + return void + param target GLenum in value + param index UInt32 in value + category EXT_draw_buffers2 + version 2.0 + glxflags ignore + glfflags ignore + extension soft WINSOFT + alias Enablei + +DisableIndexedEXT(target, index) + return void + param target GLenum in value + param index UInt32 in value + category EXT_draw_buffers2 + version 2.0 + glxflags ignore + glfflags ignore + extension soft WINSOFT + alias Disablei + +IsEnabledIndexedEXT(target, index) + return Boolean + param target GLenum in value + param index UInt32 in value + category EXT_draw_buffers2 + version 2.0 + dlflags notlistable + glxflags ignore + glfflags ignore + extension soft WINSOFT + alias IsEnabledi + +############################################################################### +# +# Extension #341 +# NV_transform_feedback commands +# +############################################################################### + +BeginTransformFeedbackNV(primitiveMode) + return void + param primitiveMode GLenum in value + category NV_transform_feedback + version 1.5 + dlflags notlistable + glxflags ignore + glfflags ignore + extension soft WINSOFT + alias BeginTransformFeedback + +EndTransformFeedbackNV() + return void + category NV_transform_feedback + version 1.5 + dlflags notlistable + glxflags ignore + glfflags ignore + extension soft WINSOFT + alias EndTransformFeedback + +TransformFeedbackAttribsNV(count, attribs, bufferMode) + return void + param count UInt32 in value + param attribs Int32 in array [COMPSIZE(count)] + param bufferMode GLenum in value + category NV_transform_feedback + version 1.5 + dlflags notlistable + glxflags ignore + glfflags ignore + extension soft WINSOFT + +BindBufferRangeNV(target, index, buffer, offset, size) + return void + param target GLenum in value + param index UInt32 in value + param buffer UInt32 in value + param offset BufferOffset in value + param size BufferSize in value + category NV_transform_feedback + version 1.5 + dlflags notlistable + glxflags ignore + glfflags ignore + extension soft WINSOFT + alias BindBufferRange + +BindBufferOffsetNV(target, index, buffer, offset) + return void + param target GLenum in value + param index UInt32 in value + param buffer UInt32 in value + param offset BufferOffset in value + category NV_transform_feedback + version 1.5 + dlflags notlistable + glxflags ignore + glfflags ignore + extension soft WINSOFT + alias BindBufferOffsetEXT + +BindBufferBaseNV(target, index, buffer) + return void + param target GLenum in value + param index UInt32 in value + param buffer UInt32 in value + category NV_transform_feedback + version 1.5 + dlflags notlistable + glxflags ignore + glfflags ignore + extension soft WINSOFT + alias BindBufferBase + +TransformFeedbackVaryingsNV(program, count, locations, bufferMode) + return void + param program UInt32 in value + param count SizeI in value + param locations Int32 in array [count] + param bufferMode GLenum in value + category NV_transform_feedback + version 1.5 + dlflags notlistable + glxflags ignore + glfflags ignore + extension soft WINSOFT + alias TransformFeedbackVaryings + +ActiveVaryingNV(program, name) + return void + param program UInt32 in value + param name Char in array [COMPSIZE(name)] + category NV_transform_feedback + version 1.5 + dlflags notlistable + glxflags ignore + glfflags ignore + extension soft WINSOFT + +GetVaryingLocationNV(program, name) + return Int32 + param program UInt32 in value + param name Char in array [COMPSIZE(name)] + category NV_transform_feedback + dlflags notlistable + version 1.5 + glfflags ignore + glxflags ignore + extension soft WINSOFT + +GetActiveVaryingNV(program, index, bufSize, length, size, type, name) + return void + param program UInt32 in value + param index UInt32 in value + param bufSize SizeI in value + param length SizeI out array [1] + param size SizeI out array [1] + param type GLenum out array [1] + param name Char out array [COMPSIZE(program/index/bufSize)] + category NV_transform_feedback + dlflags notlistable + version 1.5 + extension soft WINSOFT + glfflags ignore + glxflags ignore + +GetTransformFeedbackVaryingNV(program, index, location) + return void + param program UInt32 in value + param index UInt32 in value + param location Int32 out array [1] + category NV_transform_feedback + dlflags notlistable + version 1.5 + extension soft WINSOFT + glfflags ignore + glxflags ignore + alias GetTransformFeedbackVarying + +# These commands require ARB_transform_feedback3 +#@@ void TransformFeedbackStreamAttribsNV(sizei count, const int * attribs, sizei nbuffers, const int *bufstreams, enum bufferMode); + +TransformFeedbackStreamAttribsNV(count, attribs, nbuffers, bufstreams, bufferMode) + return void + param count SizeI in value + param attribs Int32 in array [count] + param nbuffers SizeI in value + param bufstreams Int32 in array [nbuffers] + param bufferMode GLenum in value + category NV_transform_feedback + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + + +############################################################################### +# +# Extension #342 +# EXT_bindable_uniform commands +# +############################################################################### + +UniformBufferEXT(program, location, buffer) + return void + param program UInt32 in value + param location Int32 in value + param buffer UInt32 in value + category EXT_bindable_uniform + version 2.0 + extension soft WINSOFT + glxflags ignore + glfflags ignore + +GetUniformBufferSizeEXT(program, location) + return Int32 + param program UInt32 in value + param location Int32 in value + category EXT_bindable_uniform + dlflags notlistable + version 2.0 + extension soft WINSOFT + glfflags ignore + glxflags ignore + +GetUniformOffsetEXT(program, location) + return BufferOffset + param program UInt32 in value + param location Int32 in value + category EXT_bindable_uniform + dlflags notlistable + version 2.0 + extension soft WINSOFT + glfflags ignore + glxflags ignore + +############################################################################### +# +# Extension #343 +# EXT_texture_integer extension commands +# +############################################################################### + +TexParameterIivEXT(target, pname, params) + return void + param target TextureTarget in value + param pname TextureParameterName in value + param params Int32 in array [COMPSIZE(pname)] + category EXT_texture_integer + version 2.0 + extension soft WINSOFT NV50 + glfflags ignore + glxflags ignore + alias TexParameterIiv + +TexParameterIuivEXT(target, pname, params) + return void + param target TextureTarget in value + param pname TextureParameterName in value + param params UInt32 in array [COMPSIZE(pname)] + category EXT_texture_integer + version 2.0 + extension soft WINSOFT NV50 + glfflags ignore + glxflags ignore + alias TexParameterIuiv + +GetTexParameterIivEXT(target, pname, params) + return void + param target TextureTarget in value + param pname GetTextureParameter in value + param params Int32 out array [COMPSIZE(pname)] + category EXT_texture_integer + dlflags notlistable + version 1.0 + version 2.0 + extension soft WINSOFT NV50 + glfflags ignore + glxflags ignore + alias GetTexParameterIiv + +GetTexParameterIuivEXT(target, pname, params) + return void + param target TextureTarget in value + param pname GetTextureParameter in value + param params UInt32 out array [COMPSIZE(pname)] + category EXT_texture_integer + dlflags notlistable + version 1.0 + version 2.0 + extension soft WINSOFT NV50 + glfflags ignore + glxflags ignore + alias GetTexParameterIuiv + +ClearColorIiEXT(red, green, blue, alpha) + return void + param red Int32 in value + param green Int32 in value + param blue Int32 in value + param alpha Int32 in value + category EXT_texture_integer + version 2.0 + extension soft WINSOFT NV50 + glfflags ignore + glxflags ignore + +ClearColorIuiEXT(red, green, blue, alpha) + return void + param red UInt32 in value + param green UInt32 in value + param blue UInt32 in value + param alpha UInt32 in value + category EXT_texture_integer + version 2.0 + extension soft WINSOFT NV50 + glfflags ignore + glxflags ignore + +############################################################################### +# +# Extension #344 - GLX_EXT_texture_from_pixmap +# +############################################################################### + +############################################################################### +# +# Extension #345 +# GREMEDY_frame_terminator commands +# +############################################################################### + +FrameTerminatorGREMEDY() + return void + category GREMEDY_frame_terminator + version 1.0 + extension + glxflags ignore + offset ? + +############################################################################### +# +# Extension #346 +# NV_conditional_render commands +# +############################################################################### + +BeginConditionalRenderNV(id, mode) + return void + param id UInt32 in value + param mode TypeEnum in value + category NV_conditional_render + glfflags ignore + glxflags ignore + alias BeginConditionalRender + +EndConditionalRenderNV() + return void + category NV_conditional_render + glfflags ignore + glxflags ignore + alias EndConditionalRender + +############################################################################### +# +# Extension #347 +# NV_present_video commands +# +############################################################################### + +# TBD +# void PresentFrameKeyedNV(uint video_slot, uint64EXT minPresentTime, +# uint beginPresentTimeId, uint +# presentDurationId, enum type, enum target0, +# uint fill0, uint key0, enum target1, uint +# fill1, uint key1); +# +# void PresentFrameDualFillNV(uint video_slot, uint64EXT +# minPresentTime, uint beginPresentTimeId, +# uint presentDurationId, enum type, enum +# target0, uint fill0, enum target1, uint +# fill1, enum target2, uint fill2, enum +# target3, uint fill3); +# +# void GetVideoivNV(uint video_slot, enum pname, int *params); +# void GetVideouivNV(uint video_slot, enum pname, uint *params); +# void GetVideoi64vNV(uint video_slot, enum pname, int64EXT *params); +# void GetVideoui64vNV(uint video_slot, enum pname, uint64EXT *params); +# void VideoParameterivNV(uint video_slot, enum pname, const int *params); + +PresentFrameKeyedNV(video_slot, minPresentTime, beginPresentTimeId, presentDurationId, type, target0, fill0, key0, target1, fill1, key1) + return void + param video_slot UInt32 in value + param minPresentTime UInt64EXT in value + param beginPresentTimeId UInt32 in value + param presentDurationId UInt32 in value + param type GLenum in value + param target0 GLenum in value + param fill0 UInt32 in value + param key0 UInt32 in value + param target1 GLenum in value + param fill1 UInt32 in value + param key1 UInt32 in value + category NV_present_video + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +PresentFrameDualFillNV(video_slot, minPresentTime, beginPresentTimeId, presentDurationId, type, target0, fill0, target1, fill1, target2, fill2, target3, fill3) + return void + param video_slot UInt32 in value + param minPresentTime UInt64EXT in value + param beginPresentTimeId UInt32 in value + param presentDurationId UInt32 in value + param type GLenum in value + param target0 GLenum in value + param fill0 UInt32 in value + param target1 GLenum in value + param fill1 UInt32 in value + param target2 GLenum in value + param fill2 UInt32 in value + param target3 GLenum in value + param fill3 UInt32 in value + category NV_present_video + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +GetVideoivNV(video_slot, pname, params) + return void + param video_slot UInt32 in value + param pname GLenum in value + param params Int32 out array [COMPSIZE(pname)] + category NV_present_video + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +GetVideouivNV(video_slot, pname, params) + return void + param video_slot UInt32 in value + param pname GLenum in value + param params UInt32 out array [COMPSIZE(pname)] + category NV_present_video + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +GetVideoi64vNV(video_slot, pname, params) + return void + param video_slot UInt32 in value + param pname GLenum in value + param params Int64EXT out array [COMPSIZE(pname)] + category NV_present_video + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +GetVideoui64vNV(video_slot, pname, params) + return void + param video_slot UInt32 in value + param pname GLenum in value + param params UInt64EXT out array [COMPSIZE(pname)] + category NV_present_video + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +############################################################################### +# +# Extension #348 - GLX_NV_video_out +# Extension #349 - WGL_NV_video_out +# Extension #350 - GLX_NV_swap_group +# Extension #351 - WGL_NV_swap_group +# +############################################################################### + +############################################################################### +# +# Extension #352 +# EXT_transform_feedback commands +# +############################################################################### + +# From EXT_draw_buffers2: GetBooleanIndexedvEXT / GetIntegerIndexedvEXT + +BeginTransformFeedbackEXT(primitiveMode) + return void + param primitiveMode GLenum in value + category EXT_transform_feedback + version 2.0 + dlflags notlistable + glxflags ignore + glfflags ignore + extension soft WINSOFT + alias BeginTransformFeedback + +EndTransformFeedbackEXT() + return void + category EXT_transform_feedback + version 2.0 + dlflags notlistable + glxflags ignore + glfflags ignore + extension soft WINSOFT + alias EndTransformFeedback + +BindBufferRangeEXT(target, index, buffer, offset, size) + return void + param target GLenum in value + param index UInt32 in value + param buffer UInt32 in value + param offset BufferOffset in value + param size BufferSize in value + category EXT_transform_feedback + version 2.0 + dlflags notlistable + glxflags ignore + glfflags ignore + extension soft WINSOFT + alias BindBufferRange + +# Not promoted to the OpenGL 3.0 core +BindBufferOffsetEXT(target, index, buffer, offset) + return void + param target GLenum in value + param index UInt32 in value + param buffer UInt32 in value + param offset BufferOffset in value + category EXT_transform_feedback + version 2.0 + dlflags notlistable + glxflags ignore + glfflags ignore + extension soft WINSOFT + +BindBufferBaseEXT(target, index, buffer) + return void + param target GLenum in value + param index UInt32 in value + param buffer UInt32 in value + category EXT_transform_feedback + version 2.0 + dlflags notlistable + glxflags ignore + glfflags ignore + extension soft WINSOFT + alias BindBufferBase + +TransformFeedbackVaryingsEXT(program, count, varyings, bufferMode) + return void + param program UInt32 in value + param count SizeI in value + param varyings CharPointer in array [count] + param bufferMode GLenum in value + category EXT_transform_feedback + version 2.0 + dlflags notlistable + glxflags ignore + glfflags ignore + extension soft WINSOFT + alias TransformFeedbackVaryings + +GetTransformFeedbackVaryingEXT(program, index, bufSize, length, size, type, name) + return void + param program UInt32 in value + param index UInt32 in value + param bufSize SizeI in value + param length SizeI out array [1] + param size SizeI out array [1] + param type GLenum out array [1] + param name Char out array [COMPSIZE(length)] + category EXT_transform_feedback + dlflags notlistable + version 2.0 + extension soft WINSOFT + glfflags ignore + glxflags ignore + alias GetTransformFeedbackVarying + +############################################################################### +# +# Extension #353 +# EXT_direct_state_access commands +# +############################################################################### + +# New 1.1 client commands + +ClientAttribDefaultEXT(mask) + return void + param mask ClientAttribMask in value + category EXT_direct_state_access + extension soft WINSOFT + dlflags notlistable + glxflags ignore ### client-handcode client-intercept server-handcode + +PushClientAttribDefaultEXT(mask) + return void + param mask ClientAttribMask in value + category EXT_direct_state_access + extension soft WINSOFT + dlflags notlistable + glxflags ignore ### client-handcode client-intercept server-handcode + +# New 1.0 matrix commands + +MatrixLoadfEXT(mode, m) + return void + param mode MatrixMode in value + param m Float32 in array [16] + category EXT_direct_state_access + extension soft WINSOFT + glxflags ignore + glfflags ignore + +MatrixLoaddEXT(mode, m) + return void + param mode MatrixMode in value + param m Float64 in array [16] + category EXT_direct_state_access + extension soft WINSOFT + glxflags ignore + glfflags ignore + +MatrixMultfEXT(mode, m) + return void + param mode MatrixMode in value + param m Float32 in array [16] + category EXT_direct_state_access + extension soft WINSOFT + glxflags ignore + glfflags ignore + +MatrixMultdEXT(mode, m) + return void + param mode MatrixMode in value + param m Float64 in array [16] + category EXT_direct_state_access + extension soft WINSOFT + glxflags ignore + glfflags ignore + +MatrixLoadIdentityEXT(mode) + return void + param mode MatrixMode in value + category EXT_direct_state_access + extension soft WINSOFT + glxflags ignore + glfflags ignore + +MatrixRotatefEXT(mode, angle, x, y, z) + return void + param mode MatrixMode in value + param angle Float32 in value + param x Float32 in value + param y Float32 in value + param z Float32 in value + category EXT_direct_state_access + extension soft WINSOFT + glxflags ignore + glfflags ignore + +MatrixRotatedEXT(mode, angle, x, y, z) + return void + param mode MatrixMode in value + param angle Float64 in value + param x Float64 in value + param y Float64 in value + param z Float64 in value + category EXT_direct_state_access + extension soft WINSOFT + glxflags ignore + glfflags ignore + +MatrixScalefEXT(mode, x, y, z) + return void + param mode MatrixMode in value + param x Float32 in value + param y Float32 in value + param z Float32 in value + category EXT_direct_state_access + extension soft WINSOFT + glxflags ignore + glfflags ignore + +MatrixScaledEXT(mode, x, y, z) + return void + param mode MatrixMode in value + param x Float64 in value + param y Float64 in value + param z Float64 in value + category EXT_direct_state_access + extension soft WINSOFT + glxflags ignore + glfflags ignore + +MatrixTranslatefEXT(mode, x, y, z) + return void + param mode MatrixMode in value + param x Float32 in value + param y Float32 in value + param z Float32 in value + category EXT_direct_state_access + extension soft WINSOFT + glxflags ignore + glfflags ignore + +MatrixTranslatedEXT(mode, x, y, z) + return void + param mode MatrixMode in value + param x Float64 in value + param y Float64 in value + param z Float64 in value + category EXT_direct_state_access + extension soft WINSOFT + glxflags ignore + glfflags ignore + +MatrixFrustumEXT(mode, left, right, bottom, top, zNear, zFar) + return void + param mode MatrixMode in value + param left Float64 in value + param right Float64 in value + param bottom Float64 in value + param top Float64 in value + param zNear Float64 in value + param zFar Float64 in value + category EXT_direct_state_access + extension soft WINSOFT + glxflags ignore + glfflags ignore + +MatrixOrthoEXT(mode, left, right, bottom, top, zNear, zFar) + return void + param mode MatrixMode in value + param left Float64 in value + param right Float64 in value + param bottom Float64 in value + param top Float64 in value + param zNear Float64 in value + param zFar Float64 in value + category EXT_direct_state_access + extension soft WINSOFT + glxflags ignore + glfflags ignore + +MatrixPopEXT(mode) + return void + param mode MatrixMode in value + category EXT_direct_state_access + extension soft WINSOFT + glxflags ignore + glfflags ignore + +MatrixPushEXT(mode) + return void + param mode MatrixMode in value + category EXT_direct_state_access + extension soft WINSOFT + glxflags ignore + glfflags ignore + +# New 1.3 matrix transpose commands + +MatrixLoadTransposefEXT(mode, m) + return void + param mode MatrixMode in value + param m Float32 in array [16] + category EXT_direct_state_access + extension soft WINSOFT + glxflags ignore + glfflags ignore + +MatrixLoadTransposedEXT(mode, m) + return void + param mode MatrixMode in value + param m Float64 in array [16] + category EXT_direct_state_access + extension soft WINSOFT + glxflags ignore + glfflags ignore + +MatrixMultTransposefEXT(mode, m) + return void + param mode MatrixMode in value + param m Float32 in array [16] + category EXT_direct_state_access + extension soft WINSOFT + glxflags ignore + glfflags ignore + +MatrixMultTransposedEXT(mode, m) + return void + param mode MatrixMode in value + param m Float64 in array [16] + category EXT_direct_state_access + extension soft WINSOFT + glxflags ignore + glfflags ignore + +# New 1.1 texture object commands + +TextureParameterfEXT(texture, target, pname, param) + return void + param texture Texture in value + param target TextureTarget in value + param pname TextureParameterName in value + param param CheckedFloat32 in value + category EXT_direct_state_access + extension soft WINSOFT + glxflags ignore + glfflags ignore + vectorequiv TextureParameterfvEXT + +TextureParameterfvEXT(texture, target, pname, params) + return void + param texture Texture in value + param target TextureTarget in value + param pname TextureParameterName in value + param params CheckedFloat32 in array [COMPSIZE(pname)] + category EXT_direct_state_access + extension soft WINSOFT + glxflags ignore + glfflags ignore + +TextureParameteriEXT(texture, target, pname, param) + return void + param texture Texture in value + param target TextureTarget in value + param pname TextureParameterName in value + param param CheckedInt32 in value + category EXT_direct_state_access + extension soft WINSOFT + glxflags ignore + glfflags ignore + vectorequiv TextureParameterivEXT + +TextureParameterivEXT(texture, target, pname, params) + return void + param texture Texture in value + param target TextureTarget in value + param pname TextureParameterName in value + param params CheckedInt32 in array [COMPSIZE(pname)] + category EXT_direct_state_access + extension soft WINSOFT + glxflags ignore + glfflags ignore + +TextureImage1DEXT(texture, target, level, internalformat, width, border, format, type, pixels) + return void + param texture Texture in value + param target TextureTarget in value + param level CheckedInt32 in value + param internalformat TextureInternalFormat in value + param width SizeI in value + param border CheckedInt32 in value + param format PixelFormat in value + param type PixelType in value + param pixels Void in array [COMPSIZE(format/type/width)] + category EXT_direct_state_access + dlflags handcode + glxflags ignore ### client-handcode server-handcode + extension soft WINSOFT + glfflags capture-handcode decode-handcode pixel-unpack + +TextureImage2DEXT(texture, target, level, internalformat, width, height, border, format, type, pixels) + return void + param texture Texture in value + param target TextureTarget in value + param level CheckedInt32 in value + param internalformat TextureInternalFormat in value + param width SizeI in value + param height SizeI in value + param border CheckedInt32 in value + param format PixelFormat in value + param type PixelType in value + param pixels Void in array [COMPSIZE(format/type/width/height)] + category EXT_direct_state_access + dlflags handcode + glxflags ignore ### client-handcode server-handcode + extension soft WINSOFT + glfflags capture-handcode decode-handcode pixel-unpack + +TextureSubImage1DEXT(texture, target, level, xoffset, width, format, type, pixels) + return void + param texture Texture in value + param target TextureTarget in value + param level CheckedInt32 in value + param xoffset CheckedInt32 in value + param width SizeI in value + param format PixelFormat in value + param type PixelType in value + param pixels Void in array [COMPSIZE(format/type/width)] + category EXT_direct_state_access + dlflags handcode + glxflags ignore ### EXT client-handcode server-handcode + glxflags ignore + extension soft WINSOFT + glfflags ignore + +TextureSubImage2DEXT(texture, target, level, xoffset, yoffset, width, height, format, type, pixels) + return void + param texture Texture in value + param target TextureTarget in value + param level CheckedInt32 in value + param xoffset CheckedInt32 in value + param yoffset CheckedInt32 in value + param width SizeI in value + param height SizeI in value + param format PixelFormat in value + param type PixelType in value + param pixels Void in array [COMPSIZE(format/type/width/height)] + category EXT_direct_state_access + dlflags handcode + glxflags ignore ### EXT client-handcode server-handcode + extension soft WINSOFT + glfflags ignore + +CopyTextureImage1DEXT(texture, target, level, internalformat, x, y, width, border) + return void + param texture Texture in value + param target TextureTarget in value + param level CheckedInt32 in value + param internalformat TextureInternalFormat in value + param x WinCoord in value + param y WinCoord in value + param width SizeI in value + param border CheckedInt32 in value + category EXT_direct_state_access + extension soft WINSOFT + glxflags ignore ### EXT + +CopyTextureImage2DEXT(texture, target, level, internalformat, x, y, width, height, border) + return void + param texture Texture in value + param target TextureTarget in value + param level CheckedInt32 in value + param internalformat TextureInternalFormat in value + param x WinCoord in value + param y WinCoord in value + param width SizeI in value + param height SizeI in value + param border CheckedInt32 in value + category EXT_direct_state_access + extension soft WINSOFT + glxflags ignore ### EXT + +CopyTextureSubImage1DEXT(texture, target, level, xoffset, x, y, width) + return void + param texture Texture in value + param target TextureTarget in value + param level CheckedInt32 in value + param xoffset CheckedInt32 in value + param x WinCoord in value + param y WinCoord in value + param width SizeI in value + category EXT_direct_state_access + extension soft WINSOFT + glxflags ignore ### EXT + +CopyTextureSubImage2DEXT(texture, target, level, xoffset, yoffset, x, y, width, height) + return void + param texture Texture in value + param target TextureTarget in value + param level CheckedInt32 in value + param xoffset CheckedInt32 in value + param yoffset CheckedInt32 in value + param x WinCoord in value + param y WinCoord in value + param width SizeI in value + param height SizeI in value + category EXT_direct_state_access + extension soft WINSOFT + glxflags ignore ### EXT + +# New 1.1 texture object queries + +GetTextureImageEXT(texture, target, level, format, type, pixels) + return void + param texture Texture in value + param target TextureTarget in value + param level CheckedInt32 in value + param format PixelFormat in value + param type PixelType in value + param pixels Void out array [COMPSIZE(target/level/format/type)] + category EXT_direct_state_access + dlflags notlistable + glxflags ignore ### client-handcode server-handcode + extension soft WINSOFT + glfflags capture-execute capture-handcode decode-handcode pixel-pack + +GetTextureParameterfvEXT(texture, target, pname, params) + return void + param texture Texture in value + param target TextureTarget in value + param pname GetTextureParameter in value + param params Float32 out array [COMPSIZE(pname)] + category EXT_direct_state_access + dlflags notlistable + extension soft WINSOFT + glxflags ignore + glfflags capture-execute gl-enum + +GetTextureParameterivEXT(texture, target, pname, params) + return void + param texture Texture in value + param target TextureTarget in value + param pname GetTextureParameter in value + param params Int32 out array [COMPSIZE(pname)] + category EXT_direct_state_access + dlflags notlistable + extension soft WINSOFT + glxflags ignore + glfflags capture-execute gl-enum + +GetTextureLevelParameterfvEXT(texture, target, level, pname, params) + return void + param texture Texture in value + param target TextureTarget in value + param level CheckedInt32 in value + param pname GetTextureParameter in value + param params Float32 out array [COMPSIZE(pname)] + category EXT_direct_state_access + dlflags notlistable + extension soft WINSOFT + glxflags ignore + glfflags capture-execute gl-enum + +GetTextureLevelParameterivEXT(texture, target, level, pname, params) + return void + param texture Texture in value + param target TextureTarget in value + param level CheckedInt32 in value + param pname GetTextureParameter in value + param params Int32 out array [COMPSIZE(pname)] + category EXT_direct_state_access + dlflags notlistable + extension soft WINSOFT + glxflags ignore + glfflags capture-execute gl-enum + +# New 1.2 3D texture object commands + +TextureImage3DEXT(texture, target, level, internalformat, width, height, depth, border, format, type, pixels) + return void + param texture Texture in value + param target TextureTarget in value + param level CheckedInt32 in value + param internalformat TextureInternalFormat in value + param width SizeI in value + param height SizeI in value + param depth SizeI in value + param border CheckedInt32 in value + param format PixelFormat in value + param type PixelType in value + param pixels Void in array [COMPSIZE(format/type/width/height/depth)] + category EXT_direct_state_access + dlflags handcode + glxflags ignore ### client-handcode server-handcode EXT + extension soft WINSOFT + glfflags ignore + +TextureSubImage3DEXT(texture, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels) + return void + param texture Texture in value + param target TextureTarget in value + param level CheckedInt32 in value + param xoffset CheckedInt32 in value + param yoffset CheckedInt32 in value + param zoffset CheckedInt32 in value + param width SizeI in value + param height SizeI in value + param depth SizeI in value + param format PixelFormat in value + param type PixelType in value + param pixels Void in array [COMPSIZE(format/type/width/height/depth)] + category EXT_direct_state_access + dlflags handcode + glxflags ignore ### client-handcode server-handcode EXT + extension soft WINSOFT + glfflags ignore + +CopyTextureSubImage3DEXT(texture, target, level, xoffset, yoffset, zoffset, x, y, width, height) + return void + param texture Texture in value + param target TextureTarget in value + param level CheckedInt32 in value + param xoffset CheckedInt32 in value + param yoffset CheckedInt32 in value + param zoffset CheckedInt32 in value + param x WinCoord in value + param y WinCoord in value + param width SizeI in value + param height SizeI in value + category EXT_direct_state_access + glxflags ignore ### EXT + extension soft WINSOFT + glfflags ignore + +# New 1.1 multitexture commands + +MultiTexParameterfEXT(texunit, target, pname, param) + return void + param texunit TextureUnit in value + param target TextureTarget in value + param pname TextureParameterName in value + param param CheckedFloat32 in value + category EXT_direct_state_access + extension soft WINSOFT + glxflags ignore + glfflags ignore + vectorequiv MultiTexParameterfvEXT + +MultiTexParameterfvEXT(texunit, target, pname, params) + return void + param texunit TextureUnit in value + param target TextureTarget in value + param pname TextureParameterName in value + param params CheckedFloat32 in array [COMPSIZE(pname)] + category EXT_direct_state_access + extension soft WINSOFT + glxflags ignore + glfflags ignore + +MultiTexParameteriEXT(texunit, target, pname, param) + return void + param texunit TextureUnit in value + param target TextureTarget in value + param pname TextureParameterName in value + param param CheckedInt32 in value + category EXT_direct_state_access + extension soft WINSOFT + glxflags ignore + glfflags ignore + vectorequiv MultiTexParameterivEXT + +MultiTexParameterivEXT(texunit, target, pname, params) + return void + param texunit TextureUnit in value + param target TextureTarget in value + param pname TextureParameterName in value + param params CheckedInt32 in array [COMPSIZE(pname)] + category EXT_direct_state_access + extension soft WINSOFT + glxflags ignore + glfflags ignore + +MultiTexImage1DEXT(texunit, target, level, internalformat, width, border, format, type, pixels) + return void + param texunit TextureUnit in value + param target TextureTarget in value + param level CheckedInt32 in value + param internalformat TextureInternalFormat in value + param width SizeI in value + param border CheckedInt32 in value + param format PixelFormat in value + param type PixelType in value + param pixels Void in array [COMPSIZE(format/type/width)] + category EXT_direct_state_access + dlflags handcode + glxflags ignore ### client-handcode server-handcode + extension soft WINSOFT + glfflags capture-handcode decode-handcode pixel-unpack + +MultiTexImage2DEXT(texunit, target, level, internalformat, width, height, border, format, type, pixels) + return void + param texunit TextureUnit in value + param target TextureTarget in value + param level CheckedInt32 in value + param internalformat TextureInternalFormat in value + param width SizeI in value + param height SizeI in value + param border CheckedInt32 in value + param format PixelFormat in value + param type PixelType in value + param pixels Void in array [COMPSIZE(format/type/width/height)] + category EXT_direct_state_access + dlflags handcode + glxflags ignore ### client-handcode server-handcode + extension soft WINSOFT + glfflags capture-handcode decode-handcode pixel-unpack + +MultiTexSubImage1DEXT(texunit, target, level, xoffset, width, format, type, pixels) + return void + param texunit TextureUnit in value + param target TextureTarget in value + param level CheckedInt32 in value + param xoffset CheckedInt32 in value + param width SizeI in value + param format PixelFormat in value + param type PixelType in value + param pixels Void in array [COMPSIZE(format/type/width)] + category EXT_direct_state_access + dlflags handcode + glxflags ignore ### EXT client-handcode server-handcode + extension soft WINSOFT + glfflags ignore + +MultiTexSubImage2DEXT(texunit, target, level, xoffset, yoffset, width, height, format, type, pixels) + return void + param texunit TextureUnit in value + param target TextureTarget in value + param level CheckedInt32 in value + param xoffset CheckedInt32 in value + param yoffset CheckedInt32 in value + param width SizeI in value + param height SizeI in value + param format PixelFormat in value + param type PixelType in value + param pixels Void in array [COMPSIZE(format/type/width/height)] + category EXT_direct_state_access + dlflags handcode + glxflags ignore ### EXT client-handcode server-handcode + extension soft WINSOFT + glfflags ignore + +CopyMultiTexImage1DEXT(texunit, target, level, internalformat, x, y, width, border) + return void + param texunit TextureUnit in value + param target TextureTarget in value + param level CheckedInt32 in value + param internalformat TextureInternalFormat in value + param x WinCoord in value + param y WinCoord in value + param width SizeI in value + param border CheckedInt32 in value + category EXT_direct_state_access + extension soft WINSOFT + glxflags ignore ### EXT + +CopyMultiTexImage2DEXT(texunit, target, level, internalformat, x, y, width, height, border) + return void + param texunit TextureUnit in value + param target TextureTarget in value + param level CheckedInt32 in value + param internalformat TextureInternalFormat in value + param x WinCoord in value + param y WinCoord in value + param width SizeI in value + param height SizeI in value + param border CheckedInt32 in value + category EXT_direct_state_access + extension soft WINSOFT + glxflags ignore ### EXT + +CopyMultiTexSubImage1DEXT(texunit, target, level, xoffset, x, y, width) + return void + param texunit TextureUnit in value + param target TextureTarget in value + param level CheckedInt32 in value + param xoffset CheckedInt32 in value + param x WinCoord in value + param y WinCoord in value + param width SizeI in value + category EXT_direct_state_access + extension soft WINSOFT + glxflags ignore ### EXT + +CopyMultiTexSubImage2DEXT(texunit, target, level, xoffset, yoffset, x, y, width, height) + return void + param texunit TextureUnit in value + param target TextureTarget in value + param level CheckedInt32 in value + param xoffset CheckedInt32 in value + param yoffset CheckedInt32 in value + param x WinCoord in value + param y WinCoord in value + param width SizeI in value + param height SizeI in value + category EXT_direct_state_access + extension soft WINSOFT + glxflags ignore ### EXT + +# New 1.1 multitexture queries + +GetMultiTexImageEXT(texunit, target, level, format, type, pixels) + return void + param texunit TextureUnit in value + param target TextureTarget in value + param level CheckedInt32 in value + param format PixelFormat in value + param type PixelType in value + param pixels Void out array [COMPSIZE(target/level/format/type)] + category EXT_direct_state_access + dlflags notlistable + glxflags ignore ### client-handcode server-handcode + extension soft WINSOFT + glfflags capture-execute capture-handcode decode-handcode pixel-pack + +GetMultiTexParameterfvEXT(texunit, target, pname, params) + return void + param texunit TextureUnit in value + param target TextureTarget in value + param pname GetTextureParameter in value + param params Float32 out array [COMPSIZE(pname)] + category EXT_direct_state_access + dlflags notlistable + extension soft WINSOFT + glxflags ignore + glfflags capture-execute gl-enum + +GetMultiTexParameterivEXT(texunit, target, pname, params) + return void + param texunit TextureUnit in value + param target TextureTarget in value + param pname GetTextureParameter in value + param params Int32 out array [COMPSIZE(pname)] + category EXT_direct_state_access + dlflags notlistable + extension soft WINSOFT + glxflags ignore + glfflags capture-execute gl-enum + +GetMultiTexLevelParameterfvEXT(texunit, target, level, pname, params) + return void + param texunit TextureUnit in value + param target TextureTarget in value + param level CheckedInt32 in value + param pname GetTextureParameter in value + param params Float32 out array [COMPSIZE(pname)] + category EXT_direct_state_access + dlflags notlistable + extension soft WINSOFT + glxflags ignore + glfflags capture-execute gl-enum + +GetMultiTexLevelParameterivEXT(texunit, target, level, pname, params) + return void + param texunit TextureUnit in value + param target TextureTarget in value + param level CheckedInt32 in value + param pname GetTextureParameter in value + param params Int32 out array [COMPSIZE(pname)] + category EXT_direct_state_access + dlflags notlistable + extension soft WINSOFT + glxflags ignore + glfflags capture-execute gl-enum + +# New 1.2 3D multitexture commands + +MultiTexImage3DEXT(texunit, target, level, internalformat, width, height, depth, border, format, type, pixels) + return void + param texunit TextureUnit in value + param target TextureTarget in value + param level CheckedInt32 in value + param internalformat TextureInternalFormat in value + param width SizeI in value + param height SizeI in value + param depth SizeI in value + param border CheckedInt32 in value + param format PixelFormat in value + param type PixelType in value + param pixels Void in array [COMPSIZE(format/type/width/height/depth)] + category EXT_direct_state_access + dlflags handcode + glxflags ignore ### client-handcode server-handcode EXT + extension soft WINSOFT + glfflags ignore + +MultiTexSubImage3DEXT(texunit, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels) + return void + param texunit TextureUnit in value + param target TextureTarget in value + param level CheckedInt32 in value + param xoffset CheckedInt32 in value + param yoffset CheckedInt32 in value + param zoffset CheckedInt32 in value + param width SizeI in value + param height SizeI in value + param depth SizeI in value + param format PixelFormat in value + param type PixelType in value + param pixels Void in array [COMPSIZE(format/type/width/height/depth)] + category EXT_direct_state_access + dlflags handcode + glxflags ignore ### client-handcode server-handcode EXT + extension soft WINSOFT + glfflags ignore + +CopyMultiTexSubImage3DEXT(texunit, target, level, xoffset, yoffset, zoffset, x, y, width, height) + return void + param texunit TextureUnit in value + param target TextureTarget in value + param level CheckedInt32 in value + param xoffset CheckedInt32 in value + param yoffset CheckedInt32 in value + param zoffset CheckedInt32 in value + param x WinCoord in value + param y WinCoord in value + param width SizeI in value + param height SizeI in value + category EXT_direct_state_access + glxflags ignore ### EXT + extension soft WINSOFT + glfflags ignore + +# New 1.2.1 multitexture texture commands + +BindMultiTextureEXT(texunit, target, texture) + return void + param texunit TextureUnit in value + param target TextureTarget in value + param texture Texture in value + category EXT_direct_state_access + extension soft WINSOFT + glxflags ignore ### EXT + +EnableClientStateIndexedEXT(array, index) + return void + param array EnableCap in value + param index UInt32 in value + category EXT_direct_state_access + dlflags notlistable + glxflags ignore ### client-handcode client-intercept server-handcode + extension soft WINSOFT + +DisableClientStateIndexedEXT(array, index) + return void + param array EnableCap in value + param index UInt32 in value + category EXT_direct_state_access + extension soft WINSOFT + dlflags notlistable + glxflags ignore ### client-handcode client-intercept server-handcode + +MultiTexCoordPointerEXT(texunit, size, type, stride, pointer) + return void + param texunit TextureUnit in value + param size Int32 in value + param type TexCoordPointerType in value + param stride SizeI in value + param pointer Void in array [COMPSIZE(size/type/stride)] retained + category EXT_direct_state_access + dlflags notlistable + glxflags ignore ### client-handcode client-intercept server-handcode + extension soft WINSOFT + glfflags ignore + +MultiTexEnvfEXT(texunit, target, pname, param) + return void + param texunit TextureUnit in value + param target TextureEnvTarget in value + param pname TextureEnvParameter in value + param param CheckedFloat32 in value + category EXT_direct_state_access + extension soft WINSOFT + vectorequiv MultiTexEnvfvEXT + glxflags ignore + glfflags gl-enum + +MultiTexEnvfvEXT(texunit, target, pname, params) + return void + param texunit TextureUnit in value + param target TextureEnvTarget in value + param pname TextureEnvParameter in value + param params CheckedFloat32 in array [COMPSIZE(pname)] + category EXT_direct_state_access + extension soft WINSOFT + glxflags ignore + glfflags gl-enum + +MultiTexEnviEXT(texunit, target, pname, param) + return void + param texunit TextureUnit in value + param target TextureEnvTarget in value + param pname TextureEnvParameter in value + param param CheckedInt32 in value + category EXT_direct_state_access + extension soft WINSOFT + vectorequiv MultiTexEnvivEXT + glxflags ignore + glfflags gl-enum + +MultiTexEnvivEXT(texunit, target, pname, params) + return void + param texunit TextureUnit in value + param target TextureEnvTarget in value + param pname TextureEnvParameter in value + param params CheckedInt32 in array [COMPSIZE(pname)] + category EXT_direct_state_access + extension soft WINSOFT + glxflags ignore + glfflags gl-enum + +MultiTexGendEXT(texunit, coord, pname, param) + return void + param texunit TextureUnit in value + param coord TextureCoordName in value + param pname TextureGenParameter in value + param param Float64 in value + category EXT_direct_state_access + extension soft WINSOFT + vectorequiv MultiTexGendvEXT + glxflags ignore + glfflags gl-enum + +MultiTexGendvEXT(texunit, coord, pname, params) + return void + param texunit TextureUnit in value + param coord TextureCoordName in value + param pname TextureGenParameter in value + param params Float64 in array [COMPSIZE(pname)] + category EXT_direct_state_access + extension soft WINSOFT + glxflags ignore + glfflags gl-enum + +MultiTexGenfEXT(texunit, coord, pname, param) + return void + param texunit TextureUnit in value + param coord TextureCoordName in value + param pname TextureGenParameter in value + param param CheckedFloat32 in value + category EXT_direct_state_access + extension soft WINSOFT + vectorequiv MultiTexGenfvEXT + glxflags ignore + glfflags gl-enum + +MultiTexGenfvEXT(texunit, coord, pname, params) + return void + param texunit TextureUnit in value + param coord TextureCoordName in value + param pname TextureGenParameter in value + param params CheckedFloat32 in array [COMPSIZE(pname)] + category EXT_direct_state_access + extension soft WINSOFT + glxflags ignore + glfflags gl-enum + +MultiTexGeniEXT(texunit, coord, pname, param) + return void + param texunit TextureUnit in value + param coord TextureCoordName in value + param pname TextureGenParameter in value + param param CheckedInt32 in value + category EXT_direct_state_access + extension soft WINSOFT + vectorequiv MultiTexGenivEXT + glxflags ignore + glfflags gl-enum + +MultiTexGenivEXT(texunit, coord, pname, params) + return void + param texunit TextureUnit in value + param coord TextureCoordName in value + param pname TextureGenParameter in value + param params CheckedInt32 in array [COMPSIZE(pname)] + category EXT_direct_state_access + extension soft WINSOFT + glxflags ignore + glfflags gl-enum + +# New 1.2.1 multitexture texture queries + +GetMultiTexEnvfvEXT(texunit, target, pname, params) + return void + param texunit TextureUnit in value + param target TextureEnvTarget in value + param pname TextureEnvParameter in value + param params Float32 out array [COMPSIZE(pname)] + category EXT_direct_state_access + dlflags notlistable + extension soft WINSOFT + glxflags ignore + glfflags capture-execute gl-enum + +GetMultiTexEnvivEXT(texunit, target, pname, params) + return void + param texunit TextureUnit in value + param target TextureEnvTarget in value + param pname TextureEnvParameter in value + param params Int32 out array [COMPSIZE(pname)] + category EXT_direct_state_access + dlflags notlistable + extension soft WINSOFT + glxflags ignore + glfflags capture-execute gl-enum + +GetMultiTexGendvEXT(texunit, coord, pname, params) + return void + param texunit TextureUnit in value + param coord TextureCoordName in value + param pname TextureGenParameter in value + param params Float64 out array [COMPSIZE(pname)] + category EXT_direct_state_access + dlflags notlistable + extension soft WINSOFT + glxflags ignore + glfflags capture-execute gl-enum + +GetMultiTexGenfvEXT(texunit, coord, pname, params) + return void + param texunit TextureUnit in value + param coord TextureCoordName in value + param pname TextureGenParameter in value + param params Float32 out array [COMPSIZE(pname)] + category EXT_direct_state_access + dlflags notlistable + extension soft WINSOFT + glxflags ignore + glfflags capture-execute gl-enum + +GetMultiTexGenivEXT(texunit, coord, pname, params) + return void + param texunit TextureUnit in value + param coord TextureCoordName in value + param pname TextureGenParameter in value + param params Int32 out array [COMPSIZE(pname)] + category EXT_direct_state_access + dlflags notlistable + extension soft WINSOFT + glxflags ignore + glfflags capture-execute gl-enum + +# From EXT_draw_buffers2 +# EnableIndexedEXT +# DisableIndexedEXT +# IsEnabledIndexedEXT + +GetFloatIndexedvEXT(target, index, data) + return void + param target TypeEnum in value + param index UInt32 in value + param data Float32 out array [COMPSIZE(target)] + category EXT_direct_state_access + dlflags notlistable + glxflags ignore + glfflags ignore + extension soft WINSOFT + +GetDoubleIndexedvEXT(target, index, data) + return void + param target TypeEnum in value + param index UInt32 in value + param data Float64 out array [COMPSIZE(target)] + category EXT_direct_state_access + dlflags notlistable + glxflags ignore + glfflags ignore + extension soft WINSOFT + +GetPointerIndexedvEXT(target, index, data) + return void + param target TypeEnum in value + param index UInt32 in value + param data VoidPointer out array [COMPSIZE(target)] + category EXT_direct_state_access + dlflags notlistable + glxflags ignore + glfflags ignore + extension soft WINSOFT + +# New compressed texture commands + +CompressedTextureImage3DEXT(texture, target, level, internalformat, width, height, depth, border, imageSize, bits) + return void + param texture Texture in value + param target TextureTarget in value + param level CheckedInt32 in value + param internalformat TextureInternalFormat in value + param width SizeI in value + param height SizeI in value + param depth SizeI in value + param border CheckedInt32 in value + param imageSize SizeI in value + param bits Void in array [imageSize] + category EXT_direct_state_access + dlflags handcode + glxflags ignore ### client-handcode server-handcode + glfflags ignore + extension soft WINSOFT + +CompressedTextureImage2DEXT(texture, target, level, internalformat, width, height, border, imageSize, bits) + return void + param texture Texture in value + param target TextureTarget in value + param level CheckedInt32 in value + param internalformat TextureInternalFormat in value + param width SizeI in value + param height SizeI in value + param border CheckedInt32 in value + param imageSize SizeI in value + param bits Void in array [imageSize] + category EXT_direct_state_access + dlflags handcode + glxflags ignore ### client-handcode server-handcode + glfflags ignore + extension soft WINSOFT + +CompressedTextureImage1DEXT(texture, target, level, internalformat, width, border, imageSize, bits) + return void + param texture Texture in value + param target TextureTarget in value + param level CheckedInt32 in value + param internalformat TextureInternalFormat in value + param width SizeI in value + param border CheckedInt32 in value + param imageSize SizeI in value + param bits Void in array [imageSize] + category EXT_direct_state_access + dlflags handcode + glxflags ignore ### client-handcode server-handcode + glfflags ignore + extension soft WINSOFT + +CompressedTextureSubImage3DEXT(texture, target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, bits) + return void + param texture Texture in value + param target TextureTarget in value + param level CheckedInt32 in value + param xoffset CheckedInt32 in value + param yoffset CheckedInt32 in value + param zoffset CheckedInt32 in value + param width SizeI in value + param height SizeI in value + param depth SizeI in value + param format PixelFormat in value + param imageSize SizeI in value + param bits Void in array [imageSize] + category EXT_direct_state_access + dlflags handcode + glxflags ignore ### client-handcode server-handcode + glfflags ignore + extension soft WINSOFT + +CompressedTextureSubImage2DEXT(texture, target, level, xoffset, yoffset, width, height, format, imageSize, bits) + return void + param texture Texture in value + param target TextureTarget in value + param level CheckedInt32 in value + param xoffset CheckedInt32 in value + param yoffset CheckedInt32 in value + param width SizeI in value + param height SizeI in value + param format PixelFormat in value + param imageSize SizeI in value + param bits Void in array [imageSize] + category EXT_direct_state_access + dlflags handcode + glxflags ignore ### client-handcode server-handcode + glfflags ignore + extension soft WINSOFT + +CompressedTextureSubImage1DEXT(texture, target, level, xoffset, width, format, imageSize, bits) + return void + param texture Texture in value + param target TextureTarget in value + param level CheckedInt32 in value + param xoffset CheckedInt32 in value + param width SizeI in value + param format PixelFormat in value + param imageSize SizeI in value + param bits Void in array [imageSize] + category EXT_direct_state_access + dlflags handcode + glxflags ignore ### client-handcode server-handcode + glfflags ignore + extension soft WINSOFT + +# New compressed texture query + +GetCompressedTextureImageEXT(texture, target, lod, img) + return void + param texture Texture in value + param target TextureTarget in value + param lod CheckedInt32 in value + param img Void out array [COMPSIZE(target/lod)] + category EXT_direct_state_access + dlflags notlistable + glxflags ignore ### server-handcode + extension soft WINSOFT + +# New compressed multitexture commands + +CompressedMultiTexImage3DEXT(texunit, target, level, internalformat, width, height, depth, border, imageSize, bits) + return void + param texunit TextureUnit in value + param target TextureTarget in value + param level CheckedInt32 in value + param internalformat TextureInternalFormat in value + param width SizeI in value + param height SizeI in value + param depth SizeI in value + param border CheckedInt32 in value + param imageSize SizeI in value + param bits Void in array [imageSize] + category EXT_direct_state_access + dlflags handcode + glxflags ignore ### client-handcode server-handcode + glfflags ignore + extension soft WINSOFT + +CompressedMultiTexImage2DEXT(texunit, target, level, internalformat, width, height, border, imageSize, bits) + return void + param texunit TextureUnit in value + param target TextureTarget in value + param level CheckedInt32 in value + param internalformat TextureInternalFormat in value + param width SizeI in value + param height SizeI in value + param border CheckedInt32 in value + param imageSize SizeI in value + param bits Void in array [imageSize] + category EXT_direct_state_access + dlflags handcode + glxflags ignore ### client-handcode server-handcode + glfflags ignore + extension soft WINSOFT + +CompressedMultiTexImage1DEXT(texunit, target, level, internalformat, width, border, imageSize, bits) + return void + param texunit TextureUnit in value + param target TextureTarget in value + param level CheckedInt32 in value + param internalformat TextureInternalFormat in value + param width SizeI in value + param border CheckedInt32 in value + param imageSize SizeI in value + param bits Void in array [imageSize] + category EXT_direct_state_access + dlflags handcode + glxflags ignore ### client-handcode server-handcode + glfflags ignore + extension soft WINSOFT + +CompressedMultiTexSubImage3DEXT(texunit, target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, bits) + return void + param texunit TextureUnit in value + param target TextureTarget in value + param level CheckedInt32 in value + param xoffset CheckedInt32 in value + param yoffset CheckedInt32 in value + param zoffset CheckedInt32 in value + param width SizeI in value + param height SizeI in value + param depth SizeI in value + param format PixelFormat in value + param imageSize SizeI in value + param bits Void in array [imageSize] + category EXT_direct_state_access + dlflags handcode + glxflags ignore ### client-handcode server-handcode + glfflags ignore + extension soft WINSOFT + +CompressedMultiTexSubImage2DEXT(texunit, target, level, xoffset, yoffset, width, height, format, imageSize, bits) + return void + param texunit TextureUnit in value + param target TextureTarget in value + param level CheckedInt32 in value + param xoffset CheckedInt32 in value + param yoffset CheckedInt32 in value + param width SizeI in value + param height SizeI in value + param format PixelFormat in value + param imageSize SizeI in value + param bits Void in array [imageSize] + category EXT_direct_state_access + dlflags handcode + glxflags ignore ### client-handcode server-handcode + glfflags ignore + extension soft WINSOFT + +CompressedMultiTexSubImage1DEXT(texunit, target, level, xoffset, width, format, imageSize, bits) + return void + param texunit TextureUnit in value + param target TextureTarget in value + param level CheckedInt32 in value + param xoffset CheckedInt32 in value + param width SizeI in value + param format PixelFormat in value + param imageSize SizeI in value + param bits Void in array [imageSize] + category EXT_direct_state_access + dlflags handcode + glxflags ignore ### client-handcode server-handcode + glfflags ignore + extension soft WINSOFT + +# New compressed multitexture query + +GetCompressedMultiTexImageEXT(texunit, target, lod, img) + return void + param texunit TextureUnit in value + param target TextureTarget in value + param lod CheckedInt32 in value + param img Void out array [COMPSIZE(target/lod)] + category EXT_direct_state_access + dlflags notlistable + glxflags ignore ### server-handcode + extension soft WINSOFT + +# New ARB assembly program named commands + +NamedProgramStringEXT(program, target, format, len, string) + return void + param program UInt32 in value + param target ProgramTarget in value + param format ProgramFormat in value + param len SizeI in value + param string Void in array [len] + category EXT_direct_state_access + subcategory ARB_vertex_program + extension soft WINSOFT + glfflags ignore + glxflags ignore ### client-handcode server-handcode EXT + glextmask GL_MASK_ARB_vertex_program|GL_MASK_ARB_fragment_program + +NamedProgramLocalParameter4dEXT(program, target, index, x, y, z, w) + return void + param program UInt32 in value + param target ProgramTarget in value + param index UInt32 in value + param x Float64 in value + param y Float64 in value + param z Float64 in value + param w Float64 in value + category EXT_direct_state_access + subcategory ARB_vertex_program + vectorequiv NamedProgramLocalParameter4dvEXT + glxvectorequiv NamedProgramLocalParameter4dvEXT + extension soft WINSOFT NV10 + glfflags ignore + glxflags ignore ### EXT + glextmask GL_MASK_ARB_vertex_program|GL_MASK_ARB_fragment_program + +NamedProgramLocalParameter4dvEXT(program, target, index, params) + return void + param program UInt32 in value + param target ProgramTarget in value + param index UInt32 in value + param params Float64 in array [4] + category EXT_direct_state_access + subcategory ARB_vertex_program + extension soft WINSOFT NV10 + glfflags ignore + glxflags ignore ### EXT + glextmask GL_MASK_ARB_vertex_program|GL_MASK_ARB_fragment_program + +NamedProgramLocalParameter4fEXT(program, target, index, x, y, z, w) + return void + param program UInt32 in value + param target ProgramTarget in value + param index UInt32 in value + param x Float32 in value + param y Float32 in value + param z Float32 in value + param w Float32 in value + category EXT_direct_state_access + subcategory ARB_vertex_program + vectorequiv NamedProgramLocalParameter4fvEXT + glxvectorequiv NamedProgramLocalParameter4fvEXT + extension soft WINSOFT NV10 + glfflags ignore + glxflags ignore ### EXT + glextmask GL_MASK_ARB_vertex_program|GL_MASK_ARB_fragment_program + +NamedProgramLocalParameter4fvEXT(program, target, index, params) + return void + param program UInt32 in value + param target ProgramTarget in value + param index UInt32 in value + param params Float32 in array [4] + category EXT_direct_state_access + subcategory ARB_vertex_program + extension soft WINSOFT NV10 + glfflags ignore + glxflags ignore ### EXT + glextmask GL_MASK_ARB_vertex_program|GL_MASK_ARB_fragment_program + +# New ARB assembly program named queries + +GetNamedProgramLocalParameterdvEXT(program, target, index, params) + return void + param program UInt32 in value + param target ProgramTarget in value + param index UInt32 in value + param params Float64 out array [4] + dlflags notlistable + category EXT_direct_state_access + subcategory ARB_vertex_program + extension soft WINSOFT NV10 + glfflags ignore + glxflags ignore ### client-handcode server-handcode EXT + glextmask GL_MASK_ARB_vertex_program|GL_MASK_ARB_fragment_program + +GetNamedProgramLocalParameterfvEXT(program, target, index, params) + return void + param program UInt32 in value + param target ProgramTarget in value + param index UInt32 in value + param params Float32 out array [4] + dlflags notlistable + category EXT_direct_state_access + subcategory ARB_vertex_program + extension soft WINSOFT NV10 + glfflags ignore + glxflags ignore ### client-handcode server-handcode EXT + glextmask GL_MASK_ARB_vertex_program|GL_MASK_ARB_fragment_program + +GetNamedProgramivEXT(program, target, pname, params) + return void + param program UInt32 in value + param target ProgramTarget in value + param pname ProgramProperty in value + param params Int32 out array [1] + dlflags notlistable + category EXT_direct_state_access + subcategory ARB_vertex_program + extension soft WINSOFT NV10 + glfflags ignore + glxflags ignore ### client-handcode server-handcode EXT + glextmask GL_MASK_ARB_vertex_program|GL_MASK_ARB_fragment_program + +GetNamedProgramStringEXT(program, target, pname, string) + return void + param program UInt32 in value + param target ProgramTarget in value + param pname ProgramStringProperty in value + param string Void out array [COMPSIZE(program,pname)] + dlflags notlistable + category EXT_direct_state_access + subcategory ARB_vertex_program + extension soft WINSOFT NV10 + glfflags ignore + glxflags ignore ### client-handcode server-handcode EXT + glextmask GL_MASK_ARB_vertex_program|GL_MASK_ARB_fragment_program + +# New EXT_gpu_program_parameters command + +NamedProgramLocalParameters4fvEXT(program, target, index, count, params) + return void + param program UInt32 in value + param target ProgramTarget in value + param index UInt32 in value + param count SizeI in value + param params Float32 in array [count*4] + category EXT_direct_state_access + subcategory EXT_gpu_program_parameters + extension soft WINSOFT NV10 + glfflags ignore + glxflags ignore + glextmask GL_MASK_EXT_gpu_program_parameters + +# New NV_gpu_program4 commands + +NamedProgramLocalParameterI4iEXT(program, target, index, x, y, z, w) + return void + param program UInt32 in value + param target ProgramTarget in value + param index UInt32 in value + param x Int32 in value + param y Int32 in value + param z Int32 in value + param w Int32 in value + category EXT_direct_state_access + subcategory NV_gpu_program4 + vectorequiv NamedProgramLocalParameterI4ivEXT + glxvectorequiv NamedProgramLocalParameterI4ivEXT + extension soft WINSOFT NV50 + glfflags ignore + glxflags ignore + glextmask GL_MASK_NV_gpu_program4 + +NamedProgramLocalParameterI4ivEXT(program, target, index, params) + return void + param program UInt32 in value + param target ProgramTarget in value + param index UInt32 in value + param params Int32 in array [4] + category EXT_direct_state_access + subcategory NV_gpu_program4 + extension soft WINSOFT NV50 + glfflags ignore + glxflags ignore + glextmask GL_MASK_NV_gpu_program4 + +NamedProgramLocalParametersI4ivEXT(program, target, index, count, params) + return void + param program UInt32 in value + param target ProgramTarget in value + param index UInt32 in value + param count SizeI in value + param params Int32 in array [count*4] + category EXT_direct_state_access + subcategory NV_gpu_program4 + extension soft WINSOFT NV50 + glfflags ignore + glxflags ignore + glextmask GL_MASK_NV_gpu_program4 + +NamedProgramLocalParameterI4uiEXT(program, target, index, x, y, z, w) + return void + param program UInt32 in value + param target ProgramTarget in value + param index UInt32 in value + param x UInt32 in value + param y UInt32 in value + param z UInt32 in value + param w UInt32 in value + category EXT_direct_state_access + subcategory NV_gpu_program4 + vectorequiv NamedProgramLocalParameterI4uivEXT + glxvectorequiv NamedProgramLocalParameterI4uivEXT + extension soft WINSOFT NV50 + glfflags ignore + glxflags ignore + glextmask GL_MASK_NV_gpu_program4 + +NamedProgramLocalParameterI4uivEXT(program, target, index, params) + return void + param program UInt32 in value + param target ProgramTarget in value + param index UInt32 in value + param params UInt32 in array [4] + category EXT_direct_state_access + subcategory NV_gpu_program4 + extension soft WINSOFT NV50 + glfflags ignore + glxflags ignore + glextmask GL_MASK_NV_gpu_program4 + +NamedProgramLocalParametersI4uivEXT(program, target, index, count, params) + return void + param program UInt32 in value + param target ProgramTarget in value + param index UInt32 in value + param count SizeI in value + param params UInt32 in array [count*4] + category EXT_direct_state_access + subcategory NV_gpu_program4 + extension soft WINSOFT NV50 + glfflags ignore + glxflags ignore + glextmask GL_MASK_NV_gpu_program4 + +GetNamedProgramLocalParameterIivEXT(program, target, index, params) + return void + param program UInt32 in value + param target ProgramTarget in value + param index UInt32 in value + param params Int32 out array [4] + dlflags notlistable + category EXT_direct_state_access + subcategory NV_gpu_program4 + extension soft WINSOFT NV50 + glfflags ignore + glxflags ignore + glextmask GL_MASK_NV_gpu_program4 + +GetNamedProgramLocalParameterIuivEXT(program, target, index, params) + return void + param program UInt32 in value + param target ProgramTarget in value + param index UInt32 in value + param params UInt32 out array [4] + dlflags notlistable + category EXT_direct_state_access + subcategory NV_gpu_program4 + extension soft WINSOFT NV50 + glfflags ignore + glxflags ignore + glextmask GL_MASK_NV_gpu_program4 + +# New EXT_texture_integer texture object commands + +TextureParameterIivEXT(texture, target, pname, params) + return void + param texture Texture in value + param target TextureTarget in value + param pname TextureParameterName in value + param params CheckedInt32 in array [COMPSIZE(pname)] + category EXT_direct_state_access + subcategory EXT_texture_integer + extension soft WINSOFT + glxflags ignore + glfflags ignore + glextmask GL_MASK_EXT_texture_integer + +TextureParameterIuivEXT(texture, target, pname, params) + return void + param texture Texture in value + param target TextureTarget in value + param pname TextureParameterName in value + param params UInt32 in array [COMPSIZE(pname)] + category EXT_direct_state_access + subcategory EXT_texture_integer + extension soft WINSOFT + glxflags ignore + glfflags ignore + glextmask GL_MASK_EXT_texture_integer + +# New EXT_texture_integer texture object queries + +GetTextureParameterIivEXT(texture, target, pname, params) + return void + param texture Texture in value + param target TextureTarget in value + param pname GetTextureParameter in value + param params Int32 out array [COMPSIZE(pname)] + category EXT_direct_state_access + subcategory EXT_texture_integer + dlflags notlistable + extension soft WINSOFT + glxflags ignore + glfflags capture-execute gl-enum + glextmask GL_MASK_EXT_texture_integer + +GetTextureParameterIuivEXT(texture, target, pname, params) + return void + param texture Texture in value + param target TextureTarget in value + param pname GetTextureParameter in value + param params UInt32 out array [COMPSIZE(pname)] + category EXT_direct_state_access + subcategory EXT_texture_integer + dlflags notlistable + extension soft WINSOFT + glxflags ignore + glfflags capture-execute gl-enum + glextmask GL_MASK_EXT_texture_integer + +# New EXT_texture_integer multitexture commands + +MultiTexParameterIivEXT(texunit, target, pname, params) + return void + param texunit TextureUnit in value + param target TextureTarget in value + param pname TextureParameterName in value + param params CheckedInt32 in array [COMPSIZE(pname)] + category EXT_direct_state_access + subcategory EXT_texture_integer + extension soft WINSOFT + glxflags ignore + glfflags ignore + glextmask GL_MASK_EXT_texture_integer + +MultiTexParameterIuivEXT(texunit, target, pname, params) + return void + param texunit TextureUnit in value + param target TextureTarget in value + param pname TextureParameterName in value + param params UInt32 in array [COMPSIZE(pname)] + category EXT_direct_state_access + subcategory EXT_texture_integer + extension soft WINSOFT + glxflags ignore + glfflags ignore + glextmask GL_MASK_EXT_texture_integer + +# New EXT_texture_integer multitexture queries + +GetMultiTexParameterIivEXT(texunit, target, pname, params) + return void + param texunit TextureUnit in value + param target TextureTarget in value + param pname GetTextureParameter in value + param params Int32 out array [COMPSIZE(pname)] + category EXT_direct_state_access + subcategory EXT_texture_integer + dlflags notlistable + extension soft WINSOFT + glfflags capture-execute gl-enum + glxflags ignore + glextmask GL_MASK_EXT_texture_integer + +GetMultiTexParameterIuivEXT(texunit, target, pname, params) + return void + param texunit TextureUnit in value + param target TextureTarget in value + param pname GetTextureParameter in value + param params UInt32 out array [COMPSIZE(pname)] + category EXT_direct_state_access + subcategory EXT_texture_integer + dlflags notlistable + extension soft WINSOFT + glfflags capture-execute gl-enum + glxflags ignore + glextmask GL_MASK_EXT_texture_integer + +# New GLSL 2.0 uniform commands + +ProgramUniform1fEXT(program, location, v0) + return void + param program UInt32 in value + param location Int32 in value + param v0 Float32 in value + category EXT_direct_state_access + subcategory VERSION_2_0 + glfflags ignore + glxflags ignore + extension soft WINSOFT + glextmask GL_MASK_OpenGL_2_0 + +ProgramUniform2fEXT(program, location, v0, v1) + return void + param program UInt32 in value + param location Int32 in value + param v0 Float32 in value + param v1 Float32 in value + category EXT_direct_state_access + subcategory VERSION_2_0 + glfflags ignore + glxflags ignore + extension soft WINSOFT + glextmask GL_MASK_OpenGL_2_0 + +ProgramUniform3fEXT(program, location, v0, v1, v2) + return void + param program UInt32 in value + param location Int32 in value + param v0 Float32 in value + param v1 Float32 in value + param v2 Float32 in value + category EXT_direct_state_access + subcategory VERSION_2_0 + glfflags ignore + glxflags ignore + extension soft WINSOFT + glextmask GL_MASK_OpenGL_2_0 + +ProgramUniform4fEXT(program, location, v0, v1, v2, v3) + return void + param program UInt32 in value + param location Int32 in value + param v0 Float32 in value + param v1 Float32 in value + param v2 Float32 in value + param v3 Float32 in value + category EXT_direct_state_access + subcategory VERSION_2_0 + glfflags ignore + glxflags ignore + extension soft WINSOFT + glextmask GL_MASK_OpenGL_2_0 + +ProgramUniform1iEXT(program, location, v0) + return void + param program UInt32 in value + param location Int32 in value + param v0 Int32 in value + category EXT_direct_state_access + subcategory VERSION_2_0 + glfflags ignore + glxflags ignore + extension soft WINSOFT + glextmask GL_MASK_OpenGL_2_0 + +ProgramUniform2iEXT(program, location, v0, v1) + return void + param program UInt32 in value + param location Int32 in value + param v0 Int32 in value + param v1 Int32 in value + category EXT_direct_state_access + subcategory VERSION_2_0 + glfflags ignore + glxflags ignore + extension soft WINSOFT + glextmask GL_MASK_OpenGL_2_0 + +ProgramUniform3iEXT(program, location, v0, v1, v2) + return void + param program UInt32 in value + param location Int32 in value + param v0 Int32 in value + param v1 Int32 in value + param v2 Int32 in value + category EXT_direct_state_access + subcategory VERSION_2_0 + glfflags ignore + glxflags ignore + extension soft WINSOFT + glextmask GL_MASK_OpenGL_2_0 + +ProgramUniform4iEXT(program, location, v0, v1, v2, v3) + return void + param program UInt32 in value + param location Int32 in value + param v0 Int32 in value + param v1 Int32 in value + param v2 Int32 in value + param v3 Int32 in value + category EXT_direct_state_access + subcategory VERSION_2_0 + glfflags ignore + glxflags ignore + extension soft WINSOFT + glextmask GL_MASK_OpenGL_2_0 + +ProgramUniform1fvEXT(program, location, count, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param value Float32 in array [count] + category EXT_direct_state_access + subcategory VERSION_2_0 + glfflags ignore + glxflags ignore + extension soft WINSOFT + glextmask GL_MASK_OpenGL_2_0 + +ProgramUniform2fvEXT(program, location, count, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param value Float32 in array [count*2] + category EXT_direct_state_access + subcategory VERSION_2_0 + glfflags ignore + glxflags ignore + extension soft WINSOFT + glextmask GL_MASK_OpenGL_2_0 + +ProgramUniform3fvEXT(program, location, count, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param value Float32 in array [count*3] + category EXT_direct_state_access + subcategory VERSION_2_0 + glfflags ignore + glxflags ignore + extension soft WINSOFT + glextmask GL_MASK_OpenGL_2_0 + +ProgramUniform4fvEXT(program, location, count, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param value Float32 in array [count*4] + category EXT_direct_state_access + subcategory VERSION_2_0 + glfflags ignore + glxflags ignore + extension soft WINSOFT + glextmask GL_MASK_OpenGL_2_0 + +ProgramUniform1ivEXT(program, location, count, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param value Int32 in array [count] + category EXT_direct_state_access + subcategory VERSION_2_0 + glfflags ignore + glxflags ignore + extension soft WINSOFT + glextmask GL_MASK_OpenGL_2_0 + +ProgramUniform2ivEXT(program, location, count, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param value Int32 in array [count*2] + category EXT_direct_state_access + subcategory VERSION_2_0 + glfflags ignore + glxflags ignore + extension soft WINSOFT + glextmask GL_MASK_OpenGL_2_0 + +ProgramUniform3ivEXT(program, location, count, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param value Int32 in array [count*3] + category EXT_direct_state_access + subcategory VERSION_2_0 + glfflags ignore + glxflags ignore + extension soft WINSOFT + glextmask GL_MASK_OpenGL_2_0 + +ProgramUniform4ivEXT(program, location, count, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param value Int32 in array [count*4] + category EXT_direct_state_access + subcategory VERSION_2_0 + glfflags ignore + glxflags ignore + extension soft WINSOFT + glextmask GL_MASK_OpenGL_2_0 + +ProgramUniformMatrix2fvEXT(program, location, count, transpose, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float32 in array [count*4] + category EXT_direct_state_access + subcategory VERSION_2_0 + glfflags ignore + glxflags ignore + extension soft WINSOFT + glextmask GL_MASK_OpenGL_2_0 + +ProgramUniformMatrix3fvEXT(program, location, count, transpose, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float32 in array [count*9] + category EXT_direct_state_access + subcategory VERSION_2_0 + glfflags ignore + glxflags ignore + extension soft WINSOFT + glextmask GL_MASK_OpenGL_2_0 + +ProgramUniformMatrix4fvEXT(program, location, count, transpose, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float32 in array [count*16] + category EXT_direct_state_access + subcategory VERSION_2_0 + glfflags ignore + glxflags ignore + extension soft WINSOFT + glextmask GL_MASK_OpenGL_2_0 + +# New GLSL 2.1 uniform commands + +ProgramUniformMatrix2x3fvEXT(program, location, count, transpose, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float32 in array [count*6] + category EXT_direct_state_access + subcategory VERSION_2_1 + glfflags ignore + glxflags ignore + extension soft WINSOFT + glextmask GL_MASK_OpenGL_2_0 + +ProgramUniformMatrix3x2fvEXT(program, location, count, transpose, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float32 in array [count*6] + category EXT_direct_state_access + subcategory VERSION_2_1 + glfflags ignore + glxflags ignore + extension soft WINSOFT + glextmask GL_MASK_OpenGL_2_0 + +ProgramUniformMatrix2x4fvEXT(program, location, count, transpose, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float32 in array [count*8] + category EXT_direct_state_access + subcategory VERSION_2_1 + glfflags ignore + glxflags ignore + extension soft WINSOFT + glextmask GL_MASK_OpenGL_2_0 + +ProgramUniformMatrix4x2fvEXT(program, location, count, transpose, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float32 in array [count*8] + category EXT_direct_state_access + subcategory VERSION_2_1 + glfflags ignore + glxflags ignore + extension soft WINSOFT + glextmask GL_MASK_OpenGL_2_0 + +ProgramUniformMatrix3x4fvEXT(program, location, count, transpose, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float32 in array [count*12] + category EXT_direct_state_access + subcategory VERSION_2_1 + glfflags ignore + glxflags ignore + extension soft WINSOFT + glextmask GL_MASK_OpenGL_2_0 + +ProgramUniformMatrix4x3fvEXT(program, location, count, transpose, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float32 in array [count*12] + category EXT_direct_state_access + subcategory VERSION_2_1 + glfflags ignore + glxflags ignore + extension soft WINSOFT + glextmask GL_MASK_OpenGL_2_0 + +# New EXT_gpu_shader4 commands + +ProgramUniform1uiEXT(program, location, v0) + return void + param program UInt32 in value + param location Int32 in value + param v0 UInt32 in value + category EXT_direct_state_access + subcategory EXT_gpu_shader4 + glfflags ignore + glxflags ignore + extension soft WINSOFT + glextmask GL_MASK_OpenGL_2_0 + +ProgramUniform2uiEXT(program, location, v0, v1) + return void + param program UInt32 in value + param location Int32 in value + param v0 UInt32 in value + param v1 UInt32 in value + category EXT_direct_state_access + subcategory EXT_gpu_shader4 + glfflags ignore + glxflags ignore + extension soft WINSOFT + glextmask GL_MASK_OpenGL_2_0 + +ProgramUniform3uiEXT(program, location, v0, v1, v2) + return void + param program UInt32 in value + param location Int32 in value + param v0 UInt32 in value + param v1 UInt32 in value + param v2 UInt32 in value + category EXT_direct_state_access + subcategory EXT_gpu_shader4 + glfflags ignore + glxflags ignore + extension soft WINSOFT + glextmask GL_MASK_OpenGL_2_0 + +ProgramUniform4uiEXT(program, location, v0, v1, v2, v3) + return void + param program UInt32 in value + param location Int32 in value + param v0 UInt32 in value + param v1 UInt32 in value + param v2 UInt32 in value + param v3 UInt32 in value + category EXT_direct_state_access + subcategory EXT_gpu_shader4 + glfflags ignore + glxflags ignore + extension soft WINSOFT + glextmask GL_MASK_OpenGL_2_0 + +ProgramUniform1uivEXT(program, location, count, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param value UInt32 in array [count] + category EXT_direct_state_access + subcategory EXT_gpu_shader4 + glfflags ignore + glxflags ignore + extension soft WINSOFT + glextmask GL_MASK_OpenGL_2_0 + +ProgramUniform2uivEXT(program, location, count, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param value UInt32 in array [count*2] + category EXT_direct_state_access + subcategory EXT_gpu_shader4 + glfflags ignore + glxflags ignore + extension soft WINSOFT + glextmask GL_MASK_OpenGL_2_0 + +ProgramUniform3uivEXT(program, location, count, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param value UInt32 in array [count*3] + category EXT_direct_state_access + subcategory EXT_gpu_shader4 + glfflags ignore + glxflags ignore + extension soft WINSOFT + glextmask GL_MASK_OpenGL_2_0 + +ProgramUniform4uivEXT(program, location, count, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param value UInt32 in array [count*4] + category EXT_direct_state_access + subcategory EXT_gpu_shader4 + glfflags ignore + glxflags ignore + extension soft WINSOFT + glextmask GL_MASK_OpenGL_2_0 + +# New named buffer commands + +NamedBufferDataEXT(buffer, size, data, usage) + return void + param buffer UInt32 in value + param size Sizeiptr in value + param data Void in array [COMPSIZE(size)] + param usage VertexBufferObjectUsage in value + category EXT_direct_state_access + extension soft WINSOFT + dlflags notlistable + glxflags ignore + glfflags ignore + +NamedBufferSubDataEXT(buffer, offset, size, data) + return void + param buffer UInt32 in value + param offset Intptr in value + param size Sizeiptr in value + param data Void in array [COMPSIZE(size)] + category EXT_direct_state_access + extension soft WINSOFT + dlflags notlistable + glxflags ignore + glfflags ignore + +MapNamedBufferEXT(buffer, access) + return VoidPointer + param buffer UInt32 in value + param access VertexBufferObjectAccess in value + category EXT_direct_state_access + extension soft WINSOFT + dlflags notlistable + glxflags ignore + glfflags ignore + +UnmapNamedBufferEXT(buffer) + return Boolean + param buffer UInt32 in value + category EXT_direct_state_access + extension soft WINSOFT + dlflags notlistable + glxflags ignore + glfflags ignore + +MapNamedBufferRangeEXT(buffer, offset, length, access) + return VoidPointer + param buffer UInt32 in value + param offset Intptr in value + param length Sizeiptr in value + param access BufferAccessMask in value + category EXT_direct_state_access + extension soft WINSOFT + dlflags notlistable + glxflags ignore + glfflags ignore + +FlushMappedNamedBufferRangeEXT(buffer, offset, length) + return void + param buffer UInt32 in value + param offset Intptr in value + param length Sizeiptr in value + category EXT_direct_state_access + extension soft WINSOFT + dlflags notlistable + glxflags ignore + glfflags ignore + +NamedCopyBufferSubDataEXT(readBuffer, writeBuffer, readOffset, writeOffset, size) + return void + param readBuffer UInt32 in value + param writeBuffer UInt32 in value + param readOffset Intptr in value + param writeOffset Intptr in value + param size Sizeiptr in value + category EXT_direct_state_access + extension soft WINSOFT + dlflags notlistable + glxflags ignore + glfflags ignore + +# New named buffer queries + +GetNamedBufferParameterivEXT(buffer, pname, params) + return void + param buffer UInt32 in value + param pname VertexBufferObjectParameter in value + param params Int32 out array [COMPSIZE(pname)] + category EXT_direct_state_access + extension soft WINSOFT + dlflags notlistable + glxflags ignore + glfflags ignore + +GetNamedBufferPointervEXT(buffer, pname, params) + return void + param buffer UInt32 in value + param pname VertexBufferObjectParameter in value + param params VoidPointer out array [COMPSIZE(pname)] + category EXT_direct_state_access + extension soft WINSOFT + dlflags notlistable + glxflags ignore + glfflags ignore + +GetNamedBufferSubDataEXT(buffer, offset, size, data) + return void + param buffer UInt32 in value + param offset Intptr in value + param size Sizeiptr in value + param data Void out array [COMPSIZE(size)] + category EXT_direct_state_access + extension soft WINSOFT + dlflags notlistable + glxflags ignore + glfflags ignore + +# New named texture buffer texture object command + +TextureBufferEXT(texture, target, internalformat, buffer) + return void + param texture Texture in value + param target TextureTarget in value + param internalformat TypeEnum in value + param buffer UInt32 in value + category EXT_direct_state_access + subcategory EXT_texture_buffer_object + extension soft WINSOFT NV50 + glfflags ignore + glxflags ignore + glextmask GL_MASK_EXT_texture_buffer_object + dlflags notlistable + +# New named texture buffer multitexture command + +MultiTexBufferEXT(texunit, target, internalformat, buffer) + return void + param texunit TextureUnit in value + param target TextureTarget in value + param internalformat TypeEnum in value + param buffer UInt32 in value + category EXT_direct_state_access + subcategory EXT_texture_buffer_object + extension soft WINSOFT NV50 + glfflags ignore + glxflags ignore + glextmask GL_MASK_EXT_texture_buffer_object + dlflags notlistable + +# New named frame buffer object commands + +NamedRenderbufferStorageEXT(renderbuffer, internalformat, width, height) + return void + param renderbuffer Renderbuffer in value + param internalformat PixelInternalFormat in value + param width SizeI in value + param height SizeI in value + category EXT_direct_state_access + subcategory EXT_framebuffer_object + extension soft WINSOFT + dlflags notlistable + glfflags ignore + glxflags ignore + glextmask GL_MASK_EXT_framebuffer_object + +GetNamedRenderbufferParameterivEXT(renderbuffer, pname, params) + return void + param renderbuffer Renderbuffer in value + param pname RenderbufferParameterName in value + param params Int32 out array [COMPSIZE(pname)] + category EXT_direct_state_access + subcategory EXT_framebuffer_object + extension soft WINSOFT + dlflags notlistable + glfflags ignore + glxflags ignore + glextmask GL_MASK_EXT_framebuffer_object + +CheckNamedFramebufferStatusEXT(framebuffer, target) + return FramebufferStatus + param framebuffer Framebuffer in value + param target FramebufferTarget in value + category EXT_direct_state_access + subcategory EXT_framebuffer_object + extension soft WINSOFT + dlflags notlistable + glfflags ignore + glxflags ignore + glextmask GL_MASK_EXT_framebuffer_object + +NamedFramebufferTexture1DEXT(framebuffer, attachment, textarget, texture, level) + return void + param framebuffer Framebuffer in value + param attachment FramebufferAttachment in value + param textarget TextureTarget in value + param texture Texture in value + param level CheckedInt32 in value + category EXT_direct_state_access + subcategory EXT_framebuffer_object + extension soft WINSOFT + dlflags notlistable + glfflags ignore + glxflags ignore + glextmask GL_MASK_EXT_framebuffer_object + +NamedFramebufferTexture2DEXT(framebuffer, attachment, textarget, texture, level) + return void + param framebuffer Framebuffer in value + param attachment FramebufferAttachment in value + param textarget TextureTarget in value + param texture Texture in value + param level CheckedInt32 in value + category EXT_direct_state_access + subcategory EXT_framebuffer_object + extension soft WINSOFT + dlflags notlistable + glfflags ignore + glxflags ignore + glextmask GL_MASK_EXT_framebuffer_object + +NamedFramebufferTexture3DEXT(framebuffer, attachment, textarget, texture, level, zoffset) + return void + param framebuffer Framebuffer in value + param attachment FramebufferAttachment in value + param textarget TextureTarget in value + param texture Texture in value + param level CheckedInt32 in value + param zoffset CheckedInt32 in value + category EXT_direct_state_access + subcategory EXT_framebuffer_object + extension soft WINSOFT + dlflags notlistable + glfflags ignore + glxflags ignore + glextmask GL_MASK_EXT_framebuffer_object + +NamedFramebufferRenderbufferEXT(framebuffer, attachment, renderbuffertarget, renderbuffer) + return void + param framebuffer Framebuffer in value + param attachment FramebufferAttachment in value + param renderbuffertarget RenderbufferTarget in value + param renderbuffer Renderbuffer in value + category EXT_direct_state_access + subcategory EXT_framebuffer_object + extension soft WINSOFT + dlflags notlistable + glfflags ignore + glxflags ignore + glextmask GL_MASK_EXT_framebuffer_object + +GetNamedFramebufferAttachmentParameterivEXT(framebuffer, attachment, pname, params) + return void + param framebuffer Framebuffer in value + param attachment FramebufferAttachment in value + param pname FramebufferAttachmentParameterName in value + param params Int32 out array [COMPSIZE(pname)] + category EXT_direct_state_access + subcategory EXT_framebuffer_object + extension soft WINSOFT + dlflags notlistable + glfflags ignore + glxflags ignore + glextmask GL_MASK_EXT_framebuffer_object + +GenerateTextureMipmapEXT(texture, target) + return void + param texture Texture in value + param target TextureTarget in value + category EXT_direct_state_access + subcategory EXT_framebuffer_object + extension soft WINSOFT + dlflags notlistable + glfflags ignore + glxflags ignore + glextmask GL_MASK_EXT_framebuffer_object + +GenerateMultiTexMipmapEXT(texunit, target) + return void + param texunit TextureUnit in value + param target TextureTarget in value + category EXT_direct_state_access + subcategory EXT_framebuffer_object + extension soft WINSOFT + dlflags notlistable + glfflags ignore + glxflags ignore + glextmask GL_MASK_EXT_framebuffer_object + +FramebufferDrawBufferEXT(framebuffer, mode) + return void + param framebuffer Framebuffer in value + param mode DrawBufferMode in value + category EXT_direct_state_access + subcategory EXT_framebuffer_object + extension soft WINSOFT + glfflags ignore + glxflags ignore + glextmask GL_MASK_EXT_framebuffer_object + +FramebufferDrawBuffersEXT(framebuffer, n, bufs) + return void + param framebuffer Framebuffer in value + param n SizeI in value + param bufs DrawBufferMode in array [n] + category EXT_direct_state_access + subcategory EXT_framebuffer_object + extension soft WINSOFT + glfflags ignore + glxflags ignore + glextmask GL_MASK_EXT_framebuffer_object + +FramebufferReadBufferEXT(framebuffer, mode) + return void + param framebuffer Framebuffer in value + param mode ReadBufferMode in value + category EXT_direct_state_access + subcategory EXT_framebuffer_object + extension soft WINSOFT + glfflags ignore + glxflags ignore + glextmask GL_MASK_EXT_framebuffer_object + +GetFramebufferParameterivEXT(framebuffer, pname, params) + return void + param framebuffer Framebuffer in value + param pname GetFramebufferParameter in value + param params Int32 out array [COMPSIZE(pname)] + category EXT_direct_state_access + subcategory EXT_framebuffer_object + dlflags notlistable + extension soft WINSOFT + glxflags ignore + glfflags capture-execute gl-enum + +# New named framebuffer multisample object commands + +NamedRenderbufferStorageMultisampleEXT(renderbuffer, samples, internalformat, width, height) + return void + param renderbuffer Renderbuffer in value + param samples SizeI in value + param internalformat PixelInternalFormat in value + param width SizeI in value + param height SizeI in value + category EXT_direct_state_access + subcategory EXT_framebuffer_multisample + extension soft WINSOFT + dlflags notlistable + glfflags ignore + glxflags ignore + glextmask GL_MASK_EXT_framebuffer_multisample + +# New named framebuffer multisample coverage object commands + +NamedRenderbufferStorageMultisampleCoverageEXT(renderbuffer, coverageSamples, colorSamples, internalformat, width, height) + return void + param renderbuffer Renderbuffer in value + param coverageSamples SizeI in value + param colorSamples SizeI in value + param internalformat PixelInternalFormat in value + param width SizeI in value + param height SizeI in value + category EXT_direct_state_access + subcategory NV_framebuffer_multisample_coverage + extension soft WINSOFT + dlflags notlistable + glfflags ignore + glxflags ignore + glextmask GL_MASK_NV_framebuffer_multisample_coverage + +# New named geometry program/shader frame buffer object commands + +NamedFramebufferTextureEXT(framebuffer, attachment, texture, level) + return void + param framebuffer Framebuffer in value + param attachment FramebufferAttachment in value + param texture Texture in value + param level CheckedInt32 in value + category EXT_direct_state_access + subcategory NV_gpu_program4 + extension soft WINSOFT + dlflags notlistable + glfflags ignore + glxflags ignore + glextmask GL_MASK_NV_gpu_program4 + +NamedFramebufferTextureLayerEXT(framebuffer, attachment, texture, level, layer) + return void + param framebuffer Framebuffer in value + param attachment FramebufferAttachment in value + param texture Texture in value + param level CheckedInt32 in value + param layer CheckedInt32 in value + category EXT_direct_state_access + subcategory NV_gpu_program4 + extension soft WINSOFT + dlflags notlistable + glfflags ignore + glxflags ignore + glextmask GL_MASK_NV_gpu_program4 + +NamedFramebufferTextureFaceEXT(framebuffer, attachment, texture, level, face) + return void + param framebuffer Framebuffer in value + param attachment FramebufferAttachment in value + param texture Texture in value + param level CheckedInt32 in value + param face TextureTarget in value + category EXT_direct_state_access + subcategory NV_gpu_program4 + extension soft WINSOFT + dlflags notlistable + glfflags ignore + glxflags ignore + glextmask GL_MASK_NV_gpu_program4 + +# New explicit multisample query and commands + +TextureRenderbufferEXT(texture, target, renderbuffer) + return void + param texture Texture in value + param target TextureTarget in value + param renderbuffer UInt32 in value + category EXT_direct_state_access + subcategory NV_explicit_multisample + extension soft WINSOFT NV50 + dlflags notlistable + glfflags ignore + glxflags ignore + glextmask GL_MASK_NV_explicit_multisample + +MultiTexRenderbufferEXT(texunit, target, renderbuffer) + return void + param texunit TextureUnit in value + param target TextureTarget in value + param renderbuffer UInt32 in value + category EXT_direct_state_access + subcategory NV_explicit_multisample + extension soft WINSOFT NV50 + dlflags notlistable + glfflags ignore + glxflags ignore + glextmask GL_MASK_NV_explicit_multisample + +# New ARB_gpu_shader_fp64 commands + +ProgramUniform1dEXT(program, location, x) + return void + param program UInt32 in value + param location Int32 in value + param x Float64 in value + category EXT_direct_state_access + subcategory ARB_gpu_shader_fp64 + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniform2dEXT(program, location, x, y) + return void + param program UInt32 in value + param location Int32 in value + param x Float64 in value + param y Float64 in value + category EXT_direct_state_access + subcategory ARB_gpu_shader_fp64 + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniform3dEXT(program, location, x, y, z) + return void + param program UInt32 in value + param location Int32 in value + param x Float64 in value + param y Float64 in value + param z Float64 in value + category EXT_direct_state_access + subcategory ARB_gpu_shader_fp64 + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniform4dEXT(program, location, x, y, z, w) + return void + param program UInt32 in value + param location Int32 in value + param x Float64 in value + param y Float64 in value + param z Float64 in value + param w Float64 in value + category EXT_direct_state_access + subcategory ARB_gpu_shader_fp64 + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniform1dvEXT(program, location, count, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param value Float64 in array [count] + category EXT_direct_state_access + subcategory ARB_gpu_shader_fp64 + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniform2dvEXT(program, location, count, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param value Float64 in array [count] + category EXT_direct_state_access + subcategory ARB_gpu_shader_fp64 + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniform3dvEXT(program, location, count, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param value Float64 in array [count] + category EXT_direct_state_access + subcategory ARB_gpu_shader_fp64 + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniform4dvEXT(program, location, count, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param value Float64 in array [count] + category EXT_direct_state_access + subcategory ARB_gpu_shader_fp64 + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniformMatrix2dvEXT(program, location, count, transpose, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float64 in array [count] + category EXT_direct_state_access + subcategory ARB_gpu_shader_fp64 + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniformMatrix3dvEXT(program, location, count, transpose, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float64 in array [count] + category EXT_direct_state_access + subcategory ARB_gpu_shader_fp64 + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniformMatrix4dvEXT(program, location, count, transpose, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float64 in array [count] + category EXT_direct_state_access + subcategory ARB_gpu_shader_fp64 + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniformMatrix2x3dvEXT(program, location, count, transpose, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float64 in array [count] + category EXT_direct_state_access + subcategory ARB_gpu_shader_fp64 + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniformMatrix2x4dvEXT(program, location, count, transpose, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float64 in array [count] + category EXT_direct_state_access + subcategory ARB_gpu_shader_fp64 + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniformMatrix3x2dvEXT(program, location, count, transpose, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float64 in array [count] + category EXT_direct_state_access + subcategory ARB_gpu_shader_fp64 + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniformMatrix3x4dvEXT(program, location, count, transpose, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float64 in array [count] + category EXT_direct_state_access + subcategory ARB_gpu_shader_fp64 + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniformMatrix4x2dvEXT(program, location, count, transpose, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float64 in array [count] + category EXT_direct_state_access + subcategory ARB_gpu_shader_fp64 + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniformMatrix4x3dvEXT(program, location, count, transpose, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param transpose Boolean in value + param value Float64 in array [count] + category EXT_direct_state_access + subcategory ARB_gpu_shader_fp64 + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +############################################################################### +# +# Extension #354 +# EXT_vertex_array_bgra commands +# +############################################################################### + +# (none) +newcategory: EXT_vertex_array_bgra + +############################################################################### +# +# Extension #355 - WGL_NV_gpu_affinity +# +############################################################################### + +############################################################################### +# +# Extension #356 +# EXT_texture_swizzle commands +# +############################################################################### + +# (none) +newcategory: EXT_texture_swizzle + +############################################################################### +# +# Extension #357 +# NV_explicit_multisample commands +# +############################################################################### + +# From EXT_draw_buffers2: GetBooleanIndexedvEXT / GetIntegerIndexedvEXT + +GetMultisamplefvNV(pname, index, val) + return void + param pname GetMultisamplePNameNV in value + param index UInt32 in value + param val Float32 out array [2] + category NV_explicit_multisample + dlflags notlistable + glfflags ignore + glxflags ignore + +SampleMaskIndexedNV(index, mask) + return void + param index UInt32 in value + param mask SampleMaskNV in value + category NV_explicit_multisample + glfflags ignore + glxflags ignore + +TexRenderbufferNV(target, renderbuffer) + return void + param target TextureTarget in value + param renderbuffer UInt32 in value + category NV_explicit_multisample + dlflags notlistable + glfflags ignore + glxflags ignore + +############################################################################### +# +# Extension #358 +# NV_transform_feedback2 commands +# +############################################################################### + +BindTransformFeedbackNV(target, id) + return void + param target BufferTargetARB in value + param id UInt32 in value + category NV_transform_feedback2 + glfflags ignore + glxflags ignore + +DeleteTransformFeedbacksNV(n, ids) + return void + param n SizeI in value + param ids UInt32 in array [n] + category NV_transform_feedback2 + dlflags notlistable + glfflags ignore + glxflags ignore + +GenTransformFeedbacksNV(n, ids) + return void + param n SizeI in value + param ids UInt32 out array [n] + category NV_transform_feedback2 + dlflags notlistable + glfflags ignore + glxflags ignore + +IsTransformFeedbackNV(id) + return Boolean + param id UInt32 in value + category NV_transform_feedback2 + dlflags notlistable + glfflags ignore + glxflags ignore + +PauseTransformFeedbackNV() + return void + category NV_transform_feedback2 + glfflags ignore + glxflags ignore + +ResumeTransformFeedbackNV() + return void + category NV_transform_feedback2 + glfflags ignore + glxflags ignore + +DrawTransformFeedbackNV(mode, id) + return void + param mode GLenum in value + param id UInt32 in value + category NV_transform_feedback2 + glfflags ignore + glxflags ignore + +############################################################################### +# +# Extension #359 +# ATI_meminfo commands +# +############################################################################### + +# (none) +newcategory: ATI_meminfo + +############################################################################### +# +# Extension #360 +# AMD_performance_monitor commands +# +############################################################################### + +GetPerfMonitorGroupsAMD(numGroups, groupsSize, groups) + return void + param numGroups Int32 out array [1] + param groupsSize SizeI in value + param groups UInt32 out array [groupsSize] + category AMD_performance_monitor + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +GetPerfMonitorCountersAMD(group, numCounters, maxActiveCounters, counterSize, counters) + return void + param group UInt32 in value + param numCounters Int32 out array [1] + param maxActiveCounters Int32 out array [1] + param counterSize SizeI in value + param counters UInt32 out array [counterSize] + category AMD_performance_monitor + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +GetPerfMonitorGroupStringAMD(group, bufSize, length, groupString) + return void + param group UInt32 in value + param bufSize SizeI in value + param length SizeI out array [1] + param groupString Char out array [bufSize] + category AMD_performance_monitor + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +GetPerfMonitorCounterStringAMD(group, counter, bufSize, length, counterString) + return void + param group UInt32 in value + param counter UInt32 in value + param bufSize SizeI in value + param length SizeI out array [1] + param counterString Char out array [bufSize] + category AMD_performance_monitor + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +GetPerfMonitorCounterInfoAMD(group, counter, pname, data) + return void + param group UInt32 in value + param counter UInt32 in value + param pname GLenum in value + param data Void out array [COMPSIZE(pname)] + category AMD_performance_monitor + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +GenPerfMonitorsAMD(n, monitors) + return void + param n SizeI in value + param monitors UInt32 out array [n] + category AMD_performance_monitor + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +# 'monitors' is actually in, not out, but extension spec doesn't use const +DeletePerfMonitorsAMD(n, monitors) + return void + param n SizeI in value + param monitors UInt32 out array [n] + category AMD_performance_monitor + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +# 'counterList' is actually in, not out, but extension spec doesn't use const +SelectPerfMonitorCountersAMD(monitor, enable, group, numCounters, counterList) + return void + param monitor UInt32 in value + param enable Boolean in value + param group UInt32 in value + param numCounters Int32 in value + param counterList UInt32 out array [numCounters] + category AMD_performance_monitor + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +BeginPerfMonitorAMD(monitor) + return void + param monitor UInt32 in value + category AMD_performance_monitor + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +EndPerfMonitorAMD(monitor) + return void + param monitor UInt32 in value + category AMD_performance_monitor + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +GetPerfMonitorCounterDataAMD(monitor, pname, dataSize, data, bytesWritten) + return void + param monitor UInt32 in value + param pname GLenum in value + param dataSize SizeI in value + param data UInt32 out array [dataSize] + param bytesWritten Int32 out array [1] + category AMD_performance_monitor + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +############################################################################### +# +# Extension #361 - WGL_AMD_gpu_association +# +############################################################################### + +############################################################################### +# +# Extension #362 +# AMD_texture_texture4 commands +# +############################################################################### + +# (none) +newcategory: AMD_texture_texture4 + +############################################################################### +# +# Extension #363 +# AMD_vertex_shader_tesselator commands +# +############################################################################### + +TessellationFactorAMD(factor) + return void + param factor Float32 in value + category AMD_vertex_shader_tesselator + version 2.0 + glxsingle ? + glxflags ignore + offset ? + +TessellationModeAMD(mode) + return void + param mode GLenum in value + category AMD_vertex_shader_tesselator + version 2.0 + glxsingle ? + glxflags ignore + offset ? + +############################################################################### +# +# Extension #364 +# EXT_provoking_vertex commands +# +############################################################################### + +ProvokingVertexEXT(mode) + return void + param mode GLenum in value + category EXT_provoking_vertex + version 2.1 + glxsingle ? + glxflags ignore + offset ? + +############################################################################### +# +# Extension #365 +# EXT_texture_snorm commands +# +############################################################################### + +# (none) +newcategory: EXT_texture_snorm + +############################################################################### +# +# Extension #366 +# AMD_draw_buffers_blend commands +# +############################################################################### + +# void BlendFuncIndexedAMD(uint buf, enum src, enum dst) +# void BlendFuncSeparateIndexedAMD(uint buf, enum srcRGB, enum dstRGB, enum srcAlpha, enum dstAlpha) +# void BlendEquationIndexedAMD(uint buf, enum mode) +# void BlendEquationSeparateIndexedAMD(uint buf, enum modeRGB, enum modeAlpha) + +BlendFuncIndexedAMD(buf, src, dst) + return void + param buf UInt32 in value + param src GLenum in value + param dst GLenum in value + category AMD_draw_buffers_blend + version 2.0 + extension + glxropcode ? + glxflags ignore + offset ? + +BlendFuncSeparateIndexedAMD(buf, srcRGB, dstRGB, srcAlpha, dstAlpha) + return void + param buf UInt32 in value + param srcRGB GLenum in value + param dstRGB GLenum in value + param srcAlpha GLenum in value + param dstAlpha GLenum in value + category AMD_draw_buffers_blend + version 2.0 + extension + glxropcode ? + glxflags ignore + offset ? + +BlendEquationIndexedAMD(buf, mode) + return void + param buf UInt32 in value + param mode GLenum in value + category AMD_draw_buffers_blend + version 2.0 + extension + glxropcode ? + glxflags ignore + offset ? + +BlendEquationSeparateIndexedAMD(buf, modeRGB, modeAlpha) + return void + param buf UInt32 in value + param modeRGB GLenum in value + param modeAlpha GLenum in value + category AMD_draw_buffers_blend + version 2.0 + extension + glxropcode ? + glxflags ignore + offset ? + +############################################################################### +# +# Extension #367 +# APPLE_texture_range commands +# +############################################################################### + +TextureRangeAPPLE(target, length, pointer) + return void + param target GLenum in value + param length SizeI in value + param pointer Void in array [length] + category APPLE_texture_range + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +GetTexParameterPointervAPPLE(target, pname, params) + return void + param target GLenum in value + param pname GLenum in value + param params VoidPointer out array [1] + category APPLE_texture_range + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +############################################################################### +# +# Extension #368 +# APPLE_float_pixels commands +# +############################################################################### + +# (none) +newcategory: APPLE_float_pixels + +############################################################################### +# +# Extension #369 +# APPLE_vertex_program_evaluators commands +# +############################################################################### + +EnableVertexAttribAPPLE(index, pname) + return void + param index UInt32 in value + param pname GLenum in value + category APPLE_vertex_program_evaluators + version 1.5 + extension + glxropcode ? + glxflags ignore + offset ? + +DisableVertexAttribAPPLE(index, pname) + return void + param index UInt32 in value + param pname GLenum in value + category APPLE_vertex_program_evaluators + version 1.5 + extension + glxropcode ? + glxflags ignore + offset ? + +IsVertexAttribEnabledAPPLE(index, pname) + return Boolean + param index UInt32 in value + param pname GLenum in value + category APPLE_vertex_program_evaluators + version 1.5 + extension + glxropcode ? + glxflags ignore + offset ? + +MapVertexAttrib1dAPPLE(index, size, u1, u2, stride, order, points) + return void + param index UInt32 in value + param size UInt32 in value + param u1 CoordD in value + param u2 CoordD in value + param stride Int32 in value + param order CheckedInt32 in value + param points CoordD in array [COMPSIZE(size/stride/order)] + category APPLE_vertex_program_evaluators + version 1.5 + extension + glxropcode ? + glxflags ignore + offset ? + +MapVertexAttrib1fAPPLE(index, size, u1, u2, stride, order, points) + return void + param index UInt32 in value + param size UInt32 in value + param u1 CoordF in value + param u2 CoordF in value + param stride Int32 in value + param order CheckedInt32 in value + param points CoordF in array [COMPSIZE(size/stride/order)] + category APPLE_vertex_program_evaluators + version 1.5 + extension + glxropcode ? + glxflags ignore + offset ? + +MapVertexAttrib2dAPPLE(index, size, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points) + return void + param index UInt32 in value + param size UInt32 in value + param u1 CoordD in value + param u2 CoordD in value + param ustride Int32 in value + param uorder CheckedInt32 in value + param v1 CoordD in value + param v2 CoordD in value + param vstride Int32 in value + param vorder CheckedInt32 in value + param points CoordD in array [COMPSIZE(size/ustride/uorder/vstride/vorder)] + category APPLE_vertex_program_evaluators + version 1.5 + extension + glxropcode ? + glxflags ignore + offset ? + +MapVertexAttrib2fAPPLE(index, size, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points) + return void + param index UInt32 in value + param size UInt32 in value + param u1 CoordF in value + param u2 CoordF in value + param ustride Int32 in value + param uorder CheckedInt32 in value + param v1 CoordF in value + param v2 CoordF in value + param vstride Int32 in value + param vorder CheckedInt32 in value + param points CoordF in array [COMPSIZE(size/ustride/uorder/vstride/vorder)] + category APPLE_vertex_program_evaluators + version 1.5 + extension + glxropcode ? + glxflags ignore + offset ? + +############################################################################### +# +# Extension #370 +# APPLE_aux_depth_stencil commands +# +############################################################################### + +# (none) +newcategory: APPLE_aux_depth_stencil + +############################################################################### +# +# Extension #371 +# APPLE_object_purgeable commands +# +############################################################################### + +ObjectPurgeableAPPLE(objectType, name, option) + return GLenum + param objectType GLenum in value + param name UInt32 in value + param option GLenum in value + category APPLE_object_purgeable + version 1.5 + extension + glxropcode ? + glxflags ignore + offset ? + +ObjectUnpurgeableAPPLE(objectType, name, option) + return GLenum + param objectType GLenum in value + param name UInt32 in value + param option GLenum in value + category APPLE_object_purgeable + version 1.5 + extension + glxropcode ? + glxflags ignore + offset ? + +GetObjectParameterivAPPLE(objectType, name, pname, params) + return void + param objectType GLenum in value + param name UInt32 in value + param pname GLenum in value + param params Int32 out array [COMPSIZE(pname)] + category APPLE_object_purgeable + dlflags notlistable + version 1.5 + extension + glxsingle ? + glxflags ignore + offset ? + +############################################################################### +# +# Extension #372 +# APPLE_row_bytes commands +# +############################################################################### + +# (none) +newcategory: APPLE_row_bytes + +############################################################################### +# +# Extension #373 +# APPLE_rgb_422 commands +# +############################################################################### + +# (none) +newcategory: APPLE_rgb_422 + +############################################################################### +# +# Extension #374 +# NV_video_capture commands +# +############################################################################### + +BeginVideoCaptureNV(video_capture_slot) + return void + param video_capture_slot UInt32 in value + category NV_video_capture + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +BindVideoCaptureStreamBufferNV(video_capture_slot, stream, frame_region, offset) + return void + param video_capture_slot UInt32 in value + param stream UInt32 in value + param frame_region GLenum in value + param offset BufferOffsetARB in value + category NV_video_capture + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +BindVideoCaptureStreamTextureNV(video_capture_slot, stream, frame_region, target, texture) + return void + param video_capture_slot UInt32 in value + param stream UInt32 in value + param frame_region GLenum in value + param target GLenum in value + param texture UInt32 in value + category NV_video_capture + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +EndVideoCaptureNV(video_capture_slot) + return void + param video_capture_slot UInt32 in value + category NV_video_capture + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +GetVideoCaptureivNV(video_capture_slot, pname, params) + return void + param video_capture_slot UInt32 in value + param pname GLenum in value + param params Int32 out array [COMPSIZE(pname)] + category NV_video_capture + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +GetVideoCaptureStreamivNV(video_capture_slot, stream, pname, params) + return void + param video_capture_slot UInt32 in value + param stream UInt32 in value + param pname GLenum in value + param params Int32 out array [COMPSIZE(pname)] + category NV_video_capture + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +GetVideoCaptureStreamfvNV(video_capture_slot, stream, pname, params) + return void + param video_capture_slot UInt32 in value + param stream UInt32 in value + param pname GLenum in value + param params Float32 out array [COMPSIZE(pname)] + category NV_video_capture + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +GetVideoCaptureStreamdvNV(video_capture_slot, stream, pname, params) + return void + param video_capture_slot UInt32 in value + param stream UInt32 in value + param pname GLenum in value + param params Float64 out array [COMPSIZE(pname)] + category NV_video_capture + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +VideoCaptureNV(video_capture_slot, sequence_num, capture_time) + return GLenum + param video_capture_slot UInt32 in value + param sequence_num UInt32 out reference + param capture_time UInt64EXT out reference + category NV_video_capture + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VideoCaptureStreamParameterivNV(video_capture_slot, stream, pname, params) + return void + param video_capture_slot UInt32 in value + param stream UInt32 in value + param pname GLenum in value + param params Int32 in array [COMPSIZE(pname)] + category NV_video_capture + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VideoCaptureStreamParameterfvNV(video_capture_slot, stream, pname, params) + return void + param video_capture_slot UInt32 in value + param stream UInt32 in value + param pname GLenum in value + param params Float32 in array [COMPSIZE(pname)] + category NV_video_capture + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VideoCaptureStreamParameterdvNV(video_capture_slot, stream, pname, params) + return void + param video_capture_slot UInt32 in value + param stream UInt32 in value + param pname GLenum in value + param params Float64 in array [COMPSIZE(pname)] + category NV_video_capture + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +############################################################################### +# +# Extension #375 - GLX_EXT_swap_control +# +############################################################################### + +############################################################################### +# +# Extension #376 - also GLX_NV_copy_image, WGL_NV_copy_image +# NV_copy_image commands +# +############################################################################### + +CopyImageSubDataNV(srcName, srcTarget, srcLevel, srcX, srcY, srcZ, dstName, dstTarget, dstLevel, dstX, dstY, dstZ, width, height, depth) + return void + param srcName UInt32 in value + param srcTarget GLenum in value + param srcLevel Int32 in value + param srcX Int32 in value + param srcY Int32 in value + param srcZ Int32 in value + param dstName UInt32 in value + param dstTarget GLenum in value + param dstLevel Int32 in value + param dstX Int32 in value + param dstY Int32 in value + param dstZ Int32 in value + param width SizeI in value + param height SizeI in value + param depth SizeI in value + category NV_copy_image + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +############################################################################### +# +# Extension #377 +# EXT_separate_shader_objects commands +# +############################################################################### + +UseShaderProgramEXT(type, program) + return void + param type GLenum in value + param program UInt32 in value + category EXT_separate_shader_objects + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +ActiveProgramEXT(program) + return void + param program UInt32 in value + category EXT_separate_shader_objects + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +CreateShaderProgramEXT(type, string) + return UInt32 + param type GLenum in value + param string Char in array [] + category EXT_separate_shader_objects + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +############################################################################### +# +# Extension #378 +# NV_parameter_buffer_object2 commands +# +############################################################################### + +# (none) +newcategory: NV_parameter_buffer_object2 + +############################################################################### +# +# Extension #379 +# NV_shader_buffer_load commands +# +############################################################################### + +MakeBufferResidentNV(target, access) + return void + param target GLenum in value + param access GLenum in value + category NV_shader_buffer_load + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +MakeBufferNonResidentNV(target) + return void + param target GLenum in value + category NV_shader_buffer_load + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +IsBufferResidentNV(target) + return Boolean + param target GLenum in value + category NV_shader_buffer_load + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +MakeNamedBufferResidentNV(buffer, access) + return void + param buffer UInt32 in value + param access GLenum in value + category NV_shader_buffer_load + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +MakeNamedBufferNonResidentNV(buffer) + return void + param buffer UInt32 in value + category NV_shader_buffer_load + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +IsNamedBufferResidentNV(buffer) + return Boolean + param buffer UInt32 in value + category NV_shader_buffer_load + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +GetBufferParameterui64vNV(target, pname, params) + return void + param target GLenum in value + param pname GLenum in value + param params UInt64EXT out array [COMPSIZE(pname)] + category NV_shader_buffer_load + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +GetNamedBufferParameterui64vNV(buffer, pname, params) + return void + param buffer UInt32 in value + param pname GLenum in value + param params UInt64EXT out array [COMPSIZE(pname)] + category NV_shader_buffer_load + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +GetIntegerui64vNV(value, result) + return void + param value GLenum in value + param result UInt64EXT out array [COMPSIZE(value)] + category NV_shader_buffer_load + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +Uniformui64NV(location, value) + return void + param location Int32 in value + param value UInt64EXT in value + category NV_shader_buffer_load + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +Uniformui64vNV(location, count, value) + return void + param location Int32 in value + param count SizeI in value + param value UInt64EXT in array [count] + category NV_shader_buffer_load + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +GetUniformui64vNV(program, location, params) + return void + param program UInt32 in value + param location Int32 in value + param params UInt64EXT out array [COMPSIZE(program/location)] + category NV_shader_buffer_load + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +ProgramUniformui64NV(program, location, value) + return void + param program UInt32 in value + param location Int32 in value + param value UInt64EXT in value + category NV_shader_buffer_load + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniformui64vNV(program, location, count, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param value UInt64EXT in array [count] + category NV_shader_buffer_load + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +############################################################################### +# +# Extension #380 +# NV_vertex_buffer_unified_memory commands +# +############################################################################### + +BufferAddressRangeNV(pname, index, address, length) + return void + param pname GLenum in value + param index UInt32 in value + param address UInt64EXT in value + param length BufferSize in value + category NV_vertex_buffer_unified_memory + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexFormatNV(size, type, stride) + return void + param size Int32 in value + param type GLenum in value + param stride SizeI in value + category NV_vertex_buffer_unified_memory + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +NormalFormatNV(type, stride) + return void + param type GLenum in value + param stride SizeI in value + category NV_vertex_buffer_unified_memory + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +ColorFormatNV(size, type, stride) + return void + param size Int32 in value + param type GLenum in value + param stride SizeI in value + category NV_vertex_buffer_unified_memory + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +IndexFormatNV(type, stride) + return void + param type GLenum in value + param stride SizeI in value + category NV_vertex_buffer_unified_memory + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +TexCoordFormatNV(size, type, stride) + return void + param size Int32 in value + param type GLenum in value + param stride SizeI in value + category NV_vertex_buffer_unified_memory + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +EdgeFlagFormatNV(stride) + return void + param stride SizeI in value + category NV_vertex_buffer_unified_memory + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +SecondaryColorFormatNV(size, type, stride) + return void + param size Int32 in value + param type GLenum in value + param stride SizeI in value + category NV_vertex_buffer_unified_memory + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +FogCoordFormatNV(type, stride) + return void + param type GLenum in value + param stride SizeI in value + category NV_vertex_buffer_unified_memory + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexAttribFormatNV(index, size, type, normalized, stride) + return void + param index UInt32 in value + param size Int32 in value + param type GLenum in value + param normalized Boolean in value + param stride SizeI in value + category NV_vertex_buffer_unified_memory + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexAttribIFormatNV(index, size, type, stride) + return void + param index UInt32 in value + param size Int32 in value + param type GLenum in value + param stride SizeI in value + category NV_vertex_buffer_unified_memory + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +GetIntegerui64i_vNV(value, index, result) + return void + param value GLenum in value + param index UInt32 in value + param result UInt64EXT out array [COMPSIZE(value)] + category NV_vertex_buffer_unified_memory + dlflags notlistable + version 1.2 + extension + glxsingle ? + glxflags ignore + offset ? + +############################################################################### +# +# Extension #381 +# NV_texture_barrier commands +# +############################################################################### + +TextureBarrierNV() + return void + category NV_texture_barrier + version 1.2 + extension + glxropcode ? + glxflags ignore + offset ? + +############################################################################### +# +# Extension #382 +# AMD_shader_stencil_export commands +# +############################################################################### + +# (none) +newcategory: AMD_shader_stencil_export + +############################################################################### +# +# Extension #383 +# AMD_seamless_cubemap_per_texture commands +# +############################################################################### + +# (none) +newcategory: AMD_seamless_cubemap_per_texture + +############################################################################### +# +# Extension #384 - GLX_INTEL_swap_event +# +############################################################################### + +############################################################################### +# +# Extension #385 +# AMD_conservative_depth commands +# +############################################################################### + +# (none) +newcategory: AMD_conservative_depth + +############################################################################### +# +# Extension #386 +# EXT_shader_image_load_store commands +# +############################################################################### + +BindImageTextureEXT(index, texture, level, layered, layer, access, format) + return void + param index UInt32 in value + param texture UInt32 in value + param level Int32 in value + param layered Boolean in value + param layer Int32 in value + param access GLenum in value + param format Int32 in value + category EXT_shader_image_load_store + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +MemoryBarrierEXT(barriers) + return void + param barriers GLbitfield in value + category EXT_shader_image_load_store + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +############################################################################### +# +# Extension #387 +# EXT_vertex_attrib_64bit commands +# +############################################################################### + +VertexAttribL1dEXT(index, x) + return void + param index UInt32 in value + param x Float64 in value + category EXT_vertex_attrib_64bit + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexAttribL2dEXT(index, x, y) + return void + param index UInt32 in value + param x Float64 in value + param y Float64 in value + category EXT_vertex_attrib_64bit + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexAttribL3dEXT(index, x, y, z) + return void + param index UInt32 in value + param x Float64 in value + param y Float64 in value + param z Float64 in value + category EXT_vertex_attrib_64bit + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexAttribL4dEXT(index, x, y, z, w) + return void + param index UInt32 in value + param x Float64 in value + param y Float64 in value + param z Float64 in value + param w Float64 in value + category EXT_vertex_attrib_64bit + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexAttribL1dvEXT(index, v) + return void + param index UInt32 in value + param v Float64 in array [1] + category EXT_vertex_attrib_64bit + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexAttribL2dvEXT(index, v) + return void + param index UInt32 in value + param v Float64 in array [2] + category EXT_vertex_attrib_64bit + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexAttribL3dvEXT(index, v) + return void + param index UInt32 in value + param v Float64 in array [3] + category EXT_vertex_attrib_64bit + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexAttribL4dvEXT(index, v) + return void + param index UInt32 in value + param v Float64 in array [4] + category EXT_vertex_attrib_64bit + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexAttribLPointerEXT(index, size, type, stride, pointer) + return void + param index UInt32 in value + param size Int32 in value + param type GLenum in value + param stride SizeI in value + param pointer Void in array [size] + category EXT_vertex_attrib_64bit + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +GetVertexAttribLdvEXT(index, pname, params) + return void + param index UInt32 in value + param pname GLenum in value + param params Float64 out array [COMPSIZE(pname)] + category EXT_vertex_attrib_64bit + dlflags notlistable + version 4.1 + extension + glxsingle ? + glxflags ignore + offset ? + +# Also in ARB_vertex_array_64bit. Supposedly dependent on another +# unregistered extension, EXT_direct_state_access_memory + +VertexArrayVertexAttribLOffsetEXT(vaobj, buffer, index, size, type, stride, offset) + return void + param vaobj UInt32 in value + param buffer UInt32 in value + param index UInt32 in value + param size Int32 in value + param type GLenum in value + param stride SizeI in value + param offset BufferOffset in value + category EXT_vertex_attrib_64bit + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +############################################################################### +# +# Extension #388 +# NV_gpu_program5 commands +# +############################################################################### + +# These commands require ARB_shader_subroutine +#@@ void ProgramSubroutineParametersuivNV(enum target, sizei count, const uint *params); +#@@ void GetProgramSubroutineParameteruivNV(enum target, uint index, uint *param); + +ProgramSubroutineParametersuivNV(target, count, params) + return void + param target GLenum in value + param count SizeI in value + param params UInt32 in array [count] + category NV_gpu_program5 + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +GetProgramSubroutineParameteruivNV(target, index, param) + return void + param target GLenum in value + param index UInt32 in value + param param UInt32 out array [COMPSIZE(target)] + category NV_gpu_program5 + dlflags notlistable + version 4.1 + extension + glxsingle ? + glxflags ignore + offset ? + +############################################################################### +# +# Extension #389 +# NV_gpu_shader5 commands +# +############################################################################### + +Uniform1i64NV(location, x) + return void + param location Int32 in value + param x Int64EXT in value + category NV_gpu_shader5 + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +Uniform2i64NV(location, x, y) + return void + param location Int32 in value + param x Int64EXT in value + param y Int64EXT in value + category NV_gpu_shader5 + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +Uniform3i64NV(location, x, y, z) + return void + param location Int32 in value + param x Int64EXT in value + param y Int64EXT in value + param z Int64EXT in value + category NV_gpu_shader5 + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +Uniform4i64NV(location, x, y, z, w) + return void + param location Int32 in value + param x Int64EXT in value + param y Int64EXT in value + param z Int64EXT in value + param w Int64EXT in value + category NV_gpu_shader5 + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +Uniform1i64vNV(location, count, value) + return void + param location Int32 in value + param count SizeI in value + param value Int64EXT in array [count] + category NV_gpu_shader5 + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +Uniform2i64vNV(location, count, value) + return void + param location Int32 in value + param count SizeI in value + param value Int64EXT in array [COMPSIZE(count*2)] + category NV_gpu_shader5 + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +Uniform3i64vNV(location, count, value) + return void + param location Int32 in value + param count SizeI in value + param value Int64EXT in array [COMPSIZE(count*3)] + category NV_gpu_shader5 + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +Uniform4i64vNV(location, count, value) + return void + param location Int32 in value + param count SizeI in value + param value Int64EXT in array [COMPSIZE(count*4)] + category NV_gpu_shader5 + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +Uniform1ui64NV(location, x) + return void + param location Int32 in value + param x UInt64EXT in value + category NV_gpu_shader5 + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +Uniform2ui64NV(location, x, y) + return void + param location Int32 in value + param x UInt64EXT in value + param y UInt64EXT in value + category NV_gpu_shader5 + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +Uniform3ui64NV(location, x, y, z) + return void + param location Int32 in value + param x UInt64EXT in value + param y UInt64EXT in value + param z UInt64EXT in value + category NV_gpu_shader5 + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +Uniform4ui64NV(location, x, y, z, w) + return void + param location Int32 in value + param x UInt64EXT in value + param y UInt64EXT in value + param z UInt64EXT in value + param w UInt64EXT in value + category NV_gpu_shader5 + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +Uniform1ui64vNV(location, count, value) + return void + param location Int32 in value + param count SizeI in value + param value UInt64EXT in array [count] + category NV_gpu_shader5 + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +Uniform2ui64vNV(location, count, value) + return void + param location Int32 in value + param count SizeI in value + param value UInt64EXT in array [COMPSIZE(count*2)] + category NV_gpu_shader5 + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +Uniform3ui64vNV(location, count, value) + return void + param location Int32 in value + param count SizeI in value + param value UInt64EXT in array [COMPSIZE(count*3)] + category NV_gpu_shader5 + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +Uniform4ui64vNV(location, count, value) + return void + param location Int32 in value + param count SizeI in value + param value UInt64EXT in array [COMPSIZE(count*4)] + category NV_gpu_shader5 + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +GetUniformi64vNV(program, location, params) + return void + param program UInt32 in value + param location Int32 in value + param params Int64EXT out array [COMPSIZE(location)] + category NV_gpu_shader5 + dlflags notlistable + version 4.1 + extension + glxsingle ? + glxflags ignore + offset ? + +ProgramUniform1i64NV(program, location, x) + return void + param program UInt32 in value + param location Int32 in value + param x Int64EXT in value + category NV_gpu_shader5 + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniform2i64NV(program, location, x, y) + return void + param program UInt32 in value + param location Int32 in value + param x Int64EXT in value + param y Int64EXT in value + category NV_gpu_shader5 + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniform3i64NV(program, location, x, y, z) + return void + param program UInt32 in value + param location Int32 in value + param x Int64EXT in value + param y Int64EXT in value + param z Int64EXT in value + category NV_gpu_shader5 + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniform4i64NV(program, location, x, y, z, w) + return void + param program UInt32 in value + param location Int32 in value + param x Int64EXT in value + param y Int64EXT in value + param z Int64EXT in value + param w Int64EXT in value + category NV_gpu_shader5 + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniform1i64vNV(program, location, count, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param value Int64EXT in array [count] + category NV_gpu_shader5 + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniform2i64vNV(program, location, count, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param value Int64EXT in array [COMPSIZE(count*2)] + category NV_gpu_shader5 + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniform3i64vNV(program, location, count, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param value Int64EXT in array [COMPSIZE(count*3)] + category NV_gpu_shader5 + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniform4i64vNV(program, location, count, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param value Int64EXT in array [COMPSIZE(count*4)] + category NV_gpu_shader5 + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniform1ui64NV(program, location, x) + return void + param program UInt32 in value + param location Int32 in value + param x UInt64EXT in value + category NV_gpu_shader5 + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniform2ui64NV(program, location, x, y) + return void + param program UInt32 in value + param location Int32 in value + param x UInt64EXT in value + param y UInt64EXT in value + category NV_gpu_shader5 + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniform3ui64NV(program, location, x, y, z) + return void + param program UInt32 in value + param location Int32 in value + param x UInt64EXT in value + param y UInt64EXT in value + param z UInt64EXT in value + category NV_gpu_shader5 + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniform4ui64NV(program, location, x, y, z, w) + return void + param program UInt32 in value + param location Int32 in value + param x UInt64EXT in value + param y UInt64EXT in value + param z UInt64EXT in value + param w UInt64EXT in value + category NV_gpu_shader5 + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniform1ui64vNV(program, location, count, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param value UInt64EXT in array [count] + category NV_gpu_shader5 + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniform2ui64vNV(program, location, count, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param value UInt64EXT in array [COMPSIZE(count*2)] + category NV_gpu_shader5 + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniform3ui64vNV(program, location, count, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param value UInt64EXT in array [COMPSIZE(count*3)] + category NV_gpu_shader5 + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +ProgramUniform4ui64vNV(program, location, count, value) + return void + param program UInt32 in value + param location Int32 in value + param count SizeI in value + param value UInt64EXT in array [COMPSIZE(count*4)] + category NV_gpu_shader5 + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +#@ GetUniformui64vNV also in NV_shader_buffer_load + +############################################################################### +# +# Extension #390 +# NV_shader_buffer_store commands +# +############################################################################### + +# (none) +newcategory: NV_shader_buffer_store + +############################################################################### +# +# Extension #391 +# NV_tessellation_program5 commands +# +############################################################################### + +# (none) +newcategory: NV_tessellation_program5 + +############################################################################### +# +# Extension #392 +# NV_vertex_attrib_integer_64bit commands +# +############################################################################### + +VertexAttribL1i64NV(index, x) + return void + param index UInt32 in value + param x Int64EXT in value + category NV_vertex_attrib_integer_64bit + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexAttribL2i64NV(index, x, y) + return void + param index UInt32 in value + param x Int64EXT in value + param y Int64EXT in value + category NV_vertex_attrib_integer_64bit + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexAttribL3i64NV(index, x, y, z) + return void + param index UInt32 in value + param x Int64EXT in value + param y Int64EXT in value + param z Int64EXT in value + category NV_vertex_attrib_integer_64bit + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexAttribL4i64NV(index, x, y, z, w) + return void + param index UInt32 in value + param x Int64EXT in value + param y Int64EXT in value + param z Int64EXT in value + param w Int64EXT in value + category NV_vertex_attrib_integer_64bit + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexAttribL1i64vNV(index, v) + return void + param index UInt32 in value + param v Int64EXT in array [1] + category NV_vertex_attrib_integer_64bit + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexAttribL2i64vNV(index, v) + return void + param index UInt32 in value + param v Int64EXT in array [2] + category NV_vertex_attrib_integer_64bit + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexAttribL3i64vNV(index, v) + return void + param index UInt32 in value + param v Int64EXT in array [3] + category NV_vertex_attrib_integer_64bit + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexAttribL4i64vNV(index, v) + return void + param index UInt32 in value + param v Int64EXT in array [4] + category NV_vertex_attrib_integer_64bit + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexAttribL1ui64NV(index, x) + return void + param index UInt32 in value + param x UInt64EXT in value + category NV_vertex_attrib_integer_64bit + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexAttribL2ui64NV(index, x, y) + return void + param index UInt32 in value + param x UInt64EXT in value + param y UInt64EXT in value + category NV_vertex_attrib_integer_64bit + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexAttribL3ui64NV(index, x, y, z) + return void + param index UInt32 in value + param x UInt64EXT in value + param y UInt64EXT in value + param z UInt64EXT in value + category NV_vertex_attrib_integer_64bit + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexAttribL4ui64NV(index, x, y, z, w) + return void + param index UInt32 in value + param x UInt64EXT in value + param y UInt64EXT in value + param z UInt64EXT in value + param w UInt64EXT in value + category NV_vertex_attrib_integer_64bit + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexAttribL1ui64vNV(index, v) + return void + param index UInt32 in value + param v UInt64EXT in array [1] + category NV_vertex_attrib_integer_64bit + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexAttribL2ui64vNV(index, v) + return void + param index UInt32 in value + param v UInt64EXT in array [2] + category NV_vertex_attrib_integer_64bit + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexAttribL3ui64vNV(index, v) + return void + param index UInt32 in value + param v UInt64EXT in array [3] + category NV_vertex_attrib_integer_64bit + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +VertexAttribL4ui64vNV(index, v) + return void + param index UInt32 in value + param v UInt64EXT in array [4] + category NV_vertex_attrib_integer_64bit + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +GetVertexAttribLi64vNV(index, pname, params) + return void + param index UInt32 in value + param pname GLenum in value + param params Int64EXT out array [COMPSIZE(pname)] + category NV_vertex_attrib_integer_64bit + dlflags notlistable + version 4.1 + extension + glxsingle ? + glxflags ignore + offset ? + +GetVertexAttribLui64vNV(index, pname, params) + return void + param index UInt32 in value + param pname GLenum in value + param params UInt64EXT out array [COMPSIZE(pname)] + category NV_vertex_attrib_integer_64bit + dlflags notlistable + version 4.1 + extension + glxsingle ? + glxflags ignore + offset ? + +#@ VertexAttribLFormatNV also requires NV_vertex_buffer_unified_memory + +VertexAttribLFormatNV(index, size, type, stride) + return void + param index UInt32 in value + param size Int32 in value + param type GLenum in value + param stride SizeI in value + category NV_vertex_attrib_integer_64bit + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +############################################################################### +# +# Extension #393 +# NV_multisample_coverage commands +# +############################################################################### + +# (none) +newcategory: NV_multisample_coverage + +############################################################################### +# +# Extension #394 +# AMD_name_gen_delete commands +# +############################################################################### + +GenNamesAMD(identifier, num, names) + return void + param identifier GLenum in value + param num UInt32 in value + param names UInt32 out array [num] + category AMD_name_gen_delete + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +DeleteNamesAMD(identifier, num, names) + return void + param identifier GLenum in value + param num UInt32 in value + param names UInt32 in array [num] + category AMD_name_gen_delete + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +IsNameAMD(identifier, name) + return Boolean + param identifier GLenum in value + param name UInt32 in value + category AMD_name_gen_delete + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +############################################################################### +# +# Extension #395 +# AMD_debug_output commands +# +############################################################################### + +DebugMessageEnableAMD(category, severity, count, ids, enabled) + return void + param category GLenum in value + param severity GLenum in value + param count SizeI in value + param ids UInt32 in array [count] + param enabled Boolean in value + category AMD_debug_output + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +DebugMessageInsertAMD(category, severity, id, length, buf) + return void + param category GLenum in value + param severity GLenum in value + param id UInt32 in value + param length SizeI in value + param buf Char in array [length] + category AMD_debug_output + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +DebugMessageCallbackAMD(callback, userParam) + return void + param callback GLDEBUGPROCAMD in value + param userParam Void out reference + category AMD_debug_output + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +GetDebugMessageLogAMD(count, bufsize, categories, severities, ids, lengths, message) + return UInt32 + param count UInt32 in value + param bufsize SizeI in value + param categories GLenum out array [count] + param severities UInt32 out array [count] + param ids UInt32 out array [count] + param lengths SizeI out array [count] + param message Char out array [bufsize] + category AMD_debug_output + dlflags notlistable + version 4.1 + extension + glxsingle ? + glxflags ignore + offset ? + +############################################################################### +# +# Extension #396 +# NV_vdpau_interop commands +# +############################################################################### + +VDPAUInitNV(vdpDevice, getProcAddress) + return void + param vdpDevice Void in reference + param getProcAddress Void in reference + category NV_vdpau_interop + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +VDPAUFiniNV() + return void + category NV_vdpau_interop + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +VDPAURegisterVideoSurfaceNV(vdpSurface, target, numTextureNames, textureNames) + return vdpauSurfaceNV + param vdpSurface Void out reference + param target GLenum in value + param numTextureNames SizeI in value + param textureNames UInt32 in array [numTextureNames] + category NV_vdpau_interop + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +VDPAURegisterOutputSurfaceNV(vdpSurface, target, numTextureNames, textureNames) + return vdpauSurfaceNV + param vdpSurface Void out reference + param target GLenum in value + param numTextureNames SizeI in value + param textureNames UInt32 in array [numTextureNames] + category NV_vdpau_interop + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +VDPAUIsSurfaceNV(surface) + return void + param surface vdpauSurfaceNV in value + category NV_vdpau_interop + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +VDPAUUnregisterSurfaceNV(surface) + return void + param surface vdpauSurfaceNV in value + category NV_vdpau_interop + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +VDPAUGetSurfaceivNV(surface, pname, bufSize, length, values) + return void + param surface vdpauSurfaceNV in value + param pname GLenum in value + param bufSize SizeI in value + param length SizeI out reference + param values Int32 out array [length] + category NV_vdpau_interop + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +VDPAUSurfaceAccessNV(surface, access) + return void + param surface vdpauSurfaceNV in value + param access GLenum in value + category NV_vdpau_interop + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +VDPAUMapSurfacesNV(numSurfaces, surfaces) + return void + param numSurfaces SizeI in value + param surfaces vdpauSurfaceNV in array [numSurfaces] + category NV_vdpau_interop + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + +VDPAUUnmapSurfacesNV(numSurface, surfaces) + return void + param numSurface SizeI in value + param surfaces vdpauSurfaceNV in array [numSurface] + category NV_vdpau_interop + version 4.1 + extension + glxropcode ? + glxflags ignore + offset ? + + +############################################################################### +# +# Extension #397 +# AMD_transform_feedback3_lines_triangles commands +# +############################################################################### + +# (none) +newcategory: AMD_transform_feedback3_lines_triangles + +############################################################################### +# +# Extension #398 - GLX_AMD_gpu_association +# Extension #399 - GLX_EXT_create_context_es2_profile +# Extension #400 - WGL_EXT_create_context_es2_profile +# +############################################################################### + +############################################################################### +# +# Extension #401 +# AMD_depth_clamp_separate commands +# +############################################################################### + +# (none) +newcategory: AMD_depth_clamp_separate + +############################################################################### +# +# Extension #402 +# EXT_texture_sRGB_decode commands +# +############################################################################### + +# (none) +newcategory: EXT_texture_sRGB_decode + diff --git a/xorg-server/hw/xwin/glx/gl.tm b/xorg-server/hw/xwin/glx/gl.tm new file mode 100644 index 000000000..f7b3856ac --- /dev/null +++ b/xorg-server/hw/xwin/glx/gl.tm @@ -0,0 +1,328 @@ +AccumOp,*,*, GLenum,*,* +AlphaFunction,*,*, GLenum,*,* +AttribMask,*,*, GLbitfield,*,* +BeginMode,*,*, GLenum,*,* +BinormalPointerTypeEXT,*,*, GLenum,*,* +BlendEquationMode,*,*, GLenum,*,* +BlendEquationModeEXT,*,*, GLenum,*,* +BlendFuncSeparateParameterEXT,*,*, GLenum,*,* +BlendingFactorDest,*,*, GLenum,*,* +BlendingFactorSrc,*,*, GLenum,*,* +Boolean,*,*, GLboolean,*,* +BooleanPointer,*,*, GLboolean*,*,* +Char,*,*, GLchar,*,* +CharPointer,*,*, GLchar*,*,* +CheckedFloat32,*,*, GLfloat,*,* +CheckedInt32,*,*, GLint,*,* +ClampColorTargetARB,*,*, GLenum,*,* +ClampColorModeARB,*,*, GLenum,*,* +ClampedColorF,*,*, GLclampf,*,* +ClampedFloat32,*,*, GLclampf,*,* +ClampedFloat64,*,*, GLclampd,*,* +ClampedStencilValue,*,*, GLint,*,* +ClearBufferMask,*,*, GLbitfield,*,* +ClientAttribMask,*,*, GLbitfield,*,* +ClipPlaneName,*,*, GLenum,*,* +ColorB,*,*, GLbyte,*,* +ColorD,*,*, GLdouble,*,* +ColorF,*,*, GLfloat,*,* +ColorI,*,*, GLint,*,* +ColorIndexValueD,*,*, GLdouble,*,* +ColorIndexValueF,*,*, GLfloat,*,* +ColorIndexValueI,*,*, GLint,*,* +ColorIndexValueS,*,*, GLshort,*,* +ColorIndexValueUB,*,*, GLubyte,*,* +ColorMaterialParameter,*,*, GLenum,*,* +ColorPointerType,*,*, GLenum,*,* +ColorS,*,*, GLshort,*,* +ColorTableParameterPName,*,*, GLenum,*,* +ColorTableParameterPNameSGI,*,*, GLenum,*,* +ColorTableTarget,*,*, GLenum,*,* +ColorTableTargetSGI,*,*, GLenum,*,* +ColorUB,*,*, GLubyte,*,* +ColorUI,*,*, GLuint,*,* +ColorUS,*,*, GLushort,*,* +CombinerBiasNV,*,*, GLenum,*,* +CombinerComponentUsageNV,*,*, GLenum,*,* +CombinerMappingNV,*,*, GLenum,*,* +CombinerParameterNV,*,*, GLenum,*,* +CombinerPortionNV,*,*, GLenum,*,* +CombinerRegisterNV,*,*, GLenum,*,* +CombinerScaleNV,*,*, GLenum,*,* +CombinerStageNV,*,*, GLenum,*,* +CombinerVariableNV,*,*, GLenum,*,* +CompressedTextureARB,*,*, GLvoid,*,* +ControlPointNV,*,*, GLvoid,*,* +ControlPointTypeNV,*,*, GLenum,*,* +ConvolutionParameter,*,*, GLenum,*,* +ConvolutionParameterEXT,*,*, GLenum,*,* +ConvolutionTarget,*,*, GLenum,*,* +ConvolutionTargetEXT,*,*, GLenum,*,* +CoordD,*,*, GLdouble,*,* +CoordF,*,*, GLfloat,*,* +CoordI,*,*, GLint,*,* +CoordS,*,*, GLshort,*,* +CullFaceMode,*,*, GLenum,*,* +CullParameterEXT,*,*, GLenum,*,* +DepthFunction,*,*, GLenum,*,* +DrawBufferMode,*,*, GLenum,*,* +DrawBufferName,*,*, GLint,*,* +DrawElementsType,*,*, GLenum,*,* +ElementPointerTypeATI,*,*, GLenum,*,* +EnableCap,*,*, GLenum,*,* +ErrorCode,*,*, GLenum,*,* +EvalMapsModeNV,*,*, GLenum,*,* +EvalTargetNV,*,*, GLenum,*,* +FeedbackElement,*,*, GLfloat,*,* +FeedbackType,*,*, GLenum,*,* +FenceNV,*,*, GLuint,*,* +FenceConditionNV,*,*, GLenum,*,* +FenceParameterNameNV,*,*, GLenum,*,* +FfdMaskSGIX,*,*, GLbitfield,*,* +FfdTargetSGIX,*,*, GLenum,*,* +Float32,*,*, GLfloat,*,* +Float32Pointer,*,*, GLfloat*,*,* +Float64,*,*, GLdouble,*,* +Float64Pointer,*,*, GLdouble*,*,* +FogParameter,*,*, GLenum,*,* +FogPointerTypeEXT,*,*, GLenum,*,* +FogPointerTypeIBM,*,*, GLenum,*,* +FragmentLightModelParameterSGIX,*,*,GLenum,*,* +FragmentLightNameSGIX,*,*, GLenum,*,* +FragmentLightParameterSGIX,*,*, GLenum,*,* +FramebufferAttachment,*,*, GLenum,*,* +FramebufferTarget,*,*, GLenum,*,* +FrontFaceDirection,*,*, GLenum,*,* +FunctionPointer,*,*, _GLfuncptr,*,* +GetColorTableParameterPName,*,*, GLenum,*,* +GetColorTableParameterPNameSGI,*,*, GLenum,*,* +GetConvolutionParameterPName,*,*, GLenum,*,* +GetHistogramParameterPName,*,*, GLenum,*,* +GetHistogramParameterPNameEXT,*,*, GLenum,*,* +GetMapQuery,*,*, GLenum,*,* +GetMinmaxParameterPName,*,*, GLenum,*,* +GetMinmaxParameterPNameEXT,*,*, GLenum,*,* +GetPName,*,*, GLenum,*,* +GetPointervPName,*,*, GLenum,*,* +GetTextureParameter,*,*, GLenum,*,* +HintMode,*,*, GLenum,*,* +HintTarget,*,*, GLenum,*,* +HintTargetPGI,*,*, GLenum,*,* +HistogramTarget,*,*, GLenum,*,* +HistogramTargetEXT,*,*, GLenum,*,* +IglooFunctionSelectSGIX,*,*, GLenum,*,* +IglooParameterSGIX,*,*, GLvoid,*,* +ImageTransformPNameHP,*,*, GLenum,*,* +ImageTransformTargetHP,*,*, GLenum,*,* +IndexFunctionEXT,*,*, GLenum,*,* +IndexMaterialParameterEXT,*,*, GLenum,*,* +IndexPointerType,*,*, GLenum,*,* +Int16,*,*, GLshort,*,* +Int32,*,*, GLint,*,* +Int8,*,*, GLbyte,*,* +InterleavedArrayFormat,*,*, GLenum,*,* +LightEnvParameterSGIX,*,*, GLenum,*,* +LightModelParameter,*,*, GLenum,*,* +LightName,*,*, GLenum,*,* +LightParameter,*,*, GLenum,*,* +LightTextureModeEXT,*,*, GLenum,*,* +LightTexturePNameEXT,*,*, GLenum,*,* +LineStipple,*,*, GLushort,*,* +List,*,*, GLuint,*,* +ListMode,*,*, GLenum,*,* +ListNameType,*,*, GLenum,*,* +ListParameterName,*,*, GLenum,*,* +LogicOp,*,*, GLenum,*,* +MapAttribParameterNV,*,*, GLenum,*,* +MapParameterNV,*,*, GLenum,*,* +MapTarget,*,*, GLenum,*,* +MapTargetNV,*,*, GLenum,*,* +MapTypeNV,*,*, GLenum,*,* +MaskedColorIndexValueF,*,*, GLfloat,*,* +MaskedColorIndexValueI,*,*, GLuint,*,* +MaskedStencilValue,*,*, GLuint,*,* +MaterialFace,*,*, GLenum,*,* +MaterialParameter,*,*, GLenum,*,* +MatrixIndexPointerTypeARB,*,*, GLenum,*,* +MatrixMode,*,*, GLenum,*,* +MatrixTransformNV,*,*, GLenum,*,* +MeshMode1,*,*, GLenum,*,* +MeshMode2,*,*, GLenum,*,* +MinmaxTarget,*,*, GLenum,*,* +MinmaxTargetEXT,*,*, GLenum,*,* +NormalPointerType,*,*, GLenum,*,* +NurbsCallback,*,*, GLenum,*,* +NurbsObj,*,*, GLUnurbs*,*,* +NurbsProperty,*,*, GLenum,*,* +NurbsTrim,*,*, GLenum,*,* +OcclusionQueryParameterNameNV,*,*, GLenum,*,* +PixelCopyType,*,*, GLenum,*,* +PixelFormat,*,*, GLenum,*,* +PixelInternalFormat,*,*, GLenum,*,* +PixelMap,*,*, GLenum,*,* +PixelStoreParameter,*,*, GLenum,*,* +PixelTexGenModeSGIX,*,*, GLenum,*,* +PixelTexGenParameterNameSGIS,*,*, GLenum,*,* +PixelTransferParameter,*,*, GLenum,*,* +PixelTransformPNameEXT,*,*, GLenum,*,* +PixelTransformTargetEXT,*,*, GLenum,*,* +PixelType,*,*, GLenum,*,* +PointParameterNameARB,*,*, GLenum,*,* +PolygonMode,*,*, GLenum,*,* +ProgramNV,*,*, GLuint,*,* +ProgramCharacterNV,*,*, GLubyte,*,* +ProgramParameterNV,*,*, GLenum,*,* +ProgramParameterPName,*,*, GLenum,*,* +QuadricCallback,*,*, GLenum,*,* +QuadricDrawStyle,*,*, GLenum,*,* +QuadricNormal,*,*, GLenum,*,* +QuadricObj,*,*, GLUquadric*,*,* +QuadricOrientation,*,*, GLenum,*,* +ReadBufferMode,*,*, GLenum,*,* +RenderbufferTarget,*,*, GLenum,*,* +RenderingMode,*,*, GLenum,*,* +ReplacementCodeSUN,*,*, GLuint,*,* +ReplacementCodeTypeSUN,*,*, GLenum,*,* +SamplePassARB,*,*, GLenum,*,* +SamplePatternEXT,*,*, GLenum,*,* +SamplePatternSGIS,*,*, GLenum,*,* +SecondaryColorPointerTypeIBM,*,*, GLenum,*,* +SelectName,*,*, GLuint,*,* +SeparableTarget,*,*, GLenum,*,* +SeparableTargetEXT,*,*, GLenum,*,* +ShadingModel,*,*, GLenum,*,* +SizeI,*,*, GLsizei,*,* +SpriteParameterNameSGIX,*,*, GLenum,*,* +StencilFunction,*,*, GLenum,*,* +StencilFaceDirection,*,*, GLenum,*,* +StencilOp,*,*, GLenum,*,* +StencilValue,*,*, GLint,*,* +String,*,*, const GLubyte *,*,* +StringName,*,*, GLenum,*,* +TangentPointerTypeEXT,*,*, GLenum,*,* +TessCallback,*,*, GLenum,*,* +TessContour,*,*, GLenum,*,* +TessProperty,*,*, GLenum,*,* +TesselatorObj,*,*, GLUtesselator*,*,* +TexCoordPointerType,*,*, GLenum,*,* +Texture,*,*, GLuint,*,* +TextureComponentCount,*,*, GLint,*,* +TextureCoordName,*,*, GLenum,*,* +TextureEnvParameter,*,*, GLenum,*,* +TextureEnvTarget,*,*, GLenum,*,* +TextureFilterSGIS,*,*, GLenum,*,* +TextureGenParameter,*,*, GLenum,*,* +TextureNormalModeEXT,*,*, GLenum,*,* +TextureParameterName,*,*, GLenum,*,* +TextureTarget,*,*, GLenum,*,* +TextureUnit,*,*, GLenum,*,* +UInt16,*,*, GLushort,*,* +UInt32,*,*, GLuint,*,* +UInt8,*,*, GLubyte,*,* +VertexAttribEnum,*,*, GLenum,*,* +VertexAttribEnumNV,*,*, GLenum,*,* +VertexAttribPointerTypeNV,*,*, GLenum,*,* +VertexPointerType,*,*, GLenum,*,* +VertexWeightPointerTypeEXT,*,*, GLenum,*,* +Void,*,*, GLvoid,*,* +VoidPointer,*,*, GLvoid*,*,* +ConstVoidPointer,*,*, GLvoid* const,*,* +WeightPointerTypeARB,*,*, GLenum,*,* +WinCoord,*,*, GLint,*,* +void,*,*, *,*,* +ArrayObjectPNameATI,*,*, GLenum,*,* +ArrayObjectUsageATI,*,*, GLenum,*,*, +ConstFloat32,*,*, GLfloat,*,* +ConstInt32,*,*, GLint,*,* +ConstUInt32,*,*, GLuint,*,* +ConstVoid,*,*, GLvoid,*,* +DataTypeEXT,*,*, GLenum,*,* +FragmentOpATI,*,*, GLenum,*,* +GetTexBumpParameterATI,*,*, GLenum,*,* +GetVariantValueEXT,*,*, GLenum,*,* +ParameterRangeEXT,*,*, GLenum,*,* +PreserveModeATI,*,*, GLenum,*,* +ProgramFormatARB,*,*, GLenum,*,* +ProgramTargetARB,*,*, GLenum,*,* +ProgramTarget,*,*, GLenum,*,* +ProgramPropertyARB,*,*, GLenum,*,* +ProgramStringPropertyARB,*,*, GLenum,*,* +ScalarType,*,*, GLenum,*,* +SwizzleOpATI,*,*, GLenum,*,* +TexBumpParameterATI,*,*, GLenum,*,* +VariantCapEXT,*,*, GLenum,*,* +VertexAttribPointerPropertyARB,*,*, GLenum,*,* +VertexAttribPointerTypeARB,*,*, GLenum,*,* +VertexAttribPropertyARB,*,*, GLenum,*,* +VertexShaderCoordOutEXT,*,*, GLenum,*,* +VertexShaderOpEXT,*,*, GLenum,*,* +VertexShaderParameterEXT,*,*, GLenum,*,* +VertexShaderStorageTypeEXT,*,*, GLenum,*,* +VertexShaderTextureUnitParameter,*,*, GLenum,*,* +VertexShaderWriteMaskEXT,*,*, GLenum,*,* +VertexStreamATI,*,*, GLenum,*,* +PNTrianglesPNameATI,*,*, GLenum,*,* +# ARB_vertex_buffer_object types and core equivalents for new types +BufferOffset,*,*, GLintptr,*,* +BufferSize,*,*, GLsizeiptr,*,* +BufferAccessARB,*,*, GLenum,*,* +BufferOffsetARB,*,*, GLintptrARB,*,* +BufferPNameARB,*,*, GLenum,*,* +BufferPointerNameARB,*,*, GLenum,*,* +BufferSizeARB,*,*, GLsizeiptrARB,*,* +BufferTargetARB,*,*, GLenum,*,* +BufferUsageARB,*,*, GLenum,*,* +# APPLE_fence +ObjectTypeAPPLE,*,*, GLenum,*,* +# APPLE_vertex_array_range +VertexArrayPNameAPPLE,*,*, GLenum,*,* +# ATI_draw_buffers +DrawBufferModeATI,*,*, GLenum,*,* +# NV_half +Half16NV,*,*, GLhalfNV,*,* +# NV_pixel_data_range +PixelDataRangeTargetNV,*,*, GLenum,*,* +# Generic types for as-yet-unspecified enums +TypeEnum,*,*, GLenum,*,* +GLbitfield,*,*, GLbitfield,*,* +GLenum,*,*, GLenum,*,* +Int64,*,*, GLint64,*,* +UInt64,*,*, GLuint64,*,* +# Object handle & data pointers +handleARB,*,*, GLhandleARB,*,* +charARB,*,*, GLcharARB,*,* +charPointerARB,*,*, GLcharARB*,*,* +sync,*,*, GLsync,*,*, +# EXT_timer_query +Int64EXT,*,*, GLint64EXT,*,* +UInt64EXT,*,*, GLuint64EXT,*,* +# EXT_direct_state_access +FramebufferAttachmentParameterName,*,*, GLenum,*,* +Framebuffer,*,*, GLuint,*,* +FramebufferStatus,*,*, GLenum,*,* +GetFramebufferParameter,*,*, GLenum,*,* +Intptr,*,*, GLintptr,*,* +ProgramFormat,*,*, GLenum,*,* +ProgramProperty,*,*, GLenum,*,* +ProgramStringProperty,*,*, GLenum,*,* +Renderbuffer,*,*, GLuint,*,* +RenderbufferParameterName,*,*, GLenum,*,* +Sizeiptr,*,*, GLsizeiptr,*,* +TextureInternalFormat,*,*, GLenum,*,* +VertexBufferObjectAccess,*,*, GLenum,*,* +VertexBufferObjectParameter,*,*, GLenum,*,* +VertexBufferObjectUsage,*,*, GLenum,*,* +# ARB_map_buffer_range +BufferAccessMask,*,*, GLbitfield,*,* +# NV_explicit_multisample +GetMultisamplePNameNV,*,*, GLenum,*,* +SampleMaskNV,*,*, GLbitfield,*,* +# ARB_debug_output +GLDEBUGPROCARB,*,*, GLDEBUGPROCARB,*,* +# AMD_debug_output +GLDEBUGPROCAMD,*,*, GLDEBUGPROCAMD,*,* +# NV_vdpau_interop +vdpauSurfaceNV,*,*, GLvdpauSurfaceNV,*,*, +# External API types +cl_context,*,*, struct _cl_context *,*,* +cl_event,*,*, struct _cl_event *,*,* diff --git a/xorg-server/hw/xwin/glx/glwindows.h b/xorg-server/hw/xwin/glx/glwindows.h index cc3f2e6ee..72278df30 100644 --- a/xorg-server/hw/xwin/glx/glwindows.h +++ b/xorg-server/hw/xwin/glx/glwindows.h @@ -49,9 +49,15 @@ const GLubyte* glGetStringWrapperNonstatic(GLenum name); void glAddSwapHintRectWINWrapperNonstatic(GLint x, GLint y, GLsizei width, GLsizei height); void glWinSetupDispatchTable(void); -#if 1 +#ifdef _DEBUG +#ifdef _MSC_VER +#define GLWIN_TRACE_MSG(msg, ...) if (glxWinDebugSettings.enableTrace) ErrorF(msg " [%s:%d]\n" , __VA_ARGS__ , __FUNCTION__, __LINE__ ) +#define GLWIN_DEBUG_MSG(msg, ...) if (glxWinDebugSettings.enableDebug) ErrorF(msg " [%s:%d]\n" , __VA_ARGS__ , __FUNCTION__, __LINE__ ) +#else #define GLWIN_TRACE_MSG(msg, args...) if (glxWinDebugSettings.enableTrace) ErrorF(msg " [%s:%d]\n" , ##args , __FUNCTION__, __LINE__ ) #define GLWIN_DEBUG_MSG(msg, args...) if (glxWinDebugSettings.enableDebug) ErrorF(msg " [%s:%d]\n" , ##args , __FUNCTION__, __LINE__ ) +#endif + #else #define GLWIN_TRACE_MSG(a, ...) #define GLWIN_DEBUG_MSG(a, ...) diff --git a/xorg-server/hw/xwin/glx/glwrap.c b/xorg-server/hw/xwin/glx/glwrap.c index 5190d36f7..fe59f71ef 100644 --- a/xorg-server/hw/xwin/glx/glwrap.c +++ b/xorg-server/hw/xwin/glx/glwrap.c @@ -44,7 +44,9 @@ #include <glx/glapi.h> #include <glx/dispatch.h> #include <glwindows.h> +#include <winmsg.h> +#ifdef _DEBUG static unsigned int glWinIndirectProcCalls = 0; static unsigned int glWinDirectProcCalls = 0; @@ -66,6 +68,7 @@ glWinCallDelta(void) glWinIndirectProcCallsLast = glWinIndirectProcCalls; } } +#endif static PROC glWinResolveHelper(PROC *cache, char *symbol) @@ -78,12 +81,12 @@ glWinResolveHelper(PROC *cache, char *symbol) proc = wglGetProcAddress(symbol); if (proc == NULL) { - ErrorF("glwrap: Can't resolve \"%s\"\n", symbol); + winDebug("glwrap: Can't resolve \"%s\"\n", symbol); (*cache) = (PROC)-1; } else { - ErrorF("glwrap: Resolved \"%s\"\n", symbol); + winDebug("glwrap: Resolved \"%s\"\n", symbol); (*cache) = proc; } } @@ -101,14 +104,20 @@ glWinResolveHelper(PROC *cache, char *symbol) return proc; } +#ifdef _DEBUG +#define INCPROCCALLS glWinIndirectProcCalls++; +#else +#define INCPROCCALLS +#endif + #define RESOLVE_RET(proctype, symbol, retval) \ static PROC cache = NULL; \ - __stdcall proctype proc = (proctype)glWinResolveHelper(&cache, symbol); \ + proctype proc = (proctype)glWinResolveHelper(&cache, symbol); \ if (proc == NULL) { \ __glXErrorCallBack(0); \ return retval; \ } \ - glWinIndirectProcCalls++; + INCPROCCALLS #define RESOLVE(proctype, symbol) RESOLVE_RET(proctype, symbol,) diff --git a/xorg-server/hw/xwin/glx/indirect.c b/xorg-server/hw/xwin/glx/indirect.c index 357029aa9..a2eabf5db 100644 --- a/xorg-server/hw/xwin/glx/indirect.c +++ b/xorg-server/hw/xwin/glx/indirect.c @@ -74,9 +74,16 @@ #include <glx/glxutil.h>
#include <glx/extension_string.h>
#include <GL/glxtokens.h>
+#include <glx/glapitable.h>
+#include <glx/glapi.h>
#include <winpriv.h>
#include <wgl_ext_api.h>
+#include "win.h"
+#include <winmsg.h>
+
+extern Bool g_fXdmcpEnabled;
+extern Bool g_fNativeGl;
#define NUM_ELEMENTS(x) (sizeof(x)/ sizeof(x[1]))
@@ -93,15 +100,18 @@ typedef struct __GLXWinConfig GLXWinConfig; struct __GLXWinContext {
__GLXcontext base;
HGLRC ctx; /* Windows GL Context */
+ HDC hDC; /* Windows device context */
+ HDC hreadDC; /* Windows device read context */
__GLXWinContext *shareContext; /* Context with which we will share display lists and textures */
HWND hwnd; /* For detecting when HWND has changed */
+ HWND hreadwnd;
+ struct _glapi_table *Dispatch;
};
struct __GLXWinDrawable
{
__GLXdrawable base;
__GLXWinContext *drawContext;
- __GLXWinContext *readContext;
/* If this drawable is GLX_DRAWABLE_PBUFFER */
HPBUFFERARB hPbuffer;
@@ -128,7 +138,9 @@ struct __GLXWinScreen /* wrapped screen functions */
RealizeWindowProcPtr RealizeWindow;
UnrealizeWindowProcPtr UnrealizeWindow;
+ DestroyWindowProcPtr DestroyWindow;
CopyWindowProcPtr CopyWindow;
+ PositionWindowProcPtr PositionWindow;
};
struct __GLXWinConfig
@@ -142,12 +154,34 @@ struct __GLXWinConfig * Various debug helpers
*/
-#define GLWIN_DEBUG_HWND(hwnd) \
- if (glxWinDebugSettings.dumpHWND) { \
- char buffer[1024]; \
- if (GetWindowText(hwnd, buffer, sizeof(buffer))==0) *buffer=0; \
- GLWIN_DEBUG_MSG("Got HWND %p for window '%s'", hwnd, buffer); \
- }
+#ifdef _DEBUG
+void GLWIN_DEBUG_HWND(HWND hwnd)
+{
+ if (glxWinDebugSettings.dumpHWND)
+ {
+ char buffer[1024];
+ RECT Rect;
+ HDC hDc=GetDC(hwnd);
+
+ if (GetWindowText(hwnd, buffer, sizeof(buffer))==0) *buffer=0;
+ GetWindowRect(hwnd,&Rect);
+
+ GLWIN_DEBUG_MSG("Got HWND %p (hdc %p) for window '%s' (%d,%d,%d,%d)", hwnd, hDc, buffer, Rect.left, Rect.top, Rect.right, Rect.bottom);
+ ReleaseDC(hwnd,hDc);
+ }
+}
+
+void GLWIN_HDC_DEBUG_MSG(const char *Message, HDC hDc, HWND hwnd)
+{
+ char buffer[1024];
+ RECT Rect;
+
+ if (GetWindowText(hwnd, buffer, sizeof(buffer))==0) *buffer=0;
+ GetWindowRect(hwnd,&Rect);
+
+ GLWIN_DEBUG_MSG("Got HDC %p (hwnd %p) for window '%s' (%d,%d,%d,%d)", hDc, hwnd, buffer, Rect.left, Rect.top, Rect.right, Rect.bottom);
+
+}
glxWinDebugSettingsRec glxWinDebugSettings = { 0, 0, 0, 0, 0, 0};
@@ -195,18 +229,24 @@ static void glxWinInitDebugSettings(void) glxWinDebugSettings.enableWGLcallTrace = 1;
}
}
+#endif
static
const char *glxWinErrorMessage(void)
{
static char errorbuffer[1024];
+ DWORD Error=GetLastError();
+ int offset;
+
+ sprintf(errorbuffer, "%p ",Error);
+ offset=strlen(errorbuffer);
if (!FormatMessage(
FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
- GetLastError(),
+ Error,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
- (LPTSTR) &errorbuffer,
+ (LPTSTR) &errorbuffer[offset],
sizeof(errorbuffer),
NULL ))
{
@@ -221,6 +261,8 @@ const char *glxWinErrorMessage(void) static void pfdOut(const PIXELFORMATDESCRIPTOR *pfd);
+#ifdef _DEBUG
+
#define DUMP_PFD_FLAG(flag) \
if (pfd->dwFlags & flag) { \
ErrorF("%s%s", pipesym, #flag); \
@@ -247,6 +289,9 @@ static void pfdOut(const PIXELFORMATDESCRIPTOR *pfd) DUMP_PFD_FLAG(PFD_SWAP_COPY);
DUMP_PFD_FLAG(PFD_SWAP_LAYER_BUFFERS);
DUMP_PFD_FLAG(PFD_GENERIC_ACCELERATED);
+ DUMP_PFD_FLAG(PFD_SUPPORT_DIRECTDRAW);
+ DUMP_PFD_FLAG(PFD_DIRECT3D_ACCELERATED);
+ DUMP_PFD_FLAG(PFD_SUPPORT_COMPOSITION);
DUMP_PFD_FLAG(PFD_DEPTH_DONTCARE);
DUMP_PFD_FLAG(PFD_DOUBLEBUFFER_DONTCARE);
DUMP_PFD_FLAG(PFD_STEREO_DONTCARE);
@@ -328,7 +373,7 @@ fbConfigsDump(unsigned int n, __GLXconfig *c) {
unsigned int i = ((GLXWinConfig *)c)->pixelFormatIndex;
- ErrorF("%3d %2x %2x "
+ ErrorF("%3d %3x %3x "
"%-11s"
" %3d %3d %s %s %s %s %s "
"%2d %2d %2d %2d "
@@ -365,6 +410,7 @@ fbConfigsDump(unsigned int n, __GLXconfig *c) c = c->next;
}
}
+#endif
/* ---------------------------------------------------------------------- */
/*
@@ -385,9 +431,11 @@ static __GLXdrawable *glxWinCreateDrawable(ClientPtr client, static Bool glxWinRealizeWindow(WindowPtr pWin);
static Bool glxWinUnrealizeWindow(WindowPtr pWin);
+static Bool glxWinDestroyWindow(WindowPtr pWin);
static void glxWinCopyWindow(WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc);
+static Bool glxWinPositionWindow(WindowPtr pWindow, int x, int y);
-static HDC glxWinMakeDC(__GLXWinContext *gc, __GLXWinDrawable *draw, HDC *hdc, HWND *hwnd);
+static HDC glxWinMakeDC(__GLXWinContext *gc, __GLXWinDrawable *draw, HWND *hwnd);
static void glxWinReleaseDC(HWND hwnd, HDC hdc, __GLXWinDrawable *draw);
static void glxWinCreateConfigs(HDC dc, glxWinScreen *screen);
@@ -409,7 +457,8 @@ __GLXprovider __glXWGLProvider = { void
glxWinPushNativeProvider(void)
{
- GlxPushProvider(&__glXWGLProvider);
+ if (g_fNativeGl)
+ GlxPushProvider(&__glXWGLProvider);
}
/* ---------------------------------------------------------------------- */
@@ -436,6 +485,16 @@ glxWinScreenSwapInterval(__GLXdrawable *drawable, int interval) return ret;
}
+static LRESULT CALLBACK GlxWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
+{
+ if (uMsg== WM_NCHITTEST)
+ {
+ return HTTRANSPARENT;
+ }
+ else
+ return DefWindowProc(hwnd, uMsg, wParam, lParam);
+}
+
/*
Report the extensions split and formatted to avoid overflowing a line
*/
@@ -453,7 +512,7 @@ glxLogExtensions(const char *prefix, const char *extensions) }
strl = strtok(str, " ");
- ErrorF("%s%s", prefix, strl);
+ winDebug("%s%s", prefix, strl);
length = strlen(prefix) + strlen(strl);
while (1)
@@ -463,21 +522,21 @@ glxLogExtensions(const char *prefix, const char *extensions) if (length + strlen(strl) + 1 > 120)
{
- ErrorF("\n");
- ErrorF("%s",prefix);
+ winDebug("\n");
+ winDebug("%s",prefix);
length = strlen(prefix);
}
else
{
- ErrorF(" ");
+ winDebug(" ");
length++;
}
- ErrorF("%s", strl);
+ winDebug("%s", strl);
length = length + strlen(strl);
}
- ErrorF("\n");
+ winDebug("\n");
free(str);
}
@@ -495,7 +554,9 @@ glxWinScreenProbe(ScreenPtr pScreen) GLWIN_DEBUG_MSG("glxWinScreenProbe");
+#ifdef _DEBUG
glxWinInitDebugSettings();
+#endif
if (pScreen == NULL)
return NULL;
@@ -518,27 +579,31 @@ glxWinScreenProbe(ScreenPtr pScreen) pScreen->UnrealizeWindow = glxWinUnrealizeWindow;
screen->CopyWindow = pScreen->CopyWindow;
pScreen->CopyWindow = glxWinCopyWindow;
+ screen->PositionWindow = pScreen->PositionWindow;
+ pScreen->PositionWindow = glxWinPositionWindow;
+ screen->DestroyWindow = pScreen->DestroyWindow;
+ pScreen->DestroyWindow = glxWinDestroyWindow;
/* Dump out some useful information about the native renderer */
// create window class
-#define WIN_GL_TEST_WINDOW_CLASS "XWinGLTest"
{
static wATOM glTestWndClass = 0;
if (glTestWndClass == 0)
{
WNDCLASSEX wc;
+ glTestWndClass=1;
wc.cbSize = sizeof(WNDCLASSEX);
- wc.style = CS_HREDRAW | CS_VREDRAW;
- wc.lpfnWndProc = DefWindowProc;
+ wc.style = CS_OWNDC ;
+ wc.lpfnWndProc = GlxWindowProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
- wc.hInstance = GetModuleHandle(NULL);
+ wc.hInstance = g_hInstance;
wc.hIcon = 0;
wc.hCursor = 0;
- wc.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
+ wc.hbrBackground = 0;
wc.lpszMenuName = NULL;
- wc.lpszClassName = WIN_GL_TEST_WINDOW_CLASS;
+ wc.lpszClassName = WIN_GL_WINDOW_CLASS;
wc.hIconSm = 0;
RegisterClassEx (&wc);
}
@@ -546,7 +611,7 @@ glxWinScreenProbe(ScreenPtr pScreen) // create an invisible window for a scratch DC
hwnd = CreateWindowExA(0,
- WIN_GL_TEST_WINDOW_CLASS,
+ WIN_GL_WINDOW_CLASS,
"XWin GL Renderer Capabilities Test Window",
0, 0, 0, 0, 0, NULL, NULL, GetModuleHandle(NULL), NULL);
if (hwnd == NULL)
@@ -557,15 +622,19 @@ glxWinScreenProbe(ScreenPtr pScreen) // we must set a pixel format before we can create a context, just use the first one...
SetPixelFormat(hdc, 1, NULL);
hglrc = wglCreateContext(hdc);
- wglMakeCurrent(hdc, hglrc);
+ if (!wglMakeCurrent(hdc, hglrc))
+ {
+ DWORD ErrorCode=GetLastError();
+ ErrorF("wglMakeCurrent error: %x dc %p ctx %p\n", ErrorCode,hdc,hglrc);
+ }
// initialize wgl extension proc pointers (don't call them before here...)
// (but we need to have a current context for them to be resolvable)
wglResolveExtensionProcs();
- ErrorF("GL_VERSION: %s\n", glGetStringWrapperNonstatic(GL_VERSION));
- ErrorF("GL_VENDOR: %s\n", glGetStringWrapperNonstatic(GL_VENDOR));
- ErrorF("GL_RENDERER: %s\n", glGetStringWrapperNonstatic(GL_RENDERER));
+ winDebug("GL_VERSION: %s\n", glGetStringWrapperNonstatic(GL_VERSION));
+ winDebug("GL_VENDOR: %s\n", glGetStringWrapperNonstatic(GL_VENDOR));
+ winDebug("GL_RENDERER: %s\n", glGetStringWrapperNonstatic(GL_RENDERER));
gl_extensions = (const char *)glGetStringWrapperNonstatic(GL_EXTENSIONS);
glxLogExtensions("GL_EXTENSIONS: ", gl_extensions);
wgl_extensions = wglGetExtensionsStringARBWrapper(hdc);
@@ -651,17 +720,37 @@ glxWinScreenProbe(ScreenPtr pScreen) screen->base.swapInterval = glxWinScreenSwapInterval;
screen->base.pScreen = pScreen;
+ // Creating the fbConfigs initializes screen->base.fbconfigs and screen->base.numFBConfigs
if (strstr(wgl_extensions, "WGL_ARB_pixel_format"))
{
glxWinCreateConfigsExt(hdc, screen);
- screen->has_WGL_ARB_pixel_format = TRUE;
+
+ /*
+ Some graphics drivers appear to advertise WGL_ARB_pixel_format,
+ but it doesn't work usefully, so we have to be prepared for it
+ to fail and fall back to using DescribePixelFormat()
+ */
+ if (screen->base.numFBConfigs > 0)
+ {
+ screen->has_WGL_ARB_pixel_format = TRUE;
+ }
}
- else
+
+ if (screen->base.numFBConfigs <= 0)
{
glxWinCreateConfigs(hdc, screen);
screen->has_WGL_ARB_pixel_format = FALSE;
}
- // Initializes screen->base.fbconfigs and screen->base.numFBConfigs
+
+ /*
+ If we still didn't get any fbConfigs, we can't provide GLX for this screen
+ */
+ if (screen->base.numFBConfigs <= 0)
+ {
+ free(screen);
+ LogMessage(X_ERROR,"AIGLX: No fbConfigs could be made from native OpenGL pixel formats\n");
+ return NULL;
+ }
/* These will be set by __glXScreenInit */
screen->base.visuals = NULL;
@@ -669,8 +758,10 @@ glxWinScreenProbe(ScreenPtr pScreen) __glXScreenInit(&screen->base, pScreen);
+#ifdef _DEBUG
// dump out fbConfigs now fbConfigIds and visualIDs have been assigned
fbConfigsDump(screen->base.numFBConfigs, screen->base.fbconfigs);
+#endif
// Override the GL extensions string set by __glXScreenInit()
screen->base.GLextensions = strdup(gl_extensions);
@@ -689,30 +780,26 @@ glxWinScreenProbe(ScreenPtr pScreen) //
// Override the GLX version (__glXScreenInit() sets it to "1.2")
- // if we have all the needed extensionsto operate as a higher version
+ // if we have all the needed extensions to operate as a higher version
//
// SGIX_fbconfig && SGIX_pbuffer && SGI_make_current_read -> 1.3
// ARB_multisample -> 1.4
//
if (screen->has_WGL_ARB_pbuffer && glx_sgi_make_current_read)
{
- free(screen->base.GLXversion);
-
if (screen->has_WGL_ARB_multisample)
{
- screen->base.GLXversion = strdup("1.4");
screen->base.GLXmajor = 1;
screen->base.GLXminor = 4;
}
else
{
- screen->base.GLXversion = strdup("1.3");
screen->base.GLXmajor = 1;
screen->base.GLXminor = 3;
}
- LogMessage(X_INFO, "AIGLX: Set GLX version to %s\n", screen->base.GLXversion);
}
}
+ LogMessage(X_INFO, "AIGLX: Set GLX version to %d.%d\n", screen->base.GLXmajor, screen->base.GLXminor);
wglMakeCurrent(NULL, NULL);
wglDeleteContext(hglrc);
@@ -733,6 +820,7 @@ glxWinRealizeWindow(WindowPtr pWin) Bool result;
ScreenPtr pScreen = pWin->drawable.pScreen;
glxWinScreen *screenPriv = (glxWinScreen *) glxGetScreen(pScreen);
+ winWindowPriv(pWin);
GLWIN_DEBUG_MSG("glxWinRealizeWindow");
@@ -740,7 +828,12 @@ glxWinRealizeWindow(WindowPtr pWin) pScreen->RealizeWindow = screenPriv->RealizeWindow;
result = pScreen->RealizeWindow(pWin);
pScreen->RealizeWindow = glxWinRealizeWindow;
-
+
+ // Check if ze need to move the window\n
+ if (pWinPriv->GlCtxWnd && pWinPriv->hWnd)
+ {
+ ShowWindow(pWinPriv->hWnd,SW_SHOWNOACTIVATE);
+ }
return result;
}
@@ -776,20 +869,92 @@ glxWinCopyWindow(WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc) pScreen->CopyWindow = screenPriv->CopyWindow;
pScreen->CopyWindow(pWindow, ptOldOrg, prgnSrc);
pScreen->CopyWindow = glxWinCopyWindow;
+
+}
+
+static Bool
+glxWinPositionWindow(WindowPtr pWin, int x, int y)
+{
+ Bool result;
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ glxWinScreen *screenPriv = (glxWinScreen *) glxGetScreen(pScreen);
+ winWindowPriv(pWin);
+
+ pScreen->PositionWindow = screenPriv->PositionWindow;
+ result = pScreen->PositionWindow(pWin, x, y);
+ pScreen->PositionWindow = glxWinPositionWindow;
+
+ if (pWinPriv->GlCtxWnd && pWinPriv->hWnd)
+ {
+ MoveWindow(pWinPriv->hWnd,
+ pWin->drawable.x,
+ pWin->drawable.y,
+ pWin->drawable.width,
+ pWin->drawable.height,
+ FALSE);
+ winDebug("Move window %x, %x, %d, %d, %d, %d\n",pWinPriv->hWnd,GetParent(pWinPriv->hWnd), pWin->drawable.x, pWin->drawable.y, pWin->drawable.width, pWin->drawable.height);
+ }
+ return result;
}
+
static Bool
glxWinUnrealizeWindow(WindowPtr pWin)
{
Bool result;
ScreenPtr pScreen = pWin->drawable.pScreen;
glxWinScreen *screenPriv = (glxWinScreen *)glxGetScreen(pScreen);
+ winWindowPriv(pWin);
GLWIN_DEBUG_MSG("glxWinUnrealizeWindow");
- pScreen->UnrealizeWindow = screenPriv->UnrealizeWindow;
- result = pScreen->UnrealizeWindow(pWin);
- pScreen->UnrealizeWindow = glxWinUnrealizeWindow;
+ if (pWinPriv->GlCtxWnd && pWinPriv->hWnd)
+ {
+ ShowWindow(pWinPriv->hWnd,SW_HIDE);
+ result = TRUE;
+ }
+ else
+ {
+ pScreen->UnrealizeWindow = screenPriv->UnrealizeWindow;
+ result = pScreen->UnrealizeWindow(pWin);
+ pScreen->UnrealizeWindow = glxWinUnrealizeWindow;
+ }
+
+
+ return result;
+}
+
+static Bool
+glxWinDestroyWindow(WindowPtr pWin)
+{
+ Bool result;
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ glxWinScreen *screenPriv = (glxWinScreen *)glxGetScreen(pScreen);
+ __GLXWinDrawable *pGlxDraw;
+ winWindowPriv(pWin);
+
+ GLWIN_DEBUG_MSG("glxWinDestroyWindow");
+
+ dixLookupResourceByType((pointer) &pGlxDraw, pWin->drawable.id, __glXDrawableRes, NullClient, DixUnknownAccess);
+
+ if (pGlxDraw && pGlxDraw->drawContext)
+ {
+ if (pGlxDraw->drawContext->hwnd!=pWinPriv->hWnd)
+ ErrorF("Wrong assumption\n");
+ glxWinReleaseDC(pGlxDraw->drawContext->hwnd, pGlxDraw->drawContext->hDC, pGlxDraw);
+ pGlxDraw->drawContext->hDC=NULL;
+ pGlxDraw->drawContext->hwnd=NULL;
+ }
+ if (pWinPriv->GlCtxWnd && pWinPriv->hWnd)
+ {
+ DestroyWindow(pWinPriv->hWnd);
+ pWinPriv->hWnd=NULL;
+ pWinPriv->GlCtxWnd=0;
+ }
+
+ pScreen->DestroyWindow = screenPriv->DestroyWindow;
+ result = pScreen->DestroyWindow(pWin);
+ pScreen->DestroyWindow = glxWinDestroyWindow;
return result;
}
@@ -802,8 +967,6 @@ glxWinUnrealizeWindow(WindowPtr pWin) static GLboolean
glxWinDrawableSwapBuffers(ClientPtr client, __GLXdrawable *base)
{
- HDC dc;
- HWND hwnd;
BOOL ret;
__GLXWinDrawable *draw = (__GLXWinDrawable *)base;
@@ -822,13 +985,7 @@ glxWinDrawableSwapBuffers(ClientPtr client, __GLXdrawable *base) */
assert((draw->drawContext->base.drawPriv == NULL) || (draw->drawContext->base.drawPriv == base));
- dc = glxWinMakeDC(draw->drawContext, draw, &dc, &hwnd);
- if (dc == NULL)
- return GL_FALSE;
-
- ret = wglSwapLayerBuffers(dc, WGL_SWAP_MAIN_PLANE);
-
- glxWinReleaseDC(hwnd, dc, draw);
+ ret = SwapBuffers(draw->drawContext->hDC);
if (!ret)
{
@@ -888,6 +1045,7 @@ glxWinDrawableDestroy(__GLXdrawable *base) }
((PixmapPtr)glxPriv->base.pDraw)->devPrivate.ptr = glxPriv->pOldBits;
+ glxPriv->base.pDraw->pScreen->DestroyPixmap((PixmapPtr)glxPriv->base.pDraw); /* Decrement reference count since we do not use it any more */
}
GLWIN_DEBUG_MSG("glxWinDestroyDrawable");
@@ -896,22 +1054,20 @@ glxWinDrawableDestroy(__GLXdrawable *base) static __GLXdrawable *
glxWinCreateDrawable(ClientPtr client,
- __GLXscreen *screen,
- DrawablePtr pDraw,
- XID drawId,
- int type,
- XID glxDrawId,
- __GLXconfig *conf)
+ __GLXscreen *screen,
+ DrawablePtr pDraw,
+ XID drawId,
+ int type,
+ XID glxDrawId,
+ __GLXconfig *conf)
{
__GLXWinDrawable *glxPriv;
- glxPriv = malloc(sizeof *glxPriv);
+ glxPriv = calloc(1,sizeof(*glxPriv));
if (glxPriv == NULL)
return NULL;
- memset(glxPriv, 0, sizeof *glxPriv);
-
if(!__glXDrawableInit(&glxPriv->base, screen, pDraw, type, glxDrawId, conf)) {
free(glxPriv);
return NULL;
@@ -979,25 +1135,24 @@ glxWinSetPixelFormat(__GLXWinContext *gc, HDC hdc, int bppOverride, int drawable __GLXconfig *config = gc->base.config;
GLXWinConfig *winConfig = (GLXWinConfig *)config;
+
+ WindowPtr pWin;
+ __GLXWinDrawable *drawPriv = (__GLXWinDrawable *)gc->base.drawPriv;
+ pWin = (WindowPtr) drawPriv->base.pDraw;
+ {
+ winWindowPriv(pWin);
+ if (pWinPriv->OpenGlWindow)
+ {
+ ErrorF("Not Setting pixel format to %d on hdc %x for window %x (not allowed on windows)\n",winConfig->pixelFormatIndex,hdc,pWinPriv->hWnd);
+ return; /* Pixel format is already set on this window so it cannot be changed anymore */
+ }
+ }
GLWIN_DEBUG_MSG("glxWinSetPixelFormat: pixelFormatIndex %d", winConfig->pixelFormatIndex);
/*
Normally, we can just use the the pixelFormatIndex corresponding
to the fbconfig which has been specified by the client
*/
-
- if (!((bppOverride && (bppOverride != (config->redBits + config->greenBits + config->blueBits) ))
- || ((config->drawableType & drawableTypeOverride) == 0)))
- {
- if (!SetPixelFormat(hdc, winConfig->pixelFormatIndex, NULL))
- {
- ErrorF("SetPixelFormat error: %s\n", glxWinErrorMessage());
- return;
- }
-
- return;
- }
-
/*
However, in certain special cases this pixel format will be incompatible with the
use we are going to put it to, so we need to re-evaluate the pixel format to use:
@@ -1030,8 +1185,10 @@ glxWinSetPixelFormat(__GLXWinContext *gc, HDC hdc, int bppOverride, int drawable return;
}
- if (glxWinDebugSettings.dumpPFD)
+#ifdef _DEBUG
+ if (glxWinDebugSettings.dumpPFD)
pfdOut(&pfd);
+#endif
if (bppOverride)
{
@@ -1049,6 +1206,7 @@ glxWinSetPixelFormat(__GLXWinContext *gc, HDC hdc, int bppOverride, int drawable GLWIN_DEBUG_MSG("ChoosePixelFormat: chose pixelFormatIndex %d", pixelFormat);
ErrorF("ChoosePixelFormat: chose pixelFormatIndex %d (rather than %d as originally planned)\n", pixelFormat, winConfig->pixelFormatIndex);
+ ErrorF("Setting pixel format 2 to %d on hdc %x\n",pixelFormat,hdc);
if (!SetPixelFormat(hdc, pixelFormat, &pfd))
{
ErrorF("SetPixelFormat error: %s\n", glxWinErrorMessage());
@@ -1058,27 +1216,62 @@ glxWinSetPixelFormat(__GLXWinContext *gc, HDC hdc, int bppOverride, int drawable else
{
int pixelFormat = fbConfigToPixelFormatIndex(hdc, gc->base.config, drawableTypeOverride, winScreen);
- if (pixelFormat == 0)
+ if (pixelFormat != 0)
{
- ErrorF("wglChoosePixelFormat error: %s\n", glxWinErrorMessage());
- return;
- }
+ GLWIN_DEBUG_MSG("wglChoosePixelFormat: chose pixelFormatIndex %d", pixelFormat);
- GLWIN_DEBUG_MSG("wglChoosePixelFormat: chose pixelFormatIndex %d", pixelFormat);
- ErrorF("wglChoosePixelFormat: chose pixelFormatIndex %d (rather than %d as originally planned)\n", pixelFormat, winConfig->pixelFormatIndex);
-
- if (!SetPixelFormat(hdc, pixelFormat, NULL))
- {
- ErrorF("SetPixelFormat error: %s\n", glxWinErrorMessage());
+ ErrorF("Setting pixel format 3 to %d on hdc %x\n",pixelFormat,hdc);
+ if (!SetPixelFormat(hdc, pixelFormat, NULL))
+ {
+ ErrorF("SetPixelFormat error: %s\n", glxWinErrorMessage());
+ return;
+ }
return;
}
+ else
+ {
+ /* There was an error choose some default for the moment */
+ PIXELFORMATDESCRIPTOR pfd = {
+ sizeof(PIXELFORMATDESCRIPTOR), // size of this pfd
+ 1, // version number
+ PFD_DRAW_TO_WINDOW | // support window
+ PFD_SUPPORT_OPENGL | // support OpenGL
+ PFD_DOUBLEBUFFER, // double buffered
+ PFD_TYPE_RGBA, // RGBA type
+ 24, // 24-bit color depth
+ 0, 0, 0, 0, 0, 0, // color bits ignored
+ 0, // no alpha buffer
+ 0, // shift bit ignored
+ 0, // no accumulation buffer
+ 0, 0, 0, 0, // accum bits ignored
+ 32, // 32-bit z-buffer
+ 0, // no stencil buffer
+ 0, // no auxiliary buffer
+ PFD_MAIN_PLANE, // main layer
+ 0, // reserved
+ 0, 0, 0 // layer masks ignored
+ };
+ int iPixelFormat;
+
+ // get the best available match of pixel format for the device context
+ iPixelFormat = ChoosePixelFormat(hdc, &pfd);
+
+ ErrorF("Setting pixel format 4 to %d on hdc %x\n",iPixelFormat,hdc);
+ // make that the pixel format of the device context
+ if (!SetPixelFormat(hdc, iPixelFormat, &pfd))
+ {
+ ErrorF("SetPixelFormat error: %s\n", glxWinErrorMessage());
+ return;
+ }
+ }
}
+
}
static HDC
-glxWinMakeDC(__GLXWinContext *gc, __GLXWinDrawable *draw, HDC *hdc, HWND *hwnd)
+glxWinMakeDC(__GLXWinContext *gc, __GLXWinDrawable *draw, HWND *hwnd)
{
- *hdc = NULL;
+ HDC hdc = NULL;
*hwnd = NULL;
if (draw == NULL)
@@ -1108,38 +1301,51 @@ glxWinMakeDC(__GLXWinContext *gc, __GLXWinDrawable *draw, HDC *hdc, HWND *hwnd) return NULL;
}
- *hdc = GetDC(*hwnd);
+ if (!gc->hDC)
+ {
+ winWindowPriv(pWin);
- if (*hdc == NULL)
- ErrorF("GetDC error: %s\n", glxWinErrorMessage());
+ hdc = GetDC(*hwnd);
- /* Check if the hwnd has changed... */
- if (*hwnd != gc->hwnd)
- {
- if (glxWinDebugSettings.enableTrace)
+ if (hdc == NULL)
+ ErrorF("GetDC error: %s: hwnd %x, gc %p, gc->ctx %p ,gc->hwnd %p\n", glxWinErrorMessage(), *hwnd, gc, gc->ctx, gc->hwnd);
+
+ glxWinSetPixelFormat(gc, hdc, 0, GLX_WINDOW_BIT);
+ pWinPriv->OpenGlWindow=TRUE; /* Identify it as an opengl window, also used to check if the pixel format is already set */
+ gc->ctx = wglCreateContext(hdc);
+ }
+
+#ifdef _DEBUG
+ if (glxWinDebugSettings.enableTrace)
GLWIN_DEBUG_HWND(*hwnd);
GLWIN_TRACE_MSG("for context %p (native ctx %p), hWnd changed from %p to %p", gc, gc->ctx, gc->hwnd, *hwnd);
- gc->hwnd = *hwnd;
+#endif
+ if (gc->hwnd!=*hwnd)
+ ErrorF("Window changed handle from %x to %x\n", gc->hwnd, *hwnd);
- /* We must select a pixelformat, but SetPixelFormat can only be called once for a window... */
- glxWinSetPixelFormat(gc, *hdc, 0, GLX_WINDOW_BIT);
- }
+ gc->hwnd = *hwnd;
}
break;
case GLX_DRAWABLE_PBUFFER:
{
- *hdc = wglGetPbufferDCARBWrapper(draw->hPbuffer);
+ hdc = wglGetPbufferDCARBWrapper(draw->hPbuffer);
- if (*hdc == NULL)
+ if (hdc == NULL)
ErrorF("GetDC (pbuffer) error: %s\n", glxWinErrorMessage());
+
+ gc->ctx = wglCreateContext(hdc);
}
break;
case GLX_DRAWABLE_PIXMAP:
{
- *hdc = draw->dibDC;
+ hdc = draw->dibDC;
+#ifdef _DEBUG
+ if (glxWinDebugSettings.dumpDC)
+ GLWIN_DEBUG_MSG("Got PIXMAP HDC %p for window %p", hdc, *hwnd);
+#endif
}
break;
@@ -1149,10 +1355,12 @@ glxWinMakeDC(__GLXWinContext *gc, __GLXWinDrawable *draw, HDC *hdc, HWND *hwnd) }
}
+#ifdef _DEBUG
if (glxWinDebugSettings.dumpDC)
- GLWIN_DEBUG_MSG("Got HDC %p", *hdc);
+ GLWIN_HDC_DEBUG_MSG("Got HDC %p for window %p", hdc, *hwnd);
+#endif
- return *hdc;
+ return hdc;
}
static void
@@ -1195,7 +1403,6 @@ glxWinReleaseDC(HWND hwnd, HDC hdc,__GLXWinDrawable *draw) static void
glxWinDeferredCreateContext(__GLXWinContext *gc, __GLXWinDrawable *draw)
{
- HDC dc;
HWND hwnd;
GLWIN_DEBUG_MSG("glxWinDeferredCreateContext: attach context %p to drawable %p", gc, draw);
@@ -1228,13 +1435,16 @@ glxWinDeferredCreateContext(__GLXWinContext *gc, __GLXWinDrawable *draw) case GLX_DRAWABLE_PBUFFER:
{
+ WindowPtr pWin = (WindowPtr) draw->base.pDraw;
if (draw->hPbuffer == NULL)
{
__GLXscreen *screen;
glxWinScreen *winScreen;
int pixelFormat;
// XXX: which DC are supposed to use???
- HDC screenDC = GetDC(NULL);
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ winPrivScreenPtr pWinScreen = winGetScreenPriv(pScreen);
+ HDC screenDC=pWinScreen->hdcScreen;
if (!(gc->base.config->drawableType & GLX_PBUFFER_BIT))
{
@@ -1244,7 +1454,7 @@ glxWinDeferredCreateContext(__GLXWinContext *gc, __GLXWinDrawable *draw) screen = gc->base.pGlxScreen;
winScreen = (glxWinScreen *)screen;
- pixelFormat = fbConfigToPixelFormatIndex(screenDC, gc->base.config, GLX_DRAWABLE_PBUFFER, winScreen);
+ pixelFormat = fbConfigToPixelFormatIndex(screenDC, gc->base.config, GLX_PBUFFER_BIT, winScreen);
if (pixelFormat == 0)
{
ErrorF("wglChoosePixelFormat error: %s\n", glxWinErrorMessage());
@@ -1252,7 +1462,6 @@ glxWinDeferredCreateContext(__GLXWinContext *gc, __GLXWinDrawable *draw) }
draw->hPbuffer = wglCreatePbufferARBWrapper(screenDC, pixelFormat, draw->base.pDraw->width, draw->base.pDraw->height, NULL);
- ReleaseDC(NULL, screenDC);
if (draw->hPbuffer == NULL)
{
@@ -1306,6 +1515,8 @@ glxWinDeferredCreateContext(__GLXWinContext *gc, __GLXWinDrawable *draw) draw->pOldBits = ((PixmapPtr)draw->base.pDraw)->devPrivate.ptr;
((PixmapPtr)draw->base.pDraw)->devPrivate.ptr = pBits;
+ ((PixmapPtr)draw->base.pDraw)->refcnt++; /* Increment reference count to be sure it is not freed before the glxdrawable is destroyed */
+
// Select the DIB into the DC
draw->hOldDIB = SelectObject(draw->dibDC, draw->hDIB);
if (!draw->hOldDIB)
@@ -1328,12 +1539,13 @@ glxWinDeferredCreateContext(__GLXWinContext *gc, __GLXWinDrawable *draw) }
}
- dc = glxWinMakeDC(gc, draw, &dc, &hwnd);
- gc->ctx = wglCreateContext(dc);
- glxWinReleaseDC(hwnd, dc, draw);
+ gc->hDC = glxWinMakeDC(gc, draw, &hwnd);
if (gc->ctx == NULL)
{
+ glxWinReleaseDC(hwnd, gc->hDC, draw);
+ gc->hDC=0;
+
ErrorF("wglCreateContext error: %s\n", glxWinErrorMessage());
return;
}
@@ -1341,7 +1553,7 @@ glxWinDeferredCreateContext(__GLXWinContext *gc, __GLXWinDrawable *draw) GLWIN_DEBUG_MSG("glxWinDeferredCreateContext: attached context %p to native context %p drawable %p", gc, gc->ctx, draw);
// if the native context was created successfully, shareLists if needed
- if (gc->ctx && gc->shareContext)
+ if (gc->ctx && gc->shareContext && gc->shareContext->ctx)
{
GLWIN_DEBUG_MSG("glxWinCreateContextReal shareLists with context %p (native ctx %p)", gc->shareContext, gc->shareContext->ctx);
@@ -1364,35 +1576,26 @@ glxWinContextMakeCurrent(__GLXcontext *base) {
__GLXWinContext *gc = (__GLXWinContext *)base;
BOOL ret;
- HDC drawDC;
- HDC readDC = NULL;
- __GLXdrawable *drawPriv;
- __GLXdrawable *readPriv = NULL;
- HWND hDrawWnd;
- HWND hReadWnd;
+ __GLXWinDrawable *drawPriv;
+#ifdef _DEBUG
GLWIN_TRACE_MSG("glxWinContextMakeCurrent context %p (native ctx %p)", gc, gc->ctx);
glWinCallDelta();
+#endif
/* Keep a note of the last active context in the drawable */
- drawPriv = gc->base.drawPriv;
- ((__GLXWinDrawable *)drawPriv)->drawContext = gc;
+ drawPriv = (__GLXWinDrawable *)gc->base.drawPriv;
+ drawPriv->drawContext = gc;
if (gc->ctx == NULL)
{
- glxWinDeferredCreateContext(gc, (__GLXWinDrawable *)drawPriv);
+ glxWinDeferredCreateContext(gc, drawPriv);
}
if (gc->ctx == NULL)
{
ErrorF("glxWinContextMakeCurrent: Native context is NULL\n");
- return FALSE;
- }
-
- drawDC = glxWinMakeDC(gc, (__GLXWinDrawable *)drawPriv, &drawDC, &hDrawWnd);
- if (drawDC == NULL)
- {
- ErrorF("glxWinMakeDC failed for drawDC\n");
+ drawPriv->drawContext = NULL; /* clear last active context because we return error */
return FALSE;
}
@@ -1404,16 +1607,15 @@ glxWinContextMakeCurrent(__GLXcontext *base) use the wglMakeContextCurrent extension to make the context current drawing
to one DC and reading from the other
*/
- readPriv = gc->base.readPriv;
- readDC = glxWinMakeDC(gc, (__GLXWinDrawable *)readPriv, &readDC, &hReadWnd);
- if (readDC == NULL)
+ gc->hreadDC = glxWinMakeDC(gc, (__GLXWinDrawable *)gc->base.readPriv, &gc->hreadwnd);
+ if (gc->hreadDC == NULL)
{
ErrorF("glxWinMakeDC failed for readDC\n");
- glxWinReleaseDC(hDrawWnd, drawDC, (__GLXWinDrawable *)drawPriv);
+ drawPriv->drawContext = NULL; /* clear last active context because we return error */
return FALSE;
}
- ret = wglMakeContextCurrentARBWrapper(drawDC, readDC, gc->ctx);
+ ret = wglMakeContextCurrentARBWrapper(gc->hDC, gc->hreadDC, gc->ctx);
if (!ret)
{
ErrorF("wglMakeContextCurrentARBWrapper error: %s\n", glxWinErrorMessage());
@@ -1422,19 +1624,28 @@ glxWinContextMakeCurrent(__GLXcontext *base) else
{
/* Otherwise, just use wglMakeCurrent */
- ret = wglMakeCurrent(drawDC, gc->ctx);
+ if (!gc->hDC)
+ {
+ /* It probably has been release by loseCurrent, so create it again */
+ gc->hDC = glxWinMakeDC(gc, drawPriv, &gc->hwnd);
+ }
+ ret = wglMakeCurrent(gc->hDC, gc->ctx);
if (!ret)
{
- ErrorF("wglMakeCurrent error: %s\n", glxWinErrorMessage());
+ DWORD ErrorCode=GetLastError();
+ ErrorF("wglMakeCurrent error: %x dc %p ctx %p\n", ErrorCode,gc->hDC,gc->ctx);
+ if (!ErrorCode)
+ {
+ ErrorF("Error code was 0, assuming no error.\n");
+ ret=TRUE;
+ }
}
}
// apparently make current could fail if the context is current in a different thread,
// but that shouldn't be able to happen in the current server...
-
- glxWinReleaseDC(hDrawWnd, drawDC, (__GLXWinDrawable *)drawPriv);
- if (readDC)
- glxWinReleaseDC(hReadWnd, readDC, (__GLXWinDrawable *)readPriv);
+ if (!ret)
+ drawPriv->drawContext = NULL; /* clear last active context because we return error */
return ret;
}
@@ -1442,24 +1653,33 @@ glxWinContextMakeCurrent(__GLXcontext *base) static int
glxWinContextLoseCurrent(__GLXcontext *base)
{
- BOOL ret;
+ BOOL ret=TRUE;
__GLXWinContext *gc = (__GLXWinContext *)base;
+ __GLXWinDrawable *drawPriv = (__GLXWinDrawable *)gc->base.drawPriv;
+#ifdef _DEBUG
GLWIN_TRACE_MSG("glxWinContextLoseCurrent context %p (native ctx %p)", gc, gc->ctx);
glWinCallDelta();
+#endif
- /*
- An error seems to be reported if we try to make no context current
- if there is already no current context, so avoid doing that...
- */
- if (__glXLastContext != NULL)
- {
- ret = wglMakeCurrent(NULL, NULL); /* We don't need a DC when setting no current context */
- if (!ret)
- ErrorF("glxWinContextLoseCurrent error: %s\n", glxWinErrorMessage());
- }
+ /* Clear the last active context in the drawable */
+ drawPriv->drawContext = NULL;
+
+ if (wglGetCurrentContext()==gc->ctx)
+ {
+ /* Only do this when we are sure we are currently the active, otherwise we are deactivating the wrong one (this is happening!!!) */
+ ret = wglMakeCurrent(NULL, NULL);
+ if (!ret)
+ ErrorF("glxWinContextLoseCurrent error: %s\n", glxWinErrorMessage());
+ }
+ else
+ {
+ return FALSE;
+ }
+
+ base->isCurrent=FALSE; /* It looks like glx is not doing this */
- return TRUE;
+ return ret;
}
static int
@@ -1487,25 +1707,33 @@ glxWinContextDestroy(__GLXcontext *base) if (gc != NULL)
{
+ __GLXWinDrawable *drawPriv = (__GLXWinDrawable *)gc->base.drawPriv;
+
GLWIN_DEBUG_MSG("GLXcontext %p destroyed (native ctx %p)", base, gc->ctx);
if (gc->ctx)
{
+ BOOL ret;
/* It's bad style to delete the context while it's still current */
if (wglGetCurrentContext() == gc->ctx)
- {
- wglMakeCurrent(NULL, NULL);
- }
-
{
- BOOL ret = wglDeleteContext(gc->ctx);
- if (!ret)
- ErrorF("wglDeleteContext error: %s\n", glxWinErrorMessage());
+ wglMakeCurrent(NULL, NULL);
}
+ ret = wglDeleteContext(gc->ctx);
+ if (!ret)
+ ErrorF("wglDeleteContext error: %s\n", glxWinErrorMessage());
+ if (drawPriv && gc->hDC) glxWinReleaseDC(gc->hwnd, gc->hDC, drawPriv);
+ if (gc->base.readPriv && gc->hreadDC) glxWinReleaseDC(gc->hreadwnd, gc->hreadDC, (__GLXWinDrawable *)gc->base.readPriv);
+ gc->hDC=NULL;
+ gc->hreadDC=NULL;
gc->ctx = NULL;
}
+ /* Clear the last active context in the drawable */
+ if (drawPriv) drawPriv->drawContext = NULL;
+
+ free(gc->Dispatch);
free(gc);
}
}
@@ -1539,8 +1767,11 @@ glxWinCreateContext(__GLXscreen *screen, context->base.pGlxScreen = screen;
// actual native GL context creation is deferred until attach()
- context->ctx = NULL;
+ //context->ctx = NULL; already done with memset
context->shareContext = shareContext;
+
+ context->Dispatch=calloc(sizeof(void*), (sizeof(struct _glapi_table) / sizeof(void *) + MAX_EXTENSION_FUNCS));
+ _glapi_set_dispatch(context->Dispatch);
glWinSetupDispatchTable();
@@ -1554,6 +1785,17 @@ glxWinCreateContext(__GLXscreen *screen, * Utility functions
*/
+static int GetShift(int Mask)
+{
+ int Shift=0;
+ while ((Mask&1)==0)
+ {
+ Shift++;
+ Mask>>=1;
+ }
+ return Shift;
+}
+
static int
fbConfigToPixelFormat(__GLXconfig *mode, PIXELFORMATDESCRIPTOR *pfdret, int drawableTypeOverride)
{
@@ -1589,16 +1831,26 @@ fbConfigToPixelFormat(__GLXconfig *mode, PIXELFORMATDESCRIPTOR *pfdret, int draw pfd.dwFlags |= PFD_DOUBLEBUFFER;
}
- pfd.iPixelType = PFD_TYPE_RGBA;
pfd.cColorBits = mode->redBits + mode->greenBits + mode->blueBits;
pfd.cRedBits = mode->redBits;
- pfd.cRedShift = 0; /* FIXME */
+ pfd.cRedShift = GetShift(mode->redMask);
pfd.cGreenBits = mode->greenBits;
- pfd.cGreenShift = 0; /* FIXME */
+ pfd.cGreenShift = GetShift(mode->greenMask);
pfd.cBlueBits = mode->blueBits;
- pfd.cBlueShift = 0; /* FIXME */
+ pfd.cBlueShift = GetShift(mode->blueMask);
pfd.cAlphaBits = mode->alphaBits;
- pfd.cAlphaShift = 0; /* FIXME */
+ pfd.cAlphaShift = GetShift(mode->alphaMask);
+
+ if (mode->visualType = GLX_TRUE_COLOR)
+ {
+ pfd.iPixelType = PFD_TYPE_RGBA;
+ pfd.dwVisibleMask = (pfd.cRedBits << pfd.cRedShift) | (pfd.cGreenBits << pfd.cGreenShift) | (pfd.cBlueBits << pfd.cBlueShift) | (pfd.cAlphaBits << pfd.cAlphaShift);
+ }
+ else
+ {
+ pfd.iPixelType = PFD_TYPE_COLORINDEX;
+ pfd.dwVisibleMask = mode->transparentIndex;
+ }
pfd.cAccumBits = mode->accumRedBits + mode->accumGreenBits + mode->accumBlueBits + mode->accumAlphaBits;
pfd.cAccumRedBits = mode->accumRedBits;
@@ -1764,8 +2016,10 @@ glxWinCreateConfigs(HDC hdc, glxWinScreen *screen) break;
}
+#ifdef _DEBUG
if (glxWinDebugSettings.dumpPFD)
pfdOut(&pfd);
+#endif
if (!(pfd.dwFlags & (PFD_DRAW_TO_WINDOW | PFD_DRAW_TO_BITMAP)) || !(pfd.dwFlags & PFD_SUPPORT_OPENGL))
{
@@ -1830,26 +2084,24 @@ glxWinCreateConfigs(HDC hdc, glxWinScreen *screen) if (pfd.iPixelType == PFD_TYPE_COLORINDEX)
{
c->base.visualType = GLX_STATIC_COLOR;
-
- if (!getenv("GLWIN_ENABLE_COLORINDEX_FBCONFIGS"))
- {
- GLWIN_DEBUG_MSG("pixelFormat %d is PFD_TYPE_COLORINDEX, skipping", i+1);
- continue;
- }
+ c->base.transparentRed = GLX_NONE;
+ c->base.transparentGreen = GLX_NONE;
+ c->base.transparentBlue = GLX_NONE;
+ c->base.transparentAlpha = GLX_NONE;
+ c->base.transparentIndex = pfd.dwVisibleMask;
+ c->base.transparentPixel = GLX_TRANSPARENT_INDEX;
}
else
{
c->base.visualType = GLX_TRUE_COLOR;
+ c->base.transparentRed = (pfd.dwVisibleMask&c->base.redMask) >>pfd.cRedShift;
+ c->base.transparentGreen = (pfd.dwVisibleMask&c->base.greenMask)>>pfd.cGreenShift;
+ c->base.transparentBlue = (pfd.dwVisibleMask&c->base.blueMask) >>pfd.cBlueShift;
+ c->base.transparentAlpha = (pfd.dwVisibleMask&c->base.alphaMask)>>pfd.cAlphaShift;
+ c->base.transparentIndex = GLX_NONE;
+ c->base.transparentPixel = GLX_TRANSPARENT_RGB;
}
- // pfd.dwVisibleMask; ???
- c->base.transparentPixel = GLX_NONE;
- c->base.transparentRed = GLX_NONE;
- c->base.transparentGreen = GLX_NONE;
- c->base.transparentBlue = GLX_NONE;
- c->base.transparentAlpha = GLX_NONE;
- c->base.transparentIndex = GLX_NONE;
-
/* ARB_multisample / SGIS_multisample */
c->base.sampleBuffers = 0;
c->base.samples = 0;
@@ -2051,7 +2303,10 @@ glxWinCreateConfigsExt(HDC hdc, glxWinScreen *screen) /* fill in configs */
for (i = 0; i < numConfigs; i++)
{
- int values[num_attrs];
+ int sizevalues=num_attrs*sizeof(int);
+ int *values=(int*)_alloca(sizevalues);
+
+ memset(values,0,sizevalues);
c = &(result[i]);
c->base.next = NULL;
@@ -2090,13 +2345,6 @@ glxWinCreateConfigsExt(HDC hdc, glxWinScreen *screen) c->base.indexBits = ATTR_VALUE(WGL_COLOR_BITS_ARB, 0);
c->base.rgbBits = 0;
c->base.visualType = GLX_STATIC_COLOR;
-
- if (!getenv("GLWIN_ENABLE_COLORINDEX_FBCONFIGS"))
- {
- GLWIN_DEBUG_MSG("pixelFormat %d is WGL_TYPE_COLORINDEX_ARB, skipping", i+1);
- continue;
- }
-
break;
case WGL_TYPE_RGBA_FLOAT_ARB:
diff --git a/xorg-server/hw/xwin/glx/makefile b/xorg-server/hw/xwin/glx/makefile new file mode 100644 index 000000000..5f93d8204 --- /dev/null +++ b/xorg-server/hw/xwin/glx/makefile @@ -0,0 +1,45 @@ +LIBRARY=libwinglx + +INCLUDES += $(OBJDIR) ..\..\..\glx .. ..\..\.. +DEFINES += GLAPIENTRY=__stdcall _GLAPI_NO_EXPORTS + +DEFINES += XWIN_CLIPBOARD +DEFINES += XWIN_MULTIWINDOW +DEFINES += XWIN_RANDR +DEFINES += RELOCATE_PROJECTROOT +INCLUDES += ..\..\..\miext\rootless +DEFINES += HAVE_XWIN_CONFIG_H PTW32_STATIC_LIB + +CSRCS = \ + winpriv.c \ + glwrap.c \ + indirect.c \ + wgl_ext_api.c + +.PHONY: getspecfiles + +getspecfiles: + wget http://www.opengl.org/registry/api/gl.spec + wget http://www.opengl.org/registry/api/gl.tm + + wget http://www.opengl.org/registry/api/glxenum.spec + wget http://www.opengl.org/registry/api/glxenumext.spec + wget http://www.opengl.org/registry/api/glx.spec + wget http://www.opengl.org/registry/api/glxext.spec + wget http://www.opengl.org/registry/api/glx.tm + + wget http://www.opengl.org/registry/api/wglenum.spec + wget http://www.opengl.org/registry/api/wglenumext.spec + wget http://www.opengl.org/registry/api/wgl.spec + wget http://www.opengl.org/registry/api/wglext.spec + wget http://www.opengl.org/registry/api/wgl.tm + wget http://www.opengl.org/registry/api/wglext.h + wget http://www.opengl.org/registry/api/glext.h + wget http://www.opengl.org/registry/api/glxext.h + +$(OBJDIR)\generated_gl_wrappers.c: gen_gl_wrappers.py gl.spec gl.tm + gen_gl_wrappers --spec=gl.spec --typemap=gl.tm --dispatch-header=../../../glx/dispatch.h --staticwrappers > $@ + +$(OBJDIR)\generated_wgl_wrappers.c: gen_gl_wrappers.py wglext.spec wgl.tm + gen_gl_wrappers --spec=wglext.spec --typemap=wgl.tm --prefix=wgl --preresolve > $@ + diff --git a/xorg-server/hw/xwin/glx/wgl.tm b/xorg-server/hw/xwin/glx/wgl.tm new file mode 100644 index 000000000..baceced55 --- /dev/null +++ b/xorg-server/hw/xwin/glx/wgl.tm @@ -0,0 +1,36 @@ +BOOL,*,*, BOOL,*,* +DWORD,*,*, DWORD,*,* +FLOAT,*,*, FLOAT,*,* +GLbitfield,*,*, GLbitfield,*,* +GLboolean,*,*, GLboolean,*,* +GLenum,*,*, GLenum,*,* +GLfloat,*,*, GLfloat,*,* +GLint,*,*, GLint,*,* +GLsizei,*,*, GLsizei,*,* +GLuint,*,*, GLuint,*,* +GLushort,*,*, GLushort,*,* +HANDLE,*,*, HANDLE,*,* +HDC,*,*, HDC,*,* +HGLRC,*,*, HGLRC,*,* +HGPUNV,*,*, HGPUNV,*,* +HPBUFFERARB,*,*, HPBUFFERARB,*,* +HPBUFFEREXT,*,*, HPBUFFEREXT,*,* +HPVIDEODEV,*,*, HPVIDEODEV,*,* +HPGPUNV,*,*, HPGPUNV,*,* +HVIDEOINPUTDEVICENV,*,*, HVIDEOINPUTDEVICENV,*,* +HVIDEOOUTPUTDEVICENV,*,*, HVIDEOOUTPUTDEVICENV,*,* +INT,*,*, INT,*,* +INT32,*,*, INT32,*,* +INT64,*,*, INT64,*,* +LPVOID,*,*, LPVOID,*,* +PGPU_DEVICE,*,*, PGPU_DEVICE,*,* +String,*,*, const char *,*,* +UINT,*,*, UINT,*,* +USHORT,*,*, USHORT,*,* +VOID,*,*, VOID,*,* +VoidPointer,*,*, void*,*,* +float,*,*, float,*,* +int,*,*, int,*,* +uint,*,*, unsigned int,*,* +ulong,*,*, unsigned long,*,* +void,*,*, *,*,* diff --git a/xorg-server/hw/xwin/glx/wgl_ext_api.c b/xorg-server/hw/xwin/glx/wgl_ext_api.c index b301ed567..1d6abcc63 100644 --- a/xorg-server/hw/xwin/glx/wgl_ext_api.c +++ b/xorg-server/hw/xwin/glx/wgl_ext_api.c @@ -35,19 +35,24 @@ #include <GL/glext.h>
#include <glx/glxserver.h>
#include <glx/glxext.h>
-#include <GL/wglext.h>
+#include "wglext.h"
#include <wgl_ext_api.h>
#include "glwindows.h"
#define RESOLVE_DECL(type) \
static type type##proc = NULL;
+#ifdef _DEBUG
#define PRERESOLVE(type, symbol) \
type##proc = (type)wglGetProcAddress(symbol); \
if (type##proc == NULL) \
ErrorF("wglwrap: Can't resolve \"%s\"\n", symbol); \
else \
ErrorF("wglwrap: Resolved \"%s\"\n", symbol);
+#else
+#define PRERESOLVE(type, symbol) \
+ type##proc = (type)wglGetProcAddress(symbol);
+#endif
#define RESOLVE_RET(type, symbol, retval) \
if (type##proc == NULL) { \
diff --git a/xorg-server/hw/xwin/glx/wgl_ext_api.h b/xorg-server/hw/xwin/glx/wgl_ext_api.h index 3c8a5eb0f..0edc6e6ed 100644 --- a/xorg-server/hw/xwin/glx/wgl_ext_api.h +++ b/xorg-server/hw/xwin/glx/wgl_ext_api.h @@ -29,7 +29,7 @@ #ifndef wgl_ext_api_h
#define wgl_ext_api_h
-#include <GL/wglext.h>
+#include "wglext.h"
void wglResolveExtensionProcs(void);
@@ -38,50 +38,50 @@ void wglResolveExtensionProcs(void); XXX: should be automatically generated as well
*/
-const char *wglGetExtensionsStringARBWrapper(HDC hdc);
-BOOL wglMakeContextCurrentARBWrapper(HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
-HDC wglGetCurrentReadDCARBWrapper(VOID);
+const char * __stdcall wglGetExtensionsStringARBWrapper(HDC hdc);
+BOOL __stdcall wglMakeContextCurrentARBWrapper(HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
+HDC __stdcall wglGetCurrentReadDCARBWrapper(VOID);
-BOOL wglGetPixelFormatAttribivARBWrapper(HDC hdc,
+BOOL __stdcall wglGetPixelFormatAttribivARBWrapper(HDC hdc,
int iPixelFormat,
int iLayerPlane,
UINT nAttributes,
const int *piAttributes,
int *piValues);
-BOOL wglGetPixelFormatAttribfvARBWrapper(HDC hdc,
+BOOL __stdcall wglGetPixelFormatAttribfvARBWrapper(HDC hdc,
int iPixelFormat,
int iLayerPlane,
UINT nAttributes,
const int *piAttributes,
FLOAT *pfValues);
-BOOL wglChoosePixelFormatARBWrapper(HDC hdc,
+BOOL __stdcall wglChoosePixelFormatARBWrapper(HDC hdc,
const int *piAttribIList,
const FLOAT *pfAttribFList,
UINT nMaxFormats,
int *piFormats,
UINT *nNumFormats);
-HPBUFFERARB wglCreatePbufferARBWrapper(HDC hDC,
+HPBUFFERARB __stdcall wglCreatePbufferARBWrapper(HDC hDC,
int iPixelFormat,
int iWidth,
int iHeight,
const int *piAttribList);
-HDC wglGetPbufferDCARBWrapper(HPBUFFERARB hPbuffer);
+HDC __stdcall wglGetPbufferDCARBWrapper(HPBUFFERARB hPbuffer);
-int wglReleasePbufferDCARBWrapper(HPBUFFERARB hPbuffer,
+int __stdcall wglReleasePbufferDCARBWrapper(HPBUFFERARB hPbuffer,
HDC hDC);
-BOOL wglDestroyPbufferARBWrapper(HPBUFFERARB hPbuffer);
+BOOL __stdcall wglDestroyPbufferARBWrapper(HPBUFFERARB hPbuffer);
-BOOL wglQueryPbufferARBWrapper(HPBUFFERARB hPbuffer,
+BOOL __stdcall wglQueryPbufferARBWrapper(HPBUFFERARB hPbuffer,
int iAttribute,
int *piValue);
-BOOL wglSwapIntervalEXTWrapper(int interval);
+BOOL __stdcall wglSwapIntervalEXTWrapper(int interval);
-int wglGetSwapIntervalEXTWrapper(void);
+int __stdcall wglGetSwapIntervalEXTWrapper(void);
#endif /* wgl_ext_api_h */
diff --git a/xorg-server/hw/xwin/glx/wglext.h b/xorg-server/hw/xwin/glx/wglext.h new file mode 100644 index 000000000..e60c6527d --- /dev/null +++ b/xorg-server/hw/xwin/glx/wglext.h @@ -0,0 +1,901 @@ +#ifndef __wglext_h_ +#define __wglext_h_ + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** Copyright (c) 2007-2010 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +/* Function declaration macros - to move into glplatform.h */ + +#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) +#define WIN32_LEAN_AND_MEAN 1 +#include <windows.h> +#endif + +#ifndef APIENTRY +#define APIENTRY +#endif +#ifndef APIENTRYP +#define APIENTRYP APIENTRY * +#endif +#ifndef GLAPI +#define GLAPI extern +#endif + +/*************************************************************/ + +/* Header file version number */ +/* wglext.h last updated 2010/08/06 */ +/* Current version at http://www.opengl.org/registry/ */ +#define WGL_WGLEXT_VERSION 22 + +#ifndef WGL_ARB_buffer_region +#define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001 +#define WGL_BACK_COLOR_BUFFER_BIT_ARB 0x00000002 +#define WGL_DEPTH_BUFFER_BIT_ARB 0x00000004 +#define WGL_STENCIL_BUFFER_BIT_ARB 0x00000008 +#endif + +#ifndef WGL_ARB_multisample +#define WGL_SAMPLE_BUFFERS_ARB 0x2041 +#define WGL_SAMPLES_ARB 0x2042 +#endif + +#ifndef WGL_ARB_extensions_string +#endif + +#ifndef WGL_ARB_pixel_format +#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000 +#define WGL_DRAW_TO_WINDOW_ARB 0x2001 +#define WGL_DRAW_TO_BITMAP_ARB 0x2002 +#define WGL_ACCELERATION_ARB 0x2003 +#define WGL_NEED_PALETTE_ARB 0x2004 +#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005 +#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006 +#define WGL_SWAP_METHOD_ARB 0x2007 +#define WGL_NUMBER_OVERLAYS_ARB 0x2008 +#define WGL_NUMBER_UNDERLAYS_ARB 0x2009 +#define WGL_TRANSPARENT_ARB 0x200A +#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037 +#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038 +#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039 +#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A +#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B +#define WGL_SHARE_DEPTH_ARB 0x200C +#define WGL_SHARE_STENCIL_ARB 0x200D +#define WGL_SHARE_ACCUM_ARB 0x200E +#define WGL_SUPPORT_GDI_ARB 0x200F +#define WGL_SUPPORT_OPENGL_ARB 0x2010 +#define WGL_DOUBLE_BUFFER_ARB 0x2011 +#define WGL_STEREO_ARB 0x2012 +#define WGL_PIXEL_TYPE_ARB 0x2013 +#define WGL_COLOR_BITS_ARB 0x2014 +#define WGL_RED_BITS_ARB 0x2015 +#define WGL_RED_SHIFT_ARB 0x2016 +#define WGL_GREEN_BITS_ARB 0x2017 +#define WGL_GREEN_SHIFT_ARB 0x2018 +#define WGL_BLUE_BITS_ARB 0x2019 +#define WGL_BLUE_SHIFT_ARB 0x201A +#define WGL_ALPHA_BITS_ARB 0x201B +#define WGL_ALPHA_SHIFT_ARB 0x201C +#define WGL_ACCUM_BITS_ARB 0x201D +#define WGL_ACCUM_RED_BITS_ARB 0x201E +#define WGL_ACCUM_GREEN_BITS_ARB 0x201F +#define WGL_ACCUM_BLUE_BITS_ARB 0x2020 +#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021 +#define WGL_DEPTH_BITS_ARB 0x2022 +#define WGL_STENCIL_BITS_ARB 0x2023 +#define WGL_AUX_BUFFERS_ARB 0x2024 +#define WGL_NO_ACCELERATION_ARB 0x2025 +#define WGL_GENERIC_ACCELERATION_ARB 0x2026 +#define WGL_FULL_ACCELERATION_ARB 0x2027 +#define WGL_SWAP_EXCHANGE_ARB 0x2028 +#define WGL_SWAP_COPY_ARB 0x2029 +#define WGL_SWAP_UNDEFINED_ARB 0x202A +#define WGL_TYPE_RGBA_ARB 0x202B +#define WGL_TYPE_COLORINDEX_ARB 0x202C +#endif + +#ifndef WGL_ARB_make_current_read +#define ERROR_INVALID_PIXEL_TYPE_ARB 0x2043 +#define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054 +#endif + +#ifndef WGL_ARB_pbuffer +#define WGL_DRAW_TO_PBUFFER_ARB 0x202D +#define WGL_MAX_PBUFFER_PIXELS_ARB 0x202E +#define WGL_MAX_PBUFFER_WIDTH_ARB 0x202F +#define WGL_MAX_PBUFFER_HEIGHT_ARB 0x2030 +#define WGL_PBUFFER_LARGEST_ARB 0x2033 +#define WGL_PBUFFER_WIDTH_ARB 0x2034 +#define WGL_PBUFFER_HEIGHT_ARB 0x2035 +#define WGL_PBUFFER_LOST_ARB 0x2036 +#endif + +#ifndef WGL_ARB_render_texture +#define WGL_BIND_TO_TEXTURE_RGB_ARB 0x2070 +#define WGL_BIND_TO_TEXTURE_RGBA_ARB 0x2071 +#define WGL_TEXTURE_FORMAT_ARB 0x2072 +#define WGL_TEXTURE_TARGET_ARB 0x2073 +#define WGL_MIPMAP_TEXTURE_ARB 0x2074 +#define WGL_TEXTURE_RGB_ARB 0x2075 +#define WGL_TEXTURE_RGBA_ARB 0x2076 +#define WGL_NO_TEXTURE_ARB 0x2077 +#define WGL_TEXTURE_CUBE_MAP_ARB 0x2078 +#define WGL_TEXTURE_1D_ARB 0x2079 +#define WGL_TEXTURE_2D_ARB 0x207A +#define WGL_MIPMAP_LEVEL_ARB 0x207B +#define WGL_CUBE_MAP_FACE_ARB 0x207C +#define WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x207D +#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x207E +#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x207F +#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x2080 +#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x2081 +#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x2082 +#define WGL_FRONT_LEFT_ARB 0x2083 +#define WGL_FRONT_RIGHT_ARB 0x2084 +#define WGL_BACK_LEFT_ARB 0x2085 +#define WGL_BACK_RIGHT_ARB 0x2086 +#define WGL_AUX0_ARB 0x2087 +#define WGL_AUX1_ARB 0x2088 +#define WGL_AUX2_ARB 0x2089 +#define WGL_AUX3_ARB 0x208A +#define WGL_AUX4_ARB 0x208B +#define WGL_AUX5_ARB 0x208C +#define WGL_AUX6_ARB 0x208D +#define WGL_AUX7_ARB 0x208E +#define WGL_AUX8_ARB 0x208F +#define WGL_AUX9_ARB 0x2090 +#endif + +#ifndef WGL_ARB_pixel_format_float +#define WGL_TYPE_RGBA_FLOAT_ARB 0x21A0 +#endif + +#ifndef WGL_ARB_framebuffer_sRGB +#define WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20A9 +#endif + +#ifndef WGL_ARB_create_context +#define WGL_CONTEXT_DEBUG_BIT_ARB 0x00000001 +#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x00000002 +#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091 +#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092 +#define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093 +#define WGL_CONTEXT_FLAGS_ARB 0x2094 +#define ERROR_INVALID_VERSION_ARB 0x2095 +#endif + +#ifndef WGL_ARB_create_context_profile +#define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126 +#define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001 +#define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002 +#define ERROR_INVALID_PROFILE_ARB 0x2096 +#endif + +#ifndef WGL_ARB_create_context_robustness +#define WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004 +#define WGL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 +#define WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 +#define WGL_NO_RESET_NOTIFICATION_ARB 0x8261 +#endif + +#ifndef WGL_EXT_make_current_read +#define ERROR_INVALID_PIXEL_TYPE_EXT 0x2043 +#endif + +#ifndef WGL_EXT_pixel_format +#define WGL_NUMBER_PIXEL_FORMATS_EXT 0x2000 +#define WGL_DRAW_TO_WINDOW_EXT 0x2001 +#define WGL_DRAW_TO_BITMAP_EXT 0x2002 +#define WGL_ACCELERATION_EXT 0x2003 +#define WGL_NEED_PALETTE_EXT 0x2004 +#define WGL_NEED_SYSTEM_PALETTE_EXT 0x2005 +#define WGL_SWAP_LAYER_BUFFERS_EXT 0x2006 +#define WGL_SWAP_METHOD_EXT 0x2007 +#define WGL_NUMBER_OVERLAYS_EXT 0x2008 +#define WGL_NUMBER_UNDERLAYS_EXT 0x2009 +#define WGL_TRANSPARENT_EXT 0x200A +#define WGL_TRANSPARENT_VALUE_EXT 0x200B +#define WGL_SHARE_DEPTH_EXT 0x200C +#define WGL_SHARE_STENCIL_EXT 0x200D +#define WGL_SHARE_ACCUM_EXT 0x200E +#define WGL_SUPPORT_GDI_EXT 0x200F +#define WGL_SUPPORT_OPENGL_EXT 0x2010 +#define WGL_DOUBLE_BUFFER_EXT 0x2011 +#define WGL_STEREO_EXT 0x2012 +#define WGL_PIXEL_TYPE_EXT 0x2013 +#define WGL_COLOR_BITS_EXT 0x2014 +#define WGL_RED_BITS_EXT 0x2015 +#define WGL_RED_SHIFT_EXT 0x2016 +#define WGL_GREEN_BITS_EXT 0x2017 +#define WGL_GREEN_SHIFT_EXT 0x2018 +#define WGL_BLUE_BITS_EXT 0x2019 +#define WGL_BLUE_SHIFT_EXT 0x201A +#define WGL_ALPHA_BITS_EXT 0x201B +#define WGL_ALPHA_SHIFT_EXT 0x201C +#define WGL_ACCUM_BITS_EXT 0x201D +#define WGL_ACCUM_RED_BITS_EXT 0x201E +#define WGL_ACCUM_GREEN_BITS_EXT 0x201F +#define WGL_ACCUM_BLUE_BITS_EXT 0x2020 +#define WGL_ACCUM_ALPHA_BITS_EXT 0x2021 +#define WGL_DEPTH_BITS_EXT 0x2022 +#define WGL_STENCIL_BITS_EXT 0x2023 +#define WGL_AUX_BUFFERS_EXT 0x2024 +#define WGL_NO_ACCELERATION_EXT 0x2025 +#define WGL_GENERIC_ACCELERATION_EXT 0x2026 +#define WGL_FULL_ACCELERATION_EXT 0x2027 +#define WGL_SWAP_EXCHANGE_EXT 0x2028 +#define WGL_SWAP_COPY_EXT 0x2029 +#define WGL_SWAP_UNDEFINED_EXT 0x202A +#define WGL_TYPE_RGBA_EXT 0x202B +#define WGL_TYPE_COLORINDEX_EXT 0x202C +#endif + +#ifndef WGL_EXT_pbuffer +#define WGL_DRAW_TO_PBUFFER_EXT 0x202D +#define WGL_MAX_PBUFFER_PIXELS_EXT 0x202E +#define WGL_MAX_PBUFFER_WIDTH_EXT 0x202F +#define WGL_MAX_PBUFFER_HEIGHT_EXT 0x2030 +#define WGL_OPTIMAL_PBUFFER_WIDTH_EXT 0x2031 +#define WGL_OPTIMAL_PBUFFER_HEIGHT_EXT 0x2032 +#define WGL_PBUFFER_LARGEST_EXT 0x2033 +#define WGL_PBUFFER_WIDTH_EXT 0x2034 +#define WGL_PBUFFER_HEIGHT_EXT 0x2035 +#endif + +#ifndef WGL_EXT_depth_float +#define WGL_DEPTH_FLOAT_EXT 0x2040 +#endif + +#ifndef WGL_3DFX_multisample +#define WGL_SAMPLE_BUFFERS_3DFX 0x2060 +#define WGL_SAMPLES_3DFX 0x2061 +#endif + +#ifndef WGL_EXT_multisample +#define WGL_SAMPLE_BUFFERS_EXT 0x2041 +#define WGL_SAMPLES_EXT 0x2042 +#endif + +#ifndef WGL_I3D_digital_video_control +#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D 0x2050 +#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D 0x2051 +#define WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D 0x2052 +#define WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D 0x2053 +#endif + +#ifndef WGL_I3D_gamma +#define WGL_GAMMA_TABLE_SIZE_I3D 0x204E +#define WGL_GAMMA_EXCLUDE_DESKTOP_I3D 0x204F +#endif + +#ifndef WGL_I3D_genlock +#define WGL_GENLOCK_SOURCE_MULTIVIEW_I3D 0x2044 +#define WGL_GENLOCK_SOURCE_EXTENAL_SYNC_I3D 0x2045 +#define WGL_GENLOCK_SOURCE_EXTENAL_FIELD_I3D 0x2046 +#define WGL_GENLOCK_SOURCE_EXTENAL_TTL_I3D 0x2047 +#define WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D 0x2048 +#define WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D 0x2049 +#define WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D 0x204A +#define WGL_GENLOCK_SOURCE_EDGE_RISING_I3D 0x204B +#define WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D 0x204C +#endif + +#ifndef WGL_I3D_image_buffer +#define WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 0x00000001 +#define WGL_IMAGE_BUFFER_LOCK_I3D 0x00000002 +#endif + +#ifndef WGL_I3D_swap_frame_lock +#endif + +#ifndef WGL_NV_render_depth_texture +#define WGL_BIND_TO_TEXTURE_DEPTH_NV 0x20A3 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV 0x20A4 +#define WGL_DEPTH_TEXTURE_FORMAT_NV 0x20A5 +#define WGL_TEXTURE_DEPTH_COMPONENT_NV 0x20A6 +#define WGL_DEPTH_COMPONENT_NV 0x20A7 +#endif + +#ifndef WGL_NV_render_texture_rectangle +#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV 0x20A0 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV 0x20A1 +#define WGL_TEXTURE_RECTANGLE_NV 0x20A2 +#endif + +#ifndef WGL_ATI_pixel_format_float +#define WGL_TYPE_RGBA_FLOAT_ATI 0x21A0 +#endif + +#ifndef WGL_NV_float_buffer +#define WGL_FLOAT_COMPONENTS_NV 0x20B0 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV 0x20B1 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV 0x20B2 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV 0x20B3 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV 0x20B4 +#define WGL_TEXTURE_FLOAT_R_NV 0x20B5 +#define WGL_TEXTURE_FLOAT_RG_NV 0x20B6 +#define WGL_TEXTURE_FLOAT_RGB_NV 0x20B7 +#define WGL_TEXTURE_FLOAT_RGBA_NV 0x20B8 +#endif + +#ifndef WGL_3DL_stereo_control +#define WGL_STEREO_EMITTER_ENABLE_3DL 0x2055 +#define WGL_STEREO_EMITTER_DISABLE_3DL 0x2056 +#define WGL_STEREO_POLARITY_NORMAL_3DL 0x2057 +#define WGL_STEREO_POLARITY_INVERT_3DL 0x2058 +#endif + +#ifndef WGL_EXT_pixel_format_packed_float +#define WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT 0x20A8 +#endif + +#ifndef WGL_EXT_framebuffer_sRGB +#define WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20A9 +#endif + +#ifndef WGL_NV_present_video +#define WGL_NUM_VIDEO_SLOTS_NV 0x20F0 +#endif + +#ifndef WGL_NV_video_out +#define WGL_BIND_TO_VIDEO_RGB_NV 0x20C0 +#define WGL_BIND_TO_VIDEO_RGBA_NV 0x20C1 +#define WGL_BIND_TO_VIDEO_RGB_AND_DEPTH_NV 0x20C2 +#define WGL_VIDEO_OUT_COLOR_NV 0x20C3 +#define WGL_VIDEO_OUT_ALPHA_NV 0x20C4 +#define WGL_VIDEO_OUT_DEPTH_NV 0x20C5 +#define WGL_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6 +#define WGL_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7 +#define WGL_VIDEO_OUT_FRAME 0x20C8 +#define WGL_VIDEO_OUT_FIELD_1 0x20C9 +#define WGL_VIDEO_OUT_FIELD_2 0x20CA +#define WGL_VIDEO_OUT_STACKED_FIELDS_1_2 0x20CB +#define WGL_VIDEO_OUT_STACKED_FIELDS_2_1 0x20CC +#endif + +#ifndef WGL_NV_swap_group +#endif + +#ifndef WGL_NV_gpu_affinity +#define WGL_ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV 0x20D0 +#define WGL_ERROR_MISSING_AFFINITY_MASK_NV 0x20D1 +#endif + +#ifndef WGL_AMD_gpu_association +#define WGL_GPU_VENDOR_AMD 0x1F00 +#define WGL_GPU_RENDERER_STRING_AMD 0x1F01 +#define WGL_GPU_OPENGL_VERSION_STRING_AMD 0x1F02 +#define WGL_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2 +#define WGL_GPU_RAM_AMD 0x21A3 +#define WGL_GPU_CLOCK_AMD 0x21A4 +#define WGL_GPU_NUM_PIPES_AMD 0x21A5 +#define WGL_GPU_NUM_SIMD_AMD 0x21A6 +#define WGL_GPU_NUM_RB_AMD 0x21A7 +#define WGL_GPU_NUM_SPI_AMD 0x21A8 +#endif + +#ifndef WGL_NV_video_capture +#define WGL_UNIQUE_ID_NV 0x20CE +#define WGL_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF +#endif + +#ifndef WGL_NV_copy_image +#endif + +#ifndef WGL_NV_multisample_coverage +#define WGL_COVERAGE_SAMPLES_NV 0x2042 +#define WGL_COLOR_SAMPLES_NV 0x20B9 +#endif + +#ifndef WGL_EXT_create_context_es2_profile +#define WGL_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004 +#endif + + +/*************************************************************/ + +#ifndef WGL_ARB_pbuffer +DECLARE_HANDLE(HPBUFFERARB); +#endif +#ifndef WGL_EXT_pbuffer +DECLARE_HANDLE(HPBUFFEREXT); +#endif +#ifndef WGL_NV_present_video +DECLARE_HANDLE(HVIDEOOUTPUTDEVICENV); +#endif +#ifndef WGL_NV_video_output +DECLARE_HANDLE(HPVIDEODEV); +#endif +#ifndef WGL_NV_gpu_affinity +DECLARE_HANDLE(HPGPUNV); +DECLARE_HANDLE(HGPUNV); + +typedef struct _GPU_DEVICE { + DWORD cb; + CHAR DeviceName[32]; + CHAR DeviceString[128]; + DWORD Flags; + RECT rcVirtualScreen; +} GPU_DEVICE, *PGPU_DEVICE; +#endif +#ifndef WGL_NV_video_capture +DECLARE_HANDLE(HVIDEOINPUTDEVICENV); +#endif + +#ifndef WGL_ARB_buffer_region +#define WGL_ARB_buffer_region 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern HANDLE WINAPI wglCreateBufferRegionARB (HDC hDC, int iLayerPlane, UINT uType); +extern VOID WINAPI wglDeleteBufferRegionARB (HANDLE hRegion); +extern BOOL WINAPI wglSaveBufferRegionARB (HANDLE hRegion, int x, int y, int width, int height); +extern BOOL WINAPI wglRestoreBufferRegionARB (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef HANDLE (WINAPI * PFNWGLCREATEBUFFERREGIONARBPROC) (HDC hDC, int iLayerPlane, UINT uType); +typedef VOID (WINAPI * PFNWGLDELETEBUFFERREGIONARBPROC) (HANDLE hRegion); +typedef BOOL (WINAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height); +typedef BOOL (WINAPI * PFNWGLRESTOREBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc); +#endif + +#ifndef WGL_ARB_multisample +#define WGL_ARB_multisample 1 +#endif + +#ifndef WGL_ARB_extensions_string +#define WGL_ARB_extensions_string 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern const char * WINAPI wglGetExtensionsStringARB (HDC hdc); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef const char * (WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc); +#endif + +#ifndef WGL_ARB_pixel_format +#define WGL_ARB_pixel_format 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglGetPixelFormatAttribivARB (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues); +extern BOOL WINAPI wglGetPixelFormatAttribfvARB (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues); +extern BOOL WINAPI wglChoosePixelFormatARB (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues); +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues); +typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats); +#endif + +#ifndef WGL_ARB_make_current_read +#define WGL_ARB_make_current_read 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglMakeContextCurrentARB (HDC hDrawDC, HDC hReadDC, HGLRC hglrc); +extern HDC WINAPI wglGetCurrentReadDCARB (void); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTARBPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc); +typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCARBPROC) (void); +#endif + +#ifndef WGL_ARB_pbuffer +#define WGL_ARB_pbuffer 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern HPBUFFERARB WINAPI wglCreatePbufferARB (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList); +extern HDC WINAPI wglGetPbufferDCARB (HPBUFFERARB hPbuffer); +extern int WINAPI wglReleasePbufferDCARB (HPBUFFERARB hPbuffer, HDC hDC); +extern BOOL WINAPI wglDestroyPbufferARB (HPBUFFERARB hPbuffer); +extern BOOL WINAPI wglQueryPbufferARB (HPBUFFERARB hPbuffer, int iAttribute, int *piValue); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef HPBUFFERARB (WINAPI * PFNWGLCREATEPBUFFERARBPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList); +typedef HDC (WINAPI * PFNWGLGETPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer); +typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer, HDC hDC); +typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFERARBPROC) (HPBUFFERARB hPbuffer); +typedef BOOL (WINAPI * PFNWGLQUERYPBUFFERARBPROC) (HPBUFFERARB hPbuffer, int iAttribute, int *piValue); +#endif + +#ifndef WGL_ARB_render_texture +#define WGL_ARB_render_texture 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglBindTexImageARB (HPBUFFERARB hPbuffer, int iBuffer); +extern BOOL WINAPI wglReleaseTexImageARB (HPBUFFERARB hPbuffer, int iBuffer); +extern BOOL WINAPI wglSetPbufferAttribARB (HPBUFFERARB hPbuffer, const int *piAttribList); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLBINDTEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer); +typedef BOOL (WINAPI * PFNWGLRELEASETEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer); +typedef BOOL (WINAPI * PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, const int *piAttribList); +#endif + +#ifndef WGL_ARB_pixel_format_float +#define WGL_ARB_pixel_format_float 1 +#endif + +#ifndef WGL_ARB_framebuffer_sRGB +#define WGL_ARB_framebuffer_sRGB 1 +#endif + +#ifndef WGL_ARB_create_context +#define WGL_ARB_create_context 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern HGLRC WINAPI wglCreateContextAttribsARB (HDC hDC, HGLRC hShareContext, const int *attribList); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef HGLRC (WINAPI * PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC, HGLRC hShareContext, const int *attribList); +#endif + +#ifndef WGL_ARB_create_context_profile +#define WGL_ARB_create_context_profile 1 +#endif + +#ifndef WGL_ARB_create_context_robustness +#define WGL_ARB_create_context_robustness 1 +#endif + +#ifndef WGL_EXT_display_color_table +#define WGL_EXT_display_color_table 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern GLboolean WINAPI wglCreateDisplayColorTableEXT (GLushort id); +extern GLboolean WINAPI wglLoadDisplayColorTableEXT (const GLushort *table, GLuint length); +extern GLboolean WINAPI wglBindDisplayColorTableEXT (GLushort id); +extern VOID WINAPI wglDestroyDisplayColorTableEXT (GLushort id); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef GLboolean (WINAPI * PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC) (GLushort id); +typedef GLboolean (WINAPI * PFNWGLLOADDISPLAYCOLORTABLEEXTPROC) (const GLushort *table, GLuint length); +typedef GLboolean (WINAPI * PFNWGLBINDDISPLAYCOLORTABLEEXTPROC) (GLushort id); +typedef VOID (WINAPI * PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC) (GLushort id); +#endif + +#ifndef WGL_EXT_extensions_string +#define WGL_EXT_extensions_string 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern const char * WINAPI wglGetExtensionsStringEXT (void); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef const char * (WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC) (void); +#endif + +#ifndef WGL_EXT_make_current_read +#define WGL_EXT_make_current_read 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglMakeContextCurrentEXT (HDC hDrawDC, HDC hReadDC, HGLRC hglrc); +extern HDC WINAPI wglGetCurrentReadDCEXT (void); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTEXTPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc); +typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCEXTPROC) (void); +#endif + +#ifndef WGL_EXT_pbuffer +#define WGL_EXT_pbuffer 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern HPBUFFEREXT WINAPI wglCreatePbufferEXT (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList); +extern HDC WINAPI wglGetPbufferDCEXT (HPBUFFEREXT hPbuffer); +extern int WINAPI wglReleasePbufferDCEXT (HPBUFFEREXT hPbuffer, HDC hDC); +extern BOOL WINAPI wglDestroyPbufferEXT (HPBUFFEREXT hPbuffer); +extern BOOL WINAPI wglQueryPbufferEXT (HPBUFFEREXT hPbuffer, int iAttribute, int *piValue); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef HPBUFFEREXT (WINAPI * PFNWGLCREATEPBUFFEREXTPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList); +typedef HDC (WINAPI * PFNWGLGETPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer); +typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer, HDC hDC); +typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer); +typedef BOOL (WINAPI * PFNWGLQUERYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer, int iAttribute, int *piValue); +#endif + +#ifndef WGL_EXT_pixel_format +#define WGL_EXT_pixel_format 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglGetPixelFormatAttribivEXT (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, int *piValues); +extern BOOL WINAPI wglGetPixelFormatAttribfvEXT (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, FLOAT *pfValues); +extern BOOL WINAPI wglChoosePixelFormatEXT (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, int *piValues); +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, FLOAT *pfValues); +typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATEXTPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats); +#endif + +#ifndef WGL_EXT_swap_control +#define WGL_EXT_swap_control 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglSwapIntervalEXT (int interval); +extern int WINAPI wglGetSwapIntervalEXT (void); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval); +typedef int (WINAPI * PFNWGLGETSWAPINTERVALEXTPROC) (void); +#endif + +#ifndef WGL_EXT_depth_float +#define WGL_EXT_depth_float 1 +#endif + +#ifndef WGL_NV_vertex_array_range +#define WGL_NV_vertex_array_range 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern void* WINAPI wglAllocateMemoryNV (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority); +extern void WINAPI wglFreeMemoryNV (void *pointer); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef void* (WINAPI * PFNWGLALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority); +typedef void (WINAPI * PFNWGLFREEMEMORYNVPROC) (void *pointer); +#endif + +#ifndef WGL_3DFX_multisample +#define WGL_3DFX_multisample 1 +#endif + +#ifndef WGL_EXT_multisample +#define WGL_EXT_multisample 1 +#endif + +#ifndef WGL_OML_sync_control +#define WGL_OML_sync_control 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglGetSyncValuesOML (HDC hdc, INT64 *ust, INT64 *msc, INT64 *sbc); +extern BOOL WINAPI wglGetMscRateOML (HDC hdc, INT32 *numerator, INT32 *denominator); +extern INT64 WINAPI wglSwapBuffersMscOML (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder); +extern INT64 WINAPI wglSwapLayerBuffersMscOML (HDC hdc, int fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder); +extern BOOL WINAPI wglWaitForMscOML (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64 *ust, INT64 *msc, INT64 *sbc); +extern BOOL WINAPI wglWaitForSbcOML (HDC hdc, INT64 target_sbc, INT64 *ust, INT64 *msc, INT64 *sbc); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLGETSYNCVALUESOMLPROC) (HDC hdc, INT64 *ust, INT64 *msc, INT64 *sbc); +typedef BOOL (WINAPI * PFNWGLGETMSCRATEOMLPROC) (HDC hdc, INT32 *numerator, INT32 *denominator); +typedef INT64 (WINAPI * PFNWGLSWAPBUFFERSMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder); +typedef INT64 (WINAPI * PFNWGLSWAPLAYERBUFFERSMSCOMLPROC) (HDC hdc, int fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder); +typedef BOOL (WINAPI * PFNWGLWAITFORMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64 *ust, INT64 *msc, INT64 *sbc); +typedef BOOL (WINAPI * PFNWGLWAITFORSBCOMLPROC) (HDC hdc, INT64 target_sbc, INT64 *ust, INT64 *msc, INT64 *sbc); +#endif + +#ifndef WGL_I3D_digital_video_control +#define WGL_I3D_digital_video_control 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglGetDigitalVideoParametersI3D (HDC hDC, int iAttribute, int *piValue); +extern BOOL WINAPI wglSetDigitalVideoParametersI3D (HDC hDC, int iAttribute, const int *piValue); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue); +typedef BOOL (WINAPI * PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue); +#endif + +#ifndef WGL_I3D_gamma +#define WGL_I3D_gamma 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglGetGammaTableParametersI3D (HDC hDC, int iAttribute, int *piValue); +extern BOOL WINAPI wglSetGammaTableParametersI3D (HDC hDC, int iAttribute, const int *piValue); +extern BOOL WINAPI wglGetGammaTableI3D (HDC hDC, int iEntries, USHORT *puRed, USHORT *puGreen, USHORT *puBlue); +extern BOOL WINAPI wglSetGammaTableI3D (HDC hDC, int iEntries, const USHORT *puRed, const USHORT *puGreen, const USHORT *puBlue); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue); +typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue); +typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, USHORT *puRed, USHORT *puGreen, USHORT *puBlue); +typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, const USHORT *puRed, const USHORT *puGreen, const USHORT *puBlue); +#endif + +#ifndef WGL_I3D_genlock +#define WGL_I3D_genlock 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglEnableGenlockI3D (HDC hDC); +extern BOOL WINAPI wglDisableGenlockI3D (HDC hDC); +extern BOOL WINAPI wglIsEnabledGenlockI3D (HDC hDC, BOOL *pFlag); +extern BOOL WINAPI wglGenlockSourceI3D (HDC hDC, UINT uSource); +extern BOOL WINAPI wglGetGenlockSourceI3D (HDC hDC, UINT *uSource); +extern BOOL WINAPI wglGenlockSourceEdgeI3D (HDC hDC, UINT uEdge); +extern BOOL WINAPI wglGetGenlockSourceEdgeI3D (HDC hDC, UINT *uEdge); +extern BOOL WINAPI wglGenlockSampleRateI3D (HDC hDC, UINT uRate); +extern BOOL WINAPI wglGetGenlockSampleRateI3D (HDC hDC, UINT *uRate); +extern BOOL WINAPI wglGenlockSourceDelayI3D (HDC hDC, UINT uDelay); +extern BOOL WINAPI wglGetGenlockSourceDelayI3D (HDC hDC, UINT *uDelay); +extern BOOL WINAPI wglQueryGenlockMaxSourceDelayI3D (HDC hDC, UINT *uMaxLineDelay, UINT *uMaxPixelDelay); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLENABLEGENLOCKI3DPROC) (HDC hDC); +typedef BOOL (WINAPI * PFNWGLDISABLEGENLOCKI3DPROC) (HDC hDC); +typedef BOOL (WINAPI * PFNWGLISENABLEDGENLOCKI3DPROC) (HDC hDC, BOOL *pFlag); +typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEI3DPROC) (HDC hDC, UINT uSource); +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEI3DPROC) (HDC hDC, UINT *uSource); +typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT uEdge); +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT *uEdge); +typedef BOOL (WINAPI * PFNWGLGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT uRate); +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT *uRate); +typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT uDelay); +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT *uDelay); +typedef BOOL (WINAPI * PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) (HDC hDC, UINT *uMaxLineDelay, UINT *uMaxPixelDelay); +#endif + +#ifndef WGL_I3D_image_buffer +#define WGL_I3D_image_buffer 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern LPVOID WINAPI wglCreateImageBufferI3D (HDC hDC, DWORD dwSize, UINT uFlags); +extern BOOL WINAPI wglDestroyImageBufferI3D (HDC hDC, LPVOID pAddress); +extern BOOL WINAPI wglAssociateImageBufferEventsI3D (HDC hDC, const HANDLE *pEvent, const LPVOID *pAddress, const DWORD *pSize, UINT count); +extern BOOL WINAPI wglReleaseImageBufferEventsI3D (HDC hDC, const LPVOID *pAddress, UINT count); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef LPVOID (WINAPI * PFNWGLCREATEIMAGEBUFFERI3DPROC) (HDC hDC, DWORD dwSize, UINT uFlags); +typedef BOOL (WINAPI * PFNWGLDESTROYIMAGEBUFFERI3DPROC) (HDC hDC, LPVOID pAddress); +typedef BOOL (WINAPI * PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const HANDLE *pEvent, const LPVOID *pAddress, const DWORD *pSize, UINT count); +typedef BOOL (WINAPI * PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const LPVOID *pAddress, UINT count); +#endif + +#ifndef WGL_I3D_swap_frame_lock +#define WGL_I3D_swap_frame_lock 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglEnableFrameLockI3D (void); +extern BOOL WINAPI wglDisableFrameLockI3D (void); +extern BOOL WINAPI wglIsEnabledFrameLockI3D (BOOL *pFlag); +extern BOOL WINAPI wglQueryFrameLockMasterI3D (BOOL *pFlag); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLENABLEFRAMELOCKI3DPROC) (void); +typedef BOOL (WINAPI * PFNWGLDISABLEFRAMELOCKI3DPROC) (void); +typedef BOOL (WINAPI * PFNWGLISENABLEDFRAMELOCKI3DPROC) (BOOL *pFlag); +typedef BOOL (WINAPI * PFNWGLQUERYFRAMELOCKMASTERI3DPROC) (BOOL *pFlag); +#endif + +#ifndef WGL_I3D_swap_frame_usage +#define WGL_I3D_swap_frame_usage 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglGetFrameUsageI3D (float *pUsage); +extern BOOL WINAPI wglBeginFrameTrackingI3D (void); +extern BOOL WINAPI wglEndFrameTrackingI3D (void); +extern BOOL WINAPI wglQueryFrameTrackingI3D (DWORD *pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLGETFRAMEUSAGEI3DPROC) (float *pUsage); +typedef BOOL (WINAPI * PFNWGLBEGINFRAMETRACKINGI3DPROC) (void); +typedef BOOL (WINAPI * PFNWGLENDFRAMETRACKINGI3DPROC) (void); +typedef BOOL (WINAPI * PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD *pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage); +#endif + +#ifndef WGL_ATI_pixel_format_float +#define WGL_ATI_pixel_format_float 1 +#endif + +#ifndef WGL_NV_float_buffer +#define WGL_NV_float_buffer 1 +#endif + +#ifndef WGL_3DL_stereo_control +#define WGL_3DL_stereo_control 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglSetStereoEmitterState3DL (HDC hDC, UINT uState); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLSETSTEREOEMITTERSTATE3DLPROC) (HDC hDC, UINT uState); +#endif + +#ifndef WGL_EXT_pixel_format_packed_float +#define WGL_EXT_pixel_format_packed_float 1 +#endif + +#ifndef WGL_EXT_framebuffer_sRGB +#define WGL_EXT_framebuffer_sRGB 1 +#endif + +#ifndef WGL_NV_present_video +#define WGL_NV_present_video 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern int WINAPI wglEnumerateVideoDevicesNV (HDC hDC, HVIDEOOUTPUTDEVICENV *phDeviceList); +extern BOOL WINAPI wglBindVideoDeviceNV (HDC hDC, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int *piAttribList); +extern BOOL WINAPI wglQueryCurrentContextNV (int iAttribute, int *piValue); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef int (WINAPI * PFNWGLENUMERATEVIDEODEVICESNVPROC) (HDC hDC, HVIDEOOUTPUTDEVICENV *phDeviceList); +typedef BOOL (WINAPI * PFNWGLBINDVIDEODEVICENVPROC) (HDC hDC, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int *piAttribList); +typedef BOOL (WINAPI * PFNWGLQUERYCURRENTCONTEXTNVPROC) (int iAttribute, int *piValue); +#endif + +#ifndef WGL_NV_video_output +#define WGL_NV_video_output 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglGetVideoDeviceNV (HDC hDC, int numDevices, HPVIDEODEV *hVideoDevice); +extern BOOL WINAPI wglReleaseVideoDeviceNV (HPVIDEODEV hVideoDevice); +extern BOOL WINAPI wglBindVideoImageNV (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer); +extern BOOL WINAPI wglReleaseVideoImageNV (HPBUFFERARB hPbuffer, int iVideoBuffer); +extern BOOL WINAPI wglSendPbufferToVideoNV (HPBUFFERARB hPbuffer, int iBufferType, unsigned long *pulCounterPbuffer, BOOL bBlock); +extern BOOL WINAPI wglGetVideoInfoNV (HPVIDEODEV hpVideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLGETVIDEODEVICENVPROC) (HDC hDC, int numDevices, HPVIDEODEV *hVideoDevice); +typedef BOOL (WINAPI * PFNWGLRELEASEVIDEODEVICENVPROC) (HPVIDEODEV hVideoDevice); +typedef BOOL (WINAPI * PFNWGLBINDVIDEOIMAGENVPROC) (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer); +typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOIMAGENVPROC) (HPBUFFERARB hPbuffer, int iVideoBuffer); +typedef BOOL (WINAPI * PFNWGLSENDPBUFFERTOVIDEONVPROC) (HPBUFFERARB hPbuffer, int iBufferType, unsigned long *pulCounterPbuffer, BOOL bBlock); +typedef BOOL (WINAPI * PFNWGLGETVIDEOINFONVPROC) (HPVIDEODEV hpVideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo); +#endif + +#ifndef WGL_NV_swap_group +#define WGL_NV_swap_group 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglJoinSwapGroupNV (HDC hDC, GLuint group); +extern BOOL WINAPI wglBindSwapBarrierNV (GLuint group, GLuint barrier); +extern BOOL WINAPI wglQuerySwapGroupNV (HDC hDC, GLuint *group, GLuint *barrier); +extern BOOL WINAPI wglQueryMaxSwapGroupsNV (HDC hDC, GLuint *maxGroups, GLuint *maxBarriers); +extern BOOL WINAPI wglQueryFrameCountNV (HDC hDC, GLuint *count); +extern BOOL WINAPI wglResetFrameCountNV (HDC hDC); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLJOINSWAPGROUPNVPROC) (HDC hDC, GLuint group); +typedef BOOL (WINAPI * PFNWGLBINDSWAPBARRIERNVPROC) (GLuint group, GLuint barrier); +typedef BOOL (WINAPI * PFNWGLQUERYSWAPGROUPNVPROC) (HDC hDC, GLuint *group, GLuint *barrier); +typedef BOOL (WINAPI * PFNWGLQUERYMAXSWAPGROUPSNVPROC) (HDC hDC, GLuint *maxGroups, GLuint *maxBarriers); +typedef BOOL (WINAPI * PFNWGLQUERYFRAMECOUNTNVPROC) (HDC hDC, GLuint *count); +typedef BOOL (WINAPI * PFNWGLRESETFRAMECOUNTNVPROC) (HDC hDC); +#endif + +#ifndef WGL_NV_gpu_affinity +#define WGL_NV_gpu_affinity 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglEnumGpusNV (UINT iGpuIndex, HGPUNV *phGpu); +extern BOOL WINAPI wglEnumGpuDevicesNV (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice); +extern HDC WINAPI wglCreateAffinityDCNV (const HGPUNV *phGpuList); +extern BOOL WINAPI wglEnumGpusFromAffinityDCNV (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu); +extern BOOL WINAPI wglDeleteDCNV (HDC hdc); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLENUMGPUSNVPROC) (UINT iGpuIndex, HGPUNV *phGpu); +typedef BOOL (WINAPI * PFNWGLENUMGPUDEVICESNVPROC) (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice); +typedef HDC (WINAPI * PFNWGLCREATEAFFINITYDCNVPROC) (const HGPUNV *phGpuList); +typedef BOOL (WINAPI * PFNWGLENUMGPUSFROMAFFINITYDCNVPROC) (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu); +typedef BOOL (WINAPI * PFNWGLDELETEDCNVPROC) (HDC hdc); +#endif + +#ifndef WGL_AMD_gpu_association +#define WGL_AMD_gpu_association 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern UINT WINAPI wglGetGPUIDsAMD (UINT maxCount, UINT *ids); +extern INT WINAPI wglGetGPUInfoAMD (UINT id, int property, GLenum dataType, UINT size, void *data); +extern UINT WINAPI wglGetContextGPUIDAMD (HGLRC hglrc); +extern HGLRC WINAPI wglCreateAssociatedContextAMD (UINT id); +extern HGLRC WINAPI wglCreateAssociatedContextAttribsAMD (UINT id, HGLRC hShareContext, const int *attribList); +extern BOOL WINAPI wglDeleteAssociatedContextAMD (HGLRC hglrc); +extern BOOL WINAPI wglMakeAssociatedContextCurrentAMD (HGLRC hglrc); +extern HGLRC WINAPI wglGetCurrentAssociatedContextAMD (void); +extern VOID WINAPI wglBlitContextFramebufferAMD (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef UINT (WINAPI * PFNWGLGETGPUIDSAMDPROC) (UINT maxCount, UINT *ids); +typedef INT (WINAPI * PFNWGLGETGPUINFOAMDPROC) (UINT id, int property, GLenum dataType, UINT size, void *data); +typedef UINT (WINAPI * PFNWGLGETCONTEXTGPUIDAMDPROC) (HGLRC hglrc); +typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC) (UINT id); +typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC) (UINT id, HGLRC hShareContext, const int *attribList); +typedef BOOL (WINAPI * PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC) (HGLRC hglrc); +typedef BOOL (WINAPI * PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC) (HGLRC hglrc); +typedef HGLRC (WINAPI * PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC) (void); +typedef VOID (WINAPI * PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC) (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +#endif + +#ifndef WGL_NV_video_capture +#define WGL_NV_video_capture 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglBindVideoCaptureDeviceNV (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice); +extern UINT WINAPI wglEnumerateVideoCaptureDevicesNV (HDC hDc, HVIDEOINPUTDEVICENV *phDeviceList); +extern BOOL WINAPI wglLockVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice); +extern BOOL WINAPI wglQueryVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int *piValue); +extern BOOL WINAPI wglReleaseVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLBINDVIDEOCAPTUREDEVICENVPROC) (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice); +typedef UINT (WINAPI * PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC) (HDC hDc, HVIDEOINPUTDEVICENV *phDeviceList); +typedef BOOL (WINAPI * PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice); +typedef BOOL (WINAPI * PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int *piValue); +typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice); +#endif + +#ifndef WGL_NV_copy_image +#define WGL_NV_copy_image 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglCopyImageSubDataNV (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLCOPYIMAGESUBDATANVPROC) (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); +#endif + +#ifndef WGL_NV_multisample_coverage +#define WGL_NV_multisample_coverage 1 +#endif + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/xorg-server/hw/xwin/glx/wglext.spec b/xorg-server/hw/xwin/glx/wglext.spec new file mode 100644 index 000000000..a2276fc48 --- /dev/null +++ b/xorg-server/hw/xwin/glx/wglext.spec @@ -0,0 +1,1126 @@ +# wglext.spec file +# DON'T REMOVE PREVIOUS LINE!!! libspec depends on it! +# +# Copyright (c) 1991-2002 Silicon Graphics, Inc. All Rights Reserved. +# Copyright (c) 2006-2010 The Khronos Group, Inc. +# +# This document is licensed under the SGI Free Software B License Version +# 2.0. For details, see http://oss.sgi.com/projects/FreeB/ . +# +# $Revision: 12183 $ on $Date: 2010-08-06 02:53:05 -0700 (Fri, 06 Aug 2010) $ + +required-props: +param: retval retained +category: wgl ARB_buffer_region ARB_extensions_string ARB_pixel_format ARB_make_current_read ARB_pbuffer ARB_render_texture ARB_pixel_format_float EXT_display_color_table EXT_extensions_string EXT_make_current_read EXT_pbuffer EXT_pixel_format EXT_swap_control OML_sync_control I3D_digital_video_control I3D_gamma I3D_genlock I3D_image_buffer I3D_swap_frame_lock I3D_swap_frame_usage NV_vertex_array_range 3DL_stereo_control NV_swap_group NV_video_output NV_present_video ARB_create_context NV_gpu_affinity AMD_gpu_association NV_video_capture NV_copy_image ARB_framebuffer_sRGB +# required-props in wgl.spec (which is not used for anything): +# dlflags: notlistable handcode +# wglflags: client-handcode server-handcode non-dispatch + +# +# Boilerplate to define types used by some extensions. This is done +# up front, since it involves some complexities in protecting +# the declarations whether or not the -protect flag is given to +# the generator scripts. +# + +passthru: #ifndef WGL_ARB_pbuffer +passthru: DECLARE_HANDLE(HPBUFFERARB); +passthru: #endif +passthru: #ifndef WGL_EXT_pbuffer +passthru: DECLARE_HANDLE(HPBUFFEREXT); +passthru: #endif +passthru: #ifndef WGL_NV_present_video +passthru: DECLARE_HANDLE(HVIDEOOUTPUTDEVICENV); +passthru: #endif +passthru: #ifndef WGL_NV_video_output +passthru: DECLARE_HANDLE(HPVIDEODEV); +passthru: #endif +passthru: #ifndef WGL_NV_gpu_affinity +passthru: DECLARE_HANDLE(HPGPUNV); +passthru: DECLARE_HANDLE(HGPUNV); +passthru: +passthru: typedef struct _GPU_DEVICE { +passthru: DWORD cb; +passthru: CHAR DeviceName[32]; +passthru: CHAR DeviceString[128]; +passthru: DWORD Flags; +passthru: RECT rcVirtualScreen; +passthru: } GPU_DEVICE, *PGPU_DEVICE; +passthru: #endif +passthru: #ifndef WGL_NV_video_capture +passthru: DECLARE_HANDLE(HVIDEOINPUTDEVICENV); +passthru: #endif +passthru: + + +############################################################################### +# +# ARB Extension #4 +# ARB_buffer_region commands +# +############################################################################### + +CreateBufferRegionARB(hDC, iLayerPlane, uType) + return HANDLE + param hDC HDC in value + param iLayerPlane int in value + param uType UINT in value + category ARB_buffer_region + +DeleteBufferRegionARB(hRegion) + return VOID + param hRegion HANDLE in value + category ARB_buffer_region + +SaveBufferRegionARB(hRegion, x, y, width, height) + return BOOL + param hRegion HANDLE in value + param x int in value + param y int in value + param width int in value + param height int in value + category ARB_buffer_region + +RestoreBufferRegionARB(hRegion, x, y, width, height, xSrc, ySrc) + return BOOL + param hRegion HANDLE in value + param x int in value + param y int in value + param width int in value + param height int in value + param xSrc int in value + param ySrc int in value + category ARB_buffer_region + +############################################################################### +# +# ARB Extension #5 +# ARB_multisample commands +# +############################################################################### + +# (none) +newcategory: ARB_multisample + +############################################################################### +# +# ARB Extension #8 +# ARB_extensions_string commands +# +############################################################################### + +GetExtensionsStringARB(hdc) + return String + param hdc HDC in value + category ARB_extensions_string + +############################################################################### +# +# ARB Extension #9 +# ARB_pixel_format commands +# +############################################################################### + +GetPixelFormatAttribivARB(hdc, iPixelFormat, iLayerPlane, nAttributes, piAttributes, piValues) + return BOOL + param hdc HDC in value + param iPixelFormat int in value + param iLayerPlane int in value + param nAttributes UINT in value + param piAttributes int in array [nAttributes] + param piValues int out array [nAttributes] + category ARB_pixel_format + +GetPixelFormatAttribfvARB(hdc, iPixelFormat, iLayerPlane, nAttributes, piAttributes, pfValues) + return BOOL + param hdc HDC in value + param iPixelFormat int in value + param iLayerPlane int in value + param nAttributes UINT in value + param piAttributes int in array [nAttributes] + param pfValues FLOAT out array [nAttributes] + category ARB_pixel_format + +ChoosePixelFormatARB(hdc, piAttribIList, pfAttribFList, nMaxFormats, piFormats, nNumFormats) + return BOOL + param hdc HDC in value + param piAttribIList int in array [COMPSIZE()] + param pfAttribFList FLOAT in array [COMPSIZE()] + param nMaxFormats UINT in value + param piFormats int out array [COMPSIZE(nNumFormats)] + param nNumFormats UINT out reference + category ARB_pixel_format + +############################################################################### +# +# ARB Extension #10 +# ARB_make_current_read commands +# +############################################################################### + +MakeContextCurrentARB(hDrawDC, hReadDC, hglrc) + return BOOL + param hDrawDC HDC in value + param hReadDC HDC in value + param hglrc HGLRC in value + category ARB_make_current_read + +GetCurrentReadDCARB() + return HDC + category ARB_make_current_read + +############################################################################### +# +# ARB Extension #11 +# ARB_pbuffer commands +# +############################################################################### + +CreatePbufferARB(hDC, iPixelFormat, iWidth, iHeight, piAttribList) + return HPBUFFERARB + param hDC HDC in value + param iPixelFormat int in value + param iWidth int in value + param iHeight int in value + param piAttribList int in array [COMPSIZE()] + category ARB_pbuffer + +GetPbufferDCARB(hPbuffer) + return HDC + param hPbuffer HPBUFFERARB in value + category ARB_pbuffer + +ReleasePbufferDCARB(hPbuffer, hDC) + return int + param hPbuffer HPBUFFERARB in value + param hDC HDC in value + category ARB_pbuffer + +DestroyPbufferARB(hPbuffer) + return BOOL + param hPbuffer HPBUFFERARB in value + category ARB_pbuffer + +QueryPbufferARB(hPbuffer, iAttribute, piValue) + return BOOL + param hPbuffer HPBUFFERARB in value + param iAttribute int in value + param piValue int out reference + category ARB_pbuffer + +############################################################################### +# +# ARB Extension #20 +# ARB_render_texture commands +# +############################################################################### + +BindTexImageARB(hPbuffer, iBuffer) + return BOOL + param hPbuffer HPBUFFERARB in value + param iBuffer int in value + category ARB_render_texture + +ReleaseTexImageARB(hPbuffer, iBuffer) + return BOOL + param hPbuffer HPBUFFERARB in value + param iBuffer int in value + category ARB_render_texture + +SetPbufferAttribARB(hPbuffer, piAttribList) + return BOOL + param hPbuffer HPBUFFERARB in value + param piAttribList int in array [COMPSIZE()] + category ARB_render_texture + +############################################################################### +# +# ARB Extension #39 +# ARB_pixel_format_float commands +# +############################################################################### + +# (none) +newcategory: ARB_pixel_format_float + +############################################################################### +# +# ARB Extension #46 +# ARB_framebuffer_sRGB commands +# +############################################################################### + +# (none) +newcategory: ARB_framebuffer_sRGB + +############################################################################### +# +# ARB Extension #55 +# ARB_create_context commands +# +############################################################################### + +CreateContextAttribsARB(hDC, hShareContext, attribList) + return HGLRC + param hDC HDC in value + param hShareContext HGLRC in value + param attribList int in array [COMPSIZE()] + category ARB_create_context + +############################################################################### +# +# ARB Extension #74 +# ARB_create_context_profile commands +# +############################################################################### + +# (none) +newcategory: ARB_create_context_profile + +############################################################################### +# +# ARB Extension #102 +# ARB_create_context_robustness commands +# +############################################################################### + +# (none) +newcategory: ARB_create_context_robustness + + +############################################################################### +# +# Extension #167 +# EXT_display_color_table commands +# +############################################################################### + +CreateDisplayColorTableEXT(id) + return GLboolean + param id GLushort in value + category EXT_display_color_table + +LoadDisplayColorTableEXT(table, length) + return GLboolean + param table GLushort in array [length] + param length GLuint in value + category EXT_display_color_table + +BindDisplayColorTableEXT(id) + return GLboolean + param id GLushort in value + category EXT_display_color_table + +DestroyDisplayColorTableEXT(id) + return VOID + param id GLushort in value + category EXT_display_color_table + +############################################################################### +# +# Extension #168 +# EXT_extensions_string commands +# +############################################################################### + +GetExtensionsStringEXT() + return String + category EXT_extensions_string + +############################################################################### +# +# Extension #169 +# EXT_make_current_read commands +# +############################################################################### + +MakeContextCurrentEXT(hDrawDC, hReadDC, hglrc) + return BOOL + param hDrawDC HDC in value + param hReadDC HDC in value + param hglrc HGLRC in value + category EXT_make_current_read + +GetCurrentReadDCEXT() + return HDC + category EXT_make_current_read + +############################################################################### +# +# Extension #171 +# EXT_pbuffer commands +# +############################################################################### + +CreatePbufferEXT(hDC, iPixelFormat, iWidth, iHeight, piAttribList) + return HPBUFFEREXT + param hDC HDC in value + param iPixelFormat int in value + param iWidth int in value + param iHeight int in value + param piAttribList int in array [COMPSIZE()] + category EXT_pbuffer + +GetPbufferDCEXT(hPbuffer) + return HDC + param hPbuffer HPBUFFEREXT in value + category EXT_pbuffer + +ReleasePbufferDCEXT(hPbuffer, hDC) + return int + param hPbuffer HPBUFFEREXT in value + param hDC HDC in value + category EXT_pbuffer + +DestroyPbufferEXT(hPbuffer) + return BOOL + param hPbuffer HPBUFFEREXT in value + category EXT_pbuffer + +QueryPbufferEXT(hPbuffer, iAttribute, piValue) + return BOOL + param hPbuffer HPBUFFEREXT in value + param iAttribute int in value + param piValue int out reference + category EXT_pbuffer + +############################################################################### +# +# Extension #170 +# EXT_pixel_format commands +# +############################################################################### + +GetPixelFormatAttribivEXT(hdc, iPixelFormat, iLayerPlane, nAttributes, piAttributes, piValues) + return BOOL + param hdc HDC in value + param iPixelFormat int in value + param iLayerPlane int in value + param nAttributes UINT in value + param piAttributes int out array [nAttributes] + param piValues int out array [nAttributes] + category EXT_pixel_format + +GetPixelFormatAttribfvEXT(hdc, iPixelFormat, iLayerPlane, nAttributes, piAttributes, pfValues) + return BOOL + param hdc HDC in value + param iPixelFormat int in value + param iLayerPlane int in value + param nAttributes UINT in value + param piAttributes int out array [nAttributes] + param pfValues FLOAT out array [nAttributes] + category EXT_pixel_format + +ChoosePixelFormatEXT(hdc, piAttribIList, pfAttribFList, nMaxFormats, piFormats, nNumFormats) + return BOOL + param hdc HDC in value + param piAttribIList int in array [COMPSIZE()] + param pfAttribFList FLOAT in array [COMPSIZE()] + param nMaxFormats UINT in value + param piFormats int out array [COMPSIZE(nNumFormats)] + param nNumFormats UINT out reference + category EXT_pixel_format + +############################################################################### +# +# Extension #172 +# EXT_swap_control commands +# +############################################################################### + +SwapIntervalEXT(interval) + return BOOL + param interval int in value + category EXT_swap_control + +GetSwapIntervalEXT() + return int + category EXT_swap_control + +############################################################################### +# +# Extension #177 +# EXT_depth_float commands +# +############################################################################### + +# (none) +newcategory: EXT_depth_float + +############################################################################### +# +# Extension #190 +# NV_vertex_array_range commands +# +############################################################################### + +AllocateMemoryNV(size, readfreq, writefreq, priority) + return VoidPointer + param size GLsizei in value + param readfreq GLfloat in value + param writefreq GLfloat in value + param priority GLfloat in value + category NV_vertex_array_range + +FreeMemoryNV(pointer) + return void + param pointer void out array [1] + category NV_vertex_array_range + +############################################################################### +# +# Extension #207 +# 3DFX_multisample commands +# +############################################################################### + +# (none) +newcategory: 3DFX_multisample + +############################################################################### +# +# Extension #209 +# EXT_multisample commands +# +############################################################################### + +# (none) +newcategory: EXT_multisample + +############################################################################### +# +# Extension #242 +# OML_sync_control commands +# +############################################################################### + +GetSyncValuesOML(hdc, ust, msc, sbc) + return BOOL + param hdc HDC in value + param ust INT64 out array [1] + param msc INT64 out array [1] + param sbc INT64 out array [1] + category OML_sync_control + +GetMscRateOML(hdc, numerator, denominator) + return BOOL + param hdc HDC in value + param numerator INT32 out array [1] + param denominator INT32 out array [1] + category OML_sync_control + +SwapBuffersMscOML(hdc, target_msc, divisor, remainder) + return INT64 + param hdc HDC in value + param target_msc INT64 in value + param divisor INT64 in value + param remainder INT64 in value + category OML_sync_control + +SwapLayerBuffersMscOML(hdc, fuPlanes, target_msc, divisor, remainder) + return INT64 + param hdc HDC in value + param fuPlanes int in value + param target_msc INT64 in value + param divisor INT64 in value + param remainder INT64 in value + category OML_sync_control + +WaitForMscOML(hdc, target_msc, divisor, remainder , ust, msc, sbc) + return BOOL + param hdc HDC in value + param target_msc INT64 in value + param divisor INT64 in value + param remainder INT64 in value + param ust INT64 out array [1] + param msc INT64 out array [1] + param sbc INT64 out array [1] + category OML_sync_control + +WaitForSbcOML(hdc, target_sbc, ust, msc, sbc) + return BOOL + param hdc HDC in value + param target_sbc INT64 in value + param ust INT64 out array [1] + param msc INT64 out array [1] + param sbc INT64 out array [1] + category OML_sync_control + +############################################################################### +# +# Extension #250 +# I3D_digital_video_control commands +# +############################################################################### + +GetDigitalVideoParametersI3D(hDC, iAttribute, piValue) + return BOOL + param hDC HDC in value + param iAttribute int in value + param piValue int out array [COMPSIZE(iAttribute)] + category I3D_digital_video_control + +SetDigitalVideoParametersI3D(hDC, iAttribute, piValue) + return BOOL + param hDC HDC in value + param iAttribute int in value + param piValue int in array [COMPSIZE(iAttribute)] + category I3D_digital_video_control + +############################################################################### +# +# Extension #251 +# I3D_gamma commands +# +############################################################################### + +GetGammaTableParametersI3D(hDC, iAttribute, piValue) + return BOOL + param hDC HDC in value + param iAttribute int in value + param piValue int out array [COMPSIZE(iAttribute)] + category I3D_gamma + +SetGammaTableParametersI3D(hDC, iAttribute, piValue) + return BOOL + param hDC HDC in value + param iAttribute int in value + param piValue int in array [COMPSIZE(iAttribute)] + category I3D_gamma + +GetGammaTableI3D(hDC, iEntries, puRed, puGreen, puBlue) + return BOOL + param hDC HDC in value + param iEntries int in value + param puRed USHORT out array [iEntries] + param puGreen USHORT out array [iEntries] + param puBlue USHORT out array [iEntries] + category I3D_gamma + +SetGammaTableI3D(hDC, iEntries, puRed, puGreen, puBlue) + return BOOL + param hDC HDC in value + param iEntries int in value + param puRed USHORT in array [iEntries] + param puGreen USHORT in array [iEntries] + param puBlue USHORT in array [iEntries] + category I3D_gamma + +############################################################################### +# +# Extension #252 +# I3D_genlock commands +# +############################################################################### + +EnableGenlockI3D(hDC) + return BOOL + param hDC HDC in value + category I3D_genlock + +DisableGenlockI3D(hDC) + return BOOL + param hDC HDC in value + category I3D_genlock + +IsEnabledGenlockI3D(hDC, pFlag) + return BOOL + param hDC HDC in value + param pFlag BOOL out reference + category I3D_genlock + +GenlockSourceI3D(hDC, uSource) + return BOOL + param hDC HDC in value + param uSource UINT in value + category I3D_genlock + +GetGenlockSourceI3D(hDC, uSource) + return BOOL + param hDC HDC in value + param uSource UINT out reference + category I3D_genlock + +GenlockSourceEdgeI3D(hDC, uEdge) + return BOOL + param hDC HDC in value + param uEdge UINT in value + category I3D_genlock + +GetGenlockSourceEdgeI3D(hDC, uEdge) + return BOOL + param hDC HDC in value + param uEdge UINT out reference + category I3D_genlock + +GenlockSampleRateI3D(hDC, uRate) + return BOOL + param hDC HDC in value + param uRate UINT in value + category I3D_genlock + +GetGenlockSampleRateI3D(hDC, uRate) + return BOOL + param hDC HDC in value + param uRate UINT out reference + category I3D_genlock + +GenlockSourceDelayI3D(hDC, uDelay) + return BOOL + param hDC HDC in value + param uDelay UINT in value + category I3D_genlock + +GetGenlockSourceDelayI3D(hDC, uDelay) + return BOOL + param hDC HDC in value + param uDelay UINT out reference + category I3D_genlock + +QueryGenlockMaxSourceDelayI3D(hDC, uMaxLineDelay, uMaxPixelDelay) + return BOOL + param hDC HDC in value + param uMaxLineDelay UINT out reference + param uMaxPixelDelay UINT out reference + category I3D_genlock + +############################################################################### +# +# Extension #253 +# I3D_image_buffer commands +# +############################################################################### + +CreateImageBufferI3D(hDC, dwSize, uFlags) + return LPVOID + param hDC HDC in value + param dwSize DWORD in value + param uFlags UINT in value + category I3D_image_buffer + +DestroyImageBufferI3D(hDC, pAddress) + return BOOL + param hDC HDC in value + param pAddress LPVOID in value + category I3D_image_buffer + +AssociateImageBufferEventsI3D(hDC, pEvent, pAddress, pSize, count) + return BOOL + param hDC HDC in value + param pEvent HANDLE in array [count] + param pAddress LPVOID in array [count] + param pSize DWORD in array [count] + param count UINT in value + category I3D_image_buffer + +ReleaseImageBufferEventsI3D(hDC, pAddress, count) + return BOOL + param hDC HDC in value + param pAddress LPVOID in array [count] + param count UINT in value + category I3D_image_buffer + +############################################################################### +# +# Extension #254 +# I3D_swap_frame_lock commands +# +############################################################################### + +EnableFrameLockI3D() + return BOOL + category I3D_swap_frame_lock + +DisableFrameLockI3D() + return BOOL + category I3D_swap_frame_lock + +IsEnabledFrameLockI3D(pFlag) + return BOOL + param pFlag BOOL out reference + category I3D_swap_frame_lock + +QueryFrameLockMasterI3D(pFlag) + return BOOL + param pFlag BOOL out reference + category I3D_swap_frame_lock + +############################################################################### +# +# Extension #255 +# I3D_swap_frame_usage commands +# +############################################################################### + +GetFrameUsageI3D(pUsage) + return BOOL + param pUsage float out reference + category I3D_swap_frame_usage + +BeginFrameTrackingI3D() + return BOOL + category I3D_swap_frame_usage + +EndFrameTrackingI3D() + return BOOL + category I3D_swap_frame_usage + +QueryFrameTrackingI3D(pFrameCount, pMissedFrames, pLastMissedUsage) + return BOOL + param pFrameCount DWORD out reference + param pMissedFrames DWORD out reference + param pLastMissedUsage float out reference + category I3D_swap_frame_usage + +############################################################################### +# +# Extension #278 +# ATI_pixel_format_float commands +# +############################################################################### + +# (none) +newcategory: ATI_pixel_format_float + +############################################################################### +# +# Extension #281 +# NV_float_buffer commands +# +############################################################################### + +# (none) +newcategory: NV_float_buffer + +############################################################################### +# +# Extension #313 +# 3DL_stereo_control commands +# +############################################################################### + +SetStereoEmitterState3DL(hDC, uState) + return BOOL + param hDC HDC in value + param uState UINT in value + category 3DL_stereo_control + +############################################################################### +# +# Extension #328 +# EXT_pixel_format_packed_float commands +# +############################################################################### + +# (none) +newcategory: EXT_pixel_format_packed_float + +############################################################################### +# +# Extension #337 +# EXT_framebuffer_sRGB commands +# +############################################################################### + +# (none) +newcategory: EXT_framebuffer_sRGB + +############################################################################### +# +# Extension #347 +# NV_present_video commands +# +############################################################################### + +EnumerateVideoDevicesNV(hDC, phDeviceList) + return int + param hDC HDC in value + param phDeviceList HVIDEOOUTPUTDEVICENV out array + category NV_present_video + +BindVideoDeviceNV(hDC, uVideoSlot, hVideoDevice, piAttribList) + return BOOL + param hDC HDC in value + param uVideoSlot uint in value + param hVideoDevice HVIDEOOUTPUTDEVICENV in value + param piAttribList int in array [COMPSIZE()] + category NV_present_video + +QueryCurrentContextNV(iAttribute, piValue) + return BOOL + param iAttribute int in value + param piValue int out array [COMPSIZE()] + category NV_present_video + +############################################################################### +# +# Extension #349 +# NV_video_output commands +# +############################################################################### + +GetVideoDeviceNV(hDC, numDevices, hVideoDevice) + return BOOL + param hDC HDC in value + param numDevices int in value + param hVideoDevice HPVIDEODEV out reference + category NV_video_output + +ReleaseVideoDeviceNV(hVideoDevice) + return BOOL + param hVideoDevice HPVIDEODEV in value + category NV_video_output + +BindVideoImageNV(hVideoDevice, hPbuffer, iVideoBuffer) + return BOOL + param hVideoDevice HPVIDEODEV in value + param hPbuffer HPBUFFERARB in value + param iVideoBuffer int in value + category NV_video_output + +ReleaseVideoImageNV(hPbuffer, iVideoBuffer) + return BOOL + param hPbuffer HPBUFFERARB in value + param iVideoBuffer int in value + category NV_video_output + +SendPbufferToVideoNV(hPbuffer, iBufferType, pulCounterPbuffer, bBlock) + return BOOL + param hPbuffer HPBUFFERARB in value + param iBufferType int in value + param pulCounterPbuffer ulong out reference + param bBlock BOOL in value + category NV_video_output + +GetVideoInfoNV(hpVideoDevice, pulCounterOutputPbuffer, pulCounterOutputVideo) + return BOOL + param hpVideoDevice HPVIDEODEV in value + param pulCounterOutputPbuffer ulong out reference + param pulCounterOutputVideo ulong out reference + category NV_video_output + +############################################################################### +# +# Extension #351 +# NV_swap_group commands +# +############################################################################### + +JoinSwapGroupNV(hDC, group) + return BOOL + param hDC HDC in value + param group GLuint in value + category NV_swap_group + +BindSwapBarrierNV(group, barrier) + return BOOL + param group GLuint in value + param barrier GLuint in value + category NV_swap_group + +QuerySwapGroupNV(hDC, group, barrier) + return BOOL + param hDC HDC in value + param group GLuint out reference + param barrier GLuint out reference + category NV_swap_group + +QueryMaxSwapGroupsNV(hDC, maxGroups, maxBarriers) + return BOOL + param hDC HDC in value + param maxGroups GLuint out reference + param maxBarriers GLuint out reference + category NV_swap_group + +QueryFrameCountNV(hDC, count) + return BOOL + param hDC HDC in value + param count GLuint out reference + category NV_swap_group + +ResetFrameCountNV(hDC) + return BOOL + param hDC HDC in value + category NV_swap_group + +############################################################################### +# +# Extension #355 +# NV_gpu_affinity commands +# +############################################################################### + +EnumGpusNV(iGpuIndex, phGpu) + return BOOL + param iGpuIndex UINT in value + param phGpu HGPUNV out reference + category NV_gpu_affinity + +EnumGpuDevicesNV(hGpu, iDeviceIndex, lpGpuDevice) + return BOOL + param hGpu HGPUNV in value + param iDeviceIndex UINT in value + param lpGpuDevice PGPU_DEVICE in value + category NV_gpu_affinity + +CreateAffinityDCNV(phGpuList) + return HDC + param phGpuList HGPUNV in array [COMPSIZE()] + category NV_gpu_affinity + +EnumGpusFromAffinityDCNV(hAffinityDC, iGpuIndex, hGpu) + return BOOL + param hAffinityDC HDC in value + param iGpuIndex UINT in value + param hGpu HGPUNV out reference + category NV_gpu_affinity + +DeleteDCNV(hdc) + return BOOL + param hdc HDC in value + category NV_gpu_affinity + +############################################################################### +# +# Extension #361 +# AMD_gpu_association commands +# +############################################################################### + +GetGPUIDsAMD(maxCount, ids) + return UINT + param maxCount UINT in value + param ids UINT out array [maxCount] + category AMD_gpu_association + +GetGPUInfoAMD(id, property, dataType, size, data) + return INT + param id UINT in value + param property int in value + param dataType GLenum in value + param size UINT in value + param data void out array [COMPSIZE(dataType,size)] + category AMD_gpu_association + +GetContextGPUIDAMD(hglrc) + return UINT + param hglrc HGLRC in value + category AMD_gpu_association + +CreateAssociatedContextAMD(id) + return HGLRC + param id UINT in value + category AMD_gpu_association + +CreateAssociatedContextAttribsAMD(id, hShareContext, attribList) + return HGLRC + param id UINT in value + param hShareContext HGLRC in value + param attribList int in array [COMPSIZE()] + category AMD_gpu_association + +DeleteAssociatedContextAMD(hglrc) + return BOOL + param hglrc HGLRC in value + category AMD_gpu_association + +MakeAssociatedContextCurrentAMD(hglrc) + return BOOL + param hglrc HGLRC in value + category AMD_gpu_association + +GetCurrentAssociatedContextAMD() + return HGLRC + category AMD_gpu_association + +BlitContextFramebufferAMD(dstCtx, srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter) + return VOID + param dstCtx HGLRC in value + param srcX0 GLint in value + param srcY0 GLint in value + param srcX1 GLint in value + param srcY1 GLint in value + param dstX0 GLint in value + param dstY0 GLint in value + param dstX1 GLint in value + param dstY1 GLint in value + param mask GLbitfield in value + param filter GLenum in value + category AMD_gpu_association + +############################################################################### +# +# Extension #374 +# NV_video_capture commands +# +############################################################################### + +BindVideoCaptureDeviceNV(uVideoSlot, hDevice) + return BOOL + param uVideoSlot UINT in value + param hDevice HVIDEOINPUTDEVICENV in value + category NV_video_capture + +EnumerateVideoCaptureDevicesNV(hDc, phDeviceList) + return UINT + param hDc HDC in value + param phDeviceList HVIDEOINPUTDEVICENV out reference + category NV_video_capture + +LockVideoCaptureDeviceNV(hDc, hDevice) + return BOOL + param hDc HDC in value + param hDevice HVIDEOINPUTDEVICENV in value + category NV_video_capture + +QueryVideoCaptureDeviceNV(hDc, hDevice, iAttribute, piValue) + return BOOL + param hDc HDC in value + param hDevice HVIDEOINPUTDEVICENV in value + param iAttribute int in value + param piValue int out reference + category NV_video_capture + +ReleaseVideoCaptureDeviceNV(hDc, hDevice) + return BOOL + param hDc HDC in value + param hDevice HVIDEOINPUTDEVICENV in value + category NV_video_capture + +############################################################################### +# +# Extension #376 +# WGL_NV_copy_image commands +# +############################################################################### + +CopyImageSubDataNV(hSrcRC, srcName, srcTarget, srcLevel, srcX, srcY, srcZ, hDstRC, dstName, dstTarget, dstLevel, dstX, dstY, dstZ, width, height, depth) + return BOOL + param hSrcRC HGLRC in value + param srcName GLuint in value + param srcTarget GLenum in value + param srcLevel GLint in value + param srcX GLint in value + param srcY GLint in value + param srcZ GLint in value + param hDstRC HGLRC in value + param dstName GLuint in value + param dstTarget GLenum in value + param dstLevel GLint in value + param dstX GLint in value + param dstY GLint in value + param dstZ GLint in value + param width GLsizei in value + param height GLsizei in value + param depth GLsizei in value + category NV_copy_image + +############################################################################### +# +# Extension #393 +# NV_multisample_coverage commands +# +############################################################################### + +# (none) +newcategory: NV_multisample_coverage diff --git a/xorg-server/hw/xwin/glx/winpriv.c b/xorg-server/hw/xwin/glx/winpriv.c index a35392b26..c689bae08 100644 --- a/xorg-server/hw/xwin/glx/winpriv.c +++ b/xorg-server/hw/xwin/glx/winpriv.c @@ -11,6 +11,8 @@ #include "winpriv.h" #include "winwindow.h" +extern Bool g_fXdmcpEnabled; + void winCreateWindowsWindow (WindowPtr pWin); /** @@ -19,7 +21,8 @@ winCreateWindowsWindow (WindowPtr pWin); */ HWND winGetWindowInfo(WindowPtr pWin) { - winDebug("%s: pWin=%p\n", __FUNCTION__, pWin); + HWND hwnd = NULL; + winDebug("%s:%d pWin=%p\n", __FUNCTION__, __LINE__, pWin); /* a real window was requested */ if (pWin != NULL) @@ -28,12 +31,11 @@ HWND winGetWindowInfo(WindowPtr pWin) 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; + return hwnd; } hwnd = pWinScreen->hwndScreen; @@ -53,17 +55,104 @@ HWND winGetWindowInfo(WindowPtr pWin) if (pWinPriv->hWnd == NULL) { - winCreateWindowsWindow(pWin); - ErrorF("winGetWindowInfo: forcing window to exist...\n"); + if (pWin->parent && pWin->parent->parent) + { + int offsetx; + int offsety; + int ExtraClass=(pWin->realized)?WS_VISIBLE:0; + HWND hWndParent; + WindowPtr pParent=pWin->parent; + while (pParent) + { + winWindowPriv(pParent); + hWndParent=pWinPriv->hWnd; + if (hWndParent) + break; + pParent=pParent->parent; + } + if (!hWndParent) + hWndParent=hwnd; + if (pParent) + { + offsetx=pParent->drawable.x; + offsety=pParent->drawable.y; + } + else + { + offsetx=0; + offsety=0; + } + pWinPriv->hWnd=CreateWindowExA(WS_EX_TRANSPARENT, + WIN_GL_WINDOW_CLASS, + "", + WS_CHILD |WS_CLIPSIBLINGS | WS_CLIPCHILDREN | ExtraClass, + pWin->drawable.x-offsetx, + pWin->drawable.y-offsety, + pWin->drawable.width, + pWin->drawable.height, + hWndParent, + NULL, + GetModuleHandle(NULL), + NULL); + winDebug("Window created %x %x %d %d %d %d\n",pWinPriv->hWnd,hWndParent,pWin->drawable.x-offsetx,pWin->drawable.y-offsety,pWin->drawable.width, pWin->drawable.height); + pWinPriv->GlCtxWnd=TRUE; + } + else + { + winCreateWindowsWindow(pWin); + winDebug("winGetWindowInfo: forcing window to exist...\n"); + } } - if (pWinPriv->hWnd != NULL) - { + { /* copy window handle */ hwnd = pWinPriv->hWnd; - } + } + } + else if (g_fXdmcpEnabled) + { + winWindowPriv(pWin); - return hwnd; + if (pWinPriv == NULL) + { + ErrorF("winGetWindowInfo: window has no privates\n"); + return hwnd; + } + if (pWinPriv->hWnd == NULL) + { + if (!((pWin->drawable.x==0) && + (pWin->drawable.y==0) && + (pWin->drawable.width==pScreen->width) && + (pWin->drawable.height==pScreen->height) + ) + ) + { + int ExtraClass=(pWin->realized)?WS_VISIBLE:0; + pWinPriv->hWnd=CreateWindowExA(WS_EX_TRANSPARENT, + WIN_GL_WINDOW_CLASS, + "", + WS_CHILD |WS_CLIPSIBLINGS | WS_CLIPCHILDREN | ExtraClass, + pWin->drawable.x, + pWin->drawable.y, + pWin->drawable.width, + pWin->drawable.height, + pWinScreen->hwndScreen, + NULL, + GetModuleHandle(NULL), + NULL); + pWinPriv->GlCtxWnd=TRUE; + /* copy size and window handle */ + hwnd = pWinPriv->hWnd; + } + else + { + hwnd = pWinScreen->hwndScreen; + } + } + else + { + hwnd = pWinPriv->hWnd; + } } #endif #ifdef XWIN_MULTIWINDOWEXTWM @@ -75,7 +164,6 @@ HWND winGetWindowInfo(WindowPtr pWin) if (pRLWinPriv == NULL) { ErrorF("winGetWindowInfo: window has no privates\n"); - return hwnd; } if (pRLWinPriv->hWnd != NULL) @@ -83,7 +171,6 @@ HWND winGetWindowInfo(WindowPtr pWin) /* copy window handle */ hwnd = pRLWinPriv->hWnd; } - return hwnd; } #endif } @@ -95,15 +182,16 @@ HWND winGetWindowInfo(WindowPtr pWin) if (pWinScreen == NULL) { ErrorF("winGetWindowInfo: screen has no privates\n"); - return NULL; } + else + { + winDebug("winGetWindowInfo: returning root window\n"); - ErrorF("winGetWindowInfo: returning root window\n"); - - return pWinScreen->hwndScreen; + hwnd=pWinScreen->hwndScreen; + } } - return NULL; + return hwnd; } Bool @@ -122,5 +210,8 @@ winCheckScreenAiglxIsSupported(ScreenPtr pScreen) return TRUE; #endif + if (g_fXdmcpEnabled) + return TRUE; + return FALSE; } diff --git a/xorg-server/hw/xwin/glx/winpriv.h b/xorg-server/hw/xwin/glx/winpriv.h index dce1edf48..710525ccc 100644 --- a/xorg-server/hw/xwin/glx/winpriv.h +++ b/xorg-server/hw/xwin/glx/winpriv.h @@ -7,5 +7,7 @@ #include <X11/Xwindows.h> #include <windowstr.h> +#define WIN_GL_WINDOW_CLASS "XWinGLTest" + HWND winGetWindowInfo(WindowPtr pWin); Bool winCheckScreenAiglxIsSupported(ScreenPtr pScreen); diff --git a/xorg-server/hw/xwin/makefile b/xorg-server/hw/xwin/makefile new file mode 100644 index 000000000..d6940dbaf --- /dev/null +++ b/xorg-server/hw/xwin/makefile @@ -0,0 +1,164 @@ +LIBRARY = libXWin + +XWIN_MULTIWINDOW=1 +XWIN_CLIPBOARD=1 +XWIN_MULTIWINDOWEXTWM=0 # currently not working correctly +XWIN_MULTIWINDOWINTWM=0 # currently not working correctly +XWIN_RANDR=1 +XWIN_NATIVEGDI=0 # currently not working correctly +XWIN_PRIMARYFB=0 # currently not working correctly +XWIN_GLX_WINDOWS=0 # everything is in the glx makefile + +if XWIN_CLIPBOARD +SRCS_CLIPBOARD = \ + winclipboardinit.c \ + winclipboardtextconv.c \ + winclipboardthread.c \ + winclipboardunicode.c \ + winclipboardwndproc.c \ + winclipboardwrappers.c \ + winclipboardxevents.c +DEFS_CLIPBOARD = -DXWIN_CLIPBOARD +endif + +if XWIN_GLX_WINDOWS +GLX_DIR = glx +DEFS_GLX_WINDOWS = -DXWIN_GLX_WINDOWS +XWIN_GLX_LIBS = $(top_builddir)/hw/xwin/glx/libXwinGLX.la +XWIN_GLX_LINK_FLAGS = -lopengl32 +endif + +if XWIN_MULTIWINDOW +SRCS_MULTIWINDOW = \ + winmultiwindowshape.c \ + winmultiwindowwindow.c \ + winmultiwindowwm.c \ + winmultiwindowwndproc.c +DEFS_MULTIWINDOW = -DXWIN_MULTIWINDOW +endif + +if XWIN_MULTIWINDOWEXTWM +SRCS_MULTIWINDOWEXTWM = \ + winwin32rootless.c \ + winwin32rootlesswindow.c \ + winwin32rootlesswndproc.c \ + winwindowswm.c +DEFS_MULTIWINDOWEXTWM = -DXWIN_MULTIWINDOWEXTWM +MULTIWINDOWEXTWM_LIBS = $(top_builddir)/miext/rootless/librootless.la +endif + +if XWIN_NATIVEGDI +SRCS_NATIVEGDI = \ + winclip.c \ + winfillsp.c \ + winfont.c \ + wingc.c \ + wingetsp.c \ + winnativegdi.c \ + winpixmap.c \ + winpolyline.c \ + winrop.c \ + winsetsp.c +DEFS_NATIVEGDI = -DXWIN_NATIVEGDI +endif + +if XWIN_PRIMARYFB +SRCS_PRIMARYFB = \ + winpfbdd.c +DEFS_PRIMARYFB = -DXWIN_PRIMARYFB +endif + +if XWIN_RANDR +SRCS_RANDR = \ + winrandr.c +DEFS_RANDR = -DXWIN_RANDR +endif + +if XWIN_XV +SRCS_XV = \ + winvideo.c +DEFS_XV = -DXWIN_XV +endif + +SRCS = InitInput.c \ + InitOutput.c \ + winallpriv.c \ + winauth.c \ + winblock.c \ + wincmap.c \ + winconfig.c \ + wincreatewnd.c \ + wincursor.c \ + windialogs.c \ + winengine.c \ + winerror.c \ + winglobals.c \ + winkeybd.c \ + winkeyhook.c \ + winmisc.c \ + winmonitors.c \ + winmouse.c \ + winmsg.c \ + winmultiwindowclass.c \ + winmultiwindowicons.c \ + winprefs.c \ + winprefsyacc.y \ + winprefslex.l \ + winprocarg.c \ + winregistry.c \ + winscrinit.c \ + winshaddd.c \ + winshadddnl.c \ + winshadgdi.c \ + wintrayicon.c \ + winvalargs.c \ + winwakeup.c \ + winwindow.c \ + winwndproc.c \ + ddraw.h \ + winclipboard.h \ + winconfig.h \ + win.h \ + winkeybd.h \ + winkeynames.h \ + winlayouts.h \ + winmessages.h \ + winmsg.h \ + winms.h \ + winmultiwindowclass.h \ + winprefs.h \ + winresource.h \ + winwindow.h \ + windisplay.c \ + XWin.rc \ + $(SRCS_CLIPBOARD) \ + $(SRCS_MULTIWINDOW) \ + $(SRCS_MULTIWINDOWEXTWM) \ + $(SRCS_NATIVEGDI) \ + $(SRCS_PRIMARYFB) \ + $(SRCS_RANDR) \ + $(SRCS_XV) \ + xdmcphostselect.c + +CSRCS=$(filter %.c,$(SRCS)) $(filter %.y,$(SRCS)) $(filter %.l,$(SRCS)) +CSRCS := $(CSRCS:%.y=%.c) +CSRCS := $(CSRCS:%.l=%.c) + + DEFS = $(DEFS_CLIPBOARD) \ + $(DEFS_GLX_WINDOWS) \ + $(DEFS_MULTIWINDOW) \ + $(DEFS_MULTIWINDOWEXTWM) \ + $(DEFS_NATIVEGDI) \ + $(DEFS_PRIMARYFB) \ + $(DEFS_RANDR) \ + $(DEFS_XV) + +DEFINES += $(DEFS:-D%=%) HAVE_XWIN_CONFIG_H PTW32_STATIC_LIB RELOCATE_PROJECTROOT + +INCLUDES += ..\..\miext\rootless + +INCLUDES += $(OBJDIR) + +$(OBJDIR)\winprefslex.c $(OBJDIR)\winprefsyacc.c $(OBJDIR)\winprefsyacc.h: winprefslex.l winprefsyacc.y + doflexbison.bat $(subst \,/,$(OBJDIR)) + diff --git a/xorg-server/hw/xwin/man/XWin.man b/xorg-server/hw/xwin/man/XWin.man index aad29cf25..8d8b0a9ab 100644 --- a/xorg-server/hw/xwin/man/XWin.man +++ b/xorg-server/hw/xwin/man/XWin.man @@ -1,398 +1,398 @@ -.TH XWIN 1 __vendorversion__ -.SH NAME -XWin \- X Server for the Cygwin environment on Microsoft Windows - - -.SH SYNOPSIS -.B XWin -[ options ] ... - - -.SH DESCRIPTION -\fIXWin\fP is an X Server for the X Window System on the Cygwin environment -running on Microsoft Windows. - - -.SH MODES -\fIXWin\fP can operate in 3 different modes: -.br -* \fISingle Window\fP: This is the default mode. Each X screen -appears as a single \fIWindows\fP window and all X windows are contained -within this window. -(In X terminology, the \fIWindows\fP window contains the root window for -the screen) -.br -* \fIMulti-Window\fP: In this mode \fIXWin\fP uses its own integrated -window manager in order to handle the top-level X windows, in such a -way that they appear as normal \fIWindows\fP windows. -.br -* \fIRootless\fP: In this mode the X server works in a window -containing the whole screen but this root window (traditionally covered with an X hatch -pattern) is hidden from view, so only top-level X windows are seen. - -.SH OPTIONS -In addition to the normal server options described in the \fIXserver(1)\fP -manual page, \fIXWin\fP accepts the following command line switches, -\fIall\fP of which are optional: - -.SH OPTIONS CONTROLLING WINDOWING MODE -Only one of these options may be specified. -.TP 8 -.B (default) -Windowed or rooted mode. -Each X screen appears as a single \fIWindows\fP window and all X windows are -contained within those windows. -.TP 8 -.B \-multiwindow -Each top-level X window appears in its own \fIWindows\fP window. -Also start the integrated \fIWindows\fP-based window manager. -.TP 8 -.B \-rootless -Run the server in rootless mode. -The X server works on a window covering the whole screen but the root window -is hidden from view. -.TP 8 -.B \-mwextwm -Experimental. -The mode combines \fB\-rootless\fP mode drawing with native \fIWindows\fP -window frames managed by the experimental external window manager \fIxwinwm\fP. -.PP -\fBNOTE:\fP \fI-multiwindow\fP mode uses its own internal window manager. -All other modes require an external window manager in order to move, resize, and perform other -operations on the individual X windows. - -.SH OPTIONS FOR SPECIFYING X SCREENS -An X display may be composed of multiple screens. -The default behaviour is to create a single screen 0 that is roughly the -size of useful area of the primary monitor (allowing for any window -decorations and the task-bar). - -Screen specific parameters can be applied as a -default to all screens by placing those screen specific parameters -before any \fB\-screen\fP parameter. Screen specific parameters placed after -the first \fB\-screen\fP parameter will apply only to the immediately -preceeding \fB\-screen\fP parameter. -.TP 8 -.B \-[no]multimonitors or \-[no]multiplemonitors -Create a screen 0 that covers all monitors [the primary monitor] on a system with -multiple monitors. -This option is currently enabled by default in \fB\-multiwindow\fP mode. -.TP 8 -.B "\-screen \fIscreen_number\fP [\fIW\fP \fIH\fP [\fIX\fP \fIY\fP] | [[\fIW\fPx\fIH\fP[+\fIX\fP+\fIY\fP]][@\fIM\fP]] ] " -Create screen number -.I screen_number -and optionally specify it's -.I height, -.I width -and -.I initial position. -Additionally a -.I -monitor number -(which count from 1) can be specified to place the screen on, -at which point, all coordinates become relative to that monitor. -Screen numbers must be contiguous starting from zero and cannot be duplicated. - -Examples: - -.I " -screen 0 @1 ; on 1st monitor using its full resolution (the default)" - -.I " -screen 0 800x600+100+100@2 ; on 2nd monitor offset 100,100 size 800x600" - -.I " -screen 0 1024x768@3 ; on 3rd monitor size 1024x768" - -.SH OPTIONS CONTROLLING THE APPEARANCE OF THE X SCREEN WINDOWS -These parameters only apply to windowed mode screens i.e. not -in \fB-multiwindow\fP or \fB-rootless\fP mode. -.TP 8 -.B "\-fullscreen" -The X server window takes the full screen, covering completely the -\fIWindows\fP desktop. -Currently \fB\-fullscreen\fP may only be applied to one X screen. -.TP 8 -.B \-nodecoration -Do not give the Cygwin/X window a \fIWindows\fP window border, title bar, -etc. -This parameter is ignored when the \fB\-fullscreen\fP parameter is specified. -.TP 8 -.B \-scrollbars -Alternative name for \fB\-resize=scrollbars\fP. - -.SH OPTIONS CONTROLLING RESIZE BEHAVIOUR -.TP 8 -.B \-resize[=none|scrollbars|randr] -Select the resize mode of an X screen. - -.RS -.IP \fB\-resize=none\fP 8 -(default). The screen is not resizable. - -In windowed mode, if the window has decorations, a fixed frame is used. - -.IP \fB\-resize=scrollbars\fP 8 -The screen window is resizeable, but the screen is not resizable. - -In windowed mode, if the window has decorations, a resizing frame is used. -Scrollbars are drawn when needed to allow the entire X screen -to viewed by adjusting them. - -This also permits screens bigger than the \fIWindows\fP virtual desktop to be used. - -This parameter is ignored in \fB-multiwindow\fP or \fB-rootless\fP mode. -Alternative name is \fB\-scrollbars\fP. - -.IP \fB\-resize=randr\fP 8 -The screen is resizable and the screen window is resizeable. - -In windowed mode, if the window has decorations, a resizing frame is used. - -Resizing the \fIWindows\fP window will use the RANDR extension to change -the size of the X screen. Likewise, changing the size of -the X screen using the RANDR extension will cause the size -of the \fIWindows\fP window containing the X screen to be changed. - -In \fB-multiwindow\fP or \fB-rootless\fP mode, if the X screen is -of the same dimensions as a Windows monitor or the virtual desktop, -the X server will respond to the WM_DISPLAYCHANGED sent when those -dimensions change by resizing the X screen. Changing the size -of the X screen using the RANDR extension is not permitted. - -The maximum dimensions of the screen are the dimensions of the \fIWindows\fP virtual desktop. - -.IP \fB\--resize\fP 8 -on its own is equivalent to \fB\--resize=randr\fP -.RE - -.SH OPTIONS CONTROLLING WINDOWS INTEGRATION -.TP 8 -.B \-[no]clipboard -Enables [disables] the integration between the Cygwin/X clipboard and -\fIWindows\fP clipboard. The default is enabled. -.TP 8 -.B "\-emulate3buttons [\fItimeout\fP]" -Emulate a three button mouse; pressing both buttons within -.I timeout -milliseconds causes an emulated middle button press. The default -.I timeout -is 50 milliseconds. Note that most mice with scroll wheel have middle -button functionality, usually you will need this option only if you have -a two button mouse without scroll wheel. -.TP 8 -.B \-[no]keyhook -Enable [disable] a low-level keyboard hook for catching -special keypresses like Menu and Alt+Tab and passing them to the X -Server instead of letting \fIWindows\fP handle them. -.TP 8 -.B \-lesspointer -Normally the \fIWindows\fP mouse cursor is hidden when the mouse is -over an active Cygwin/X window. This option causes the mouse cursor -also to be hidden when it is over an inactive Cygwin/X window. This -prevents the \fIWindows\fP mouse cursor from being drawn on top of the X -cursor. -This parameter has no effect unless \fB-swcursor\fP is also specified. -.TP 8 -.B \-swcursor -Disable the usage of the \fIWindows\fP cursor and use the X11 software cursor instead. -.TP 8 -.B \-[no]trayicon -Do not create a tray icon. Default is to create one -icon per screen. You can globally disable tray icons with -\fB\-notrayicon\fP, then enable it for specific screens with -\fB\-trayicon\fP for those screens. -.TP 8 -.B \-nounicodeclipboard -Do not use Unicode clipboard even if on a NT-based platform. -.TP 8 -.B \-[no]unixkill -Enable or disable the \fICtrl-Alt-Backspace\fP key combination as a -signal to exit the X Server. The \fICtrl-Alt-Backspace\fP key combination -is disabled by default. -.TP 8 -.B \-[no]winkill -Enable or disable the \fIAlt-F4\fP key combination as a signal to exit the -X Server. -The \fIAlt-F4\fP key combination is enabled by default. - -.SH DRAWING ENGINE OPTIONS -.TP 8 -.B "\-clipupdates \fInum_boxes\fP" -Specify an optional threshold, above which the regions in a shadow -update operation will be collected into a GDI clipping region. The -clipping region is then used to do a single bit block transfer that is -constrained to the updated area by the clipping region. There is some -overhead involved in creating, installing, destroying, and removing -the clipping region, thus there may not be much benefit for a small -number of boxes (less than 10). It is even possible that this -functionality does not provide a benefit at any number of boxes; we -can only determine the usefulness of this feature through testing. -This option probably has limited effect on current \fIWindows\fP versions -as they already perform GDI batching. -This parameter works in conjunction with engines 1, 2, and 4 (Shadow -GDI, Shadow DirectDraw, and Shadow DirectDraw Non-Locking, -respectively). -.TP 8 -.B "\-engine \fIengine_type_id\fP" -This option, which is intended for Cygwin/X developers, -overrides the server's automatically selected drawing engine type. This -parameter will be ignored if the specified drawing engine type is not -supported on the current system. - -Default behavior is to select the drawing engine with optimum performance that -supports the specified depth and window configuration. - -The engine type ids are: -.RS -.IP 1 4 -Shadow GDI -.IP 2 4 -Shadow DirectDraw -.IP 4 4 -Shadow DirectDraw Non-Locking -.IP 8 4 -Primary DirectDraw (unsupported, obsolete) -.IP 16 4 -Native GDI (unsupported, experimental and barely functional) -.RE - -.SH FULLSCREEN OPTIONS -.TP 8 -.B "\-depth \fIdepth\fP" -Specify the color depth, in bits per pixel, to use when running in -fullscreen with a DirectDraw engine. This parameter is ignored if -\fB\-fullscreen\fP is not specified. -.TP 8 -.B "\-refresh \fIrate_in_Hz\fP" -Specify an optional refresh rate to use when running in -fullscreen with a DirectDraw engine. This parameter is ignored if -\fB\-fullscreen\fP is not specified. - -.SH MISCELLANEOUS OPTIONS -See also the normal server options described in the \fIXserver(1)\fP -manual page - -.TP 8 -.B \-help -Write a help text listing supported command line options and their description to the console. -.TP 8 -.B \-ignoreinput -Ignore keyboard and mouse input. This is usually only used for testing -and debugging purposes. -.TP 8 -.B "\-logfile \fIfilename\fP" -Change the server log file from the default of \fI -__logdir__/XWin.n.log\fP, -where \fIn\fP is the display number of the XWin server, to \fIfilename\fP. -.TP 8 -.B "\-logverbose \fIlevel\fP" -Control the degree of verbosity of the log messages with the integer -parameter \fIlevel\fP. For \fIlevel\fP=0 only fatal errors are -reported, for \fIlevel\fP=1 simple information about -configuration is also given, for \fIlevel\fP=2 (default) -additional runtime information is recorded -and for \fIlevel\fP=3 detailed log -information (including trace and debug output) is produced. Bigger -values will yield a still more detailed debug output. -.TP 8 -.B \-silent-dup-error -If another instance of \fIXWin\fP with the same display number is found running, -exit silently and don't display any error message. -.TP 8 -.B "\-xkblayout \fIlayout\fP" -.TP 8 -.B "\-xkbmodel \fImodel\fP" -.TP 8 -.B "\-xkboptions \fIoption\fP" -.TP 8 -.B "\-xkbrules \fIrule\fP" -.TP 8 -.B "\-xkbvariant \fIvariant\fp" -These options configure the xkeyboard extension to load -a particular keyboard map as the X server starts. The behavior is similar -to the \fIsetxkbmap\fP program. The layout data is located at \fI -__datadir__/X11/xkb/\fP. Additional information is found in the -README files therein and in the man page of \fIsetxkbmap\fP. For example -in order to load a German layout for a pc105 keyboard one uses -the options: -.br -.I " \-xkblayout de \-xkbmodel pc105" - -Alternatively one may use the \fIsetxkbmap\fP program after \fIXWin\fP is -running. - -The default is to select a configuration matching your current layout as -reported by \fIWindows\fP, if known, or the default X server configuration -if no matching keyboard configuration was found. - -.SH UNDOCUMENTED OPTIONS -These options are undocumented. Do not use them. - -.TP 8 -.B \-emulatepseudo -Create a depth 8 PseudoColor visual when running in depths 15, 16, 24, -or 32, collectively known as TrueColor depths. -Color map manipulation is not supported, so the PseudoColor visual will -not have the correct colors. -This option is intended to allow applications which only work with a depth 8 -visual to operate in TrueColor modes. -.TP 8 -.B \-internalwm -Run the internal window manager. - -.SH LOG FILE -As it runs \fIXWin\fP writes messages indicating the most relevant events -to the console -from which it was called and to a log file that by default is located at \fI -__logdir__/XWin.0.log\fP. This file is mainly for debugging purposes. - - -.SH PREFERENCES FILE -On startup \fIXWin\fP looks for the file \fI$HOME/.XWinrc\fP or, if -the previous file does not exist, \fI -__sysconfdir__/X11/system.XWinrc\fP. \fI.XWinrc\fP allows setting -preferences for the following: -.br -* To include items into the menu associated with the \fIXWin\fP icon -which is in the \fIWindows\fP system tray. This functions in all -modes that have a tray icon. -.br -* To include items in the system menu which is associated with the \fIWindows\fP -window that \fIXWin -multiwindow\fP produces for each top-level X -window, in both the generic case and for particular programs. -.br -* To change the icon that is associated to the \fIWindows\fP window that -\fIXWin -multiwindow\fP produces for each top-level X-window. -.br -* To change the style that is associated to the \fIWindows\fP window that -\fXWin I-multiwindow\fP produces for each top-level X window. -.PP -The format of the \fI.XWinrc\fP file is given in the man page XWinrc(5). - -.SH EXAMPLES -Need some examples - - -.SH "SEE ALSO" -X(__miscmansuffix__), Xserver(1), xdm(1), xinit(1), XWinrc(__filemansuffix__), setxkbmap(1) - - -.SH BUGS -.I XWin -and this man page still have many limitations. - -The \fIXWin\fP software is continuously developing; it is therefore possible that -this man page is not up to date. It is always prudent to -look also at the output of \fIXWin -help\fP in order to -check the options that are operative. - - -.SH AUTHORS -This list is by no means complete, but direct contributors to the -Cygwin/X project include (in alphabetical order by last name): Stuart -Adamson, Michael Bax, Jehan Bing, Lev Bishop, Dr. Peter Busch, Biju G -C, Robert Collins, Nick Crabtree, Early Ehlinger, Christopher Faylor, -John Fortin, Brian Genisio, Fabrizio Gennari, Alexander Gottwald, Ralf -Habacker, Colin Harrison, Matthieu Herrb, Alan Hourihane, Pierre A -Humblet, Harold L Hunt II, Dakshinamurthy Karra, Joe Krahn, -Paul Loewenstein, Kensuke Matsuzaki, -Takuma Murakami, Earle F. Philhower III, Benjamin Riefenstahl, Yaakov Selkowitz, -Suhaib Siddiqi, Jack Tanner, Jon Turney and Nicholas Wourms. +.TH XWIN 1 __vendorversion__
+.SH NAME
+XWin \- X Server for the Cygwin environment on Microsoft Windows
+
+
+.SH SYNOPSIS
+.B XWin
+[ options ] ...
+
+
+.SH DESCRIPTION
+\fIXWin\fP is an X Server for the X Window System on the Cygwin environment
+running on Microsoft Windows.
+
+
+.SH MODES
+\fIXWin\fP can operate in 3 different modes:
+.br
+* \fISingle Window\fP: This is the default mode. Each X screen
+appears as a single \fIWindows\fP window and all X windows are contained
+within this window.
+(In X terminology, the \fIWindows\fP window contains the root window for
+the screen)
+.br
+* \fIMulti-Window\fP: In this mode \fIXWin\fP uses its own integrated
+window manager in order to handle the top-level X windows, in such a
+way that they appear as normal \fIWindows\fP windows.
+.br
+* \fIRootless\fP: In this mode the X server works in a window
+containing the whole screen but this root window (traditionally covered with an X hatch
+pattern) is hidden from view, so only top-level X windows are seen.
+
+.SH OPTIONS
+In addition to the normal server options described in the \fIXserver(1)\fP
+manual page, \fIXWin\fP accepts the following command line switches,
+\fIall\fP of which are optional:
+
+.SH OPTIONS CONTROLLING WINDOWING MODE
+Only one of these options may be specified.
+.TP 8
+.B (default)
+Windowed or rooted mode.
+Each X screen appears as a single \fIWindows\fP window and all X windows are
+contained within those windows.
+.TP 8
+.B \-multiwindow
+Each top-level X window appears in its own \fIWindows\fP window.
+Also start the integrated \fIWindows\fP-based window manager.
+.TP 8
+.B \-rootless
+Run the server in rootless mode.
+The X server works on a window covering the whole screen but the root window
+is hidden from view.
+.TP 8
+.B \-mwextwm
+Experimental.
+The mode combines \fB\-rootless\fP mode drawing with native \fIWindows\fP
+window frames managed by the experimental external window manager \fIxwinwm\fP.
+.PP
+\fBNOTE:\fP \fI-multiwindow\fP mode uses its own internal window manager.
+All other modes require an external window manager in order to move, resize, and perform other
+operations on the individual X windows.
+
+.SH OPTIONS FOR SPECIFYING X SCREENS
+An X display may be composed of multiple screens.
+The default behaviour is to create a single screen 0 that is roughly the
+size of useful area of the primary monitor (allowing for any window
+decorations and the task-bar).
+
+Screen specific parameters can be applied as a
+default to all screens by placing those screen specific parameters
+before any \fB\-screen\fP parameter. Screen specific parameters placed after
+the first \fB\-screen\fP parameter will apply only to the immediately
+preceeding \fB\-screen\fP parameter.
+.TP 8
+.B \-[no]multimonitors or \-[no]multiplemonitors
+Create a screen 0 that covers all monitors [the primary monitor] on a system with
+multiple monitors.
+This option is currently enabled by default in \fB\-multiwindow\fP mode.
+.TP 8
+.B "\-screen \fIscreen_number\fP [\fIW\fP \fIH\fP [\fIX\fP \fIY\fP] | [[\fIW\fPx\fIH\fP[+\fIX\fP+\fIY\fP]][@\fIM\fP]] ] "
+Create screen number
+.I screen_number
+and optionally specify it's
+.I height,
+.I width
+and
+.I initial position.
+Additionally a
+.I
+monitor number
+(which count from 1) can be specified to place the screen on,
+at which point, all coordinates become relative to that monitor.
+Screen numbers must be contiguous starting from zero and cannot be duplicated.
+
+Examples:
+
+.I " -screen 0 @1 ; on 1st monitor using its full resolution (the default)"
+
+.I " -screen 0 800x600+100+100@2 ; on 2nd monitor offset 100,100 size 800x600"
+
+.I " -screen 0 1024x768@3 ; on 3rd monitor size 1024x768"
+
+.SH OPTIONS CONTROLLING THE APPEARANCE OF THE X SCREEN WINDOWS
+These parameters only apply to windowed mode screens i.e. not
+in \fB-multiwindow\fP or \fB-rootless\fP mode.
+.TP 8
+.B "\-fullscreen"
+The X server window takes the full screen, covering completely the
+\fIWindows\fP desktop.
+Currently \fB\-fullscreen\fP may only be applied to one X screen.
+.TP 8
+.B \-nodecoration
+Do not give the Cygwin/X window a \fIWindows\fP window border, title bar,
+etc.
+This parameter is ignored when the \fB\-fullscreen\fP parameter is specified.
+.TP 8
+.B \-scrollbars
+Alternative name for \fB\-resize=scrollbars\fP.
+
+.SH OPTIONS CONTROLLING RESIZE BEHAVIOUR
+.TP 8
+.B \-resize[=none|scrollbars|randr]
+Select the resize mode of an X screen.
+
+.RS
+.IP \fB\-resize=none\fP 8
+(default). The screen is not resizable.
+
+In windowed mode, if the window has decorations, a fixed frame is used.
+
+.IP \fB\-resize=scrollbars\fP 8
+The screen window is resizeable, but the screen is not resizable.
+
+In windowed mode, if the window has decorations, a resizing frame is used.
+Scrollbars are drawn when needed to allow the entire X screen
+to viewed by adjusting them.
+
+This also permits screens bigger than the \fIWindows\fP virtual desktop to be used.
+
+This parameter is ignored in \fB-multiwindow\fP or \fB-rootless\fP mode.
+Alternative name is \fB\-scrollbars\fP.
+
+.IP \fB\-resize=randr\fP 8
+The screen is resizable and the screen window is resizeable.
+
+In windowed mode, if the window has decorations, a resizing frame is used.
+
+Resizing the \fIWindows\fP window will use the RANDR extension to change
+the size of the X screen. Likewise, changing the size of
+the X screen using the RANDR extension will cause the size
+of the \fIWindows\fP window containing the X screen to be changed.
+
+In \fB-multiwindow\fP or \fB-rootless\fP mode, if the X screen is
+of the same dimensions as a Windows monitor or the virtual desktop,
+the X server will respond to the WM_DISPLAYCHANGED sent when those
+dimensions change by resizing the X screen. Changing the size
+of the X screen using the RANDR extension is not permitted.
+
+The maximum dimensions of the screen are the dimensions of the \fIWindows\fP virtual desktop.
+
+.IP \fB\--resize\fP 8
+on its own is equivalent to \fB\--resize=randr\fP
+.RE
+
+.SH OPTIONS CONTROLLING WINDOWS INTEGRATION
+.TP 8
+.B \-[no]clipboard
+Enables [disables] the integration between the Cygwin/X clipboard and
+\fIWindows\fP clipboard. The default is enabled.
+.TP 8
+.B "\-emulate3buttons [\fItimeout\fP]"
+Emulate a three button mouse; pressing both buttons within
+.I timeout
+milliseconds causes an emulated middle button press. The default
+.I timeout
+is 50 milliseconds. Note that most mice with scroll wheel have middle
+button functionality, usually you will need this option only if you have
+a two button mouse without scroll wheel.
+.TP 8
+.B \-[no]keyhook
+Enable [disable] a low-level keyboard hook for catching
+special keypresses like Menu and Alt+Tab and passing them to the X
+Server instead of letting \fIWindows\fP handle them.
+.TP 8
+.B \-lesspointer
+Normally the \fIWindows\fP mouse cursor is hidden when the mouse is
+over an active Cygwin/X window. This option causes the mouse cursor
+also to be hidden when it is over an inactive Cygwin/X window. This
+prevents the \fIWindows\fP mouse cursor from being drawn on top of the X
+cursor.
+This parameter has no effect unless \fB-swcursor\fP is also specified.
+.TP 8
+.B \-swcursor
+Disable the usage of the \fIWindows\fP cursor and use the X11 software cursor instead.
+.TP 8
+.B \-[no]trayicon
+Do not create a tray icon. Default is to create one
+icon per screen. You can globally disable tray icons with
+\fB\-notrayicon\fP, then enable it for specific screens with
+\fB\-trayicon\fP for those screens.
+.TP 8
+.B \-nounicodeclipboard
+Do not use Unicode clipboard even if on a NT-based platform.
+.TP 8
+.B \-[no]unixkill
+Enable or disable the \fICtrl-Alt-Backspace\fP key combination as a
+signal to exit the X Server. The \fICtrl-Alt-Backspace\fP key combination
+is disabled by default.
+.TP 8
+.B \-[no]winkill
+Enable or disable the \fIAlt-F4\fP key combination as a signal to exit the
+X Server.
+The \fIAlt-F4\fP key combination is enabled by default.
+
+.SH DRAWING ENGINE OPTIONS
+.TP 8
+.B "\-clipupdates \fInum_boxes\fP"
+Specify an optional threshold, above which the regions in a shadow
+update operation will be collected into a GDI clipping region. The
+clipping region is then used to do a single bit block transfer that is
+constrained to the updated area by the clipping region. There is some
+overhead involved in creating, installing, destroying, and removing
+the clipping region, thus there may not be much benefit for a small
+number of boxes (less than 10). It is even possible that this
+functionality does not provide a benefit at any number of boxes; we
+can only determine the usefulness of this feature through testing.
+This option probably has limited effect on current \fIWindows\fP versions
+as they already perform GDI batching.
+This parameter works in conjunction with engines 1, 2, and 4 (Shadow
+GDI, Shadow DirectDraw, and Shadow DirectDraw Non-Locking,
+respectively).
+.TP 8
+.B "\-engine \fIengine_type_id\fP"
+This option, which is intended for Cygwin/X developers,
+overrides the server's automatically selected drawing engine type. This
+parameter will be ignored if the specified drawing engine type is not
+supported on the current system.
+
+Default behavior is to select the drawing engine with optimum performance that
+supports the specified depth and window configuration.
+
+The engine type ids are:
+.RS
+.IP 1 4
+Shadow GDI
+.IP 2 4
+Shadow DirectDraw
+.IP 4 4
+Shadow DirectDraw Non-Locking
+.IP 8 4
+Primary DirectDraw (unsupported, obsolete)
+.IP 16 4
+Native GDI (unsupported, experimental and barely functional)
+.RE
+
+.SH FULLSCREEN OPTIONS
+.TP 8
+.B "\-depth \fIdepth\fP"
+Specify the color depth, in bits per pixel, to use when running in
+fullscreen with a DirectDraw engine. This parameter is ignored if
+\fB\-fullscreen\fP is not specified.
+.TP 8
+.B "\-refresh \fIrate_in_Hz\fP"
+Specify an optional refresh rate to use when running in
+fullscreen with a DirectDraw engine. This parameter is ignored if
+\fB\-fullscreen\fP is not specified.
+
+.SH MISCELLANEOUS OPTIONS
+See also the normal server options described in the \fIXserver(1)\fP
+manual page
+
+.TP 8
+.B \-help
+Write a help text listing supported command line options and their description to the console.
+.TP 8
+.B \-ignoreinput
+Ignore keyboard and mouse input. This is usually only used for testing
+and debugging purposes.
+.TP 8
+.B "\-logfile \fIfilename\fP"
+Change the server log file from the default of \fI
+__logdir__/XWin.n.log\fP,
+where \fIn\fP is the display number of the XWin server, to \fIfilename\fP.
+.TP 8
+.B "\-logverbose \fIlevel\fP"
+Control the degree of verbosity of the log messages with the integer
+parameter \fIlevel\fP. For \fIlevel\fP=0 only fatal errors are
+reported, for \fIlevel\fP=1 simple information about
+configuration is also given, for \fIlevel\fP=2 (default)
+additional runtime information is recorded
+and for \fIlevel\fP=3 detailed log
+information (including trace and debug output) is produced. Bigger
+values will yield a still more detailed debug output.
+.TP 8
+.B \-silent-dup-error
+If another instance of \fIXWin\fP with the same display number is found running,
+exit silently and don't display any error message.
+.TP 8
+.B "\-xkblayout \fIlayout\fP"
+.TP 8
+.B "\-xkbmodel \fImodel\fP"
+.TP 8
+.B "\-xkboptions \fIoption\fP"
+.TP 8
+.B "\-xkbrules \fIrule\fP"
+.TP 8
+.B "\-xkbvariant \fIvariant\fp"
+These options configure the xkeyboard extension to load
+a particular keyboard map as the X server starts. The behavior is similar
+to the \fIsetxkbmap\fP program. The layout data is located at \fI
+__datadir__/X11/xkb/\fP. Additional information is found in the
+README files therein and in the man page of \fIsetxkbmap\fP. For example
+in order to load a German layout for a pc105 keyboard one uses
+the options:
+.br
+.I " \-xkblayout de \-xkbmodel pc105"
+
+Alternatively one may use the \fIsetxkbmap\fP program after \fIXWin\fP is
+running.
+
+The default is to select a configuration matching your current layout as
+reported by \fIWindows\fP, if known, or the default X server configuration
+if no matching keyboard configuration was found.
+
+.SH UNDOCUMENTED OPTIONS
+These options are undocumented. Do not use them.
+
+.TP 8
+.B \-emulatepseudo
+Create a depth 8 PseudoColor visual when running in depths 15, 16, 24,
+or 32, collectively known as TrueColor depths.
+Color map manipulation is not supported, so the PseudoColor visual will
+not have the correct colors.
+This option is intended to allow applications which only work with a depth 8
+visual to operate in TrueColor modes.
+.TP 8
+.B \-internalwm
+Run the internal window manager.
+
+.SH LOG FILE
+As it runs \fIXWin\fP writes messages indicating the most relevant events
+to the console
+from which it was called and to a log file that by default is located at \fI
+__logdir__/XWin.0.log\fP. This file is mainly for debugging purposes.
+
+
+.SH PREFERENCES FILE
+On startup \fIXWin\fP looks for the file \fI$HOME/.XWinrc\fP or, if
+the previous file does not exist, \fI
+__sysconfdir__/X11/system.XWinrc\fP. \fI.XWinrc\fP allows setting
+preferences for the following:
+.br
+* To include items into the menu associated with the \fIXWin\fP icon
+which is in the \fIWindows\fP system tray. This functions in all
+modes that have a tray icon.
+.br
+* To include items in the system menu which is associated with the \fIWindows\fP
+window that \fIXWin -multiwindow\fP produces for each top-level X
+window, in both the generic case and for particular programs.
+.br
+* To change the icon that is associated to the \fIWindows\fP window that
+\fIXWin -multiwindow\fP produces for each top-level X-window.
+.br
+* To change the style that is associated to the \fIWindows\fP window that
+\fXWin I-multiwindow\fP produces for each top-level X window.
+.PP
+The format of the \fI.XWinrc\fP file is given in the man page XWinrc(5).
+
+.SH EXAMPLES
+Need some examples
+
+
+.SH "SEE ALSO"
+X(__miscmansuffix__), Xserver(1), xdm(1), xinit(1), XWinrc(__filemansuffix__), setxkbmap(1)
+
+
+.SH BUGS
+.I XWin
+and this man page still have many limitations.
+
+The \fIXWin\fP software is continuously developing; it is therefore possible that
+this man page is not up to date. It is always prudent to
+look also at the output of \fIXWin -help\fP in order to
+check the options that are operative.
+
+
+.SH AUTHORS
+This list is by no means complete, but direct contributors to the
+Cygwin/X project include (in alphabetical order by last name): Stuart
+Adamson, Michael Bax, Jehan Bing, Lev Bishop, Dr. Peter Busch, Biju G
+C, Robert Collins, Nick Crabtree, Early Ehlinger, Christopher Faylor,
+John Fortin, Brian Genisio, Fabrizio Gennari, Alexander Gottwald, Ralf
+Habacker, Colin Harrison, Matthieu Herrb, Alan Hourihane, Pierre A
+Humblet, Harold L Hunt II, Dakshinamurthy Karra, Joe Krahn,
+Paul Loewenstein, Kensuke Matsuzaki,
+Takuma Murakami, Earle F. Philhower III, Benjamin Riefenstahl, Yaakov Selkowitz,
+Suhaib Siddiqi, Jack Tanner, Jon Turney and Nicholas Wourms.
diff --git a/xorg-server/hw/xwin/win.h b/xorg-server/hw/xwin/win.h index 9bee9b64f..614c6b23f 100644 --- a/xorg-server/hw/xwin/win.h +++ b/xorg-server/hw/xwin/win.h @@ -1,1490 +1,1464 @@ -/* - *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved. - * - *Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - *"Software"), to deal in the Software without restriction, including - *without limitation the rights to use, copy, modify, merge, publish, - *distribute, sublicense, and/or sell copies of the Software, and to - *permit persons to whom the Software is furnished to do so, subject to - *the following conditions: - * - *The above copyright notice and this permission notice shall be - *included in all copies or substantial portions of the Software. - * - *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR - *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - *Except as contained in this notice, the name of the XFree86 Project - *shall not be used in advertising or otherwise to promote the sale, use - *or other dealings in this Software without prior written authorization - *from the XFree86 Project. - * - * Authors: Dakshinamurthy Karra - * Suhaib M Siddiqi - * Peter Busch - * Harold L Hunt II - * Kensuke Matsuzaki - */ - -#ifndef _WIN_H_ -#define _WIN_H_ - -#ifndef NO -#define NO 0 -#endif -#ifndef YES -#define YES 1 -#endif - -/* Turn debug messages on or off */ -#ifndef CYGDEBUG -#define CYGDEBUG NO -#endif - -/* WM_XBUTTON Messages. They should go into w32api. */ -#ifndef WM_XBUTTONDOWN -# define WM_XBUTTONDOWN 523 -#endif -#ifndef WM_XBUTTONUP -# define WM_XBUTTONUP 524 -#endif -#ifndef WM_XBUTTONDBLCLK -# define WM_XBUTTONDBLCLK 525 -#endif - - -#define WIN_DEFAULT_BPP 0 -#define WIN_DEFAULT_WHITEPIXEL 255 -#define WIN_DEFAULT_BLACKPIXEL 0 -#define WIN_DEFAULT_LINEBIAS 0 -#define WIN_DEFAULT_E3B_TIME 50 /* milliseconds */ -#define WIN_DEFAULT_DPI 75 -#define WIN_DEFAULT_REFRESH 0 -#define WIN_DEFAULT_WIN_KILL TRUE -#define WIN_DEFAULT_UNIX_KILL FALSE -#define WIN_DEFAULT_CLIP_UPDATES_NBOXES 0 -#ifdef XWIN_EMULATEPSEUDO -#define WIN_DEFAULT_EMULATE_PSEUDO FALSE -#endif -#define WIN_DEFAULT_USER_GAVE_HEIGHT_AND_WIDTH FALSE - -/* - * Windows only supports 256 color palettes - */ -#define WIN_NUM_PALETTE_ENTRIES 256 - -/* - * Number of times to call Restore in an attempt to restore the primary surface - */ -#define WIN_REGAIN_SURFACE_RETRIES 1 - -/* - * Build a supported display depths mask by shifting one to the left - * by the number of bits in the supported depth. - */ -#define WIN_SUPPORTED_BPPS ( (1 << (32 - 1)) | (1 << (24 - 1)) \ - | (1 << (16 - 1)) | (1 << (15 - 1)) \ - | (1 << ( 8 - 1))) -#define WIN_CHECK_DEPTH YES - -/* - * Timer IDs for WM_TIMER - */ -#define WIN_E3B_TIMER_ID 1 -#define WIN_POLLING_MOUSE_TIMER_ID 2 - -#define MOUSE_POLLING_INTERVAL 50 - -#define WIN_E3B_OFF -1 -#define WIN_FD_INVALID -1 - -#define WIN_SERVER_NONE 0x0L /* 0 */ -#define WIN_SERVER_SHADOW_GDI 0x1L /* 1 */ -#define WIN_SERVER_SHADOW_DD 0x2L /* 2 */ -#define WIN_SERVER_SHADOW_DDNL 0x4L /* 4 */ -#ifdef XWIN_PRIMARYFB -#define WIN_SERVER_PRIMARY_DD 0x8L /* 8 */ -#endif -#ifdef XWIN_NATIVEGDI -# define WIN_SERVER_NATIVE_GDI 0x10L /* 16 */ -#endif - -#define AltMapIndex Mod1MapIndex -#define NumLockMapIndex Mod2MapIndex -#define AltLangMapIndex Mod3MapIndex -#define KanaMapIndex Mod4MapIndex -#define ScrollLockMapIndex Mod5MapIndex - -#define WIN_MOD_LALT 0x00000001 -#define WIN_MOD_RALT 0x00000002 -#define WIN_MOD_LCONTROL 0x00000004 -#define WIN_MOD_RCONTROL 0x00000008 - -#define WIN_24BPP_MASK_RED 0x00FF0000 -#define WIN_24BPP_MASK_GREEN 0x0000FF00 -#define WIN_24BPP_MASK_BLUE 0x000000FF - -#define WIN_MAX_KEYS_PER_KEY 4 - -#include <sys/types.h> -#include <sys/stat.h> -#include <stdio.h> - -#include <errno.h> -#if defined(XWIN_MULTIWINDOWEXTWM) || defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW) -#define HANDLE void * -#include <pthread.h> -#undef HANDLE -#endif - -#ifdef HAS_MMAP -#include <sys/mman.h> -#ifndef MAP_FILE -#define MAP_FILE 0 -#endif /* MAP_FILE */ -#endif /* HAS_MMAP */ - -#include <X11/X.h> -#include <X11/Xproto.h> -#include <X11/Xos.h> -#include <X11/Xprotostr.h> -#include "scrnintstr.h" -#include "pixmapstr.h" -#include "pixmap.h" -#include "region.h" -#include "gcstruct.h" -#include "colormap.h" -#include "colormapst.h" -#include "miscstruct.h" -#include "servermd.h" -#include "windowstr.h" -#include "mi.h" -#include "micmap.h" -#include "mifillarc.h" -#include "mifpoly.h" -#include "mibstore.h" -#include "input.h" -#include "mipointer.h" -#include "X11/keysym.h" -#include "micoord.h" -#include "dix.h" -#include "miline.h" -#include "shadow.h" -#include "fb.h" -#include "rootless.h" - -#include "mipict.h" -#include "picturestr.h" - -#ifdef RANDR -#include "randrstr.h" -#endif - -/* - * Windows headers - */ -#include "winms.h" -#include "winresource.h" - - -/* - * Define Windows constants - */ - -#define WM_TRAYICON (WM_USER + 1000) -#define WM_INIT_SYS_MENU (WM_USER + 1001) -#define WM_GIVEUP (WM_USER + 1002) - - -/* Local includes */ -#include "winwindow.h" -#include "winmsg.h" - - -/* - * Debugging macros - */ - -#if CYGDEBUG -#define DEBUG_MSG(str,...) \ -if (fDebugProcMsg) \ -{ \ - char *pszTemp; \ - int iLength; \ - if (asprintf (&pszTemp, str, ##__VA_ARGS__) != -1) { \ - MessageBox (NULL, pszTemp, szFunctionName, MB_OK); \ - free (pszTemp); \ - } \ -} -#else -#define DEBUG_MSG(str,...) -#endif - -#if CYGDEBUG -#define DEBUG_FN_NAME(str) PTSTR szFunctionName = str -#else -#define DEBUG_FN_NAME(str) -#endif - -#if CYGDEBUG || YES -#define DEBUGVARS BOOL fDebugProcMsg = FALSE -#else -#define DEBUGVARS -#endif - -#if CYGDEBUG || YES -#define DEBUGPROC_MSG fDebugProcMsg = TRUE -#else -#define DEBUGPROC_MSG -#endif - -#define PROFILEPOINT(point,thresh)\ -{\ -static unsigned int PROFPT##point = 0;\ -if (++PROFPT##point % thresh == 0)\ -ErrorF (#point ": PROFILEPOINT hit %u times\n", PROFPT##point);\ -} - - -/* We use xor this macro for detecting toggle key state changes */ -#define WIN_XOR(a,b) ((!(a) && (b)) || ((a) && !(b))) - -#define DEFINE_ATOM_HELPER(func,atom_name) \ -static Atom func (void) { \ - static int generation; \ - static Atom atom; \ - if (generation != serverGeneration) { \ - generation = serverGeneration; \ - atom = MakeAtom (atom_name, strlen (atom_name), TRUE); \ - } \ - return atom; \ -} - -/* - * Typedefs for engine dependent function pointers - */ - -typedef Bool (*winAllocateFBProcPtr)(ScreenPtr); - -typedef void (*winFreeFBProcPtr)(ScreenPtr); - -typedef void (*winShadowUpdateProcPtr)(ScreenPtr, shadowBufPtr); - -typedef Bool (*winInitScreenProcPtr)(ScreenPtr); - -typedef Bool (*winCloseScreenProcPtr)(int, ScreenPtr); - -typedef Bool (*winInitVisualsProcPtr)(ScreenPtr); - -typedef Bool (*winAdjustVideoModeProcPtr)(ScreenPtr); - -typedef Bool (*winCreateBoundingWindowProcPtr)(ScreenPtr); - -typedef Bool (*winFinishScreenInitProcPtr)(int, ScreenPtr, int, char **); - -typedef Bool (*winBltExposedRegionsProcPtr)(ScreenPtr); - -typedef Bool (*winActivateAppProcPtr)(ScreenPtr); - -typedef Bool (*winRedrawScreenProcPtr)(ScreenPtr pScreen); - -typedef Bool (*winRealizeInstalledPaletteProcPtr)(ScreenPtr pScreen); - -typedef Bool (*winInstallColormapProcPtr)(ColormapPtr pColormap); - -typedef Bool (*winStoreColorsProcPtr)(ColormapPtr pmap, - int ndef, xColorItem *pdefs); - -typedef Bool (*winCreateColormapProcPtr)(ColormapPtr pColormap); - -typedef Bool (*winDestroyColormapProcPtr)(ColormapPtr pColormap); - -typedef Bool (*winHotKeyAltTabProcPtr)(ScreenPtr); - -typedef Bool (*winCreatePrimarySurfaceProcPtr)(ScreenPtr); - -typedef Bool (*winReleasePrimarySurfaceProcPtr)(ScreenPtr); - -typedef Bool (*winFinishCreateWindowsWindowProcPtr)(WindowPtr pWin); - -typedef Bool (*winCreateScreenResourcesProc)(ScreenPtr); - -#ifdef XWIN_NATIVEGDI -/* Typedefs for native GDI wrappers */ -typedef Bool (*RealizeFontPtr) (ScreenPtr pScreen, FontPtr pFont); -typedef Bool (*UnrealizeFontPtr)(ScreenPtr pScreen, FontPtr pFont); -#endif - - -/* - * GC (graphics context) privates - */ - -typedef struct -{ - HDC hdc; - HDC hdcMem; -} winPrivGCRec, *winPrivGCPtr; - - -/* - * Pixmap privates - */ - -typedef struct -{ - HDC hdcSelected; - HBITMAP hBitmap; - BYTE *pbBits; - DWORD dwScanlineBytes; - BITMAPINFOHEADER *pbmih; -} winPrivPixmapRec, *winPrivPixmapPtr; - - -/* - * Colormap privates - */ - -typedef struct -{ - HPALETTE hPalette; - LPDIRECTDRAWPALETTE lpDDPalette; - RGBQUAD rgbColors[WIN_NUM_PALETTE_ENTRIES]; - PALETTEENTRY peColors[WIN_NUM_PALETTE_ENTRIES]; -} winPrivCmapRec, *winPrivCmapPtr; - -/* - * Windows Cursor handling. - */ - -typedef struct { - /* from GetSystemMetrics */ - int sm_cx; - int sm_cy; - - BOOL visible; - HCURSOR handle; - QueryBestSizeProcPtr QueryBestSize; - miPointerSpriteFuncPtr spriteFuncs; -} winCursorRec; - -/* - * Resize modes - */ -typedef enum { - notAllowed, - resizeWithScrollbars, - resizeWithRandr -} winResizeMode; - -/* - * Screen information structure that we need before privates are available - * in the server startup sequence. - */ - -typedef struct -{ - ScreenPtr pScreen; - - /* Did the user specify a height and width? */ - Bool fUserGaveHeightAndWidth; - - DWORD dwScreen; - - int iMonitor; - DWORD dwUserWidth; - DWORD dwUserHeight; - DWORD dwWidth; - DWORD dwHeight; - DWORD dwPaddedWidth; - - /* Did the user specify a screen position? */ - Bool fUserGavePosition; - DWORD dwInitialX; - DWORD dwInitialY; - - /* - * dwStride is the number of whole pixels that occupy a scanline, - * including those pixels that are not displayed. This is basically - * a rounding up of the width. - */ - DWORD dwStride; - - /* Offset of the screen in the window when using scrollbars */ - DWORD dwXOffset; - DWORD dwYOffset; - - DWORD dwBPP; - DWORD dwDepth; - DWORD dwRefreshRate; - char *pfb; - DWORD dwEngine; - DWORD dwEnginePreferred; - DWORD dwClipUpdatesNBoxes; -#ifdef XWIN_EMULATEPSEUDO - Bool fEmulatePseudo; -#endif - Bool fFullScreen; - Bool fDecoration; -#ifdef XWIN_MULTIWINDOWEXTWM - Bool fMWExtWM; - Bool fInternalWM; - Bool fAnotherWMRunning; -#endif - Bool fRootless; -#ifdef XWIN_MULTIWINDOW - Bool fMultiWindow; -#endif -#if defined(XWIN_MULTIWINDOW) || defined(XWIN_MULTIWINDOWEXTWM) - Bool fMultiMonitorOverride; -#endif - Bool fMultipleMonitors; - Bool fLessPointer; - winResizeMode iResizeMode; - Bool fNoTrayIcon; - int iE3BTimeout; - /* Windows (Alt+F4) and Unix (Ctrl+Alt+Backspace) Killkey */ - Bool fUseWinKillKey; - Bool fUseUnixKillKey; - Bool fIgnoreInput; - - /* Did the user explicitly set this screen? */ - Bool fExplicitScreen; -} winScreenInfo, *winScreenInfoPtr; - - -/* - * Screen privates - */ - -typedef struct _winPrivScreenRec -{ - winScreenInfoPtr pScreenInfo; - - Bool fEnabled; - Bool fClosed; - Bool fActive; - Bool fBadDepth; - - int iDeltaZ; - - int iConnectedClients; - - CloseScreenProcPtr CloseScreen; - - DWORD dwRedMask; - DWORD dwGreenMask; - DWORD dwBlueMask; - DWORD dwBitsPerRGB; - - DWORD dwModeKeyStates; - - /* Handle to icons that must be freed */ - HICON hiconNotifyIcon; - - /* Palette management */ - ColormapPtr pcmapInstalled; - - /* Pointer to the root visual so we only have to look it up once */ - VisualPtr pRootVisual; - - /* 3 button emulation variables */ - int iE3BCachedPress; - Bool fE3BFakeButton2Sent; - - /* Privates used by shadow fb GDI server */ - HBITMAP hbmpShadow; - HDC hdcScreen; - HDC hdcShadow; - HWND hwndScreen; - BITMAPINFOHEADER *pbmih; - - /* Privates used by shadow fb and primary fb DirectDraw servers */ - LPDIRECTDRAW pdd; - LPDIRECTDRAWSURFACE2 pddsPrimary; - LPDIRECTDRAW2 pdd2; - - /* Privates used by shadow fb DirectDraw server */ - LPDIRECTDRAWSURFACE2 pddsShadow; - LPDDSURFACEDESC pddsdShadow; - - /* Privates used by primary fb DirectDraw server */ - LPDIRECTDRAWSURFACE2 pddsOffscreen; - LPDDSURFACEDESC pddsdOffscreen; - LPDDSURFACEDESC pddsdPrimary; - - /* Privates used by shadow fb DirectDraw Nonlocking server */ - LPDIRECTDRAW4 pdd4; - LPDIRECTDRAWSURFACE4 pddsShadow4; - LPDIRECTDRAWSURFACE4 pddsPrimary4; - BOOL fRetryCreateSurface; - - /* Privates used by both shadow fb DirectDraw servers */ - LPDIRECTDRAWCLIPPER pddcPrimary; - -#ifdef XWIN_MULTIWINDOWEXTWM - /* Privates used by multi-window external window manager */ - RootlessFrameID widTop; - Bool fRestacking; -#endif - -#ifdef XWIN_MULTIWINDOW - /* Privates used by multi-window */ - pthread_t ptWMProc; - pthread_t ptXMsgProc; - void *pWMInfo; -#endif - -#if defined(XWIN_MULTIWINDOW) || defined(XWIN_MULTIWINDOWEXTWM) - /* Privates used by both multi-window and rootless */ - Bool fRootWindowShown; -#endif - -#if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW) - /* Privates used for any module running in a seperate thread */ - pthread_mutex_t pmServerStarted; - Bool fServerStarted; -#endif - - /* Engine specific functions */ - winAllocateFBProcPtr pwinAllocateFB; - winFreeFBProcPtr pwinFreeFB; - winShadowUpdateProcPtr pwinShadowUpdate; - winInitScreenProcPtr pwinInitScreen; - winCloseScreenProcPtr pwinCloseScreen; - winInitVisualsProcPtr pwinInitVisuals; - winAdjustVideoModeProcPtr pwinAdjustVideoMode; - winCreateBoundingWindowProcPtr pwinCreateBoundingWindow; - winFinishScreenInitProcPtr pwinFinishScreenInit; - winBltExposedRegionsProcPtr pwinBltExposedRegions; - winActivateAppProcPtr pwinActivateApp; - winRedrawScreenProcPtr pwinRedrawScreen; - winRealizeInstalledPaletteProcPtr pwinRealizeInstalledPalette; - winInstallColormapProcPtr pwinInstallColormap; - winStoreColorsProcPtr pwinStoreColors; - winCreateColormapProcPtr pwinCreateColormap; - winDestroyColormapProcPtr pwinDestroyColormap; - winHotKeyAltTabProcPtr pwinHotKeyAltTab; - winCreatePrimarySurfaceProcPtr pwinCreatePrimarySurface; - winReleasePrimarySurfaceProcPtr pwinReleasePrimarySurface; - - winCreateScreenResourcesProc pwinCreateScreenResources; - -#ifdef XWIN_MULTIWINDOW - /* Window Procedures for MultiWindow mode */ - winFinishCreateWindowsWindowProcPtr pwinFinishCreateWindowsWindow; -#endif - - /* Window Procedures for Rootless mode */ - CreateWindowProcPtr CreateWindow; - DestroyWindowProcPtr DestroyWindow; - PositionWindowProcPtr PositionWindow; - ChangeWindowAttributesProcPtr ChangeWindowAttributes; - RealizeWindowProcPtr RealizeWindow; - UnrealizeWindowProcPtr UnrealizeWindow; - ValidateTreeProcPtr ValidateTree; - PostValidateTreeProcPtr PostValidateTree; - WindowExposuresProcPtr WindowExposures; - CopyWindowProcPtr CopyWindow; - ClearToBackgroundProcPtr ClearToBackground; - ClipNotifyProcPtr ClipNotify; - RestackWindowProcPtr RestackWindow; - ReparentWindowProcPtr ReparentWindow; - ResizeWindowProcPtr ResizeWindow; - MoveWindowProcPtr MoveWindow; - SetShapeProcPtr SetShape; - - winCursorRec cursor; - -#ifdef XWIN_NATIVEGDI - RealizeFontPtr RealizeFont; - UnrealizeFontPtr UnrealizeFont; -#endif - -} winPrivScreenRec; - - -#ifdef XWIN_MULTIWINDOWEXTWM -typedef struct { - RootlessWindowPtr pFrame; - HWND hWnd; - int dwWidthBytes; - BITMAPINFOHEADER *pbmihShadow; - HBITMAP hbmpShadow; - HDC hdcShadow; - HDC hdcScreen; - BOOL fResized; - BOOL fRestackingNow; - BOOL fClose; - BOOL fMovingOrSizing; - BOOL fDestroyed;//for debug - char *pfb; -} win32RootlessWindowRec, *win32RootlessWindowPtr; -#endif - - -typedef struct { - pointer value; - XID id; -} WindowIDPairRec, *WindowIDPairPtr; - - -/* - * Extern declares for general global variables - */ - -#include "winglobals.h" - -extern winScreenInfo * g_ScreenInfo; -extern miPointerScreenFuncRec g_winPointerCursorFuncs; -extern DWORD g_dwEvents; -#ifdef HAS_DEVWINDOWS -extern int g_fdMessageQueue; -#endif -extern DevPrivateKeyRec g_iScreenPrivateKeyRec; -#define g_iScreenPrivateKey (&g_iScreenPrivateKeyRec) -extern DevPrivateKeyRec g_iCmapPrivateKeyRec; -#define g_iCmapPrivateKey (&g_iCmapPrivateKeyRec) -extern DevPrivateKeyRec g_iGCPrivateKeyRec; -#define g_iGCPrivateKey (&g_iGCPrivateKeyRec) -extern DevPrivateKeyRec g_iPixmapPrivateKeyRec; -#define g_iPixmapPrivateKey (&g_iPixmapPrivateKeyRec) -extern DevPrivateKeyRec g_iWindowPrivateKeyRec; -#define g_iWindowPrivateKey (&g_iWindowPrivateKeyRec) - -extern unsigned long g_ulServerGeneration; -extern DWORD g_dwEnginesSupported; -extern HINSTANCE g_hInstance; -extern int g_copyROP[]; -extern int g_patternROP[]; -extern const char * g_pszQueryHost; -extern DeviceIntPtr g_pwinPointer; -extern DeviceIntPtr g_pwinKeyboard; - -/* - * Extern declares for dynamically loaded library function pointers - */ - -extern FARPROC g_fpDirectDrawCreate; -extern FARPROC g_fpDirectDrawCreateClipper; -extern FARPROC g_fpTrackMouseEvent; - - -/* - * Screen privates macros - */ - -#define winGetScreenPriv(pScreen) ((winPrivScreenPtr) \ - dixLookupPrivate(&(pScreen)->devPrivates, g_iScreenPrivateKey)) - -#define winSetScreenPriv(pScreen,v) \ - dixSetPrivate(&(pScreen)->devPrivates, g_iScreenPrivateKey, v) - -#define winScreenPriv(pScreen) \ - winPrivScreenPtr pScreenPriv = winGetScreenPriv(pScreen) - - -/* - * Colormap privates macros - */ - -#define winGetCmapPriv(pCmap) ((winPrivCmapPtr) \ - dixLookupPrivate(&(pCmap)->devPrivates, g_iCmapPrivateKey)) - -#define winSetCmapPriv(pCmap,v) \ - dixSetPrivate(&(pCmap)->devPrivates, g_iCmapPrivateKey, v) - -#define winCmapPriv(pCmap) \ - winPrivCmapPtr pCmapPriv = winGetCmapPriv(pCmap) - - -/* - * GC privates macros - */ - -#define winGetGCPriv(pGC) ((winPrivGCPtr) \ - dixLookupPrivate(&(pGC)->devPrivates, g_iGCPrivateKey)) - -#define winSetGCPriv(pGC,v) \ - dixSetPrivate(&(pGC)->devPrivates, g_iGCPrivateKey, v) - -#define winGCPriv(pGC) \ - winPrivGCPtr pGCPriv = winGetGCPriv(pGC) - - -/* - * Pixmap privates macros - */ - -#define winGetPixmapPriv(pPixmap) ((winPrivPixmapPtr) \ - dixLookupPrivate(&(pPixmap)->devPrivates, g_iPixmapPrivateKey)) - -#define winSetPixmapPriv(pPixmap,v) \ - dixLookupPrivate(&(pPixmap)->devPrivates, g_iPixmapPrivateKey, v) - -#define winPixmapPriv(pPixmap) \ - winPrivPixmapPtr pPixmapPriv = winGetPixmapPriv(pPixmap) - - -/* - * Window privates macros - */ - -#define winGetWindowPriv(pWin) ((winPrivWinPtr) \ - dixLookupPrivate(&(pWin)->devPrivates, g_iWindowPrivateKey)) - -#define winSetWindowPriv(pWin,v) \ - dixLookupPrivate(&(pWin)->devPrivates, g_iWindowPrivateKey, v) - -#define winWindowPriv(pWin) \ - winPrivWinPtr pWinPriv = winGetWindowPriv(pWin) - -/* - * wrapper macros - */ -#define _WIN_WRAP(priv, real, mem, func) {\ - priv->mem = real->mem; \ - real->mem = func; \ -} - -#define _WIN_UNWRAP(priv, real, mem) {\ - real->mem = priv->mem; \ -} - -#define WIN_WRAP(mem, func) _WIN_WRAP(pScreenPriv, pScreen, mem, func) - -#define WIN_UNWRAP(mem) _WIN_UNWRAP(pScreenPriv, pScreen, mem) - -/* - * BEGIN DDX and DIX Function Prototypes - */ - - -/* - * winallpriv.c - */ - -Bool -winAllocatePrivates (ScreenPtr pScreen); - -Bool -winInitCmapPrivates (ColormapPtr pCmap, int index); - -Bool -winAllocateCmapPrivates (ColormapPtr pCmap); - - -/* - * winauth.c - */ - -#if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW) -Bool -winGenerateAuthorization (void); -void winSetAuthorization(void); -#endif - - -/* - * winblock.c - */ - -void -winBlockHandler (int nScreen, - pointer pBlockData, - pointer pTimeout, - pointer pReadMask); - - -#ifdef XWIN_NATIVEGDI -/* - * winclip.c - */ - -RegionPtr -winPixmapToRegionNativeGDI (PixmapPtr pPix); -#endif - - -#ifdef XWIN_CLIPBOARD -/* - * winclipboardinit.c - */ - -Bool -winInitClipboard (void); - -void -winFixClipboardChain (void); -#endif - - -/* - * wincmap.c - */ - -void -winSetColormapFunctions (ScreenPtr pScreen); - -Bool -winCreateDefColormap (ScreenPtr pScreen); - - -/* - * wincreatewnd.c - */ - -Bool -winCreateBoundingWindowFullScreen (ScreenPtr pScreen); - -Bool -winCreateBoundingWindowWindowed (ScreenPtr pScreen); - - -/* - * windialogs.c - */ - -void -winDisplayExitDialog (winPrivScreenPtr pScreenPriv); - -void -winDisplayDepthChangeDialog (winPrivScreenPtr pScreenPriv); - -void -winDisplayAboutDialog (winPrivScreenPtr pScreenPriv); - - -/* - * winengine.c - */ - -void -winDetectSupportedEngines (void); - -Bool -winSetEngine (ScreenPtr pScreen); - -Bool -winGetDDProcAddresses (void); - -void -winReleaseDDProcAddresses(void); - - -/* - * winerror.c - */ - -#ifdef DDXOSVERRORF -void -OSVenderVErrorF (const char *pszFormat, va_list va_args); -#endif - -void -winMessageBoxF (const char *pszError, UINT uType, ...); - - -#ifdef XWIN_NATIVEGDI -/* - * winfillsp.c - */ - -void -winFillSpansNativeGDI (DrawablePtr pDrawable, - GCPtr pGC, - int nSpans, - DDXPointPtr pPoints, - int *pWidths, - int fSorted); -#endif - - -#ifdef XWIN_NATIVEGDI -/* - * winfont.c - */ - -Bool -winRealizeFontNativeGDI (ScreenPtr pScreen, FontPtr pFont); - -Bool -winUnrealizeFontNativeGDI (ScreenPtr pScreen, FontPtr pFont); -#endif - - -#ifdef XWIN_NATIVEGDI -/* - * wingc.c - */ - -Bool -winCreateGCNativeGDI (GCPtr pGC); -#endif - - -#ifdef XWIN_NATIVEGDI -/* - * wingetsp.c - */ - -void -winGetSpansNativeGDI (DrawablePtr pDrawable, - int wMax, - DDXPointPtr pPoints, - int *pWidths, - int nSpans, - char *pDst); -#endif - - -/* - * winglobals.c - */ - -void -winInitializeGlobals (void); - - -/* - * winkeybd.c - */ - -void -winTranslateKey (WPARAM wParam, LPARAM lParam, int *piScanCode); - -int -winKeybdProc (DeviceIntPtr pDeviceInt, int iState); - -void -winInitializeModeKeyStates (void); - -void -winRestoreModeKeyStates (void); - -Bool -winIsFakeCtrl_L (UINT message, WPARAM wParam, LPARAM lParam); - -void -winKeybdReleaseKeys (void); - -void -winSendKeyEvent (DWORD dwKey, Bool fDown); - -BOOL -winCheckKeyPressed(WPARAM wParam, LPARAM lParam); - -void -winFixShiftKeys (int iScanCode); - -/* - * winkeyhook.c - */ - -Bool -winInstallKeyboardHookLL (void); - -void -winRemoveKeyboardHookLL (void); - - -/* - * winmisc.c - */ - -#ifdef XWIN_NATIVEGDI -void -winQueryBestSizeNativeGDI (int class, unsigned short *pWidth, - unsigned short *pHeight, ScreenPtr pScreen); -#endif - -CARD8 -winCountBits (DWORD dw); - -Bool -winUpdateFBPointer (ScreenPtr pScreen, void *pbits); - -#ifdef XWIN_NATIVEGDI -BOOL -winPaintBackground (HWND hwnd, COLORREF colorref); -#endif - - -/* - * winmouse.c - */ - -int -winMouseProc (DeviceIntPtr pDeviceInt, int iState); - -int -winMouseWheel (ScreenPtr pScreen, int iDeltaZ); - -void -winMouseButtonsSendEvent (int iEventType, int iButton); - -int -winMouseButtonsHandle (ScreenPtr pScreen, - int iEventType, int iButton, - WPARAM wParam); - -void -winEnqueueMotion(int x, int y); - -#ifdef XWIN_NATIVEGDI -/* - * winnativegdi.c - */ - -HBITMAP -winCreateDIBNativeGDI (int iWidth, int iHeight, int iDepth, - BYTE **ppbBits, BITMAPINFO **ppbmi); - -Bool -winSetEngineFunctionsNativeGDI (ScreenPtr pScreen); -#endif - - -#ifdef XWIN_PRIMARYFB -/* - * winpfbddd.c - */ - -Bool -winSetEngineFunctionsPrimaryDD (ScreenPtr pScreen); -#endif - - -#ifdef XWIN_NATIVEGDI -/* - * winpixmap.c - */ - -PixmapPtr -winCreatePixmapNativeGDI (ScreenPtr pScreen, int width, int height, int depth, - unsigned usage_hint); - -Bool -winDestroyPixmapNativeGDI (PixmapPtr pPixmap); - -Bool -winModifyPixmapHeaderNativeGDI (PixmapPtr pPixmap, - int iWidth, int iHeight, - int iDepth, - int iBitsPerPixel, - int devKind, - pointer pPixData); -#endif - -#ifdef XWIN_NATIVEGDI -/* - * winpolyline.c - */ - -void -winPolyLineNativeGDI (DrawablePtr pDrawable, - GCPtr pGC, - int mode, - int npt, - DDXPointPtr ppt); -#endif - - -#ifdef XWIN_NATIVEGDI -/* - * winpushpxl.c - */ - -void -winPushPixels (GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDrawable, - int dx, int dy, int xOrg, int yOrg); -#endif - - -/* - * winscrinit.c - */ - -Bool -winScreenInit (int index, - ScreenPtr pScreen, - int argc, char **argv); - -Bool -winFinishScreenInitFB (int index, - ScreenPtr pScreen, - int argc, char **argv); - -#if defined(XWIN_NATIVEGDI) -Bool -winFinishScreenInitNativeGDI (int index, - ScreenPtr pScreen, - int argc, char **argv); -#endif - - -#ifdef XWIN_NATIVEGDI -/* - * winsetsp.c - */ - -void -winSetSpansNativeGDI (DrawablePtr pDrawable, - GCPtr pGC, - char *pSrc, - DDXPointPtr pPoints, - int *pWidth, - int nSpans, - int fSorted); -#endif - - -/* - * winshaddd.c - */ - -Bool -winSetEngineFunctionsShadowDD (ScreenPtr pScreen); - - -/* - * winshadddnl.c - */ - -Bool -winSetEngineFunctionsShadowDDNL (ScreenPtr pScreen); - - -/* - * winshadgdi.c - */ - -Bool -winSetEngineFunctionsShadowGDI (ScreenPtr pScreen); - - -/* - * winwakeup.c - */ - -void -winWakeupHandler (int nScreen, - pointer pWakeupData, - unsigned long ulResult, - pointer pReadmask); - - -/* - * winwindow.c - */ - -#ifdef XWIN_NATIVEGDI -Bool -winCreateWindowNativeGDI (WindowPtr pWin); - -Bool -winDestroyWindowNativeGDI (WindowPtr pWin); - -Bool -winPositionWindowNativeGDI (WindowPtr pWin, int x, int y); - -void -winCopyWindowNativeGDI (WindowPtr pWin, - DDXPointRec ptOldOrg, - RegionPtr prgnSrc); - -Bool -winChangeWindowAttributesNativeGDI (WindowPtr pWin, unsigned long mask); - -Bool -winUnmapWindowNativeGDI (WindowPtr pWindow); - -Bool -winMapWindowNativeGDI (WindowPtr pWindow); -#endif - -Bool -winCreateWindowRootless (WindowPtr pWindow); - -Bool -winDestroyWindowRootless (WindowPtr pWindow); - -Bool -winPositionWindowRootless (WindowPtr pWindow, int x, int y); - -Bool -winChangeWindowAttributesRootless (WindowPtr pWindow, unsigned long mask); - -Bool -winUnmapWindowRootless (WindowPtr pWindow); - -Bool -winMapWindowRootless (WindowPtr pWindow); - -void -winSetShapeRootless (WindowPtr pWindow, int kind); - - -/* - * winmultiwindowicons.c - Used by both multi-window and Win32Rootless - */ - -HICON -winXIconToHICON (WindowPtr pWin, int iconSize); - -void -winSelectIcons(WindowPtr pWin, HICON *pIcon, HICON *pSmallIcon); - -#ifdef XWIN_MULTIWINDOW -/* - * winmultiwindowshape.c - */ - -void -winReshapeMultiWindow (WindowPtr pWin); - -void -winSetShapeMultiWindow (WindowPtr pWindow, int kind); - -void -winUpdateRgnMultiWindow (WindowPtr pWindow); -#endif - - -#ifdef XWIN_MULTIWINDOW -/* - * winmultiwindowwindow.c - */ - -Bool -winCreateWindowMultiWindow (WindowPtr pWindow); - -Bool -winDestroyWindowMultiWindow (WindowPtr pWindow); - -Bool -winPositionWindowMultiWindow (WindowPtr pWindow, int x, int y); - -Bool -winChangeWindowAttributesMultiWindow (WindowPtr pWindow, unsigned long mask); - -Bool -winUnmapWindowMultiWindow (WindowPtr pWindow); - -Bool -winMapWindowMultiWindow (WindowPtr pWindow); - -void -winReparentWindowMultiWindow (WindowPtr pWin, WindowPtr pPriorParent); - -void -winRestackWindowMultiWindow (WindowPtr pWin, WindowPtr pOldNextSib); - -void -winReorderWindowsMultiWindow (void); - -void -winResizeWindowMultiWindow (WindowPtr pWin, int x, int y, unsigned int w, - unsigned int h, WindowPtr pSib); -void -winMoveWindowMultiWindow (WindowPtr pWin, int x, int y, - WindowPtr pSib, VTKind kind); - -void -winCopyWindowMultiWindow (WindowPtr pWin, DDXPointRec oldpt, - RegionPtr oldRegion); - -XID -winGetWindowID (WindowPtr pWin); - -int -winAdjustXWindow (WindowPtr pWin, HWND hwnd); -#endif - - -#ifdef XWIN_MULTIWINDOW -/* - * winmultiwindowwndproc.c - */ - -LRESULT CALLBACK -winTopLevelWindowProc (HWND hwnd, UINT message, - WPARAM wParam, LPARAM lParam); -#endif - - -/* - * wintrayicon.c - */ - -void -winInitNotifyIcon (winPrivScreenPtr pScreenPriv); - -void -winDeleteNotifyIcon (winPrivScreenPtr pScreenPriv); - -LRESULT -winHandleIconMessage (HWND hwnd, UINT message, - WPARAM wParam, LPARAM lParam, - winPrivScreenPtr pScreenPriv); - - -/* - * winwndproc.c - */ - -LRESULT CALLBACK -winWindowProc (HWND hWnd, UINT message, - WPARAM wParam, LPARAM lParam); - - -#ifdef XWIN_MULTIWINDOWEXTWM -/* - * winwin32rootless.c - */ - -Bool -winMWExtWMCreateFrame (RootlessWindowPtr pFrame, ScreenPtr pScreen, - int newX, int newY, RegionPtr pShape); - -void -winMWExtWMDestroyFrame (RootlessFrameID wid); - -void -winMWExtWMMoveFrame (RootlessFrameID wid, ScreenPtr pScreen, int newX, int newY); - -void -winMWExtWMResizeFrame (RootlessFrameID wid, ScreenPtr pScreen, - int newX, int newY, unsigned int newW, unsigned int newH, - unsigned int gravity); - -void -winMWExtWMRestackFrame (RootlessFrameID wid, RootlessFrameID nextWid); - -void -winMWExtWMReshapeFrame (RootlessFrameID wid, RegionPtr pShape); - -void -winMWExtWMUnmapFrame (RootlessFrameID wid); - -void -winMWExtWMStartDrawing (RootlessFrameID wid, char **pixelData, int *bytesPerRow); - -void -winMWExtWMStopDrawing (RootlessFrameID wid, Bool flush); - -void -winMWExtWMUpdateRegion (RootlessFrameID wid, RegionPtr pDamage); - -void -winMWExtWMDamageRects (RootlessFrameID wid, int count, const BoxRec *rects, - int shift_x, int shift_y); - -void -winMWExtWMRootlessSwitchWindow (RootlessWindowPtr pFrame, WindowPtr oldWin); - -void -winMWExtWMCopyBytes (unsigned int width, unsigned int height, - const void *src, unsigned int srcRowBytes, - void *dst, unsigned int dstRowBytes); - -void -winMWExtWMCopyWindow (RootlessFrameID wid, int dstNrects, const BoxRec *dstRects, - int dx, int dy); -#endif - - -#ifdef XWIN_MULTIWINDOWEXTWM -/* - * winwin32rootlesswindow.c - */ - -void -winMWExtWMReorderWindows (ScreenPtr pScreen); - -void -winMWExtWMMoveXWindow (WindowPtr pWin, int x, int y); - -void -winMWExtWMResizeXWindow (WindowPtr pWin, int w, int h); - -void -winMWExtWMMoveResizeXWindow (WindowPtr pWin, int x, int y, int w, int h); - -void -winMWExtWMUpdateIcon (Window id); - -void -winMWExtWMUpdateWindowDecoration (win32RootlessWindowPtr pRLWinPriv, - winScreenInfoPtr pScreenInfo); - -wBOOL CALLBACK -winMWExtWMDecorateWindow (HWND hwnd, LPARAM lParam); - -Bool -winIsInternalWMRunning (winScreenInfoPtr pScreenInfo); - -void -winMWExtWMRestackWindows (ScreenPtr pScreen); -#endif - - -#ifdef XWIN_MULTIWINDOWEXTWM -/* - * winwin32rootlesswndproc.c - */ - -LRESULT CALLBACK -winMWExtWMWindowProc (HWND hwnd, UINT message, - WPARAM wParam, LPARAM lParam); -#endif - - -/* - * winwindowswm.c - */ - -void -winWindowsWMSendEvent (int type, unsigned int mask, int which, int arg, - Window window, int x, int y, int w, int h); - -void -winWindowsWMExtensionInit (void); - -/* - * wincursor.c - */ - -Bool -winInitCursor (ScreenPtr pScreen); - -/* - * winprocarg.c - */ -void -winInitializeScreens(int maxscreens); - -/* - * winrandr.c - */ -Bool -winRandRInit (ScreenPtr pScreen); -void -winDoRandRScreenSetSize (ScreenPtr pScreen, - CARD16 width, - CARD16 height, - CARD32 mmWidth, - CARD32 mmHeight); - -/* - * END DDX and DIX Function Prototypes - */ - -#endif /* _WIN_H_ */ - +/*
+ *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
+ *
+ *Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ *"Software"), to deal in the Software without restriction, including
+ *without limitation the rights to use, copy, modify, merge, publish,
+ *distribute, sublicense, and/or sell copies of the Software, and to
+ *permit persons to whom the Software is furnished to do so, subject to
+ *the following conditions:
+ *
+ *The above copyright notice and this permission notice shall be
+ *included in all copies or substantial portions of the Software.
+ *
+ *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
+ *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+ *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Dakshinamurthy Karra
+ * Suhaib M Siddiqi
+ * Peter Busch
+ * Harold L Hunt II
+ * Kensuke Matsuzaki
+ */
+
+#ifndef _WIN_H_
+#define _WIN_H_
+
+#ifndef NO
+#define NO 0
+#endif
+#ifndef YES
+#define YES 1
+#endif
+
+/* WM_XBUTTON Messages. They should go into w32api. */
+#ifndef WM_XBUTTONDOWN
+# define WM_XBUTTONDOWN 523
+#endif
+#ifndef WM_XBUTTONUP
+# define WM_XBUTTONUP 524
+#endif
+#ifndef WM_XBUTTONDBLCLK
+# define WM_XBUTTONDBLCLK 525
+#endif
+
+
+#define WIN_DEFAULT_BPP 0
+#define WIN_DEFAULT_WHITEPIXEL 255
+#define WIN_DEFAULT_BLACKPIXEL 0
+#define WIN_DEFAULT_LINEBIAS 0
+#define WIN_DEFAULT_E3B_TIME 50 /* milliseconds */
+#define WIN_DEFAULT_DPI 75
+#define WIN_DEFAULT_REFRESH 0
+#define WIN_DEFAULT_WIN_KILL TRUE
+#define WIN_DEFAULT_UNIX_KILL FALSE
+#define WIN_DEFAULT_CLIP_UPDATES_NBOXES 0
+#ifdef XWIN_EMULATEPSEUDO
+#define WIN_DEFAULT_EMULATE_PSEUDO FALSE
+#endif
+#define WIN_DEFAULT_USER_GAVE_HEIGHT_AND_WIDTH FALSE
+
+/*
+ * Windows only supports 256 color palettes
+ */
+#define WIN_NUM_PALETTE_ENTRIES 256
+
+/*
+ * Number of times to call Restore in an attempt to restore the primary surface
+ */
+#define WIN_REGAIN_SURFACE_RETRIES 1
+
+/*
+ * Build a supported display depths mask by shifting one to the left
+ * by the number of bits in the supported depth.
+ */
+#define WIN_SUPPORTED_BPPS ( (1 << (32 - 1)) | (1 << (24 - 1)) \
+ | (1 << (16 - 1)) | (1 << (15 - 1)) \
+ | (1 << ( 8 - 1)))
+#define WIN_CHECK_DEPTH YES
+
+/*
+ * Timer IDs for WM_TIMER
+ */
+#define WIN_E3B_TIMER_ID 1
+#define WIN_POLLING_MOUSE_TIMER_ID 2
+
+#define MOUSE_POLLING_INTERVAL 50
+
+#define WIN_E3B_OFF -1
+#define WIN_FD_INVALID -1
+
+#define WIN_SERVER_NONE 0x0L /* 0 */
+#define WIN_SERVER_SHADOW_GDI 0x1L /* 1 */
+#define WIN_SERVER_SHADOW_DD 0x2L /* 2 */
+#define WIN_SERVER_SHADOW_DDNL 0x4L /* 4 */
+#ifdef XWIN_PRIMARYFB
+#define WIN_SERVER_PRIMARY_DD 0x8L /* 8 */
+#endif
+#ifdef XWIN_NATIVEGDI
+# define WIN_SERVER_NATIVE_GDI 0x10L /* 16 */
+#endif
+
+#define AltMapIndex Mod1MapIndex
+#define NumLockMapIndex Mod2MapIndex
+#define AltLangMapIndex Mod3MapIndex
+#define KanaMapIndex Mod4MapIndex
+#define ScrollLockMapIndex Mod5MapIndex
+
+#define WIN_MOD_LALT 0x00000001
+#define WIN_MOD_RALT 0x00000002
+#define WIN_MOD_LCONTROL 0x00000004
+#define WIN_MOD_RCONTROL 0x00000008
+
+#define WIN_24BPP_MASK_RED 0x00FF0000
+#define WIN_24BPP_MASK_GREEN 0x0000FF00
+#define WIN_24BPP_MASK_BLUE 0x000000FF
+
+#define WIN_MAX_KEYS_PER_KEY 4
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdio.h>
+
+#include <errno.h>
+#if defined(XWIN_MULTIWINDOWEXTWM) || defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW)
+#define HANDLE void *
+#ifdef _MSC_VER
+typedef int pid_t;
+#endif
+#include <pthread.h>
+#undef HANDLE
+#endif
+
+#ifdef HAS_MMAP
+#include <sys/mman.h>
+#ifndef MAP_FILE
+#define MAP_FILE 0
+#endif /* MAP_FILE */
+#endif /* HAS_MMAP */
+
+#include <X11/X.h>
+#include <X11/Xproto.h>
+#include <X11/Xos.h>
+#include <X11/Xprotostr.h>
+#include "scrnintstr.h"
+#include "pixmapstr.h"
+#include "pixmap.h"
+#include "region.h"
+#include "gcstruct.h"
+#include "colormap.h"
+#include "colormapst.h"
+#include "miscstruct.h"
+#include "servermd.h"
+#include "windowstr.h"
+#include "mi.h"
+#include "micmap.h"
+#include "mifillarc.h"
+#include "mifpoly.h"
+#include "mibstore.h"
+#include "input.h"
+#include "mipointer.h"
+#include "X11/keysym.h"
+#include "micoord.h"
+#include "dix.h"
+#include "miline.h"
+#include "shadow.h"
+#include "fb.h"
+#include "rootless.h"
+
+#include "mipict.h"
+#include "picturestr.h"
+
+#ifdef RANDR
+#include "randrstr.h"
+#endif
+
+/*
+ * Windows headers
+ */
+#include "winms.h"
+#include "winresource.h"
+
+
+/*
+ * Define Windows constants
+ */
+
+#define WM_TRAYICON (WM_USER + 1000)
+#define WM_INIT_SYS_MENU (WM_USER + 1001)
+#define WM_GIVEUP (WM_USER + 1002)
+
+
+/* Local includes */
+#include "winwindow.h"
+#include "winmsg.h"
+
+#define PROFILEPOINT(point,thresh)\
+{\
+static unsigned int PROFPT##point = 0;\
+if (++PROFPT##point % thresh == 0)\
+ErrorF (#point ": PROFILEPOINT hit %u times\n", PROFPT##point);\
+}
+
+
+/* We use xor this macro for detecting toggle key state changes */
+#define WIN_XOR(a,b) ((!(a) && (b)) || ((a) && !(b)))
+
+#define DEFINE_ATOM_HELPER(func,atom_name) \
+static Atom func (void) { \
+ static int generation; \
+ static Atom atom; \
+ if (generation != serverGeneration) { \
+ generation = serverGeneration; \
+ atom = MakeAtom (atom_name, strlen (atom_name), TRUE); \
+ } \
+ return atom; \
+}
+
+/*
+ * Typedefs for engine dependent function pointers
+ */
+
+typedef Bool (*winAllocateFBProcPtr)(ScreenPtr);
+
+typedef void (*winFreeFBProcPtr)(ScreenPtr);
+
+typedef void (*winShadowUpdateProcPtr)(ScreenPtr, shadowBufPtr);
+
+typedef Bool (*winInitScreenProcPtr)(ScreenPtr);
+
+typedef Bool (*winCloseScreenProcPtr)(int, ScreenPtr);
+
+typedef Bool (*winInitVisualsProcPtr)(ScreenPtr);
+
+typedef Bool (*winAdjustVideoModeProcPtr)(ScreenPtr);
+
+typedef Bool (*winCreateBoundingWindowProcPtr)(ScreenPtr);
+
+typedef Bool (*winFinishScreenInitProcPtr)(int, ScreenPtr, int, char **);
+
+typedef Bool (*winBltExposedRegionsProcPtr)(ScreenPtr);
+
+typedef Bool (*winActivateAppProcPtr)(ScreenPtr);
+
+typedef Bool (*winRedrawScreenProcPtr)(ScreenPtr pScreen);
+
+typedef Bool (*winRealizeInstalledPaletteProcPtr)(ScreenPtr pScreen);
+
+typedef Bool (*winInstallColormapProcPtr)(ColormapPtr pColormap);
+
+typedef Bool (*winStoreColorsProcPtr)(ColormapPtr pmap,
+ int ndef, xColorItem *pdefs);
+
+typedef Bool (*winCreateColormapProcPtr)(ColormapPtr pColormap);
+
+typedef Bool (*winDestroyColormapProcPtr)(ColormapPtr pColormap);
+
+typedef Bool (*winHotKeyAltTabProcPtr)(ScreenPtr);
+
+typedef Bool (*winCreatePrimarySurfaceProcPtr)(ScreenPtr);
+
+typedef Bool (*winReleasePrimarySurfaceProcPtr)(ScreenPtr);
+
+typedef Bool (*winFinishCreateWindowsWindowProcPtr)(WindowPtr pWin);
+
+typedef Bool (*winCreateScreenResourcesProc)(ScreenPtr);
+
+#ifdef XWIN_NATIVEGDI
+/* Typedefs for native GDI wrappers */
+typedef Bool (*RealizeFontPtr) (ScreenPtr pScreen, FontPtr pFont);
+typedef Bool (*UnrealizeFontPtr)(ScreenPtr pScreen, FontPtr pFont);
+#endif
+
+
+/*
+ * GC (graphics context) privates
+ */
+
+typedef struct
+{
+ HDC hdc;
+ HDC hdcMem;
+} winPrivGCRec, *winPrivGCPtr;
+
+
+/*
+ * Pixmap privates
+ */
+
+typedef struct
+{
+ HDC hdcSelected;
+ HBITMAP hBitmap;
+ BYTE *pbBits;
+ DWORD dwScanlineBytes;
+ BITMAPINFOHEADER *pbmih;
+} winPrivPixmapRec, *winPrivPixmapPtr;
+
+
+/*
+ * Colormap privates
+ */
+
+typedef struct
+{
+ HPALETTE hPalette;
+ LPDIRECTDRAWPALETTE lpDDPalette;
+ RGBQUAD rgbColors[WIN_NUM_PALETTE_ENTRIES];
+ PALETTEENTRY peColors[WIN_NUM_PALETTE_ENTRIES];
+} winPrivCmapRec, *winPrivCmapPtr;
+
+/*
+ * Windows Cursor handling.
+ */
+
+typedef struct {
+ /* from GetSystemMetrics */
+ int sm_cx;
+ int sm_cy;
+
+ BOOL visible;
+ HCURSOR handle;
+ QueryBestSizeProcPtr QueryBestSize;
+ miPointerSpriteFuncPtr spriteFuncs;
+} winCursorRec;
+
+/*
+ * Resize modes
+ */
+typedef enum {
+ notAllowed,
+ resizeWithScrollbars,
+ resizeWithRandr
+} winResizeMode;
+
+/*
+ * Screen information structure that we need before privates are available
+ * in the server startup sequence.
+ */
+
+typedef struct
+{
+ ScreenPtr pScreen;
+
+ /* Did the user specify a height and width? */
+ Bool fUserGaveHeightAndWidth;
+
+ DWORD dwScreen;
+
+ int iMonitor;
+ DWORD dwUserWidth;
+ DWORD dwUserHeight;
+ DWORD dwWidth;
+ DWORD dwHeight;
+ DWORD dwPaddedWidth;
+
+ /* Did the user specify a screen position? */
+ Bool fUserGavePosition;
+ DWORD dwInitialX;
+ DWORD dwInitialY;
+
+ /*
+ * dwStride is the number of whole pixels that occupy a scanline,
+ * including those pixels that are not displayed. This is basically
+ * a rounding up of the width.
+ */
+ DWORD dwStride;
+
+ /* Offset of the screen in the window when using scrollbars */
+ DWORD dwXOffset;
+ DWORD dwYOffset;
+
+ DWORD dwBPP;
+ DWORD dwDepth;
+ DWORD dwRefreshRate;
+ char *pfb;
+ DWORD dwEngine;
+ DWORD dwEnginePreferred;
+ DWORD dwClipUpdatesNBoxes;
+#ifdef XWIN_EMULATEPSEUDO
+ Bool fEmulatePseudo;
+#endif
+ Bool fFullScreen;
+ Bool fDecoration;
+#ifdef XWIN_MULTIWINDOWEXTWM
+ Bool fMWExtWM;
+ Bool fAnotherWMRunning;
+#endif
+#ifdef XWIN_MULTIWINDOWINTWM
+ Bool fInternalWM;
+#endif
+ Bool fRootless;
+#ifdef XWIN_MULTIWINDOW
+ Bool fMultiWindow;
+#endif
+#if defined(XWIN_MULTIWINDOW) || defined(XWIN_MULTIWINDOWEXTWM)
+ Bool fMultiMonitorOverride;
+#endif
+ Bool fMultipleMonitors;
+ Bool fLessPointer;
+ winResizeMode iResizeMode;
+ Bool fNoTrayIcon;
+ int iE3BTimeout;
+ /* Windows (Alt+F4) and Unix (Ctrl+Alt+Backspace) Killkey */
+ Bool fUseWinKillKey;
+ Bool fUseUnixKillKey;
+ Bool fIgnoreInput;
+
+ /* Did the user explicitly set this screen? */
+ Bool fExplicitScreen;
+} winScreenInfo, *winScreenInfoPtr;
+
+
+/*
+ * Screen privates
+ */
+
+typedef struct _winPrivScreenRec
+{
+ winScreenInfoPtr pScreenInfo;
+
+ Bool fEnabled;
+ Bool fClosed;
+ Bool fActive;
+ Bool fBadDepth;
+
+ int iDeltaZ;
+
+ int iConnectedClients;
+
+ CloseScreenProcPtr CloseScreen;
+
+ DWORD dwRedMask;
+ DWORD dwGreenMask;
+ DWORD dwBlueMask;
+ DWORD dwBitsPerRGB;
+
+ DWORD dwModeKeyStates;
+
+ /* Handle to icons that must be freed */
+ HICON hiconNotifyIcon;
+
+ /* Palette management */
+ ColormapPtr pcmapInstalled;
+
+ /* Pointer to the root visual so we only have to look it up once */
+ VisualPtr pRootVisual;
+
+ /* 3 button emulation variables */
+ int iE3BCachedPress;
+ Bool fE3BFakeButton2Sent;
+
+ /* Privates used by shadow fb GDI server */
+ HBITMAP hbmpShadow;
+ HDC hdcScreen;
+ HDC hdcShadow;
+ HWND hwndScreen;
+ BITMAPINFOHEADER *pbmih;
+
+ /* Privates used by shadow fb and primary fb DirectDraw servers */
+ LPDIRECTDRAW pdd;
+ LPDIRECTDRAWSURFACE pddsPrimary;
+ LPDIRECTDRAW2 pdd2;
+
+ /* Privates used by shadow fb DirectDraw server */
+ LPDIRECTDRAWSURFACE pddsShadow;
+ LPDDSURFACEDESC pddsdShadow;
+
+#ifdef XWIN_PRIMARYFB
+ /* Privates used by primary fb DirectDraw server */
+ LPDIRECTDRAWSURFACE pddsOffscreen;
+ LPDDSURFACEDESC pddsdOffscreen;
+ LPDDSURFACEDESC pddsdPrimary;
+#endif
+
+ /* Privates used by shadow fb DirectDraw Nonlocking server */
+ LPDIRECTDRAW4 pdd4;
+ LPDIRECTDRAWSURFACE4 pddsShadow4;
+ LPDIRECTDRAWSURFACE4 pddsPrimary4;
+ BOOL fRetryCreateSurface;
+
+ /* Privates used by both shadow fb DirectDraw servers */
+ LPDIRECTDRAWCLIPPER pddcPrimary;
+
+#ifdef XWIN_MULTIWINDOWEXTWM
+ /* Privates used by multi-window external window manager */
+ RootlessFrameID widTop;
+ Bool fRestacking;
+#endif
+
+#ifdef XWIN_MULTIWINDOW
+ /* Privates used by multi-window */
+ pthread_t ptWMProc;
+ pthread_t ptXMsgProc;
+ void *pWMInfo;
+#endif
+
+#if defined(XWIN_MULTIWINDOW) || defined(XWIN_MULTIWINDOWEXTWM)
+ /* Privates used by both multi-window and rootless */
+ Bool fRootWindowShown;
+#endif
+
+#if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW)
+ /* Privates used for any module running in a seperate thread */
+ pthread_mutex_t pmServerStarted;
+ Bool fServerStarted;
+#endif
+
+ /* Engine specific functions */
+ winAllocateFBProcPtr pwinAllocateFB;
+ winFreeFBProcPtr pwinFreeFB;
+ winShadowUpdateProcPtr pwinShadowUpdate;
+ winInitScreenProcPtr pwinInitScreen;
+ winCloseScreenProcPtr pwinCloseScreen;
+ winInitVisualsProcPtr pwinInitVisuals;
+ winAdjustVideoModeProcPtr pwinAdjustVideoMode;
+ winCreateBoundingWindowProcPtr pwinCreateBoundingWindow;
+ winFinishScreenInitProcPtr pwinFinishScreenInit;
+ winBltExposedRegionsProcPtr pwinBltExposedRegions;
+ winActivateAppProcPtr pwinActivateApp;
+ winRedrawScreenProcPtr pwinRedrawScreen;
+ winRealizeInstalledPaletteProcPtr pwinRealizeInstalledPalette;
+ winInstallColormapProcPtr pwinInstallColormap;
+ winStoreColorsProcPtr pwinStoreColors;
+ winCreateColormapProcPtr pwinCreateColormap;
+ winDestroyColormapProcPtr pwinDestroyColormap;
+ winHotKeyAltTabProcPtr pwinHotKeyAltTab;
+ winCreatePrimarySurfaceProcPtr pwinCreatePrimarySurface;
+ winReleasePrimarySurfaceProcPtr pwinReleasePrimarySurface;
+
+ winCreateScreenResourcesProc pwinCreateScreenResources;
+
+#ifdef XWIN_MULTIWINDOW
+ /* Window Procedures for MultiWindow mode */
+ winFinishCreateWindowsWindowProcPtr pwinFinishCreateWindowsWindow;
+#endif
+
+ /* Window Procedures for Rootless mode */
+ CreateWindowProcPtr CreateWindow;
+ DestroyWindowProcPtr DestroyWindow;
+ PositionWindowProcPtr PositionWindow;
+ ChangeWindowAttributesProcPtr ChangeWindowAttributes;
+ RealizeWindowProcPtr RealizeWindow;
+ UnrealizeWindowProcPtr UnrealizeWindow;
+ ValidateTreeProcPtr ValidateTree;
+ PostValidateTreeProcPtr PostValidateTree;
+ WindowExposuresProcPtr WindowExposures;
+ CopyWindowProcPtr CopyWindow;
+ ClearToBackgroundProcPtr ClearToBackground;
+ ClipNotifyProcPtr ClipNotify;
+ RestackWindowProcPtr RestackWindow;
+ ReparentWindowProcPtr ReparentWindow;
+ ResizeWindowProcPtr ResizeWindow;
+ MoveWindowProcPtr MoveWindow;
+ SetShapeProcPtr SetShape;
+
+ winCursorRec cursor;
+
+#ifdef XWIN_NATIVEGDI
+ RealizeFontPtr RealizeFont;
+ UnrealizeFontPtr UnrealizeFont;
+#endif
+
+} winPrivScreenRec;
+
+
+#ifdef XWIN_MULTIWINDOWEXTWM
+typedef struct {
+ RootlessWindowPtr pFrame;
+ HWND hWnd;
+ int dwWidthBytes;
+ BITMAPINFOHEADER *pbmihShadow;
+ HBITMAP hbmpShadow;
+ HDC hdcShadow;
+ HDC hdcScreen;
+ BOOL fResized;
+ BOOL fRestackingNow;
+ BOOL fClose;
+ BOOL fMovingOrSizing;
+ BOOL fDestroyed;//for debug
+ char *pfb;
+} win32RootlessWindowRec, *win32RootlessWindowPtr;
+#endif
+
+
+typedef struct {
+ pointer value;
+ XID id;
+} WindowIDPairRec, *WindowIDPairPtr;
+
+
+/*
+ * Extern declares for general global variables
+ */
+
+#include "winglobals.h"
+
+extern winScreenInfo * g_ScreenInfo;
+extern miPointerScreenFuncRec g_winPointerCursorFuncs;
+extern DWORD g_dwEvents;
+#ifdef HAS_DEVWINDOWS
+extern int g_fdMessageQueue;
+#endif
+extern DevPrivateKeyRec g_iScreenPrivateKeyRec;
+#define g_iScreenPrivateKey (&g_iScreenPrivateKeyRec)
+extern DevPrivateKeyRec g_iCmapPrivateKeyRec;
+#define g_iCmapPrivateKey (&g_iCmapPrivateKeyRec)
+extern DevPrivateKeyRec g_iGCPrivateKeyRec;
+#define g_iGCPrivateKey (&g_iGCPrivateKeyRec)
+extern DevPrivateKeyRec g_iPixmapPrivateKeyRec;
+#define g_iPixmapPrivateKey (&g_iPixmapPrivateKeyRec)
+extern DevPrivateKeyRec g_iWindowPrivateKeyRec;
+#define g_iWindowPrivateKey (&g_iWindowPrivateKeyRec)
+
+extern unsigned long g_ulServerGeneration;
+extern DWORD g_dwEnginesSupported;
+extern HINSTANCE g_hInstance;
+extern int g_copyROP[];
+extern int g_patternROP[];
+extern const char * g_pszQueryHost;
+extern DeviceIntPtr g_pwinPointer;
+extern DeviceIntPtr g_pwinKeyboard;
+
+/*
+ * Extern declares for dynamically loaded library function pointers
+ */
+
+extern FARPROC g_fpDirectDrawCreate;
+extern FARPROC g_fpDirectDrawCreateClipper;
+extern FARPROC g_fpTrackMouseEvent;
+
+
+/*
+ * Screen privates macros
+ */
+
+#define winGetScreenPriv(pScreen) ((winPrivScreenPtr) \
+ dixLookupPrivate(&(pScreen)->devPrivates, g_iScreenPrivateKey))
+
+#define winSetScreenPriv(pScreen,v) \
+ dixSetPrivate(&(pScreen)->devPrivates, g_iScreenPrivateKey, v)
+
+#define winScreenPriv(pScreen) \
+ winPrivScreenPtr pScreenPriv = winGetScreenPriv(pScreen)
+
+
+/*
+ * Colormap privates macros
+ */
+
+#define winGetCmapPriv(pCmap) ((winPrivCmapPtr) \
+ dixLookupPrivate(&(pCmap)->devPrivates, g_iCmapPrivateKey))
+
+#define winSetCmapPriv(pCmap,v) \
+ dixSetPrivate(&(pCmap)->devPrivates, g_iCmapPrivateKey, v)
+
+#define winCmapPriv(pCmap) \
+ winPrivCmapPtr pCmapPriv = winGetCmapPriv(pCmap)
+
+
+/*
+ * GC privates macros
+ */
+
+#define winGetGCPriv(pGC) ((winPrivGCPtr) \
+ dixLookupPrivate(&(pGC)->devPrivates, g_iGCPrivateKey))
+
+#define winSetGCPriv(pGC,v) \
+ dixSetPrivate(&(pGC)->devPrivates, g_iGCPrivateKey, v)
+
+#define winGCPriv(pGC) \
+ winPrivGCPtr pGCPriv = winGetGCPriv(pGC)
+
+
+/*
+ * Pixmap privates macros
+ */
+
+#define winGetPixmapPriv(pPixmap) ((winPrivPixmapPtr) \
+ dixLookupPrivate(&(pPixmap)->devPrivates, g_iPixmapPrivateKey))
+
+#define winSetPixmapPriv(pPixmap,v) \
+ dixLookupPrivate(&(pPixmap)->devPrivates, g_iPixmapPrivateKey, v)
+
+#define winPixmapPriv(pPixmap) \
+ winPrivPixmapPtr pPixmapPriv = winGetPixmapPriv(pPixmap)
+
+
+/*
+ * Window privates macros
+ */
+
+#define winGetWindowPriv(pWin) ((winPrivWinPtr) \
+ dixLookupPrivate(&(pWin)->devPrivates, g_iWindowPrivateKey))
+
+#define winSetWindowPriv(pWin,v) \
+ dixLookupPrivate(&(pWin)->devPrivates, g_iWindowPrivateKey, v)
+
+#define winWindowPriv(pWin) \
+ winPrivWinPtr pWinPriv = winGetWindowPriv(pWin)
+
+/*
+ * wrapper macros
+ */
+#define _WIN_WRAP(priv, real, mem, func) {\
+ priv->mem = real->mem; \
+ real->mem = func; \
+}
+
+#define _WIN_UNWRAP(priv, real, mem) {\
+ real->mem = priv->mem; \
+}
+
+#define WIN_WRAP(mem, func) _WIN_WRAP(pScreenPriv, pScreen, mem, func)
+
+#define WIN_UNWRAP(mem) _WIN_UNWRAP(pScreenPriv, pScreen, mem)
+
+/*
+ * BEGIN DDX and DIX Function Prototypes
+ */
+
+
+/*
+ * winallpriv.c
+ */
+
+Bool
+winAllocatePrivates (ScreenPtr pScreen);
+
+Bool
+winInitCmapPrivates (ColormapPtr pCmap, int index);
+
+Bool
+winAllocateCmapPrivates (ColormapPtr pCmap);
+
+
+/*
+ * winauth.c
+ */
+
+#if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW)
+Bool
+winGenerateAuthorization (void);
+void winSetAuthorization(void);
+#endif
+
+
+/*
+ * winblock.c
+ */
+
+void
+winBlockHandler (int nScreen,
+ pointer pBlockData,
+ pointer pTimeout,
+ pointer pReadMask);
+
+
+#ifdef XWIN_NATIVEGDI
+/*
+ * winclip.c
+ */
+
+RegionPtr
+winPixmapToRegionNativeGDI (PixmapPtr pPix);
+#endif
+
+
+#ifdef XWIN_CLIPBOARD
+/*
+ * winclipboardinit.c
+ */
+
+Bool
+winInitClipboard (void);
+
+void
+winFixClipboardChain (int Removed);
+#endif
+
+
+/*
+ * wincmap.c
+ */
+
+void
+winSetColormapFunctions (ScreenPtr pScreen);
+
+Bool
+winCreateDefColormap (ScreenPtr pScreen);
+
+
+/*
+ * wincreatewnd.c
+ */
+
+Bool
+winCreateBoundingWindowFullScreen (ScreenPtr pScreen);
+
+Bool
+winCreateBoundingWindowWindowed (ScreenPtr pScreen);
+
+
+/*
+ * windialogs.c
+ */
+
+int
+GetLiveClients (winPrivScreenPtr pScreenPriv);
+
+void
+winDisplayExitDialog (winPrivScreenPtr pScreenPriv);
+
+void
+winDisplayDepthChangeDialog (winPrivScreenPtr pScreenPriv);
+
+void
+winDisplayAboutDialog (winPrivScreenPtr pScreenPriv);
+
+
+/*
+ * winengine.c
+ */
+
+void
+winDetectSupportedEngines (void);
+
+Bool
+winSetEngine (ScreenPtr pScreen);
+
+Bool
+winGetDDProcAddresses (void);
+
+void
+winReleaseDDProcAddresses(void);
+
+
+/*
+ * winerror.c
+ */
+
+#ifdef DDXOSVERRORF
+void
+OSVenderVErrorF (const char *pszFormat, va_list va_args);
+#endif
+
+void
+winMessageBoxF (const char *pszError, UINT uType, ...);
+
+
+#ifdef XWIN_NATIVEGDI
+/*
+ * winfillsp.c
+ */
+
+void
+winFillSpansNativeGDI (DrawablePtr pDrawable,
+ GCPtr pGC,
+ int nSpans,
+ DDXPointPtr pPoints,
+ int *pWidths,
+ int fSorted);
+#endif
+
+
+#ifdef XWIN_NATIVEGDI
+/*
+ * winfont.c
+ */
+
+Bool
+winRealizeFontNativeGDI (ScreenPtr pScreen, FontPtr pFont);
+
+Bool
+winUnrealizeFontNativeGDI (ScreenPtr pScreen, FontPtr pFont);
+#endif
+
+
+#ifdef XWIN_NATIVEGDI
+/*
+ * wingc.c
+ */
+
+Bool
+winCreateGCNativeGDI (GCPtr pGC);
+#endif
+
+
+#ifdef XWIN_NATIVEGDI
+/*
+ * wingetsp.c
+ */
+
+void
+winGetSpansNativeGDI (DrawablePtr pDrawable,
+ int wMax,
+ DDXPointPtr pPoints,
+ int *pWidths,
+ int nSpans,
+ char *pDst);
+#endif
+
+
+/*
+ * winglobals.c
+ */
+
+void
+winInitializeGlobals (void);
+
+
+/*
+ * winkeybd.c
+ */
+
+void
+winTranslateKey (WPARAM wParam, LPARAM lParam, int *piScanCode);
+
+int
+winKeybdProc (DeviceIntPtr pDeviceInt, int iState);
+
+void
+winInitializeModeKeyStates (void);
+
+void
+winRestoreModeKeyStates (void);
+
+Bool
+winIsFakeCtrl_L (UINT message, WPARAM wParam, LPARAM lParam);
+
+void
+winKeybdReleaseKeys (void);
+
+void
+winSendKeyEvent (DWORD dwKey, Bool fDown);
+
+BOOL
+winCheckKeyPressed(WPARAM wParam, LPARAM lParam);
+
+void
+winFixShiftKeys (int iScanCode);
+
+/*
+ * winkeyhook.c
+ */
+
+Bool
+winInstallKeyboardHookLL (void);
+
+void
+winRemoveKeyboardHookLL (void);
+
+
+/*
+ * winmisc.c
+ */
+
+#ifdef XWIN_NATIVEGDI
+void
+winQueryBestSizeNativeGDI (int class, unsigned short *pWidth,
+ unsigned short *pHeight, ScreenPtr pScreen);
+#endif
+
+CARD8
+winCountBits (DWORD dw);
+
+Bool
+winUpdateFBPointer (ScreenPtr pScreen, void *pbits);
+
+#ifdef XWIN_NATIVEGDI
+BOOL
+winPaintBackground (HWND hwnd, COLORREF colorref);
+#endif
+
+
+/*
+ * winmouse.c
+ */
+
+int
+winMouseProc (DeviceIntPtr pDeviceInt, int iState);
+
+int
+winMouseWheel (ScreenPtr pScreen, int iDeltaZ);
+
+void
+winMouseButtonsSendEvent (int iEventType, int iButton);
+
+int
+winMouseButtonsHandle (ScreenPtr pScreen,
+ int iEventType, int iButton,
+ WPARAM wParam);
+
+void
+winEnqueueMotion(int x, int y);
+
+#ifdef XWIN_NATIVEGDI
+/*
+ * winnativegdi.c
+ */
+
+HBITMAP
+winCreateDIBNativeGDI (int iWidth, int iHeight, int iDepth,
+ BYTE **ppbBits, BITMAPINFO **ppbmi);
+
+Bool
+winSetEngineFunctionsNativeGDI (ScreenPtr pScreen);
+#endif
+
+
+#ifdef XWIN_PRIMARYFB
+/*
+ * winpfbddd.c
+ */
+
+Bool
+winSetEngineFunctionsPrimaryDD (ScreenPtr pScreen);
+#endif
+
+
+#ifdef XWIN_NATIVEGDI
+/*
+ * winpixmap.c
+ */
+
+PixmapPtr
+winCreatePixmapNativeGDI (ScreenPtr pScreen, int width, int height, int depth,
+ unsigned usage_hint);
+
+Bool
+winDestroyPixmapNativeGDI (PixmapPtr pPixmap);
+
+Bool
+winModifyPixmapHeaderNativeGDI (PixmapPtr pPixmap,
+ int iWidth, int iHeight,
+ int iDepth,
+ int iBitsPerPixel,
+ int devKind,
+ pointer pPixData);
+#endif
+
+#ifdef XWIN_NATIVEGDI
+/*
+ * winpolyline.c
+ */
+
+void
+winPolyLineNativeGDI (DrawablePtr pDrawable,
+ GCPtr pGC,
+ int mode,
+ int npt,
+ DDXPointPtr ppt);
+#endif
+
+
+#ifdef XWIN_NATIVEGDI
+/*
+ * winpushpxl.c
+ */
+
+void
+winPushPixels (GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDrawable,
+ int dx, int dy, int xOrg, int yOrg);
+#endif
+
+
+/*
+ * winscrinit.c
+ */
+
+Bool
+winScreenInit (int index,
+ ScreenPtr pScreen,
+ int argc, char **argv);
+
+Bool
+winFinishScreenInitFB (int index,
+ ScreenPtr pScreen,
+ int argc, char **argv);
+
+#if defined(XWIN_NATIVEGDI)
+Bool
+winFinishScreenInitNativeGDI (int index,
+ ScreenPtr pScreen,
+ int argc, char **argv);
+#endif
+
+
+#ifdef XWIN_NATIVEGDI
+/*
+ * winsetsp.c
+ */
+
+void
+winSetSpansNativeGDI (DrawablePtr pDrawable,
+ GCPtr pGC,
+ char *pSrc,
+ DDXPointPtr pPoints,
+ int *pWidth,
+ int nSpans,
+ int fSorted);
+#endif
+
+
+/*
+ * winshaddd.c
+ */
+
+Bool
+winSetEngineFunctionsShadowDD (ScreenPtr pScreen);
+
+
+/*
+ * winshadddnl.c
+ */
+
+Bool
+winSetEngineFunctionsShadowDDNL (ScreenPtr pScreen);
+
+
+/*
+ * winshadgdi.c
+ */
+
+Bool
+winSetEngineFunctionsShadowGDI (ScreenPtr pScreen);
+
+
+/*
+ * winwakeup.c
+ */
+
+void
+winWakeupHandler (int nScreen,
+ pointer pWakeupData,
+ unsigned long ulResult,
+ pointer pReadmask);
+
+
+/*
+ * winwindow.c
+ */
+
+#ifdef XWIN_NATIVEGDI
+Bool
+winCreateWindowNativeGDI (WindowPtr pWin);
+
+Bool
+winDestroyWindowNativeGDI (WindowPtr pWin);
+
+Bool
+winPositionWindowNativeGDI (WindowPtr pWin, int x, int y);
+
+void
+winCopyWindowNativeGDI (WindowPtr pWin,
+ DDXPointRec ptOldOrg,
+ RegionPtr prgnSrc);
+
+Bool
+winChangeWindowAttributesNativeGDI (WindowPtr pWin, unsigned long mask);
+
+Bool
+winUnmapWindowNativeGDI (WindowPtr pWindow);
+
+Bool
+winMapWindowNativeGDI (WindowPtr pWindow);
+#endif
+
+Bool
+winCreateWindowRootless (WindowPtr pWindow);
+
+Bool
+winDestroyWindowRootless (WindowPtr pWindow);
+
+Bool
+winPositionWindowRootless (WindowPtr pWindow, int x, int y);
+
+Bool
+winChangeWindowAttributesRootless (WindowPtr pWindow, unsigned long mask);
+
+Bool
+winUnmapWindowRootless (WindowPtr pWindow);
+
+Bool
+winMapWindowRootless (WindowPtr pWindow);
+
+void
+winSetShapeRootless (WindowPtr pWindow, int kind);
+
+
+/*
+ * winmultiwindowicons.c - Used by both multi-window and Win32Rootless
+ */
+
+HICON
+winXIconToHICON (WindowPtr pWin, int iconSize);
+
+void
+winSelectIcons(WindowPtr pWin, HICON *pIcon, HICON *pSmallIcon);
+
+#ifdef XWIN_MULTIWINDOW
+/*
+ * winmultiwindowshape.c
+ */
+
+void
+winReshapeMultiWindow (WindowPtr pWin);
+
+void
+winSetShapeMultiWindow (WindowPtr pWindow, int kind);
+
+void
+winUpdateRgnMultiWindow (WindowPtr pWindow);
+#endif
+
+
+#ifdef XWIN_MULTIWINDOW
+/*
+ * winmultiwindowwindow.c
+ */
+
+Bool
+winCreateWindowMultiWindow (WindowPtr pWindow);
+
+Bool
+winDestroyWindowMultiWindow (WindowPtr pWindow);
+
+Bool
+winPositionWindowMultiWindow (WindowPtr pWindow, int x, int y);
+
+Bool
+winChangeWindowAttributesMultiWindow (WindowPtr pWindow, unsigned long mask);
+
+Bool
+winUnmapWindowMultiWindow (WindowPtr pWindow);
+
+Bool
+winMapWindowMultiWindow (WindowPtr pWindow);
+
+void
+winReparentWindowMultiWindow (WindowPtr pWin, WindowPtr pPriorParent);
+
+void
+winRestackWindowMultiWindow (WindowPtr pWin, WindowPtr pOldNextSib);
+
+void
+winReorderWindowsMultiWindow (void);
+
+void
+winResizeWindowMultiWindow (WindowPtr pWin, int x, int y, unsigned int w,
+ unsigned int h, WindowPtr pSib);
+void
+winMoveWindowMultiWindow (WindowPtr pWin, int x, int y,
+ WindowPtr pSib, VTKind kind);
+
+void
+winCopyWindowMultiWindow (WindowPtr pWin, DDXPointRec oldpt,
+ RegionPtr oldRegion);
+
+XID
+winGetWindowID (WindowPtr pWin);
+
+int
+winAdjustXWindow (WindowPtr pWin, HWND hwnd);
+#endif
+
+
+#ifdef XWIN_MULTIWINDOW
+/*
+ * winmultiwindowwndproc.c
+ */
+
+LRESULT CALLBACK
+winTopLevelWindowProc (HWND hwnd, UINT message,
+ WPARAM wParam, LPARAM lParam);
+#endif
+
+
+/*
+ * wintrayicon.c
+ */
+
+void
+winInitNotifyIcon (winPrivScreenPtr pScreenPriv, Bool Modify);
+
+void
+winDeleteNotifyIcon (winPrivScreenPtr pScreenPriv);
+
+LRESULT
+winHandleIconMessage (HWND hwnd, UINT message,
+ WPARAM wParam, LPARAM lParam,
+ winPrivScreenPtr pScreenPriv);
+
+
+/*
+ * winwndproc.c
+ */
+
+LRESULT CALLBACK
+winWindowProc (HWND hWnd, UINT message,
+ WPARAM wParam, LPARAM lParam);
+
+
+#ifdef XWIN_MULTIWINDOWEXTWM
+/*
+ * winwin32rootless.c
+ */
+
+Bool
+winMWExtWMCreateFrame (RootlessWindowPtr pFrame, ScreenPtr pScreen,
+ int newX, int newY, RegionPtr pShape);
+
+void
+winMWExtWMDestroyFrame (RootlessFrameID wid);
+
+void
+winMWExtWMMoveFrame (RootlessFrameID wid, ScreenPtr pScreen, int newX, int newY);
+
+void
+winMWExtWMResizeFrame (RootlessFrameID wid, ScreenPtr pScreen,
+ int newX, int newY, unsigned int newW, unsigned int newH,
+ unsigned int gravity);
+
+void
+winMWExtWMRestackFrame (RootlessFrameID wid, RootlessFrameID nextWid);
+
+void
+winMWExtWMReshapeFrame (RootlessFrameID wid, RegionPtr pShape);
+
+void
+winMWExtWMUnmapFrame (RootlessFrameID wid);
+
+void
+winMWExtWMStartDrawing (RootlessFrameID wid, char **pixelData, int *bytesPerRow);
+
+void
+winMWExtWMStopDrawing (RootlessFrameID wid, Bool flush);
+
+void
+winMWExtWMUpdateRegion (RootlessFrameID wid, RegionPtr pDamage);
+
+void
+winMWExtWMDamageRects (RootlessFrameID wid, int count, const BoxRec *rects,
+ int shift_x, int shift_y);
+
+void
+winMWExtWMRootlessSwitchWindow (RootlessWindowPtr pFrame, WindowPtr oldWin);
+
+void
+winMWExtWMCopyBytes (unsigned int width, unsigned int height,
+ const void *src, unsigned int srcRowBytes,
+ void *dst, unsigned int dstRowBytes);
+
+void
+winMWExtWMCopyWindow (RootlessFrameID wid, int dstNrects, const BoxRec *dstRects,
+ int dx, int dy);
+#endif
+
+
+#ifdef XWIN_MULTIWINDOWEXTWM
+/*
+ * winwin32rootlesswindow.c
+ */
+
+void
+winMWExtWMReorderWindows (ScreenPtr pScreen);
+
+void
+winMWExtWMMoveXWindow (WindowPtr pWin, int x, int y);
+
+void
+winMWExtWMResizeXWindow (WindowPtr pWin, int w, int h);
+
+void
+winMWExtWMMoveResizeXWindow (WindowPtr pWin, int x, int y, int w, int h);
+
+void
+winMWExtWMUpdateIcon (Window id);
+
+void
+winMWExtWMUpdateWindowDecoration (win32RootlessWindowPtr pRLWinPriv,
+ winScreenInfoPtr pScreenInfo);
+
+wBOOL CALLBACK
+winMWExtWMDecorateWindow (HWND hwnd, LPARAM lParam);
+
+void
+winMWExtWMRestackWindows (ScreenPtr pScreen);
+#endif
+#ifdef XWIN_MULTIWINDOWINTWM
+Bool
+winIsInternalWMRunning (winScreenInfoPtr pScreenInfo);
+#endif
+
+#ifdef XWIN_MULTIWINDOWEXTWM
+/*
+ * winwin32rootlesswndproc.c
+ */
+
+LRESULT CALLBACK
+winMWExtWMWindowProc (HWND hwnd, UINT message,
+ WPARAM wParam, LPARAM lParam);
+#endif
+
+
+/*
+ * winwindowswm.c
+ */
+
+void
+winWindowsWMSendEvent (int type, unsigned int mask, int which, int arg,
+ Window window, int x, int y, int w, int h);
+
+void
+winWindowsWMExtensionInit (void);
+
+/*
+ * wincursor.c
+ */
+
+Bool
+winInitCursor (ScreenPtr pScreen);
+
+/*
+ * winprocarg.c
+ */
+void
+winInitializeScreens(int maxscreens);
+
+/*
+ * windisplay.c
+ */
+
+void
+winGetDisplayName(char *szDisplay, unsigned int screen);
+
+/*
+ * winrandr.c
+ */
+Bool
+winRandRInit (ScreenPtr pScreen);
+void
+winDoRandRScreenSetSize (ScreenPtr pScreen,
+ CARD16 width,
+ CARD16 height,
+ CARD32 mmWidth,
+ CARD32 mmHeight);
+
+/*
+ * END DDX and DIX Function Prototypes
+ */
+
+#endif /* _WIN_H_ */
+
diff --git a/xorg-server/hw/xwin/winallpriv.c b/xorg-server/hw/xwin/winallpriv.c index ce74a021e..f4078207e 100644 --- a/xorg-server/hw/xwin/winallpriv.c +++ b/xorg-server/hw/xwin/winallpriv.c @@ -48,11 +48,9 @@ winAllocatePrivates (ScreenPtr pScreen) {
winPrivScreenPtr pScreenPriv;
-#if CYGDEBUG
winDebug ("winAllocateScreenPrivates - g_ulServerGeneration: %d "
"serverGeneration: %d\n",
g_ulServerGeneration, serverGeneration);
-#endif
/* We need a new slot for our privates if the screen gen has changed */
if (g_ulServerGeneration != serverGeneration)
@@ -77,7 +75,7 @@ winAllocatePrivates (ScreenPtr pScreen) /* Register our screen private */
if (!dixRegisterPrivateKey(g_iScreenPrivateKey, PRIVATE_SCREEN, 0))
{
- ErrorF ("winAllocatePrivates - AllocateScreenPrivate () failed\n");
+ ErrorF ("winAllocatePrivates - dixRegisterPrivateKey () failed\n");
return FALSE;
}
@@ -118,9 +116,7 @@ winAllocatePrivates (ScreenPtr pScreen) Bool
winInitCmapPrivates (ColormapPtr pcmap, int index)
{
-#if CYGDEBUG
winDebug ("winInitCmapPrivates\n");
-#endif
/*
* I see no way that this function can do anything useful
@@ -146,9 +142,7 @@ winAllocateCmapPrivates (ColormapPtr pCmap) winPrivCmapPtr pCmapPriv;
static unsigned long s_ulPrivateGeneration = 0;
-#if CYGDEBUG
winDebug ("winAllocateCmapPrivates\n");
-#endif
/* Get a new privates index when the server generation changes */
if (s_ulPrivateGeneration != serverGeneration)
@@ -178,9 +172,7 @@ winAllocateCmapPrivates (ColormapPtr pCmap) /* Save the cmap private pointer */
winSetCmapPriv (pCmap, pCmapPriv);
-#if CYGDEBUG
winDebug ("winAllocateCmapPrivates - Returning\n");
-#endif
return TRUE;
}
diff --git a/xorg-server/hw/xwin/winauth.c b/xorg-server/hw/xwin/winauth.c index 7d4372549..b603f70f5 100644 --- a/xorg-server/hw/xwin/winauth.c +++ b/xorg-server/hw/xwin/winauth.c @@ -32,12 +32,15 @@ #include <xwin-config.h>
#endif
+#define GC X11_GC /* To avoid compilation errors later when including win.h (which also defines the GC type) */
+#include <X11/Xlib.h>
+#undef GC
+
#include "win.h"
/* Includes for authorization */
#include "securitysrv.h"
-
/*
* Constants
*/
@@ -57,16 +60,29 @@ static char *g_pAuthData = NULL; * Code to generate a MIT-MAGIC-COOKIE-1, copied from under XCSECURITY
*/
+
+
#ifndef XCSECURITY
static
void
GenerateRandomData (int len, char *buf)
{
int fd;
+#ifdef _MSC_VER
+ static HANDLE hAdvApi32;
+ static BOOLEAN (_stdcall * RtlGenRandom)(void *,unsigned long);
+ if (!hAdvApi32)
+ {
+ hAdvApi32=LoadLibrary("advapi32.dll");
+ RtlGenRandom=(BOOLEAN (_stdcall *)(void*,unsigned long))GetProcAddress(hAdvApi32,"SystemFunction036");
+ }
+ RtlGenRandom(buf, len);
+#else
fd = open("/dev/urandom", O_RDONLY);
read(fd, buf, len);
close(fd);
+#endif
}
@@ -124,7 +140,6 @@ GenerateAuthorization( Bool
winGenerateAuthorization (void)
{
- Bool fFreeAuth = FALSE;
SecurityAuthorizationPtr pAuth = NULL;
/* Call OS layer to generate authorization key */
@@ -139,13 +154,14 @@ winGenerateAuthorization (void) ErrorF ("winGenerateAuthorization - GenerateAuthorization failed\n");
goto auth_bailout;
}
-
+#ifdef WINDBG
else
{
winDebug("winGenerateAuthorization - GenerateAuthorization success!\n"
"AuthDataLen: %d AuthData: %s\n",
g_uiAuthDataLen, g_pAuthData);
}
+#endif
#ifdef XCSECURITY
/* Allocate structure for additional auth information */
@@ -174,19 +190,16 @@ winGenerateAuthorization (void) pAuth))
{
ErrorF ("winGenerateAuthorization - AddResource failed for auth.\n");
- fFreeAuth = TRUE;
goto auth_bailout;
}
/* Don't free the auth data, since it is still used internally */
- pAuth = NULL;
#endif
return TRUE;
auth_bailout:
- if (fFreeAuth)
- free(pAuth);
+ free(pAuth);
return FALSE;
}
@@ -195,6 +208,7 @@ winGenerateAuthorization (void) void
winSetAuthorization(void)
{
+ if (g_pAuthData)
XSetAuthorization (AUTH_NAME,
strlen (AUTH_NAME),
g_pAuthData,
diff --git a/xorg-server/hw/xwin/winclip.c b/xorg-server/hw/xwin/winclip.c index aab7d632d..cbbf08c59 100644 --- a/xorg-server/hw/xwin/winclip.c +++ b/xorg-server/hw/xwin/winclip.c @@ -37,6 +37,6 @@ RegionPtr winPixmapToRegionNativeGDI (PixmapPtr pPix) { - ErrorF ("winPixmapToRegion()\n"); + winDebug ("winPixmapToRegion()\n"); return NULL; } diff --git a/xorg-server/hw/xwin/winclipboard.h b/xorg-server/hw/xwin/winclipboard.h index 089c2913b..e55f6023d 100644 --- a/xorg-server/hw/xwin/winclipboard.h +++ b/xorg-server/hw/xwin/winclipboard.h @@ -34,7 +34,9 @@ #include <assert.h> #include <stdio.h> #include <stdlib.h> +#ifndef _MSC_VER #include <unistd.h> +#endif #ifdef __CYGWIN__ #include <sys/select.h> #else @@ -43,6 +45,9 @@ #endif #include <fcntl.h> #include <setjmp.h> +#ifdef _MSC_VER +typedef int pid_t; +#endif #include <pthread.h> /* X headers */ @@ -50,7 +55,6 @@ #include <X11/Xatom.h> #include <X11/Xproto.h> #include <X11/Xutil.h> -#include <X11/Xlocale.h> /* Windows headers */ #include <X11/Xwindows.h> @@ -72,17 +76,13 @@ #define WIN_XEVENTS_CONVERT 2 #define WIN_XEVENTS_NOTIFY 3 -#define WM_WM_REINIT (WM_USER + 1) +#include "winmsg.h" /* * References to external symbols */ extern char *display; -extern void ErrorF (const char* /*f*/, ...); -extern void winDebug (const char *format, ...); -extern void winErrorFVerb (int verb, const char *format, ...); - /* * winclipboardinit.c @@ -145,5 +145,6 @@ int winClipboardFlushXEvents (HWND hwnd, int iWindow, Display *pDisplay, - Bool fUnicodeSupport); + Bool fUnicodeSupport, + Bool ClipboardOpened); #endif diff --git a/xorg-server/hw/xwin/winclipboardinit.c b/xorg-server/hw/xwin/winclipboardinit.c index a8b038c5c..d5990900a 100644 --- a/xorg-server/hw/xwin/winclipboardinit.c +++ b/xorg-server/hw/xwin/winclipboardinit.c @@ -33,6 +33,9 @@ #endif
#include "dixstruct.h"
#include "winclipboard.h"
+#include "objbase.h"
+#include "ddraw.h"
+#include "winwindow.h"
/*
@@ -61,7 +64,7 @@ extern HWND g_hwndClipboard; Bool
winInitClipboard (void)
{
- ErrorF ("winInitClipboard ()\n");
+ winDebug ("winInitClipboard ()\n");
/* Wrap some internal server functions */
if (ProcVector[X_SetSelectionOwner] != winProcSetSelectionOwner)
@@ -135,11 +138,11 @@ winClipboardCreateMessagingWindow (void) }
void
-winFixClipboardChain (void)
+winFixClipboardChain (int Removed)
{
if (g_fClipboard
&& g_hwndClipboard)
{
- PostMessage (g_hwndClipboard, WM_WM_REINIT, 0, 0);
+ PostMessage (g_hwndClipboard, WM_WM_REINIT, Removed, 0);
}
}
diff --git a/xorg-server/hw/xwin/winclipboardtextconv.c b/xorg-server/hw/xwin/winclipboardtextconv.c index 400f560fa..487df81ef 100644 --- a/xorg-server/hw/xwin/winclipboardtextconv.c +++ b/xorg-server/hw/xwin/winclipboardtextconv.c @@ -1,155 +1,155 @@ -/* - *Copyright (C) 2003-2004 Harold L Hunt II All Rights Reserved. - * - *Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - *"Software"), to deal in the Software without restriction, including - *without limitation the rights to use, copy, modify, merge, publish, - *distribute, sublicense, and/or sell copies of the Software, and to - *permit persons to whom the Software is furnished to do so, subject to - *the following conditions: - * - *The above copyright notice and this permission notice shall be - *included in all copies or substantial portions of the Software. - * - *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - *NONINFRINGEMENT. IN NO EVENT SHALL HAROLD L HUNT II BE LIABLE FOR - *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - *Except as contained in this notice, the name of Harold L Hunt II - *shall not be used in advertising or otherwise to promote the sale, use - *or other dealings in this Software without prior written authorization - *from Harold L Hunt II. - * - * Authors: Harold L Hunt II - */ - -#ifdef HAVE_XWIN_CONFIG_H -#include <xwin-config.h> -#endif -#include "win.h" -#include <stdio.h> -#include <stdlib.h> - -void -winClipboardDOStoUNIX (char *pszSrc, int iLength); -void -winClipboardUNIXtoDOS (unsigned char **ppszData, int iLength); - -/* - * Convert \r\n to \n - * - * NOTE: This was heavily inspired by, Cygwin's - * winsup/cygwin/fhandler.cc/fhandler_base::read () - */ - -void -winClipboardDOStoUNIX (char *pszSrc, int iLength) -{ - char *pszDest = pszSrc; - char *pszEnd = pszSrc + iLength; - - /* Loop until the last character */ - while (pszSrc < pszEnd) - { - /* Copy the current source character to current destination character */ - *pszDest = *pszSrc; - - /* Advance to the next source character */ - pszSrc++; - - /* Don't advance the destination character if we need to drop an \r */ - if (*pszDest != '\r' || *pszSrc != '\n') - pszDest++; - } - - /* Move the terminating null */ - *pszDest = '\0'; -} - - -/* - * Convert \n to \r\n - */ - -void -winClipboardUNIXtoDOS (unsigned char **ppszData, int iLength) -{ - int iNewlineCount = 0; - unsigned char *pszSrc = *ppszData; - unsigned char *pszEnd = pszSrc + iLength; - unsigned char *pszDest = NULL, *pszDestBegin = NULL; - - winDebug("UNIXtoDOS () - Original data:'%s'\n", *ppszData); - - /* Count \n characters without leading \r */ - while (pszSrc < pszEnd) - { - /* Skip ahead two character if found set of \r\n */ - if (*pszSrc == '\r' && pszSrc + 1 < pszEnd && *(pszSrc + 1) == '\n') - { - pszSrc += 2; - continue; - } - - /* Increment the count if found naked \n */ - if (*pszSrc == '\n') - { - iNewlineCount++; - } - - pszSrc++; - } - - /* Return if no naked \n's */ - if (iNewlineCount == 0) - return; - - /* Allocate a new string */ - pszDestBegin = pszDest = malloc (iLength + iNewlineCount + 1); - - /* Set source pointer to beginning of data string */ - pszSrc = *ppszData; - - /* Loop through all characters in source string */ - while (pszSrc < pszEnd) - { - /* Copy line endings that are already valid */ - if (*pszSrc == '\r' && pszSrc + 1 < pszEnd && *(pszSrc + 1) == '\n') - { - *pszDest = *pszSrc; - *(pszDest + 1) = *(pszSrc + 1); - pszDest += 2; - pszSrc += 2; - continue; - } - - /* Add \r to naked \n's */ - if (*pszSrc == '\n') - { - *pszDest = '\r'; - *(pszDest + 1) = *pszSrc; - pszDest += 2; - pszSrc += 1; - continue; - } - - /* Copy normal characters */ - *pszDest = *pszSrc; - pszSrc++; - pszDest++; - } - - /* Put terminating null at end of new string */ - *pszDest = '\0'; - - /* Swap string pointers */ - free (*ppszData); - *ppszData = pszDestBegin; - - winDebug("UNIXtoDOS () - Final string:'%s'\n", pszDestBegin); -} +/*
+ *Copyright (C) 2003-2004 Harold L Hunt II All Rights Reserved.
+ *
+ *Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ *"Software"), to deal in the Software without restriction, including
+ *without limitation the rights to use, copy, modify, merge, publish,
+ *distribute, sublicense, and/or sell copies of the Software, and to
+ *permit persons to whom the Software is furnished to do so, subject to
+ *the following conditions:
+ *
+ *The above copyright notice and this permission notice shall be
+ *included in all copies or substantial portions of the Software.
+ *
+ *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *NONINFRINGEMENT. IN NO EVENT SHALL HAROLD L HUNT II BE LIABLE FOR
+ *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+ *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *Except as contained in this notice, the name of Harold L Hunt II
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from Harold L Hunt II.
+ *
+ * Authors: Harold L Hunt II
+ */
+
+#ifdef HAVE_XWIN_CONFIG_H
+#include <xwin-config.h>
+#endif
+#include "win.h"
+#include <stdio.h>
+#include <stdlib.h>
+
+void
+winClipboardDOStoUNIX (char *pszSrc, int iLength);
+void
+winClipboardUNIXtoDOS (unsigned char **ppszData, int iLength);
+
+/*
+ * Convert \r\n to \n
+ *
+ * NOTE: This was heavily inspired by, Cygwin's
+ * winsup/cygwin/fhandler.cc/fhandler_base::read ()
+ */
+
+void
+winClipboardDOStoUNIX (char *pszSrc, int iLength)
+{
+ char *pszDest = pszSrc;
+ char *pszEnd = pszSrc + iLength;
+
+ /* Loop until the last character */
+ while (pszSrc < pszEnd)
+ {
+ /* Copy the current source character to current destination character */
+ *pszDest = *pszSrc;
+
+ /* Advance to the next source character */
+ pszSrc++;
+
+ /* Don't advance the destination character if we need to drop an \r */
+ if (*pszDest != '\r' || *pszSrc != '\n')
+ pszDest++;
+ }
+
+ /* Move the terminating null */
+ *pszDest = '\0';
+}
+
+
+/*
+ * Convert \n to \r\n
+ */
+
+void
+winClipboardUNIXtoDOS (unsigned char **ppszData, int iLength)
+{
+ int iNewlineCount = 0;
+ unsigned char *pszSrc = *ppszData;
+ unsigned char *pszEnd = pszSrc + iLength;
+ unsigned char *pszDest = NULL, *pszDestBegin = NULL;
+
+ winDebug("UNIXtoDOS () - Original data:'%s'\n", *ppszData);
+
+ /* Count \n characters without leading \r */
+ while (pszSrc < pszEnd)
+ {
+ /* Skip ahead two character if found set of \r\n */
+ if (*pszSrc == '\r' && pszSrc + 1 < pszEnd && *(pszSrc + 1) == '\n')
+ {
+ pszSrc += 2;
+ continue;
+ }
+
+ /* Increment the count if found naked \n */
+ if (*pszSrc == '\n')
+ {
+ iNewlineCount++;
+ }
+
+ pszSrc++;
+ }
+
+ /* Return if no naked \n's */
+ if (iNewlineCount == 0)
+ return;
+
+ /* Allocate a new string */
+ pszDestBegin = pszDest = malloc (iLength + iNewlineCount + 1);
+
+ /* Set source pointer to beginning of data string */
+ pszSrc = *ppszData;
+
+ /* Loop through all characters in source string */
+ while (pszSrc < pszEnd)
+ {
+ /* Copy line endings that are already valid */
+ if (*pszSrc == '\r' && pszSrc + 1 < pszEnd && *(pszSrc + 1) == '\n')
+ {
+ *pszDest = *pszSrc;
+ *(pszDest + 1) = *(pszSrc + 1);
+ pszDest += 2;
+ pszSrc += 2;
+ continue;
+ }
+
+ /* Add \r to naked \n's */
+ if (*pszSrc == '\n')
+ {
+ *pszDest = '\r';
+ *(pszDest + 1) = *pszSrc;
+ pszDest += 2;
+ pszSrc += 1;
+ continue;
+ }
+
+ /* Copy normal characters */
+ *pszDest = *pszSrc;
+ pszSrc++;
+ pszDest++;
+ }
+
+ /* Put terminating null at end of new string */
+ *pszDest = '\0';
+
+ /* Swap string pointers */
+ free (*ppszData);
+ *ppszData = pszDestBegin;
+
+ winDebug("UNIXtoDOS () - Final string:'%s'\n", pszDestBegin);
+}
diff --git a/xorg-server/hw/xwin/winclipboardthread.c b/xorg-server/hw/xwin/winclipboardthread.c index 34a963ce8..b3ffff689 100644 --- a/xorg-server/hw/xwin/winclipboardthread.c +++ b/xorg-server/hw/xwin/winclipboardthread.c @@ -39,7 +39,11 @@ #include <errno.h>
#endif
#include "misc.h"
+#include "winmsg.h"
+#ifdef _MSC_VER
+#define snprintf _snprintf
+#endif
/*
* References to external symbols
@@ -47,10 +51,12 @@ extern Bool g_fUnicodeClipboard;
extern unsigned long serverGeneration;
+extern Bool g_fClipboardLaunched;
extern Bool g_fClipboardStarted;
extern HWND g_hwndClipboard;
extern void *g_pClipboardDisplay;
extern Window g_iClipboardWindow;
+extern Bool g_fClipboardPrimary;
/*
@@ -58,6 +64,9 @@ extern Window g_iClipboardWindow; */
static jmp_buf g_jmpEntry;
+static XIOErrorHandler g_winClipboardOldIOErrorHandler;
+static pthread_t g_winClipboardProcThread;
+
Bool g_fUnicodeSupport = FALSE;
Bool g_fUseUnicode = FALSE;
@@ -72,6 +81,8 @@ winClipboardErrorHandler (Display *pDisplay, XErrorEvent *pErr); static int
winClipboardIOErrorHandler (Display *pDisplay);
+static void
+winClipboardThreadExit(void *arg);
/*
* Main thread function
@@ -98,7 +109,9 @@ winClipboardProc (void *pvNotUsed) char szDisplay[512];
int iSelectError;
- ErrorF ("winClipboardProc - Hello\n");
+ pthread_cleanup_push(&winClipboardThreadExit, NULL);
+
+ winDebug ("winClipboardProc - Hello\n");
/* Do we have Unicode support? */
g_fUnicodeSupport = winClipboardDetectUnicodeSupport ();
@@ -109,18 +122,16 @@ winClipboardProc (void *pvNotUsed) /* Save the Unicode support flag in a global */
g_fUseUnicode = fUseUnicode;
- /* Allow multiple threads to access Xlib */
- if (XInitThreads () == 0)
- {
- ErrorF ("winClipboardProc - XInitThreads failed.\n");
- pthread_exit (NULL);
- }
+ /* Create Windows messaging window */
+ hwnd = winClipboardCreateMessagingWindow ();
+
+ /* Save copy of HWND in screen privates */
+ g_hwndClipboard = hwnd;
- /* See if X supports the current locale */
- if (XSupportsLocale () == False)
- {
- ErrorF ("winClipboardProc - Warning: Locale not supported by X.\n");
- }
+ /* Set error handler */
+ XSetErrorHandler (winClipboardErrorHandler);
+ g_winClipboardProcThread = pthread_self();
+ g_winClipboardOldIOErrorHandler = XSetIOErrorHandler (winClipboardIOErrorHandler);
/* Set jump point for Error exits */
iReturn = setjmp (g_jmpEntry);
@@ -132,22 +143,18 @@ winClipboardProc (void *pvNotUsed) /* setjmp returned an unknown value, exit */
ErrorF ("winClipboardProc - setjmp returned: %d exiting\n",
iReturn);
- pthread_exit (NULL);
+ goto thread_errorexit;
}
else if (iReturn == WIN_JMP_ERROR_IO)
{
/* TODO: Cleanup the Win32 window and free any allocated memory */
ErrorF ("winClipboardProc - setjmp returned for IO Error Handler.\n");
- pthread_exit (NULL);
+ //goto thread_errorexit;
}
/* Use our generated cookie for authentication */
winSetAuthorization();
- /* Set error handler */
- XSetErrorHandler (winClipboardErrorHandler);
- XSetIOErrorHandler (winClipboardIOErrorHandler);
-
/* Initialize retry count */
iRetries = 0;
@@ -159,13 +166,10 @@ winClipboardProc (void *pvNotUsed) * for all screens on the display. That is why there is only
* one clipboard client thread.
*/
- snprintf (szDisplay,
- 512,
- "127.0.0.1:%s.0",
- display);
+ winGetDisplayName(szDisplay,0);
/* Print the display connection string */
- ErrorF ("winClipboardProc - DISPLAY=%s\n", szDisplay);
+ winDebug ("winClipboardProc - DISPLAY=%s\n", szDisplay);
/* Open the X display */
do
@@ -189,25 +193,27 @@ winClipboardProc (void *pvNotUsed) if (pDisplay == NULL)
{
ErrorF ("winClipboardProc - Failed opening the display, giving up\n");
- pthread_exit (NULL);
+ goto thread_errorexit;
}
/* Save the display in the screen privates */
g_pClipboardDisplay = pDisplay;
- ErrorF ("winClipboardProc - XOpenDisplay () returned and "
+ winDebug ("winClipboardProc - XOpenDisplay () returned and "
"successfully opened the display.\n");
/* Get our connection number */
iConnectionNumber = ConnectionNumber (pDisplay);
+ winDebug("Clipboard is using socket %d\n",iConnectionNumber);
+
#ifdef HAS_DEVWINDOWS
/* Open a file descriptor for the windows message queue */
- fdMessageQueue = open (WIN_MSG_QUEUE_FNAME, O_RDONLY);
+ fdMessageQueue = open (WIN_MSG_QUEUE_FNAME, _O_RDONLY);
if (fdMessageQueue == -1)
{
ErrorF ("winClipboardProc - Failed opening %s\n", WIN_MSG_QUEUE_FNAME);
- pthread_exit (NULL);
+ goto thread_errorexit;
}
/* Find max of our file descriptors */
@@ -219,6 +225,10 @@ winClipboardProc (void *pvNotUsed) /* Create atoms */
atomClipboard = XInternAtom (pDisplay, "CLIPBOARD", False);
atomClipboardManager = XInternAtom (pDisplay, "CLIPBOARD_MANAGER", False);
+ XInternAtom (pDisplay, WIN_LOCAL_PROPERTY, False);
+ XInternAtom (pDisplay, "UTF8_STRING", False);
+ XInternAtom (pDisplay, "COMPOUND_TEXT", False);
+ XInternAtom (pDisplay, "TARGETS", False);
/* Create a messaging window */
iWindow = XCreateSimpleWindow (pDisplay,
@@ -231,9 +241,11 @@ winClipboardProc (void *pvNotUsed) if (iWindow == 0)
{
ErrorF ("winClipboardProc - Could not create an X window.\n");
- pthread_exit (NULL);
+ goto thread_errorexit;
}
+ XStoreName(pDisplay, iWindow, "xwinclip");
+
/* Select event types to watch */
if (XSelectInput (pDisplay,
iWindow,
@@ -244,33 +256,31 @@ winClipboardProc (void *pvNotUsed) /* Save the window in the screen privates */
g_iClipboardWindow = iWindow;
- /* Create Windows messaging window */
- hwnd = winClipboardCreateMessagingWindow ();
-
- /* Save copy of HWND in screen privates */
- g_hwndClipboard = hwnd;
-
/* Assert ownership of selections if Win32 clipboard is owned */
if (NULL != GetClipboardOwner ())
{
- /* PRIMARY */
- iReturn = XSetSelectionOwner (pDisplay, XA_PRIMARY,
- iWindow, CurrentTime);
- if (iReturn == BadAtom || iReturn == BadWindow ||
- XGetSelectionOwner (pDisplay, XA_PRIMARY) != iWindow)
+ if (g_fClipboardPrimary)
+ {
+ /* PRIMARY */
+ winDebug("winClipboardProc - asserted ownership.\n");
+ iReturn = XSetSelectionOwner (pDisplay, XA_PRIMARY,
+ iWindow, CurrentTime);
+ if (iReturn == BadAtom || iReturn == BadWindow /*||
+ XGetSelectionOwner (pDisplay, XA_PRIMARY) != iWindow*/)
{
ErrorF ("winClipboardProc - Could not set PRIMARY owner\n");
- pthread_exit (NULL);
+ goto thread_errorexit;
}
+ }
/* CLIPBOARD */
iReturn = XSetSelectionOwner (pDisplay, atomClipboard,
iWindow, CurrentTime);
- if (iReturn == BadAtom || iReturn == BadWindow ||
- XGetSelectionOwner (pDisplay, atomClipboard) != iWindow)
+ if (iReturn == BadAtom || iReturn == BadWindow /*||
+ XGetSelectionOwner (pDisplay, atomClipboard) != iWindow*/)
{
ErrorF ("winClipboardProc - Could not set CLIPBOARD owner\n");
- pthread_exit (NULL);
+ goto thread_errorexit;
}
}
@@ -280,15 +290,20 @@ winClipboardProc (void *pvNotUsed) * because there may be events in local data structures
* already.
*/
- winClipboardFlushXEvents (hwnd,
+ /*winClipboardFlushXEvents (hwnd,
iWindow,
pDisplay,
fUseUnicode);
-
+ */
/* Pre-flush Windows messages */
+ winDebug ("Start flushing \n");
if (!winClipboardFlushWindowsMessageQueue (hwnd))
- return 0;
+ {
+ ErrorF ("winClipboardFlushWindowsMessageQueue - returned 0\n");
+ goto thread_errorexit;
+ }
+ winDebug ("winClipboardProc - Started\n");
/* Signal that the clipboard client has started */
g_fClipboardStarted = TRUE;
@@ -343,21 +358,24 @@ winClipboardProc (void *pvNotUsed) }
/* Branch on which descriptor became active */
- if (FD_ISSET (iConnectionNumber, &fdsRead))
- {
+// if (FD_ISSET (iConnectionNumber, &fdsRead))
+// { Also do it when no read since winClipboardFlushXEvents
+// is sending the output.
/* Process X events */
/* Exit when we see that server is shutting down */
iReturn = winClipboardFlushXEvents (hwnd,
iWindow,
pDisplay,
- fUseUnicode);
+ fUseUnicode,
+ FALSE
+ );
if (WIN_XEVENTS_SHUTDOWN == iReturn)
{
ErrorF ("winClipboardProc - winClipboardFlushXEvents "
"trapped shutdown event, exiting main loop.\n");
break;
}
- }
+// }
#ifdef HAS_DEVWINDOWS
/* Check for Windows event ready */
@@ -383,8 +401,10 @@ winClipboardProc (void *pvNotUsed) iReturn = XDestroyWindow (pDisplay, iWindow);
if (iReturn == BadWindow)
ErrorF ("winClipboardProc - XDestroyWindow returned BadWindow.\n");
+#ifdef WINDBG
else
- ErrorF ("winClipboardProc - XDestroyWindow succeeded.\n");
+ winDebug ("winClipboardProc - XDestroyWindow succeeded.\n");
+#endif
}
@@ -415,9 +435,28 @@ winClipboardProc (void *pvNotUsed) }
#endif
+ goto commonexit;
+
+thread_errorexit:
+ if (g_pClipboardDisplay && g_iClipboardWindow)
+ {
+ iReturn = XDestroyWindow (g_pClipboardDisplay, g_iClipboardWindow);
+ if (iReturn == BadWindow)
+ ErrorF ("winClipboardProc - XDestroyWindow returned BadWindow.\n");
+#ifdef WINDBG
+ else
+ winDebug ("winClipboardProc - XDestroyWindow succeeded.\n");
+#endif
+ }
+ winDebug ("Clipboard thread died.\n");
+
+commonexit:
g_iClipboardWindow = None;
g_pClipboardDisplay = NULL;
- g_hwndClipboard = NULL;
+ g_fClipboardLaunched = FALSE;
+ g_fClipboardStarted = FALSE;
+
+ pthread_cleanup_pop(0);
return NULL;
}
@@ -437,11 +476,17 @@ winClipboardErrorHandler (Display *pDisplay, XErrorEvent *pErr) pszErrorMsg,
sizeof (pszErrorMsg));
ErrorF ("winClipboardErrorHandler - ERROR: \n\t%s\n"
- "\tSerial: %lu, Request Code: %d, Minor Code: %d\n",
- pszErrorMsg,
- pErr->serial,
- pErr->request_code,
- pErr->minor_code);
+ " errorCode %d\n"
+ " serial %lu\n"
+ " resourceID 0x%x\n"
+ " majorCode %d\n"
+ " minorCode %d\n"
+ , pszErrorMsg
+ , pErr->error_code
+ , pErr->serial
+ , pErr->resourceid
+ , pErr->request_code
+ , pErr->minor_code);
return 0;
}
@@ -455,8 +500,26 @@ winClipboardIOErrorHandler (Display *pDisplay) {
ErrorF ("winClipboardIOErrorHandler!\n\n");
- /* Restart at the main entry point */
- longjmp (g_jmpEntry, WIN_JMP_ERROR_IO);
-
+ if (pthread_equal(pthread_self(),g_winClipboardProcThread))
+ {
+ /* Restart at the main entry point */
+ longjmp (g_jmpEntry, WIN_JMP_ERROR_IO);
+ }
+
+ if (g_winClipboardOldIOErrorHandler)
+ g_winClipboardOldIOErrorHandler(pDisplay);
+
return 0;
}
+
+/*
+ * winClipboardThreadExit - Thread exit handler
+ */
+
+static void
+winClipboardThreadExit(void *arg)
+{
+ /* clipboard thread has exited, stop server as well */
+ AbortDDX();
+ TerminateProcess(GetCurrentProcess(),1);
+}
diff --git a/xorg-server/hw/xwin/winclipboardunicode.c b/xorg-server/hw/xwin/winclipboardunicode.c index ba86915a4..947475509 100644 --- a/xorg-server/hw/xwin/winclipboardunicode.c +++ b/xorg-server/hw/xwin/winclipboardunicode.c @@ -43,25 +43,43 @@ Bool winClipboardDetectUnicodeSupport (void) { Bool fReturn = FALSE; - OSVERSIONINFO osvi = {0}; + OSVERSIONINFOEX osvi = {0}; /* Get operating system version information */ osvi.dwOSVersionInfoSize = sizeof (osvi); - GetVersionEx (&osvi); + GetVersionEx ((LPOSVERSIONINFO)&osvi); /* Branch on platform ID */ switch (osvi.dwPlatformId) { case VER_PLATFORM_WIN32_NT: - /* Unicode supported on NT only */ - ErrorF ("DetectUnicodeSupport - Windows NT/2000/XP\n"); - fReturn = TRUE; + if (osvi.dwMajorVersion >= 6) + { + if (osvi.wProductType == VER_NT_WORKSTATION) + winDebug ("OS: Windows Vista\n"); + else + winDebug ("OS: Windows Server 2008\n"); + fReturn = TRUE; + } + else if (osvi.dwMajorVersion == 5) + { + if (osvi.dwMinorVersion == 2) + { + winDebug ("OS: Windows 2003\n"); + fReturn = TRUE; + } + else if (osvi.dwMinorVersion == 1) + { + winDebug ("OS: Windows XP\n"); + fReturn = TRUE; + } + else if (osvi.dwMinorVersion == 0) winDebug ("OS: Windows 2000\n"); + } + else if (osvi.dwMajorVersion <= 4) winDebug ("OS: Windows NT\n"); break; case VER_PLATFORM_WIN32_WINDOWS: - /* Unicode is not supported on non-NT */ - ErrorF ("DetectUnicodeSupport - Windows 95/98/Me\n"); - fReturn = FALSE; + winDebug ("OS: Windows 95/98/Me\n"); break; } diff --git a/xorg-server/hw/xwin/winclipboardwndproc.c b/xorg-server/hw/xwin/winclipboardwndproc.c index 9394b04db..57413b1c3 100644 --- a/xorg-server/hw/xwin/winclipboardwndproc.c +++ b/xorg-server/hw/xwin/winclipboardwndproc.c @@ -1,629 +1,566 @@ -/* - *Copyright (C) 2003-2004 Harold L Hunt II All Rights Reserved. - *Copyright (C) Colin Harrison 2005-2008 - * - *Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - *"Software"), to deal in the Software without restriction, including - *without limitation the rights to use, copy, modify, merge, publish, - *distribute, sublicense, and/or sell copies of the Software, and to - *permit persons to whom the Software is furnished to do so, subject to - *the following conditions: - * - *The above copyright notice and this permission notice shall be - *included in all copies or substantial portions of the Software. - * - *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - *NONINFRINGEMENT. IN NO EVENT SHALL HAROLD L HUNT II BE LIABLE FOR - *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - *Except as contained in this notice, the name of the copyright holder(s) - *and author(s) shall not be used in advertising or otherwise to promote - *the sale, use or other dealings in this Software without prior written - *authorization from the copyright holder(s) and author(s). - * - * Authors: Harold L Hunt II - * Colin Harrison - */ - -#ifdef HAVE_XWIN_CONFIG_H -#include <xwin-config.h> -#endif -#include <sys/types.h> -#include <sys/time.h> -#include "winclipboard.h" -#include "misc.h" - -/* - * Constants - */ - -#define WIN_CLIPBOARD_PROP "cyg_clipboard_prop" -#define WIN_POLL_TIMEOUT 1 - - -/* - * References to external symbols - */ - -extern Bool g_fUseUnicode; -extern Bool g_fUnicodeSupport; -extern void *g_pClipboardDisplay; -extern Window g_iClipboardWindow; -extern Atom g_atomLastOwnedSelection; - -/* BPS - g_hwndClipboard needed for X app->Windows paste fix */ -extern HWND g_hwndClipboard; - -/* - * Local function prototypes - */ - -static int -winProcessXEventsTimeout (HWND hwnd, int iWindow, Display *pDisplay, - Bool fUseUnicode, int iTimeoutSec); - - -/* - * Process X events up to specified timeout - */ - -static int -winProcessXEventsTimeout (HWND hwnd, int iWindow, Display *pDisplay, - Bool fUseUnicode, int iTimeoutSec) -{ - int iConnNumber; - struct timeval tv; - int iReturn; - DWORD dwStopTime = (GetTickCount () / 1000) + iTimeoutSec; - - /* We need to ensure that all pending events are processed */ - XSync (pDisplay, FALSE); - - /* Get our connection number */ - iConnNumber = ConnectionNumber (pDisplay); - - /* Loop for X events */ - while (1) - { - fd_set fdsRead; - - /* Setup the file descriptor set */ - FD_ZERO (&fdsRead); - FD_SET (iConnNumber, &fdsRead); - - /* Adjust timeout */ - tv.tv_sec = dwStopTime - (GetTickCount () / 1000); - tv.tv_usec = 0; - - /* Break out if no time left */ - if (tv.tv_sec < 0) - return WIN_XEVENTS_SUCCESS; - - /* Wait for an X event */ - iReturn = select (iConnNumber + 1,/* Highest fds number */ - &fdsRead, /* Read mask */ - NULL, /* No write mask */ - NULL, /* No exception mask */ - &tv); /* No timeout */ - if (iReturn < 0) - { - ErrorF ("winProcessXEventsTimeout - Call to select () failed: %d. " - "Bailing.\n", iReturn); - break; - } - - /* Branch on which descriptor became active */ - if (FD_ISSET (iConnNumber, &fdsRead)) - { - /* Process X events */ - /* Exit when we see that server is shutting down */ - iReturn = winClipboardFlushXEvents (hwnd, - iWindow, - pDisplay, - fUseUnicode); - if (WIN_XEVENTS_NOTIFY == iReturn - || WIN_XEVENTS_CONVERT == iReturn) - { - /* Bail out if convert or notify processed */ - return iReturn; - } - } - } - - return WIN_XEVENTS_SUCCESS; -} - - -/* - * Process a given Windows message - */ - -/* BPS - Define our own message, which we'll post to ourselves to facilitate - * resetting the delayed rendering mechanism after each paste from X app to - * Windows app. TODO - Perhaps move to win.h with the other WM_USER messages. - */ -#define WM_USER_PASTE_COMPLETE (WM_USER + 1003) - -LRESULT CALLBACK -winClipboardWindowProc (HWND hwnd, UINT message, - WPARAM wParam, LPARAM lParam) -{ - static HWND s_hwndNextViewer; - static Bool s_fCBCInitialized; - - /* Branch on message type */ - switch (message) - { - case WM_DESTROY: - { - winDebug ("winClipboardWindowProc - WM_DESTROY\n"); - - /* Remove ourselves from the clipboard chain */ - ChangeClipboardChain (hwnd, s_hwndNextViewer); - - s_hwndNextViewer = NULL; - - PostQuitMessage (0); - } - return 0; - - - case WM_CREATE: - { - HWND first, next; - DWORD error_code = 0; - winDebug ("winClipboardWindowProc - WM_CREATE\n"); - - first = GetClipboardViewer(); /* Get handle to first viewer in chain. */ - if (first == hwnd) return 0; /* Make sure it's not us! */ - /* Add ourselves to the clipboard viewer chain */ - next = SetClipboardViewer (hwnd); - error_code = GetLastError(); - if (SUCCEEDED(error_code) && (next == first)) /* SetClipboardViewer must have succeeded, and the handle */ - s_hwndNextViewer = next; /* it returned must have been the first window in the chain */ - else - s_fCBCInitialized = FALSE; - } - return 0; - - - case WM_CHANGECBCHAIN: - { - winDebug ("winClipboardWindowProc - WM_CHANGECBCHAIN: wParam(%x) " - "lParam(%x) s_hwndNextViewer(%x)\n", - wParam, lParam, s_hwndNextViewer); - - if ((HWND) wParam == s_hwndNextViewer) - { - s_hwndNextViewer = (HWND) lParam; - if (s_hwndNextViewer == hwnd) - { - s_hwndNextViewer = NULL; - winErrorFVerb (1, "winClipboardWindowProc - WM_CHANGECBCHAIN: " - "attempted to set next window to ourselves."); - } - } - else if (s_hwndNextViewer) - SendMessage (s_hwndNextViewer, message, - wParam, lParam); - - } - winDebug ("winClipboardWindowProc - WM_CHANGECBCHAIN: Exit\n"); - return 0; - - case WM_WM_REINIT: - { - /* Ensure that we're in the clipboard chain. Some apps, - * WinXP's remote desktop for one, don't play nice with the - * chain. This message is called whenever we receive a - * WM_ACTIVATEAPP message to ensure that we continue to - * receive clipboard messages. - * - * It might be possible to detect if we're still in the chain - * by calling SendMessage (GetClipboardViewer(), - * WM_DRAWCLIPBOARD, 0, 0); and then seeing if we get the - * WM_DRAWCLIPBOARD message. That, however, might be more - * expensive than just putting ourselves back into the chain. - */ - - HWND first, next; - DWORD error_code = 0; - winDebug ("winClipboardWindowProc - WM_WM_REINIT: Enter\n"); - - first = GetClipboardViewer(); /* Get handle to first viewer in chain. */ - if (first == hwnd) return 0; /* Make sure it's not us! */ - winDebug (" WM_WM_REINIT: Replacing us(%x) with %x at head " - "of chain\n", hwnd, s_hwndNextViewer); - s_fCBCInitialized = FALSE; - ChangeClipboardChain (hwnd, s_hwndNextViewer); - s_hwndNextViewer = NULL; - s_fCBCInitialized = FALSE; - winDebug (" WM_WM_REINIT: Putting us back at head of chain.\n"); - first = GetClipboardViewer(); /* Get handle to first viewer in chain. */ - if (first == hwnd) return 0; /* Make sure it's not us! */ - next = SetClipboardViewer (hwnd); - error_code = GetLastError(); - if (SUCCEEDED(error_code) && (next == first)) /* SetClipboardViewer must have succeeded, and the handle */ - s_hwndNextViewer = next; /* it returned must have been the first window in the chain */ - else - s_fCBCInitialized = FALSE; - } - winDebug ("winClipboardWindowProc - WM_WM_REINIT: Exit\n"); - return 0; - - - case WM_DRAWCLIPBOARD: - { - static Atom atomClipboard; - static int generation; - static Bool s_fProcessingDrawClipboard = FALSE; - Display *pDisplay = g_pClipboardDisplay; - Window iWindow = g_iClipboardWindow; - int iReturn; - - winDebug ("winClipboardWindowProc - WM_DRAWCLIPBOARD: Enter\n"); - - if (generation != serverGeneration) - { - generation = serverGeneration; - atomClipboard = XInternAtom (pDisplay, "CLIPBOARD", False); - } - - /* - * We've occasionally seen a loop in the clipboard chain. - * Try and fix it on the first hint of recursion. - */ - if (! s_fProcessingDrawClipboard) - { - s_fProcessingDrawClipboard = TRUE; - } - else - { - /* Attempt to break the nesting by getting out of the chain, twice?, and then fix and bail */ - s_fCBCInitialized = FALSE; - ChangeClipboardChain (hwnd, s_hwndNextViewer); - winFixClipboardChain(); - winErrorFVerb (1, "winClipboardWindowProc - WM_DRAWCLIPBOARD - " - "Nested calls detected. Re-initing.\n"); - winDebug ("winClipboardWindowProc - WM_DRAWCLIPBOARD: Exit\n"); - s_fProcessingDrawClipboard = FALSE; - return 0; - } - - /* Bail on first message */ - if (!s_fCBCInitialized) - { - s_fCBCInitialized = TRUE; - s_fProcessingDrawClipboard = FALSE; - winDebug ("winClipboardWindowProc - WM_DRAWCLIPBOARD: Exit\n"); - return 0; - } - - /* - * NOTE: We cannot bail out when NULL == GetClipboardOwner () - * because some applications deal with the clipboard in a manner - * that causes the clipboard owner to be NULL when they are in - * fact taking ownership. One example of this is the Win32 - * native compile of emacs. - */ - - /* Bail when we still own the clipboard */ - if (hwnd == GetClipboardOwner ()) - { - - winDebug ("winClipboardWindowProc - WM_DRAWCLIPBOARD - " - "We own the clipboard, returning.\n"); - winDebug ("winClipboardWindowProc - WM_DRAWCLIPBOARD: Exit\n"); - s_fProcessingDrawClipboard = FALSE; - if (s_hwndNextViewer) - SendMessage (s_hwndNextViewer, message, wParam, lParam); - return 0; - } - - /* - * Do not take ownership of the X11 selections when something - * other than CF_TEXT or CF_UNICODETEXT has been copied - * into the Win32 clipboard. - */ - if (!IsClipboardFormatAvailable (CF_TEXT) - && !IsClipboardFormatAvailable (CF_UNICODETEXT)) - { - - winDebug ("winClipboardWindowProc - WM_DRAWCLIPBOARD - " - "Clipboard does not contain CF_TEXT nor " - "CF_UNICODETEXT.\n"); - - /* - * We need to make sure that the X Server has processed - * previous XSetSelectionOwner messages. - */ - XSync (pDisplay, FALSE); - - /* Release PRIMARY selection if owned */ - iReturn = XGetSelectionOwner (pDisplay, XA_PRIMARY); - if (iReturn == g_iClipboardWindow) - { - winDebug ("winClipboardWindowProc - WM_DRAWCLIPBOARD - " - "PRIMARY selection is owned by us.\n"); - XSetSelectionOwner (pDisplay, - XA_PRIMARY, - None, - CurrentTime); - } - else if (BadWindow == iReturn || BadAtom == iReturn) - winErrorFVerb (1, "winClipboardWindowProc - WM_DRAWCLIPBOARD - " - "XGetSelection failed for PRIMARY: %d\n", iReturn); - - /* Release CLIPBOARD selection if owned */ - iReturn = XGetSelectionOwner (pDisplay, - atomClipboard); - if (iReturn == g_iClipboardWindow) - { - winDebug ("winClipboardWindowProc - WM_DRAWCLIPBOARD - " - "CLIPBOARD selection is owned by us.\n"); - XSetSelectionOwner (pDisplay, - atomClipboard, - None, - CurrentTime); - } - else if (BadWindow == iReturn || BadAtom == iReturn) - winErrorFVerb (1, "winClipboardWindowProc - WM_DRAWCLIPBOARD - " - "XGetSelection failed for CLIPBOARD: %d\n", iReturn); - - winDebug ("winClipboardWindowProc - WM_DRAWCLIPBOARD: Exit\n"); - s_fProcessingDrawClipboard = FALSE; - if (s_hwndNextViewer) - SendMessage (s_hwndNextViewer, message, wParam, lParam); - return 0; - } - - /* Reassert ownership of PRIMARY */ - iReturn = XSetSelectionOwner (pDisplay, - XA_PRIMARY, - iWindow, - CurrentTime); - if (iReturn == BadAtom || iReturn == BadWindow || - XGetSelectionOwner (pDisplay, XA_PRIMARY) != iWindow) - { - winErrorFVerb (1, "winClipboardWindowProc - WM_DRAWCLIPBOARD - " - "Could not reassert ownership of PRIMARY\n"); - } - else - { - winDebug ("winClipboardWindowProc - WM_DRAWCLIPBOARD - " - "Reasserted ownership of PRIMARY\n"); - } - - /* Reassert ownership of the CLIPBOARD */ - iReturn = XSetSelectionOwner (pDisplay, - atomClipboard, - iWindow, - CurrentTime); - - if (iReturn == BadAtom || iReturn == BadWindow || - XGetSelectionOwner (pDisplay, atomClipboard) != iWindow) - { - winErrorFVerb (1, "winClipboardWindowProc - WM_DRAWCLIPBOARD - " - "Could not reassert ownership of CLIPBOARD\n"); - } - else - { - winDebug ("winClipboardWindowProc - WM_DRAWCLIPBOARD - " - "Reasserted ownership of CLIPBOARD\n"); - } - - /* Flush the pending SetSelectionOwner event now */ - XFlush (pDisplay); - - s_fProcessingDrawClipboard = FALSE; - } - winDebug ("winClipboardWindowProc - WM_DRAWCLIPBOARD: Exit\n"); - /* Pass the message on the next window in the clipboard viewer chain */ - if (s_hwndNextViewer) - SendMessage (s_hwndNextViewer, message, wParam, lParam); - return 0; - - - case WM_DESTROYCLIPBOARD: - /* - * NOTE: Intentionally do nothing. - * Changes in the Win32 clipboard are handled by WM_DRAWCLIPBOARD - * above. We only process this message to conform to the specs - * for delayed clipboard rendering in Win32. You might think - * that we need to release ownership of the X11 selections, but - * we do not, because a WM_DRAWCLIPBOARD message will closely - * follow this message and reassert ownership of the X11 - * selections, handling the issue for us. - */ - winDebug ("winClipboardWindowProc - WM_DESTROYCLIPBOARD - Ignored.\n"); - return 0; - - case WM_RENDERFORMAT: - case WM_RENDERALLFORMATS: - { - int iReturn; - Display *pDisplay = g_pClipboardDisplay; - Window iWindow = g_iClipboardWindow; - Bool fConvertToUnicode; - - winDebug ("winClipboardWindowProc - WM_RENDER*FORMAT - Hello.\n"); - - /* Flag whether to convert to Unicode or not */ - if (message == WM_RENDERALLFORMATS) - fConvertToUnicode = FALSE; - else - fConvertToUnicode = g_fUnicodeSupport && (CF_UNICODETEXT == wParam); - - /* Request the selection contents */ - iReturn = XConvertSelection (pDisplay, - g_atomLastOwnedSelection, - XInternAtom (pDisplay, - "COMPOUND_TEXT", False), - XInternAtom (pDisplay, - "CYGX_CUT_BUFFER", False), - iWindow, - CurrentTime); - if (iReturn == BadAtom || iReturn == BadWindow) - { - winErrorFVerb (1, "winClipboardWindowProc - WM_RENDER*FORMAT - " - "XConvertSelection () failed\n"); - break; - } - - /* Special handling for WM_RENDERALLFORMATS */ - if (message == WM_RENDERALLFORMATS) - { - /* We must open and empty the clipboard */ - - /* Close clipboard if we have it open already */ - if (GetOpenClipboardWindow () == hwnd) - { - CloseClipboard (); - } - - if (!OpenClipboard (hwnd)) - { - winErrorFVerb (1, "winClipboardWindowProc - WM_RENDER*FORMATS - " - "OpenClipboard () failed: %08x\n", - GetLastError ()); - break; - } - - if (!EmptyClipboard ()) - { - winErrorFVerb (1, "winClipboardWindowProc - WM_RENDER*FORMATS - " - "EmptyClipboard () failed: %08x\n", - GetLastError ()); - break; - } - } - - /* Process the SelectionNotify event */ - iReturn = winProcessXEventsTimeout (hwnd, - iWindow, - pDisplay, - fConvertToUnicode, - WIN_POLL_TIMEOUT); - if (WIN_XEVENTS_CONVERT == iReturn) - { - /* - * The selection was offered for conversion first, so we have - * to process a second SelectionNotify event to get the actual - * data in the selection. - */ - iReturn = winProcessXEventsTimeout (hwnd, - iWindow, - pDisplay, - fConvertToUnicode, - WIN_POLL_TIMEOUT); - } - - /* - * The last of the up-to two calls to winProcessXEventsTimeout - * from above had better have seen a notify event, or else we - * are dealing with a buggy or old X11 app. In these cases we - * have to paste some fake data to the Win32 clipboard to - * satisfy the requirement that we write something to it. - */ - if (WIN_XEVENTS_NOTIFY != iReturn) - { - /* Paste no data, to satisfy required call to SetClipboardData */ - if (g_fUnicodeSupport) - SetClipboardData (CF_UNICODETEXT, NULL); - SetClipboardData (CF_TEXT, NULL); - - ErrorF("winClipboardWindowProc - timed out waiting for WIN_XEVENTS_NOTIFY\n"); - } - - /* BPS - Post ourselves a user message whose handler will reset the - * delayed rendering mechanism after the paste is complete. This is - * necessary because calling SetClipboardData() with a NULL argument - * here will cause the data we just put on the clipboard to be lost! - */ - PostMessage(g_hwndClipboard, WM_USER_PASTE_COMPLETE, 0, 0); - - /* Special handling for WM_RENDERALLFORMATS */ - if (message == WM_RENDERALLFORMATS) - { - /* We must close the clipboard */ - - if (!CloseClipboard ()) - { - winErrorFVerb (1, "winClipboardWindowProc - WM_RENDERALLFORMATS - " - "CloseClipboard () failed: %08x\n", - GetLastError ()); - break; - } - } - - winDebug ("winClipboardWindowProc - WM_RENDER*FORMAT - Returning.\n"); - return 0; - } - /* BPS - This WM_USER message is posted by us. It gives us the opportunity - * to reset the delayed rendering mechanism after each and every paste - * from an X app to a Windows app. Without such a mechanism, subsequent - * changes of selection in the X app owning the selection are not - * reflected in pastes into Windows apps, since Windows won't send us the - * WM_RENDERFORMAT message unless someone has set changed data (or NULL) - * on the clipboard. */ - case WM_USER_PASTE_COMPLETE: - { - if (hwnd != GetClipboardOwner ()) - /* In case we've lost the selection since posting the message */ - return 0; - winDebug ("winClipboardWindowProc - WM_USER_PASTE_COMPLETE\n"); - - /* Set up for another delayed rendering callback */ - OpenClipboard (g_hwndClipboard); - - /* Take ownership of the Windows clipboard */ - EmptyClipboard (); - - /* Advertise Unicode if we support it */ - if (g_fUnicodeSupport) - SetClipboardData (CF_UNICODETEXT, NULL); - - /* Always advertise regular text */ - SetClipboardData (CF_TEXT, NULL); - - /* Release the clipboard */ - CloseClipboard (); - } - return 0; - } - - /* Let Windows perform default processing for unhandled messages */ - return DefWindowProc (hwnd, message, wParam, lParam); -} - - -/* - * Process any pending Windows messages - */ - -BOOL -winClipboardFlushWindowsMessageQueue (HWND hwnd) -{ - MSG msg; - - /* Flush the messaging window queue */ - /* NOTE: Do not pass the hwnd of our messaging window to PeekMessage, - * as this will filter out many non-window-specific messages that - * are sent to our thread, such as WM_QUIT. - */ - while (PeekMessage (&msg, NULL, 0, 0, PM_REMOVE)) - { - /* Dispatch the message if not WM_QUIT */ - if (msg.message == WM_QUIT) - return FALSE; - else - DispatchMessage (&msg); - } - - return TRUE; -} +/*
+ *Copyright (C) 2003-2004 Harold L Hunt II All Rights Reserved.
+ *Copyright (C) Colin Harrison 2005-2008
+ *
+ *Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ *"Software"), to deal in the Software without restriction, including
+ *without limitation the rights to use, copy, modify, merge, publish,
+ *distribute, sublicense, and/or sell copies of the Software, and to
+ *permit persons to whom the Software is furnished to do so, subject to
+ *the following conditions:
+ *
+ *The above copyright notice and this permission notice shall be
+ *included in all copies or substantial portions of the Software.
+ *
+ *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *NONINFRINGEMENT. IN NO EVENT SHALL HAROLD L HUNT II BE LIABLE FOR
+ *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+ *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *Except as contained in this notice, the name of the copyright holder(s)
+ *and author(s) shall not be used in advertising or otherwise to promote
+ *the sale, use or other dealings in this Software without prior written
+ *authorization from the copyright holder(s) and author(s).
+ *
+ * Authors: Harold L Hunt II
+ * Colin Harrison
+ */
+
+#ifdef HAVE_XWIN_CONFIG_H
+#include <xwin-config.h>
+#endif
+#include <sys/types.h>
+#include <sys/time.h>
+#include "winclipboard.h"
+#include "misc.h"
+#include "winmsg.h"
+#include "objbase.h"
+#include "ddraw.h"
+#include "winwindow.h"
+
+/*
+ * Constants
+ */
+
+#define WIN_POLL_TIMEOUT 1
+
+/*
+ * References to external symbols
+ */
+
+extern Bool g_fUseUnicode;
+extern Bool g_fUnicodeSupport;
+extern void *g_pClipboardDisplay;
+extern Window g_iClipboardWindow;
+extern Atom g_atomLastOwnedSelection;
+extern Bool g_fClipboardStarted;
+/* BPS - g_hwndClipboard needed for X app->Windows paste fix */
+extern HWND g_hwndClipboard;
+extern Bool g_fClipboardPrimary;
+
+/*
+ * Local function prototypes
+ */
+
+static int
+winProcessXEventsTimeout (HWND hwnd, int iWindow, Display *pDisplay,
+ Bool fUseUnicode, int iTimeoutSec);
+
+
+/*
+ * Process X events up to specified timeout
+ */
+
+static int
+winProcessXEventsTimeout (HWND hwnd, int iWindow, Display *pDisplay,
+ Bool fUseUnicode, int iTimeoutSec)
+{
+ int iConnNumber;
+ struct timeval tv;
+ int iReturn;
+ DWORD dwStopTime = (GetTickCount () / 1000) + iTimeoutSec;
+
+ /* Make sure the output messages are sent before waiting on a response. */
+ iReturn = winClipboardFlushXEvents (hwnd,
+ iWindow,
+ pDisplay,
+ fUseUnicode,
+ TRUE);
+ if (WIN_XEVENTS_NOTIFY == iReturn)
+ {
+ /* Bail out if notify processed */
+ return iReturn;
+ }
+
+ /* Get our connection number */
+ iConnNumber = ConnectionNumber (pDisplay);
+
+ /* Loop for X events */
+ while (1)
+ {
+ fd_set fdsRead;
+
+ /* Setup the file descriptor set */
+ FD_ZERO (&fdsRead);
+ FD_SET (iConnNumber, &fdsRead);
+
+ /* Adjust timeout */
+ tv.tv_sec = dwStopTime - (GetTickCount () / 1000);
+ tv.tv_usec = 0;
+
+ /* Break out if no time left */
+ if (tv.tv_sec < 0)
+ return WIN_XEVENTS_SUCCESS;
+
+ /* Wait for an X event */
+ iReturn = select (iConnNumber + 1,/* Highest fds number */
+ &fdsRead, /* Read mask */
+ NULL, /* No write mask */
+ NULL, /* No exception mask */
+ &tv); /* No timeout */
+ if (iReturn < 0)
+ {
+ ErrorF ("winProcessXEventsTimeout - Call to select () failed: %d (%x). "
+ "Bailing.\n", iReturn, WSAGetLastError());
+ break;
+ }
+
+ /* Branch on which descriptor became active */
+ if (FD_ISSET (iConnNumber, &fdsRead))
+ {
+ /* Process X events */
+ /* Exit when we see that server is shutting down */
+ iReturn = winClipboardFlushXEvents (hwnd,
+ iWindow,
+ pDisplay,
+ fUseUnicode,
+ TRUE);
+ if (WIN_XEVENTS_NOTIFY == iReturn
+ || WIN_XEVENTS_CONVERT == iReturn)
+ {
+ /* Bail out if convert or notify processed */
+ return iReturn;
+ }
+ }
+ }
+
+ return WIN_XEVENTS_SUCCESS;
+}
+
+/*
+ * Process a given Windows message
+ */
+
+LRESULT CALLBACK
+winClipboardWindowProc (HWND hwnd, UINT message,
+ WPARAM wParam, LPARAM lParam)
+{
+ static HWND s_hwndNextViewer;
+
+ /* Branch on message type */
+ switch (message)
+ {
+ case WM_DESTROY:
+ {
+ winDebug ("winClipboardWindowProc - WM_DESTROY\n");
+
+ /* Remove ourselves from the clipboard chain */
+ ChangeClipboardChain (hwnd, s_hwndNextViewer);
+
+ s_hwndNextViewer = NULL;
+ g_hwndClipboard = NULL;
+ PostQuitMessage (0);
+ }
+ return 0;
+
+
+ case WM_CREATE:
+ {
+ HWND first, next;
+ DWORD error_code = 0;
+ winDebug ("winClipboardWindowProc - WM_CREATE\n");
+
+ /* Add ourselves to the clipboard viewer chain */
+ s_hwndNextViewer = SetClipboardViewer (hwnd);
+ #ifdef _DEBUG
+ if (s_hwndNextViewer== hwnd)
+ {
+ ErrorF("WM_CREATE: SetClipboardViewer returned own window. This causes an endless loop, so reset s_hwndNextViewer. ");
+ s_hwndNextViewer=NULL;
+ }
+ #endif
+
+ }
+ return 0;
+
+
+ case WM_CHANGECBCHAIN:
+ {
+ winDebug ("winClipboardWindowProc - WM_CHANGECBCHAIN: wParam(%x) "
+ "lParam(%x) s_hwndNextViewer(%x)\n",
+ wParam, lParam, s_hwndNextViewer);
+
+ if ((HWND) wParam == s_hwndNextViewer)
+ {
+ s_hwndNextViewer = (HWND) lParam;
+ if (s_hwndNextViewer == hwnd)
+ {
+ winDebug("WM_CHANGECBCHAIN: trying to set s_hwndNextViewer to own window. Resetting it back to NULL. ");
+ s_hwndNextViewer=NULL; /* This would cause an endless loop, so break it by ending the loop here. I have seen this happening, why??? */
+ }
+ }
+ else if (s_hwndNextViewer)
+ SendMessage (s_hwndNextViewer, message,
+ wParam, lParam);
+
+ }
+ winDebug ("winClipboardWindowProc - WM_CHANGECBCHAIN: Exit\n");
+ return 0;
+
+ case WM_WM_REINIT:
+ {
+ /* Ensure that we're in the clipboard chain. Some apps,
+ * WinXP's remote desktop for one, don't play nice with the
+ * chain. This message is called whenever we receive a
+ * WM_ACTIVATEAPP message to ensure that we continue to
+ * receive clipboard messages.
+ *
+ * It might be possible to detect if we're still in the chain
+ * by calling SendMessage (GetClipboardViewer(),
+ * WM_DRAWCLIPBOARD, 0, 0); and then seeing if we get the
+ * WM_DRAWCLIPBOARD message. That, however, might be more
+ * expensive than just putting ourselves back into the chain.
+ */
+
+ HWND first, next;
+ DWORD error_code = 0;
+ if (!g_hwndClipboard)
+ return 0;
+ winDebug ("winClipboardWindowProc - WM_WM_REINIT: Enter\n");
+
+ first = GetClipboardViewer(); /* Get handle to first viewer in chain. */
+ if (first != hwnd)
+ {
+ winDebug (" WM_WM_REINIT: Replacing us(%x) with %x at head "
+ "of chain\n", hwnd, s_hwndNextViewer);
+ if (!wParam) ChangeClipboardChain (hwnd, s_hwndNextViewer); /* When wParam is set, the window was already removed from the chain */
+ winDebug (" WM_WM_REINIT: Putting us back at head of chain.\n");
+ s_hwndNextViewer = SetClipboardViewer (hwnd);
+ #ifdef _DEBUG
+ if (s_hwndNextViewer== hwnd)
+ {
+ ErrorF("WM_WM_REINIT: SetClipboardViewer returned own window. This causes an endless loop, so reset s_hwndNextViewer. ");
+ s_hwndNextViewer=NULL;
+ }
+ #endif
+ }
+ winDebug ("winClipboardWindowProc - WM_WM_REINIT: Exit\n");
+ }
+ return 0;
+
+
+ case WM_DRAWCLIPBOARD:
+ {
+ static Atom atomClipboard;
+ static int generation;
+ static Bool s_fProcessingDrawClipboard = FALSE;
+ Display *pDisplay = g_pClipboardDisplay;
+ Window iWindow = g_iClipboardWindow;
+ int iReturn;
+
+ winDebug ("winClipboardWindowProc - WM_DRAWCLIPBOARD 0x%x 0x%x 0x%x: Enter\n",hwnd,wParam,lParam);
+
+ if (!g_fClipboardStarted)
+ {
+ winDebug ("winClipboardWindowProc - WM_DRAWCLIPBOARD: Exit with no processing\n");
+ if (s_hwndNextViewer)
+ SendMessage (s_hwndNextViewer, message, wParam, lParam);
+ return 0;
+ }
+
+ if (generation != serverGeneration)
+ {
+ generation = serverGeneration;
+ atomClipboard = XInternAtom (pDisplay, "CLIPBOARD", False);
+ }
+
+ /*
+ * We've occasionally seen a loop in the clipboard chain.
+ * Try and fix it on the first hint of recursion.
+ */
+ if (! s_fProcessingDrawClipboard)
+ {
+ s_fProcessingDrawClipboard = TRUE;
+ }
+ else
+ {
+ /* Attempt to break the nesting by getting out of the chain, twice?, and then fix and bail */
+ ChangeClipboardChain (hwnd, s_hwndNextViewer);
+ winFixClipboardChain(1);
+ ErrorF ("winClipboardWindowProc - WM_DRAWCLIPBOARD - "
+ "Nested calls detected. Re-initing.\n");
+ winDebug ("winClipboardWindowProc - WM_DRAWCLIPBOARD: Exit\n");
+ s_fProcessingDrawClipboard = FALSE;
+ return 0;
+ }
+
+ /*
+ * Do not take ownership of the X11 selections when something
+ * other than CF_TEXT or CF_UNICODETEXT has been copied
+ * into the Win32 clipboard.
+ */
+ if (!IsClipboardFormatAvailable (CF_TEXT)
+ && !IsClipboardFormatAvailable (CF_UNICODETEXT))
+ {
+
+ winDebug ("winClipboardWindowProc - WM_DRAWCLIPBOARD - "
+ "Clipboard does not contain CF_TEXT nor "
+ "CF_UNICODETEXT.\n");
+
+ /*
+ * We need to make sure that the X Server has processed
+ * previous XSetSelectionOwner messages.
+ */
+ XSync (pDisplay, FALSE);
+
+ if (g_fClipboardPrimary)
+ {
+ /* Release PRIMARY selection if owned */
+ iReturn = XGetSelectionOwner (pDisplay, XA_PRIMARY);
+ if (iReturn == g_iClipboardWindow)
+ {
+ winDebug ("winClipboardWindowProc - WM_DRAWCLIPBOARD - "
+ "PRIMARY selection is owned by us.\n");
+ XSetSelectionOwner (pDisplay,
+ XA_PRIMARY,
+ None,
+ CurrentTime);
+ }
+ else if (BadWindow == iReturn || BadAtom == iReturn)
+ ErrorF ("winClipboardWindowProc - WM_DRAWCLIPBOARD - "
+ "XGetSelection failed for PRIMARY: %d\n", iReturn);
+ }
+ /* Release CLIPBOARD selection if owned */
+ iReturn = XGetSelectionOwner (pDisplay,
+ atomClipboard);
+ if (iReturn == g_iClipboardWindow)
+ {
+ winDebug ("winClipboardWindowProc - WM_DRAWCLIPBOARD - "
+ "CLIPBOARD selection is owned by us.\n");
+ XSetSelectionOwner (pDisplay,
+ atomClipboard,
+ None,
+ CurrentTime);
+ }
+ else if (BadWindow == iReturn || BadAtom == iReturn)
+ ErrorF ("winClipboardWindowProc - WM_DRAWCLIPBOARD - "
+ "XGetSelection failed for CLIPBOARD: %d\n", iReturn);
+
+ winDebug ("winClipboardWindowProc - WM_DRAWCLIPBOARD: Exit\n");
+ s_fProcessingDrawClipboard = FALSE;
+ if (s_hwndNextViewer)
+ SendMessage (s_hwndNextViewer, message, wParam, lParam);
+ return 0;
+ }
+ /* Only reassert ownership when we did not change the clipboard ourselves */
+ if (hwnd!=(HWND)wParam)
+ {
+ if (g_fClipboardPrimary)
+ {
+ /* Reassert ownership of PRIMARY */
+ iReturn = XSetSelectionOwner (pDisplay,
+ XA_PRIMARY,
+ iWindow,
+ CurrentTime);
+ if (iReturn == BadAtom || iReturn == BadWindow ||
+ XGetSelectionOwner (pDisplay, XA_PRIMARY) != iWindow)
+ {
+ ErrorF ("winClipboardWindowProc - WM_DRAWCLIPBOARD - "
+ "Could not reassert ownership of PRIMARY\n");
+ }
+ else
+ {
+ winDebug ("winClipboardWindowProc - WM_DRAWCLIPBOARD - "
+ "Reasserted ownership of PRIMARY\n");
+ }
+ }
+ /* Reassert ownership of the CLIPBOARD */
+ iReturn = XSetSelectionOwner (pDisplay,
+ atomClipboard,
+ iWindow,
+ CurrentTime);
+
+ if (iReturn == BadAtom || iReturn == BadWindow ||
+ XGetSelectionOwner (pDisplay, atomClipboard) != iWindow)
+ {
+ ErrorF ("winClipboardWindowProc - WM_DRAWCLIPBOARD - "
+ "Could not reassert ownership of CLIPBOARD\n");
+ }
+ else
+ {
+ winDebug ("winClipboardWindowProc - WM_DRAWCLIPBOARD - "
+ "Reasserted ownership of CLIPBOARD\n");
+ }
+
+ /* Flush the pending SetSelectionOwner event now */
+ XFlush (pDisplay);
+ }
+
+ s_fProcessingDrawClipboard = FALSE;
+ winDebug ("winClipboardWindowProc - WM_DRAWCLIPBOARD: Exit\n");
+ /* Pass the message on the next window in the clipboard viewer chain */
+ if (s_hwndNextViewer)
+ SendMessage (s_hwndNextViewer, message, wParam, lParam);
+ return 0;
+
+ }
+
+ case WM_DESTROYCLIPBOARD:
+ /*
+ * NOTE: Intentionally do nothing.
+ * Changes in the Win32 clipboard are handled by WM_DRAWCLIPBOARD
+ * above. We only process this message to conform to the specs
+ * for delayed clipboard rendering in Win32. You might think
+ * that we need to release ownership of the X11 selections, but
+ * we do not, because a WM_DRAWCLIPBOARD message will closely
+ * follow this message and reassert ownership of the X11
+ * selections, handling the issue for us.
+ */
+ winDebug ("winClipboardWindowProc - WM_DESTROYCLIPBOARD - Ignored.\n");
+ return 0;
+
+ case WM_RENDERFORMAT:
+ case WM_RENDERALLFORMATS:
+ {
+ int iReturn;
+ Display *pDisplay = g_pClipboardDisplay;
+ Window iWindow = g_iClipboardWindow;
+ Bool fConvertToUnicode;
+
+ winDebug ("winClipboardWindowProc - WM_RENDER*FORMAT - Hello.\n");
+
+ /* Flag whether to convert to Unicode or not */
+ if (message == WM_RENDERALLFORMATS)
+ fConvertToUnicode = FALSE;
+ else
+ fConvertToUnicode = g_fUnicodeSupport && (CF_UNICODETEXT == wParam);
+
+ /* Request the selection contents */
+ iReturn = XConvertSelection (pDisplay,
+ g_atomLastOwnedSelection,
+ XInternAtom (pDisplay,
+ "COMPOUND_TEXT", False),
+ XInternAtom (pDisplay,
+ WIN_LOCAL_PROPERTY, False),
+ iWindow,
+ CurrentTime);
+ if (iReturn == BadAtom || iReturn == BadWindow)
+ {
+ ErrorF ("winClipboardWindowProc - WM_RENDER*FORMAT - "
+ "XConvertSelection () failed\n");
+ break;
+ }
+
+ /* Special handling for WM_RENDERALLFORMATS */
+ if (message == WM_RENDERALLFORMATS)
+ {
+ /* We must open and empty the clipboard */
+ if (!OpenClipboard (hwnd))
+ {
+ ErrorF ("winClipboardWindowProc - WM_RENDER*FORMATS - "
+ "OpenClipboard () failed: %08x\n",
+ GetLastError ());
+ break;
+ }
+
+ if (!EmptyClipboard ())
+ {
+ ErrorF ("winClipboardWindowProc - WM_RENDER*FORMATS - "
+ "EmptyClipboard () failed: %08x\n",
+ GetLastError ());
+ CloseClipboard ();
+ break;
+ }
+ }
+
+ /* Process the SelectionNotify event */
+ do {
+ iReturn = winProcessXEventsTimeout (hwnd,
+ iWindow,
+ pDisplay,
+ fConvertToUnicode,
+ WIN_POLL_TIMEOUT);
+ } while (WIN_XEVENTS_CONVERT == iReturn);
+
+
+ /*
+ * The last call to winProcessXEventsTimeout
+ * from above had better have seen a notify event, or else we
+ * are dealing with a buggy or old X11 app. In these cases we
+ * have to paste some fake data to the Win32 clipboard to
+ * satisfy the requirement that we write something to it.
+ */
+ if (WIN_XEVENTS_NOTIFY != iReturn)
+ {
+ ErrorF("winClipboardWindowProc - winProcessXEventsTimeout should have returned WIN_XEVENTS_NOTIFY was %d\n",iReturn);
+ /* Paste no data, to satisfy required call to SetClipboardData */
+ if (g_fUnicodeSupport)
+ SetClipboardData (CF_UNICODETEXT, NULL);
+ SetClipboardData (CF_TEXT, NULL);
+
+ ErrorF("winClipboardWindowProc - timed out waiting for WIN_XEVENTS_NOTIFY\n");
+ }
+
+ /* Special handling for WM_RENDERALLFORMATS */
+ if (message == WM_RENDERALLFORMATS)
+ {
+ /* We must close the clipboard */
+
+ if (!CloseClipboard ())
+ {
+ ErrorF ("winClipboardWindowProc - WM_RENDERALLFORMATS - "
+ "CloseClipboard () failed: %08x\n",
+ GetLastError ());
+ break;
+ }
+ }
+
+ winDebug ("winClipboardWindowProc - WM_RENDER*FORMAT - Returning.\n");
+ return 0;
+ }
+ }
+
+ /* Let Windows perform default processing for unhandled messages */
+ return DefWindowProc (hwnd, message, wParam, lParam);
+}
+
+
+/*
+ * Process any pending Windows messages
+ */
+
+BOOL
+winClipboardFlushWindowsMessageQueue (HWND hwnd)
+{
+ MSG msg;
+
+ /* Flush the messaging window queue */
+ /* NOTE: Do not pass the hwnd of our messaging window to PeekMessage,
+ * as this will filter out many non-window-specific messages that
+ * are sent to our thread, such as WM_QUIT.
+ */
+ while (PeekMessage (&msg, NULL, 0, 0, PM_REMOVE))
+ {
+ /* Dispatch the message if not WM_QUIT */
+ if (msg.message == WM_QUIT)
+ return FALSE;
+ else
+ DispatchMessage (&msg);
+ }
+
+ return TRUE;
+}
diff --git a/xorg-server/hw/xwin/winclipboardwrappers.c b/xorg-server/hw/xwin/winclipboardwrappers.c index ddc7814d7..cbf9a8ed2 100644 --- a/xorg-server/hw/xwin/winclipboardwrappers.c +++ b/xorg-server/hw/xwin/winclipboardwrappers.c @@ -42,7 +42,6 @@ * Constants
*/
-#define CLIP_NUM_CALLS 4
#define CLIP_NUM_SELECTIONS 2
#define CLIP_OWN_PRIMARY 0
#define CLIP_OWN_CLIPBOARD 1
@@ -53,7 +52,6 @@ */
int winProcEstablishConnection(ClientPtr /* client */);
-int winProcQueryTree(ClientPtr /* client */);
int winProcSetSelectionOwner(ClientPtr /* client */);
@@ -72,111 +70,13 @@ extern Bool g_fClipboard; extern Window g_iClipboardWindow;
extern Atom g_atomLastOwnedSelection;
extern HWND g_hwndClipboard;
+extern Bool g_fClipboardPrimary;
extern winDispatchProcPtr winProcEstablishConnectionOrig;
-extern winDispatchProcPtr winProcQueryTreeOrig;
extern winDispatchProcPtr winProcSetSelectionOwnerOrig;
/*
- * Wrapper for internal QueryTree function.
- * Hides the clipboard client when it is the only client remaining.
- */
-
-int
-winProcQueryTree (ClientPtr client)
-{
- int iReturn;
-
- ErrorF ("winProcQueryTree - Hello\n");
-
- /*
- * This procedure is only used for initialization.
- * We can unwrap the original procedure at this point
- * so that this function is no longer called until the
- * server resets and the function is wrapped again.
- */
- ProcVector[X_QueryTree] = winProcQueryTreeOrig;
-
- /*
- * Call original function and bail if it fails.
- * NOTE: We must do this first, since we need XdmcpOpenDisplay
- * to be called before we initialize our clipboard client.
- */
- iReturn = (*winProcQueryTreeOrig) (client);
- if (iReturn != 0)
- {
- ErrorF ("winProcQueryTree - ProcQueryTree failed, bailing.\n");
- return iReturn;
- }
-
- /* Make errors more obvious */
- winProcQueryTreeOrig = NULL;
-
- /* Do nothing if clipboard is not enabled */
- if (!g_fClipboard)
- {
- ErrorF ("winProcQueryTree - Clipboard is not enabled, "
- "returning.\n");
- return iReturn;
- }
-
- /* If the clipboard client has already been started, abort */
- if (g_fClipboardLaunched)
- {
- ErrorF ("winProcQueryTree - Clipboard client already "
- "launched, returning.\n");
- return iReturn;
- }
-
- /* Startup the clipboard client if clipboard mode is being used */
- if (g_fXdmcpEnabled && g_fClipboard)
- {
- /*
- * NOTE: The clipboard client is started here for a reason:
- * 1) Assume you are using XDMCP (e.g. XWin -query %hostname%)
- * 2) If the clipboard client attaches during X Server startup,
- * then it becomes the "magic client" that causes the X Server
- * to reset if it exits.
- * 3) XDMCP calls KillAllClients when it starts up.
- * 4) The clipboard client is a client, so it is killed.
- * 5) The clipboard client is the "magic client", so the X Server
- * resets itself.
- * 6) This repeats ad infinitum.
- * 7) We avoid this by waiting until at least one client (could
- * be XDM, could be another client) connects, which makes it
- * almost certain that the clipboard client will not connect
- * until after XDM when using XDMCP.
- * 8) Unfortunately, there is another problem.
- * 9) XDM walks the list of windows with XQueryTree,
- * killing any client it finds with a window.
- * 10)Thus, when using XDMCP we wait until the first call
- * to ProcQueryTree before we startup the clipboard client.
- * This should prevent XDM from finding the clipboard client,
- * since it has not yet created a window.
- * 11)Startup when not using XDMCP is handled in
- * winProcEstablishConnection.
- */
-
- /* Create the clipboard client thread */
- if (!winInitClipboard ())
- {
- ErrorF ("winProcQueryTree - winClipboardInit "
- "failed.\n");
- return iReturn;
- }
-
- ErrorF ("winProcQueryTree - winInitClipboard returned.\n");
- }
-
- /* Flag that clipboard client has been launched */
- g_fClipboardLaunched = TRUE;
-
- return iReturn;
-}
-
-
-/*
* Wrapper for internal EstablishConnection function.
* Initializes internal clients that must not be started until
* an external client has connected.
@@ -189,12 +89,14 @@ winProcEstablishConnection (ClientPtr client) static int s_iCallCount = 0;
static unsigned long s_ulServerGeneration = 0;
- if (s_iCallCount == 0 || s_iCallCount == CLIP_NUM_CALLS) ErrorF ("winProcEstablishConnection - Hello\n");
+ #ifdef WINDBG
+ if (s_iCallCount == 0) winDebug ("winProcEstablishConnection - Hello\n");
+ #endif
/* Do nothing if clipboard is not enabled */
if (!g_fClipboard)
{
- ErrorF ("winProcEstablishConnection - Clipboard is not enabled, "
+ winDebug ("winProcEstablishConnection - Clipboard is not enabled, "
"returning.\n");
/* Unwrap the original function, call it, and return */
@@ -217,18 +119,6 @@ winProcEstablishConnection (ClientPtr client) /* Increment call count */
++s_iCallCount;
- /* Wait for CLIP_NUM_CALLS when Xdmcp is enabled */
- if (g_fXdmcpEnabled
- && !g_fClipboardLaunched
- && s_iCallCount < CLIP_NUM_CALLS)
- {
- if (s_iCallCount == 1) ErrorF ("winProcEstablishConnection - Xdmcp, waiting to "
- "start clipboard client until %dth call", CLIP_NUM_CALLS);
- if (s_iCallCount == CLIP_NUM_CALLS - 1) ErrorF (".\n");
- else ErrorF (".");
- return (*winProcEstablishConnectionOrig) (client);
- }
-
/*
* This procedure is only used for initialization.
* We can unwrap the original procedure at this point
@@ -256,7 +146,7 @@ winProcEstablishConnection (ClientPtr client) /* If the clipboard client has already been started, abort */
if (g_fClipboardLaunched)
{
- ErrorF ("winProcEstablishConnection - Clipboard client already "
+ winDebug ("winProcEstablishConnection - Clipboard client already "
"launched, returning.\n");
return iReturn;
}
@@ -279,13 +169,6 @@ winProcEstablishConnection (ClientPtr client) * be XDM, could be another client) connects, which makes it
* almost certain that the clipboard client will not connect
* until after XDM when using XDMCP.
- * 8) Unfortunately, there is another problem.
- * 9) XDM walks the list of windows with XQueryTree,
- * killing any client it finds with a window.
- * 10)Thus, when using XDMCP we wait until CLIP_NUM_CALLS
- * to ProcEstablishCeonnection before we startup the clipboard
- * client. This should prevent XDM from finding the clipboard
- * client, since it has not yet created a window.
*/
/* Create the clipboard client thread */
@@ -296,7 +179,7 @@ winProcEstablishConnection (ClientPtr client) return iReturn;
}
- ErrorF ("winProcEstablishConnection - winInitClipboard returned.\n");
+ winDebug ("winProcEstablishConnection - winInitClipboard returned.\n");
}
/* Flag that clipboard client has been launched */
@@ -310,28 +193,26 @@ winProcEstablishConnection (ClientPtr client) * Wrapper for internal SetSelectionOwner function.
* Grabs ownership of Windows clipboard when X11 clipboard owner changes.
*/
-
int
winProcSetSelectionOwner (ClientPtr client)
{
int i;
DrawablePtr pDrawable;
WindowPtr pWindow = None;
- Bool fOwnedToNotOwned = FALSE;
static Window s_iOwners[CLIP_NUM_SELECTIONS] = {None};
static unsigned long s_ulServerGeneration = 0;
REQUEST(xSetSelectionOwnerReq);
REQUEST_SIZE_MATCH(xSetSelectionOwnerReq);
- winDebug("winProcSetSelectionOwner - Hello.\n");
+ winDebug ("winProcSetSelectionOwner - Hello.\n");
/* Watch for server reset */
if (s_ulServerGeneration != serverGeneration)
{
/* Save new generation number */
s_ulServerGeneration = serverGeneration;
-
+
/* Initialize static variables */
for (i = 0; i < CLIP_NUM_SELECTIONS; ++i)
s_iOwners[i] = None;
@@ -340,9 +221,9 @@ winProcSetSelectionOwner (ClientPtr client) /* Abort if clipboard not completely initialized yet */
if (!g_fClipboardStarted)
{
- /* ErrorF ("winProcSetSelectionOwner - Clipboard not yet started, "
- "aborting.\n"); */
- goto winProcSetSelectionOwner_Done;
+ winDebug ("winProcSetSelectionOwner - Clipboard not yet started, "
+ "aborting.\n");
+ goto winProcSetSelectionOwner_Done;
}
/* Grab window if we have one */
@@ -359,29 +240,27 @@ winProcSetSelectionOwner (ClientPtr client) /* Now we either have a valid window or None */
/* Save selection owners for monitored selections, ignore other selections */
- if (XA_PRIMARY == stuff->selection)
+ if (XA_PRIMARY == stuff->selection && g_fClipboardPrimary)
{
/* Look for owned -> not owned transition */
if (None == stuff->window
&& None != s_iOwners[CLIP_OWN_PRIMARY])
{
- fOwnedToNotOwned = TRUE;
+ winDebug ("winProcSetSelectionOwner - PRIMARY - Going from "
+ "owned to not owned.\n");
- winDebug("winProcSetSelectionOwner - PRIMARY - Going from "
- "owned to not owned.\n");
-
- /* Adjust last owned selection */
+ /* Adjust last owned selection */
if (None != s_iOwners[CLIP_OWN_CLIPBOARD])
g_atomLastOwnedSelection = MakeAtom ("CLIPBOARD", 9, TRUE);
else
g_atomLastOwnedSelection = None;
}
-
+
/* Save new selection owner or None */
s_iOwners[CLIP_OWN_PRIMARY] = stuff->window;
- winDebug("winProcSetSelectionOwner - PRIMARY - Now owned by: %d\n",
- stuff->window);
+ winDebug ("winProcSetSelectionOwner - PRIMARY - Now owned by: 0x%x (clipboard is 0x%x)\n",
+ stuff->window,g_iClipboardWindow);
}
else if (MakeAtom ("CLIPBOARD", 9, TRUE) == stuff->selection)
{
@@ -389,13 +268,11 @@ winProcSetSelectionOwner (ClientPtr client) if (None == stuff->window
&& None != s_iOwners[CLIP_OWN_CLIPBOARD])
{
- fOwnedToNotOwned = TRUE;
-
- winDebug("winProcSetSelectionOwner - CLIPBOARD - Going from "
- "owned to not owned.\n");
+ winDebug ("winProcSetSelectionOwner - CLIPBOARD - Going from "
+ "owned to not owned.\n");
/* Adjust last owned selection */
- if (None != s_iOwners[CLIP_OWN_PRIMARY])
+ if ((None != s_iOwners[CLIP_OWN_PRIMARY]) && g_fClipboardPrimary)
g_atomLastOwnedSelection = XA_PRIMARY;
else
g_atomLastOwnedSelection = None;
@@ -404,9 +281,8 @@ winProcSetSelectionOwner (ClientPtr client) /* Save new selection owner or None */
s_iOwners[CLIP_OWN_CLIPBOARD] = stuff->window;
- winDebug("winProcSetSelectionOwner - CLIPBOARD - Now owned by: %d\n",
- stuff->window);
-
+ winDebug ("winProcSetSelectionOwner - CLIPBOARD - Now owned by: 0x%x, clipboard is 0x%x\n",
+ stuff->window,g_iClipboardWindow);
}
else
goto winProcSetSelectionOwner_Done;
@@ -421,44 +297,17 @@ winProcSetSelectionOwner (ClientPtr client) if (g_iClipboardWindow == s_iOwners[CLIP_OWN_CLIPBOARD])
s_iOwners[CLIP_OWN_CLIPBOARD] = None;
- /*
- * Handle case when selection is being disowned,
- * WM_DRAWCLIPBOARD did not do the disowning,
- * both monitored selections are no longer owned,
- * an owned to not owned transition was detected,
- * and we currently own the Win32 clipboard.
- */
- if (stuff->window == None
- && s_iOwners[CLIP_OWN_PRIMARY] == None
- && s_iOwners[CLIP_OWN_CLIPBOARD] == None
- && fOwnedToNotOwned
- && g_hwndClipboard != NULL
- && g_hwndClipboard == GetClipboardOwner ())
- {
- winDebug("winProcSetSelectionOwner - We currently own the "
- "clipboard and neither the PRIMARY nor the CLIPBOARD "
- "selections are owned, releasing ownership of Win32 "
- "clipboard.\n");
-
- /* Release ownership of the Windows clipboard */
- OpenClipboard (NULL);
- EmptyClipboard ();
- CloseClipboard ();
-
- goto winProcSetSelectionOwner_Done;
- }
-
/* Abort if no window at this point */
if (None == stuff->window)
{
- winDebug("winProcSetSelectionOwner - No window, returning.\n");
+ winDebug ("winProcSetSelectionOwner - No window, returning.\n");
goto winProcSetSelectionOwner_Done;
}
/* Abort if invalid selection */
if (!ValidAtom (stuff->selection))
{
- ErrorF ("winProcSetSelectionOwner - Found BadAtom, aborting.\n");
+ winDebug ("winProcSetSelectionOwner - Found BadAtom, aborting.\n");
goto winProcSetSelectionOwner_Done;
}
@@ -468,7 +317,7 @@ winProcSetSelectionOwner (ClientPtr client) /* Abort if clipboard manager is owning the selection */
if (pDrawable->id == g_iClipboardWindow)
{
- winDebug("winProcSetSelectionOwner - We changed ownership, "
+ winDebug ("winProcSetSelectionOwner - We changed ownership, "
"aborting.\n");
goto winProcSetSelectionOwner_Done;
}
@@ -476,22 +325,16 @@ winProcSetSelectionOwner (ClientPtr client) /* Abort if root window is taking ownership */
if (pDrawable->id == 0)
{
- ErrorF ("winProcSetSelectionOwner - Root window taking ownership, "
+ winDebug ("winProcSetSelectionOwner - Root window taking ownership, "
"aborting\n");
goto winProcSetSelectionOwner_Done;
}
- /* Close clipboard if we have it open already */
- if (GetOpenClipboardWindow () == g_hwndClipboard)
- {
- CloseClipboard ();
- }
-
/* Access the Windows clipboard */
if (!OpenClipboard (g_hwndClipboard))
{
- ErrorF ("winProcSetSelectionOwner - OpenClipboard () failed: %08x\n",
- (int) GetLastError ());
+ ErrorF ("winProcSetSelectionOwner - OpenClipboard () failed: %08x, hwnd: %08x\n",
+ (int) GetLastError (),g_hwndClipboard);
goto winProcSetSelectionOwner_Done;
}
@@ -500,9 +343,12 @@ winProcSetSelectionOwner (ClientPtr client) {
ErrorF ("winProcSetSelectionOwner - EmptyClipboard () failed: %08x\n",
(int) GetLastError ());
+ CloseClipboard ();
goto winProcSetSelectionOwner_Done;
}
+ winDebug("winProcSetSelectionOwner - SetClipboardData NULL\n");
+
/* Advertise Unicode if we support it */
if (g_fUnicodeSupport)
SetClipboardData (CF_UNICODETEXT, NULL);
@@ -522,6 +368,6 @@ winProcSetSelectionOwner (ClientPtr client) goto winProcSetSelectionOwner_Done;
}
- winProcSetSelectionOwner_Done:
+winProcSetSelectionOwner_Done:
return (*winProcSetSelectionOwnerOrig) (client);
}
diff --git a/xorg-server/hw/xwin/winclipboardxevents.c b/xorg-server/hw/xwin/winclipboardxevents.c index b0006a01f..b3ed5eba5 100644 --- a/xorg-server/hw/xwin/winclipboardxevents.c +++ b/xorg-server/hw/xwin/winclipboardxevents.c @@ -1,805 +1,843 @@ -/* - *Copyright (C) 2003-2004 Harold L Hunt II All Rights Reserved. - *Copyright (C) Colin Harrison 2005-2008 - * - *Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - *"Software"), to deal in the Software without restriction, including - *without limitation the rights to use, copy, modify, merge, publish, - *distribute, sublicense, and/or sell copies of the Software, and to - *permit persons to whom the Software is furnished to do so, subject to - *the following conditions: - * - *The above copyright notice and this permission notice shall be - *included in all copies or substantial portions of the Software. - * - *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - *NONINFRINGEMENT. IN NO EVENT SHALL HAROLD L HUNT II BE LIABLE FOR - *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - *Except as contained in this notice, the name of the copyright holder(s) - *and author(s) shall not be used in advertising or otherwise to promote - *the sale, use or other dealings in this Software without prior written - *authorization from the copyright holder(s) and author(s). - * - * Authors: Harold L Hunt II - * Colin Harrison - */ - -#ifdef HAVE_XWIN_CONFIG_H -#include <xwin-config.h> -#endif -#include "winclipboard.h" -#include "misc.h" - - -/* - * References to external symbols - */ - -extern Bool g_fUnicodeSupport; - - -/* - * Process any pending X events - */ - -int -winClipboardFlushXEvents (HWND hwnd, - int iWindow, - Display *pDisplay, - Bool fUseUnicode) -{ - static Atom atomLocalProperty; - static Atom atomCompoundText; - static Atom atomUTF8String; - static Atom atomTargets; - static int generation; - - if (generation != serverGeneration) - { - generation = serverGeneration; - atomLocalProperty = XInternAtom (pDisplay, WIN_LOCAL_PROPERTY, False); - atomUTF8String = XInternAtom (pDisplay, "UTF8_STRING", False); - atomCompoundText = XInternAtom (pDisplay, "COMPOUND_TEXT", False); - atomTargets = XInternAtom (pDisplay, "TARGETS", False); - } - - /* Process all pending events */ - while (XPending (pDisplay)) - { - XTextProperty xtpText = {0}; - XEvent event; - XSelectionEvent eventSelection; - unsigned long ulReturnBytesLeft; - char *pszReturnData = NULL; - char *pszGlobalData = NULL; - int iReturn; - HGLOBAL hGlobal = NULL; - XICCEncodingStyle xiccesStyle; - int iConvertDataLen = 0; - char *pszConvertData = NULL; - char *pszTextList[2] = {NULL}; - int iCount; - char **ppszTextList = NULL; - wchar_t *pwszUnicodeStr = NULL; - int iUnicodeLen = 0; - int iReturnDataLen = 0; - int i; - Bool fAbort = FALSE; - Bool fCloseClipboard = FALSE; - Bool fSetClipboardData = TRUE; - - /* Get the next event - will not block because one is ready */ - XNextEvent (pDisplay, &event); - - /* Branch on the event type */ - switch (event.type) - { - /* - * SelectionRequest - */ - - case SelectionRequest: - { - char *pszAtomName = NULL; - winDebug("SelectionRequest - target %d\n", - event.xselectionrequest.target); - - pszAtomName = XGetAtomName (pDisplay, - event.xselectionrequest.target); - winDebug("SelectionRequest - Target atom name %s\n", pszAtomName); - XFree (pszAtomName); - pszAtomName = NULL; - } - - /* Abort if invalid target type */ - if (event.xselectionrequest.target != XA_STRING - && event.xselectionrequest.target != atomUTF8String - && event.xselectionrequest.target != atomCompoundText - && event.xselectionrequest.target != atomTargets) - { - /* Abort */ - fAbort = TRUE; - goto winClipboardFlushXEvents_SelectionRequest_Done; - } - - /* Handle targets type of request */ - if (event.xselectionrequest.target == atomTargets) - { - Atom atomTargetArr[] = {atomTargets, - atomCompoundText, - atomUTF8String, - XA_STRING}; - - /* Try to change the property */ - iReturn = XChangeProperty (pDisplay, - event.xselectionrequest.requestor, - event.xselectionrequest.property, - XA_ATOM, - 32, - PropModeReplace, - (unsigned char *) atomTargetArr, - (sizeof (atomTargetArr) - / sizeof (atomTargetArr[0]))); - if (iReturn == BadAlloc - || iReturn == BadAtom - || iReturn == BadMatch - || iReturn == BadValue - || iReturn == BadWindow) - { - ErrorF ("winClipboardFlushXEvents - SelectionRequest - " - "XChangeProperty failed: %d\n", - iReturn); - } - - /* Setup selection notify xevent */ - eventSelection.type = SelectionNotify; - eventSelection.send_event = True; - eventSelection.display = pDisplay; - eventSelection.requestor = event.xselectionrequest.requestor; - eventSelection.selection = event.xselectionrequest.selection; - eventSelection.target = event.xselectionrequest.target; - eventSelection.property = event.xselectionrequest.property; - eventSelection.time = event.xselectionrequest.time; - - /* - * Notify the requesting window that - * the operation has completed - */ - iReturn = XSendEvent (pDisplay, - eventSelection.requestor, - False, - 0L, - (XEvent *) &eventSelection); - if (iReturn == BadValue || iReturn == BadWindow) - { - ErrorF ("winClipboardFlushXEvents - SelectionRequest - " - "XSendEvent () failed\n"); - } - break; - } - - /* Check that clipboard format is available */ - if (fUseUnicode - && !IsClipboardFormatAvailable (CF_UNICODETEXT)) - { - static int count; /* Hack to stop acroread spamming the log */ - static HWND lasthwnd; /* I've not seen any other client get here repeatedly? */ - if (hwnd != lasthwnd) count = 0; - count++; - if (count < 6) ErrorF ("winClipboardFlushXEvents - CF_UNICODETEXT is not " - "available from Win32 clipboard. Aborting %d.\n", count); - lasthwnd = hwnd; - - /* Abort */ - fAbort = TRUE; - goto winClipboardFlushXEvents_SelectionRequest_Done; - } - else if (!fUseUnicode - && !IsClipboardFormatAvailable (CF_TEXT)) - { - ErrorF ("winClipboardFlushXEvents - CF_TEXT is not " - "available from Win32 clipboard. Aborting.\n"); - - /* Abort */ - fAbort = TRUE; - goto winClipboardFlushXEvents_SelectionRequest_Done; - } - - /* Close clipboard if we have it open already */ - if (GetOpenClipboardWindow () == hwnd) - { - CloseClipboard (); - } - - /* Access the clipboard */ - if (!OpenClipboard (hwnd)) - { - ErrorF ("winClipboardFlushXEvents - SelectionRequest - " - "OpenClipboard () failed: %08lx\n", - GetLastError ()); - - /* Abort */ - fAbort = TRUE; - goto winClipboardFlushXEvents_SelectionRequest_Done; - } - - /* Indicate that clipboard was opened */ - fCloseClipboard = TRUE; - - /* Setup the string style */ - if (event.xselectionrequest.target == XA_STRING) - xiccesStyle = XStringStyle; -#ifdef X_HAVE_UTF8_STRING - else if (event.xselectionrequest.target == atomUTF8String) - xiccesStyle = XUTF8StringStyle; -#endif - else if (event.xselectionrequest.target == atomCompoundText) - xiccesStyle = XCompoundTextStyle; - else - xiccesStyle = XStringStyle; - - /* - * FIXME: Can't pass CF_UNICODETEXT on Windows 95/98/Me - */ - - /* Get a pointer to the clipboard text, in desired format */ - if (fUseUnicode) - { - /* Retrieve clipboard data */ - hGlobal = GetClipboardData (CF_UNICODETEXT); - } - else - { - /* Retrieve clipboard data */ - hGlobal = GetClipboardData (CF_TEXT); - } - if (!hGlobal) - { - ErrorF ("winClipboardFlushXEvents - SelectionRequest - " - "GetClipboardData () failed: %08lx\n", - GetLastError ()); - - /* Abort */ - fAbort = TRUE; - goto winClipboardFlushXEvents_SelectionRequest_Done; - } - pszGlobalData = (char *) GlobalLock (hGlobal); - - /* Convert the Unicode string to UTF8 (MBCS) */ - if (fUseUnicode) - { - iConvertDataLen = WideCharToMultiByte (CP_UTF8, - 0, - (LPCWSTR)pszGlobalData, - -1, - NULL, - 0, - NULL, - NULL); - /* NOTE: iConvertDataLen includes space for null terminator */ - pszConvertData = (char *) malloc (iConvertDataLen); - WideCharToMultiByte (CP_UTF8, - 0, - (LPCWSTR)pszGlobalData, - -1, - pszConvertData, - iConvertDataLen, - NULL, - NULL); - } - else - { - pszConvertData = strdup (pszGlobalData); - iConvertDataLen = strlen (pszConvertData) + 1; - } - - /* Convert DOS string to UNIX string */ - winClipboardDOStoUNIX (pszConvertData, strlen (pszConvertData)); - - /* Setup our text list */ - pszTextList[0] = pszConvertData; - pszTextList[1] = NULL; - - /* Initialize the text property */ - xtpText.value = NULL; - xtpText.nitems = 0; - - /* Create the text property from the text list */ - if (fUseUnicode) - { -#ifdef X_HAVE_UTF8_STRING - iReturn = Xutf8TextListToTextProperty (pDisplay, - pszTextList, - 1, - xiccesStyle, - &xtpText); -#endif - } - else - { - iReturn = XmbTextListToTextProperty (pDisplay, - pszTextList, - 1, - xiccesStyle, - &xtpText); - } - if (iReturn == XNoMemory || iReturn == XLocaleNotSupported) - { - ErrorF ("winClipboardFlushXEvents - SelectionRequest - " - "X*TextListToTextProperty failed: %d\n", - iReturn); - - /* Abort */ - fAbort = TRUE; - goto winClipboardFlushXEvents_SelectionRequest_Done; - } - - /* Free the converted string */ - free (pszConvertData); - pszConvertData = NULL; - - /* Copy the clipboard text to the requesting window */ - iReturn = XChangeProperty (pDisplay, - event.xselectionrequest.requestor, - event.xselectionrequest.property, - event.xselectionrequest.target, - 8, - PropModeReplace, - xtpText.value, - xtpText.nitems); - if (iReturn == BadAlloc || iReturn == BadAtom - || iReturn == BadMatch || iReturn == BadValue - || iReturn == BadWindow) - { - ErrorF ("winClipboardFlushXEvents - SelectionRequest - " - "XChangeProperty failed: %d\n", - iReturn); - - /* Abort */ - fAbort = TRUE; - goto winClipboardFlushXEvents_SelectionRequest_Done; - } - - /* Release the clipboard data */ - GlobalUnlock (hGlobal); - pszGlobalData = NULL; - fCloseClipboard = FALSE; - CloseClipboard (); - - /* Clean up */ - XFree (xtpText.value); - xtpText.value = NULL; - xtpText.nitems = 0; - - /* Setup selection notify event */ - eventSelection.type = SelectionNotify; - eventSelection.send_event = True; - eventSelection.display = pDisplay; - eventSelection.requestor = event.xselectionrequest.requestor; - eventSelection.selection = event.xselectionrequest.selection; - eventSelection.target = event.xselectionrequest.target; - eventSelection.property = event.xselectionrequest.property; - eventSelection.time = event.xselectionrequest.time; - - /* Notify the requesting window that the operation has completed */ - iReturn = XSendEvent (pDisplay, - eventSelection.requestor, - False, - 0L, - (XEvent *) &eventSelection); - if (iReturn == BadValue || iReturn == BadWindow) - { - ErrorF ("winClipboardFlushXEvents - SelectionRequest - " - "XSendEvent () failed\n"); - - /* Abort */ - fAbort = TRUE; - goto winClipboardFlushXEvents_SelectionRequest_Done; - } - - winClipboardFlushXEvents_SelectionRequest_Done: - /* Free allocated resources */ - if (xtpText.value) - { - XFree (xtpText.value); - xtpText.value = NULL; - xtpText.nitems = 0; - } - free(pszConvertData); - if (hGlobal && pszGlobalData) - GlobalUnlock (hGlobal); - - /* - * Send a SelectionNotify event to the requesting - * client when we abort. - */ - if (fAbort) - { - /* Setup selection notify event */ - eventSelection.type = SelectionNotify; - eventSelection.send_event = True; - eventSelection.display = pDisplay; - eventSelection.requestor = event.xselectionrequest.requestor; - eventSelection.selection = event.xselectionrequest.selection; - eventSelection.target = event.xselectionrequest.target; - eventSelection.property = None; - eventSelection.time = event.xselectionrequest.time; - - /* Notify the requesting window that the operation is complete */ - iReturn = XSendEvent (pDisplay, - eventSelection.requestor, - False, - 0L, - (XEvent *) &eventSelection); - if (iReturn == BadValue || iReturn == BadWindow) - { - /* - * Should not be a problem if XSendEvent fails because - * the client may simply have exited. - */ - ErrorF ("winClipboardFlushXEvents - SelectionRequest - " - "XSendEvent () failed for abort event.\n"); - } - } - - /* Close clipboard if it was opened */ - if (fCloseClipboard) - { - fCloseClipboard = FALSE; - CloseClipboard (); - } - break; - - - /* - * SelectionNotify - */ - - case SelectionNotify: - - winDebug ("winClipboardFlushXEvents - SelectionNotify\n"); - { - char *pszAtomName; - pszAtomName = XGetAtomName (pDisplay, - event.xselection.selection); - - winDebug("winClipboardFlushXEvents - SelectionNotify - ATOM: %s\n", - pszAtomName); - XFree (pszAtomName); - } - - /* - * Request conversion of UTF8 and CompoundText targets. - */ - if (event.xselection.property == None) - { - if (event.xselection.target == XA_STRING) - { - winDebug ("winClipboardFlushXEvents - SelectionNotify - " - "XA_STRING\n"); - - return WIN_XEVENTS_CONVERT; - } - else if (event.xselection.target == atomUTF8String) - { - winDebug("winClipboardFlushXEvents - SelectionNotify - " - "Requesting conversion of UTF8 target.\n"); - - XConvertSelection (pDisplay, - event.xselection.selection, - XA_STRING, - atomLocalProperty, - iWindow, - CurrentTime); - - /* Process the ConvertSelection event */ - XFlush (pDisplay); - return WIN_XEVENTS_CONVERT; - } -#ifdef X_HAVE_UTF8_STRING - else if (event.xselection.target == atomCompoundText) - { - winDebug("winClipboardFlushXEvents - SelectionNotify - " - "Requesting conversion of CompoundText target.\n"); - - XConvertSelection (pDisplay, - event.xselection.selection, - atomUTF8String, - atomLocalProperty, - iWindow, - CurrentTime); - - /* Process the ConvertSelection event */ - XFlush (pDisplay); - return WIN_XEVENTS_CONVERT; - } -#endif - else - { - ErrorF ("winClipboardFlushXEvents - SelectionNotify - " - "Unknown format. Cannot request conversion, " - "aborting.\n"); - break; - } - } - - /* Retrieve the size of the stored data */ - iReturn = XGetWindowProperty (pDisplay, - iWindow, - atomLocalProperty, - 0, - 0, /* Don't get data, just size */ - False, - AnyPropertyType, - &xtpText.encoding, - &xtpText.format, - &xtpText.nitems, - &ulReturnBytesLeft, - &xtpText.value); - if (iReturn != Success) - { - ErrorF ("winClipboardFlushXEvents - SelectionNotify - " - "XGetWindowProperty () failed, aborting: %d\n", - iReturn); - break; - } - - winDebug("SelectionNotify - returned data %d left %d\n", - xtpText.nitems, ulReturnBytesLeft); - - /* Request the selection data */ - iReturn = XGetWindowProperty (pDisplay, - iWindow, - atomLocalProperty, - 0, - ulReturnBytesLeft, - False, - AnyPropertyType, - &xtpText.encoding, - &xtpText.format, - &xtpText.nitems, - &ulReturnBytesLeft, - &xtpText.value); - if (iReturn != Success) - { - ErrorF ("winClipboardFlushXEvents - SelectionNotify - " - "XGetWindowProperty () failed, aborting: %d\n", - iReturn); - break; - } - - { - char *pszAtomName = NULL; - - winDebug("SelectionNotify - returned data %d left %d\n", - xtpText.nitems, ulReturnBytesLeft); - pszAtomName = XGetAtomName(pDisplay, xtpText.encoding); - winDebug("Notify atom name %s\n", pszAtomName); - XFree (pszAtomName); - pszAtomName = NULL; - } - - if (fUseUnicode) - { -#ifdef X_HAVE_UTF8_STRING - /* Convert the text property to a text list */ - iReturn = Xutf8TextPropertyToTextList (pDisplay, - &xtpText, - &ppszTextList, - &iCount); -#endif - } - else - { - iReturn = XmbTextPropertyToTextList (pDisplay, - &xtpText, - &ppszTextList, - &iCount); - } - if (iReturn == Success || iReturn > 0) - { - /* Conversion succeeded or some unconvertible characters */ - if (ppszTextList != NULL) - { - iReturnDataLen = 0; - for (i = 0; i < iCount; i++) - { - iReturnDataLen += strlen(ppszTextList[i]); - } - pszReturnData = malloc (iReturnDataLen + 1); - pszReturnData[0] = '\0'; - for (i = 0; i < iCount; i++) - { - strcat (pszReturnData, ppszTextList[i]); - } - } - else - { - ErrorF ("winClipboardFlushXEvents - SelectionNotify - " - "X*TextPropertyToTextList list_return is NULL.\n"); - pszReturnData = malloc (1); - pszReturnData[0] = '\0'; - } - } - else - { - ErrorF ("winClipboardFlushXEvents - SelectionNotify - " - "X*TextPropertyToTextList returned: "); - switch (iReturn) - { - case XNoMemory: - ErrorF ("XNoMemory\n"); - break; - case XLocaleNotSupported: - ErrorF ("XLocaleNotSupported\n"); - break; - case XConverterNotFound: - ErrorF ("XConverterNotFound\n"); - break; - default: - ErrorF ("%d\n", iReturn); - break; - } - pszReturnData = malloc (1); - pszReturnData[0] = '\0'; - } - - /* Free the data returned from XGetWindowProperty */ - if (ppszTextList) - XFreeStringList (ppszTextList); - ppszTextList = NULL; - XFree (xtpText.value); - xtpText.value = NULL; - xtpText.nitems = 0; - - /* Convert the X clipboard string to DOS format */ - winClipboardUNIXtoDOS (&pszReturnData, strlen (pszReturnData)); - - if (fUseUnicode) - { - /* Find out how much space needed to convert MBCS to Unicode */ - iUnicodeLen = MultiByteToWideChar (CP_UTF8, - 0, - pszReturnData, - -1, - NULL, - 0); - - /* Allocate memory for the Unicode string */ - pwszUnicodeStr - = (wchar_t*) malloc (sizeof (wchar_t) * (iUnicodeLen + 1)); - if (!pwszUnicodeStr) - { - ErrorF ("winClipboardFlushXEvents - SelectionNotify " - "malloc failed for pwszUnicodeStr, aborting.\n"); - - /* Abort */ - fAbort = TRUE; - goto winClipboardFlushXEvents_SelectionNotify_Done; - } - - /* Do the actual conversion */ - MultiByteToWideChar (CP_UTF8, - 0, - pszReturnData, - -1, - pwszUnicodeStr, - iUnicodeLen); - - /* Allocate global memory for the X clipboard data */ - hGlobal = GlobalAlloc (GMEM_MOVEABLE, - sizeof (wchar_t) * (iUnicodeLen + 1)); - } - else - { - pszConvertData = strdup (pszReturnData); - iConvertDataLen = strlen (pszConvertData) + 1; - - /* Allocate global memory for the X clipboard data */ - hGlobal = GlobalAlloc (GMEM_MOVEABLE, iConvertDataLen); - } - - free (pszReturnData); - - /* Check that global memory was allocated */ - if (!hGlobal) - { - ErrorF ("winClipboardFlushXEvents - SelectionNotify " - "GlobalAlloc failed, aborting: %ld\n", - GetLastError ()); - - /* Abort */ - fAbort = TRUE; - goto winClipboardFlushXEvents_SelectionNotify_Done; - } - - /* Obtain a pointer to the global memory */ - pszGlobalData = GlobalLock (hGlobal); - if (pszGlobalData == NULL) - { - ErrorF ("winClipboardFlushXEvents - Could not lock global " - "memory for clipboard transfer\n"); - - /* Abort */ - fAbort = TRUE; - goto winClipboardFlushXEvents_SelectionNotify_Done; - } - - /* Copy the returned string into the global memory */ - if (fUseUnicode) - { - memcpy (pszGlobalData, - pwszUnicodeStr, - sizeof (wchar_t) * (iUnicodeLen + 1)); - free (pwszUnicodeStr); - pwszUnicodeStr = NULL; - } - else - { - strcpy (pszGlobalData, pszConvertData); - free (pszConvertData); - pszConvertData = NULL; - } - - /* Release the pointer to the global memory */ - GlobalUnlock (hGlobal); - pszGlobalData = NULL; - - /* Push the selection data to the Windows clipboard */ - if (fUseUnicode) - SetClipboardData (CF_UNICODETEXT, hGlobal); - else - SetClipboardData (CF_TEXT, hGlobal); - - /* Flag that SetClipboardData has been called */ - fSetClipboardData = FALSE; - - /* - * NOTE: Do not try to free pszGlobalData, it is owned by - * Windows after the call to SetClipboardData (). - */ - - winClipboardFlushXEvents_SelectionNotify_Done: - /* Free allocated resources */ - if (ppszTextList) - XFreeStringList (ppszTextList); - if (xtpText.value) - { - XFree (xtpText.value); - xtpText.value = NULL; - xtpText.nitems = 0; - } - free(pszConvertData); - free(pwszUnicodeStr); - if (hGlobal && pszGlobalData) - GlobalUnlock (hGlobal); - if (fSetClipboardData && g_fUnicodeSupport) - SetClipboardData (CF_UNICODETEXT, NULL); - if (fSetClipboardData) - SetClipboardData (CF_TEXT, NULL); - return WIN_XEVENTS_NOTIFY; - - case SelectionClear: - winDebug("SelectionClear - doing nothing\n"); - break; - - case PropertyNotify: - break; - - case MappingNotify: - break; - - default: - ErrorF ("winClipboardFlushXEvents - unexpected event type %d\n", event.type); - break; - } - } - - return WIN_XEVENTS_SUCCESS; -} +/*
+ *Copyright (C) 2003-2004 Harold L Hunt II All Rights Reserved.
+ *Copyright (C) Colin Harrison 2005-2008
+ *
+ *Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ *"Software"), to deal in the Software without restriction, including
+ *without limitation the rights to use, copy, modify, merge, publish,
+ *distribute, sublicense, and/or sell copies of the Software, and to
+ *permit persons to whom the Software is furnished to do so, subject to
+ *the following conditions:
+ *
+ *The above copyright notice and this permission notice shall be
+ *included in all copies or substantial portions of the Software.
+ *
+ *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *NONINFRINGEMENT. IN NO EVENT SHALL HAROLD L HUNT II BE LIABLE FOR
+ *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+ *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *Except as contained in this notice, the name of the copyright holder(s)
+ *and author(s) shall not be used in advertising or otherwise to promote
+ *the sale, use or other dealings in this Software without prior written
+ *authorization from the copyright holder(s) and author(s).
+ *
+ * Authors: Harold L Hunt II
+ * Colin Harrison
+ */
+
+#ifdef HAVE_XWIN_CONFIG_H
+#include <xwin-config.h>
+#endif
+#include "winclipboard.h"
+#include "misc.h"
+#include "winmsg.h"
+#include <unistd.h>
+
+/*
+ * References to external symbols
+ */
+
+extern Bool g_fUnicodeSupport;
+extern Bool g_fClipboardPrimary;
+
+
+/*
+ * Process any pending X events
+ */
+
+int
+winClipboardFlushXEvents (HWND hwnd,
+ int iWindow,
+ Display *pDisplay,
+ Bool fUseUnicode,
+ Bool ClipboardOpened)
+{
+ static Atom atomLocalProperty;
+ static Atom atomCompoundText;
+ static Atom atomUTF8String;
+ static Atom atomTargets;
+ static int generation;
+
+ if (generation != serverGeneration)
+ {
+ generation = serverGeneration;
+ atomLocalProperty = XInternAtom (pDisplay, WIN_LOCAL_PROPERTY, False);
+ atomUTF8String = XInternAtom (pDisplay, "UTF8_STRING", False);
+ atomCompoundText = XInternAtom (pDisplay, "COMPOUND_TEXT", False);
+ atomTargets = XInternAtom (pDisplay, "TARGETS", False);
+ }
+
+ /* Process all pending events */
+ while (XPending (pDisplay))
+ {
+ XTextProperty xtpText = {0};
+ XEvent event;
+ XSelectionEvent eventSelection;
+ unsigned long ulReturnBytesLeft;
+ char *pszReturnData = NULL;
+ char *pszGlobalData = NULL;
+ int iReturn;
+ HGLOBAL hGlobal = NULL;
+ XICCEncodingStyle xiccesStyle;
+ int iConvertDataLen = 0;
+ char *pszConvertData = NULL;
+ char *pszTextList[2] = {NULL};
+ int iCount;
+ char **ppszTextList = NULL;
+ wchar_t *pwszUnicodeStr = NULL;
+ int iUnicodeLen = 0;
+ int iReturnDataLen = 0;
+ int i;
+ Bool fAbort = FALSE;
+ Bool fCloseClipboard = FALSE;
+ Bool fSetClipboardData = TRUE;
+
+ /* Get the next event - will not block because one is ready */
+ XNextEvent (pDisplay, &event);
+
+ winDebug ("Received event type %d\n",event.type);
+
+ /* Branch on the event type */
+ switch (event.type)
+ {
+ /*
+ * SelectionRequest
+ */
+
+ case SelectionRequest:
+#ifdef _DEBUG
+ {
+ char *pszAtomName = NULL;
+ winDebug("SelectionRequest - target %d\n",
+ event.xselectionrequest.target);
+
+ pszAtomName = XGetAtomName (pDisplay,
+ event.xselectionrequest.target);
+ winDebug("SelectionRequest - Target atom name %s\n", pszAtomName);
+ XFree (pszAtomName);
+ pszAtomName = NULL;
+ winDebug ("SelectionRequest - owner %d\n", event.xselectionrequest.owner);
+ winDebug ("SelectionRequest - requestor %d\n", event.xselectionrequest.requestor);
+ }
+#endif
+
+ /* Abort if invalid target type */
+ if (event.xselectionrequest.target != XA_STRING
+ && event.xselectionrequest.target != atomUTF8String
+ && event.xselectionrequest.target != atomCompoundText
+ && event.xselectionrequest.target != atomTargets)
+ {
+ /* Abort */
+ fAbort = TRUE;
+ goto winClipboardFlushXEvents_SelectionRequest_Done;
+ }
+
+ /* Handle targets type of request */
+ if (event.xselectionrequest.target == atomTargets)
+ {
+ Atom atomTargetArr[] = {atomTargets,
+ atomCompoundText,
+ atomUTF8String,
+ XA_STRING};
+
+ /* Try to change the property */
+ iReturn = XChangeProperty (pDisplay,
+ event.xselectionrequest.requestor,
+ event.xselectionrequest.property,
+ XA_ATOM,
+ 32,
+ PropModeReplace,
+ (unsigned char *) atomTargetArr,
+ (sizeof (atomTargetArr)
+ / sizeof (atomTargetArr[0])));
+ if (iReturn == BadAlloc
+ || iReturn == BadAtom
+ || iReturn == BadMatch
+ || iReturn == BadValue
+ || iReturn == BadWindow)
+ {
+ ErrorF ("winClipboardFlushXEvents - SelectionRequest - "
+ "XChangeProperty failed: %d\n",
+ iReturn);
+ }
+
+ /* Setup selection notify xevent */
+ eventSelection.type = SelectionNotify;
+ eventSelection.send_event = True;
+ eventSelection.display = pDisplay;
+ eventSelection.requestor = event.xselectionrequest.requestor;
+ eventSelection.selection = event.xselectionrequest.selection;
+ eventSelection.target = event.xselectionrequest.target;
+ eventSelection.property = event.xselectionrequest.property;
+ eventSelection.time = event.xselectionrequest.time;
+
+ /*
+ * Notify the requesting window that
+ * the operation has completed
+ */
+ iReturn = XSendEvent (pDisplay,
+ eventSelection.requestor,
+ False,
+ 0L,
+ (XEvent *) &eventSelection);
+ if (iReturn == BadValue || iReturn == BadWindow)
+ {
+ ErrorF ("winClipboardFlushXEvents - SelectionRequest - "
+ "XSendEvent () failed\n");
+ }
+ break;
+ }
+
+ /* Check that clipboard format is available */
+ if (fUseUnicode
+ && !IsClipboardFormatAvailable (CF_UNICODETEXT))
+ {
+ static int count; /* Hack to stop acroread spamming the log */
+ static HWND lasthwnd; /* I've not seen any other client get here repeatedly? */
+ if (hwnd != lasthwnd) count = 0;
+ count++;
+ if (count < 6) ErrorF ("winClipboardFlushXEvents - CF_UNICODETEXT is not "
+ "available from Win32 clipboard. Aborting %d.\n", count);
+ lasthwnd = hwnd;
+
+ /* Abort */
+ fAbort = TRUE;
+ goto winClipboardFlushXEvents_SelectionRequest_Done;
+ }
+ else if (!fUseUnicode
+ && !IsClipboardFormatAvailable (CF_TEXT))
+ {
+ ErrorF ("winClipboardFlushXEvents - CF_TEXT is not "
+ "available from Win32 clipboard. Aborting.\n");
+
+ /* Abort */
+ fAbort = TRUE;
+ goto winClipboardFlushXEvents_SelectionRequest_Done;
+ }
+
+ /* Access the clipboard */
+ if (!ClipboardOpened)
+ {
+ if (!OpenClipboard (hwnd))
+ {
+ ErrorF ("winClipboardFlushXEvents - SelectionRequest - "
+ "OpenClipboard () failed: %08lx\n",
+ GetLastError ());
+
+ /* Abort */
+ fAbort = TRUE;
+ goto winClipboardFlushXEvents_SelectionRequest_Done;
+ }
+
+ /* Indicate that clipboard was opened */
+ fCloseClipboard = TRUE;
+ }
+ /* Setup the string style */
+ if (event.xselectionrequest.target == XA_STRING)
+ xiccesStyle = XStringStyle;
+#ifdef X_HAVE_UTF8_STRING
+ else if (event.xselectionrequest.target == atomUTF8String)
+ xiccesStyle = XUTF8StringStyle;
+#endif
+ else if (event.xselectionrequest.target == atomCompoundText)
+ xiccesStyle = XCompoundTextStyle;
+ else
+ xiccesStyle = XStringStyle;
+
+ /*
+ * FIXME: Can't pass CF_UNICODETEXT on Windows 95/98/Me
+ */
+
+ /* Get a pointer to the clipboard text, in desired format */
+ if (fUseUnicode)
+ {
+ /* Retrieve clipboard data */
+ hGlobal = GetClipboardData (CF_UNICODETEXT);
+ }
+ else
+ {
+ /* Retrieve clipboard data */
+ hGlobal = GetClipboardData (CF_TEXT);
+ }
+ if (!hGlobal)
+ {
+ if (GetLastError()==ERROR_CLIPBOARD_NOT_OPEN && ClipboardOpened)
+ {
+ ErrorF("We should not have received a SelectionRequest????\n"
+ "The owner is the clipboard, but in reality it was"
+ "an X window\n");
+ /* Set the owner to None */
+ if (g_fClipboardPrimary) XSetSelectionOwner (pDisplay, XA_PRIMARY, None, CurrentTime);
+ XSetSelectionOwner (pDisplay, XInternAtom (pDisplay, "CLIPBOARD", False), None, CurrentTime);
+ }
+ ErrorF ("winClipboardFlushXEvents - SelectionRequest - "
+ "GetClipboardData () failed: %08lx\n",
+ GetLastError ());
+
+ /* Abort */
+ fAbort = TRUE;
+ goto winClipboardFlushXEvents_SelectionRequest_Done;
+ }
+ pszGlobalData = (char *) GlobalLock (hGlobal);
+
+ /* Convert the Unicode string to UTF8 (MBCS) */
+ if (fUseUnicode)
+ {
+ iConvertDataLen = WideCharToMultiByte (CP_UTF8,
+ 0,
+ (LPCWSTR)pszGlobalData,
+ -1,
+ NULL,
+ 0,
+ NULL,
+ NULL);
+ /* NOTE: iConvertDataLen includes space for null terminator */
+ pszConvertData = (char *) malloc (iConvertDataLen);
+ WideCharToMultiByte (CP_UTF8,
+ 0,
+ (LPCWSTR)pszGlobalData,
+ -1,
+ pszConvertData,
+ iConvertDataLen,
+ NULL,
+ NULL);
+ }
+ else
+ {
+ pszConvertData = strdup (pszGlobalData);
+ iConvertDataLen = strlen (pszConvertData) + 1;
+ }
+
+ /* Convert DOS string to UNIX string */
+ winClipboardDOStoUNIX (pszConvertData, strlen (pszConvertData));
+
+ /* Setup our text list */
+ pszTextList[0] = pszConvertData;
+ pszTextList[1] = NULL;
+
+ /* Initialize the text property */
+ xtpText.value = NULL;
+ xtpText.nitems = 0;
+
+ /* Create the text property from the text list */
+ if (fUseUnicode)
+ {
+#ifdef X_HAVE_UTF8_STRING
+ iReturn = Xutf8TextListToTextProperty (pDisplay,
+ pszTextList,
+ 1,
+ xiccesStyle,
+ &xtpText);
+#endif
+ }
+ else
+ {
+ iReturn = XmbTextListToTextProperty (pDisplay,
+ pszTextList,
+ 1,
+ xiccesStyle,
+ &xtpText);
+ }
+ if (iReturn == XNoMemory || iReturn == XLocaleNotSupported)
+ {
+ ErrorF ("winClipboardFlushXEvents - SelectionRequest - "
+ "X*TextListToTextProperty failed: %d\n",
+ iReturn);
+
+ /* Abort */
+ fAbort = TRUE;
+ goto winClipboardFlushXEvents_SelectionRequest_Done;
+ }
+
+ /* Free the converted string */
+ free (pszConvertData);
+ pszConvertData = NULL;
+
+ /* Copy the clipboard text to the requesting window */
+ iReturn = XChangeProperty (pDisplay,
+ event.xselectionrequest.requestor,
+ event.xselectionrequest.property,
+ event.xselectionrequest.target,
+ 8,
+ PropModeReplace,
+ xtpText.value,
+ xtpText.nitems);
+ if (iReturn == BadAlloc || iReturn == BadAtom
+ || iReturn == BadMatch || iReturn == BadValue
+ || iReturn == BadWindow)
+ {
+ ErrorF ("winClipboardFlushXEvents - SelectionRequest - "
+ "XChangeProperty failed: %d\n",
+ iReturn);
+
+ /* Abort */
+ fAbort = TRUE;
+ goto winClipboardFlushXEvents_SelectionRequest_Done;
+ }
+
+ /* Release the clipboard data */
+ GlobalUnlock (hGlobal);
+ pszGlobalData = NULL;
+ if (fCloseClipboard)
+ {
+ fCloseClipboard = FALSE;
+ CloseClipboard ();
+ }
+ /* Clean up */
+ XFree (xtpText.value);
+ xtpText.value = NULL;
+ xtpText.nitems = 0;
+
+ /* Setup selection notify event */
+ eventSelection.type = SelectionNotify;
+ eventSelection.send_event = True;
+ eventSelection.display = pDisplay;
+ eventSelection.requestor = event.xselectionrequest.requestor;
+ eventSelection.selection = event.xselectionrequest.selection;
+ eventSelection.target = event.xselectionrequest.target;
+ eventSelection.property = event.xselectionrequest.property;
+ eventSelection.time = event.xselectionrequest.time;
+
+ /* Notify the requesting window that the operation has completed */
+ iReturn = XSendEvent (pDisplay,
+ eventSelection.requestor,
+ False,
+ 0L,
+ (XEvent *) &eventSelection);
+ if (iReturn == BadValue || iReturn == BadWindow)
+ {
+ ErrorF ("winClipboardFlushXEvents - SelectionRequest - "
+ "XSendEvent () failed\n");
+
+ /* Abort */
+ fAbort = TRUE;
+ goto winClipboardFlushXEvents_SelectionRequest_Done;
+ }
+
+ winClipboardFlushXEvents_SelectionRequest_Done:
+ /* Free allocated resources */
+ if (xtpText.value)
+ {
+ XFree (xtpText.value);
+ xtpText.value = NULL;
+ xtpText.nitems = 0;
+ }
+ free(pszConvertData);
+ if (hGlobal && pszGlobalData)
+ GlobalUnlock (hGlobal);
+
+ /*
+ * Send a SelectionNotify event to the requesting
+ * client when we abort.
+ */
+ if (fAbort)
+ {
+ /* Setup selection notify event */
+ eventSelection.type = SelectionNotify;
+ eventSelection.send_event = True;
+ eventSelection.display = pDisplay;
+ eventSelection.requestor = event.xselectionrequest.requestor;
+ eventSelection.selection = event.xselectionrequest.selection;
+ eventSelection.target = event.xselectionrequest.target;
+ eventSelection.property = None;
+ eventSelection.time = event.xselectionrequest.time;
+
+ /* Notify the requesting window that the operation is complete */
+ iReturn = XSendEvent (pDisplay,
+ eventSelection.requestor,
+ False,
+ 0L,
+ (XEvent *) &eventSelection);
+ if (iReturn == BadValue || iReturn == BadWindow)
+ {
+ /*
+ * Should not be a problem if XSendEvent fails because
+ * the client may simply have exited.
+ */
+ ErrorF ("winClipboardFlushXEvents - SelectionRequest - "
+ "XSendEvent () failed for abort event.\n");
+ }
+ }
+
+ /* Close clipboard if it was opened */
+ if (fCloseClipboard)
+ {
+ fCloseClipboard = FALSE;
+ CloseClipboard ();
+ }
+ break;
+
+
+ /*
+ * SelectionNotify
+ */
+ case SelectionNotify:
+#ifdef _DEBUG
+ winDebug ("winClipboardFlushXEvents - SelectionNotify\n");
+ {
+ char *pszAtomName;
+ pszAtomName = XGetAtomName (pDisplay,
+ event.xselection.selection);
+
+ winDebug("winClipboardFlushXEvents - SelectionNotify - ATOM: %s\n",
+ pszAtomName);
+ winDebug ("SelectionNotify - requestor %d\n", event.xselectionrequest.requestor);
+ XFree (pszAtomName);
+ }
+#endif
+
+
+ /*
+ * Request conversion of UTF8 and CompoundText targets.
+ */
+ if (event.xselection.property == None)
+ {
+ if (event.xselection.target == XA_STRING)
+ {
+ winDebug ("winClipboardFlushXEvents - SelectionNotify - "
+ "XA_STRING\n");
+
+ return WIN_XEVENTS_CONVERT;
+ }
+ else if (event.xselection.target == atomUTF8String)
+ {
+ winDebug("winClipboardFlushXEvents - SelectionNotify - "
+ "Requesting conversion of UTF8 target.\n");
+
+ XConvertSelection (pDisplay,
+ event.xselection.selection,
+ XA_STRING,
+ atomLocalProperty,
+ iWindow,
+ CurrentTime);
+
+ /* Process the ConvertSelection event */
+ XFlush (pDisplay);
+ return WIN_XEVENTS_CONVERT;
+ }
+#ifdef X_HAVE_UTF8_STRING
+ else if (event.xselection.target == atomCompoundText)
+ {
+ winDebug("winClipboardFlushXEvents - SelectionNotify - "
+ "Requesting conversion of CompoundText target.\n");
+
+ XConvertSelection (pDisplay,
+ event.xselection.selection,
+ atomUTF8String,
+ atomLocalProperty,
+ iWindow,
+ CurrentTime);
+
+ /* Process the ConvertSelection event */
+ XFlush (pDisplay);
+ return WIN_XEVENTS_CONVERT;
+ }
+#endif
+ else
+ {
+ ErrorF ("winClipboardFlushXEvents - SelectionNotify - "
+ "Unknown format. Cannot request conversion, "
+ "aborting.\n");
+ break;
+ }
+ }
+
+ /* Retrieve the size of the stored data */
+ iReturn = XGetWindowProperty (pDisplay,
+ iWindow,
+ atomLocalProperty,
+ 0,
+ 0, /* Don't get data, just size */
+ False,
+ AnyPropertyType,
+ &xtpText.encoding,
+ &xtpText.format,
+ &xtpText.nitems,
+ &ulReturnBytesLeft,
+ &xtpText.value);
+ if (iReturn != Success)
+ {
+ ErrorF ("winClipboardFlushXEvents - SelectionNotify - "
+ "XGetWindowProperty () failed, aborting: %d\n",
+ iReturn);
+ break;
+ }
+
+ winDebug("SelectionNotify - returned data %d left %d\n",
+ xtpText.nitems, ulReturnBytesLeft);
+
+ /* Request the selection data */
+ iReturn = XGetWindowProperty (pDisplay,
+ iWindow,
+ atomLocalProperty,
+ 0,
+ ulReturnBytesLeft,
+ False,
+ AnyPropertyType,
+ &xtpText.encoding,
+ &xtpText.format,
+ &xtpText.nitems,
+ &ulReturnBytesLeft,
+ &xtpText.value);
+ if (iReturn != Success)
+ {
+ ErrorF ("winClipboardFlushXEvents - SelectionNotify - "
+ "XGetWindowProperty () failed, aborting: %d\n",
+ iReturn);
+ break;
+ }
+
+#ifdef WINDBG
+ {
+ char *pszAtomName = NULL;
+
+ winDebug("SelectionNotify - returned data %d left %d\n",
+ xtpText.nitems, ulReturnBytesLeft);
+ pszAtomName = XGetAtomName(pDisplay, xtpText.encoding);
+ winDebug("Notify atom name %s\n", pszAtomName);
+ XFree (pszAtomName);
+ pszAtomName = NULL;
+ }
+#endif
+
+ if (fUseUnicode)
+ {
+#ifdef X_HAVE_UTF8_STRING
+ /* Convert the text property to a text list */
+ iReturn = Xutf8TextPropertyToTextList (pDisplay,
+ &xtpText,
+ &ppszTextList,
+ &iCount);
+#endif
+ }
+ else
+ {
+ iReturn = XmbTextPropertyToTextList (pDisplay,
+ &xtpText,
+ &ppszTextList,
+ &iCount);
+ }
+ if (iReturn == Success || iReturn > 0)
+ {
+ /* Conversion succeeded or some unconvertible characters */
+ if (ppszTextList != NULL)
+ {
+ iReturnDataLen = 0;
+ for (i = 0; i < iCount; i++)
+ {
+ iReturnDataLen += strlen(ppszTextList[i]);
+ }
+ pszReturnData = (char *) malloc (iReturnDataLen + 1);
+ pszReturnData[0] = '\0';
+ for (i = 0; i < iCount; i++)
+ {
+ strcat (pszReturnData, ppszTextList[i]);
+ }
+ }
+ else
+ {
+ ErrorF ("winClipboardFlushXEvents - SelectionNotify - "
+ "X*TextPropertyToTextList list_return is NULL.\n");
+ pszReturnData = (char *) malloc (1);
+ pszReturnData[0] = '\0';
+ }
+ }
+ else
+ {
+ ErrorF ("winClipboardFlushXEvents - SelectionNotify - "
+ "X*TextPropertyToTextList returned: ");
+ switch (iReturn)
+ {
+ case XNoMemory:
+ ErrorF ("XNoMemory\n");
+ break;
+ case XLocaleNotSupported:
+ ErrorF ("XLocaleNotSupported\n");
+ break;
+ case XConverterNotFound:
+ ErrorF ("XConverterNotFound\n");
+ break;
+ default:
+ ErrorF ("%d\n", iReturn);
+ break;
+ }
+ pszReturnData = (char *) malloc (1);
+ pszReturnData[0] = '\0';
+ }
+
+ /* Free the data returned from XGetWindowProperty */
+ if (ppszTextList)
+ XFreeStringList (ppszTextList);
+ ppszTextList = NULL;
+ XFree (xtpText.value);
+ xtpText.value = NULL;
+ xtpText.nitems = 0;
+
+ /* Convert the X clipboard string to DOS format */
+ winClipboardUNIXtoDOS ((unsigned char **)&pszReturnData, strlen (pszReturnData));
+
+ if (fUseUnicode)
+ {
+ /* Find out how much space needed to convert MBCS to Unicode */
+ iUnicodeLen = MultiByteToWideChar (CP_UTF8,
+ 0,
+ pszReturnData,
+ -1,
+ NULL,
+ 0);
+
+ /* Allocate memory for the Unicode string */
+ pwszUnicodeStr
+ = (wchar_t*) malloc (sizeof (wchar_t) * (iUnicodeLen + 1));
+ if (!pwszUnicodeStr)
+ {
+ ErrorF ("winClipboardFlushXEvents - SelectionNotify "
+ "malloc failed for pwszUnicodeStr, aborting.\n");
+
+ /* Abort */
+ fAbort = TRUE;
+ goto winClipboardFlushXEvents_SelectionNotify_Done;
+ }
+
+ /* Do the actual conversion */
+ MultiByteToWideChar (CP_UTF8,
+ 0,
+ pszReturnData,
+ -1,
+ pwszUnicodeStr,
+ iUnicodeLen);
+
+ /* Allocate global memory for the X clipboard data */
+ hGlobal = GlobalAlloc (GMEM_MOVEABLE,
+ sizeof (wchar_t) * (iUnicodeLen + 1));
+ }
+ else
+ {
+ pszConvertData = strdup (pszReturnData);
+ iConvertDataLen = strlen (pszConvertData) + 1;
+
+ /* Allocate global memory for the X clipboard data */
+ hGlobal = GlobalAlloc (GMEM_MOVEABLE, iConvertDataLen);
+ }
+
+ free (pszReturnData);
+
+ /* Check that global memory was allocated */
+ if (!hGlobal)
+ {
+ ErrorF ("winClipboardFlushXEvents - SelectionNotify "
+ "GlobalAlloc failed, aborting: %ld\n",
+ GetLastError ());
+
+ /* Abort */
+ fAbort = TRUE;
+ goto winClipboardFlushXEvents_SelectionNotify_Done;
+ }
+
+ /* Obtain a pointer to the global memory */
+ pszGlobalData = GlobalLock (hGlobal);
+ if (pszGlobalData == NULL)
+ {
+ ErrorF ("winClipboardFlushXEvents - Could not lock global "
+ "memory for clipboard transfer\n");
+
+ /* Abort */
+ fAbort = TRUE;
+ goto winClipboardFlushXEvents_SelectionNotify_Done;
+ }
+
+ /* Copy the returned string into the global memory */
+ if (fUseUnicode)
+ {
+ memcpy (pszGlobalData,
+ pwszUnicodeStr,
+ sizeof (wchar_t) * (iUnicodeLen + 1));
+ free (pwszUnicodeStr);
+ pwszUnicodeStr = NULL;
+ }
+ else
+ {
+ strcpy (pszGlobalData, pszConvertData);
+ free (pszConvertData);
+ pszConvertData = NULL;
+ }
+
+ /* Release the pointer to the global memory */
+ GlobalUnlock (hGlobal);
+ pszGlobalData = NULL;
+
+ /* Push the selection data to the Windows clipboard */
+ if (fUseUnicode)
+ SetClipboardData (CF_UNICODETEXT, hGlobal);
+ else
+ SetClipboardData (CF_TEXT, hGlobal);
+
+ /* Flag that SetClipboardData has been called */
+ fSetClipboardData = FALSE;
+
+ /*
+ * NOTE: Do not try to free pszGlobalData, it is owned by
+ * Windows after the call to SetClipboardData ().
+ */
+
+ winClipboardFlushXEvents_SelectionNotify_Done:
+ /* Free allocated resources */
+ if (ppszTextList)
+ XFreeStringList (ppszTextList);
+ if (xtpText.value)
+ {
+ XFree (xtpText.value);
+ xtpText.value = NULL;
+ xtpText.nitems = 0;
+ }
+ free(pszConvertData);
+ free(pwszUnicodeStr);
+ if (hGlobal && pszGlobalData)
+ GlobalUnlock (hGlobal);
+ if (fSetClipboardData && g_fUnicodeSupport)
+ SetClipboardData (CF_UNICODETEXT, NULL);
+ if (fSetClipboardData)
+ SetClipboardData (CF_TEXT, NULL);
+ return WIN_XEVENTS_NOTIFY;
+
+ /*
+ * SelectionClear
+ */
+ case SelectionClear:
+#ifdef _DEBUG
+ winDebug ("SelectionClear - doing nothing\n");
+ {
+ char *pszAtomName;
+
+ pszAtomName = XGetAtomName (pDisplay,
+ event.xselection.selection);
+
+ winDebug ("SelectionClear - ATOM: %s\n",
+ pszAtomName);
+ winDebug ("SelectionClear - owner %d\n", event.xselectionrequest.owner);
+
+ XFree (pszAtomName);
+ }
+#endif
+ break;
+
+ case PropertyNotify:
+ break;
+
+ case MappingNotify:
+ XRefreshKeyboardMapping((XMappingEvent *)&event);
+ break;
+
+ default:
+ ErrorF ("winClipboardFlushXEvents - unexpected event type %d\n", event.type);
+ break;
+ }
+ }
+
+ return WIN_XEVENTS_SUCCESS;
+}
diff --git a/xorg-server/hw/xwin/wincmap.c b/xorg-server/hw/xwin/wincmap.c index 6cb037243..83279fd84 100644 --- a/xorg-server/hw/xwin/wincmap.c +++ b/xorg-server/hw/xwin/wincmap.c @@ -119,17 +119,13 @@ winInstallColormap (ColormapPtr pColormap) winScreenPriv(pScreen);
ColormapPtr oldpmap = pScreenPriv->pcmapInstalled;
-#if CYGDEBUG
winDebug ("winInstallColormap\n");
-#endif
/* Did the colormap actually change? */
if (pColormap != oldpmap)
{
-#if CYGDEBUG
winDebug ("winInstallColormap - Colormap has changed, attempt "
"to install.\n");
-#endif
/* Was there a previous colormap? */
if (oldpmap != (ColormapPtr) None)
@@ -145,7 +141,7 @@ winInstallColormap (ColormapPtr pColormap) /* Call the engine specific colormap install procedure */
if (!((*pScreenPriv->pwinInstallColormap) (pColormap)))
{
- winErrorFVerb (2, "winInstallColormap - Screen specific colormap install "
+ ErrorF ("winInstallColormap - Screen specific colormap install "
"procedure failed. Continuing, but colors may be "
"messed up from now on.\n");
}
@@ -163,9 +159,7 @@ winUninstallColormap (ColormapPtr pmap) winScreenPriv(pmap->pScreen);
ColormapPtr curpmap = pScreenPriv->pcmapInstalled;
-#if CYGDEBUG
winDebug ("winUninstallColormap\n");
-#endif
/* Is the colormap currently installed? */
if (pmap != curpmap)
@@ -204,7 +198,7 @@ winStoreColors (ColormapPtr pmap, int i;
unsigned short nRed, nGreen, nBlue;
-#if CYGDEBUG
+#ifdef WINDBG
if (ndef != 1)
winDebug ("winStoreColors - ndef: %d\n",
ndef);
@@ -228,16 +222,14 @@ winStoreColors (ColormapPtr pmap, pCmapPriv->rgbColors[pdefs[0].pixel + i].rgbGreen = nGreen;
pCmapPriv->rgbColors[pdefs[0].pixel + i].rgbBlue = nBlue;
-#if CYGDEBUG
winDebug ("winStoreColors - nRed %d nGreen %d nBlue %d\n",
nRed, nGreen, nBlue);
-#endif
}
/* Call the engine specific store colors procedure */
if (!((pScreenPriv->pwinStoreColors) (pmap, ndef, pdefs)))
{
- winErrorFVerb (2, "winStoreColors - Engine cpecific color storage procedure "
+ ErrorF ("winStoreColors - Engine cpecific color storage procedure "
"failed. Continuing, but colors may be messed up from now "
"on.\n");
}
@@ -251,9 +243,7 @@ winResolveColor (unsigned short *pred, unsigned short *pblue,
VisualPtr pVisual)
{
-#if CYGDEBUG
winDebug ("winResolveColor ()\n");
-#endif
miResolveColor (pred, pgreen, pblue, pVisual);
}
@@ -267,9 +257,7 @@ winCreateColormap (ColormapPtr pmap) ScreenPtr pScreen = pmap->pScreen;
winScreenPriv(pScreen);
-#if CYGDEBUG
winDebug ("winCreateColormap\n");
-#endif
/* Allocate colormap privates */
if (!winAllocateCmapPrivates (pmap))
@@ -319,7 +307,7 @@ winDestroyColormap (ColormapPtr pColormap) /* Call the engine specific colormap destruction procedure */
if (!((*pScreenPriv->pwinDestroyColormap) (pColormap)))
{
- winErrorFVerb (2, "winDestroyColormap - Engine specific colormap destruction "
+ ErrorF ("winDestroyColormap - Engine specific colormap destruction "
"procedure failed. Continuing, but it is possible that memory "
"was leaked, or that colors will be messed up from now on.\n");
}
@@ -328,9 +316,7 @@ winDestroyColormap (ColormapPtr pColormap) free (pCmapPriv);
winSetCmapPriv (pColormap, NULL);
-#if CYGDEBUG
winDebug ("winDestroyColormap - Returning\n");
-#endif
}
@@ -359,10 +345,8 @@ winGetPaletteDIB (ScreenPtr pScreen, ColormapPtr pcmap) return FALSE;
}
-#if CYGDEBUG
winDebug ("winGetPaletteDIB - Retrieved %d colors from DIB\n",
uiColorsRetrieved);
-#endif
/* Set the DIB color table to the default screen palette */
if (SetDIBColorTable (pScreenPriv->hdcShadow,
@@ -384,11 +368,9 @@ winGetPaletteDIB (ScreenPtr pScreen, ColormapPtr pcmap) nGreen = rgbColors[i].rgbGreen << 8;
nBlue = rgbColors[i].rgbBlue << 8;
-#if CYGDEBUG
winDebug ("winGetPaletteDIB - Allocating a color: %d; "
"%d %d %d\n",
pixel, nRed, nGreen, nBlue);
-#endif
/* Allocate a entry in the X colormap */
if (AllocColor (pcmap,
@@ -460,10 +442,8 @@ winGetPaletteDD (ScreenPtr pScreen, ColormapPtr pcmap) return FALSE;
}
-#if CYGDEBUG
winDebug ("winGetPaletteDD - uiSystemPaletteEntries %d\n",
uiSystemPaletteEntries);
-#endif
/* Allocate palette entries structure */
ppeColors = malloc (uiSystemPaletteEntries * sizeof (PALETTEENTRY));
@@ -486,11 +466,9 @@ winGetPaletteDD (ScreenPtr pScreen, ColormapPtr pcmap) nRed = ppeColors[i].peRed << 8;
nGreen = ppeColors[i].peGreen << 8;
nBlue = ppeColors[i].peBlue << 8;
-#if CYGDEBUG
winDebug ("winGetPaletteDD - Allocating a color: %d; "
"%d %d %d\n",
pixel, nRed, nGreen, nBlue);
-#endif
if (AllocColor (pcmap,
&nRed,
&nGreen,
@@ -545,9 +523,7 @@ winCreateDefColormap (ScreenPtr pScreen) ColormapPtr pcmap = NULL;
Pixel wp, bp;
-#if CYGDEBUG
winDebug ("winCreateDefColormap\n");
-#endif
/* Use standard fb colormaps for non palettized color modes */
if (pScreenInfo->dwBPP > 8)
@@ -567,10 +543,8 @@ winCreateDefColormap (ScreenPtr pScreen) * to be changed by clients.
*/
-#if CYGDEBUG
winDebug ("winCreateDefColormap - defColormap: %d\n",
pScreen->defColormap);
-#endif
/* Allocate an X colormap, owned by client 0 */
if (CreateColormap (pScreen->defColormap,
@@ -589,9 +563,7 @@ winCreateDefColormap (ScreenPtr pScreen) return FALSE;
}
-#if CYGDEBUG
winDebug ("winCreateDefColormap - Created a colormap\n");
-#endif
/* Branch on the visual class */
if (!(pVisual->class & DynamicClass))
@@ -636,36 +608,12 @@ winCreateDefColormap (ScreenPtr pScreen) pScreen->whitePixel = wp;
pScreen->blackPixel = bp;
-#if 0
- /* Have to reserve first 10 and last ten pixels in DirectDraw windowed */
- if (pScreenInfo->dwEngine != WIN_SERVER_SHADOW_GDI)
- {
- int k;
- Pixel p;
-
- for (k = 1; k < 10; ++k)
- {
- p = k;
- if (AllocColor (pcmap, &ones, &ones, &ones, &p, 0) != Success)
- FatalError ("Foo!\n");
- }
-
- for (k = 245; k < 255; ++k)
- {
- p = k;
- if (AllocColor (pcmap, &zero, &zero, &zero, &p, 0) != Success)
- FatalError ("Baz!\n");
- }
- }
-#endif
}
/* Install the created colormap */
(*pScreen->InstallColormap)(pcmap);
-#if CYGDEBUG
winDebug ("winCreateDefColormap - Returning\n");
-#endif
return TRUE;
}
diff --git a/xorg-server/hw/xwin/winconfig.c b/xorg-server/hw/xwin/winconfig.c index 7b26432f2..1325e77a6 100644 --- a/xorg-server/hw/xwin/winconfig.c +++ b/xorg-server/hw/xwin/winconfig.c @@ -145,11 +145,11 @@ winReadConfigfile () if (filename)
{
- winMsg (from, "Using config file: \"%s\"\n", filename);
+ winDebug ("Using config file: \"%s\"\n", filename);
}
else
{
- winMsg (X_ERROR, "Unable to locate/open config file");
+ ErrorF ("Unable to locate/open config file");
if (xf86ConfigFile)
ErrorF (": \"%s\"", xf86ConfigFile);
ErrorF ("\n");
@@ -171,7 +171,7 @@ winReadConfigfile () }
if ((g_xf86configptr = xf86readConfigFile ()) == NULL)
{
- winMsg (X_ERROR, "Problem parsing the config file\n");
+ ErrorF ("Problem parsing the config file\n");
return FALSE;
}
xf86closeConfigFile ();
@@ -184,13 +184,12 @@ winReadConfigfile () {
if (g_cmdline.screenname == NULL)
{
- winMsg (X_WARNING,
- "No Layout section. Using the first Screen section.\n");
+ winDebug ("No Layout section. Using the first Screen section.\n");
}
if (!configImpliedLayout (&g_winConfigLayout,
g_xf86configptr->conf_screen_lst))
{
- winMsg (X_ERROR, "Unable to determine the screen layout\n");
+ ErrorF ("Unable to determine the screen layout\n");
return FALSE;
}
}
@@ -210,7 +209,7 @@ winReadConfigfile () g_xf86configptr->conf_layout_lst,
dfltlayout))
{
- winMsg (X_ERROR, "Unable to determine the screen layout\n");
+ ErrorF ("Unable to determine the screen layout\n");
return FALSE;
}
}
@@ -220,7 +219,7 @@ winReadConfigfile () g_xf86configptr->conf_layout_lst,
NULL))
{
- winMsg (X_ERROR, "Unable to determine the screen layout\n");
+ ErrorF ("Unable to determine the screen layout\n");
return FALSE;
}
}
@@ -272,7 +271,7 @@ winConfigKeyboard (DeviceIntPtr pDevice) case 3: g_winInfo.keyboard.delay = 1000; break;
}
g_winInfo.keyboard.rate = (kbd_speed>0)?kbd_speed:1;
- winMsgVerb(X_PROBED, 1, "Setting autorepeat to delay=%d, rate=%d\n",
+ winDebug("Setting autorepeat to delay=%d, rate=%d\n",
g_winInfo.keyboard.delay, g_winInfo.keyboard.rate);
}
}
@@ -298,9 +297,9 @@ winConfigKeyboard (DeviceIntPtr pDevice) such as the lack of WM_KEYUP for Caps Lock key.
Loading US layout fixes this problem. */
if (LoadKeyboardLayout("00000409", KLF_ACTIVATE) != NULL)
- winMsg (X_INFO, "Loading US keyboard layout.\n");
+ winDebug("Loading US keyboard layout.\n");
else
- winMsg (X_ERROR, "LoadKeyboardLayout failed.\n");
+ ErrorF ("LoadKeyboardLayout failed.\n");
}
}
@@ -324,7 +323,7 @@ winConfigKeyboard (DeviceIntPtr pDevice) free(regpath);
}
- winMsg (X_PROBED, "Windows keyboard layout: \"%s\" (%08x) \"%s\", type %d\n",
+ winDebug ("Windows keyboard layout: \"%s\" (%08x) \"%s\", type %d\n",
layoutName, layoutNum, layoutFriendlyName, keyboardType);
for (pLayout = winKBLayouts; pLayout->winlayout != -1; pLayout++)
@@ -335,11 +334,11 @@ winConfigKeyboard (DeviceIntPtr pDevice) continue;
bfound = TRUE;
- winMsg (X_PROBED,
+ winDebug (
"Found matching XKB configuration \"%s\"\n",
pLayout->layoutname);
- winMsg(X_PROBED,
+ winDebug(
"Model = \"%s\" Layout = \"%s\""
" Variant = \"%s\" Options = \"%s\"\n",
pLayout->xkbmodel ? pLayout->xkbmodel : "none",
@@ -358,7 +357,7 @@ winConfigKeyboard (DeviceIntPtr pDevice) if (!bfound)
{
- winMsg (X_ERROR, "Keyboardlayout \"%s\" (%s) is unknown, using X server default layout\n", layoutFriendlyName, layoutName);
+ ErrorF ("Keyboardlayout \"%s\" (%s) is unknown, using X server default layout\n", layoutFriendlyName, layoutName);
}
}
@@ -392,7 +391,7 @@ winConfigKeyboard (DeviceIntPtr pDevice) {
if (kbd->inp_identifier)
- winMsg (kbdfrom, "Using keyboard \"%s\" as primary keyboard\n",
+ winDebug ("Using keyboard \"%s\" as primary keyboard\n",
kbd->inp_identifier);
if ((s = winSetStrOption(kbd->inp_option_lst, "AutoRepeat", NULL)))
@@ -403,12 +402,12 @@ winConfigKeyboard (DeviceIntPtr pDevice) (g_winInfo.keyboard.rate == 0) ||
(1000 / g_winInfo.keyboard.rate) < 1)
{
- winErrorFVerb (2, "\"%s\" is not a valid AutoRepeat value", s);
+ ErrorF ("\"%s\" is not a valid AutoRepeat value", s);
free(s);
return FALSE;
}
free(s);
- winMsg (X_CONFIG, "AutoRepeat: %ld %ld\n",
+ winDebug ("AutoRepeat: %ld %ld\n",
g_winInfo.keyboard.delay, g_winInfo.keyboard.rate);
}
#endif
@@ -429,7 +428,7 @@ winConfigKeyboard (DeviceIntPtr pDevice) if (s)
{
g_winInfo.xkb.rules = NULL_IF_EMPTY (s);
- winMsg (from, "XKB: rules: \"%s\"\n", s);
+ winDebug ("XKB: rules: \"%s\"\n", s);
}
s = NULL;
@@ -448,7 +447,7 @@ winConfigKeyboard (DeviceIntPtr pDevice) if (s)
{
g_winInfo.xkb.model = NULL_IF_EMPTY (s);
- winMsg (from, "XKB: model: \"%s\"\n", s);
+ winDebug ("XKB: model: \"%s\"\n", s);
}
s = NULL;
@@ -467,7 +466,7 @@ winConfigKeyboard (DeviceIntPtr pDevice) if (s)
{
g_winInfo.xkb.layout = NULL_IF_EMPTY (s);
- winMsg (from, "XKB: layout: \"%s\"\n", s);
+ winDebug ("XKB: layout: \"%s\"\n", s);
}
s = NULL;
@@ -486,7 +485,7 @@ winConfigKeyboard (DeviceIntPtr pDevice) if (s)
{
g_winInfo.xkb.variant = NULL_IF_EMPTY (s);
- winMsg (from, "XKB: variant: \"%s\"\n", s);
+ winDebug ("XKB: variant: \"%s\"\n", s);
}
s = NULL;
@@ -505,7 +504,7 @@ winConfigKeyboard (DeviceIntPtr pDevice) if (s)
{
g_winInfo.xkb.options = NULL_IF_EMPTY (s);
- winMsg (from, "XKB: options: \"%s\"\n", s);
+ winDebug ("XKB: options: \"%s\"\n", s);
}
#ifdef XWIN_XF86CONFIG
@@ -547,7 +546,7 @@ winConfigMouse (DeviceIntPtr pDevice) if (mouse != NULL)
{
if (mouse->inp_identifier)
- winMsg (mousefrom, "Using pointer \"%s\" as primary pointer\n",
+ winDebug ("Using pointer \"%s\" as primary pointer\n",
mouse->inp_identifier);
g_winInfo.pointer.emulate3Buttons =
@@ -562,8 +561,8 @@ winConfigMouse (DeviceIntPtr pDevice) }
else
{
- winMsg (X_ERROR, "No primary pointer configured\n");
- winMsg (X_DEFAULT, "Using compiletime defaults for pointer\n");
+ winDebug ("No primary pointer configured\n");
+ winDebug ("Using compiletime defaults for pointer\n");
}
return TRUE;
@@ -596,7 +595,7 @@ winConfigFiles () from = X_CONFIG;
defaultFontPath = strdup (filesptr->file_fontpath);
}
- winMsg (from, "FontPath set to \"%s\"\n", defaultFontPath);
+ winDebug ("FontPath set to \"%s\"\n", defaultFontPath);
return TRUE;
}
@@ -608,7 +607,7 @@ winConfigFiles (void) if (g_cmdline.fontPath)
{
defaultFontPath = g_cmdline.fontPath;
- winMsg (X_CMDLINE, "FontPath set to \"%s\"\n", defaultFontPath);
+ winDebug("FontPath set to \"%s\"\n", defaultFontPath);
}
return TRUE;
@@ -800,8 +799,7 @@ ParseOptionValue (int scrnIndex, pointer options, OptionInfoPtr p) case OPTV_INTEGER:
if (*s == '\0')
{
- winDrvMsg (scrnIndex, X_WARNING,
- "Option \"%s\" requires an integer value\n",
+ winDebug ( "Option \"%s\" requires an integer value\n",
p->name);
p->found = FALSE;
}
@@ -814,8 +812,7 @@ ParseOptionValue (int scrnIndex, pointer options, OptionInfoPtr p) }
else
{
- winDrvMsg (scrnIndex, X_WARNING,
- "Option \"%s\" requires an integer value\n",
+ winDebug ( "Option \"%s\" requires an integer value\n",
p->name);
p->found = FALSE;
}
@@ -824,8 +821,7 @@ ParseOptionValue (int scrnIndex, pointer options, OptionInfoPtr p) case OPTV_STRING:
if (*s == '\0')
{
- winDrvMsg (scrnIndex, X_WARNING,
- "Option \"%s\" requires an string value\n", p->name);
+ winDebug ( "Option \"%s\" requires an string value\n", p->name);
p->found = FALSE;
}
else
@@ -841,8 +837,7 @@ ParseOptionValue (int scrnIndex, pointer options, OptionInfoPtr p) case OPTV_REAL:
if (*s == '\0')
{
- winDrvMsg (scrnIndex, X_WARNING,
- "Option \"%s\" requires a floating point value\n",
+ winDebug ( "Option \"%s\" requires a floating point value\n",
p->name);
p->found = FALSE;
}
@@ -855,8 +850,7 @@ ParseOptionValue (int scrnIndex, pointer options, OptionInfoPtr p) }
else
{
- winDrvMsg (scrnIndex, X_WARNING,
- "Option \"%s\" requires a floating point value\n",
+ winDebug ( "Option \"%s\" requires a floating point value\n",
p->name);
p->found = FALSE;
}
@@ -869,8 +863,7 @@ ParseOptionValue (int scrnIndex, pointer options, OptionInfoPtr p) }
else
{
- winDrvMsg (scrnIndex, X_WARNING,
- "Option \"%s\" requires a boolean value\n", p->name);
+ winDebug ( "Option \"%s\" requires a boolean value\n", p->name);
p->found = FALSE;
}
break;
@@ -902,8 +895,7 @@ ParseOptionValue (int scrnIndex, pointer options, OptionInfoPtr p) case OPTV_FREQ:
if (*s == '\0')
{
- winDrvMsg (scrnIndex, X_WARNING,
- "Option \"%s\" requires a frequency value\n",
+ winDebug ( "Option \"%s\" requires a frequency value\n",
p->name);
p->found = FALSE;
}
@@ -925,8 +917,7 @@ ParseOptionValue (int scrnIndex, pointer options, OptionInfoPtr p) units = 1000000;
else
{
- winDrvMsg (scrnIndex, X_WARNING,
- "Option \"%s\" requires a frequency value\n",
+ winDebug ( "Option \"%s\" requires a frequency value\n",
p->name);
p->found = FALSE;
}
@@ -935,8 +926,7 @@ ParseOptionValue (int scrnIndex, pointer options, OptionInfoPtr p) }
else
{
- winDrvMsg (scrnIndex, X_WARNING,
- "Option \"%s\" requires a frequency value\n",
+ winDebug ( "Option \"%s\" requires a frequency value\n",
p->name);
p->found = FALSE;
}
@@ -954,12 +944,12 @@ ParseOptionValue (int scrnIndex, pointer options, OptionInfoPtr p) }
if (p->found)
{
- winDrvMsgVerb (scrnIndex, X_CONFIG, 2, "Option \"%s\"", p->name);
+ winDebug ("Option \"%s\"", p->name);
if (!(p->type == OPTV_BOOLEAN && *s == 0))
{
- winErrorFVerb (2, " \"%s\"", s);
+ winDebug (" \"%s\"", s);
}
- winErrorFVerb (2, "\n");
+ winDebug ("\n");
}
}
else if (p->type == OPTV_BOOLEAN)
@@ -1000,8 +990,7 @@ ParseOptionValue (int scrnIndex, pointer options, OptionInfoPtr p) }
else
{
- winDrvMsg (scrnIndex, X_WARNING,
- "Option \"%s\" requires a boolean value\n", newn);
+ winDebug ( "Option \"%s\" requires a boolean value\n", newn);
p->found = FALSE;
}
}
@@ -1011,12 +1000,12 @@ ParseOptionValue (int scrnIndex, pointer options, OptionInfoPtr p) }
if (p->found)
{
- winDrvMsgVerb (scrnIndex, X_CONFIG, 2, "Option \"%s\"", newn);
+ winDebug ("Option \"%s\"", newn);
if (*s != 0)
{
- winErrorFVerb (2, " \"%s\"", s);
+ winDebug (" \"%s\"", s);
}
- winErrorFVerb (2, "\n");
+ winDebug ("\n");
}
free (n);
}
diff --git a/xorg-server/hw/xwin/wincreatewnd.c b/xorg-server/hw/xwin/wincreatewnd.c index 755373965..9931abe75 100644 --- a/xorg-server/hw/xwin/wincreatewnd.c +++ b/xorg-server/hw/xwin/wincreatewnd.c @@ -65,10 +65,10 @@ winCreateBoundingWindowFullScreen (ScreenPtr pScreen) HWND *phwnd = &pScreenPriv->hwndScreen; WNDCLASSEX wc; char szTitle[256]; + char HostName[256]; + gethostname(HostName,256); -#if CYGDEBUG winDebug ("winCreateBoundingWindowFullScreen\n"); -#endif /* Setup our window class */ wc.cbSize=sizeof(WNDCLASSEX); @@ -93,15 +93,18 @@ winCreateBoundingWindowFullScreen (ScreenPtr pScreen) sizeof (szTitle), WINDOW_TITLE_XDMCP, g_pszQueryHost, + HostName, display, (int) pScreenInfo->dwScreen); - else + else + { snprintf (szTitle, sizeof (szTitle), WINDOW_TITLE, + HostName, display, (int) pScreenInfo->dwScreen); - + } /* Create the window */ *phwnd = CreateWindowExA (0, /* Extended styles */ WINDOW_CLASS, /* Class name */ @@ -161,6 +164,9 @@ winCreateBoundingWindowWindowed (ScreenPtr pScreen) DWORD dwWindowStyle; BOOL fForceShowWindow = FALSE; char szTitle[256]; + char HostName[256]; + + gethostname(HostName,256); winDebug ("winCreateBoundingWindowWindowed - User w: %d h: %d\n", (int) pScreenInfo->dwUserWidth, (int) pScreenInfo->dwUserHeight); @@ -253,10 +259,8 @@ winCreateBoundingWindowWindowed (ScreenPtr pScreen) if (pScreenInfo->fUserGaveHeightAndWidth) { /* User gave a desired height and width, try to accomodate */ -#if CYGDEBUG winDebug ("winCreateBoundingWindowWindowed - User gave height " "and width\n"); -#endif /* Adjust the window width and height for borders and title bar */ if (pScreenInfo->fDecoration @@ -269,16 +273,12 @@ winCreateBoundingWindowWindowed (ScreenPtr pScreen) #endif ) { -#if CYGDEBUG winDebug ("winCreateBoundingWindowWindowed - Window has decoration\n"); -#endif /* Are we resizable */ if (pScreenInfo->iResizeMode != notAllowed) { -#if CYGDEBUG winDebug ("winCreateBoundingWindowWindowed - Window is resizable\n"); -#endif iWidth += 2 * GetSystemMetrics (SM_CXSIZEFRAME); iHeight += 2 * GetSystemMetrics (SM_CYSIZEFRAME) @@ -286,9 +286,7 @@ winCreateBoundingWindowWindowed (ScreenPtr pScreen) } else { -#if CYGDEBUG winDebug ("winCreateBoundingWindowWindowed - Window is not resizable\n"); -#endif iWidth += 2 * GetSystemMetrics (SM_CXFIXEDFRAME); iHeight += 2 * GetSystemMetrics (SM_CYFIXEDFRAME) @@ -299,10 +297,8 @@ winCreateBoundingWindowWindowed (ScreenPtr pScreen) else { /* By default, we are creating a window that is as large as possible */ -#if CYGDEBUG winDebug ("winCreateBoundingWindowWindowed - User did not give " "height and width\n"); -#endif /* Defaults are wrong if we have multiple monitors */ if (pScreenInfo->fMultipleMonitors) { @@ -329,11 +325,9 @@ winCreateBoundingWindowWindowed (ScreenPtr pScreen) if (iHeight >= (rcWorkArea.bottom - rcWorkArea.top)) iHeight = rcWorkArea.bottom - rcWorkArea.top; -#if CYGDEBUG winDebug ("winCreateBoundingWindowWindowed - Adjusted width: %d "\ "height: %d\n", iWidth, iHeight); -#endif } /* Set display and screen-specific tooltip text */ @@ -342,14 +336,18 @@ winCreateBoundingWindowWindowed (ScreenPtr pScreen) sizeof (szTitle), WINDOW_TITLE_XDMCP, g_pszQueryHost, + HostName, display, (int) pScreenInfo->dwScreen); - else + else + { snprintf (szTitle, sizeof (szTitle), WINDOW_TITLE, + HostName, display, (int) pScreenInfo->dwScreen); + } /* Create the window */ *phwnd = CreateWindowExA (0, /* Extended styles */ @@ -370,9 +368,7 @@ winCreateBoundingWindowWindowed (ScreenPtr pScreen) return FALSE; } -#if CYGDEBUG winDebug ("winCreateBoundingWindowWindowed - CreateWindowEx () returned\n"); -#endif if (fForceShowWindow) { diff --git a/xorg-server/hw/xwin/wincursor.c b/xorg-server/hw/xwin/wincursor.c index 9f669bcf8..3cae2361b 100644 --- a/xorg-server/hw/xwin/wincursor.c +++ b/xorg-server/hw/xwin/wincursor.c @@ -43,10 +43,9 @@ #define BRIGHTNESS(x) (x##Red * 0.299 + x##Green * 0.587 + x##Blue * 0.114)
-#if 0
-# define WIN_DEBUG_MSG winDebug
-#else
-# define WIN_DEBUG_MSG(...)
+#ifdef _MSC_VER
+#define min(a,b) (((a) < (b)) ? (a) : (b))
+#define max(a,b) (((a) > (b)) ? (a) : (b))
#endif
/*
@@ -85,7 +84,7 @@ winPointerWarpCursor (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) /* Don't ignore subsequent warps */
s_fInitialWarp = FALSE;
- winErrorFVerb (2, "winPointerWarpCursor - Discarding first warp: %d %d\n",
+ winDebug ("winPointerWarpCursor - Discarding first warp: %d %d\n",
x, y);
return;
@@ -170,7 +169,7 @@ winLoadCursor (ScreenPtr pScreen, CursorPtr pCursor, int screen) BITMAPINFO *pbmi;
unsigned long *lpBits;
- WIN_DEBUG_MSG("winLoadCursor: Win32: %dx%d X11: %dx%d hotspot: %d,%d\n",
+ winDebug("winLoadCursor: Win32: %dx%d X11: %dx%d hotspot: %d,%d\n",
pScreenPriv->cursor.sm_cx, pScreenPriv->cursor.sm_cy,
pCursor->bits->width, pCursor->bits->height,
pCursor->bits->xhot, pCursor->bits->yhot
@@ -186,7 +185,7 @@ winLoadCursor (ScreenPtr pScreen, CursorPtr pCursor, int screen) if (pScreenPriv->cursor.sm_cx < pCursor->bits->width ||
pScreenPriv->cursor.sm_cy < pCursor->bits->height)
{
- winErrorFVerb (3, "winLoadCursor - Windows requires %dx%d cursor but X requires %dx%d\n",
+ ErrorF ("winLoadCursor - Windows requires %dx%d cursor but X requires %dx%d\n",
pScreenPriv->cursor.sm_cx, pScreenPriv->cursor.sm_cy,
pCursor->bits->width, pCursor->bits->height);
}
@@ -248,7 +247,7 @@ winLoadCursor (ScreenPtr pScreen, CursorPtr pCursor, int screen) /* We have a truecolor alpha-blended cursor and can use it! */
if (pCursor->bits->argb)
{
- WIN_DEBUG_MSG("winLoadCursor: Trying truecolor alphablended cursor\n");
+ winDebug("winLoadCursor: Trying truecolor alphablended cursor\n");
memset (&bi, 0, sizeof (BITMAPV4HEADER));
bi.bV4Size = sizeof(BITMAPV4HEADER);
bi.bV4Width = pScreenPriv->cursor.sm_cx;
@@ -279,7 +278,7 @@ winLoadCursor (ScreenPtr pScreen, CursorPtr pCursor, int screen) if (!lpBits)
{
/* Bicolor, use a palettized DIB */
- WIN_DEBUG_MSG("winLoadCursor: Trying two color cursor\n");
+ winDebug("winLoadCursor: Trying two color cursor\n");
pbmi = (BITMAPINFO*)&bi;
memset (pbmi, 0, sizeof (BITMAPINFOHEADER));
pbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
@@ -343,7 +342,7 @@ winLoadCursor (ScreenPtr pScreen, CursorPtr pCursor, int screen) /* If one of the previous two methods gave us the bitmap we need, make a cursor */
if (lpBits)
{
- WIN_DEBUG_MSG("winLoadCursor: Creating bitmap cursor: hotspot %d,%d\n",
+ winDebug("winLoadCursor: Creating bitmap cursor: hotspot %d,%d\n",
pCursor->bits->xhot, pCursor->bits->yhot);
hAnd = NULL;
@@ -371,14 +370,14 @@ winLoadCursor (ScreenPtr pScreen, CursorPtr pCursor, int screen) hCursor = (HCURSOR) CreateIconIndirect( &ii );
if (hCursor == NULL)
- winW32Error(2, "winLoadCursor - CreateIconIndirect failed:");
+ winW32Error("winLoadCursor - CreateIconIndirect failed:");
else
{
if (GetIconInfo(hCursor, &ii))
{
if (ii.fIcon)
{
- WIN_DEBUG_MSG("winLoadCursor: CreateIconIndirect returned no cursor. Trying again.\n");
+ winDebug("winLoadCursor: CreateIconIndirect returned no cursor. Trying again.\n");
DestroyCursor(hCursor);
@@ -388,7 +387,7 @@ winLoadCursor (ScreenPtr pScreen, CursorPtr pCursor, int screen) hCursor = (HCURSOR) CreateIconIndirect( &ii );
if (hCursor == NULL)
- winW32Error(2, "winLoadCursor - CreateIconIndirect failed:");
+ winW32Error("winLoadCursor - CreateIconIndirect failed:");
}
/* GetIconInfo creates new bitmaps. Destroy them again */
if (ii.hbmMask)
@@ -414,7 +413,7 @@ winLoadCursor (ScreenPtr pScreen, CursorPtr pCursor, int screen) pScreenPriv->cursor.sm_cx, pScreenPriv->cursor.sm_cy,
pAnd, pXor);
if (hCursor == NULL)
- winW32Error(2, "winLoadCursor - CreateCursor failed:");
+ winW32Error("winLoadCursor - CreateCursor failed:");
}
free (pAnd);
free (pXor);
@@ -469,7 +468,7 @@ winSetCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor, int x, in RECT rcClient;
BOOL bInhibit;
winScreenPriv(pScreen);
- WIN_DEBUG_MSG("winSetCursor: cursor=%p\n", pCursor);
+ winDebug("winSetCursor: cursor=%p\n", pCursor);
/* Inhibit changing the cursor if the mouse is not in a client area */
bInhibit = FALSE;
@@ -520,7 +519,7 @@ winSetCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor, int x, in }
pScreenPriv->cursor.handle =
winLoadCursor (pScreen, pCursor, pScreen->myNum);
- WIN_DEBUG_MSG("winSetCursor: handle=%p\n", pScreenPriv->cursor.handle);
+ winDebug("winSetCursor: handle=%p\n", pScreenPriv->cursor.handle);
if (!bInhibit)
SetCursor (pScreenPriv->cursor.handle);
@@ -614,9 +613,11 @@ winInitCursor (ScreenPtr pScreen) pPointPriv = (miPointerScreenPtr)
dixLookupPrivate(&pScreen->devPrivates, miPointerScreenKey);
+ if (pPointPriv)
+ {
pScreenPriv->cursor.spriteFuncs = pPointPriv->spriteFuncs;
pPointPriv->spriteFuncs = &winSpriteFuncsRec;
-
+ }
pScreenPriv->cursor.handle = NULL;
pScreenPriv->cursor.visible = FALSE;
diff --git a/xorg-server/hw/xwin/windialogs.c b/xorg-server/hw/xwin/windialogs.c index c3a149762..346e7b4e0 100644 --- a/xorg-server/hw/xwin/windialogs.c +++ b/xorg-server/hw/xwin/windialogs.c @@ -202,8 +202,8 @@ winInitDialog (HWND hwndDlg) */ if (GetSystemMetrics(SM_CMONITORS)>1) { /* Still need to refresh the frame change. */ - SetWindowPos (hwndDlg, HWND_TOPMOST, 0,0,0,0, - SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED); + SetWindowPos (hwndDlg, HWND_TOP, 0,0,0,0, + SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED); } else { GetWindowRect (hwndDesk, &rcDesk); GetWindowRect (hwndDlg, &rcDlg); @@ -242,12 +242,8 @@ winInitDialog (HWND hwndDlg) } -/* - * Display the Exit dialog box - */ - -void -winDisplayExitDialog (winPrivScreenPtr pScreenPriv) +int +GetLiveClients (winPrivScreenPtr pScreenPriv) { int i; int liveClients = 0; @@ -268,7 +264,21 @@ winDisplayExitDialog (winPrivScreenPtr pScreenPriv) /* A user reported that this sometimes drops below zero. just eye-candy. */ if (liveClients < 0) - liveClients = 0; + liveClients = 0; + + pScreenPriv->iConnectedClients = liveClients; + + return liveClients; +} + +/* + * Display the Exit dialog box + */ + +void +winDisplayExitDialog (winPrivScreenPtr pScreenPriv) +{ + int liveClients = GetLiveClients(pScreenPriv); /* Don't show the exit confirmation dialog if SilentExit & no clients, or ForceExit, is enabled */ @@ -283,8 +293,6 @@ winDisplayExitDialog (winPrivScreenPtr pScreenPriv) return; } - pScreenPriv->iConnectedClients = liveClients; - /* Check if dialog already exists */ if (g_hDlgExit != NULL) { @@ -434,9 +442,9 @@ winDisplayDepthChangeDialog (winPrivScreenPtr pScreenPriv) /* Show the dialog box */ ShowWindow (g_hDlgDepthChange, SW_SHOW); - ErrorF ("winDisplayDepthChangeDialog - DialogBox returned: %d\n", + winDebug ("winDisplayDepthChangeDialog - DialogBox returned: %d\n", (int) g_hDlgDepthChange); - ErrorF ("winDisplayDepthChangeDialog - GetLastError: %d\n", + winDebug ("winDisplayDepthChangeDialog - GetLastError: %d\n", (int) GetLastError ()); /* Minimize the display window */ @@ -457,52 +465,42 @@ winChangeDepthDlgProc (HWND hwndDialog, UINT message, static winScreenInfo *s_pScreenInfo = NULL; static ScreenPtr s_pScreen = NULL; -#if CYGDEBUG winDebug ("winChangeDepthDlgProc\n"); -#endif /* Branch on message type */ switch (message) { case WM_INITDIALOG: -#if CYGDEBUG winDebug ("winChangeDepthDlgProc - WM_INITDIALOG\n"); -#endif /* Store pointers to private structures for future use */ s_pScreenPriv = (winPrivScreenPtr) lParam; s_pScreenInfo = s_pScreenPriv->pScreenInfo; s_pScreen = s_pScreenInfo->pScreen; -#if CYGDEBUG winDebug ("winChangeDepthDlgProc - WM_INITDIALOG - s_pScreenPriv: %08x, " "s_pScreenInfo: %08x, s_pScreen: %08x\n", s_pScreenPriv, s_pScreenInfo, s_pScreen); -#endif -#if CYGDEBUG winDebug ("winChangeDepthDlgProc - WM_INITDIALOG - orig bpp: %d, " "current bpp: %d\n", s_pScreenInfo->dwBPP, GetDeviceCaps(s_pScreenPriv->hdcScreen, BITSPIXEL)); -#endif winInitDialog( hwndDialog ); return TRUE; case WM_DISPLAYCHANGE: -#if CYGDEBUG winDebug ("winChangeDepthDlgProc - WM_DISPLAYCHANGE - orig bpp: %d, " "new bpp: %d\n", s_pScreenInfo->dwBPP, GetDeviceCaps(s_pScreenPriv->hdcScreen, BITSPIXEL)); -#endif /* Dismiss the dialog if the display returns to the original depth */ if (GetDeviceCaps(s_pScreenPriv->hdcScreen, BITSPIXEL) == s_pScreenInfo->dwBPP) { - ErrorF ("winChangeDelthDlgProc - wParam == s_pScreenInfo->dwBPP\n"); + winDebug ("winChangeDelthDlgProc - wParam == s_pScreenInfo->dwBPP\n"); /* Depth has been restored, dismiss dialog */ DestroyWindow (g_hDlgDepthChange); @@ -530,7 +528,7 @@ winChangeDepthDlgProc (HWND hwndDialog, UINT message, break; case WM_CLOSE: - ErrorF ("winChangeDepthDlgProc - WM_CLOSE\n"); + winDebug ("winChangeDepthDlgProc - WM_CLOSE\n"); DestroyWindow (g_hDlgAbout); g_hDlgAbout = NULL; @@ -596,17 +594,13 @@ winAboutDlgProc (HWND hwndDialog, UINT message, static winScreenInfo *s_pScreenInfo = NULL; static ScreenPtr s_pScreen = NULL; -#if CYGDEBUG winDebug ("winAboutDlgProc\n"); -#endif /* Branch on message type */ switch (message) { case WM_INITDIALOG: -#if CYGDEBUG winDebug ("winAboutDlgProc - WM_INITDIALOG\n"); -#endif /* Store pointers to private structures for future use */ s_pScreenPriv = (winPrivScreenPtr) lParam; @@ -643,7 +637,7 @@ winAboutDlgProc (HWND hwndDialog, UINT message, { case IDOK: case IDCANCEL: - ErrorF ("winAboutDlgProc - WM_COMMAND - IDOK or IDCANCEL\n"); + winDebug ("winAboutDlgProc - WM_COMMAND - IDOK or IDCANCEL\n"); DestroyWindow (g_hDlgAbout); g_hDlgAbout = NULL; diff --git a/xorg-server/hw/xwin/windisplay.c b/xorg-server/hw/xwin/windisplay.c new file mode 100644 index 000000000..db7b2f4d8 --- /dev/null +++ b/xorg-server/hw/xwin/windisplay.c @@ -0,0 +1,60 @@ +/* + * Copyright (C) Jon TURNEY 2009 + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + */ + +#ifdef HAVE_XWIN_CONFIG_H +#include <xwin-config.h> +#endif +#include "win.h" + +#include <X11/Xwindows.h> + +/* + Generate a display name string referring to the display of this server, + using a transport we know is enabled +*/ + +void +winGetDisplayName(char *szDisplay, unsigned int screen) +{ + if (TransIsListening("local")) + { + snprintf(szDisplay, 512, ":%s.%d", display, screen); + } + else if (TransIsListening("inet")) + { + snprintf(szDisplay, 512, "127.0.0.1:%s.%d", display, screen); + } + else if (TransIsListening("inet6")) + { + snprintf(szDisplay, 512, "[::1]:%s.%d", display, screen); + } + else + { + // this can't happen! + winDebug ("winGetDisplay: Don't know what to use for DISPLAY\n"); + snprintf(szDisplay, 512, "localhost:%s.%d", display, screen); + } + + winDebug ("winGetDisplay: DISPLAY=%s\n", szDisplay); +} diff --git a/xorg-server/hw/xwin/winengine.c b/xorg-server/hw/xwin/winengine.c index 1e3ee2bef..d9d0d476c 100644 --- a/xorg-server/hw/xwin/winengine.c +++ b/xorg-server/hw/xwin/winengine.c @@ -73,12 +73,12 @@ winDetectSupportedEngines (void) {
case VER_PLATFORM_WIN32_NT:
/* Engine 4 is supported on NT only */
- winErrorFVerb (2, "winDetectSupportedEngines - Windows NT/2000/XP\n");
+ winDebug ("winDetectSupportedEngines - Windows NT/2000/XP\n");
break;
case VER_PLATFORM_WIN32_WINDOWS:
/* Engine 4 is supported on NT only */
- winErrorFVerb (2, "winDetectSupportedEngines - Windows 95/98/Me\n");
+ winDebug ("winDetectSupportedEngines - Windows 95/98/Me\n");
break;
}
@@ -104,13 +104,13 @@ winDetectSupportedEngines (void) if (FAILED (ddrval))
{
/* No DirectDraw support */
- winErrorFVerb (2, "winDetectSupportedEngines - DirectDraw not installed\n");
+ winDebug ("winDetectSupportedEngines - DirectDraw not installed\n");
return;
}
else
{
/* We have DirectDraw */
- winErrorFVerb (2, "winDetectSupportedEngines - DirectDraw installed\n");
+ winDebug ("winDetectSupportedEngines - DirectDraw installed\n");
g_dwEnginesSupported |= WIN_SERVER_SHADOW_DD;
#ifdef XWIN_PRIMARYFB
@@ -118,7 +118,7 @@ winDetectSupportedEngines (void) if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT)
{
g_dwEnginesSupported |= WIN_SERVER_PRIMARY_DD;
- winErrorFVerb (2, "winDetectSupportedEngines - Allowing PrimaryDD\n");
+ winDebug ("winDetectSupportedEngines - Allowing PrimaryDD\n");
}
#endif
}
@@ -130,7 +130,7 @@ winDetectSupportedEngines (void) if (SUCCEEDED (ddrval))
{
/* We have DirectDraw4 */
- winErrorFVerb (2, "winDetectSupportedEngines - DirectDraw4 installed\n");
+ winDebug ("winDetectSupportedEngines - DirectDraw4 installed\n");
g_dwEnginesSupported |= WIN_SERVER_SHADOW_DDNL;
}
@@ -141,7 +141,7 @@ winDetectSupportedEngines (void) IDirectDraw_Release (lpdd);
}
- winErrorFVerb (2, "winDetectSupportedEngines - Returning, supported engines %08x\n",
+ winDebug ("winDetectSupportedEngines - Returning, supported engines %08x\n",
(unsigned int) g_dwEnginesSupported);
}
@@ -182,7 +182,7 @@ winSetEngine (ScreenPtr pScreen) /* ShadowGDI is the only engine that supports windowed PseudoColor */
if (dwBPP == 8 && !pScreenInfo->fFullScreen)
{
- winErrorFVerb (2, "winSetEngine - Windowed && PseudoColor => ShadowGDI\n");
+ winDebug ("winSetEngine - Windowed && PseudoColor => ShadowGDI\n");
pScreenInfo->dwEngine = WIN_SERVER_SHADOW_GDI;
/* Set engine function pointers */
@@ -204,7 +204,7 @@ winSetEngine (ScreenPtr pScreen) #endif
)
{
- winErrorFVerb (2, "winSetEngine - Multi Window or Rootless => ShadowGDI\n");
+ winDebug ("winSetEngine - Multi Window or Rootless => ShadowGDI\n");
pScreenInfo->dwEngine = WIN_SERVER_SHADOW_GDI;
/* Set engine function pointers */
@@ -212,10 +212,10 @@ winSetEngine (ScreenPtr pScreen) return TRUE;
}
- /* If the user's choice is supported, we'll use that */
- if (g_dwEnginesSupported & pScreenInfo->dwEnginePreferred)
+ /* If there is a user's choice, we'll use that */
+ if (pScreenInfo->dwEnginePreferred)
{
- winErrorFVerb (2, "winSetEngine - Using user's preference: %d\n",
+ winDebug ("winSetEngine - Using user's preference: %d\n",
(int) pScreenInfo->dwEnginePreferred);
pScreenInfo->dwEngine = pScreenInfo->dwEnginePreferred;
@@ -242,7 +242,7 @@ winSetEngine (ScreenPtr pScreen) break;
#endif
default:
- FatalError ("winSetEngine - Invalid engine type\n");
+ FatalError ("winSetEngine - Invalid engine type %d\n",pScreenInfo->dwEngine);
}
return TRUE;
}
@@ -250,7 +250,7 @@ winSetEngine (ScreenPtr pScreen) /* ShadowDDNL has good performance, so why not */
if (g_dwEnginesSupported & WIN_SERVER_SHADOW_DDNL)
{
- winErrorFVerb (2, "winSetEngine - Using Shadow DirectDraw NonLocking\n");
+ winDebug ("winSetEngine - Using Shadow DirectDraw NonLocking\n");
pScreenInfo->dwEngine = WIN_SERVER_SHADOW_DDNL;
/* Set engine function pointers */
@@ -261,7 +261,7 @@ winSetEngine (ScreenPtr pScreen) /* ShadowDD is next in line */
if (g_dwEnginesSupported & WIN_SERVER_SHADOW_DD)
{
- winErrorFVerb (2, "winSetEngine - Using Shadow DirectDraw\n");
+ winDebug ("winSetEngine - Using Shadow DirectDraw\n");
pScreenInfo->dwEngine = WIN_SERVER_SHADOW_DD;
/* Set engine function pointers */
@@ -272,7 +272,7 @@ winSetEngine (ScreenPtr pScreen) /* ShadowGDI is next in line */
if (g_dwEnginesSupported & WIN_SERVER_SHADOW_GDI)
{
- winErrorFVerb (2, "winSetEngine - Using Shadow GDI DIB\n");
+ winDebug ("winSetEngine - Using Shadow GDI DIB\n");
pScreenInfo->dwEngine = WIN_SERVER_SHADOW_GDI;
/* Set engine function pointers */
diff --git a/xorg-server/hw/xwin/winerror.c b/xorg-server/hw/xwin/winerror.c index 988c5952e..47e1bd86f 100644 --- a/xorg-server/hw/xwin/winerror.c +++ b/xorg-server/hw/xwin/winerror.c @@ -35,6 +35,7 @@ #include <../xfree86/common/xorgVersion.h>
#include "win.h"
+extern Bool g_fSilentDupError;
#ifdef DDXOSVERRORF
/* Prototype */
void
@@ -52,6 +53,24 @@ OsVendorVErrorF (const char *pszFormat, va_list va_args) pthread_mutex_lock (&s_pmPrinting);
#endif
+ /*
+ If we want to silence it,
+ detect if we are going to abort due to duplication error
+ */
+ if (g_fSilentDupError)
+ {
+ if ((strcmp(pszFormat,
+ "InitOutput - Duplicate invocation on display "
+ "number: %s. Exiting.\n") == 0)
+ || (strcmp(pszFormat,
+ "Server is already active for display %s\n%s %s\n%s\n") == 0)
+ || (strcmp(pszFormat,
+ "MakeAllCOTSServerListeners: server already running\n") == 0))
+ {
+ g_fSilentFatalError = TRUE;
+ }
+ }
+
/* Print the error message to a log file, could be stderr */
LogVWrite (0, pszFormat, va_args);
@@ -70,6 +89,7 @@ OsVendorVErrorF (const char *pszFormat, va_list va_args) *
* Attempt to do last-ditch, safe, important cleanup here.
*/
+char g_FatalErrorMessage[1024];
void
OsVendorFatalError (void)
{
@@ -85,8 +105,9 @@ OsVendorFatalError (void) winMessageBoxF (
"A fatal error has occurred and " PROJECT_NAME " will now exit.\n" \
- "Please open %s for more information.\n",
- MB_ICONERROR, (g_pszLogFile?g_pszLogFile:"the logfile"));
+ "%s\n"
+ "Please open %s for more information.\n",
+ MB_ICONERROR, g_FatalErrorMessage, (g_pszLogFile?g_pszLogFile:"the logfile"));
}
@@ -114,7 +135,7 @@ winMessageBoxF (const char *pszError, UINT uType, ...) #define MESSAGEBOXF \
"%s\n" \
"Vendor: %s\n" \
- "Release: %d.%d.%d.%d (%d)\n" \
+ "Release: %d.%d.%d.%d\n" \
"Contact: %s\n" \
"%s\n\n" \
"XWin was started with the following command-line:\n\n" \
@@ -123,7 +144,7 @@ winMessageBoxF (const char *pszError, UINT uType, ...) size = asprintf (&pszMsgBox, MESSAGEBOXF,
pszErrorF, XVENDORNAME,
XORG_VERSION_MAJOR, XORG_VERSION_MINOR, XORG_VERSION_PATCH,
- XORG_VERSION_SNAP, XORG_VERSION_CURRENT,
+ XORG_VERSION_SNAP,
BUILDERADDR,
BUILDERSTRING,
g_pszCommandLine);
diff --git a/xorg-server/hw/xwin/winfont.c b/xorg-server/hw/xwin/winfont.c index af3e90da5..5a3011c0a 100644 --- a/xorg-server/hw/xwin/winfont.c +++ b/xorg-server/hw/xwin/winfont.c @@ -42,9 +42,7 @@ winRealizeFontNativeGDI (ScreenPtr pScreen, FontPtr pFont) BOOL fResult = TRUE; winScreenPriv(pScreen); -#if CYGDEBUG - winTrace ("winRealizeFont (%p, %p)\n", pScreen, pFont); -#endif + winDebug ("winRealizeFont (%p, %p)\n", pScreen, pFont); WIN_UNWRAP(RealizeFont); if (pScreen->RealizeFont) @@ -62,9 +60,7 @@ winUnrealizeFontNativeGDI (ScreenPtr pScreen, FontPtr pFont) BOOL fResult = TRUE; winScreenPriv(pScreen); -#if CYGDEBUG - winTrace ("winUnrealizeFont (%p, %p)\n", pScreen, pFont); -#endif + winDebug ("winUnrealizeFont (%p, %p)\n", pScreen, pFont); WIN_UNWRAP(UnrealizeFont); if (pScreen->UnrealizeFont) @@ -72,9 +68,5 @@ winUnrealizeFontNativeGDI (ScreenPtr pScreen, FontPtr pFont) WIN_WRAP(UnrealizeFont, winUnrealizeFontNativeGDI); return fResult; -#if CYGDEBUG - winDebug ("winUnrealizeFont()\n"); -#endif - return TRUE; } #endif diff --git a/xorg-server/hw/xwin/wingc.c b/xorg-server/hw/xwin/wingc.c index a131264b9..bf307a44c 100644 --- a/xorg-server/hw/xwin/wingc.c +++ b/xorg-server/hw/xwin/wingc.c @@ -41,47 +41,14 @@ winPushPixels (GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDrawable, int dx, int * Local prototypes
*/
-#if 0
-static void
-winChangeGCNativeGDI (GCPtr pGC, unsigned long ulChanges);
-#endif
-
static void
winValidateGCNativeGDI (GCPtr pGC,
unsigned long changes,
DrawablePtr pDrawable);
-#if 0
-static void
-winCopyGCNativeGDI (GCPtr pGCsrc, unsigned long ulMask, GCPtr pGCdst);
-#endif
-
static void
winDestroyGCNativeGDI (GCPtr pGC);
-#if 0
-static void
-winChangeClipNativeGDI (GCPtr pGC, int nType, pointer pValue, int nRects);
-
-static void
-winDestroyClipNativeGDI (GCPtr pGC);
-
-static void
-winCopyClipNativeGDI (GCPtr pGCdst, GCPtr pGCsrc);
-#endif
-
-#if 0
-/* GC Handling Routines */
-const GCFuncs winGCFuncs = {
- winValidateGCNativeGDI,
- winChangeGCNativeGDI,
- winCopyGCNativeGDI,
- winDestroyGCNativeGDI,
- winChangeClipNativeGDI,
- winDestroyClipNativeGDI,
- winCopyClipNativeGDI,
-};
-#else
const GCFuncs winGCFuncs = {
winValidateGCNativeGDI,
miChangeGC,
@@ -91,7 +58,6 @@ const GCFuncs winGCFuncs = { miDestroyClip,
miCopyClip,
};
-#endif
/* Drawing Primitives */
const GCOps winGCOps = {
@@ -112,13 +78,8 @@ const GCOps winGCOps = { miPolyText16,
miImageText8,
miImageText16,
-#if 0
- winImageGlyphBltNativeGDI,
- winPolyGlyphBltNativeGDI,
-#else
miImageGlyphBlt,
miPolyGlyphBlt,
-#endif
miPushPixels,
};
@@ -132,10 +93,8 @@ winCreateGCNativeGDI (GCPtr pGC) winPrivGCPtr pGCPriv = NULL;
winPrivScreenPtr pScreenPriv = NULL;
-#if 0
- ErrorF ("winCreateGCNativeGDI - depth: %d\n",
+ winDebug ("winCreateGCNativeGDI - depth: %d\n",
pGC->depth);
-#endif
pGC->ops = (GCOps *) &winGCOps;
pGC->funcs = (GCFuncs *) &winGCFuncs;
@@ -161,19 +120,6 @@ winCreateGCNativeGDI (GCPtr pGC) return TRUE;
}
-
-#if 0
-/* See Porting Layer Definition - p. 45 */
-static void
-winChangeGCNativeGDI (GCPtr pGC, unsigned long ulChanges)
-{
-#if 0
- ErrorF ("winChangeGCNativeGDI () - Doing nothing\n");
-#endif
-}
-#endif
-
-
static void
winValidateGCNativeGDI (GCPtr pGC,
unsigned long ulChanges,
@@ -187,16 +133,6 @@ winValidateGCNativeGDI (GCPtr pGC, }
-#if 0
-/* See Porting Layer Definition - p. 46 */
-static void
-winCopyGCNativeGDI (GCPtr pGCsrc, unsigned long ulMask, GCPtr pGCdst)
-{
-
-}
-#endif
-
-
/* See Porting Layer Definition - p. 46 */
static void
winDestroyGCNativeGDI (GCPtr pGC)
@@ -224,28 +160,3 @@ winDestroyGCNativeGDI (GCPtr pGC) /* Invalidate the GC privates pointer */
winSetGCPriv (pGC, NULL);
}
-
-#if 0
-/* See Porting Layer Definition - p. 46 */
-static void
-winChangeClipNativeGDI (GCPtr pGC, int nType, pointer pValue, int nRects)
-{
-
-}
-
-
-/* See Porting Layer Definition - p. 47 */
-static void
-winDestroyClipNativeGDI (GCPtr pGC)
-{
-
-}
-
-
-/* See Porting Layer Definition - p. 47 */
-static void
-winCopyClipNativeGDI (GCPtr pGCdst, GCPtr pGCsrc)
-{
-
-}
-#endif
diff --git a/xorg-server/hw/xwin/wingetsp.c b/xorg-server/hw/xwin/wingetsp.c index ab4c181c7..0fd0ebce9 100644 --- a/xorg-server/hw/xwin/wingetsp.c +++ b/xorg-server/hw/xwin/wingetsp.c @@ -59,10 +59,8 @@ winGetSpansNativeGDI (DrawablePtr pDrawable, switch (pDrawable->type)
{
case DRAWABLE_PIXMAP:
-#if 0
- ErrorF ("winGetSpans - DRAWABLE_PIXMAP %08x\n",
+ winDebug ("winGetSpans - DRAWABLE_PIXMAP %08x\n",
pDrawable);
-#endif
pPixmap = (PixmapPtr) pDrawable;
pPixmapPriv = winGetPixmapPriv (pPixmap);
@@ -107,12 +105,6 @@ winGetSpansNativeGDI (DrawablePtr pDrawable, SelectObject (hdcMem, hbmpOrig);
DeleteObject (hbmpWindow);
-#if 0
- ErrorF ("(%dx%dx%d) (%d,%d) w: %d\n",
- pDrawable->width, pDrawable->height, pDrawable->depth,
- pPoint->x, pPoint->y, *piWidth);
-#endif
-
/* Calculate offset of next bit destination */
pDst += PixmapBytePad (*piWidth, pDrawable->depth);
}
@@ -126,9 +118,6 @@ winGetSpansNativeGDI (DrawablePtr pDrawable, break;
case DRAWABLE_WINDOW:
-#if 0
- ErrorF ("winGetSpans - DRAWABLE_WINDOW\n");
-#endif
/* Open a memory HDC */
hdcMem = CreateCompatibleDC (NULL);
@@ -163,12 +152,6 @@ winGetSpansNativeGDI (DrawablePtr pDrawable, DeleteObject (hbmpWindow);
-#if 0
- ErrorF ("(%dx%dx%d) (%d,%d) w: %d\n",
- pDrawable->width, pDrawable->height, pDrawable->depth,
- pPoint->x, pPoint->y, *piWidth);
-#endif
-
/* Calculate offset of next bit destination */
pDst += PixmapBytePad (*piWidth, pDrawable->depth);
}
diff --git a/xorg-server/hw/xwin/winglobals.c b/xorg-server/hw/xwin/winglobals.c index 80d946c5d..0f52b651c 100644 --- a/xorg-server/hw/xwin/winglobals.c +++ b/xorg-server/hw/xwin/winglobals.c @@ -76,7 +76,7 @@ Bool g_fKeyboardHookLL = FALSE; Bool g_fNoHelpMessageBox = FALSE;
Bool g_fSoftwareCursor = FALSE;
Bool g_fSilentDupError = FALSE;
-Bool g_fNativeGl = FALSE;
+Bool g_fNativeGl = FALSE;
/*
* Global variables for dynamically loaded libraries and
@@ -91,7 +91,6 @@ FARPROC g_fpTrackMouseEvent = (FARPROC) (void (*)(void))NoopDDA; * Wrapped DIX functions
*/
winDispatchProcPtr winProcEstablishConnectionOrig = NULL;
-winDispatchProcPtr winProcQueryTreeOrig = NULL;
winDispatchProcPtr winProcSetSelectionOwnerOrig = NULL;
@@ -101,6 +100,7 @@ winDispatchProcPtr winProcSetSelectionOwnerOrig = NULL; Bool g_fUnicodeClipboard = TRUE;
Bool g_fClipboard = TRUE;
+Bool g_fClipboardPrimary = TRUE;
Bool g_fClipboardLaunched = FALSE;
Bool g_fClipboardStarted = FALSE;
pthread_t g_ptClipboardProc;
@@ -121,8 +121,6 @@ winInitializeGlobals (void) {
g_dwCurrentThreadID = GetCurrentThreadId ();
#ifdef XWIN_CLIPBOARD
- g_fClipboardLaunched = FALSE;
- g_fClipboardStarted = FALSE;
g_iClipboardWindow = None;
g_pClipboardDisplay = NULL;
g_atomLastOwnedSelection = None;
diff --git a/xorg-server/hw/xwin/winglobals.h b/xorg-server/hw/xwin/winglobals.h index 898b9388a..dd7c72949 100644 --- a/xorg-server/hw/xwin/winglobals.h +++ b/xorg-server/hw/xwin/winglobals.h @@ -64,7 +64,6 @@ typedef int (*winDispatchProcPtr) (ClientPtr); * Wrapped DIX functions
*/
extern winDispatchProcPtr winProcEstablishConnectionOrig;
-extern winDispatchProcPtr winProcQueryTreeOrig;
extern winDispatchProcPtr winProcSetSelectionOwnerOrig;
#endif
diff --git a/xorg-server/hw/xwin/winkeybd.c b/xorg-server/hw/xwin/winkeybd.c index a3112fffe..2cd8caff1 100644 --- a/xorg-server/hw/xwin/winkeybd.c +++ b/xorg-server/hw/xwin/winkeybd.c @@ -1,524 +1,539 @@ -/* - *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved. - * - *Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - *"Software"), to deal in the Software without restriction, including - *without limitation the rights to use, copy, modify, merge, publish, - *distribute, sublicense, and/or sell copies of the Software, and to - *permit persons to whom the Software is furnished to do so, subject to - *the following conditions: - * - *The above copyright notice and this permission notice shall be - *included in all copies or substantial portions of the Software. - * - *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR - *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - *Except as contained in this notice, the name of the XFree86 Project - *shall not be used in advertising or otherwise to promote the sale, use - *or other dealings in this Software without prior written authorization - *from the XFree86 Project. - * - * Authors: Dakshinamurthy Karra - * Suhaib M Siddiqi - * Peter Busch - * Harold L Hunt II - */ - - -#ifdef HAVE_XWIN_CONFIG_H -#include <xwin-config.h> -#endif -#include "win.h" -#include "winkeybd.h" -#include "winconfig.h" -#include "winmsg.h" - -#include "xkbsrv.h" - -static Bool g_winKeyState[NUM_KEYCODES]; - -/* - * Local prototypes - */ - -static void -winKeybdBell (int iPercent, DeviceIntPtr pDeviceInt, - pointer pCtrl, int iClass); - -static void -winKeybdCtrl (DeviceIntPtr pDevice, KeybdCtrl *pCtrl); - - -/* - * Translate a Windows WM_[SYS]KEY(UP/DOWN) message - * into an ASCII scan code. - * - * We do this ourselves, rather than letting Windows handle it, - * because Windows tends to munge the handling of special keys, - * like AltGr on European keyboards. - */ - -void -winTranslateKey (WPARAM wParam, LPARAM lParam, int *piScanCode) -{ - int iKeyFixup = g_iKeyMap[wParam * WIN_KEYMAP_COLS + 1]; - int iKeyFixupEx = g_iKeyMap[wParam * WIN_KEYMAP_COLS + 2]; - int iParam = HIWORD (lParam); - int iParamScanCode = LOBYTE (iParam); - - winDebug("winTranslateKey: wParam %08x lParam %08x\n", wParam, lParam); - -/* WM_ key messages faked by Vista speech recognition (WSR) don't have a - * scan code. - * - * Vocola 3 (Rick Mohr's supplement to WSR) uses - * System.Windows.Forms.SendKeys.SendWait(), which appears always to give a - * scan code of 1 - */ - if (iParamScanCode <= 1) - { - if (VK_PRIOR <= wParam && wParam <= VK_DOWN) - /* Trigger special case table to translate to extended - * keycode, otherwise if num_lock is on, we can get keypad - * numbers instead of navigation keys. */ - iParam |= KF_EXTENDED; - else - iParamScanCode = MapVirtualKeyEx(wParam, - /*MAPVK_VK_TO_VSC*/0, - GetKeyboardLayout(0)); - } - - /* Branch on special extended, special non-extended, or normal key */ - if ((iParam & KF_EXTENDED) && iKeyFixupEx) - *piScanCode = iKeyFixupEx; - else if (iKeyFixup) - *piScanCode = iKeyFixup; - else if (wParam == 0 && iParamScanCode == 0x70) - *piScanCode = KEY_HKTG; - else - switch (iParamScanCode) - { - case 0x70: - *piScanCode = KEY_HKTG; - break; - case 0x73: - *piScanCode = KEY_BSlash2; - break; - default: - *piScanCode = iParamScanCode; - break; - } -} - - -/* Ring the keyboard bell (system speaker on PCs) */ -static void -winKeybdBell (int iPercent, DeviceIntPtr pDeviceInt, - pointer pCtrl, int iClass) -{ - /* - * We can't use Beep () here because it uses the PC speaker - * on NT/2000. MessageBeep (MB_OK) will play the default system - * sound on systems with a sound card or it will beep the PC speaker - * on systems that do not have a sound card. - */ - MessageBeep (MB_OK); -} - - -/* Change some keyboard configuration parameters */ -static void -winKeybdCtrl (DeviceIntPtr pDevice, KeybdCtrl *pCtrl) -{ -} - - -/* - * See Porting Layer Definition - p. 18 - * winKeybdProc is known as a DeviceProc. - */ - -int -winKeybdProc (DeviceIntPtr pDeviceInt, int iState) -{ - DevicePtr pDevice = (DevicePtr) pDeviceInt; - XkbSrvInfoPtr xkbi; - XkbControlsPtr ctrl; - - switch (iState) - { - case DEVICE_INIT: - winConfigKeyboard (pDeviceInt); - - /* FIXME: Maybe we should use winGetKbdLeds () here? */ - defaultKeyboardControl.leds = g_winInfo.keyboard.leds; - - winErrorFVerb(2, "Rules = \"%s\" Model = \"%s\" Layout = \"%s\"" - " Variant = \"%s\" Options = \"%s\"\n", - g_winInfo.xkb.rules ? g_winInfo.xkb.rules : "none", - g_winInfo.xkb.model ? g_winInfo.xkb.model : "none", - g_winInfo.xkb.layout ? g_winInfo.xkb.layout : "none", - g_winInfo.xkb.variant ? g_winInfo.xkb.variant : "none", - g_winInfo.xkb.options ? g_winInfo.xkb.options : "none"); - - InitKeyboardDeviceStruct (pDeviceInt, - &g_winInfo.xkb, - winKeybdBell, - winKeybdCtrl); - - xkbi = pDeviceInt->key->xkbInfo; - if ((xkbi != NULL) && (xkbi->desc != NULL)) - { - ctrl = xkbi->desc->ctrls; - ctrl->repeat_delay = g_winInfo.keyboard.delay; - ctrl->repeat_interval = 1000/g_winInfo.keyboard.rate; - } - else - { - winErrorFVerb (1, "winKeybdProc - Error initializing keyboard AutoRepeat\n"); - } - - break; - - case DEVICE_ON: - pDevice->on = TRUE; - - // immediately copy the state of this keyboard device to the VCK - // (which otherwise happens lazily after the first keypress) - CopyKeyClass(pDeviceInt, inputInfo.keyboard); - break; - - case DEVICE_CLOSE: - case DEVICE_OFF: - pDevice->on = FALSE; - break; - } - - return Success; -} - - -/* - * Detect current mode key states upon server startup. - * - * Simulate a press and release of any key that is currently - * toggled. - */ - -void -winInitializeModeKeyStates (void) -{ - /* Restore NumLock */ - if (GetKeyState (VK_NUMLOCK) & 0x0001) - { - winSendKeyEvent (KEY_NumLock, TRUE); - winSendKeyEvent (KEY_NumLock, FALSE); - } - - /* Restore CapsLock */ - if (GetKeyState (VK_CAPITAL) & 0x0001) - { - winSendKeyEvent (KEY_CapsLock, TRUE); - winSendKeyEvent (KEY_CapsLock, FALSE); - } - - /* Restore ScrollLock */ - if (GetKeyState (VK_SCROLL) & 0x0001) - { - winSendKeyEvent (KEY_ScrollLock, TRUE); - winSendKeyEvent (KEY_ScrollLock, FALSE); - } - - /* Restore KanaLock */ - if (GetKeyState (VK_KANA) & 0x0001) - { - winSendKeyEvent (KEY_HKTG, TRUE); - winSendKeyEvent (KEY_HKTG, FALSE); - } -} - - -/* - * Upon regaining the keyboard focus we must - * resynchronize our internal mode key states - * with the actual state of the keys. - */ - -void -winRestoreModeKeyStates (void) -{ - DWORD dwKeyState; - BOOL processEvents = TRUE; - unsigned short internalKeyStates; - - /* X server is being initialized */ - if (!inputInfo.keyboard) - return; - - /* Only process events if the rootwindow is mapped. The keyboard events - * will cause segfaults otherwise */ - if (screenInfo.screens[0]->root && screenInfo.screens[0]->root->mapped == FALSE) - processEvents = FALSE; - - /* Force to process all pending events in the mi event queue */ - if (processEvents) - mieqProcessInputEvents (); - - /* Read the mode key states of our X server */ - /* (stored in the virtual core keyboard) */ - internalKeyStates = XkbStateFieldFromRec(&inputInfo.keyboard->key->xkbInfo->state); - winDebug("winRestoreModeKeyStates: state %d\n", internalKeyStates); - - /* - * NOTE: The C XOR operator, ^, will not work here because it is - * a bitwise operator, not a logical operator. C does not - * have a logical XOR operator, so we use a macro instead. - */ - - /* Has the key state changed? */ - dwKeyState = GetKeyState (VK_NUMLOCK) & 0x0001; - if (WIN_XOR (internalKeyStates & NumLockMask, dwKeyState)) - { - winSendKeyEvent (KEY_NumLock, TRUE); - winSendKeyEvent (KEY_NumLock, FALSE); - } - - /* Has the key state changed? */ - dwKeyState = GetKeyState (VK_CAPITAL) & 0x0001; - if (WIN_XOR (internalKeyStates & LockMask, dwKeyState)) - { - winSendKeyEvent (KEY_CapsLock, TRUE); - winSendKeyEvent (KEY_CapsLock, FALSE); - } - - /* Has the key state changed? */ - dwKeyState = GetKeyState (VK_SCROLL) & 0x0001; - if (WIN_XOR (internalKeyStates & ScrollLockMask, dwKeyState)) - { - winSendKeyEvent (KEY_ScrollLock, TRUE); - winSendKeyEvent (KEY_ScrollLock, FALSE); - } - - /* Has the key state changed? */ - dwKeyState = GetKeyState (VK_KANA) & 0x0001; - if (WIN_XOR (internalKeyStates & KanaMask, dwKeyState)) - { - winSendKeyEvent (KEY_HKTG, TRUE); - winSendKeyEvent (KEY_HKTG, FALSE); - } -} - - -/* - * Look for the lovely fake Control_L press/release generated by Windows - * when AltGr is pressed/released on a non-U.S. keyboard. - */ - -Bool -winIsFakeCtrl_L (UINT message, WPARAM wParam, LPARAM lParam) -{ - MSG msgNext; - LONG lTime; - Bool fReturn; - - /* - * Fake Ctrl_L presses will be followed by an Alt_R keypress - * with the same timestamp as the Ctrl_L press. - */ - if ((message == WM_KEYDOWN || message == WM_SYSKEYDOWN) - && wParam == VK_CONTROL - && (HIWORD (lParam) & KF_EXTENDED) == 0) - { - /* Got a Ctrl_L press */ - - /* Get time of current message */ - lTime = GetMessageTime (); - - /* Look for fake Ctrl_L preceeding an Alt_R press. */ - fReturn = PeekMessage (&msgNext, NULL, - WM_KEYDOWN, WM_SYSKEYDOWN, - PM_NOREMOVE); - - /* - * Try again if the first call fails. - * NOTE: This usually happens when TweakUI is enabled. - */ - if (!fReturn) - { - /* Voodoo to make sure that the Alt_R message has posted */ - Sleep (0); - - /* Look for fake Ctrl_L preceeding an Alt_R press. */ - fReturn = PeekMessage (&msgNext, NULL, - WM_KEYDOWN, WM_SYSKEYDOWN, - PM_NOREMOVE); - } - if (msgNext.message != WM_KEYDOWN && msgNext.message != WM_SYSKEYDOWN) - fReturn = 0; - - /* Is next press an Alt_R with the same timestamp? */ - if (fReturn && msgNext.wParam == VK_MENU - && msgNext.time == lTime - && (HIWORD (msgNext.lParam) & KF_EXTENDED)) - { - /* - * Next key press is Alt_R with same timestamp as current - * Ctrl_L message. Therefore, this Ctrl_L press is a fake - * event, so discard it. - */ - return TRUE; - } - } - - /* - * Fake Ctrl_L releases will be followed by an Alt_R release - * with the same timestamp as the Ctrl_L release. - */ - if ((message == WM_KEYUP || message == WM_SYSKEYUP) - && wParam == VK_CONTROL - && (HIWORD (lParam) & KF_EXTENDED) == 0) - { - /* Got a Ctrl_L release */ - - /* Get time of current message */ - lTime = GetMessageTime (); - - /* Look for fake Ctrl_L release preceeding an Alt_R release. */ - fReturn = PeekMessage (&msgNext, NULL, - WM_KEYUP, WM_SYSKEYUP, - PM_NOREMOVE); - - /* - * Try again if the first call fails. - * NOTE: This usually happens when TweakUI is enabled. - */ - if (!fReturn) - { - /* Voodoo to make sure that the Alt_R message has posted */ - Sleep (0); - - /* Look for fake Ctrl_L release preceeding an Alt_R release. */ - fReturn = PeekMessage (&msgNext, NULL, - WM_KEYUP, WM_SYSKEYUP, - PM_NOREMOVE); - } - - if (msgNext.message != WM_KEYUP && msgNext.message != WM_SYSKEYUP) - fReturn = 0; - - /* Is next press an Alt_R with the same timestamp? */ - if (fReturn - && (msgNext.message == WM_KEYUP - || msgNext.message == WM_SYSKEYUP) - && msgNext.wParam == VK_MENU - && msgNext.time == lTime - && (HIWORD (msgNext.lParam) & KF_EXTENDED)) - { - /* - * Next key release is Alt_R with same timestamp as current - * Ctrl_L message. Therefore, this Ctrl_L release is a fake - * event, so discard it. - */ - return TRUE; - } - } - - /* Not a fake control left press/release */ - return FALSE; -} - - -/* - * Lift any modifier keys that are pressed - */ - -void -winKeybdReleaseKeys (void) -{ - int i; - -#ifdef HAS_DEVWINDOWS - /* Verify that the mi input system has been initialized */ - if (g_fdMessageQueue == WIN_FD_INVALID) - return; -#endif - - /* Loop through all keys */ - for (i = 0; i < NUM_KEYCODES; ++i) - { - /* Pop key if pressed */ - if (g_winKeyState[i]) - winSendKeyEvent (i, FALSE); - - /* Reset pressed flag for keys */ - g_winKeyState[i] = FALSE; - } -} - - -/* - * Take a raw X key code and send an up or down event for it. - * - * Thanks to VNC for inspiration, though it is a simple function. - */ - -void -winSendKeyEvent (DWORD dwKey, Bool fDown) -{ - /* - * When alt-tabing between screens we can get phantom key up messages - * Here we only pass them through it we think we should! - */ - if (g_winKeyState[dwKey] == FALSE && fDown == FALSE) return; - - /* Update the keyState map */ - g_winKeyState[dwKey] = fDown; - - QueueKeyboardEvents(g_pwinKeyboard, fDown ? KeyPress : KeyRelease, dwKey + MIN_KEYCODE, NULL); - - winDebug("winSendKeyEvent: dwKey: %d, fDown: %d\n", - dwKey, fDown); -} - -BOOL winCheckKeyPressed(WPARAM wParam, LPARAM lParam) -{ - switch (wParam) - { - case VK_CONTROL: - if ((lParam & 0x1ff0000) == 0x11d0000 && g_winKeyState[KEY_RCtrl]) - return TRUE; - if ((lParam & 0x1ff0000) == 0x01d0000 && g_winKeyState[KEY_LCtrl]) - return TRUE; - break; - case VK_SHIFT: - if ((lParam & 0x1ff0000) == 0x0360000 && g_winKeyState[KEY_ShiftR]) - return TRUE; - if ((lParam & 0x1ff0000) == 0x02a0000 && g_winKeyState[KEY_ShiftL]) - return TRUE; - break; - default: - return TRUE; - } - return FALSE; -} - -/* Only on shift release message is sent even if both are pressed. - * Fix this here - */ -void winFixShiftKeys (int iScanCode) -{ - if (GetKeyState (VK_SHIFT) & 0x8000) - return; - - if (iScanCode == KEY_ShiftL && g_winKeyState[KEY_ShiftR]) - winSendKeyEvent (KEY_ShiftR, FALSE); - if (iScanCode == KEY_ShiftR && g_winKeyState[KEY_ShiftL]) - winSendKeyEvent (KEY_ShiftL, FALSE); -} +/*
+ *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
+ *
+ *Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ *"Software"), to deal in the Software without restriction, including
+ *without limitation the rights to use, copy, modify, merge, publish,
+ *distribute, sublicense, and/or sell copies of the Software, and to
+ *permit persons to whom the Software is furnished to do so, subject to
+ *the following conditions:
+ *
+ *The above copyright notice and this permission notice shall be
+ *included in all copies or substantial portions of the Software.
+ *
+ *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
+ *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+ *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Dakshinamurthy Karra
+ * Suhaib M Siddiqi
+ * Peter Busch
+ * Harold L Hunt II
+ */
+
+
+#ifdef HAVE_XWIN_CONFIG_H
+#include <xwin-config.h>
+#endif
+#include "win.h"
+#include "winkeybd.h"
+#include "winconfig.h"
+#include "winmsg.h"
+
+#include "xkbsrv.h"
+
+static Bool g_winKeyState[NUM_KEYCODES];
+
+/*
+ * Local prototypes
+ */
+
+static void
+winKeybdBell (int iPercent, DeviceIntPtr pDeviceInt,
+ pointer pCtrl, int iClass);
+
+static void
+winKeybdCtrl (DeviceIntPtr pDevice, KeybdCtrl *pCtrl);
+
+
+/*
+ * Translate a Windows WM_[SYS]KEY(UP/DOWN) message
+ * into an ASCII scan code.
+ *
+ * We do this ourselves, rather than letting Windows handle it,
+ * because Windows tends to munge the handling of special keys,
+ * like AltGr on European keyboards.
+ */
+
+void
+winTranslateKey (WPARAM wParam, LPARAM lParam, int *piScanCode)
+{
+ int iKeyFixup = g_iKeyMap[wParam * WIN_KEYMAP_COLS + 1];
+ int iKeyFixupEx = g_iKeyMap[wParam * WIN_KEYMAP_COLS + 2];
+ int iParam = HIWORD (lParam);
+ int iParamScanCode = LOBYTE (iParam);
+
+ winDebug("winTranslateKey: wParam %08x lParam %08x\n", wParam, lParam);
+
+/* WM_ key messages faked by Vista speech recognition (WSR) don't have a
+ * scan code.
+ *
+ * Vocola 3 (Rick Mohr's supplement to WSR) uses
+ * System.Windows.Forms.SendKeys.SendWait(), which appears always to give a
+ * scan code of 1
+ */
+ if (iParamScanCode <= 1)
+ {
+ if (VK_PRIOR <= wParam && wParam <= VK_DOWN)
+ /* Trigger special case table to translate to extended
+ * keycode, otherwise if num_lock is on, we can get keypad
+ * numbers instead of navigation keys. */
+ iParam |= KF_EXTENDED;
+ else
+ iParamScanCode = MapVirtualKeyEx(wParam,
+ /*MAPVK_VK_TO_VSC*/0,
+ GetKeyboardLayout(0));
+ }
+
+ /* Branch on special extended, special non-extended, or normal key */
+ if ((iParam & KF_EXTENDED) && iKeyFixupEx)
+ *piScanCode = iKeyFixupEx;
+ else if (iKeyFixup)
+ *piScanCode = iKeyFixup;
+ else if (wParam == 0 && iParamScanCode == 0x70)
+ *piScanCode = KEY_HKTG;
+ else
+ switch (iParamScanCode)
+ {
+ case 0x70:
+ *piScanCode = KEY_HKTG;
+ break;
+ case 0x73:
+ *piScanCode = KEY_BSlash2;
+ break;
+ default:
+ *piScanCode = iParamScanCode;
+ break;
+ }
+}
+
+
+/* Ring the keyboard bell (system speaker on PCs) */
+static void
+winKeybdBell (int iPercent, DeviceIntPtr pDeviceInt,
+ pointer pCtrl, int iClass)
+{
+ /*
+ * We can't use Beep () here because it uses the PC speaker
+ * on NT/2000. MessageBeep (MB_OK) will play the default system
+ * sound on systems with a sound card or it will beep the PC speaker
+ * on systems that do not have a sound card.
+ */
+ MessageBeep (MB_OK);
+}
+
+
+/* Change some keyboard configuration parameters */
+static void
+winKeybdCtrl (DeviceIntPtr pDevice, KeybdCtrl *pCtrl)
+{
+}
+
+
+/*
+ * See Porting Layer Definition - p. 18
+ * winKeybdProc is known as a DeviceProc.
+ */
+
+int
+winKeybdProc (DeviceIntPtr pDeviceInt, int iState)
+{
+ DevicePtr pDevice = (DevicePtr) pDeviceInt;
+ XkbSrvInfoPtr xkbi;
+ XkbControlsPtr ctrl;
+
+ switch (iState)
+ {
+ case DEVICE_INIT:
+ winConfigKeyboard (pDeviceInt);
+
+ /* FIXME: Maybe we should use winGetKbdLeds () here? */
+ defaultKeyboardControl.leds = g_winInfo.keyboard.leds;
+
+ winDebug("Rules = \"%s\" Model = \"%s\" Layout = \"%s\""
+ " Variant = \"%s\" Options = \"%s\"\n",
+ g_winInfo.xkb.rules ? g_winInfo.xkb.rules : "none",
+ g_winInfo.xkb.model ? g_winInfo.xkb.model : "none",
+ g_winInfo.xkb.layout ? g_winInfo.xkb.layout : "none",
+ g_winInfo.xkb.variant ? g_winInfo.xkb.variant : "none",
+ g_winInfo.xkb.options ? g_winInfo.xkb.options : "none");
+
+ InitKeyboardDeviceStruct (pDeviceInt,
+ &g_winInfo.xkb,
+ winKeybdBell,
+ winKeybdCtrl);
+
+ xkbi = pDeviceInt->key->xkbInfo;
+ if ((xkbi != NULL) && (xkbi->desc != NULL))
+ {
+ ctrl = xkbi->desc->ctrls;
+ ctrl->repeat_delay = g_winInfo.keyboard.delay;
+ ctrl->repeat_interval = 1000/g_winInfo.keyboard.rate;
+ }
+ else
+ {
+ winDebug ("winKeybdProc - Error initializing keyboard AutoRepeat\n");
+ }
+
+ break;
+
+ case DEVICE_ON:
+ pDevice->on = TRUE;
+
+ // immediately copy the state of this keyboard device to the VCK
+ // (which otherwise happens lazily after the first keypress)
+ CopyKeyClass(pDeviceInt, inputInfo.keyboard);
+ break;
+
+ case DEVICE_CLOSE:
+ case DEVICE_OFF:
+ pDevice->on = FALSE;
+ break;
+ }
+
+ return Success;
+}
+
+
+/*
+ * Detect current mode key states upon server startup.
+ *
+ * Simulate a press and release of any key that is currently
+ * toggled.
+ */
+
+void
+winInitializeModeKeyStates (void)
+{
+ /* Restore NumLock */
+ if (GetKeyState (VK_NUMLOCK) & 0x0001)
+ {
+ winSendKeyEvent (KEY_NumLock, TRUE);
+ winSendKeyEvent (KEY_NumLock, FALSE);
+ }
+
+ /* Restore CapsLock */
+ if (GetKeyState (VK_CAPITAL) & 0x0001)
+ {
+ winSendKeyEvent (KEY_CapsLock, TRUE);
+ winSendKeyEvent (KEY_CapsLock, FALSE);
+ }
+
+ /* Restore ScrollLock */
+ if (GetKeyState (VK_SCROLL) & 0x0001)
+ {
+ winSendKeyEvent (KEY_ScrollLock, TRUE);
+ winSendKeyEvent (KEY_ScrollLock, FALSE);
+ }
+
+ /* Restore KanaLock */
+ if (GetKeyState (VK_KANA) & 0x0001)
+ {
+ winSendKeyEvent (KEY_HKTG, TRUE);
+ winSendKeyEvent (KEY_HKTG, FALSE);
+ }
+}
+
+
+/*
+ * Upon regaining the keyboard focus we must
+ * resynchronize our internal mode key states
+ * with the actual state of the keys.
+ */
+
+void
+winRestoreModeKeyStates (void)
+{
+ DWORD dwKeyState;
+ BOOL processEvents = TRUE;
+ unsigned short internalKeyStates;
+
+ /* X server is being initialized */
+ if (!inputInfo.keyboard)
+ return;
+
+ /* Only process events if the rootwindow is mapped. The keyboard events
+ * will cause segfaults otherwise */
+ if (screenInfo.screens[0]->root && screenInfo.screens[0]->root->mapped == FALSE)
+ processEvents = FALSE;
+
+ /* Force to process all pending events in the mi event queue */
+ if (processEvents)
+ mieqProcessInputEvents ();
+
+ /* Read the mode key states of our X server */
+ /* (stored in the virtual core keyboard) */
+ internalKeyStates = XkbStateFieldFromRec(&inputInfo.keyboard->key->xkbInfo->state);
+ winDebug("winRestoreModeKeyStates: state %d\n", internalKeyStates);
+
+ {
+ /* Make sure the message queue is empty, otherwise the GetKeyState will not always
+ return the correct state of the numlock key, capslock key, ...
+ This is mainly because this function is called from the WM_SETFOCUS handler.
+ From MSDN GetKeyState: The key status returned from this function changes as a thread
+ reads key messages from its message queue.*/
+ MSG msg;
+
+ /* Process all messages on our queue */
+ while (PeekMessage (&msg, NULL, 0, 0, PM_REMOVE))
+ {
+ DispatchMessage (&msg);
+ }
+ }
+
+ /*
+ * NOTE: The C XOR operator, ^, will not work here because it is
+ * a bitwise operator, not a logical operator. C does not
+ * have a logical XOR operator, so we use a macro instead.
+ */
+
+ /* Has the key state changed? */
+ dwKeyState = GetKeyState (VK_NUMLOCK) & 0x0001;
+ if (WIN_XOR (internalKeyStates & NumLockMask, dwKeyState))
+ {
+ winSendKeyEvent (KEY_NumLock, TRUE);
+ winSendKeyEvent (KEY_NumLock, FALSE);
+ }
+
+ /* Has the key state changed? */
+ dwKeyState = GetKeyState (VK_CAPITAL) & 0x0001;
+ if (WIN_XOR (internalKeyStates & LockMask, dwKeyState))
+ {
+ winSendKeyEvent (KEY_CapsLock, TRUE);
+ winSendKeyEvent (KEY_CapsLock, FALSE);
+ }
+
+ /* Has the key state changed? */
+ dwKeyState = GetKeyState (VK_SCROLL) & 0x0001;
+ if (WIN_XOR (internalKeyStates & ScrollLockMask, dwKeyState))
+ {
+ winSendKeyEvent (KEY_ScrollLock, TRUE);
+ winSendKeyEvent (KEY_ScrollLock, FALSE);
+ }
+
+ /* Has the key state changed? */
+ dwKeyState = GetKeyState (VK_KANA) & 0x0001;
+ if (WIN_XOR (internalKeyStates & KanaMask, dwKeyState))
+ {
+ winSendKeyEvent (KEY_HKTG, TRUE);
+ winSendKeyEvent (KEY_HKTG, FALSE);
+ }
+}
+
+
+/*
+ * Look for the lovely fake Control_L press/release generated by Windows
+ * when AltGr is pressed/released on a non-U.S. keyboard.
+ */
+
+Bool
+winIsFakeCtrl_L (UINT message, WPARAM wParam, LPARAM lParam)
+{
+ MSG msgNext;
+ LONG lTime;
+ Bool fReturn;
+
+ /*
+ * Fake Ctrl_L presses will be followed by an Alt_R keypress
+ * with the same timestamp as the Ctrl_L press.
+ */
+ if ((message == WM_KEYDOWN || message == WM_SYSKEYDOWN)
+ && wParam == VK_CONTROL
+ && (HIWORD (lParam) & KF_EXTENDED) == 0)
+ {
+ /* Got a Ctrl_L press */
+
+ /* Get time of current message */
+ lTime = GetMessageTime ();
+
+ /* Look for fake Ctrl_L preceeding an Alt_R press. */
+ fReturn = PeekMessage (&msgNext, NULL,
+ WM_KEYDOWN, WM_SYSKEYDOWN,
+ PM_NOREMOVE);
+
+ /*
+ * Try again if the first call fails.
+ * NOTE: This usually happens when TweakUI is enabled.
+ */
+ if (!fReturn)
+ {
+ /* Voodoo to make sure that the Alt_R message has posted */
+ Sleep (0);
+
+ /* Look for fake Ctrl_L preceeding an Alt_R press. */
+ fReturn = PeekMessage (&msgNext, NULL,
+ WM_KEYDOWN, WM_SYSKEYDOWN,
+ PM_NOREMOVE);
+ }
+ if (msgNext.message != WM_KEYDOWN && msgNext.message != WM_SYSKEYDOWN)
+ fReturn = 0;
+
+ /* Is next press an Alt_R with the same timestamp? */
+ if (fReturn && msgNext.wParam == VK_MENU
+ && msgNext.time == lTime
+ && (HIWORD (msgNext.lParam) & KF_EXTENDED))
+ {
+ /*
+ * Next key press is Alt_R with same timestamp as current
+ * Ctrl_L message. Therefore, this Ctrl_L press is a fake
+ * event, so discard it.
+ */
+ return TRUE;
+ }
+ }
+
+ /*
+ * Fake Ctrl_L releases will be followed by an Alt_R release
+ * with the same timestamp as the Ctrl_L release.
+ */
+ if ((message == WM_KEYUP || message == WM_SYSKEYUP)
+ && wParam == VK_CONTROL
+ && (HIWORD (lParam) & KF_EXTENDED) == 0)
+ {
+ /* Got a Ctrl_L release */
+
+ /* Get time of current message */
+ lTime = GetMessageTime ();
+
+ /* Look for fake Ctrl_L release preceeding an Alt_R release. */
+ fReturn = PeekMessage (&msgNext, NULL,
+ WM_KEYUP, WM_SYSKEYUP,
+ PM_NOREMOVE);
+
+ /*
+ * Try again if the first call fails.
+ * NOTE: This usually happens when TweakUI is enabled.
+ */
+ if (!fReturn)
+ {
+ /* Voodoo to make sure that the Alt_R message has posted */
+ Sleep (0);
+
+ /* Look for fake Ctrl_L release preceeding an Alt_R release. */
+ fReturn = PeekMessage (&msgNext, NULL,
+ WM_KEYUP, WM_SYSKEYUP,
+ PM_NOREMOVE);
+ }
+
+ if (msgNext.message != WM_KEYUP && msgNext.message != WM_SYSKEYUP)
+ fReturn = 0;
+
+ /* Is next press an Alt_R with the same timestamp? */
+ if (fReturn
+ && (msgNext.message == WM_KEYUP
+ || msgNext.message == WM_SYSKEYUP)
+ && msgNext.wParam == VK_MENU
+ && msgNext.time == lTime
+ && (HIWORD (msgNext.lParam) & KF_EXTENDED))
+ {
+ /*
+ * Next key release is Alt_R with same timestamp as current
+ * Ctrl_L message. Therefore, this Ctrl_L release is a fake
+ * event, so discard it.
+ */
+ return TRUE;
+ }
+ }
+
+ /* Not a fake control left press/release */
+ return FALSE;
+}
+
+
+/*
+ * Lift any modifier keys that are pressed
+ */
+
+void
+winKeybdReleaseKeys (void)
+{
+ int i;
+
+#ifdef HAS_DEVWINDOWS
+ /* Verify that the mi input system has been initialized */
+ if (g_fdMessageQueue == WIN_FD_INVALID)
+ return;
+#endif
+
+ /* Loop through all keys */
+ for (i = 0; i < NUM_KEYCODES; ++i)
+ {
+ /* Pop key if pressed */
+ if (g_winKeyState[i])
+ winSendKeyEvent (i, FALSE);
+
+ /* Reset pressed flag for keys */
+ g_winKeyState[i] = FALSE;
+ }
+}
+
+
+/*
+ * Take a raw X key code and send an up or down event for it.
+ *
+ * Thanks to VNC for inspiration, though it is a simple function.
+ */
+
+void
+winSendKeyEvent (DWORD dwKey, Bool fDown)
+{
+ /*
+ * When alt-tabing between screens we can get phantom key up messages
+ * Here we only pass them through it we think we should!
+ */
+ if (g_winKeyState[dwKey] == FALSE && fDown == FALSE) return;
+
+ /* Update the keyState map */
+ g_winKeyState[dwKey] = fDown;
+
+ QueueKeyboardEvents(g_pwinKeyboard, fDown ? KeyPress : KeyRelease, dwKey + MIN_KEYCODE, NULL);
+
+ winDebug("winSendKeyEvent: dwKey: %d, fDown: %d\n",
+ dwKey, fDown);
+}
+
+BOOL winCheckKeyPressed(WPARAM wParam, LPARAM lParam)
+{
+ switch (wParam)
+ {
+ case VK_CONTROL:
+ if ((lParam & 0x1ff0000) == 0x11d0000 && g_winKeyState[KEY_RCtrl])
+ return TRUE;
+ if ((lParam & 0x1ff0000) == 0x01d0000 && g_winKeyState[KEY_LCtrl])
+ return TRUE;
+ break;
+ case VK_SHIFT:
+ if ((lParam & 0x1ff0000) == 0x0360000 && g_winKeyState[KEY_ShiftR])
+ return TRUE;
+ if ((lParam & 0x1ff0000) == 0x02a0000 && g_winKeyState[KEY_ShiftL])
+ return TRUE;
+ break;
+ default:
+ return TRUE;
+ }
+ return FALSE;
+}
+
+/* Only on shift release message is sent even if both are pressed.
+ * Fix this here
+ */
+void winFixShiftKeys (int iScanCode)
+{
+ if (GetKeyState (VK_SHIFT) & 0x8000)
+ return;
+
+ if (iScanCode == KEY_ShiftL && g_winKeyState[KEY_ShiftR])
+ winSendKeyEvent (KEY_ShiftR, FALSE);
+ if (iScanCode == KEY_ShiftR && g_winKeyState[KEY_ShiftL])
+ winSendKeyEvent (KEY_ShiftL, FALSE);
+}
diff --git a/xorg-server/hw/xwin/winkeybd.h b/xorg-server/hw/xwin/winkeybd.h index 40fbc179f..37cc66733 100644 --- a/xorg-server/hw/xwin/winkeybd.h +++ b/xorg-server/hw/xwin/winkeybd.h @@ -37,8 +37,10 @@ #define WIN_KEYMAP_COLS 3
-/* Rows 160 through 165 correspond to software-generated codes, which
- * may not be associated with the appropriate scan code.
+/* ASCII column, rows 33 through 40 are for Speech Recognition with
+ * num-lock asserted.
+ * Rows 160 through 165 correspond to software-generated codes, which
+ * may not be associated with the appropriate scan code/extended bit
*/
const int
g_iKeyMap [] = {
@@ -76,14 +78,14 @@ g_iKeyMap [] = { /* 30 */ 0, 0, 0,
/* 31 */ 0, 0, 0,
/* 32 */ 0, 0, 0,
- /* 33 */ VK_PRIOR, 0, KEY_PgUp,
- /* 34 */ VK_NEXT, 0, KEY_PgDown,
- /* 35 */ VK_END, 0, KEY_End,
- /* 36 */ VK_HOME, 0, KEY_Home,
- /* 37 */ VK_LEFT, 0, KEY_Left,
- /* 38 */ VK_UP, 0, KEY_Up,
- /* 39 */ VK_RIGHT, 0, KEY_Right,
- /* 40 */ VK_DOWN, 0, KEY_Down,
+ /* 33 */ VK_PRIOR, KEY_PgUp, KEY_PgUp,
+ /* 34 */ VK_NEXT, KEY_PgDown, KEY_PgDown,
+ /* 35 */ VK_END, KEY_End, KEY_End,
+ /* 36 */ VK_HOME, KEY_Home, KEY_Home,
+ /* 37 */ VK_LEFT, KEY_Left, KEY_Left,
+ /* 38 */ VK_UP, KEY_Up, KEY_Up,
+ /* 39 */ VK_RIGHT, KEY_Right, KEY_Right,
+ /* 40 */ VK_DOWN, KEY_Down, KEY_Down,
/* 41 */ 0, 0, 0,
/* 42 */ 0, 0, 0,
/* 43 */ 0, 0, 0,
@@ -203,12 +205,12 @@ g_iKeyMap [] = { /* 157 */ 0, 0, 0,
/* 158 */ 0, 0, 0,
/* 159 */ 0, 0, 0,
- /* 160 */ VK_LSHIFT, KEY_ShiftL, 0,
- /* 161 */ VK_RSHIFT, KEY_ShiftR, 0,
- /* 162 */ VK_LCONTROL, KEY_LCtrl, 0,
- /* 163 */ VK_RCONTROL, KEY_RCtrl, 0,
- /* 164 */ VK_LMENU, KEY_Alt, 0,
- /* 165 */ VK_RMENU, KEY_AltLang, 0,
+ /* 160 */ VK_LSHIFT, KEY_ShiftL, KEY_ShiftL,
+ /* 161 */ VK_RSHIFT, KEY_ShiftR, KEY_ShiftR,
+ /* 162 */ VK_LCONTROL, KEY_LCtrl, KEY_LCtrl,
+ /* 163 */ VK_RCONTROL, KEY_RCtrl, KEY_RCtrl,
+ /* 164 */ VK_LMENU, KEY_Alt, KEY_Alt,
+ /* 165 */ VK_RMENU, KEY_AltLang, KEY_AltLang,
/* 166 */ 0, 0, 0,
/* 167 */ 0, 0, 0,
/* 168 */ 0, 0, 0,
diff --git a/xorg-server/hw/xwin/winlayouts.h b/xorg-server/hw/xwin/winlayouts.h index 743f03c39..c53f0e054 100644 --- a/xorg-server/hw/xwin/winlayouts.h +++ b/xorg-server/hw/xwin/winlayouts.h @@ -63,6 +63,7 @@ WinKBLayoutRec winKBLayouts[] = { 0x0000040b, -1, "pc105", "fi", NULL, NULL, "Finnish"},
{ 0x0000040c, -1, "pc105", "fr", NULL, NULL, "French (Standard)"},
{ 0x0000080c, -1, "pc105", "be", NULL, NULL, "French (Belgian)"},
+ { 0x0001080c, -1, "pc105", "be", NULL, NULL, "Belgian (Comma)"},
{ 0x00000c0c, -1, "pc105", "ca", "fr-legacy", NULL, "French (Canada, Legacy)"},
{ 0x0000100c, -1, "pc105", "ch", "fr", NULL, "French (Switzerland)"},
{ 0x0000040d, -1, "pc105", "il", NULL, NULL, "Hebrew"},
diff --git a/xorg-server/hw/xwin/winmisc.c b/xorg-server/hw/xwin/winmisc.c index 8e6698118..a5a2d3d1c 100644 --- a/xorg-server/hw/xwin/winmisc.c +++ b/xorg-server/hw/xwin/winmisc.c @@ -44,7 +44,7 @@ void winQueryBestSizeNativeGDI (int class, unsigned short *pWidth, unsigned short *pHeight, ScreenPtr pScreen) { - ErrorF ("winQueryBestSizeNativeGDI\n"); + winDebug ("winQueryBestSizeNativeGDI\n"); } #endif diff --git a/xorg-server/hw/xwin/winmonitors.c b/xorg-server/hw/xwin/winmonitors.c index a9d46f90e..f78734b9b 100644 --- a/xorg-server/hw/xwin/winmonitors.c +++ b/xorg-server/hw/xwin/winmonitors.c @@ -1,92 +1,73 @@ -/* - -Copyright 1993, 1998 The Open Group -Copyright (C) Colin Harrison 2005-2008 - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ - - -#include "win.h" -#include "winmonitors.h" - -/* - * getMonitorInfo - callback function used to return information from the enumeration of monitors attached - */ - -static -wBOOL CALLBACK getMonitorInfo(HMONITOR hMonitor, HDC hdc, LPRECT rect, LPARAM _data) -{ - struct GetMonitorInfoData* data = (struct GetMonitorInfoData*)_data; - // only get data for monitor number specified in <data> - data->monitorNum++; - if (data->monitorNum == data->requestedMonitor) - { - data->bMonitorSpecifiedExists = TRUE; - data->monitorOffsetX = rect->left; - data->monitorOffsetY = rect->top; - data->monitorHeight = rect->bottom - rect->top; - data->monitorWidth = rect->right - rect->left; - return FALSE; - } - return TRUE; -} - -typedef WINAPI wBOOL (*ENUMDISPLAYMONITORSPROC)(HDC,LPCRECT,MONITORENUMPROC,LPARAM); -ENUMDISPLAYMONITORSPROC _EnumDisplayMonitors; - -wBOOL CALLBACK getMonitorInfo(HMONITOR hMonitor, HDC hdc, LPRECT rect, LPARAM _data); - -Bool QueryMonitor(int index, struct GetMonitorInfoData *data) -{ - /* Load EnumDisplayMonitors from DLL */ - HMODULE user32; - FARPROC func; - user32 = LoadLibrary("user32.dll"); - if (user32 == NULL) - { - winW32Error(2, "Could not open user32.dll"); - return FALSE; - } - func = GetProcAddress(user32, "EnumDisplayMonitors"); - if (func == NULL) - { - winW32Error(2, "Could not resolve EnumDisplayMonitors: "); - return FALSE; - } - _EnumDisplayMonitors = (ENUMDISPLAYMONITORSPROC)func; - - /* prepare data */ - if (data == NULL) - return FALSE; - memset(data, 0, sizeof(*data)); - data->requestedMonitor = index; - - /* query information */ - _EnumDisplayMonitors(NULL, NULL, getMonitorInfo, (LPARAM) data); - - /* cleanup */ - FreeLibrary(user32); - return TRUE; -} +/*
+
+Copyright 1993, 1998 The Open Group
+Copyright (C) Colin Harrison 2005-2008
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization
+from The Open Group.
+
+*/
+
+#ifdef HAVE_XWIN_CONFIG_H
+#include <xwin-config.h>
+#endif
+
+#include "win.h"
+#define COMPILE_MULTIMON_STUBS
+#include <multimon.h>
+#include "winmonitors.h"
+
+/*
+ * getMonitorInfo - callback function used to return information from the enumeration of monitors attached
+ */
+
+static
+wBOOL CALLBACK getMonitorInfo(HMONITOR hMonitor, HDC hdc, LPRECT rect, LPARAM _data)
+{
+ struct GetMonitorInfoData* data = (struct GetMonitorInfoData*)_data;
+ // only get data for monitor number specified in <data>
+ data->monitorNum++;
+ if (data->monitorNum == data->requestedMonitor)
+ {
+ data->bMonitorSpecifiedExists = TRUE;
+ data->monitorOffsetX = rect->left;
+ data->monitorOffsetY = rect->top;
+ data->monitorHeight = rect->bottom - rect->top;
+ data->monitorWidth = rect->right - rect->left;
+ return FALSE;
+ }
+ return TRUE;
+}
+
+Bool QueryMonitor(int index, struct GetMonitorInfoData *data)
+{
+ /* prepare data */
+ if (data == NULL)
+ return FALSE;
+ memset(data, 0, sizeof(*data));
+ data->requestedMonitor = index;
+
+ /* query information */
+ xEnumDisplayMonitors(NULL, NULL, getMonitorInfo, (LPARAM) data);
+
+ return TRUE;
+}
diff --git a/xorg-server/hw/xwin/winmouse.c b/xorg-server/hw/xwin/winmouse.c index 752334a31..efe71103c 100644 --- a/xorg-server/hw/xwin/winmouse.c +++ b/xorg-server/hw/xwin/winmouse.c @@ -1,375 +1,380 @@ -/* - *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved. - * - *Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - *"Software"), to deal in the Software without restriction, including - *without limitation the rights to use, copy, modify, merge, publish, - *distribute, sublicense, and/or sell copies of the Software, and to - *permit persons to whom the Software is furnished to do so, subject to - *the following conditions: - * - *The above copyright notice and this permission notice shall be - *included in all copies or substantial portions of the Software. - * - *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR - *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - *Except as contained in this notice, the name of the XFree86 Project - *shall not be used in advertising or otherwise to promote the sale, use - *or other dealings in this Software without prior written authorization - *from the XFree86 Project. - * - * Authors: Dakshinamurthy Karra - * Suhaib M Siddiqi - * Peter Busch - * Harold L Hunt II - */ - -#ifdef HAVE_XWIN_CONFIG_H -#include <xwin-config.h> -#endif -#include "win.h" - -#include "inputstr.h" -#include "exevents.h" /* for button/axes labels */ -#include "xserver-properties.h" -#include "inpututils.h" - -/* Peek the internal button mapping */ -static CARD8 const *g_winMouseButtonMap = NULL; - - -/* - * Local prototypes - */ - -static void -winMouseCtrl (DeviceIntPtr pDevice, PtrCtrl *pCtrl); - - -static void -winMouseCtrl (DeviceIntPtr pDevice, PtrCtrl *pCtrl) -{ -} - - -/* - * See Porting Layer Definition - p. 18 - * This is known as a DeviceProc - */ - -int -winMouseProc (DeviceIntPtr pDeviceInt, int iState) -{ - int lngMouseButtons, i; - int lngWheelEvents = 2; - CARD8 *map; - DevicePtr pDevice = (DevicePtr) pDeviceInt; - Atom *btn_labels; - Atom axes_labels[2]; - - switch (iState) - { - case DEVICE_INIT: - /* Get number of mouse buttons */ - lngMouseButtons = GetSystemMetrics(SM_CMOUSEBUTTONS); - - /* Mapping of windows events to X events: - * LEFT:1 MIDDLE:2 RIGHT:3 - * SCROLL_UP:4 SCROLL_DOWN:5 - * XBUTTON 1:6 XBUTTON 2:7 ... - * - * To map scroll wheel correctly we need at least the 3 normal buttons - */ - if (lngMouseButtons < 3) - lngMouseButtons = 3; - winMsg(X_PROBED, "%d mouse buttons found\n", lngMouseButtons); - - /* allocate memory: - * number of buttons + 2x mouse wheel event + 1 extra (offset for map) - */ - map = malloc(sizeof(CARD8) * (lngMouseButtons + lngWheelEvents + 1)); - - /* initalize button map */ - map[0] = 0; - for (i=1; i <= lngMouseButtons + lngWheelEvents; i++) - map[i] = i; - - btn_labels = calloc((lngMouseButtons + lngWheelEvents), sizeof(Atom)); - btn_labels[0] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_LEFT); - btn_labels[1] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_MIDDLE); - btn_labels[2] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_RIGHT); - btn_labels[3] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_UP); - btn_labels[4] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_DOWN); - - axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_X); - axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_Y); - - InitPointerDeviceStruct (pDevice, - map, - lngMouseButtons + lngWheelEvents, - btn_labels, - winMouseCtrl, - GetMotionHistorySize(), - 2, - axes_labels); - free(map); - free(btn_labels); - - g_winMouseButtonMap = pDeviceInt->button->map; - break; - - case DEVICE_ON: - pDevice->on = TRUE; - break; - - case DEVICE_CLOSE: - g_winMouseButtonMap = NULL; - - case DEVICE_OFF: - pDevice->on = FALSE; - break; - } - return Success; -} - - -/* Handle the mouse wheel */ -int -winMouseWheel (ScreenPtr pScreen, int iDeltaZ) -{ - winScreenPriv(pScreen); - int button; /* Button4 or Button5 */ - - /* Button4 = WheelUp */ - /* Button5 = WheelDown */ - - /* Do we have any previous delta stored? */ - if ((pScreenPriv->iDeltaZ > 0 - && iDeltaZ > 0) - || (pScreenPriv->iDeltaZ < 0 - && iDeltaZ < 0)) - { - /* Previous delta and of same sign as current delta */ - iDeltaZ += pScreenPriv->iDeltaZ; - pScreenPriv->iDeltaZ = 0; - } - else - { - /* - * Previous delta of different sign, or zero. - * We will set it to zero for either case, - * as blindly setting takes just as much time - * as checking, then setting if necessary :) - */ - pScreenPriv->iDeltaZ = 0; - } - - /* - * Only process this message if the wheel has moved further than - * WHEEL_DELTA - */ - if (iDeltaZ >= WHEEL_DELTA || (-1 * iDeltaZ) >= WHEEL_DELTA) - { - pScreenPriv->iDeltaZ = 0; - - /* Figure out how many whole deltas of the wheel we have */ - iDeltaZ /= WHEEL_DELTA; - } - else - { - /* - * Wheel has not moved past WHEEL_DELTA threshold; - * we will store the wheel delta until the threshold - * has been reached. - */ - pScreenPriv->iDeltaZ = iDeltaZ; - return 0; - } - - /* Set the button to indicate up or down wheel delta */ - if (iDeltaZ > 0) - { - button = Button4; - } - else - { - button = Button5; - } - - /* - * Flip iDeltaZ to positive, if negative, - * because always need to generate a *positive* number of - * button clicks for the Z axis. - */ - if (iDeltaZ < 0) - { - iDeltaZ *= -1; - } - - /* Generate X input messages for each wheel delta we have seen */ - while (iDeltaZ--) - { - /* Push the wheel button */ - winMouseButtonsSendEvent (ButtonPress, button); - - /* Release the wheel button */ - winMouseButtonsSendEvent (ButtonRelease, button); - } - - return 0; -} - - -/* - * Enqueue a mouse button event - */ - -void -winMouseButtonsSendEvent (int iEventType, int iButton) -{ - ValuatorMask mask; - - if (g_winMouseButtonMap) - iButton = g_winMouseButtonMap[iButton]; - - valuator_mask_zero(&mask); - QueuePointerEvents(g_pwinPointer, iEventType, iButton, - POINTER_RELATIVE, &mask); - -#if CYGDEBUG - ErrorF("winMouseButtonsSendEvent: iEventType: %d, iButton: %d\n", - iEventType, iButton); -#endif -} - - -/* - * Decide what to do with a Windows mouse message - */ - -int -winMouseButtonsHandle (ScreenPtr pScreen, - int iEventType, int iButton, - WPARAM wParam) -{ - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - - /* Send button events right away if emulate 3 buttons is off */ - if (pScreenInfo->iE3BTimeout == WIN_E3B_OFF) - { - /* Emulate 3 buttons is off, send the button event */ - winMouseButtonsSendEvent (iEventType, iButton); - return 0; - } - - /* Emulate 3 buttons is on, let the fun begin */ - if (iEventType == ButtonPress - && pScreenPriv->iE3BCachedPress == 0 - && !pScreenPriv->fE3BFakeButton2Sent) - { - /* - * Button was pressed, no press is cached, - * and there is no fake button 2 release pending. - */ - - /* Store button press type */ - pScreenPriv->iE3BCachedPress = iButton; - - /* - * Set a timer to send this button press if the other button - * is not pressed within the timeout time. - */ - SetTimer (pScreenPriv->hwndScreen, - WIN_E3B_TIMER_ID, - pScreenInfo->iE3BTimeout, - NULL); - } - else if (iEventType == ButtonPress - && pScreenPriv->iE3BCachedPress != 0 - && pScreenPriv->iE3BCachedPress != iButton - && !pScreenPriv->fE3BFakeButton2Sent) - { - /* - * Button press is cached, other button was pressed, - * and there is no fake button 2 release pending. - */ - - /* Mouse button was cached and other button was pressed */ - KillTimer (pScreenPriv->hwndScreen, WIN_E3B_TIMER_ID); - pScreenPriv->iE3BCachedPress = 0; - - /* Send fake middle button */ - winMouseButtonsSendEvent (ButtonPress, Button2); - - /* Indicate that a fake middle button event was sent */ - pScreenPriv->fE3BFakeButton2Sent = TRUE; - } - else if (iEventType == ButtonRelease - && pScreenPriv->iE3BCachedPress == iButton) - { - /* - * Cached button was released before timer ran out, - * and before the other mouse button was pressed. - */ - KillTimer (pScreenPriv->hwndScreen, WIN_E3B_TIMER_ID); - pScreenPriv->iE3BCachedPress = 0; - - /* Send cached press, then send release */ - winMouseButtonsSendEvent (ButtonPress, iButton); - winMouseButtonsSendEvent (ButtonRelease, iButton); - } - else if (iEventType == ButtonRelease - && pScreenPriv->fE3BFakeButton2Sent - && !(wParam & MK_LBUTTON) - && !(wParam & MK_RBUTTON)) - { - /* - * Fake button 2 was sent and both mouse buttons have now been released - */ - pScreenPriv->fE3BFakeButton2Sent = FALSE; - - /* Send middle mouse button release */ - winMouseButtonsSendEvent (ButtonRelease, Button2); - } - else if (iEventType == ButtonRelease - && pScreenPriv->iE3BCachedPress == 0 - && !pScreenPriv->fE3BFakeButton2Sent) - { - /* - * Button was release, no button is cached, - * and there is no fake button 2 release is pending. - */ - winMouseButtonsSendEvent (ButtonRelease, iButton); - } - - return 0; -} - -/** - * Enqueue a motion event. - * - * XXX: miPointerMove does exactly this, but is static :-( (and uses a static buffer) - * - */ -void winEnqueueMotion(int x, int y) -{ - int valuators[2]; - ValuatorMask mask; - - miPointerSetPosition(g_pwinPointer, POINTER_RELATIVE, &x, &y); - valuators[0] = x; - valuators[1] = y; - - valuator_mask_set_range(&mask, 0, 2, valuators); - QueuePointerEvents(g_pwinPointer, MotionNotify, 0, - POINTER_ABSOLUTE | POINTER_SCREEN, &mask); - -} +/*
+ *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
+ *
+ *Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ *"Software"), to deal in the Software without restriction, including
+ *without limitation the rights to use, copy, modify, merge, publish,
+ *distribute, sublicense, and/or sell copies of the Software, and to
+ *permit persons to whom the Software is furnished to do so, subject to
+ *the following conditions:
+ *
+ *The above copyright notice and this permission notice shall be
+ *included in all copies or substantial portions of the Software.
+ *
+ *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
+ *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+ *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Dakshinamurthy Karra
+ * Suhaib M Siddiqi
+ * Peter Busch
+ * Harold L Hunt II
+ */
+
+#ifdef HAVE_XWIN_CONFIG_H
+#include <xwin-config.h>
+#endif
+#include "win.h"
+
+#ifdef XKB
+#ifndef XKB_IN_SERVER
+#define XKB_IN_SERVER
+#endif
+#include <xkbsrv.h>
+#endif
+
+#include "inputstr.h"
+#include "exevents.h" /* for button/axes labels */
+#include "xserver-properties.h"
+#include "inpututils.h"
+
+/* Peek the internal button mapping */
+static CARD8 const *g_winMouseButtonMap = NULL;
+
+
+/*
+ * Local prototypes
+ */
+
+static void
+winMouseCtrl (DeviceIntPtr pDevice, PtrCtrl *pCtrl);
+
+
+static void
+winMouseCtrl (DeviceIntPtr pDevice, PtrCtrl *pCtrl)
+{
+}
+
+
+/*
+ * See Porting Layer Definition - p. 18
+ * This is known as a DeviceProc
+ */
+
+int
+winMouseProc (DeviceIntPtr pDeviceInt, int iState)
+{
+ int lngMouseButtons, i;
+ int lngWheelEvents = 2;
+ CARD8 *map;
+ DevicePtr pDevice = (DevicePtr) pDeviceInt;
+ Atom *btn_labels;
+ Atom axes_labels[2];
+
+ switch (iState)
+ {
+ case DEVICE_INIT:
+ /* Get number of mouse buttons */
+ lngMouseButtons = GetSystemMetrics(SM_CMOUSEBUTTONS);
+
+ /* Mapping of windows events to X events:
+ * LEFT:1 MIDDLE:2 RIGHT:3
+ * SCROLL_UP:4 SCROLL_DOWN:5
+ * XBUTTON 1:6 XBUTTON 2:7 ...
+ *
+ * To map scroll wheel correctly we need at least the 3 normal buttons
+ */
+ if (lngMouseButtons < 3)
+ lngMouseButtons = 3;
+ winDebug("%d mouse buttons found\n", lngMouseButtons);
+
+ /* allocate memory:
+ * number of buttons + 2x mouse wheel event + 1 extra (offset for map)
+ */
+ map = malloc(sizeof(CARD8) * (lngMouseButtons + lngWheelEvents + 1));
+
+ /* initalize button map */
+ map[0] = 0;
+ for (i=1; i <= lngMouseButtons + lngWheelEvents; i++)
+ map[i] = i;
+
+ btn_labels = calloc((lngMouseButtons + lngWheelEvents), sizeof(Atom));
+ btn_labels[0] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_LEFT);
+ btn_labels[1] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_MIDDLE);
+ btn_labels[2] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_RIGHT);
+ btn_labels[3] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_UP);
+ btn_labels[4] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_DOWN);
+
+ axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_X);
+ axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_Y);
+
+ InitPointerDeviceStruct (pDevice,
+ map,
+ lngMouseButtons + lngWheelEvents,
+ btn_labels,
+ winMouseCtrl,
+ GetMotionHistorySize(),
+ 2,
+ axes_labels);
+ free(map);
+ free(btn_labels);
+
+ g_winMouseButtonMap = pDeviceInt->button->map;
+ break;
+
+ case DEVICE_ON:
+ pDevice->on = TRUE;
+ break;
+
+ case DEVICE_CLOSE:
+ g_winMouseButtonMap = NULL;
+
+ case DEVICE_OFF:
+ pDevice->on = FALSE;
+ break;
+ }
+ return Success;
+}
+
+
+/* Handle the mouse wheel */
+int
+winMouseWheel (ScreenPtr pScreen, int iDeltaZ)
+{
+ winScreenPriv(pScreen);
+ int button; /* Button4 or Button5 */
+
+ /* Button4 = WheelUp */
+ /* Button5 = WheelDown */
+
+ /* Do we have any previous delta stored? */
+ if ((pScreenPriv->iDeltaZ > 0
+ && iDeltaZ > 0)
+ || (pScreenPriv->iDeltaZ < 0
+ && iDeltaZ < 0))
+ {
+ /* Previous delta and of same sign as current delta */
+ iDeltaZ += pScreenPriv->iDeltaZ;
+ pScreenPriv->iDeltaZ = 0;
+ }
+ else
+ {
+ /*
+ * Previous delta of different sign, or zero.
+ * We will set it to zero for either case,
+ * as blindly setting takes just as much time
+ * as checking, then setting if necessary :)
+ */
+ pScreenPriv->iDeltaZ = 0;
+ }
+
+ /*
+ * Only process this message if the wheel has moved further than
+ * WHEEL_DELTA
+ */
+ if (iDeltaZ >= WHEEL_DELTA || (-1 * iDeltaZ) >= WHEEL_DELTA)
+ {
+ pScreenPriv->iDeltaZ = 0;
+
+ /* Figure out how many whole deltas of the wheel we have */
+ iDeltaZ /= WHEEL_DELTA;
+ }
+ else
+ {
+ /*
+ * Wheel has not moved past WHEEL_DELTA threshold;
+ * we will store the wheel delta until the threshold
+ * has been reached.
+ */
+ pScreenPriv->iDeltaZ = iDeltaZ;
+ return 0;
+ }
+
+ /* Set the button to indicate up or down wheel delta */
+ if (iDeltaZ > 0)
+ {
+ button = Button4;
+ }
+ else
+ {
+ button = Button5;
+ }
+
+ /*
+ * Flip iDeltaZ to positive, if negative,
+ * because always need to generate a *positive* number of
+ * button clicks for the Z axis.
+ */
+ if (iDeltaZ < 0)
+ {
+ iDeltaZ *= -1;
+ }
+
+ /* Generate X input messages for each wheel delta we have seen */
+ while (iDeltaZ--)
+ {
+ /* Push the wheel button */
+ winMouseButtonsSendEvent (ButtonPress, button);
+
+ /* Release the wheel button */
+ winMouseButtonsSendEvent (ButtonRelease, button);
+ }
+
+ return 0;
+}
+
+
+/*
+ * Enqueue a mouse button event
+ */
+
+void
+winMouseButtonsSendEvent (int iEventType, int iButton)
+{
+ ValuatorMask mask;
+
+ if (g_winMouseButtonMap)
+ iButton = g_winMouseButtonMap[iButton];
+
+ valuator_mask_zero(&mask);
+ QueuePointerEvents(g_pwinPointer, iEventType, iButton,
+ POINTER_RELATIVE, &mask);
+
+ winDebug("winMouseButtonsSendEvent: iEventType: %d, iButton: %d\n",
+ iEventType, iButton);
+}
+
+
+/*
+ * Decide what to do with a Windows mouse message
+ */
+
+int
+winMouseButtonsHandle (ScreenPtr pScreen,
+ int iEventType, int iButton,
+ WPARAM wParam)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+
+ /* Send button events right away if emulate 3 buttons is off */
+ if (pScreenInfo->iE3BTimeout == WIN_E3B_OFF)
+ {
+ /* Emulate 3 buttons is off, send the button event */
+ winMouseButtonsSendEvent (iEventType, iButton);
+ return 0;
+ }
+
+ /* Emulate 3 buttons is on, let the fun begin */
+ if (iEventType == ButtonPress
+ && pScreenPriv->iE3BCachedPress == 0
+ && !pScreenPriv->fE3BFakeButton2Sent)
+ {
+ /*
+ * Button was pressed, no press is cached,
+ * and there is no fake button 2 release pending.
+ */
+
+ /* Store button press type */
+ pScreenPriv->iE3BCachedPress = iButton;
+
+ /*
+ * Set a timer to send this button press if the other button
+ * is not pressed within the timeout time.
+ */
+ SetTimer (pScreenPriv->hwndScreen,
+ WIN_E3B_TIMER_ID,
+ pScreenInfo->iE3BTimeout,
+ NULL);
+ }
+ else if (iEventType == ButtonPress
+ && pScreenPriv->iE3BCachedPress != 0
+ && pScreenPriv->iE3BCachedPress != iButton
+ && !pScreenPriv->fE3BFakeButton2Sent)
+ {
+ /*
+ * Button press is cached, other button was pressed,
+ * and there is no fake button 2 release pending.
+ */
+
+ /* Mouse button was cached and other button was pressed */
+ KillTimer (pScreenPriv->hwndScreen, WIN_E3B_TIMER_ID);
+ pScreenPriv->iE3BCachedPress = 0;
+
+ /* Send fake middle button */
+ winMouseButtonsSendEvent (ButtonPress, Button2);
+
+ /* Indicate that a fake middle button event was sent */
+ pScreenPriv->fE3BFakeButton2Sent = TRUE;
+ }
+ else if (iEventType == ButtonRelease
+ && pScreenPriv->iE3BCachedPress == iButton)
+ {
+ /*
+ * Cached button was released before timer ran out,
+ * and before the other mouse button was pressed.
+ */
+ KillTimer (pScreenPriv->hwndScreen, WIN_E3B_TIMER_ID);
+ pScreenPriv->iE3BCachedPress = 0;
+
+ /* Send cached press, then send release */
+ winMouseButtonsSendEvent (ButtonPress, iButton);
+ winMouseButtonsSendEvent (ButtonRelease, iButton);
+ }
+ else if (iEventType == ButtonRelease
+ && pScreenPriv->fE3BFakeButton2Sent
+ && !(wParam & MK_LBUTTON)
+ && !(wParam & MK_RBUTTON))
+ {
+ /*
+ * Fake button 2 was sent and both mouse buttons have now been released
+ */
+ pScreenPriv->fE3BFakeButton2Sent = FALSE;
+
+ /* Send middle mouse button release */
+ winMouseButtonsSendEvent (ButtonRelease, Button2);
+ }
+ else if (iEventType == ButtonRelease
+ && pScreenPriv->iE3BCachedPress == 0
+ && !pScreenPriv->fE3BFakeButton2Sent)
+ {
+ /*
+ * Button was release, no button is cached,
+ * and there is no fake button 2 release is pending.
+ */
+ winMouseButtonsSendEvent (ButtonRelease, iButton);
+ }
+
+ return 0;
+}
+
+/**
+ * Enqueue a motion event.
+ *
+ * XXX: miPointerMove does exactly this, but is static :-( (and uses a static buffer)
+ *
+ */
+void winEnqueueMotion(int x, int y)
+{
+ int valuators[2];
+ ValuatorMask mask;
+
+ miPointerSetPosition(g_pwinPointer, POINTER_RELATIVE, &x, &y);
+ valuators[0] = x;
+ valuators[1] = y;
+
+ valuator_mask_set_range(&mask, 0, 2, valuators);
+ QueuePointerEvents(g_pwinPointer, MotionNotify, 0,
+ POINTER_ABSOLUTE | POINTER_SCREEN, &mask);
+
+}
diff --git a/xorg-server/hw/xwin/winmsg.c b/xorg-server/hw/xwin/winmsg.c index d0464f71b..e3d68915f 100644 --- a/xorg-server/hw/xwin/winmsg.c +++ b/xorg-server/hw/xwin/winmsg.c @@ -33,71 +33,12 @@ #endif #include "win.h" #include "winmsg.h" -#if CYGDEBUG +#ifdef WINDBG #include "winmessages.h" #endif #include <stdarg.h> -void winVMsg (int, MessageType, int verb, const char *, va_list); - -void -winVMsg (int scrnIndex, MessageType type, int verb, const char *format, - va_list ap) -{ - LogVMessageVerb(type, verb, format, ap); -} - - -void -winDrvMsg (int scrnIndex, MessageType type, const char *format, ...) -{ - va_list ap; - va_start (ap, format); - LogVMessageVerb(type, 0, format, ap); - va_end (ap); -} - - -void -winMsg (MessageType type, const char *format, ...) -{ - va_list ap; - va_start (ap, format); - LogVMessageVerb(type, 1, format, ap); - va_end (ap); -} - - -void -winDrvMsgVerb (int scrnIndex, MessageType type, int verb, const char *format, - ...) -{ - va_list ap; - va_start (ap, format); - LogVMessageVerb(type, verb, format, ap); - va_end (ap); -} - - -void -winMsgVerb (MessageType type, int verb, const char *format, ...) -{ - va_list ap; - va_start (ap, format); - LogVMessageVerb(type, verb, format, ap); - va_end (ap); -} - - -void -winErrorFVerb (int verb, const char *format, ...) -{ - va_list ap; - va_start (ap, format); - LogVMessageVerb(X_NONE, verb, format, ap); - va_end (ap); -} - +#ifdef WINDBG void winDebug (const char *format, ...) { @@ -108,22 +49,23 @@ winDebug (const char *format, ...) } void -winTrace (const char *format, ...) +winDebug4 (const char *format, ...) { va_list ap; va_start (ap, format); - LogVMessageVerb(X_NONE, 10, format, ap); + LogVMessageVerb(X_NONE, 4, format, ap); va_end (ap); } +#endif void -winW32Error(int verb, const char *msg) +winW32Error(const char *msg) { - winW32ErrorEx(verb, msg, GetLastError()); + winW32ErrorEx(msg, GetLastError()); } void -winW32ErrorEx(int verb, const char *msg, DWORD errorcode) +winW32ErrorEx(const char *msg, DWORD errorcode) { LPVOID buffer; if (!FormatMessage( @@ -137,16 +79,17 @@ winW32ErrorEx(int verb, const char *msg, DWORD errorcode) 0, NULL )) { - winErrorFVerb(verb, "Unknown error in FormatMessage!\n"); + ErrorF(msg); + ErrorF("Unknown error in FormatMessage!\n"); } else { - winErrorFVerb(verb, "%s %s", msg, (char *)buffer); + ErrorF("%s %s", msg, (char *)buffer); LocalFree(buffer); } } -#if CYGDEBUG +#ifdef WINDBG void winDebugWin32Message(const char* function, HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { static int force = 0; @@ -172,8 +115,4 @@ void winDebugWin32Message(const char* function, HWND hwnd, UINT message, WPARAM } } } -#else -void winDebugWin32Message(const char* function, HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) -{ -} #endif diff --git a/xorg-server/hw/xwin/winmsg.h b/xorg-server/hw/xwin/winmsg.h index 611dd6962..beb6683ed 100644 --- a/xorg-server/hw/xwin/winmsg.h +++ b/xorg-server/hw/xwin/winmsg.h @@ -33,18 +33,21 @@ /* * Function prototypes */ + +#include "os.h" -void winDrvMsgVerb (int scrnIndex, - MessageType type, int verb, const char *format, ...); -void winDrvMsg (int scrnIndex, MessageType type, const char *format, ...); -void winMsgVerb (MessageType type, int verb, const char *format, ...); -void winMsg (MessageType type, const char *format, ...); +#if !defined(_MSC_VER) || defined(_DEBUG) +#define WINDBG void winDebug (const char *format, ...); -void winTrace (const char *format, ...); - -void winErrorFVerb (int verb, const char *format, ...); -void winW32Error(int verb, const char *message); -void winW32ErrorEx(int verb, const char *message, DWORD errorcode); +void winDebug4 (const char *format, ...); void winDebugWin32Message(const char* function, HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); +#else +#define winDebug(...) +#define winDebug4(...) +#define winDebugWin32Message(...) +#endif + +void winW32Error(const char *message); +void winW32ErrorEx(const char *message, DWORD errorcode); #endif diff --git a/xorg-server/hw/xwin/winmultiwindowclass.c b/xorg-server/hw/xwin/winmultiwindowclass.c index a5cf2120a..ca08ae483 100644 --- a/xorg-server/hw/xwin/winmultiwindowclass.c +++ b/xorg-server/hw/xwin/winmultiwindowclass.c @@ -139,9 +139,10 @@ winMultiWindowGetWMHints (WindowPtr pWin, WinXWMHints *hints) while (prop) { if (prop->propertyName == XA_WM_HINTS + && prop->format == 32 && prop->data) { - memcpy (hints, prop->data, sizeof (WinXWMHints)); + memcpy (hints, prop->data, 4*(int)prop->size); /* format/8 = 4 */ return 1; } else @@ -224,9 +225,10 @@ winMultiWindowGetWMNormalHints (WindowPtr pWin, WinXSizeHints *hints) while (prop) { if (prop->propertyName == XA_WM_NORMAL_HINTS + && prop->format == 32 && prop->data) { - memcpy (hints, prop->data, sizeof (WinXSizeHints)); + memcpy (hints, prop->data, 4*(int)prop->size); /* format/8 = 4 */ return 1; } else @@ -260,10 +262,12 @@ winMultiWindowGetTransientFor (WindowPtr pWin, WindowPtr *ppDaddy) while (prop) { - if (prop->propertyName == XA_WM_TRANSIENT_FOR) + if (prop->propertyName == XA_WM_TRANSIENT_FOR + && prop->format == 32 + && prop->data) { if (ppDaddy) - memcpy (ppDaddy, prop->data, sizeof (WindowPtr)); + memcpy (ppDaddy, prop->data, 4*(int)prop->size); /* format/8 = 4 */ return 1; } else diff --git a/xorg-server/hw/xwin/winmultiwindowicons.c b/xorg-server/hw/xwin/winmultiwindowicons.c index 763cb7e08..853d63864 100644 --- a/xorg-server/hw/xwin/winmultiwindowicons.c +++ b/xorg-server/hw/xwin/winmultiwindowicons.c @@ -1,641 +1,649 @@ -/* - *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved. - * - *Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - *"Software"), to deal in the Software without restriction, including - *without limitation the rights to use, copy, modify, merge, publish, - *distribute, sublicense, and/or sell copies of the Software, and to - *permit persons to whom the Software is furnished to do so, subject to - *the following conditions: - * - *The above copyright notice and this permission notice shall be - *included in all copies or substantial portions of the Software. - * - *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR - *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - *Except as contained in this notice, the name of the XFree86 Project - *shall not be used in advertising or otherwise to promote the sale, use - *or other dealings in this Software without prior written authorization - *from the XFree86 Project. - * - * Authors: Earle F. Philhower, III - */ - -#ifdef HAVE_XWIN_CONFIG_H -#include <xwin-config.h> -#endif -#include "win.h" -#include "dixevents.h" -#include "winmultiwindowclass.h" -#include "winprefs.h" - -#include "propertyst.h" -#include "windowstr.h" - - -/* - * Prototypes for local functions - */ - -static void -winScaleXBitmapToWindows (int iconSize, int effBPP, - PixmapPtr pixmap, unsigned char *image); - - -/* - * Scale an X icon bitmap into a Windoze icon bitmap - */ - -static void -winScaleXBitmapToWindows (int iconSize, - int effBPP, - PixmapPtr pixmap, - unsigned char *image) -{ - int row, column, effXBPP, effXDepth; - unsigned char *outPtr; - char *iconData = 0; - int stride, xStride; - float factX, factY; - int posX, posY; - unsigned char *ptr; - unsigned int zero; - unsigned int color; - - effXBPP = BitsPerPixel(pixmap->drawable.depth); - effXDepth = pixmap->drawable.depth; - - if (pixmap->drawable.bitsPerPixel == 15) - effXBPP = 16; - - if (pixmap->drawable.depth == 15) - effXDepth = 16; - - /* Need 16-bit aligned rows for DDBitmaps */ - stride = ((iconSize * effBPP + 15) & (~15)) / 8; - xStride = PixmapBytePad (pixmap->drawable.width, pixmap->drawable.depth); - if (stride == 0 || xStride == 0) - { - ErrorF ("winScaleXBitmapToWindows - stride or xStride is zero. " - "Bailing.\n"); - return; - } - - /* Allocate memory for icon data */ - iconData = malloc (xStride * pixmap->drawable.height); - if (!iconData) - { - ErrorF ("winScaleXBitmapToWindows - malloc failed for iconData. " - "Bailing.\n"); - return; - } - - /* Get icon data */ - miGetImage ((DrawablePtr) &(pixmap->drawable), 0, 0, - pixmap->drawable.width, pixmap->drawable.height, - ZPixmap, 0xffffffff, iconData); - - /* Keep aspect ratio */ - factX = ((float)pixmap->drawable.width) / ((float)iconSize); - factY = ((float)pixmap->drawable.height) / ((float)iconSize); - if (factX > factY) - factY = factX; - else - factX = factY; - - /* Out-of-bounds, fill icon with zero */ - zero = 0; - - for (row = 0; row < iconSize; row++) - { - outPtr = image + stride * row; - for (column = 0; column < iconSize; column++) - { - posX = factX * column; - posY = factY * row; - - ptr = (unsigned char*) iconData + posY*xStride; - if (effXBPP == 1) - { - ptr += posX / 8; - - /* Out of X icon bounds, leave space blank */ - if (posX >= pixmap->drawable.width - || posY >= pixmap->drawable.height) - ptr = (unsigned char *) &zero; - - if ((*ptr) & (1 << (posX & 7))) - switch (effBPP) - { - case 32: - *(outPtr++) = 0; - case 24: - *(outPtr++) = 0; - case 16: - *(outPtr++) = 0; - case 8: - *(outPtr++) = 0; - break; - case 1: - outPtr[column / 8] &= ~(1 << (7 - (column & 7))); - break; - } - else - switch (effBPP) - { - case 32: - *(outPtr++) = 255; - *(outPtr++) = 255; - *(outPtr++) = 255; - *(outPtr++) = 0; - break; - case 24: - *(outPtr++) = 255; - case 16: - *(outPtr++) = 255; - case 8: - *(outPtr++) = 255; - break; - case 1: - outPtr[column / 8] |= (1 << (7 - (column & 7))); - break; - } - } - else if (effXDepth == 24 || effXDepth == 32) - { - ptr += posX * (effXBPP / 8); - - /* Out of X icon bounds, leave space blank */ - if (posX >= pixmap->drawable.width - || posY >= pixmap->drawable.height) - ptr = (unsigned char *) &zero; - color = (((*ptr) << 16) - + ((*(ptr + 1)) << 8) - + ((*(ptr + 2)) << 0)); - switch (effBPP) - { - case 32: - *(outPtr++) = *(ptr++); /* b */ - *(outPtr++) = *(ptr++); /* g */ - *(outPtr++) = *(ptr++); /* r */ - *(outPtr++) = (effXDepth == 32) ? *(ptr++) : 0x0; /* alpha */ - break; - case 24: - *(outPtr++) = *(ptr++); - *(outPtr++) = *(ptr++); - *(outPtr++) = *(ptr++); - break; - case 16: - color = ((((*ptr) >> 2) << 10) - + (((*(ptr + 1)) >> 2) << 5) - + (((*(ptr + 2)) >> 2))); - *(outPtr++) = (color >> 8); - *(outPtr++) = (color & 255); - break; - case 8: - color = (((*ptr))) + (((*(ptr + 1)))) + (((*(ptr + 2)))); - color /= 3; - *(outPtr++) = color; - break; - case 1: - if (color) - outPtr[column / 8] |= (1 << (7 - (column & 7))); - else - outPtr[column / 8] &= ~(1 << (7 - (column & 7))); - } - } - else if (effXDepth == 16) - { - ptr += posX * (effXBPP / 8); - - /* Out of X icon bounds, leave space blank */ - if (posX >= pixmap->drawable.width - || posY >= pixmap->drawable.height) - ptr = (unsigned char *) &zero; - color = ((*ptr) << 8) + (*(ptr + 1)); - switch (effBPP) - { - case 32: - *(outPtr++) = (color & 31) << 2; - *(outPtr++) = ((color >> 5) & 31) << 2; - *(outPtr++) = ((color >> 10) & 31) << 2; - *(outPtr++) = 0; /* resvd */ - break; - case 24: - *(outPtr++) = (color & 31) << 2; - *(outPtr++) = ((color >> 5) & 31) << 2; - *(outPtr++) = ((color >> 10) & 31) << 2; - break; - case 16: - *(outPtr++) = *(ptr++); - *(outPtr++) = *(ptr++); - break; - case 8: - *(outPtr++) = (((color & 31) - + ((color >> 5) & 31) - + ((color >> 10) & 31)) / 3) << 2; - break; - case 1: - if (color) - outPtr[column / 8] |= (1 << (7 - (column & 7))); - else - outPtr[column / 8] &= ~(1 << (7 - (column & 7))); - break; - } /* end switch(effbpp) */ - } /* end if effxbpp==16) */ - } /* end for column */ - } /* end for row */ - free (iconData); -} - -static HICON -NetWMToWinIconAlpha(uint32_t *icon) -{ - int width = icon[0]; - int height = icon[1]; - uint32_t *pixels = &icon[2]; - HICON result; - HDC hdc = GetDC(NULL); - uint32_t *DIB_pixels; - ICONINFO ii = {TRUE}; - BITMAPV4HEADER bmh = {sizeof(bmh)}; - - /* Define an ARGB pixel format used for Color+Alpha icons */ - bmh.bV4Width = width; - bmh.bV4Height = -height; /* Invert the image */ - bmh.bV4Planes = 1; - bmh.bV4BitCount = 32; - bmh.bV4V4Compression = BI_BITFIELDS; - bmh.bV4AlphaMask = 0xFF000000; - bmh.bV4RedMask = 0x00FF0000; - bmh.bV4GreenMask = 0x0000FF00; - bmh.bV4BlueMask = 0x000000FF; - - ii.hbmColor = CreateDIBSection(hdc, (BITMAPINFO*)&bmh, - DIB_RGB_COLORS, (void**)&DIB_pixels, NULL, 0); - ReleaseDC(NULL, hdc); - ii.hbmMask = CreateBitmap(width, height, 1, 1, NULL); - memcpy(DIB_pixels, pixels, height*width*4); - - /* CreateIconIndirect() traditionally required DDBitmaps */ - /* Systems from WinXP accept 32-bit ARGB DIBitmaps with full 8-bit alpha support */ - /* The icon is created with a DIB + empty DDB mask (an MS example does the same) */ - result = CreateIconIndirect(&ii); - - DeleteObject(ii.hbmColor); - DeleteObject(ii.hbmMask); - - winDebug("NetWMToWinIconAlpha - %d x %d = %p\n", icon[0], icon[1], result); - return result; -} - -static HICON -NetWMToWinIconThreshold(uint32_t *icon) -{ - int width = icon[0]; - int height = icon[1]; - uint32_t *pixels = &icon[2]; - int row, col; - HICON result; - ICONINFO ii = {TRUE}; - - HDC hdc = GetDC(NULL); - HDC xorDC = CreateCompatibleDC(hdc); - HDC andDC = CreateCompatibleDC(hdc); - ii.hbmColor = CreateCompatibleBitmap(hdc, width, height); - ii.hbmMask = CreateCompatibleBitmap(hdc, width, height); - ReleaseDC(NULL, hdc); - SelectObject(xorDC, ii.hbmColor); - SelectObject(andDC, ii.hbmMask); - - for (row = 0; row < height; row++) { - for (col = 0; col < width; col++) { - if ((*pixels & 0xFF000000) > 31<<24) { /* 31 alpha threshold, i.e. opaque above, transparent below */ - SetPixelV(xorDC, col, row, RGB(((char*)pixels)[2], ((char*)pixels)[1], - ((char*)pixels)[0])); - SetPixelV(andDC, col, row, RGB(0, 0, 0)); /* black mask */ - } - else { - SetPixelV(xorDC, col, row, RGB(0, 0, 0)); - SetPixelV(andDC, col, row, RGB(255, 255, 255)); /* white mask */ - } - pixels++; - } - } - DeleteDC(xorDC); - DeleteDC(andDC); - - result = CreateIconIndirect(&ii); - - DeleteObject(ii.hbmColor); - DeleteObject(ii.hbmMask ); - - winDebug("NetWMToWinIconThreshold - %d x %d = %p\n", icon[0], icon[1], result); - return result; -} - -static HICON -NetWMToWinIcon(int bpp, uint32_t *icon) -{ - static Bool hasIconAlphaChannel = FALSE; - static BOOL versionChecked = FALSE; - - if (!versionChecked) - { - OSVERSIONINFOEX osvi = {0}; - ULONGLONG dwlConditionMask = 0; - - osvi.dwOSVersionInfoSize = sizeof (osvi); - osvi.dwMajorVersion = 5; - osvi.dwMinorVersion = 1; - - /* Windows versions later than XP have icon alpha channel suport, 2000 does not */ - VER_SET_CONDITION(dwlConditionMask, VER_MAJORVERSION, VER_GREATER_EQUAL); - VER_SET_CONDITION(dwlConditionMask, VER_MINORVERSION, VER_GREATER_EQUAL); - hasIconAlphaChannel = VerifyVersionInfo(&osvi, VER_MAJORVERSION | VER_MINORVERSION, dwlConditionMask); - versionChecked = TRUE; - - ErrorF("OS has icon alpha channel support: %s\n", hasIconAlphaChannel ? "yes" : "no"); - } - - if (hasIconAlphaChannel && (bpp==32)) - return NetWMToWinIconAlpha(icon); - else - return NetWMToWinIconThreshold(icon); -} - -static pointer -GetWindowProp(WindowPtr pWin, Atom name, long int *size_return) -{ - struct _Window *pwin; - struct _Property *prop; - - if (!pWin || !name) { - ErrorF ("GetWindowProp - pWin or name was NULL\n"); - return 0; - } - pwin = (struct _Window*) pWin; - if (!pwin->optional) return NULL; - for (prop = (struct _Property *) pwin->optional->userProps; - prop; - prop=prop->next){ - if (prop->propertyName == name) { - *size_return=prop->size; - return prop->data; - } - } - return NULL; -} - -/* - * Attempt to create a custom icon from the WM_HINTS bitmaps - */ - -HICON -winXIconToHICON (WindowPtr pWin, int iconSize) -{ - unsigned char *mask, *image, *imageMask; - unsigned char *dst, *src; - PixmapPtr iconPtr; - PixmapPtr maskPtr; - int planes, bpp, effBPP, stride, maskStride, i; - int biggest_size = 0; - HDC hDC; - ICONINFO ii; - WinXWMHints hints; - HICON hIcon = NULL; - uint32_t *biggest_icon = NULL; - - /* Try to get _NET_WM_ICON icons first */ - static Atom _XA_NET_WM_ICON; - static int generation; - uint32_t *icon, *icon_data = NULL; - long int size=0; - - hDC = GetDC (GetDesktopWindow ()); - planes = GetDeviceCaps (hDC, PLANES); - bpp = GetDeviceCaps (hDC, BITSPIXEL); - ReleaseDC (GetDesktopWindow (), hDC); - - if (generation != serverGeneration) { - generation = serverGeneration; - _XA_NET_WM_ICON = MakeAtom("_NET_WM_ICON", 12, TRUE); - } - - if (_XA_NET_WM_ICON) icon_data = GetWindowProp(pWin, _XA_NET_WM_ICON, &size); - if (icon_data) - { - for(icon = icon_data; - icon < &icon_data[size] && *icon; - icon = &icon[icon[0]*icon[1]+2]) - { - if (icon[0]==iconSize && icon[1]==iconSize) - return NetWMToWinIcon(bpp, icon); - /* Find the biggest icon and let Windows scale the size */ - else if (biggest_size < icon[0]) - { - biggest_icon = icon; - biggest_size = icon[0]; - } - } - if (biggest_icon) - return NetWMToWinIcon(bpp, biggest_icon); - } - winDebug("winXIconToHICON - pWin %x: no suitable NetIcon\n",(int)pWin, iconSize); - - winMultiWindowGetWMHints (pWin, &hints); - if (!hints.icon_pixmap) return NULL; - - dixLookupResourceByType((pointer) &iconPtr, hints.icon_pixmap, RT_PIXMAP, - NullClient, DixUnknownAccess); - - if (!iconPtr) return NULL; - - /* 15 BPP is really 16BPP as far as we care */ - if (bpp == 15) - effBPP = 16; - else - effBPP = bpp; - - /* Need 16-bit aligned rows for DDBitmaps */ - stride = ((iconSize * effBPP + 15) & (~15)) / 8; - - /* Mask is 1-bit deep */ - maskStride = ((iconSize * 1 + 15) & (~15)) / 8; - - image = malloc (stride * iconSize); - imageMask = malloc (stride * iconSize); - /* Default to a completely black mask */ - mask = calloc (maskStride, iconSize); - - winScaleXBitmapToWindows (iconSize, effBPP, iconPtr, image); - dixLookupResourceByType((pointer) &maskPtr, hints.icon_mask, RT_PIXMAP, - NullClient, DixUnknownAccess); - - if (maskPtr) - { - winScaleXBitmapToWindows (iconSize, 1, maskPtr, mask); - - winScaleXBitmapToWindows (iconSize, effBPP, maskPtr, imageMask); - - /* Now we need to set all bits of the icon which are not masked */ - /* on to 0 because Color is really an XOR, not an OR function */ - dst = image; - src = imageMask; - - for (i = 0; i < (stride * iconSize); i++) - if ((*(src++))) - *(dst++) = 0; - else - dst++; - } - - ii.fIcon = TRUE; - ii.xHotspot = 0; /* ignored */ - ii.yHotspot = 0; /* ignored */ - - /* Create Win32 mask from pixmap shape */ - ii.hbmMask = CreateBitmap (iconSize, iconSize, planes, 1, mask); - - /* Create Win32 bitmap from pixmap */ - ii.hbmColor = CreateBitmap (iconSize, iconSize, planes, bpp, image); - - /* Merge Win32 mask and bitmap into icon */ - hIcon = CreateIconIndirect (&ii); - - /* Release Win32 mask and bitmap */ - DeleteObject (ii.hbmMask); - DeleteObject (ii.hbmColor); - - /* Free X mask and bitmap */ - free (mask); - free (image); - free (imageMask); - - return hIcon; -} - - - -/* - * Change the Windows window icon - */ - -#ifdef XWIN_MULTIWINDOW -void -winUpdateIcon (Window id) -{ - WindowPtr pWin; - HICON hIcon, hIconSmall=NULL, hIconOld; - - dixLookupResourceByType((pointer) &pWin, id, RT_WINDOW, NullClient, DixUnknownAccess); - if (pWin) - { - winWindowPriv(pWin); - if (pWinPriv->hWnd) { - hIcon = winOverrideIcon ((unsigned long)pWin); - if (!hIcon) { - hIcon = winXIconToHICON (pWin, GetSystemMetrics(SM_CXICON)); - if (!hIcon) { - hIcon = g_hIconX; - hIconSmall = g_hSmallIconX; - } else { - /* Leave undefined if not found */ - hIconSmall = winXIconToHICON (pWin, GetSystemMetrics(SM_CXSMICON)); - } - } - - /* Set the large icon */ - hIconOld = (HICON) SendMessage (pWinPriv->hWnd, - WM_SETICON, ICON_BIG, (LPARAM) hIcon); - - /* Delete the icon if its not the default */ - winDestroyIcon(hIconOld); - - /* Same for the small icon */ - hIconOld = (HICON) SendMessage (pWinPriv->hWnd, - WM_SETICON, ICON_SMALL, (LPARAM) hIconSmall); - winDestroyIcon(hIconOld); - } - } -} - -void winInitGlobalIcons (void) -{ - int sm_cx = GetSystemMetrics(SM_CXICON); - int sm_cxsm = GetSystemMetrics(SM_CXSMICON); - /* Load default X icon in case it's not ready yet */ - if (!g_hIconX) - { - g_hIconX = winOverrideDefaultIcon(sm_cx); - g_hSmallIconX = winOverrideDefaultIcon(sm_cxsm); - } - - if (!g_hIconX) - { - g_hIconX = (HICON)LoadImage (g_hInstance, - MAKEINTRESOURCE(IDI_XWIN), - IMAGE_ICON, - GetSystemMetrics(SM_CXICON), - GetSystemMetrics(SM_CYICON), - 0); - g_hSmallIconX = (HICON)LoadImage (g_hInstance, - MAKEINTRESOURCE(IDI_XWIN), - IMAGE_ICON, - GetSystemMetrics(SM_CXSMICON), - GetSystemMetrics(SM_CYSMICON), - LR_DEFAULTSIZE); - } -} - -void winSelectIcons(WindowPtr pWin, HICON *pIcon, HICON *pSmallIcon) -{ - HICON hIcon, hSmallIcon; - - winInitGlobalIcons(); - - /* Try and get the icon from WM_HINTS */ - hIcon = winXIconToHICON (pWin, GetSystemMetrics(SM_CXICON)); - hSmallIcon = winXIconToHICON (pWin, GetSystemMetrics(SM_CXSMICON)); - - /* If we got the small, but not the large one swap them */ - if (!hIcon && hSmallIcon) - { - hIcon = hSmallIcon; - hSmallIcon = NULL; - } - - /* Use default X icon if no icon loaded from WM_HINTS */ - if (!hIcon) { - hIcon = g_hIconX; - hSmallIcon = g_hSmallIconX; - } - - if (pIcon) - *pIcon = hIcon; - else - winDestroyIcon(hIcon); - - if (pSmallIcon) - *pSmallIcon = hSmallIcon; - else - winDestroyIcon(hSmallIcon); -} - -void winDestroyIcon(HICON hIcon) -{ - /* Delete the icon if its not one of the application defaults or an override */ - if (hIcon && - hIcon != g_hIconX && - hIcon != g_hSmallIconX && - !winIconIsOverride((unsigned long)hIcon)) - DestroyIcon (hIcon); -} -#endif +/*
+ *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
+ *
+ *Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ *"Software"), to deal in the Software without restriction, including
+ *without limitation the rights to use, copy, modify, merge, publish,
+ *distribute, sublicense, and/or sell copies of the Software, and to
+ *permit persons to whom the Software is furnished to do so, subject to
+ *the following conditions:
+ *
+ *The above copyright notice and this permission notice shall be
+ *included in all copies or substantial portions of the Software.
+ *
+ *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
+ *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+ *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Earle F. Philhower, III
+ */
+
+#ifdef HAVE_XWIN_CONFIG_H
+#include <xwin-config.h>
+#endif
+#include "win.h"
+#include "dixevents.h"
+#include "winmultiwindowclass.h"
+#include "winprefs.h"
+
+#include "propertyst.h"
+#include "windowstr.h"
+
+
+/*
+ * Prototypes for local functions
+ */
+
+static void
+winScaleXBitmapToWindows (int iconSize, int effBPP,
+ PixmapPtr pixmap, unsigned char *image);
+
+
+/*
+ * Scale an X icon bitmap into a Windoze icon bitmap
+ */
+
+static void
+winScaleXBitmapToWindows (int iconSize,
+ int effBPP,
+ PixmapPtr pixmap,
+ unsigned char *image)
+{
+ int row, column, effXBPP, effXDepth;
+ unsigned char *outPtr;
+ char *iconData = 0;
+ int stride, xStride;
+ float factX, factY;
+ int posX, posY;
+ unsigned char *ptr;
+ unsigned int zero;
+ unsigned int color;
+
+ effXBPP = BitsPerPixel(pixmap->drawable.depth);
+ effXDepth = pixmap->drawable.depth;
+
+ if (pixmap->drawable.bitsPerPixel == 15)
+ effXBPP = 16;
+
+ if (pixmap->drawable.depth == 15)
+ effXDepth = 16;
+
+ /* Need 16-bit aligned rows for DDBitmaps */
+ stride = ((iconSize * effBPP + 15) & (~15)) / 8;
+ xStride = PixmapBytePad (pixmap->drawable.width, pixmap->drawable.depth);
+ if (stride == 0 || xStride == 0)
+ {
+ ErrorF ("winScaleXBitmapToWindows - stride or xStride is zero. "
+ "Bailing.\n");
+ return;
+ }
+
+ /* Allocate memory for icon data */
+ iconData = malloc (xStride * pixmap->drawable.height);
+ if (!iconData)
+ {
+ ErrorF ("winScaleXBitmapToWindows - malloc failed for iconData. "
+ "Bailing.\n");
+ return;
+ }
+
+ /* Get icon data */
+ miGetImage ((DrawablePtr) &(pixmap->drawable), 0, 0,
+ pixmap->drawable.width, pixmap->drawable.height,
+ ZPixmap, 0xffffffff, iconData);
+
+ /* Keep aspect ratio */
+ factX = ((float)pixmap->drawable.width) / ((float)iconSize);
+ factY = ((float)pixmap->drawable.height) / ((float)iconSize);
+ if (factX > factY)
+ factY = factX;
+ else
+ factX = factY;
+
+ /* Out-of-bounds, fill icon with zero */
+ zero = 0;
+
+ for (row = 0; row < iconSize; row++)
+ {
+ outPtr = image + stride * row;
+ for (column = 0; column < iconSize; column++)
+ {
+ posX = factX * column;
+ posY = factY * row;
+
+ ptr = (unsigned char*) iconData + posY*xStride;
+ if (effXBPP == 1)
+ {
+ ptr += posX / 8;
+
+ /* Out of X icon bounds, leave space blank */
+ if (posX >= pixmap->drawable.width
+ || posY >= pixmap->drawable.height)
+ ptr = (unsigned char *) &zero;
+
+ if ((*ptr) & (1 << (posX & 7)))
+ switch (effBPP)
+ {
+ case 32:
+ *(outPtr++) = 0;
+ case 24:
+ *(outPtr++) = 0;
+ case 16:
+ *(outPtr++) = 0;
+ case 8:
+ *(outPtr++) = 0;
+ break;
+ case 1:
+ outPtr[column / 8] &= ~(1 << (7 - (column & 7)));
+ break;
+ }
+ else
+ switch (effBPP)
+ {
+ case 32:
+ *(outPtr++) = 255;
+ *(outPtr++) = 255;
+ *(outPtr++) = 255;
+ *(outPtr++) = 0;
+ break;
+ case 24:
+ *(outPtr++) = 255;
+ case 16:
+ *(outPtr++) = 255;
+ case 8:
+ *(outPtr++) = 255;
+ break;
+ case 1:
+ outPtr[column / 8] |= (1 << (7 - (column & 7)));
+ break;
+ }
+ }
+ else if (effXDepth == 24 || effXDepth == 32)
+ {
+ ptr += posX * (effXBPP / 8);
+
+ /* Out of X icon bounds, leave space blank */
+ if (posX >= pixmap->drawable.width
+ || posY >= pixmap->drawable.height)
+ ptr = (unsigned char *) &zero;
+ color = (((*ptr) << 16)
+ + ((*(ptr + 1)) << 8)
+ + ((*(ptr + 2)) << 0));
+ switch (effBPP)
+ {
+ case 32:
+ *(outPtr++) = *(ptr++); /* b */
+ *(outPtr++) = *(ptr++); /* g */
+ *(outPtr++) = *(ptr++); /* r */
+ *(outPtr++) = (effXDepth == 32) ? *(ptr++) : 0x0; /* alpha */
+ break;
+ case 24:
+ *(outPtr++) = *(ptr++);
+ *(outPtr++) = *(ptr++);
+ *(outPtr++) = *(ptr++);
+ break;
+ case 16:
+ color = ((((*ptr) >> 2) << 10)
+ + (((*(ptr + 1)) >> 2) << 5)
+ + (((*(ptr + 2)) >> 2)));
+ *(outPtr++) = (color >> 8);
+ *(outPtr++) = (color & 255);
+ break;
+ case 8:
+ color = (((*ptr))) + (((*(ptr + 1)))) + (((*(ptr + 2))));
+ color /= 3;
+ *(outPtr++) = color;
+ break;
+ case 1:
+ if (color)
+ outPtr[column / 8] |= (1 << (7 - (column & 7)));
+ else
+ outPtr[column / 8] &= ~(1 << (7 - (column & 7)));
+ }
+ }
+ else if (effXDepth == 16)
+ {
+ ptr += posX * (effXBPP / 8);
+
+ /* Out of X icon bounds, leave space blank */
+ if (posX >= pixmap->drawable.width
+ || posY >= pixmap->drawable.height)
+ ptr = (unsigned char *) &zero;
+ color = ((*ptr) << 8) + (*(ptr + 1));
+ switch (effBPP)
+ {
+ case 32:
+ *(outPtr++) = (color & 31) << 2;
+ *(outPtr++) = ((color >> 5) & 31) << 2;
+ *(outPtr++) = ((color >> 10) & 31) << 2;
+ *(outPtr++) = 0; /* resvd */
+ break;
+ case 24:
+ *(outPtr++) = (color & 31) << 2;
+ *(outPtr++) = ((color >> 5) & 31) << 2;
+ *(outPtr++) = ((color >> 10) & 31) << 2;
+ break;
+ case 16:
+ *(outPtr++) = *(ptr++);
+ *(outPtr++) = *(ptr++);
+ break;
+ case 8:
+ *(outPtr++) = (((color & 31)
+ + ((color >> 5) & 31)
+ + ((color >> 10) & 31)) / 3) << 2;
+ break;
+ case 1:
+ if (color)
+ outPtr[column / 8] |= (1 << (7 - (column & 7)));
+ else
+ outPtr[column / 8] &= ~(1 << (7 - (column & 7)));
+ break;
+ } /* end switch(effbpp) */
+ } /* end if effxbpp==16) */
+ } /* end for column */
+ } /* end for row */
+ free (iconData);
+}
+
+static HICON
+NetWMToWinIconAlpha(uint32_t *icon)
+{
+ int width = icon[0];
+ int height = icon[1];
+ uint32_t *pixels = &icon[2];
+ HICON result;
+ HDC hdc = GetDC(NULL);
+ uint32_t *DIB_pixels;
+ ICONINFO ii;
+ BITMAPV5HEADER bmh;
+
+ /* Define an ARGB pixel format used for Color+Alpha icons */
+ ZeroMemory(&bmh,sizeof(bmh));
+ bmh.bV5Size = sizeof(bmh);
+ bmh.bV5Width = width;
+ bmh.bV5Height = -height; /* Invert the image */
+ bmh.bV5Planes = 1;
+ bmh.bV5BitCount = 32;
+ bmh.bV5Compression = BI_BITFIELDS;
+ bmh.bV5AlphaMask = 0xFF000000;
+ bmh.bV5RedMask = 0x00FF0000;
+ bmh.bV5GreenMask = 0x0000FF00;
+ bmh.bV5BlueMask = 0x000000FF;
+
+ ii.hbmColor = CreateDIBSection(hdc, (BITMAPINFO*)&bmh,
+ DIB_RGB_COLORS, (void**)&DIB_pixels, NULL, 0);
+ ReleaseDC(NULL, hdc);
+ ii.hbmMask = CreateBitmap(width, height, 1, 1, NULL);
+ memcpy(DIB_pixels, pixels, height*width*4);
+
+ /* CreateIconIndirect() traditionally required DDBitmaps */
+ /* Systems from WinXP accept 32-bit ARGB DIBitmaps with full 8-bit alpha support */
+ /* The icon is created with a DIB + empty DDB mask (an MS example does the same) */
+ ii.fIcon = TRUE;
+ ii.xHotspot = 0;
+ ii.yHotspot = 0;
+ result = CreateIconIndirect(&ii);
+
+ DeleteObject(ii.hbmColor);
+ DeleteObject(ii.hbmMask);
+
+ winDebug("NetWMToWinIconAlpha - %d x %d = %p\n", icon[0], icon[1], result);
+ return result;
+}
+
+static HICON
+NetWMToWinIconThreshold(uint32_t *icon)
+{
+ int width = icon[0];
+ int height = icon[1];
+ uint32_t *pixels = &icon[2];
+ int row, col;
+ HICON result;
+ ICONINFO ii;
+
+ HDC hdc = GetDC(NULL);
+ HDC xorDC = CreateCompatibleDC(hdc);
+ HDC andDC = CreateCompatibleDC(hdc);
+ ii.hbmColor = CreateCompatibleBitmap(hdc, width, height);
+ ii.hbmMask = CreateCompatibleBitmap(hdc, width, height);
+ ReleaseDC(NULL, hdc);
+ SelectObject(xorDC, ii.hbmColor);
+ SelectObject(andDC, ii.hbmMask);
+
+ for (row = 0; row < height; row++) {
+ for (col = 0; col < width; col++) {
+ if ((*pixels & 0xFF000000) > 31<<24) { /* 31 alpha threshold, i.e. opaque above, transparent below */
+ SetPixelV(xorDC, col, row, RGB(((char*)pixels)[2], ((char*)pixels)[1],
+ ((char*)pixels)[0]));
+ SetPixelV(andDC, col, row, RGB(0, 0, 0)); /* black mask */
+ }
+ else {
+ SetPixelV(xorDC, col, row, RGB(0, 0, 0));
+ SetPixelV(andDC, col, row, RGB(255, 255, 255)); /* white mask */
+ }
+ pixels++;
+ }
+ }
+ DeleteDC(xorDC);
+ DeleteDC(andDC);
+
+ ii.fIcon = TRUE;
+ ii.xHotspot = 0;
+ ii.yHotspot = 0;
+ result = CreateIconIndirect(&ii);
+
+ DeleteObject(ii.hbmColor);
+ DeleteObject(ii.hbmMask );
+
+ winDebug("NetWMToWinIconThreshold - %d x %d = %p\n", icon[0], icon[1], result);
+ return result;
+}
+
+static HICON
+NetWMToWinIcon(int bpp, uint32_t *icon)
+{
+ static Bool hasIconAlphaChannel = FALSE;
+ static BOOL versionChecked = FALSE;
+
+ if (!versionChecked)
+ {
+ OSVERSIONINFOEX osvi = {0};
+ ULONGLONG dwlConditionMask = 0;
+
+ osvi.dwOSVersionInfoSize = sizeof (osvi);
+ osvi.dwMajorVersion = 5;
+ osvi.dwMinorVersion = 1;
+
+ /* Windows versions later than XP have icon alpha channel suport, 2000 does not */
+ VER_SET_CONDITION(dwlConditionMask, VER_MAJORVERSION, VER_GREATER_EQUAL);
+ VER_SET_CONDITION(dwlConditionMask, VER_MINORVERSION, VER_GREATER_EQUAL);
+ hasIconAlphaChannel = VerifyVersionInfo(&osvi, VER_MAJORVERSION | VER_MINORVERSION, dwlConditionMask);
+ versionChecked = TRUE;
+
+ winDebug("OS has icon alpha channel support: %s\n", hasIconAlphaChannel ? "yes" : "no");
+ }
+
+ if (hasIconAlphaChannel && (bpp==32))
+ return NetWMToWinIconAlpha(icon);
+ else
+ return NetWMToWinIconThreshold(icon);
+}
+
+static pointer
+GetWindowProp(WindowPtr pWin, Atom name, long int *size_return)
+{
+ struct _Window *pwin;
+ struct _Property *prop;
+
+ if (!pWin || !name) {
+ ErrorF ("GetWindowProp - pWin or name was NULL\n");
+ return 0;
+ }
+ pwin = (struct _Window*) pWin;
+ if (!pwin->optional) return NULL;
+ for (prop = (struct _Property *) pwin->optional->userProps;
+ prop;
+ prop=prop->next){
+ if (prop->propertyName == name) {
+ *size_return=prop->size;
+ return prop->data;
+ }
+ }
+ return NULL;
+}
+
+/*
+ * Attempt to create a custom icon from the WM_HINTS bitmaps
+ */
+
+HICON
+winXIconToHICON (WindowPtr pWin, int iconSize)
+{
+ unsigned char *mask, *image, *imageMask;
+ unsigned char *dst, *src;
+ PixmapPtr iconPtr;
+ PixmapPtr maskPtr;
+ int planes, bpp, effBPP, stride, maskStride, i;
+ int biggest_size = 0;
+ HDC hDC;
+ ICONINFO ii;
+ WinXWMHints hints;
+ HICON hIcon = NULL;
+ uint32_t *biggest_icon = NULL;
+
+ /* Try to get _NET_WM_ICON icons first */
+ static Atom _XA_NET_WM_ICON;
+ static int generation;
+ uint32_t *icon, *icon_data = NULL;
+ long int size=0;
+
+ hDC = GetDC (GetDesktopWindow ());
+ planes = GetDeviceCaps (hDC, PLANES);
+ bpp = GetDeviceCaps (hDC, BITSPIXEL);
+ ReleaseDC (GetDesktopWindow (), hDC);
+
+ if (generation != serverGeneration) {
+ generation = serverGeneration;
+ _XA_NET_WM_ICON = MakeAtom("_NET_WM_ICON", 12, TRUE);
+ }
+
+ if (_XA_NET_WM_ICON) icon_data = GetWindowProp(pWin, _XA_NET_WM_ICON, &size);
+ if (icon_data)
+ {
+ for(icon = icon_data;
+ icon < &icon_data[size] && *icon;
+ icon = &icon[icon[0]*icon[1]+2])
+ {
+ if (icon[0]==iconSize && icon[1]==iconSize)
+ return NetWMToWinIcon(bpp, icon);
+ /* Find the biggest icon and let Windows scale the size */
+ else if (biggest_size < icon[0])
+ {
+ biggest_icon = icon;
+ biggest_size = icon[0];
+ }
+ }
+ if (biggest_icon)
+ return NetWMToWinIcon(bpp, biggest_icon);
+ }
+ winDebug("winXIconToHICON - pWin %x: no suitable NetIcon\n",(int)pWin, iconSize);
+
+ winMultiWindowGetWMHints (pWin, &hints);
+ if (!hints.icon_pixmap) return NULL;
+
+ dixLookupResourceByType((pointer) &iconPtr, hints.icon_pixmap, RT_PIXMAP,
+ NullClient, DixUnknownAccess);
+
+ if (!iconPtr) return NULL;
+
+ /* 15 BPP is really 16BPP as far as we care */
+ if (bpp == 15)
+ effBPP = 16;
+ else
+ effBPP = bpp;
+
+ /* Need 16-bit aligned rows for DDBitmaps */
+ stride = ((iconSize * effBPP + 15) & (~15)) / 8;
+
+ /* Mask is 1-bit deep */
+ maskStride = ((iconSize * 1 + 15) & (~15)) / 8;
+
+ image = malloc (stride * iconSize);
+ imageMask = malloc (stride * iconSize);
+ /* Default to a completely black mask */
+ mask = calloc (maskStride, iconSize);
+
+ winScaleXBitmapToWindows (iconSize, effBPP, iconPtr, image);
+ dixLookupResourceByType((pointer) &maskPtr, hints.icon_mask, RT_PIXMAP,
+ NullClient, DixUnknownAccess);
+
+ if (maskPtr)
+ {
+ winScaleXBitmapToWindows (iconSize, 1, maskPtr, mask);
+
+ winScaleXBitmapToWindows (iconSize, effBPP, maskPtr, imageMask);
+
+ /* Now we need to set all bits of the icon which are not masked */
+ /* on to 0 because Color is really an XOR, not an OR function */
+ dst = image;
+ src = imageMask;
+
+ for (i = 0; i < (stride * iconSize); i++)
+ if ((*(src++)))
+ *(dst++) = 0;
+ else
+ dst++;
+ }
+
+ ii.fIcon = TRUE;
+ ii.xHotspot = 0; /* ignored */
+ ii.yHotspot = 0; /* ignored */
+
+ /* Create Win32 mask from pixmap shape */
+ ii.hbmMask = CreateBitmap (iconSize, iconSize, planes, 1, mask);
+
+ /* Create Win32 bitmap from pixmap */
+ ii.hbmColor = CreateBitmap (iconSize, iconSize, planes, bpp, image);
+
+ /* Merge Win32 mask and bitmap into icon */
+ hIcon = CreateIconIndirect (&ii);
+
+ /* Release Win32 mask and bitmap */
+ DeleteObject (ii.hbmMask);
+ DeleteObject (ii.hbmColor);
+
+ /* Free X mask and bitmap */
+ free (mask);
+ free (image);
+ free (imageMask);
+
+ return hIcon;
+}
+
+
+
+/*
+ * Change the Windows window icon
+ */
+
+#ifdef XWIN_MULTIWINDOW
+void
+winUpdateIcon (Window id)
+{
+ WindowPtr pWin;
+ HICON hIcon, hIconSmall=NULL, hIconOld;
+
+ dixLookupResourceByType((pointer) &pWin, id, RT_WINDOW, NullClient, DixUnknownAccess);
+ if (pWin)
+ {
+ winWindowPriv(pWin);
+ if (pWinPriv->hWnd) {
+ hIcon = winOverrideIcon ((unsigned long)pWin);
+ if (!hIcon) {
+ hIcon = winXIconToHICON (pWin, GetSystemMetrics(SM_CXICON));
+ if (!hIcon) {
+ hIcon = g_hIconX;
+ hIconSmall = g_hSmallIconX;
+ } else {
+ /* Leave undefined if not found */
+ hIconSmall = winXIconToHICON (pWin, GetSystemMetrics(SM_CXSMICON));
+ }
+ }
+
+ /* Set the large icon */
+ hIconOld = (HICON) SendMessage (pWinPriv->hWnd,
+ WM_SETICON, ICON_BIG, (LPARAM) hIcon);
+
+ /* Delete the icon if its not the default */
+ winDestroyIcon(hIconOld);
+
+ /* Same for the small icon */
+ hIconOld = (HICON) SendMessage (pWinPriv->hWnd,
+ WM_SETICON, ICON_SMALL, (LPARAM) hIconSmall);
+ winDestroyIcon(hIconOld);
+ }
+ }
+}
+
+void winInitGlobalIcons (void)
+{
+ int sm_cx = GetSystemMetrics(SM_CXICON);
+ int sm_cxsm = GetSystemMetrics(SM_CXSMICON);
+ /* Load default X icon in case it's not ready yet */
+ if (!g_hIconX)
+ {
+ g_hIconX = winOverrideDefaultIcon(sm_cx);
+ g_hSmallIconX = winOverrideDefaultIcon(sm_cxsm);
+ }
+
+ if (!g_hIconX)
+ {
+ g_hIconX = (HICON)LoadImage (g_hInstance,
+ MAKEINTRESOURCE(IDI_XWIN),
+ IMAGE_ICON,
+ GetSystemMetrics(SM_CXICON),
+ GetSystemMetrics(SM_CYICON),
+ 0);
+ g_hSmallIconX = (HICON)LoadImage (g_hInstance,
+ MAKEINTRESOURCE(IDI_XWIN),
+ IMAGE_ICON,
+ GetSystemMetrics(SM_CXSMICON),
+ GetSystemMetrics(SM_CYSMICON),
+ LR_DEFAULTSIZE);
+ }
+}
+
+void winSelectIcons(WindowPtr pWin, HICON *pIcon, HICON *pSmallIcon)
+{
+ HICON hIcon, hSmallIcon;
+
+ winInitGlobalIcons();
+
+ /* Try and get the icon from WM_HINTS */
+ hIcon = winXIconToHICON (pWin, GetSystemMetrics(SM_CXICON));
+ hSmallIcon = winXIconToHICON (pWin, GetSystemMetrics(SM_CXSMICON));
+
+ /* If we got the small, but not the large one swap them */
+ if (!hIcon && hSmallIcon)
+ {
+ hIcon = hSmallIcon;
+ hSmallIcon = NULL;
+ }
+
+ /* Use default X icon if no icon loaded from WM_HINTS */
+ if (!hIcon) {
+ hIcon = g_hIconX;
+ hSmallIcon = g_hSmallIconX;
+ }
+
+ if (pIcon)
+ *pIcon = hIcon;
+ else
+ winDestroyIcon(hIcon);
+
+ if (pSmallIcon)
+ *pSmallIcon = hSmallIcon;
+ else
+ winDestroyIcon(hSmallIcon);
+}
+
+void winDestroyIcon(HICON hIcon)
+{
+ /* Delete the icon if its not one of the application defaults or an override */
+ if (hIcon &&
+ hIcon != g_hIconX &&
+ hIcon != g_hSmallIconX &&
+ !winIconIsOverride((unsigned long)hIcon))
+ DestroyIcon (hIcon);
+}
+#endif
diff --git a/xorg-server/hw/xwin/winmultiwindowshape.c b/xorg-server/hw/xwin/winmultiwindowshape.c index b622db95a..9219bb708 100644 --- a/xorg-server/hw/xwin/winmultiwindowshape.c +++ b/xorg-server/hw/xwin/winmultiwindowshape.c @@ -46,9 +46,7 @@ winSetShapeMultiWindow (WindowPtr pWin, int kind) ScreenPtr pScreen = pWin->drawable.pScreen;
winScreenPriv(pScreen);
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winSetShapeMultiWindow - pWin: %08x kind: %i\n", pWin, kind);
-#endif
+ winDebug ("winSetShapeMultiWindow - pWin: %08x kind: %i\n", pWin, kind);
WIN_UNWRAP(SetShape);
(*pScreen->SetShape)(pWin, kind);
@@ -90,9 +88,7 @@ winReshapeMultiWindow (WindowPtr pWin) HRGN hRgn, hRgnRect;
winWindowPriv(pWin);
-#if CYGDEBUG
winDebug ("winReshape ()\n");
-#endif
/* Bail if the window is the root window */
if (pWin->parent == NULL)
@@ -206,3 +202,14 @@ winReshapeMultiWindow (WindowPtr pWin) return;
}
+
+void
+winShapeRgnUpdateMultiwindow(HWND hwnd)
+{
+ WindowPtr pWin = GetProp (hwnd, WIN_WINDOW_PROP);
+ if (pWin)
+ {
+ winReshapeMultiWindow(pWin);
+ winUpdateRgnMultiWindow(pWin);
+ }
+}
diff --git a/xorg-server/hw/xwin/winmultiwindowwindow.c b/xorg-server/hw/xwin/winmultiwindowwindow.c index 21b818b89..ceb8dff04 100644 --- a/xorg-server/hw/xwin/winmultiwindowwindow.c +++ b/xorg-server/hw/xwin/winmultiwindowwindow.c @@ -1,1008 +1,1008 @@ -/* - *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved. - *Copyright (C) Colin Harrison 2005-2008 - * - *Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - *"Software"), to deal in the Software without restriction, including - *without limitation the rights to use, copy, modify, merge, publish, - *distribute, sublicense, and/or sell copies of the Software, and to - *permit persons to whom the Software is furnished to do so, subject to - *the following conditions: - * - *The above copyright notice and this permission notice shall be - *included in all copies or substantial portions of the Software. - * - *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR - *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - *Except as contained in this notice, the name of the XFree86 Project - *shall not be used in advertising or otherwise to promote the sale, use - *or other dealings in this Software without prior written authorization - *from the XFree86 Project. - * - * Authors: Kensuke Matsuzaki - * Earle F. Philhower, III - * Harold L Hunt II - * Colin Harrison - */ - -#ifdef HAVE_XWIN_CONFIG_H -#include <xwin-config.h> -#endif -#include "win.h" -#include "dixevents.h" -#include "winmultiwindowclass.h" - -/* - * Prototypes for local functions - */ - -void -winCreateWindowsWindow (WindowPtr pWin); - -static void -winDestroyWindowsWindow (WindowPtr pWin); - -static void -winUpdateWindowsWindow (WindowPtr pWin); - -static void -winFindWindow (pointer value, XID id, pointer cdata); - -static -void winInitMultiWindowClass(void) -{ - static wATOM atomXWinClass=0; - WNDCLASSEX wcx; - - if (atomXWinClass==0) - { - /* Setup our window class */ - wcx.cbSize=sizeof(WNDCLASSEX); - wcx.style = CS_HREDRAW | CS_VREDRAW | (g_fNativeGl ? CS_OWNDC : 0); - wcx.lpfnWndProc = winTopLevelWindowProc; - wcx.cbClsExtra = 0; - wcx.cbWndExtra = 0; - wcx.hInstance = g_hInstance; - wcx.hIcon = g_hIconX; - wcx.hCursor = 0; - wcx.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH); - wcx.lpszMenuName = NULL; - wcx.lpszClassName = WINDOW_CLASS_X; - wcx.hIconSm = g_hSmallIconX; - -#if CYGMULTIWINDOW_DEBUG - ErrorF ("winCreateWindowsWindow - Creating class: %s\n", WINDOW_CLASS_X); -#endif - - atomXWinClass = RegisterClassEx (&wcx); - } -} - -/* - * CreateWindow - See Porting Layer Definition - p. 37 - */ - -Bool -winCreateWindowMultiWindow (WindowPtr pWin) -{ - Bool fResult = TRUE; - ScreenPtr pScreen = pWin->drawable.pScreen; - winWindowPriv(pWin); - winScreenPriv(pScreen); - -#if CYGMULTIWINDOW_DEBUG - winTrace ("winCreateWindowMultiWindow - pWin: %p\n", pWin); -#endif - - WIN_UNWRAP(CreateWindow); - fResult = (*pScreen->CreateWindow) (pWin); - WIN_WRAP(CreateWindow, winCreateWindowMultiWindow); - - /* Initialize some privates values */ - pWinPriv->hRgn = NULL; - pWinPriv->hWnd = NULL; - pWinPriv->pScreenPriv = winGetScreenPriv(pWin->drawable.pScreen); - pWinPriv->fXKilled = FALSE; - - return fResult; -} - - -/* - * DestroyWindow - See Porting Layer Definition - p. 37 - */ - -Bool -winDestroyWindowMultiWindow (WindowPtr pWin) -{ - Bool fResult = TRUE; - ScreenPtr pScreen = pWin->drawable.pScreen; - winWindowPriv(pWin); - winScreenPriv(pScreen); - -#if CYGMULTIWINDOW_DEBUG - ErrorF ("winDestroyWindowMultiWindow - pWin: %p\n", pWin); -#endif - - WIN_UNWRAP(DestroyWindow); - fResult = (*pScreen->DestroyWindow)(pWin); - WIN_WRAP(DestroyWindow, winDestroyWindowMultiWindow); - - /* Flag that the window has been destroyed */ - pWinPriv->fXKilled = TRUE; - - /* Kill the MS Windows window associated with this window */ - winDestroyWindowsWindow (pWin); - - return fResult; -} - - -/* - * PositionWindow - See Porting Layer Definition - p. 37 - * - * This function adjusts the position and size of Windows window - * with respect to the underlying X window. This is the inverse - * of winAdjustXWindow, which adjusts X window to Windows window. - */ - -Bool -winPositionWindowMultiWindow (WindowPtr pWin, int x, int y) -{ - Bool fResult = TRUE; - int iX, iY, iWidth, iHeight; - ScreenPtr pScreen = pWin->drawable.pScreen; - winWindowPriv(pWin); - winScreenPriv(pScreen); - - HWND hWnd = pWinPriv->hWnd; - RECT rcNew; - RECT rcOld; -#if CYGMULTIWINDOW_DEBUG - RECT rcClient; - RECT *lpRc; -#endif - DWORD dwExStyle; - DWORD dwStyle; - -#if CYGMULTIWINDOW_DEBUG - winTrace ("winPositionWindowMultiWindow - pWin: %p\n", pWin); -#endif - - WIN_UNWRAP(PositionWindow); - fResult = (*pScreen->PositionWindow)(pWin, x, y); - WIN_WRAP(PositionWindow, winPositionWindowMultiWindow); - -#if CYGWINDOWING_DEBUG - ErrorF ("winPositionWindowMultiWindow: (x, y) = (%d, %d)\n", - x, y); -#endif - - /* Bail out if the Windows window handle is bad */ - if (!hWnd) - { -#if CYGWINDOWING_DEBUG - ErrorF ("\timmediately return since hWnd is NULL\n"); -#endif - return fResult; - } - - /* Get the Windows window style and extended style */ - dwExStyle = GetWindowLongPtr (hWnd, GWL_EXSTYLE); - dwStyle = GetWindowLongPtr (hWnd, GWL_STYLE); - - /* Get the X and Y location of the X window */ - iX = pWin->drawable.x + GetSystemMetrics (SM_XVIRTUALSCREEN); - iY = pWin->drawable.y + GetSystemMetrics (SM_YVIRTUALSCREEN); - - /* Get the height and width of the X window */ - iWidth = pWin->drawable.width; - iHeight = pWin->drawable.height; - - /* Store the origin, height, and width in a rectangle structure */ - SetRect (&rcNew, iX, iY, iX + iWidth, iY + iHeight); - -#if CYGMULTIWINDOW_DEBUG - lpRc = &rcNew; - ErrorF ("winPositionWindowMultiWindow - (%d ms)drawable (%d, %d)-(%d, %d)\n", - GetTickCount (), lpRc->left, lpRc->top, lpRc->right, lpRc->bottom); -#endif - - /* - * Calculate the required size of the Windows window rectangle, - * given the size of the Windows window client area. - */ - AdjustWindowRectEx (&rcNew, dwStyle, FALSE, dwExStyle); - - /* Get a rectangle describing the old Windows window */ - GetWindowRect (hWnd, &rcOld); - -#if CYGMULTIWINDOW_DEBUG - /* Get a rectangle describing the Windows window client area */ - GetClientRect (hWnd, &rcClient); - - lpRc = &rcNew; - ErrorF ("winPositionWindowMultiWindow - (%d ms)rcNew (%d, %d)-(%d, %d)\n", - GetTickCount (), lpRc->left, lpRc->top, lpRc->right, lpRc->bottom); - - lpRc = &rcOld; - ErrorF ("winPositionWindowMultiWindow - (%d ms)rcOld (%d, %d)-(%d, %d)\n", - GetTickCount (), lpRc->left, lpRc->top, lpRc->right, lpRc->bottom); - - lpRc = &rcClient; - ErrorF ("(%d ms)rcClient (%d, %d)-(%d, %d)\n", - GetTickCount (), lpRc->left, lpRc->top, lpRc->right, lpRc->bottom); -#endif - - /* Check if the old rectangle and new rectangle are the same */ - if (!EqualRect (&rcNew, &rcOld)) - { -#if CYGMULTIWINDOW_DEBUG - ErrorF ("winPositionWindowMultiWindow - Need to move\n"); -#endif - -#if CYGWINDOWING_DEBUG - ErrorF ("\tMoveWindow to (%ld, %ld) - %ldx%ld\n", rcNew.left, rcNew.top, - rcNew.right - rcNew.left, rcNew.bottom - rcNew.top); -#endif - /* Change the position and dimensions of the Windows window */ - MoveWindow (hWnd, - rcNew.left, rcNew.top, - rcNew.right - rcNew.left, rcNew.bottom - rcNew.top, - TRUE); - } - else - { -#if CYGMULTIWINDOW_DEBUG - ErrorF ("winPositionWindowMultiWindow - Not need to move\n"); -#endif - } - - return fResult; -} - - -/* - * ChangeWindowAttributes - See Porting Layer Definition - p. 37 - */ - -Bool -winChangeWindowAttributesMultiWindow (WindowPtr pWin, unsigned long mask) -{ - Bool fResult = TRUE; - ScreenPtr pScreen = pWin->drawable.pScreen; - winScreenPriv(pScreen); - -#if CYGMULTIWINDOW_DEBUG - ErrorF ("winChangeWindowAttributesMultiWindow - pWin: %08x\n", pWin); -#endif - - WIN_UNWRAP(ChangeWindowAttributes); - fResult = (*pScreen->ChangeWindowAttributes)(pWin, mask); - WIN_WRAP(ChangeWindowAttributes, winChangeWindowAttributesMultiWindow); - - /* - * NOTE: We do not currently need to do anything here. - */ - - return fResult; -} - - -/* - * UnmapWindow - See Porting Layer Definition - p. 37 - * Also referred to as UnrealizeWindow - */ - -Bool -winUnmapWindowMultiWindow (WindowPtr pWin) -{ - Bool fResult = TRUE; - ScreenPtr pScreen = pWin->drawable.pScreen; - winWindowPriv(pWin); - winScreenPriv(pScreen); - -#if CYGMULTIWINDOW_DEBUG - ErrorF ("winUnmapWindowMultiWindow - pWin: %08x\n", pWin); -#endif - - WIN_UNWRAP(UnrealizeWindow); - fResult = (*pScreen->UnrealizeWindow)(pWin); - WIN_WRAP(UnrealizeWindow, winUnmapWindowMultiWindow); - - /* Flag that the window has been killed */ - pWinPriv->fXKilled = TRUE; - - /* Destroy the Windows window associated with this X window */ - winDestroyWindowsWindow (pWin); - - return fResult; -} - - -/* - * MapWindow - See Porting Layer Definition - p. 37 - * Also referred to as RealizeWindow - */ - -Bool -winMapWindowMultiWindow (WindowPtr pWin) -{ - Bool fResult = TRUE; - ScreenPtr pScreen = pWin->drawable.pScreen; - winWindowPriv(pWin); - winScreenPriv(pScreen); - -#if CYGMULTIWINDOW_DEBUG - ErrorF ("winMapWindowMultiWindow - pWin: %08x\n", pWin); -#endif - - WIN_UNWRAP(RealizeWindow); - fResult = (*pScreen->RealizeWindow)(pWin); - WIN_WRAP(RealizeWindow, winMapWindowMultiWindow); - - /* Flag that this window has not been destroyed */ - pWinPriv->fXKilled = FALSE; - - /* Refresh/redisplay the Windows window associated with this X window */ - winUpdateWindowsWindow (pWin); - - /* Update the Windows window's shape */ - winReshapeMultiWindow (pWin); - winUpdateRgnMultiWindow (pWin); - - return fResult; -} - - -/* - * ReparentWindow - See Porting Layer Definition - p. 42 - */ - -void -winReparentWindowMultiWindow (WindowPtr pWin, WindowPtr pPriorParent) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - winScreenPriv(pScreen); - -#if CYGMULTIWINDOW_DEBUG - ErrorF ("winReparentMultiWindow - pWin: %08x\n", pWin); -#endif - - WIN_UNWRAP(ReparentWindow); - if (pScreen->ReparentWindow) - (*pScreen->ReparentWindow)(pWin, pPriorParent); - WIN_WRAP(ReparentWindow, winReparentWindowMultiWindow); - - /* Update the Windows window associated with this X window */ - winUpdateWindowsWindow (pWin); -} - - -/* - * RestackWindow - Shuffle the z-order of a window - */ - -void -winRestackWindowMultiWindow (WindowPtr pWin, WindowPtr pOldNextSib) -{ -#if 0 - WindowPtr pPrevWin; - UINT uFlags; - HWND hInsertAfter; - HWND hWnd = NULL; -#endif - ScreenPtr pScreen = pWin->drawable.pScreen; - winScreenPriv(pScreen); - -#if CYGMULTIWINDOW_DEBUG || CYGWINDOWING_DEBUG - winTrace ("winRestackMultiWindow - %08x\n", pWin); -#endif - - WIN_UNWRAP(RestackWindow); - if (pScreen->RestackWindow) - (*pScreen->RestackWindow)(pWin, pOldNextSib); - WIN_WRAP(RestackWindow, winRestackWindowMultiWindow); - -#if 1 - /* - * Calling winReorderWindowsMultiWindow here means our window manager - * (i.e. Windows Explorer) has initiative to determine Z order. - */ - if (pWin->nextSib != pOldNextSib) - winReorderWindowsMultiWindow (); -#else - /* Bail out if no window privates or window handle is invalid */ - if (!pWinPriv || !pWinPriv->hWnd) - return; - - /* Get a pointer to our previous sibling window */ - pPrevWin = pWin->prevSib; - - /* - * Look for a sibling window with - * valid privates and window handle - */ - while (pPrevWin - && !winGetWindowPriv(pPrevWin) - && !winGetWindowPriv(pPrevWin)->hWnd) - pPrevWin = pPrevWin->prevSib; - - /* Check if we found a valid sibling */ - if (pPrevWin) - { - /* Valid sibling - get handle to insert window after */ - hInsertAfter = winGetWindowPriv(pPrevWin)->hWnd; - uFlags = SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE; - - hWnd = GetNextWindow (pWinPriv->hWnd, GW_HWNDPREV); - - do - { - if (GetProp (hWnd, WIN_WINDOW_PROP)) - { - if (hWnd == winGetWindowPriv(pPrevWin)->hWnd) - { - uFlags |= SWP_NOZORDER; - } - break; - } - hWnd = GetNextWindow (hWnd, GW_HWNDPREV); - } - while (hWnd); - } - else - { - /* No valid sibling - make this window the top window */ - hInsertAfter = HWND_TOP; - uFlags = SWP_NOMOVE | SWP_NOSIZE; - } - - /* Perform the restacking operation in Windows */ - SetWindowPos (pWinPriv->hWnd, - hInsertAfter, - 0, 0, - 0, 0, - uFlags); -#endif -} - - -/* - * winCreateWindowsWindow - Create a Windows window associated with an X window - */ - -void -winCreateWindowsWindow (WindowPtr pWin) -{ - int iX, iY; - int iWidth; - int iHeight; - HWND hWnd; - HWND hFore = NULL; - winWindowPriv(pWin); - HICON hIcon; - HICON hIconSmall; - winPrivScreenPtr pScreenPriv = pWinPriv->pScreenPriv; - WinXSizeHints hints; - WindowPtr pDaddy; - - winInitMultiWindowClass(); - -#if CYGMULTIWINDOW_DEBUG - ErrorF ("winCreateWindowsWindow - pWin: %08x\n", pWin); -#endif - - iX = pWin->drawable.x + GetSystemMetrics (SM_XVIRTUALSCREEN); - iY = pWin->drawable.y + GetSystemMetrics (SM_YVIRTUALSCREEN); - - iWidth = pWin->drawable.width; - iHeight = pWin->drawable.height; - - /* If it's an InputOutput window, and so is going to end up being made visible, - make sure the window actually ends up somewhere where it will be visible */ - if (pWin->drawable.class != InputOnly) - { - if ((iX < GetSystemMetrics (SM_XVIRTUALSCREEN)) || (iX > GetSystemMetrics (SM_CXVIRTUALSCREEN))) - iX = CW_USEDEFAULT; - - if ((iY < GetSystemMetrics (SM_YVIRTUALSCREEN)) || (iY > GetSystemMetrics (SM_CYVIRTUALSCREEN))) - iY = CW_USEDEFAULT; - } - - if (winMultiWindowGetTransientFor (pWin, &pDaddy)) - { - if (pDaddy) - { - hFore = GetForegroundWindow(); - if (hFore && (pDaddy != (WindowPtr)GetProp(hFore, WIN_WID_PROP))) hFore = NULL; - } - } - else - { - /* Default positions if none specified */ - if (!winMultiWindowGetWMNormalHints(pWin, &hints)) - hints.flags = 0; - if (!(hints.flags & (USPosition|PPosition)) && - !pWin->overrideRedirect) - { - iX = CW_USEDEFAULT; - iY = CW_USEDEFAULT; - } - } - - /* Create the window */ - /* Make it OVERLAPPED in create call since WS_POPUP doesn't support */ - /* CW_USEDEFAULT, change back to popup after creation */ - hWnd = CreateWindowExA (WS_EX_TOOLWINDOW, /* Extended styles */ - WINDOW_CLASS_X, /* Class name */ - WINDOW_TITLE_X, /* Window name */ - WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, - iX, /* Horizontal position */ - iY, /* Vertical position */ - iWidth, /* Right edge */ - iHeight, /* Bottom edge */ - hFore, /* Null or Parent window if transient*/ - (HMENU) NULL, /* No menu */ - GetModuleHandle (NULL), /* Instance handle */ - pWin); /* ScreenPrivates */ - if (hWnd == NULL) - { - ErrorF ("winCreateWindowsWindow - CreateWindowExA () failed: %d\n", - (int) GetLastError ()); - } - pWinPriv->hWnd = hWnd; - - /* Set application or .XWinrc defined Icons */ - winSelectIcons(pWin, &hIcon, &hIconSmall); - if (hIcon) SendMessage (hWnd, WM_SETICON, ICON_BIG, (LPARAM) hIcon); - if (hIconSmall) SendMessage (hWnd, WM_SETICON, ICON_SMALL, (LPARAM) hIconSmall); - - /* Change style back to popup, already placed... */ - SetWindowLongPtr(hWnd, GWL_STYLE, WS_POPUP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS); - SetWindowPos (hWnd, 0, 0, 0, 0, 0, - SWP_FRAMECHANGED | SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); - /* Make sure it gets the proper system menu for a WS_POPUP, too */ - GetSystemMenu (hWnd, TRUE); - - /* Cause any .XWinrc menus to be added in main WNDPROC */ - PostMessage (hWnd, WM_INIT_SYS_MENU, 0, 0); - - SetProp (hWnd, WIN_WID_PROP, (HANDLE) winGetWindowID(pWin)); - - /* Flag that this Windows window handles its own activation */ - SetProp (hWnd, WIN_NEEDMANAGE_PROP, (HANDLE) 0); - - /* Call engine-specific create window procedure */ - (*pScreenPriv->pwinFinishCreateWindowsWindow) (pWin); -} - - -Bool winInDestroyWindowsWindow = FALSE; -/* - * winDestroyWindowsWindow - Destroy a Windows window associated - * with an X window - */ -static void -winDestroyWindowsWindow (WindowPtr pWin) -{ - MSG msg; - winWindowPriv(pWin); - BOOL oldstate = winInDestroyWindowsWindow; - HICON hIcon; - HICON hIconSm; - -#if CYGMULTIWINDOW_DEBUG - ErrorF ("winDestroyWindowsWindow\n"); -#endif - - /* Bail out if the Windows window handle is invalid */ - if (pWinPriv->hWnd == NULL) - return; - - winInDestroyWindowsWindow = TRUE; - - /* Store the info we need to destroy after this window is gone */ - hIcon = (HICON)SendMessage(pWinPriv->hWnd, WM_GETICON, ICON_BIG, 0); - hIconSm = (HICON)SendMessage(pWinPriv->hWnd, WM_GETICON, ICON_SMALL, 0); - - SetProp (pWinPriv->hWnd, WIN_WINDOW_PROP, NULL); - - /* Destroy the Windows window */ - DestroyWindow (pWinPriv->hWnd); - - /* Null our handle to the Window so referencing it will cause an error */ - pWinPriv->hWnd = NULL; - - /* Destroy any icons we created for this window */ - winDestroyIcon(hIcon); - winDestroyIcon(hIconSm); - - /* Process all messages on our queue */ - while (PeekMessage (&msg, NULL, 0, 0, PM_REMOVE)) - { - if (g_hDlgDepthChange == 0 || !IsDialogMessage (g_hDlgDepthChange, &msg)) - { - DispatchMessage (&msg); - } - } - - winInDestroyWindowsWindow = oldstate; - -#if CYGMULTIWINDOW_DEBUG - ErrorF ("-winDestroyWindowsWindow\n"); -#endif -} - - -/* - * winUpdateWindowsWindow - Redisplay/redraw a Windows window - * associated with an X window - */ - -static void -winUpdateWindowsWindow (WindowPtr pWin) -{ - winWindowPriv(pWin); - HWND hWnd = pWinPriv->hWnd; - -#if CYGMULTIWINDOW_DEBUG - ErrorF ("winUpdateWindowsWindow\n"); -#endif - - /* Check if the Windows window's parents have been destroyed */ - if (pWin->parent != NULL - && pWin->parent->parent == NULL - && pWin->mapped) - { - /* Create the Windows window if it has been destroyed */ - if (hWnd == NULL) - { - winCreateWindowsWindow (pWin); - assert (pWinPriv->hWnd != NULL); - } - - /* Display the window without activating it */ - if (pWin->drawable.class != InputOnly) - ShowWindow (pWinPriv->hWnd, SW_SHOWNOACTIVATE); - - /* Send first paint message */ - UpdateWindow (pWinPriv->hWnd); - } - else if (hWnd != NULL) - { - /* Destroy the Windows window if its parents are destroyed */ - winDestroyWindowsWindow (pWin); - assert (pWinPriv->hWnd == NULL); - } - -#if CYGMULTIWINDOW_DEBUG - ErrorF ("-winUpdateWindowsWindow\n"); -#endif -} - - -/* - * winGetWindowID - - */ - -XID -winGetWindowID (WindowPtr pWin) -{ - WindowIDPairRec wi = {pWin, 0}; - ClientPtr c = wClient(pWin); - - /* */ - FindClientResourcesByType (c, RT_WINDOW, winFindWindow, &wi); - -#if CYGMULTIWINDOW_DEBUG - ErrorF ("winGetWindowID - Window ID: %d\n", wi.id); -#endif - - return wi.id; -} - - -/* - * winFindWindow - - */ - -static void -winFindWindow (pointer value, XID id, pointer cdata) -{ - WindowIDPairPtr wi = (WindowIDPairPtr)cdata; - - if (value == wi->value) - { - wi->id = id; - } -} - - -/* - * winReorderWindowsMultiWindow - - */ - -void -winReorderWindowsMultiWindow (void) -{ - HWND hwnd = NULL; - WindowPtr pWin = NULL; - WindowPtr pWinSib = NULL; - XID vlist[2]; - static Bool fRestacking = FALSE; /* Avoid recusive calls to this function */ - DWORD dwCurrentProcessID = GetCurrentProcessId (); - DWORD dwWindowProcessID = 0; - -#if CYGMULTIWINDOW_DEBUG || CYGWINDOWING_DEBUG - winTrace ("winReorderWindowsMultiWindow\n"); -#endif - - if (fRestacking) - { - /* It is a recusive call so immediately exit */ -#if CYGWINDOWING_DEBUG - ErrorF ("winReorderWindowsMultiWindow - " - "exit because fRestacking == TRUE\n"); -#endif - return; - } - fRestacking = TRUE; - - /* Loop through top level Window windows, descending in Z order */ - for ( hwnd = GetTopWindow (NULL); - hwnd; - hwnd = GetNextWindow (hwnd, GW_HWNDNEXT) ) - { - /* Don't take care of other Cygwin/X process's windows */ - GetWindowThreadProcessId (hwnd, &dwWindowProcessID); - - if ( GetProp (hwnd, WIN_WINDOW_PROP) - && (dwWindowProcessID == dwCurrentProcessID) - && !IsIconic (hwnd) ) /* ignore minimized windows */ - { - pWinSib = pWin; - pWin = GetProp (hwnd, WIN_WINDOW_PROP); - - if (!pWinSib) - { /* 1st window - raise to the top */ - vlist[0] = Above; - - ConfigureWindow (pWin, CWStackMode, vlist, wClient(pWin)); - } - else - { /* 2nd or deeper windows - just below the previous one */ - vlist[0] = winGetWindowID (pWinSib); - vlist[1] = Below; - - ConfigureWindow (pWin, CWSibling | CWStackMode, - vlist, wClient(pWin)); - } - } - } - - fRestacking = FALSE; -} - - -/* - * winMinimizeWindow - Minimize in response to WM_CHANGE_STATE - */ - -void -winMinimizeWindow (Window id) -{ - WindowPtr pWin; - winPrivWinPtr pWinPriv; -#ifdef XWIN_MULTIWINDOWEXTWM - win32RootlessWindowPtr pRLWinPriv; -#endif - HWND hWnd; - ScreenPtr pScreen = NULL; - winPrivScreenPtr pScreenPriv = NULL; - winScreenInfo *pScreenInfo = NULL; - -#if CYGWINDOWING_DEBUG - ErrorF ("winMinimizeWindow\n"); -#endif - - dixLookupResourceByType((pointer) &pWin, id, RT_WINDOW, NullClient, DixUnknownAccess); - if (!pWin) - { - ErrorF("%s: NULL pWin. Leaving\n", __FUNCTION__); - return; - } - - pScreen = pWin->drawable.pScreen; - if (pScreen) pScreenPriv = winGetScreenPriv(pScreen); - if (pScreenPriv) pScreenInfo = pScreenPriv->pScreenInfo; - -#ifdef XWIN_MULTIWINDOWEXTWM - if (pScreenPriv && pScreenInfo->fInternalWM) - { - pRLWinPriv = (win32RootlessWindowPtr) RootlessFrameForWindow (pWin, FALSE); - hWnd = pRLWinPriv->hWnd; - } - else -#else - if (pScreenPriv) -#endif - { - pWinPriv = winGetWindowPriv (pWin); - hWnd = pWinPriv->hWnd; - } - - ShowWindow (hWnd, SW_MINIMIZE); -} - - -/* - * CopyWindow - See Porting Layer Definition - p. 39 - */ -void -winCopyWindowMultiWindow (WindowPtr pWin, DDXPointRec oldpt, - RegionPtr oldRegion) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - winScreenPriv(pScreen); - -#if CYGWINDOWING_DEBUG - ErrorF ("CopyWindowMultiWindow\n"); -#endif - WIN_UNWRAP(CopyWindow); - (*pScreen->CopyWindow)(pWin, oldpt, oldRegion); - WIN_WRAP(CopyWindow, winCopyWindowMultiWindow); -} - - -/* - * MoveWindow - See Porting Layer Definition - p. 42 - */ -void -winMoveWindowMultiWindow (WindowPtr pWin, int x, int y, - WindowPtr pSib, VTKind kind) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - winScreenPriv(pScreen); - -#if CYGWINDOWING_DEBUG - ErrorF ("MoveWindowMultiWindow to (%d, %d)\n", x, y); -#endif - - WIN_UNWRAP(MoveWindow); - (*pScreen->MoveWindow)(pWin, x, y, pSib, kind); - WIN_WRAP(MoveWindow, winMoveWindowMultiWindow); -} - - -/* - * ResizeWindow - See Porting Layer Definition - p. 42 - */ -void -winResizeWindowMultiWindow (WindowPtr pWin, int x, int y, unsigned int w, - unsigned int h, WindowPtr pSib) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - winScreenPriv(pScreen); - -#if CYGWINDOWING_DEBUG - ErrorF ("ResizeWindowMultiWindow to (%d, %d) - %dx%d\n", x, y, w, h); -#endif - WIN_UNWRAP(ResizeWindow); - (*pScreen->ResizeWindow)(pWin, x, y, w, h, pSib); - WIN_WRAP(ResizeWindow, winResizeWindowMultiWindow); -} - - -/* - * winAdjustXWindow - * - * Move and resize X window with respect to corresponding Windows window. - * This is called from WM_MOVE/WM_SIZE handlers when the user performs - * any windowing operation (move, resize, minimize, maximize, restore). - * - * The functionality is the inverse of winPositionWindowMultiWindow, which - * adjusts Windows window with respect to X window. - */ -int -winAdjustXWindow (WindowPtr pWin, HWND hwnd) -{ - RECT rcDraw; /* Rect made from pWin->drawable to be adjusted */ - RECT rcWin; /* The source: WindowRect from hwnd */ - DrawablePtr pDraw; - XID vlist[4]; - LONG dX, dY, dW, dH, x, y; - DWORD dwStyle, dwExStyle; - -#define WIDTH(rc) (rc.right - rc.left) -#define HEIGHT(rc) (rc.bottom - rc.top) - -#if CYGWINDOWING_DEBUG - ErrorF ("winAdjustXWindow\n"); -#endif - - if (IsIconic (hwnd)) - { -#if CYGWINDOWING_DEBUG - ErrorF ("\timmediately return because the window is iconized\n"); -#endif - /* - * If the Windows window is minimized, its WindowRect has - * meaningless values so we don't adjust X window to it. - */ - vlist[0] = 0; - vlist[1] = 0; - return ConfigureWindow (pWin, CWX | CWY, vlist, wClient(pWin)); - } - - pDraw = &pWin->drawable; - - /* Calculate the window rect from the drawable */ - x = pDraw->x + GetSystemMetrics (SM_XVIRTUALSCREEN); - y = pDraw->y + GetSystemMetrics (SM_YVIRTUALSCREEN); - SetRect (&rcDraw, x, y, x + pDraw->width, y + pDraw->height); -#ifdef CYGMULTIWINDOW_DEBUG - winDebug("\tDrawable extend {%d, %d, %d, %d}, {%d, %d}\n", - rcDraw.left, rcDraw.top, rcDraw.right, rcDraw.bottom, - rcDraw.right - rcDraw.left, rcDraw.bottom - rcDraw.top); -#endif - dwExStyle = GetWindowLongPtr (hwnd, GWL_EXSTYLE); - dwStyle = GetWindowLongPtr (hwnd, GWL_STYLE); -#ifdef CYGMULTIWINDOW_DEBUG - winDebug("\tWindowStyle: %08x %08x\n", dwStyle, dwExStyle); -#endif - AdjustWindowRectEx (&rcDraw, dwStyle, FALSE, dwExStyle); - - /* The source of adjust */ - GetWindowRect (hwnd, &rcWin); -#ifdef CYGMULTIWINDOW_DEBUG - winDebug("\tWindow extend {%d, %d, %d, %d}, {%d, %d}\n", - rcWin.left, rcWin.top, rcWin.right, rcWin.bottom, - rcWin.right - rcWin.left, rcWin.bottom - rcWin.top); - winDebug("\tDraw extend {%d, %d, %d, %d}, {%d, %d}\n", - rcDraw.left, rcDraw.top, rcDraw.right, rcDraw.bottom, - rcDraw.right - rcDraw.left, rcDraw.bottom - rcDraw.top); -#endif - - if (EqualRect (&rcDraw, &rcWin)) { - /* Bail if no adjust is needed */ -#if CYGWINDOWING_DEBUG - ErrorF ("\treturn because already adjusted\n"); -#endif - return 0; - } - - /* Calculate delta values */ - dX = rcWin.left - rcDraw.left; - dY = rcWin.top - rcDraw.top; - dW = WIDTH(rcWin) - WIDTH(rcDraw); - dH = HEIGHT(rcWin) - HEIGHT(rcDraw); - - /* - * Adjust. - * We may only need to move (vlist[0] and [1]), or only resize - * ([2] and [3]) but currently we set all the parameters and leave - * the decision to ConfigureWindow. The reason is code simplicity. - */ - vlist[0] = pDraw->x + dX - wBorderWidth(pWin); - vlist[1] = pDraw->y + dY - wBorderWidth(pWin); - vlist[2] = pDraw->width + dW; - vlist[3] = pDraw->height + dH; -#if CYGWINDOWING_DEBUG - ErrorF ("\tConfigureWindow to (%ld, %ld) - %ldx%ld\n", vlist[0], vlist[1], - vlist[2], vlist[3]); -#endif - return ConfigureWindow (pWin, CWX | CWY | CWWidth | CWHeight, - vlist, wClient(pWin)); - -#undef WIDTH -#undef HEIGHT -} - +/*
+ *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
+ *Copyright (C) Colin Harrison 2005-2008
+ *
+ *Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ *"Software"), to deal in the Software without restriction, including
+ *without limitation the rights to use, copy, modify, merge, publish,
+ *distribute, sublicense, and/or sell copies of the Software, and to
+ *permit persons to whom the Software is furnished to do so, subject to
+ *the following conditions:
+ *
+ *The above copyright notice and this permission notice shall be
+ *included in all copies or substantial portions of the Software.
+ *
+ *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
+ *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+ *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Kensuke Matsuzaki
+ * Earle F. Philhower, III
+ * Harold L Hunt II
+ * Colin Harrison
+ */
+
+#ifdef HAVE_XWIN_CONFIG_H
+#include <xwin-config.h>
+#endif
+#include "win.h"
+#include "dixevents.h"
+#include "winmultiwindowclass.h"
+
+/*
+ * Prototypes for local functions
+ */
+
+void
+winCreateWindowsWindow (WindowPtr pWin);
+
+static void
+winDestroyWindowsWindow (WindowPtr pWin);
+
+static void
+winUpdateWindowsWindow (WindowPtr pWin);
+
+static void
+winFindWindow (pointer value, XID id, pointer cdata);
+
+static
+void winInitMultiWindowClass(void)
+{
+ static wATOM atomXWinClass=0;
+ WNDCLASSEX wcx;
+
+ if (atomXWinClass==0)
+ {
+ /* Setup our window class */
+ wcx.cbSize=sizeof(WNDCLASSEX);
+ wcx.style = CS_HREDRAW | CS_VREDRAW | (g_fNativeGl ? CS_OWNDC : 0);
+ wcx.lpfnWndProc = winTopLevelWindowProc;
+ wcx.cbClsExtra = 0;
+ wcx.cbWndExtra = 0;
+ wcx.hInstance = g_hInstance;
+ wcx.hIcon = g_hIconX;
+ wcx.hCursor = 0;
+ wcx.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH);
+ wcx.lpszMenuName = NULL;
+ wcx.lpszClassName = WINDOW_CLASS_X;
+ wcx.hIconSm = g_hSmallIconX;
+
+#if CYGMULTIWINDOW_DEBUG
+ winDebug ("winCreateWindowsWindow - Creating class: %s\n", WINDOW_CLASS_X);
+#endif
+
+ atomXWinClass = RegisterClassEx (&wcx);
+ }
+}
+
+/*
+ * CreateWindow - See Porting Layer Definition - p. 37
+ */
+
+Bool
+winCreateWindowMultiWindow (WindowPtr pWin)
+{
+ Bool fResult = TRUE;
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ winWindowPriv(pWin);
+ winScreenPriv(pScreen);
+
+#if CYGMULTIWINDOW_DEBUG
+ winDebug ("winCreateWindowMultiWindow - pWin: %p\n", pWin);
+#endif
+
+ WIN_UNWRAP(CreateWindow);
+ fResult = (*pScreen->CreateWindow) (pWin);
+ WIN_WRAP(CreateWindow, winCreateWindowMultiWindow);
+
+ /* Initialize some privates values */
+ pWinPriv->hRgn = NULL;
+ pWinPriv->hWnd = NULL;
+ pWinPriv->GlCtxWnd = FALSE;
+ pWinPriv->pScreenPriv = winGetScreenPriv(pWin->drawable.pScreen);
+ pWinPriv->fXKilled = FALSE;
+
+ return fResult;
+}
+
+
+/*
+ * DestroyWindow - See Porting Layer Definition - p. 37
+ */
+
+Bool
+winDestroyWindowMultiWindow (WindowPtr pWin)
+{
+ Bool fResult = TRUE;
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ winWindowPriv(pWin);
+ winScreenPriv(pScreen);
+
+#if CYGMULTIWINDOW_DEBUG
+ winDebug ("winDestroyWindowMultiWindow - pWin: %p\n", pWin);
+#endif
+
+ WIN_UNWRAP(DestroyWindow);
+ fResult = (*pScreen->DestroyWindow)(pWin);
+ WIN_WRAP(DestroyWindow, winDestroyWindowMultiWindow);
+
+ /* Flag that the window has been destroyed */
+ pWinPriv->fXKilled = TRUE;
+
+ /* Kill the MS Windows window associated with this window */
+ winDestroyWindowsWindow (pWin);
+
+ return fResult;
+}
+
+
+/*
+ * PositionWindow - See Porting Layer Definition - p. 37
+ *
+ * This function adjusts the position and size of Windows window
+ * with respect to the underlying X window. This is the inverse
+ * of winAdjustXWindow, which adjusts X window to Windows window.
+ */
+
+Bool
+winPositionWindowMultiWindow (WindowPtr pWin, int x, int y)
+{
+ Bool fResult = TRUE;
+ int iX, iY, iWidth, iHeight;
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ winWindowPriv(pWin);
+ winScreenPriv(pScreen);
+
+ HWND hWnd = pWinPriv->hWnd;
+ RECT rcNew;
+ RECT rcOld;
+#ifdef WINDBG
+ RECT rcClient;
+ RECT *lpRc;
+#endif
+ DWORD dwExStyle;
+ DWORD dwStyle;
+
+ winDebug ("winPositionWindowMultiWindow - pWin: %p\n", pWin);
+
+ WIN_UNWRAP(PositionWindow);
+ fResult = (*pScreen->PositionWindow)(pWin, x, y);
+ WIN_WRAP(PositionWindow, winPositionWindowMultiWindow);
+
+ winDebug ("winPositionWindowMultiWindow: (x, y) = (%d, %d)\n",
+ x, y);
+
+ /* Bail out if the Windows window handle is bad */
+ if (!hWnd)
+ {
+ winDebug ("\timmediately return since hWnd is NULL\n");
+ if (pWin->redirectDraw != RedirectDrawNone)
+ {
+ winDebug("winPositionWindowMultiWindow: Calling compReallocPixmap to make sure the pixmap buffer is valid.\n");
+ compReallocPixmap(pWin, x, y, pWin->drawable.width, pWin->drawable.height, pWin->borderWidth);
+ }
+ return fResult;
+ }
+
+ /* Get the Windows window style and extended style */
+ dwExStyle = GetWindowLongPtr (hWnd, GWL_EXSTYLE);
+ dwStyle = GetWindowLongPtr (hWnd, GWL_STYLE);
+
+ /* Get the X and Y location of the X window */
+ iX = pWin->drawable.x + GetSystemMetrics (SM_XVIRTUALSCREEN);
+ iY = pWin->drawable.y + GetSystemMetrics (SM_YVIRTUALSCREEN);
+
+ /* Get the height and width of the X window */
+ iWidth = pWin->drawable.width;
+ iHeight = pWin->drawable.height;
+
+ /* Store the origin, height, and width in a rectangle structure */
+ SetRect (&rcNew, iX, iY, iX + iWidth, iY + iHeight);
+
+#if CYGMULTIWINDOW_DEBUG
+ lpRc = &rcNew;
+ winDebug ("winPositionWindowMultiWindow - (%d ms)drawable (%d, %d)-(%d, %d)\n",
+ GetTickCount (), lpRc->left, lpRc->top, lpRc->right, lpRc->bottom);
+#endif
+
+ /*
+ * Calculate the required size of the Windows window rectangle,
+ * given the size of the Windows window client area.
+ */
+ AdjustWindowRectEx (&rcNew, dwStyle, FALSE, dwExStyle);
+
+ /* Get a rectangle describing the old Windows window */
+ GetWindowRect (hWnd, &rcOld);
+
+#if CYGMULTIWINDOW_DEBUG
+ /* Get a rectangle describing the Windows window client area */
+ GetClientRect (hWnd, &rcClient);
+
+ lpRc = &rcNew;
+ winDebug ("winPositionWindowMultiWindow - (%d ms)rcNew (%d, %d)-(%d, %d)\n",
+ GetTickCount (), lpRc->left, lpRc->top, lpRc->right, lpRc->bottom);
+
+ lpRc = &rcOld;
+ winDebug ("winPositionWindowMultiWindow - (%d ms)rcOld (%d, %d)-(%d, %d)\n",
+ GetTickCount (), lpRc->left, lpRc->top, lpRc->right, lpRc->bottom);
+
+ lpRc = &rcClient;
+ winDebug ("(%d ms)rcClient (%d, %d)-(%d, %d)\n",
+ GetTickCount (), lpRc->left, lpRc->top, lpRc->right, lpRc->bottom);
+#endif
+
+ /* Check if the old rectangle and new rectangle are the same */
+ if (!EqualRect (&rcNew, &rcOld))
+ {
+ winDebug ("winPositionWindowMultiWindow - Need to move\n");
+ winDebug ("\tMoveWindow to (%ld, %ld) - %ldx%ld\n", rcNew.left, rcNew.top,
+ rcNew.right - rcNew.left, rcNew.bottom - rcNew.top);
+
+ /* Change the position and dimensions of the Windows window */
+ if (pWinPriv->GlCtxWnd)
+ {
+ int iWidth=rcNew.right - rcNew.left;
+ int iHeight=rcNew.bottom - rcNew.top;
+ ScreenToClient(GetParent(hWnd), (LPPOINT)&rcNew);
+ MoveWindow (hWnd,
+ rcNew.left, rcNew.top,
+ iWidth, iHeight,
+ TRUE);
+ }
+ else
+ MoveWindow (hWnd,
+ rcNew.left, rcNew.top,
+ rcNew.right - rcNew.left, rcNew.bottom - rcNew.top,
+ TRUE);
+ }
+ else
+ {
+ winDebug ("winPositionWindowMultiWindow - Not need to move\n");
+ }
+
+ return fResult;
+}
+
+
+/*
+ * ChangeWindowAttributes - See Porting Layer Definition - p. 37
+ */
+
+Bool
+winChangeWindowAttributesMultiWindow (WindowPtr pWin, unsigned long mask)
+{
+ Bool fResult = TRUE;
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ winScreenPriv(pScreen);
+
+ winDebug ("winChangeWindowAttributesMultiWindow - pWin: %08x\n", pWin);
+
+ WIN_UNWRAP(ChangeWindowAttributes);
+ fResult = (*pScreen->ChangeWindowAttributes)(pWin, mask);
+ WIN_WRAP(ChangeWindowAttributes, winChangeWindowAttributesMultiWindow);
+
+ /*
+ * NOTE: We do not currently need to do anything here.
+ */
+
+ return fResult;
+}
+
+
+/*
+ * UnmapWindow - See Porting Layer Definition - p. 37
+ * Also referred to as UnrealizeWindow
+ */
+
+Bool
+winUnmapWindowMultiWindow (WindowPtr pWin)
+{
+ Bool fResult = TRUE;
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ winWindowPriv(pWin);
+ winScreenPriv(pScreen);
+
+#if CYGMULTIWINDOW_DEBUG
+ winDebug ("winUnmapWindowMultiWindow - pWin: %08x\n", pWin);
+#endif
+
+ WIN_UNWRAP(UnrealizeWindow);
+ fResult = (*pScreen->UnrealizeWindow)(pWin);
+ WIN_WRAP(UnrealizeWindow, winUnmapWindowMultiWindow);
+
+ /* Flag that the window has been killed */
+ pWinPriv->fXKilled = TRUE;
+
+ /* Destroy the Windows window associated with this X window */
+ winDestroyWindowsWindow (pWin);
+
+ return fResult;
+}
+
+
+/*
+ * MapWindow - See Porting Layer Definition - p. 37
+ * Also referred to as RealizeWindow
+ */
+
+Bool
+winMapWindowMultiWindow (WindowPtr pWin)
+{
+ Bool fResult = TRUE;
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ winWindowPriv(pWin);
+ winScreenPriv(pScreen);
+
+#if CYGMULTIWINDOW_DEBUG
+ winDebug ("winMapWindowMultiWindow - pWin: %08x\n", pWin);
+#endif
+
+ WIN_UNWRAP(RealizeWindow);
+ fResult = (*pScreen->RealizeWindow)(pWin);
+ WIN_WRAP(RealizeWindow, winMapWindowMultiWindow);
+
+ /* Flag that this window has not been destroyed */
+ pWinPriv->fXKilled = FALSE;
+
+ /* Refresh/redisplay the Windows window associated with this X window */
+ winUpdateWindowsWindow (pWin);
+
+ /* Update the Windows window's shape */
+ winReshapeMultiWindow (pWin);
+ winUpdateRgnMultiWindow (pWin);
+
+ return fResult;
+}
+
+
+/*
+ * ReparentWindow - See Porting Layer Definition - p. 42
+ */
+
+void
+winReparentWindowMultiWindow (WindowPtr pWin, WindowPtr pPriorParent)
+{
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ winScreenPriv(pScreen);
+
+#if CYGMULTIWINDOW_DEBUG
+ winDebug ("winReparentMultiWindow - pWin: %08x\n", pWin);
+#endif
+
+ WIN_UNWRAP(ReparentWindow);
+ if (pScreen->ReparentWindow)
+ (*pScreen->ReparentWindow)(pWin, pPriorParent);
+ WIN_WRAP(ReparentWindow, winReparentWindowMultiWindow);
+
+ /* Update the Windows window associated with this X window */
+ winUpdateWindowsWindow (pWin);
+}
+
+
+/*
+ * RestackWindow - Shuffle the z-order of a window
+ */
+
+void
+winRestackWindowMultiWindow (WindowPtr pWin, WindowPtr pOldNextSib)
+{
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ winScreenPriv(pScreen);
+
+ winDebug ("winRestackMultiWindow - %08x\n", pWin);
+
+ WIN_UNWRAP(RestackWindow);
+ if (pScreen->RestackWindow)
+ (*pScreen->RestackWindow)(pWin, pOldNextSib);
+ WIN_WRAP(RestackWindow, winRestackWindowMultiWindow);
+
+ /*
+ * Calling winReorderWindowsMultiWindow here means our window manager
+ * (i.e. Windows Explorer) has initiative to determine Z order.
+ */
+ if (pWin->nextSib != pOldNextSib)
+ winReorderWindowsMultiWindow ();
+}
+
+
+/*
+ * winCreateWindowsWindow - Create a Windows window associated with an X window
+ */
+
+void
+winCreateWindowsWindow (WindowPtr pWin)
+{
+ int iX, iY;
+ int iWidth;
+ int iHeight;
+ HWND hWnd;
+ HWND hFore = NULL;
+ winWindowPriv(pWin);
+ HICON hIcon;
+ HICON hIconSmall;
+ winPrivScreenPtr pScreenPriv = pWinPriv->pScreenPriv;
+ WinXSizeHints hints;
+ WindowPtr pDaddy;
+ DWORD dwStyle;
+ DWORD dwExStyle;
+ RECT rc;
+
+ winInitMultiWindowClass();
+
+ winDebug ("winCreateWindowsWindow - pWin: %08x\n", pWin);
+
+ iX = pWin->drawable.x + GetSystemMetrics (SM_XVIRTUALSCREEN);
+ iY = pWin->drawable.y + GetSystemMetrics (SM_YVIRTUALSCREEN);
+
+ iWidth = pWin->drawable.width;
+ iHeight = pWin->drawable.height;
+
+ /* If it's an InputOutput window, and so is going to end up being made visible,
+ make sure the window actually ends up somewhere where it will be visible
+ Dont't do it by making just one of the two iX and iY CW_USEDEFAULT since
+ this will create a window at place CW_USEDEFAULT which is 0x80000000 */
+ if (pWin->drawable.class != InputOnly)
+ {
+ while (1)
+ {
+ if (iX < GetSystemMetrics (SM_XVIRTUALSCREEN))
+ {
+ iX = GetSystemMetrics (SM_XVIRTUALSCREEN);
+ ErrorF("Resetting iX to %d\n",iX);
+ }
+ else if (iX > GetSystemMetrics (SM_CXVIRTUALSCREEN))
+ {
+ iX = GetSystemMetrics (SM_CXVIRTUALSCREEN)-iWidth;
+ ErrorF("Resetting iX to %d\n",iX);
+ }
+ else
+ break;
+ }
+
+ while (1)
+ {
+ if (iY < GetSystemMetrics (SM_YVIRTUALSCREEN))
+ {
+ iY = GetSystemMetrics (SM_YVIRTUALSCREEN);
+ ErrorF("Resetting iY to %d\n",iY);
+ }
+ else if (iY > GetSystemMetrics (SM_CYVIRTUALSCREEN))
+ {
+ iY = GetSystemMetrics (SM_CYVIRTUALSCREEN)-iHeight;
+ ErrorF("Resetting iY to %d\n",iY);
+ }
+ else
+ break;
+ }
+ }
+
+ winDebug("winCreateWindowsWindow - %dx%d @ %dx%d\n", iWidth, iHeight, iX, iY);
+
+ if (winMultiWindowGetTransientFor (pWin, &pDaddy))
+ {
+ if (pDaddy)
+ {
+ hFore = GetForegroundWindow();
+ if (hFore && (pDaddy != (WindowPtr)GetProp(hFore, WIN_WID_PROP))) hFore = NULL;
+ }
+ }
+ else
+ {
+ /* Default positions if none specified */
+ if (!winMultiWindowGetWMNormalHints(pWin, &hints))
+ hints.flags = 0;
+ if (!(hints.flags & (USPosition|PPosition)) &&
+ !pWin->overrideRedirect)
+ {
+ iX = CW_USEDEFAULT;
+ iY = CW_USEDEFAULT;
+ }
+ }
+
+ /* Create the window */
+ /* Make it OVERLAPPED in create call since WS_POPUP doesn't support */
+ /* CW_USEDEFAULT, change back to popup after creation */
+
+ dwStyle = WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS;
+ dwExStyle = WS_EX_TOOLWINDOW;
+ rc.top = 0;
+ rc.left = 0;
+ rc.bottom = iHeight;
+ rc.right = iWidth;
+ AdjustWindowRectEx(&rc, dwStyle, FALSE, dwExStyle);
+ iHeight = rc.bottom - rc.top;
+ iWidth = rc.right - rc.left;
+
+ winDebug("winCreateWindowsWindow - window size %dx%d\n", iWidth, iHeight);
+
+ hWnd = CreateWindowExA (dwExStyle, /* Extended styles */
+ WINDOW_CLASS_X, /* Class name */
+ WINDOW_TITLE_X, /* Window name */
+ dwStyle, /* Styles */
+ iX, /* Horizontal position */
+ iY, /* Vertical position */
+ iWidth, /* Right edge */
+ iHeight, /* Bottom edge */
+ hFore, /* Null or Parent window if transient*/
+ (HMENU) NULL, /* No menu */
+ GetModuleHandle (NULL), /* Instance handle */
+ pWin); /* ScreenPrivates */
+ if (hWnd == NULL)
+ {
+ ErrorF ("winCreateWindowsWindow - CreateWindowExA () failed: %d\n",
+ (int) GetLastError ());
+ }
+ pWinPriv->hWnd = hWnd;
+
+ /* Set application or .XWinrc defined Icons */
+ winSelectIcons(pWin, &hIcon, &hIconSmall);
+ if (hIcon) SendMessage (hWnd, WM_SETICON, ICON_BIG, (LPARAM) hIcon);
+ if (hIconSmall) SendMessage (hWnd, WM_SETICON, ICON_SMALL, (LPARAM) hIconSmall);
+
+ /* If we asked the native WM to place the window, synchronize the X window position */
+ if (iX == CW_USEDEFAULT)
+ winAdjustXWindow(pWin, hWnd);
+
+ /* Change style back to popup, already placed... */
+ SetWindowLongPtr(hWnd, GWL_STYLE, WS_POPUP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS);
+ SetWindowPos (hWnd, 0, 0, 0, 0, 0,
+ SWP_FRAMECHANGED | SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
+ /* Make sure it gets the proper system menu for a WS_POPUP, too */
+ GetSystemMenu (hWnd, TRUE);
+
+ /* Cause any .XWinrc menus to be added in main WNDPROC */
+ PostMessage (hWnd, WM_INIT_SYS_MENU, 0, 0);
+
+ SetProp (hWnd, WIN_WID_PROP, (HANDLE) winGetWindowID(pWin));
+
+ /* Flag that this Windows window handles its own activation */
+ SetProp (hWnd, WIN_NEEDMANAGE_PROP, (HANDLE) 0);
+
+ /* Call engine-specific create window procedure */
+ (*pScreenPriv->pwinFinishCreateWindowsWindow) (pWin);
+}
+
+
+Bool winInDestroyWindowsWindow = FALSE;
+/*
+ * winDestroyWindowsWindow - Destroy a Windows window associated
+ * with an X window
+ */
+static void
+winDestroyWindowsWindow (WindowPtr pWin)
+{
+ MSG msg;
+ winWindowPriv(pWin);
+ BOOL oldstate = winInDestroyWindowsWindow;
+ HICON hIcon;
+ HICON hIconSm;
+
+#if CYGMULTIWINDOW_DEBUG
+ winDebug ("winDestroyWindowsWindow\n");
+#endif
+
+ /* Bail out if the Windows window handle is invalid */
+ if (pWinPriv->hWnd == NULL)
+ return;
+
+ winInDestroyWindowsWindow = TRUE;
+
+ /* Store the info we need to destroy after this window is gone */
+ hIcon = (HICON)SendMessage(pWinPriv->hWnd, WM_GETICON, ICON_BIG, 0);
+ hIconSm = (HICON)SendMessage(pWinPriv->hWnd, WM_GETICON, ICON_SMALL, 0);
+
+ SetProp (pWinPriv->hWnd, WIN_WINDOW_PROP, NULL);
+
+ /* Destroy the Windows window */
+ DestroyWindow (pWinPriv->hWnd);
+
+ /* Null our handle to the Window so referencing it will cause an error */
+ pWinPriv->hWnd = NULL;
+
+ /* Destroy any icons we created for this window */
+ winDestroyIcon(hIcon);
+ winDestroyIcon(hIconSm);
+
+ /* Process all messages on our queue */
+ while (PeekMessage (&msg, NULL, 0, 0, PM_REMOVE))
+ {
+ if (g_hDlgDepthChange == 0 || !IsDialogMessage (g_hDlgDepthChange, &msg))
+ {
+ DispatchMessage (&msg);
+ }
+ }
+
+ winInDestroyWindowsWindow = oldstate;
+
+#if CYGMULTIWINDOW_DEBUG
+ winDebug ("-winDestroyWindowsWindow\n");
+#endif
+}
+
+
+/*
+ * winUpdateWindowsWindow - Redisplay/redraw a Windows window
+ * associated with an X window
+ */
+
+static void
+winUpdateWindowsWindow (WindowPtr pWin)
+{
+ winWindowPriv(pWin);
+ HWND hWnd = pWinPriv->hWnd;
+
+#if CYGMULTIWINDOW_DEBUG
+ winDebug ("winUpdateWindowsWindow\n");
+#endif
+
+ /* Check if the Windows window's parents have been destroyed */
+ if (pWin->parent != NULL
+ && pWin->parent->parent == NULL
+ && pWin->mapped)
+ {
+ /* Create the Windows window if it has been destroyed */
+ if (hWnd == NULL)
+ {
+ winCreateWindowsWindow (pWin);
+ assert (pWinPriv->hWnd != NULL);
+ }
+
+ /* Display the window without activating it */
+ if (pWin->drawable.class != InputOnly)
+ ShowWindow (pWinPriv->hWnd, SW_SHOWNOACTIVATE);
+
+ /* Send first paint message */
+ UpdateWindow (pWinPriv->hWnd);
+ }
+ else if (hWnd != NULL)
+ {
+ if (pWinPriv->GlCtxWnd)
+ {
+ /* We do not need to destroy the window but to reparent it and move it to the
+ correct place when it is an opengl window */
+ int offsetx;
+ int offsety;
+ HWND hParentWnd;
+ WindowPtr pParent=pWin->parent;
+
+ while (pParent)
+ {
+ winWindowPriv(pParent);
+ hParentWnd=pWinPriv->hWnd;
+ if (hParentWnd)
+ break;
+ pParent=pParent->parent;
+ }
+
+ if (pParent)
+ {
+ offsetx=pParent->drawable.x;
+ offsety=pParent->drawable.y;
+ }
+ else
+ {
+ offsetx=0;
+ offsety=0;
+ }
+ winDebug ("-winUpdateWindowsWindow: %x changing parent to %x and moving to %d,%d\n",pWinPriv->hWnd,hParentWnd,pWin->drawable.x-offsetx,pWin->drawable.y-offsety);
+ SetParent(pWinPriv->hWnd,hParentWnd);
+ SetWindowPos(pWinPriv->hWnd,NULL,pWin->drawable.x-offsetx,pWin->drawable.y-offsety,0,0,SWP_NOSIZE|SWP_NOZORDER|SWP_SHOWWINDOW);
+ }
+ else
+ {
+ /* Destroy the Windows window if its parents are destroyed */
+ /* First check if we need to release the DC when it is an opengl window */
+ winDestroyWindowsWindow (pWin);
+ assert (pWinPriv->hWnd == NULL);
+ }
+ }
+
+#if CYGMULTIWINDOW_DEBUG
+ winDebug ("-winUpdateWindowsWindow\n");
+#endif
+}
+
+
+/*
+ * winGetWindowID -
+ */
+
+XID
+winGetWindowID (WindowPtr pWin)
+{
+ WindowIDPairRec wi = {pWin, 0};
+ ClientPtr c = wClient(pWin);
+
+ /* */
+ FindClientResourcesByType (c, RT_WINDOW, winFindWindow, &wi);
+
+#if CYGMULTIWINDOW_DEBUG
+ winDebug ("winGetWindowID - Window ID: %d\n", wi.id);
+#endif
+
+ return wi.id;
+}
+
+
+/*
+ * winFindWindow -
+ */
+
+static void
+winFindWindow (pointer value, XID id, pointer cdata)
+{
+ WindowIDPairPtr wi = (WindowIDPairPtr)cdata;
+
+ if (value == wi->value)
+ {
+ wi->id = id;
+ }
+}
+
+
+/*
+ * winReorderWindowsMultiWindow -
+ */
+
+void
+winReorderWindowsMultiWindow (void)
+{
+ HWND hwnd = NULL;
+ WindowPtr pWin = NULL;
+ WindowPtr pWinSib = NULL;
+ XID vlist[2];
+ static Bool fRestacking = FALSE; /* Avoid recusive calls to this function */
+ DWORD dwCurrentProcessID = GetCurrentProcessId ();
+ DWORD dwWindowProcessID = 0;
+
+ winDebug ("winReorderWindowsMultiWindow\n");
+
+ if (fRestacking)
+ {
+ /* It is a recusive call so immediately exit */
+ winDebug ("winReorderWindowsMultiWindow - "
+ "exit because fRestacking == TRUE\n");
+ return;
+ }
+ fRestacking = TRUE;
+
+ /* Loop through top level Window windows, descending in Z order */
+ for ( hwnd = GetTopWindow (NULL);
+ hwnd;
+ hwnd = GetNextWindow (hwnd, GW_HWNDNEXT) )
+ {
+ /* Don't take care of other Cygwin/X process's windows */
+ GetWindowThreadProcessId (hwnd, &dwWindowProcessID);
+
+ if ( GetProp (hwnd, WIN_WINDOW_PROP)
+ && (dwWindowProcessID == dwCurrentProcessID)
+ && !IsIconic (hwnd) ) /* ignore minimized windows */
+ {
+ pWinSib = pWin;
+ pWin = GetProp (hwnd, WIN_WINDOW_PROP);
+
+ if (!pWinSib)
+ { /* 1st window - raise to the top */
+ vlist[0] = Above;
+
+ ConfigureWindow (pWin, CWStackMode, vlist, wClient(pWin));
+ }
+ else
+ { /* 2nd or deeper windows - just below the previous one */
+ vlist[0] = winGetWindowID (pWinSib);
+ vlist[1] = Below;
+
+ ConfigureWindow (pWin, CWSibling | CWStackMode,
+ vlist, wClient(pWin));
+ }
+ }
+ }
+
+ fRestacking = FALSE;
+}
+
+
+/*
+ * winMinimizeWindow - Minimize in response to WM_CHANGE_STATE
+ */
+
+void
+winMinimizeWindow (Window id)
+{
+ WindowPtr pWin;
+ winPrivWinPtr pWinPriv;
+#ifdef XWIN_MULTIWINDOWEXTWM
+ win32RootlessWindowPtr pRLWinPriv;
+#endif
+ HWND hWnd;
+ ScreenPtr pScreen = NULL;
+ winPrivScreenPtr pScreenPriv = NULL;
+ winScreenInfo *pScreenInfo = NULL;
+
+ winDebug ("winMinimizeWindow\n");
+
+ dixLookupResourceByType((pointer) &pWin, id, RT_WINDOW, NullClient, DixUnknownAccess);
+ if (!pWin)
+ {
+ ErrorF("%s: NULL pWin. Leaving\n", __FUNCTION__);
+ return;
+ }
+
+ pScreen = pWin->drawable.pScreen;
+ if (pScreen) pScreenPriv = winGetScreenPriv(pScreen);
+ if (pScreenPriv) pScreenInfo = pScreenPriv->pScreenInfo;
+
+#ifdef XWIN_MULTIWINDOWINTWM
+ if (pScreenPriv && pScreenInfo->fInternalWM)
+ {
+ pRLWinPriv = (win32RootlessWindowPtr) RootlessFrameForWindow (pWin, FALSE);
+ hWnd = pRLWinPriv->hWnd;
+ }
+ else
+#else
+ if (pScreenPriv)
+#endif
+ {
+ pWinPriv = winGetWindowPriv (pWin);
+ hWnd = pWinPriv->hWnd;
+ }
+
+ ShowWindow (hWnd, SW_MINIMIZE);
+}
+
+
+/*
+ * CopyWindow - See Porting Layer Definition - p. 39
+ */
+void
+winCopyWindowMultiWindow (WindowPtr pWin, DDXPointRec oldpt,
+ RegionPtr oldRegion)
+{
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ winScreenPriv(pScreen);
+
+ winDebug ("CopyWindowMultiWindow\n");
+
+ WIN_UNWRAP(CopyWindow);
+ (*pScreen->CopyWindow)(pWin, oldpt, oldRegion);
+ WIN_WRAP(CopyWindow, winCopyWindowMultiWindow);
+}
+
+
+/*
+ * MoveWindow - See Porting Layer Definition - p. 42
+ */
+void
+winMoveWindowMultiWindow (WindowPtr pWin, int x, int y,
+ WindowPtr pSib, VTKind kind)
+{
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ winScreenPriv(pScreen);
+
+ winDebug ("MoveWindowMultiWindow to (%d, %d)\n", x, y);
+
+ WIN_UNWRAP(MoveWindow);
+ (*pScreen->MoveWindow)(pWin, x, y, pSib, kind);
+ WIN_WRAP(MoveWindow, winMoveWindowMultiWindow);
+}
+
+
+/*
+ * ResizeWindow - See Porting Layer Definition - p. 42
+ */
+void
+winResizeWindowMultiWindow (WindowPtr pWin, int x, int y, unsigned int w,
+ unsigned int h, WindowPtr pSib)
+{
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ winScreenPriv(pScreen);
+
+ winDebug ("ResizeWindowMultiWindow to (%d, %d) - %dx%d\n", x, y, w, h);
+
+ WIN_UNWRAP(ResizeWindow);
+ (*pScreen->ResizeWindow)(pWin, x, y, w, h, pSib);
+ WIN_WRAP(ResizeWindow, winResizeWindowMultiWindow);
+}
+
+
+/*
+ * winAdjustXWindow
+ *
+ * Move and resize X window with respect to corresponding Windows window.
+ * This is called from WM_MOVE/WM_SIZE handlers when the user performs
+ * any windowing operation (move, resize, minimize, maximize, restore).
+ *
+ * The functionality is the inverse of winPositionWindowMultiWindow, which
+ * adjusts Windows window with respect to X window.
+ */
+int
+winAdjustXWindow (WindowPtr pWin, HWND hwnd)
+{
+ RECT rcDraw; /* Rect made from pWin->drawable to be adjusted */
+ RECT rcWin; /* The source: WindowRect from hwnd */
+ DrawablePtr pDraw;
+ XID vlist[4];
+ LONG dX, dY, dW, dH, x, y;
+ DWORD dwStyle, dwExStyle;
+
+#define WIDTH(rc) (rc.right - rc.left)
+#define HEIGHT(rc) (rc.bottom - rc.top)
+
+ winDebug ("winAdjustXWindow\n");
+
+ if (IsIconic (hwnd))
+ {
+ winDebug ("\timmediately return because the window is iconized\n");
+ /*
+ * If the Windows window is minimized, its WindowRect has
+ * meaningless values so we don't adjust X window to it.
+ */
+ vlist[0] = 0;
+ vlist[1] = 0;
+ return ConfigureWindow (pWin, CWX | CWY, vlist, wClient(pWin));
+ }
+
+ pDraw = &pWin->drawable;
+
+ /* Calculate the window rect from the drawable */
+ x = pDraw->x + GetSystemMetrics (SM_XVIRTUALSCREEN);
+ y = pDraw->y + GetSystemMetrics (SM_YVIRTUALSCREEN);
+ SetRect (&rcDraw, x, y, x + pDraw->width, y + pDraw->height);
+ winDebug("\tDrawable extend {%d, %d, %d, %d}, {%d, %d}\n",
+ rcDraw.left, rcDraw.top, rcDraw.right, rcDraw.bottom,
+ rcDraw.right - rcDraw.left, rcDraw.bottom - rcDraw.top);
+ dwExStyle = GetWindowLongPtr (hwnd, GWL_EXSTYLE);
+ dwStyle = GetWindowLongPtr (hwnd, GWL_STYLE);
+ winDebug("\tWindowStyle: %08x %08x\n", dwStyle, dwExStyle);
+ AdjustWindowRectEx (&rcDraw, dwStyle, FALSE, dwExStyle);
+
+ /* The source of adjust */
+ GetWindowRect (hwnd, &rcWin);
+ winDebug("\tWindow extend {%d, %d, %d, %d}, {%d, %d}\n",
+ rcWin.left, rcWin.top, rcWin.right, rcWin.bottom,
+ rcWin.right - rcWin.left, rcWin.bottom - rcWin.top);
+ winDebug("\tDraw extend {%d, %d, %d, %d}, {%d, %d}\n",
+ rcDraw.left, rcDraw.top, rcDraw.right, rcDraw.bottom,
+ rcDraw.right - rcDraw.left, rcDraw.bottom - rcDraw.top);
+
+ if (EqualRect (&rcDraw, &rcWin)) {
+ /* Bail if no adjust is needed */
+ winDebug ("\treturn because already adjusted\n");
+ return 0;
+ }
+
+ /* Calculate delta values */
+ dX = rcWin.left - rcDraw.left;
+ dY = rcWin.top - rcDraw.top;
+ dW = WIDTH(rcWin) - WIDTH(rcDraw);
+ dH = HEIGHT(rcWin) - HEIGHT(rcDraw);
+
+ /*
+ * Adjust.
+ * We may only need to move (vlist[0] and [1]), or only resize
+ * ([2] and [3]) but currently we set all the parameters and leave
+ * the decision to ConfigureWindow. The reason is code simplicity.
+ */
+ vlist[0] = pDraw->x + dX - wBorderWidth(pWin);
+ vlist[1] = pDraw->y + dY - wBorderWidth(pWin);
+ vlist[2] = pDraw->width + dW;
+ vlist[3] = pDraw->height + dH;
+ winDebug ("\tConfigureWindow to (%ld, %ld) - %ldx%ld\n", vlist[0], vlist[1],
+ vlist[2], vlist[3]);
+ return ConfigureWindow (pWin, CWX | CWY | CWWidth | CWHeight,
+ vlist, wClient(pWin));
+
+#undef WIDTH
+#undef HEIGHT
+}
+
diff --git a/xorg-server/hw/xwin/winmultiwindowwm.c b/xorg-server/hw/xwin/winmultiwindowwm.c index 67a58a076..015192070 100644 --- a/xorg-server/hw/xwin/winmultiwindowwm.c +++ b/xorg-server/hw/xwin/winmultiwindowwm.c @@ -1,1787 +1,1755 @@ -/* - *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved. - *Copyright (C) Colin Harrison 2005-2009 - * - *Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - *"Software"), to deal in the Software without restriction, including - *without limitation the rights to use, copy, modify, merge, publish, - *distribute, sublicense, and/or sell copies of the Software, and to - *permit persons to whom the Software is furnished to do so, subject to - *the following conditions: - * - *The above copyright notice and this permission notice shall be - *included in all copies or substantial portions of the Software. - * - *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR - *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - *Except as contained in this notice, the name of the XFree86 Project - *shall not be used in advertising or otherwise to promote the sale, use - *or other dealings in this Software without prior written authorization - *from the XFree86 Project. - * - * Authors: Kensuke Matsuzaki - * Colin Harrison - */ - -/* X headers */ -#ifdef HAVE_XWIN_CONFIG_H -#include <xwin-config.h> -#endif -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#ifdef __CYGWIN__ -#include <sys/select.h> -#endif -#include <fcntl.h> -#include <setjmp.h> -#define HANDLE void * -#include <pthread.h> -#undef HANDLE -#include <X11/X.h> -#include <X11/Xatom.h> -#include <X11/Xlib.h> -#include <X11/Xlocale.h> -#include <X11/Xproto.h> -#include <X11/Xutil.h> -#include <X11/cursorfont.h> -#include <X11/Xwindows.h> - -/* Local headers */ -#include "objbase.h" -#include "ddraw.h" -#include "winwindow.h" -#include "winprefs.h" -#include "window.h" -#include "pixmapstr.h" -#include "windowstr.h" - -#ifdef XWIN_MULTIWINDOWEXTWM -#include <X11/extensions/windowswmstr.h> -#else -/* We need the native HWND atom for intWM, so for consistency use the - same name as extWM would if we were building with enabled... */ -#define WINDOWSWM_NATIVE_HWND "_WINDOWSWM_NATIVE_HWND" -#endif - -extern void winDebug(const char *format, ...); -extern void winReshapeMultiWindow(WindowPtr pWin); -extern void winUpdateRgnMultiWindow(WindowPtr pWin); - -#ifndef CYGDEBUG -#define CYGDEBUG NO -#endif - -/* - * Constant defines - */ - -#define WIN_CONNECT_RETRIES 5 -#define WIN_CONNECT_DELAY 5 -#ifdef HAS_DEVWINDOWS -# define WIN_MSG_QUEUE_FNAME "/dev/windows" -#endif -#define WIN_JMP_OKAY 0 -#define WIN_JMP_ERROR_IO 2 - -/* - * Local structures - */ - -typedef struct _WMMsgNodeRec { - winWMMessageRec msg; - struct _WMMsgNodeRec *pNext; -} WMMsgNodeRec, *WMMsgNodePtr; - -typedef struct _WMMsgQueueRec { - struct _WMMsgNodeRec *pHead; - struct _WMMsgNodeRec *pTail; - pthread_mutex_t pmMutex; - pthread_cond_t pcNotEmpty; - int nQueueSize; -} WMMsgQueueRec, *WMMsgQueuePtr; - -typedef struct _WMInfo { - Display *pDisplay; - WMMsgQueueRec wmMsgQueue; - Atom atmWmProtos; - Atom atmWmDelete; - Atom atmPrivMap; - Bool fAllowOtherWM; -} WMInfoRec, *WMInfoPtr; - -typedef struct _WMProcArgRec { - DWORD dwScreen; - WMInfoPtr pWMInfo; - pthread_mutex_t *ppmServerStarted; -} WMProcArgRec, *WMProcArgPtr; - -typedef struct _XMsgProcArgRec { - Display *pDisplay; - DWORD dwScreen; - WMInfoPtr pWMInfo; - pthread_mutex_t *ppmServerStarted; - HWND hwndScreen; -} XMsgProcArgRec, *XMsgProcArgPtr; - - -/* - * References to external symbols - */ - -extern char *display; -extern void ErrorF (const char* /*f*/, ...); - -/* - * Prototypes for local functions - */ - -static void -PushMessage (WMMsgQueuePtr pQueue, WMMsgNodePtr pNode); - -static WMMsgNodePtr -PopMessage (WMMsgQueuePtr pQueue, WMInfoPtr pWMInfo); - -static Bool -InitQueue (WMMsgQueuePtr pQueue); - -static void -GetWindowName (Display * pDpy, Window iWin, wchar_t **ppName); - -static int -SendXMessage (Display *pDisplay, Window iWin, Atom atmType, long nData); - -static void -UpdateName (WMInfoPtr pWMInfo, Window iWindow); - -static void* -winMultiWindowWMProc (void* pArg); - -static int -winMultiWindowWMErrorHandler (Display *pDisplay, XErrorEvent *pErr); - -static int -winMultiWindowWMIOErrorHandler (Display *pDisplay); - -static void * -winMultiWindowXMsgProc (void *pArg); - -static int -winMultiWindowXMsgProcErrorHandler (Display *pDisplay, XErrorEvent *pErr); - -static int -winMultiWindowXMsgProcIOErrorHandler (Display *pDisplay); - -static int -winRedirectErrorHandler (Display *pDisplay, XErrorEvent *pErr); - -static void -winInitMultiWindowWM (WMInfoPtr pWMInfo, WMProcArgPtr pProcArg); - -#if 0 -static void -PreserveWin32Stack(WMInfoPtr pWMInfo, Window iWindow, UINT direction); -#endif - -static Bool -CheckAnotherWindowManager (Display *pDisplay, DWORD dwScreen, Bool fAllowOtherWM); - -static void -winApplyHints (Display *pDisplay, Window iWindow, HWND hWnd, HWND *zstyle); - -void -winUpdateWindowPosition (HWND hWnd, Bool reshape, HWND *zstyle); - -/* - * Local globals - */ - -static jmp_buf g_jmpWMEntry; -static jmp_buf g_jmpXMsgProcEntry; -static Bool g_shutdown = FALSE; -static Bool redirectError = FALSE; -static Bool g_fAnotherWMRunning = FALSE; - -/* - * PushMessage - Push a message onto the queue - */ - -static void -PushMessage (WMMsgQueuePtr pQueue, WMMsgNodePtr pNode) -{ - - /* Lock the queue mutex */ - pthread_mutex_lock (&pQueue->pmMutex); - - pNode->pNext = NULL; - - if (pQueue->pTail != NULL) - { - pQueue->pTail->pNext = pNode; - } - pQueue->pTail = pNode; - - if (pQueue->pHead == NULL) - { - pQueue->pHead = pNode; - } - - -#if 0 - switch (pNode->msg.msg) - { - case WM_WM_MOVE: - ErrorF ("\tWM_WM_MOVE\n"); - break; - case WM_WM_SIZE: - ErrorF ("\tWM_WM_SIZE\n"); - break; - case WM_WM_RAISE: - ErrorF ("\tWM_WM_RAISE\n"); - break; - case WM_WM_LOWER: - ErrorF ("\tWM_WM_LOWER\n"); - break; - case WM_WM_MAP: - ErrorF ("\tWM_WM_MAP\n"); - break; - case WM_WM_MAP2: - ErrorF ("\tWM_WM_MAP2\n"); - break; - case WM_WM_MAP3: - ErrorF ("\tWM_WM_MAP3\n"); - break; - case WM_WM_UNMAP: - ErrorF ("\tWM_WM_UNMAP\n"); - break; - case WM_WM_KILL: - ErrorF ("\tWM_WM_KILL\n"); - break; - case WM_WM_ACTIVATE: - ErrorF ("\tWM_WM_ACTIVATE\n"); - break; - default: - ErrorF ("\tUnknown Message.\n"); - break; - } -#endif - - /* Increase the count of elements in the queue by one */ - ++(pQueue->nQueueSize); - - /* Release the queue mutex */ - pthread_mutex_unlock (&pQueue->pmMutex); - - /* Signal that the queue is not empty */ - pthread_cond_signal (&pQueue->pcNotEmpty); -} - - -#if CYGMULTIWINDOW_DEBUG -/* - * QueueSize - Return the size of the queue - */ - -static int -QueueSize (WMMsgQueuePtr pQueue) -{ - WMMsgNodePtr pNode; - int nSize = 0; - - /* Loop through all elements in the queue */ - for (pNode = pQueue->pHead; pNode != NULL; pNode = pNode->pNext) - ++nSize; - - return nSize; -} -#endif - - -/* - * PopMessage - Pop a message from the queue - */ - -static WMMsgNodePtr -PopMessage (WMMsgQueuePtr pQueue, WMInfoPtr pWMInfo) -{ - WMMsgNodePtr pNode; - - /* Lock the queue mutex */ - pthread_mutex_lock (&pQueue->pmMutex); - - /* Wait for --- */ - while (pQueue->pHead == NULL) - { - pthread_cond_wait (&pQueue->pcNotEmpty, &pQueue->pmMutex); - } - - pNode = pQueue->pHead; - if (pQueue->pHead != NULL) - { - pQueue->pHead = pQueue->pHead->pNext; - } - - if (pQueue->pTail == pNode) - { - pQueue->pTail = NULL; - } - - /* Drop the number of elements in the queue by one */ - --(pQueue->nQueueSize); - -#if CYGMULTIWINDOW_DEBUG - ErrorF ("Queue Size %d %d\n", pQueue->nQueueSize, QueueSize(pQueue)); -#endif - - /* Release the queue mutex */ - pthread_mutex_unlock (&pQueue->pmMutex); - - return pNode; -} - - -#if 0 -/* - * HaveMessage - - */ - -static Bool -HaveMessage (WMMsgQueuePtr pQueue, UINT msg, Window iWindow) -{ - WMMsgNodePtr pNode; - - for (pNode = pQueue->pHead; pNode != NULL; pNode = pNode->pNext) - { - if (pNode->msg.msg==msg && pNode->msg.iWindow==iWindow) - return True; - } - - return False; -} -#endif - - -/* - * InitQueue - Initialize the Window Manager message queue - */ - -static -Bool -InitQueue (WMMsgQueuePtr pQueue) -{ - /* Check if the pQueue pointer is NULL */ - if (pQueue == NULL) - { - ErrorF ("InitQueue - pQueue is NULL. Exiting.\n"); - return FALSE; - } - - /* Set the head and tail to NULL */ - pQueue->pHead = NULL; - pQueue->pTail = NULL; - - /* There are no elements initially */ - pQueue->nQueueSize = 0; - -#if CYGMULTIWINDOW_DEBUG - ErrorF ("InitQueue - Queue Size %d %d\n", pQueue->nQueueSize, - QueueSize(pQueue)); -#endif - - ErrorF ("InitQueue - Calling pthread_mutex_init\n"); - - /* Create synchronization objects */ - pthread_mutex_init (&pQueue->pmMutex, NULL); - - ErrorF ("InitQueue - pthread_mutex_init returned\n"); - ErrorF ("InitQueue - Calling pthread_cond_init\n"); - - pthread_cond_init (&pQueue->pcNotEmpty, NULL); - - ErrorF ("InitQueue - pthread_cond_init returned\n"); - - return TRUE; -} - - -/* - * GetWindowName - Retrieve the title of an X Window - */ - -static void -GetWindowName (Display *pDisplay, Window iWin, wchar_t **ppName) -{ - int nResult, nNum; - char **ppList; - char *pszReturnData; - int iLen, i; - XTextProperty xtpName; - -#if CYGMULTIWINDOW_DEBUG - ErrorF ("GetWindowName\n"); -#endif - - /* Intialize ppName to NULL */ - *ppName = NULL; - - /* Try to get --- */ - nResult = XGetWMName (pDisplay, iWin, &xtpName); - if (!nResult || !xtpName.value || !xtpName.nitems) - { -#if CYGMULTIWINDOW_DEBUG - ErrorF ("GetWindowName - XGetWMName failed. No name.\n"); -#endif - return; - } - - if (Xutf8TextPropertyToTextList (pDisplay, &xtpName, &ppList, &nNum) >= Success && nNum > 0 && *ppList) - { - iLen = 0; - for (i = 0; i < nNum; i++) iLen += strlen(ppList[i]); - pszReturnData = (char *) malloc (iLen + 1); - pszReturnData[0] = '\0'; - for (i = 0; i < nNum; i++) strcat (pszReturnData, ppList[i]); - if (ppList) XFreeStringList (ppList); - } - else - { - pszReturnData = (char *) malloc (1); - pszReturnData[0] = '\0'; - } - iLen = MultiByteToWideChar (CP_UTF8, 0, pszReturnData, -1, NULL, 0); - *ppName = (wchar_t*)malloc(sizeof(wchar_t)*(iLen + 1)); - MultiByteToWideChar (CP_UTF8, 0, pszReturnData, -1, *ppName, iLen); - XFree (xtpName.value); - free (pszReturnData); - -#if CYGMULTIWINDOW_DEBUG - ErrorF ("GetWindowName - Returning\n"); -#endif -} - - -/* - * Send a message to the X server from the WM thread - */ - -static int -SendXMessage (Display *pDisplay, Window iWin, Atom atmType, long nData) -{ - XEvent e; - - /* Prepare the X event structure */ - e.type = ClientMessage; - e.xclient.window = iWin; - e.xclient.message_type = atmType; - e.xclient.format = 32; - e.xclient.data.l[0] = nData; - e.xclient.data.l[1] = CurrentTime; - - /* Send the event to X */ - return XSendEvent (pDisplay, iWin, False, NoEventMask, &e); -} - - -/* - * Updates the name of a HWND according to its X WM_NAME property - */ - -static void -UpdateName (WMInfoPtr pWMInfo, Window iWindow) -{ - wchar_t *pszName; - Atom atmType; - int fmtRet; - unsigned long items, remain; - HWND *retHwnd, hWnd; - XWindowAttributes attr; - - hWnd = 0; - - /* See if we can get the cached HWND for this window... */ - if (XGetWindowProperty (pWMInfo->pDisplay, - iWindow, - pWMInfo->atmPrivMap, - 0, - 1, - False, - XA_INTEGER,//pWMInfo->atmPrivMap, - &atmType, - &fmtRet, - &items, - &remain, - (unsigned char **) &retHwnd) == Success) - { - if (retHwnd) - { - hWnd = *retHwnd; - XFree (retHwnd); - } - } - - /* Some sanity checks */ - if (!hWnd) return; - if (!IsWindow (hWnd)) return; - - /* Set the Windows window name */ - GetWindowName (pWMInfo->pDisplay, iWindow, &pszName); - if (pszName) - { - /* Get the window attributes */ - XGetWindowAttributes (pWMInfo->pDisplay, - iWindow, - &attr); - if (!attr.override_redirect) - { - SetWindowTextW (hWnd, pszName); - winUpdateIcon (iWindow); - } - - free (pszName); - } -} - - -#if 0 -/* - * Fix up any differences between the X11 and Win32 window stacks - * starting at the window passed in - */ -static void -PreserveWin32Stack(WMInfoPtr pWMInfo, Window iWindow, UINT direction) -{ - Atom atmType; - int fmtRet; - unsigned long items, remain; - HWND hWnd, *retHwnd; - DWORD myWinProcID, winProcID; - Window xWindow; - WINDOWPLACEMENT wndPlace; - - hWnd = NULL; - /* See if we can get the cached HWND for this window... */ - if (XGetWindowProperty (pWMInfo->pDisplay, - iWindow, - pWMInfo->atmPrivMap, - 0, - 1, - False, - XA_INTEGER,//pWMInfo->atmPrivMap, - &atmType, - &fmtRet, - &items, - &remain, - (unsigned char **) &retHwnd) == Success) - { - if (retHwnd) - { - hWnd = *retHwnd; - XFree (retHwnd); - } - } - - if (!hWnd) return; - - GetWindowThreadProcessId (hWnd, &myWinProcID); - hWnd = GetNextWindow (hWnd, direction); - - while (hWnd) { - GetWindowThreadProcessId (hWnd, &winProcID); - if (winProcID == myWinProcID) - { - wndPlace.length = sizeof(WINDOWPLACEMENT); - GetWindowPlacement (hWnd, &wndPlace); - if ( !(wndPlace.showCmd==SW_HIDE || - wndPlace.showCmd==SW_MINIMIZE) ) - { - xWindow = (Window)GetProp (hWnd, WIN_WID_PROP); - if (xWindow) - { - if (direction==GW_HWNDPREV) - XRaiseWindow (pWMInfo->pDisplay, xWindow); - else - XLowerWindow (pWMInfo->pDisplay, xWindow); - } - } - } - hWnd = GetNextWindow(hWnd, direction); - } -} -#endif /* PreserveWin32Stack */ - - -/* - * winMultiWindowWMProc - */ - -static void * -winMultiWindowWMProc (void *pArg) -{ - WMProcArgPtr pProcArg = (WMProcArgPtr)pArg; - WMInfoPtr pWMInfo = pProcArg->pWMInfo; - - /* Initialize the Window Manager */ - winInitMultiWindowWM (pWMInfo, pProcArg); - -#if CYGMULTIWINDOW_DEBUG - ErrorF ("winMultiWindowWMProc ()\n"); -#endif - - /* Loop until we explicitly break out */ - for (;;) - { - WMMsgNodePtr pNode; - - if(g_fAnotherWMRunning)/* Another Window manager exists. */ - { - Sleep (1000); - continue; - } - - /* Pop a message off of our queue */ - pNode = PopMessage (&pWMInfo->wmMsgQueue, pWMInfo); - if (pNode == NULL) - { - /* Bail if PopMessage returns without a message */ - /* NOTE: Remember that PopMessage is a blocking function. */ - ErrorF ("winMultiWindowWMProc - Queue is Empty? Exiting.\n"); - pthread_exit (NULL); - } - -#if CYGMULTIWINDOW_DEBUG - ErrorF ("winMultiWindowWMProc - %d ms MSG: %d ID: %d\n", - GetTickCount (), (int)pNode->msg.msg, (int)pNode->msg.dwID); -#endif - - /* Branch on the message type */ - switch (pNode->msg.msg) - { -#if 0 - case WM_WM_MOVE: - ErrorF ("\tWM_WM_MOVE\n"); - break; - - case WM_WM_SIZE: - ErrorF ("\tWM_WM_SIZE\n"); - break; -#endif - - case WM_WM_RAISE: -#if CYGMULTIWINDOW_DEBUG - ErrorF ("\tWM_WM_RAISE\n"); -#endif - /* Raise the window */ - XRaiseWindow (pWMInfo->pDisplay, pNode->msg.iWindow); -#if 0 - PreserveWin32Stack (pWMInfo, pNode->msg.iWindow, GW_HWNDPREV); -#endif - break; - - case WM_WM_LOWER: -#if CYGMULTIWINDOW_DEBUG - ErrorF ("\tWM_WM_LOWER\n"); -#endif - - /* Lower the window */ - XLowerWindow (pWMInfo->pDisplay, pNode->msg.iWindow); - break; - - case WM_WM_MAP: -#if CYGMULTIWINDOW_DEBUG - ErrorF ("\tWM_WM_MAP\n"); -#endif - /* Put a note as to the HWND associated with this Window */ - XChangeProperty (pWMInfo->pDisplay, - pNode->msg.iWindow, - pWMInfo->atmPrivMap, - XA_INTEGER,//pWMInfo->atmPrivMap, - 32, - PropModeReplace, - (unsigned char *) &(pNode->msg.hwndWindow), - 1); - UpdateName (pWMInfo, pNode->msg.iWindow); - winUpdateIcon (pNode->msg.iWindow); - break; - - case WM_WM_MAP2: -#if CYGMULTIWINDOW_DEBUG - ErrorF ("\tWM_WM_MAP2\n"); -#endif - XChangeProperty (pWMInfo->pDisplay, - pNode->msg.iWindow, - pWMInfo->atmPrivMap, - XA_INTEGER,//pWMInfo->atmPrivMap, - 32, - PropModeReplace, - (unsigned char *) &(pNode->msg.hwndWindow), - 1); - break; - - case WM_WM_MAP3: -#if CYGMULTIWINDOW_DEBUG - ErrorF ("\tWM_WM_MAP3\n"); -#endif - /* Put a note as to the HWND associated with this Window */ - XChangeProperty (pWMInfo->pDisplay, - pNode->msg.iWindow, - pWMInfo->atmPrivMap, - XA_INTEGER,//pWMInfo->atmPrivMap, - 32, - PropModeReplace, - (unsigned char *) &(pNode->msg.hwndWindow), - 1); - UpdateName (pWMInfo, pNode->msg.iWindow); - winUpdateIcon (pNode->msg.iWindow); - { - HWND zstyle = HWND_NOTOPMOST; - winApplyHints (pWMInfo->pDisplay, pNode->msg.iWindow, pNode->msg.hwndWindow, &zstyle); - winUpdateWindowPosition (pNode->msg.hwndWindow, TRUE, &zstyle); - } - break; - - case WM_WM_UNMAP: -#if CYGMULTIWINDOW_DEBUG - ErrorF ("\tWM_WM_UNMAP\n"); -#endif - - /* Unmap the window */ - XUnmapWindow (pWMInfo->pDisplay, pNode->msg.iWindow); - break; - - case WM_WM_KILL: -#if CYGMULTIWINDOW_DEBUG - ErrorF ("\tWM_WM_KILL\n"); -#endif - { - int i, n, found = 0; - Atom *protocols; - - /* --- */ - if (XGetWMProtocols (pWMInfo->pDisplay, - pNode->msg.iWindow, - &protocols, - &n)) - { - for (i = 0; i < n; ++i) - if (protocols[i] == pWMInfo->atmWmDelete) - ++found; - - XFree (protocols); - } - - /* --- */ - if (found) - SendXMessage (pWMInfo->pDisplay, - pNode->msg.iWindow, - pWMInfo->atmWmProtos, - pWMInfo->atmWmDelete); - else - XKillClient (pWMInfo->pDisplay, - pNode->msg.iWindow); - } - break; - - case WM_WM_ACTIVATE: -#if CYGMULTIWINDOW_DEBUG - ErrorF ("\tWM_WM_ACTIVATE\n"); -#endif - - /* Set the input focus */ - XSetInputFocus (pWMInfo->pDisplay, - pNode->msg.iWindow, - RevertToPointerRoot, - CurrentTime); - break; - - case WM_WM_NAME_EVENT: - UpdateName (pWMInfo, pNode->msg.iWindow); - break; - - case WM_WM_HINTS_EVENT: - winUpdateIcon (pNode->msg.iWindow); - break; - - case WM_WM_CHANGE_STATE: - /* Minimize the window in Windows */ - winMinimizeWindow (pNode->msg.iWindow); - break; - - default: - ErrorF ("winMultiWindowWMProc - Unknown Message. Exiting.\n"); - pthread_exit (NULL); - break; - } - - /* Free the retrieved message */ - free (pNode); - - /* Flush any pending events on our display */ - XFlush (pWMInfo->pDisplay); - } - - /* Free the condition variable */ - pthread_cond_destroy (&pWMInfo->wmMsgQueue.pcNotEmpty); - - /* Free the mutex variable */ - pthread_mutex_destroy (&pWMInfo->wmMsgQueue.pmMutex); - - /* Free the passed-in argument */ - free (pProcArg); - -#if CYGMULTIWINDOW_DEBUG - ErrorF("-winMultiWindowWMProc ()\n"); -#endif - return NULL; -} - - -/* - * X message procedure - */ - -static void * -winMultiWindowXMsgProc (void *pArg) -{ - winWMMessageRec msg; - XMsgProcArgPtr pProcArg = (XMsgProcArgPtr) pArg; - char pszDisplay[512]; - int iRetries; - XEvent event; - Atom atmWmName; - Atom atmWmHints; - Atom atmWmChange; - int iReturn; - XIconSize *xis; - - ErrorF ("winMultiWindowXMsgProc - Hello\n"); - - /* Check that argument pointer is not invalid */ - if (pProcArg == NULL) - { - ErrorF ("winMultiWindowXMsgProc - pProcArg is NULL. Exiting.\n"); - pthread_exit (NULL); - } - - ErrorF ("winMultiWindowXMsgProc - Calling pthread_mutex_lock ()\n"); - - /* Grab the server started mutex - pause until we get it */ - iReturn = pthread_mutex_lock (pProcArg->ppmServerStarted); - if (iReturn != 0) - { - ErrorF ("winMultiWindowXMsgProc - pthread_mutex_lock () failed: %d. " - "Exiting.\n", - iReturn); - pthread_exit (NULL); - } - - ErrorF ("winMultiWindowXMsgProc - pthread_mutex_lock () returned.\n"); - - /* Allow multiple threads to access Xlib */ - if (XInitThreads () == 0) - { - ErrorF ("winMultiWindowXMsgProc - XInitThreads () failed. Exiting.\n"); - pthread_exit (NULL); - } - - /* See if X supports the current locale */ - if (XSupportsLocale () == False) - { - ErrorF ("winMultiWindowXMsgProc - Warning: locale not supported by X\n"); - } - - /* Release the server started mutex */ - pthread_mutex_unlock (pProcArg->ppmServerStarted); - - ErrorF ("winMultiWindowXMsgProc - pthread_mutex_unlock () returned.\n"); - - /* Set jump point for IO Error exits */ - iReturn = setjmp (g_jmpXMsgProcEntry); - - /* Check if we should continue operations */ - if (iReturn != WIN_JMP_ERROR_IO - && iReturn != WIN_JMP_OKAY) - { - /* setjmp returned an unknown value, exit */ - ErrorF ("winInitMultiWindowXMsgProc - setjmp returned: %d. Exiting.\n", - iReturn); - pthread_exit (NULL); - } - else if (iReturn == WIN_JMP_ERROR_IO) - { - ErrorF ("winInitMultiWindowXMsgProc - Caught IO Error. Exiting.\n"); - pthread_exit (NULL); - } - - /* Install our error handler */ - XSetErrorHandler (winMultiWindowXMsgProcErrorHandler); - XSetIOErrorHandler (winMultiWindowXMsgProcIOErrorHandler); - - /* Setup the display connection string x */ - snprintf (pszDisplay, - 512, "127.0.0.1:%s.%d", display, (int)pProcArg->dwScreen); - - /* Print the display connection string */ - ErrorF ("winMultiWindowXMsgProc - DISPLAY=%s\n", pszDisplay); - - /* Use our generated cookie for authentication */ - winSetAuthorization(); - - /* Initialize retry count */ - iRetries = 0; - - /* Open the X display */ - do - { - /* Try to open the display */ - pProcArg->pDisplay = XOpenDisplay (pszDisplay); - if (pProcArg->pDisplay == NULL) - { - ErrorF ("winMultiWindowXMsgProc - Could not open display, try: %d, " - "sleeping: %d\n", - iRetries + 1, WIN_CONNECT_DELAY); - ++iRetries; - sleep (WIN_CONNECT_DELAY); - continue; - } - else - break; - } - while (pProcArg->pDisplay == NULL && iRetries < WIN_CONNECT_RETRIES); - - /* Make sure that the display opened */ - if (pProcArg->pDisplay == NULL) - { - ErrorF ("winMultiWindowXMsgProc - Failed opening the display. " - "Exiting.\n"); - pthread_exit (NULL); - } - - ErrorF ("winMultiWindowXMsgProc - XOpenDisplay () returned and " - "successfully opened the display.\n"); - - /* Check if another window manager is already running */ - g_fAnotherWMRunning = CheckAnotherWindowManager (pProcArg->pDisplay, pProcArg->dwScreen, pProcArg->pWMInfo->fAllowOtherWM); - - if (g_fAnotherWMRunning && !pProcArg->pWMInfo->fAllowOtherWM) - { - ErrorF ("winMultiWindowXMsgProc - " - "another window manager is running. Exiting.\n"); - pthread_exit (NULL); - } - - /* Set up the supported icon sizes */ - xis = XAllocIconSize (); - if (xis) - { - xis->min_width = xis->min_height = 16; - xis->max_width = xis->max_height = 48; - xis->width_inc = xis->height_inc = 16; - XSetIconSizes (pProcArg->pDisplay, - RootWindow (pProcArg->pDisplay, pProcArg->dwScreen), - xis, - 1); - XFree (xis); - } - - atmWmName = XInternAtom (pProcArg->pDisplay, - "WM_NAME", - False); - atmWmHints = XInternAtom (pProcArg->pDisplay, - "WM_HINTS", - False); - atmWmChange = XInternAtom (pProcArg->pDisplay, - "WM_CHANGE_STATE", - False); - - /* - iiimxcf had a bug until 2009-04-27, assuming that the - WM_STATE atom exists, causing clients to fail with - a BadAtom X error if it doesn't. - - Since this is on in the default Solaris 10 install, - workaround this by making sure it does exist... - */ - XInternAtom(pProcArg->pDisplay, "WM_STATE", 0); - - /* Loop until we explicitly break out */ - while (1) - { - if (g_shutdown) - break; - - if (pProcArg->pWMInfo->fAllowOtherWM && !XPending (pProcArg->pDisplay)) - { - if (CheckAnotherWindowManager (pProcArg->pDisplay, pProcArg->dwScreen, TRUE)) - { - if (!g_fAnotherWMRunning) - { - g_fAnotherWMRunning = TRUE; - SendMessage(*(HWND*)pProcArg->hwndScreen, WM_UNMANAGE, 0, 0); - } - } - else - { - if (g_fAnotherWMRunning) - { - g_fAnotherWMRunning = FALSE; - SendMessage(*(HWND*)pProcArg->hwndScreen, WM_MANAGE, 0, 0); - } - } - Sleep (500); - continue; - } - - /* Fetch next event */ - XNextEvent (pProcArg->pDisplay, &event); - - /* Branch on event type */ - if (event.type == CreateNotify) - { - XWindowAttributes attr; - - XSelectInput (pProcArg->pDisplay, - event.xcreatewindow.window, - PropertyChangeMask); - - /* Get the window attributes */ - XGetWindowAttributes (pProcArg->pDisplay, - event.xcreatewindow.window, - &attr); - - if (!attr.override_redirect) - XSetWindowBorderWidth(pProcArg->pDisplay, - event.xcreatewindow.window, - 0); - } - else if (event.type == MapNotify) - { - /* Fake a reparentNotify event as SWT/Motif expects a - Window Manager to reparent a top-level window when - it is mapped and waits until they do. - - We don't actually need to reparent, as the frame is - a native window, not an X window - - We do this on MapNotify, not MapRequest like a real - Window Manager would, so we don't have do get involved - in actually mapping the window via it's (non-existent) - parent... - - See sourceware bugzilla #9848 - */ - - XWindowAttributes attr; - Window root; - Window parent; - Window *children; - unsigned int nchildren; - - if (XGetWindowAttributes(event.xmap.display, - event.xmap.window, - &attr) && - XQueryTree(event.xmap.display, - event.xmap.window, - &root, &parent, &children, &nchildren)) - { - if (children) XFree(children); - - /* - It's a top-level window if the parent window is a root window - Only non-override_redirect windows can get reparented - */ - if ((attr.root == parent) && !event.xmap.override_redirect) - { - XEvent event_send; - - event_send.type = ReparentNotify; - event_send.xreparent.event = event.xmap.window; - event_send.xreparent.window = event.xmap.window; - event_send.xreparent.parent = parent; - event_send.xreparent.x = attr.x; - event_send.xreparent.y = attr.y; - - XSendEvent(event.xmap.display, - event.xmap.window, - True, StructureNotifyMask, - &event_send); - } - } - } - else if (event.type == ConfigureNotify) - { - if (!event.xconfigure.send_event) - { - /* - Java applications using AWT on JRE 1.6.0 break with non-reparenting WMs AWT - doesn't explicitly know about (See sun bug #6434227) - - XDecoratedPeer.handleConfigureNotifyEvent() only processes non-synthetic - ConfigureNotify events to update window location if it's identified the - WM as a non-reparenting WM it knows about (compiz or lookingglass) - - Rather than tell all sorts of lies to get XWM to recognize us as one of - those, simply send a synthetic ConfigureNotify for every non-synthetic one - */ - XEvent event_send = event; - event_send.xconfigure.send_event = TRUE; - event_send.xconfigure.event = event.xconfigure.window; - XSendEvent(event.xconfigure.display, - event.xconfigure.window, - True, StructureNotifyMask, - &event_send); - } - } - else if (event.type == PropertyNotify - && event.xproperty.atom == atmWmName) - { - memset (&msg, 0, sizeof (msg)); - - msg.msg = WM_WM_NAME_EVENT; - msg.iWindow = event.xproperty.window; - - /* Other fields ignored */ - winSendMessageToWM (pProcArg->pWMInfo, &msg); - } - else if (event.type == PropertyNotify - && event.xproperty.atom == atmWmHints) - { - memset (&msg, 0, sizeof (msg)); - - msg.msg = WM_WM_HINTS_EVENT; - msg.iWindow = event.xproperty.window; - - /* Other fields ignored */ - winSendMessageToWM (pProcArg->pWMInfo, &msg); - } - else if (event.type == ClientMessage - && event.xclient.message_type == atmWmChange - && event.xclient.data.l[0] == IconicState) - { - ErrorF ("winMultiWindowXMsgProc - WM_CHANGE_STATE - IconicState\n"); - - memset (&msg, 0, sizeof (msg)); - - msg.msg = WM_WM_CHANGE_STATE; - msg.iWindow = event.xclient.window; - - winSendMessageToWM (pProcArg->pWMInfo, &msg); - } - } - - XCloseDisplay (pProcArg->pDisplay); - pthread_exit (NULL); - return NULL; -} - - -/* - * winInitWM - Entry point for the X server to spawn - * the Window Manager thread. Called from - * winscrinit.c/winFinishScreenInitFB (). - */ - -Bool -winInitWM (void **ppWMInfo, - pthread_t *ptWMProc, - pthread_t *ptXMsgProc, - pthread_mutex_t *ppmServerStarted, - int dwScreen, - HWND hwndScreen, - BOOL allowOtherWM) -{ - WMProcArgPtr pArg = (WMProcArgPtr) malloc (sizeof(WMProcArgRec)); - WMInfoPtr pWMInfo = (WMInfoPtr) malloc (sizeof(WMInfoRec)); - XMsgProcArgPtr pXMsgArg = (XMsgProcArgPtr) malloc (sizeof(XMsgProcArgRec)); - - /* Bail if the input parameters are bad */ - if (pArg == NULL || pWMInfo == NULL) - { - ErrorF ("winInitWM - malloc failed.\n"); - return FALSE; - } - - /* Zero the allocated memory */ - ZeroMemory (pArg, sizeof (WMProcArgRec)); - ZeroMemory (pWMInfo, sizeof (WMInfoRec)); - ZeroMemory (pXMsgArg, sizeof (XMsgProcArgRec)); - - /* Set a return pointer to the Window Manager info structure */ - *ppWMInfo = pWMInfo; - pWMInfo->fAllowOtherWM = allowOtherWM; - - /* Setup the argument structure for the thread function */ - pArg->dwScreen = dwScreen; - pArg->pWMInfo = pWMInfo; - pArg->ppmServerStarted = ppmServerStarted; - - /* Intialize the message queue */ - if (!InitQueue (&pWMInfo->wmMsgQueue)) - { - ErrorF ("winInitWM - InitQueue () failed.\n"); - return FALSE; - } - - /* Spawn a thread for the Window Manager */ - if (pthread_create (ptWMProc, NULL, winMultiWindowWMProc, pArg)) - { - /* Bail if thread creation failed */ - ErrorF ("winInitWM - pthread_create failed for Window Manager.\n"); - return FALSE; - } - - /* Spawn the XNextEvent thread, will send messages to WM */ - pXMsgArg->dwScreen = dwScreen; - pXMsgArg->pWMInfo = pWMInfo; - pXMsgArg->ppmServerStarted = ppmServerStarted; - pXMsgArg->hwndScreen = hwndScreen; - if (pthread_create (ptXMsgProc, NULL, winMultiWindowXMsgProc, pXMsgArg)) - { - /* Bail if thread creation failed */ - ErrorF ("winInitWM - pthread_create failed on XMSG.\n"); - return FALSE; - } - -#if CYGDEBUG || YES - winDebug ("winInitWM - Returning.\n"); -#endif - - return TRUE; -} - - -/* - * Window manager thread - setup - */ - -static void -winInitMultiWindowWM (WMInfoPtr pWMInfo, WMProcArgPtr pProcArg) -{ - int iRetries = 0; - char pszDisplay[512]; - int iReturn; - - ErrorF ("winInitMultiWindowWM - Hello\n"); - - /* Check that argument pointer is not invalid */ - if (pProcArg == NULL) - { - ErrorF ("winInitMultiWindowWM - pProcArg is NULL. Exiting.\n"); - pthread_exit (NULL); - } - - ErrorF ("winInitMultiWindowWM - Calling pthread_mutex_lock ()\n"); - - /* Grab our garbage mutex to satisfy pthread_cond_wait */ - iReturn = pthread_mutex_lock (pProcArg->ppmServerStarted); - if (iReturn != 0) - { - ErrorF ("winInitMultiWindowWM - pthread_mutex_lock () failed: %d. " - "Exiting.\n", - iReturn); - pthread_exit (NULL); - } - - ErrorF ("winInitMultiWindowWM - pthread_mutex_lock () returned.\n"); - - /* Allow multiple threads to access Xlib */ - if (XInitThreads () == 0) - { - ErrorF ("winInitMultiWindowWM - XInitThreads () failed. Exiting.\n"); - pthread_exit (NULL); - } - - /* See if X supports the current locale */ - if (XSupportsLocale () == False) - { - ErrorF ("winInitMultiWindowWM - Warning: Locale not supported by X.\n"); - } - - /* Release the server started mutex */ - pthread_mutex_unlock (pProcArg->ppmServerStarted); - - ErrorF ("winInitMultiWindowWM - pthread_mutex_unlock () returned.\n"); - - /* Set jump point for IO Error exits */ - iReturn = setjmp (g_jmpWMEntry); - - /* Check if we should continue operations */ - if (iReturn != WIN_JMP_ERROR_IO - && iReturn != WIN_JMP_OKAY) - { - /* setjmp returned an unknown value, exit */ - ErrorF ("winInitMultiWindowWM - setjmp returned: %d. Exiting.\n", - iReturn); - pthread_exit (NULL); - } - else if (iReturn == WIN_JMP_ERROR_IO) - { - ErrorF ("winInitMultiWindowWM - Caught IO Error. Exiting.\n"); - pthread_exit (NULL); - } - - /* Install our error handler */ - XSetErrorHandler (winMultiWindowWMErrorHandler); - XSetIOErrorHandler (winMultiWindowWMIOErrorHandler); - - /* Setup the display connection string x */ - snprintf (pszDisplay, - 512, - "127.0.0.1:%s.%d", - display, - (int) pProcArg->dwScreen); - - /* Print the display connection string */ - ErrorF ("winInitMultiWindowWM - DISPLAY=%s\n", pszDisplay); - - /* Use our generated cookie for authentication */ - winSetAuthorization(); - - /* Open the X display */ - do - { - /* Try to open the display */ - pWMInfo->pDisplay = XOpenDisplay (pszDisplay); - if (pWMInfo->pDisplay == NULL) - { - ErrorF ("winInitMultiWindowWM - Could not open display, try: %d, " - "sleeping: %d\n", - iRetries + 1, WIN_CONNECT_DELAY); - ++iRetries; - sleep (WIN_CONNECT_DELAY); - continue; - } - else - break; - } - while (pWMInfo->pDisplay == NULL && iRetries < WIN_CONNECT_RETRIES); - - /* Make sure that the display opened */ - if (pWMInfo->pDisplay == NULL) - { - ErrorF ("winInitMultiWindowWM - Failed opening the display. " - "Exiting.\n"); - pthread_exit (NULL); - } - - ErrorF ("winInitMultiWindowWM - XOpenDisplay () returned and " - "successfully opened the display.\n"); - - - /* Create some atoms */ - pWMInfo->atmWmProtos = XInternAtom (pWMInfo->pDisplay, - "WM_PROTOCOLS", - False); - pWMInfo->atmWmDelete = XInternAtom (pWMInfo->pDisplay, - "WM_DELETE_WINDOW", - False); - - pWMInfo->atmPrivMap = XInternAtom (pWMInfo->pDisplay, - WINDOWSWM_NATIVE_HWND, - False); - - - if (1) { - Cursor cursor = XCreateFontCursor (pWMInfo->pDisplay, XC_left_ptr); - if (cursor) - { - XDefineCursor (pWMInfo->pDisplay, DefaultRootWindow(pWMInfo->pDisplay), cursor); - XFreeCursor (pWMInfo->pDisplay, cursor); - } - } -} - - -/* - * winSendMessageToWM - Send a message from the X thread to the WM thread - */ - -void -winSendMessageToWM (void *pWMInfo, winWMMessagePtr pMsg) -{ - WMMsgNodePtr pNode; - -#if CYGMULTIWINDOW_DEBUG - ErrorF ("winSendMessageToWM ()\n"); -#endif - - pNode = (WMMsgNodePtr)malloc(sizeof(WMMsgNodeRec)); - if (pNode != NULL) - { - memcpy (&pNode->msg, pMsg, sizeof(winWMMessageRec)); - PushMessage (&((WMInfoPtr)pWMInfo)->wmMsgQueue, pNode); - } -} - - -/* - * Window manager error handler - */ - -static int -winMultiWindowWMErrorHandler (Display *pDisplay, XErrorEvent *pErr) -{ - char pszErrorMsg[100]; - - if (pErr->request_code == X_ChangeWindowAttributes - && pErr->error_code == BadAccess) - { - ErrorF ("winMultiWindowWMErrorHandler - ChangeWindowAttributes " - "BadAccess.\n"); - return 0; - } - - XGetErrorText (pDisplay, - pErr->error_code, - pszErrorMsg, - sizeof (pszErrorMsg)); - ErrorF ("winMultiWindowWMErrorHandler - ERROR: %s\n", pszErrorMsg); - - return 0; -} - - -/* - * Window manager IO error handler - */ - -static int -winMultiWindowWMIOErrorHandler (Display *pDisplay) -{ - ErrorF ("winMultiWindowWMIOErrorHandler!\n\n"); - - if (g_shutdown) - pthread_exit(NULL); - - /* Restart at the main entry point */ - longjmp (g_jmpWMEntry, WIN_JMP_ERROR_IO); - - return 0; -} - - -/* - * X message procedure error handler - */ - -static int -winMultiWindowXMsgProcErrorHandler (Display *pDisplay, XErrorEvent *pErr) -{ - char pszErrorMsg[100]; - - XGetErrorText (pDisplay, - pErr->error_code, - pszErrorMsg, - sizeof (pszErrorMsg)); -#if CYGMULTIWINDOW_DEBUG - ErrorF ("winMultiWindowXMsgProcErrorHandler - ERROR: %s\n", pszErrorMsg); -#endif - - return 0; -} - - -/* - * X message procedure IO error handler - */ - -static int -winMultiWindowXMsgProcIOErrorHandler (Display *pDisplay) -{ - ErrorF ("winMultiWindowXMsgProcIOErrorHandler!\n\n"); - - /* Restart at the main entry point */ - longjmp (g_jmpXMsgProcEntry, WIN_JMP_ERROR_IO); - - return 0; -} - - -/* - * Catch RedirectError to detect other window manager running - */ - -static int -winRedirectErrorHandler (Display *pDisplay, XErrorEvent *pErr) -{ - redirectError = TRUE; - return 0; -} - - -/* - * Check if another window manager is running - */ - -static Bool -CheckAnotherWindowManager (Display *pDisplay, DWORD dwScreen, Bool fAllowOtherWM) -{ - /* - Try to select the events which only one client at a time is allowed to select. - If this causes an error, another window manager is already running... - */ - redirectError = FALSE; - XSetErrorHandler (winRedirectErrorHandler); - XSelectInput(pDisplay, RootWindow (pDisplay, dwScreen), - ResizeRedirectMask | SubstructureRedirectMask | ButtonPressMask); - XSync (pDisplay, 0); - XSetErrorHandler (winMultiWindowXMsgProcErrorHandler); - - /* - Side effect: select the events we are actually interested in... - - If other WMs are not allowed, also select one of the events which only one client - at a time is allowed to select, so other window managers won't start... - */ - XSelectInput(pDisplay, RootWindow (pDisplay, dwScreen), - SubstructureNotifyMask | ( !fAllowOtherWM ? ButtonPressMask : 0)); - XSync (pDisplay, 0); - return redirectError; -} - -/* - * Notify the MWM thread we're exiting and not to reconnect - */ - -void -winDeinitMultiWindowWM (void) -{ - ErrorF ("winDeinitMultiWindowWM - Noting shutdown in progress\n"); - g_shutdown = TRUE; -} - -/* Windows window styles */ -#define HINT_NOFRAME (1l<<0) -#define HINT_BORDER (1L<<1) -#define HINT_SIZEBOX (1l<<2) -#define HINT_CAPTION (1l<<3) -#define HINT_NOMAXIMIZE (1L<<4) -/* These two are used on their own */ -#define HINT_MAX (1L<<0) -#define HINT_MIN (1L<<1) - -static void -winApplyHints (Display *pDisplay, Window iWindow, HWND hWnd, HWND *zstyle) -{ - static Atom windowState, motif_wm_hints, windowType; - static Atom hiddenState, fullscreenState, belowState, aboveState; - static Atom dockWindow; - static int generation; - Atom type, *pAtom = NULL; - int format; - unsigned long hint = 0, maxmin = 0, style, nitems = 0 , left = 0; - MwmHints *mwm_hint = NULL; - - if (!hWnd) return; - if (!IsWindow (hWnd)) return; - - if (generation != serverGeneration) { - generation = serverGeneration; - windowState = XInternAtom(pDisplay, "_NET_WM_STATE", False); - motif_wm_hints = XInternAtom(pDisplay, "_MOTIF_WM_HINTS", False); - windowType = XInternAtom(pDisplay, "_NET_WM_WINDOW_TYPE", False); - hiddenState = XInternAtom(pDisplay, "_NET_WM_STATE_HIDDEN", False); - fullscreenState = XInternAtom(pDisplay, "_NET_WM_STATE_FULLSCREEN", False); - belowState = XInternAtom(pDisplay, "_NET_WM_STATE_BELOW", False); - aboveState = XInternAtom(pDisplay, "_NET_WM_STATE_ABOVE", False); - dockWindow = XInternAtom(pDisplay, "_NET_WM_WINDOW_TYPE_DOCK", False); - } - - if (XGetWindowProperty(pDisplay, iWindow, windowState, 0L, - 1L, False, XA_ATOM, &type, &format, - &nitems, &left, (unsigned char **)&pAtom) == Success) - { - if (pAtom && nitems == 1) - { - if (*pAtom == hiddenState) maxmin |= HINT_MIN; - else if (*pAtom == fullscreenState) maxmin |= HINT_MAX; - if (*pAtom == belowState) *zstyle = HWND_BOTTOM; - else if (*pAtom == aboveState) *zstyle = HWND_TOPMOST; - } - if (pAtom) XFree(pAtom); - } - - nitems = left = 0; - if (XGetWindowProperty(pDisplay, iWindow, motif_wm_hints, 0L, - PropMwmHintsElements, False, motif_wm_hints, &type, &format, - &nitems, &left, (unsigned char **)&mwm_hint) == Success) - { - if (mwm_hint && nitems == PropMwmHintsElements && (mwm_hint->flags & MwmHintsDecorations)) - { - if (!mwm_hint->decorations) hint |= HINT_NOFRAME; - else if (!(mwm_hint->decorations & MwmDecorAll)) - { - if (mwm_hint->decorations & MwmDecorBorder) hint |= HINT_BORDER; - if (mwm_hint->decorations & MwmDecorHandle) hint |= HINT_SIZEBOX; - if (mwm_hint->decorations & MwmDecorTitle) hint |= HINT_CAPTION; - } - } - if (mwm_hint) XFree(mwm_hint); - } - - nitems = left = 0; - pAtom = NULL; - if (XGetWindowProperty(pDisplay, iWindow, windowType, 0L, - 1L, False, XA_ATOM, &type, &format, - &nitems, &left, (unsigned char **)&pAtom) == Success) - { - if (pAtom && nitems == 1) - { - if (*pAtom == dockWindow) - { - hint = (hint & ~HINT_NOFRAME) | HINT_SIZEBOX; /* Xming puts a sizebox on dock windows */ - *zstyle = HWND_TOPMOST; - } - } - if (pAtom) XFree(pAtom); - } - - { - XSizeHints *normal_hint = XAllocSizeHints(); - long supplied; - if (normal_hint && (XGetWMNormalHints(pDisplay, iWindow, normal_hint, &supplied) == Success)) - { - if (normal_hint->flags & PMaxSize) - { - /* Not maximizable if a maximum size is specified */ - hint |= HINT_NOMAXIMIZE; - - if (normal_hint->flags & PMinSize) - { - /* - If both minimum size and maximum size are specified and are the same, - don't bother with a resizing frame - */ - if ((normal_hint->min_width == normal_hint->max_width) - && (normal_hint->min_height == normal_hint->max_height)) - hint = (hint & ~HINT_SIZEBOX); - } - } - } - XFree(normal_hint); - } - - /* Override hint settings from above with settings from config file */ - { - XClassHint class_hint = {0,0}; - char *window_name = 0; - - if (XGetClassHint(pDisplay, iWindow, &class_hint)) - { - XFetchName(pDisplay, iWindow, &window_name); - - style = winOverrideStyle(class_hint.res_name, class_hint.res_class, window_name); - - if (class_hint.res_name) XFree(class_hint.res_name); - if (class_hint.res_class) XFree(class_hint.res_class); - if (window_name) XFree(window_name); - } - else - { - style = STYLE_NONE; - } - } - - if (style & STYLE_TOPMOST) *zstyle = HWND_TOPMOST; - else if (style & STYLE_MAXIMIZE) maxmin = (hint & ~HINT_MIN) | HINT_MAX; - else if (style & STYLE_MINIMIZE) maxmin = (hint & ~HINT_MAX) | HINT_MIN; - else if (style & STYLE_BOTTOM) *zstyle = HWND_BOTTOM; - - if (maxmin & HINT_MAX) SendMessage(hWnd, WM_SYSCOMMAND, SC_MAXIMIZE, 0); - else if (maxmin & HINT_MIN) SendMessage(hWnd, WM_SYSCOMMAND, SC_MINIMIZE, 0); - - if (style & STYLE_NOTITLE) - hint = (hint & ~HINT_NOFRAME & ~HINT_BORDER & ~HINT_CAPTION) | HINT_SIZEBOX; - else if (style & STYLE_OUTLINE) - hint = (hint & ~HINT_NOFRAME & ~HINT_SIZEBOX & ~HINT_CAPTION) | HINT_BORDER; - else if (style & STYLE_NOFRAME) - hint = (hint & ~HINT_BORDER & ~HINT_CAPTION & ~HINT_SIZEBOX) | HINT_NOFRAME; - - /* Now apply styles to window */ - style = GetWindowLongPtr(hWnd, GWL_STYLE) & ~WS_CAPTION & ~WS_SIZEBOX; /* Just in case */ - if (!style) return; - - if (!hint) /* All on */ - style = style | WS_CAPTION | WS_SIZEBOX; - else if (hint & HINT_NOFRAME) /* All off */ - style = style & ~WS_CAPTION & ~WS_SIZEBOX; - else style = style | ((hint & HINT_BORDER) ? WS_BORDER : 0) | - ((hint & HINT_SIZEBOX) ? WS_SIZEBOX : 0) | - ((hint & HINT_CAPTION) ? WS_CAPTION : 0); - - if (hint & HINT_NOMAXIMIZE) - style = style & ~WS_MAXIMIZEBOX; - - SetWindowLongPtr (hWnd, GWL_STYLE, style); -} - -void -winUpdateWindowPosition (HWND hWnd, Bool reshape, HWND *zstyle) -{ - int iX, iY, iWidth, iHeight; - int iDx, iDy; - RECT rcNew; - WindowPtr pWin = GetProp (hWnd, WIN_WINDOW_PROP); - DrawablePtr pDraw = NULL; - - if (!pWin) return; - pDraw = &pWin->drawable; - if (!pDraw) return; - - /* Get the X and Y location of the X window */ - iX = pWin->drawable.x + GetSystemMetrics (SM_XVIRTUALSCREEN); - iY = pWin->drawable.y + GetSystemMetrics (SM_YVIRTUALSCREEN); - - /* Get the height and width of the X window */ - iWidth = pWin->drawable.width; - iHeight = pWin->drawable.height; - - /* Setup a rectangle with the X window position and size */ - SetRect (&rcNew, iX, iY, iX + iWidth, iY + iHeight); - -#if 0 - ErrorF ("winUpdateWindowPosition - (%d, %d)-(%d, %d)\n", - rcNew.left, rcNew.top, - rcNew.right, rcNew.bottom); -#endif - - AdjustWindowRectEx (&rcNew, GetWindowLongPtr (hWnd, GWL_STYLE), FALSE, WS_EX_APPWINDOW); - - /* Don't allow window decoration to disappear off to top-left as a result of this adjustment */ - if (rcNew.left < GetSystemMetrics(SM_XVIRTUALSCREEN)) - { - iDx = GetSystemMetrics(SM_XVIRTUALSCREEN) - rcNew.left; - rcNew.left += iDx; - rcNew.right += iDx; - } - - if (rcNew.top < GetSystemMetrics(SM_YVIRTUALSCREEN)) - { - iDy = GetSystemMetrics(SM_YVIRTUALSCREEN) - rcNew.top; - rcNew.top += iDy; - rcNew.bottom += iDy; - } - -#if 0 - ErrorF ("winUpdateWindowPosition - (%d, %d)-(%d, %d)\n", - rcNew.left, rcNew.top, - rcNew.right, rcNew.bottom); -#endif - - /* Position the Windows window */ - SetWindowPos (hWnd, *zstyle, rcNew.left, rcNew.top, - rcNew.right - rcNew.left, rcNew.bottom - rcNew.top, - 0); - - if (reshape) - { - winReshapeMultiWindow(pWin); - winUpdateRgnMultiWindow(pWin); - } -} +/*
+ *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
+ *Copyright (C) Colin Harrison 2005-2009
+ *
+ *Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ *"Software"), to deal in the Software without restriction, including
+ *without limitation the rights to use, copy, modify, merge, publish,
+ *distribute, sublicense, and/or sell copies of the Software, and to
+ *permit persons to whom the Software is furnished to do so, subject to
+ *the following conditions:
+ *
+ *The above copyright notice and this permission notice shall be
+ *included in all copies or substantial portions of the Software.
+ *
+ *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
+ *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+ *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Kensuke Matsuzaki
+ * Colin Harrison
+ */
+
+/* X headers */
+#ifdef HAVE_XWIN_CONFIG_H
+#include <xwin-config.h>
+#endif
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#ifdef __CYGWIN__
+#include <sys/select.h>
+#endif
+#include <fcntl.h>
+#include <setjmp.h>
+#define HANDLE void *
+#ifdef _MSC_VER
+typedef int pid_t;
+#endif
+#include <pthread.h>
+#undef HANDLE
+#include <X11/X.h>
+#include <X11/Xatom.h>
+#include <X11/Xlib.h>
+#include <X11/Xproto.h>
+#include <X11/Xutil.h>
+#include <X11/cursorfont.h>
+#include <X11/Xwindows.h>
+
+/* Local headers */
+#include "objbase.h"
+#include "ddraw.h"
+#include "winwindow.h"
+#include "winprefs.h"
+#include "window.h"
+#include "pixmapstr.h"
+#include "winmsg.h"
+#include "windowstr.h"
+#include "winmultiwindowclass.h"
+
+#ifdef XWIN_MULTIWINDOWEXTWM
+#define _WINDOWSWM_SERVER_
+#include <X11/extensions/windowswmstr.h>
+#else
+/* We need the native HWND atom for intWM, so for consistency use the
+ same name as extWM would if we were building with enabled... */
+#define WINDOWSWM_NATIVE_HWND "_WINDOWSWM_NATIVE_HWND"
+#endif
+
+extern void winDebug(const char *format, ...);
+extern void winReshapeMultiWindow(WindowPtr pWin);
+extern void winUpdateRgnMultiWindow(WindowPtr pWin);
+
+/*
+ * Constant defines
+ */
+
+#define WIN_CONNECT_RETRIES 5
+#define WIN_CONNECT_DELAY 5
+#ifdef HAS_DEVWINDOWS
+# define WIN_MSG_QUEUE_FNAME "/dev/windows"
+#endif
+#define WIN_JMP_OKAY 0
+#define WIN_JMP_ERROR_IO 2
+
+/*
+ * Local structures
+ */
+
+typedef struct _WMMsgNodeRec {
+ winWMMessageRec msg;
+ struct _WMMsgNodeRec *pNext;
+} WMMsgNodeRec, *WMMsgNodePtr;
+
+typedef struct _WMMsgQueueRec {
+ struct _WMMsgNodeRec *pHead;
+ struct _WMMsgNodeRec *pTail;
+ pthread_mutex_t pmMutex;
+ pthread_cond_t pcNotEmpty;
+#ifdef _DEBUG
+ int nQueueSize;
+#endif
+} WMMsgQueueRec, *WMMsgQueuePtr;
+
+typedef struct _WMInfo {
+ Display *pDisplay;
+ WMMsgQueueRec wmMsgQueue;
+ Atom atmWmProtos;
+ Atom atmWmDelete;
+ Atom atmPrivMap;
+#ifdef XWIN_MULTIWINDOWINTWM
+ Bool fAllowOtherWM;
+#endif
+} WMInfoRec, *WMInfoPtr;
+
+typedef struct _WMProcArgRec {
+ DWORD dwScreen;
+ WMInfoPtr pWMInfo;
+ pthread_mutex_t *ppmServerStarted;
+} WMProcArgRec, *WMProcArgPtr;
+
+typedef struct _XMsgProcArgRec {
+ Display *pDisplay;
+ DWORD dwScreen;
+ WMInfoPtr pWMInfo;
+ pthread_mutex_t *ppmServerStarted;
+ HWND hwndScreen;
+} XMsgProcArgRec, *XMsgProcArgPtr;
+
+
+/*
+ * References to external symbols
+ */
+
+extern char *display;
+extern void ErrorF (const char* /*f*/, ...);
+
+/*
+ * Prototypes for local functions
+ */
+
+static void
+PushMessage (WMMsgQueuePtr pQueue, WMMsgNodePtr pNode);
+
+static WMMsgNodePtr
+PopMessage (WMMsgQueuePtr pQueue, WMInfoPtr pWMInfo);
+
+static Bool
+InitQueue (WMMsgQueuePtr pQueue);
+
+static void
+GetWindowName (Display * pDpy, Window iWin, wchar_t **ppName);
+
+static int
+SendXMessage (Display *pDisplay, Window iWin, Atom atmType, long nData);
+
+static void
+UpdateName (WMInfoPtr pWMInfo, Window iWindow);
+
+static void*
+winMultiWindowWMProc (void* pArg);
+
+static int
+winMultiWindowWMErrorHandler (Display *pDisplay, XErrorEvent *pErr);
+
+static int
+winMultiWindowWMIOErrorHandler (Display *pDisplay);
+
+static void *
+winMultiWindowXMsgProc (void *pArg);
+
+static int
+winMultiWindowXMsgProcErrorHandler (Display *pDisplay, XErrorEvent *pErr);
+
+static int
+winMultiWindowXMsgProcIOErrorHandler (Display *pDisplay);
+
+static void
+winMultiWindowThreadExit(void *arg);
+
+static int
+winRedirectErrorHandler (Display *pDisplay, XErrorEvent *pErr);
+
+static void
+winInitMultiWindowWM (WMInfoPtr pWMInfo, WMProcArgPtr pProcArg);
+
+static Bool
+CheckAnotherWindowManager (Display *pDisplay, DWORD dwScreen, Bool fAllowOtherWM);
+
+static void
+winApplyHints (Display *pDisplay, Window iWindow, HWND hWnd, HWND *zstyle);
+
+void
+winUpdateWindowPosition (HWND hWnd, Bool reshape, HWND *zstyle);
+
+/*
+ * Local globals
+ */
+
+static jmp_buf g_jmpWMEntry;
+static XIOErrorHandler g_winMultiWindowWMOldIOErrorHandler;
+static pthread_t g_winMultiWindowWMThread;
+static jmp_buf g_jmpXMsgProcEntry;
+static XIOErrorHandler g_winMultiWindowXMsgProcOldIOErrorHandler;
+static pthread_t g_winMultiWindowXMsgProcThread;
+static Bool g_shutdown = FALSE;
+static Bool redirectError = FALSE;
+static Bool g_fAnotherWMRunning = FALSE;
+
+/*
+ * PushMessage - Push a message onto the queue
+ */
+
+static void
+PushMessage (WMMsgQueuePtr pQueue, WMMsgNodePtr pNode)
+{
+
+ /* Lock the queue mutex */
+ pthread_mutex_lock (&pQueue->pmMutex);
+
+ pNode->pNext = NULL;
+
+ if (pQueue->pTail != NULL)
+ {
+ pQueue->pTail->pNext = pNode;
+ }
+ pQueue->pTail = pNode;
+
+ if (pQueue->pHead == NULL)
+ {
+ pQueue->pHead = pNode;
+ }
+
+#ifdef _DEBUG
+ /* Increase the count of elements in the queue by one */
+ ++(pQueue->nQueueSize);
+#endif
+
+ /* Release the queue mutex */
+ pthread_mutex_unlock (&pQueue->pmMutex);
+
+ /* Signal that the queue is not empty */
+ pthread_cond_signal (&pQueue->pcNotEmpty);
+}
+
+
+#ifdef WINDBG
+/*
+ * QueueSize - Return the size of the queue
+ */
+
+static int
+QueueSize (WMMsgQueuePtr pQueue)
+{
+ WMMsgNodePtr pNode;
+ int nSize = 0;
+
+ /* Loop through all elements in the queue */
+ for (pNode = pQueue->pHead; pNode != NULL; pNode = pNode->pNext)
+ ++nSize;
+
+ return nSize;
+}
+#endif
+
+
+/*
+ * PopMessage - Pop a message from the queue
+ */
+
+static WMMsgNodePtr
+PopMessage (WMMsgQueuePtr pQueue, WMInfoPtr pWMInfo)
+{
+ WMMsgNodePtr pNode;
+
+ /* Lock the queue mutex */
+ pthread_mutex_lock (&pQueue->pmMutex);
+
+ /* Wait for --- */
+ while (pQueue->pHead == NULL)
+ {
+ pthread_cond_wait (&pQueue->pcNotEmpty, &pQueue->pmMutex);
+ }
+
+ pNode = pQueue->pHead;
+ if (pQueue->pHead != NULL)
+ {
+ pQueue->pHead = pQueue->pHead->pNext;
+ }
+
+ if (pQueue->pTail == pNode)
+ {
+ pQueue->pTail = NULL;
+ }
+
+ #ifdef _DEBUG
+ /* Drop the number of elements in the queue by one */
+ --(pQueue->nQueueSize);
+
+ winDebug ("Queue Size %d %d\n", pQueue->nQueueSize, QueueSize(pQueue));
+ #endif
+
+ /* Release the queue mutex */
+ pthread_mutex_unlock (&pQueue->pmMutex);
+
+ return pNode;
+}
+
+
+#if 0
+/*
+ * HaveMessage -
+ */
+
+static Bool
+HaveMessage (WMMsgQueuePtr pQueue, UINT msg, Window iWindow)
+{
+ WMMsgNodePtr pNode;
+
+ for (pNode = pQueue->pHead; pNode != NULL; pNode = pNode->pNext)
+ {
+ if (pNode->msg.msg==msg && pNode->msg.iWindow==iWindow)
+ return True;
+ }
+
+ return False;
+}
+#endif
+
+
+/*
+ * InitQueue - Initialize the Window Manager message queue
+ */
+
+static
+Bool
+InitQueue (WMMsgQueuePtr pQueue)
+{
+ /* Check if the pQueue pointer is NULL */
+ if (pQueue == NULL)
+ {
+ ErrorF ("InitQueue - pQueue is NULL. Exiting.\n");
+ return FALSE;
+ }
+
+ /* Set the head and tail to NULL */
+ pQueue->pHead = NULL;
+ pQueue->pTail = NULL;
+
+ /* There are no elements initially */
+ #ifdef _DEBUG
+ pQueue->nQueueSize = 0;
+
+ winDebug ("InitQueue - Queue Size %d %d\n", pQueue->nQueueSize,
+ QueueSize(pQueue));
+ #endif
+
+ winDebug ("InitQueue - Calling pthread_mutex_init\n");
+
+ /* Create synchronization objects */
+ pthread_mutex_init (&pQueue->pmMutex, NULL);
+
+ winDebug ("InitQueue - pthread_mutex_init returned\n");
+ winDebug ("InitQueue - Calling pthread_cond_init\n");
+
+ pthread_cond_init (&pQueue->pcNotEmpty, NULL);
+
+ winDebug ("InitQueue - pthread_cond_init returned\n");
+
+ return TRUE;
+}
+
+
+/*
+ * GetWindowName - Retrieve the title of an X Window
+ */
+
+static void
+GetWindowName (Display *pDisplay, Window iWin, wchar_t **ppName)
+{
+ int nResult, nNum;
+ char **ppList;
+ char *pszReturnData;
+ int iLen, i;
+ XTextProperty xtpName;
+
+ winDebug ("GetWindowName\n");
+
+ /* Intialize ppName to NULL */
+ *ppName = NULL;
+
+ /* Try to get --- */
+ nResult = XGetWMName (pDisplay, iWin, &xtpName);
+ if (!nResult || !xtpName.value || !xtpName.nitems)
+ {
+ ErrorF ("GetWindowName - XGetWMName failed. No name.\n");
+ return;
+ }
+
+ if (Xutf8TextPropertyToTextList (pDisplay, &xtpName, &ppList, &nNum) >= Success && nNum > 0 && *ppList)
+ {
+ iLen = 0;
+ for (i = 0; i < nNum; i++) iLen += strlen(ppList[i]);
+ pszReturnData = (char *) malloc (iLen + 1);
+ pszReturnData[0] = '\0';
+ for (i = 0; i < nNum; i++) strcat (pszReturnData, ppList[i]);
+ if (ppList) XFreeStringList (ppList);
+ }
+ else
+ {
+ pszReturnData = (char *) malloc (1);
+ pszReturnData[0] = '\0';
+ }
+ iLen = MultiByteToWideChar (CP_UTF8, 0, pszReturnData, -1, NULL, 0);
+ *ppName = (wchar_t*)malloc(sizeof(wchar_t)*(iLen + 1));
+ MultiByteToWideChar (CP_UTF8, 0, pszReturnData, -1, *ppName, iLen);
+ XFree (xtpName.value);
+ free (pszReturnData);
+ winDebug ("GetWindowName - Returning\n");
+}
+
+
+/*
+ * Send a message to the X server from the WM thread
+ */
+
+static int
+SendXMessage (Display *pDisplay, Window iWin, Atom atmType, long nData)
+{
+ XEvent e;
+
+ /* Prepare the X event structure */
+ e.type = ClientMessage;
+ e.xclient.window = iWin;
+ e.xclient.message_type = atmType;
+ e.xclient.format = 32;
+ e.xclient.data.l[0] = nData;
+ e.xclient.data.l[1] = CurrentTime;
+
+ /* Send the event to X */
+ return XSendEvent (pDisplay, iWin, False, NoEventMask, &e);
+}
+
+
+/*
+ * Updates the name of a HWND according to its X WM_NAME property
+ */
+
+static void
+UpdateName (WMInfoPtr pWMInfo, Window iWindow)
+{
+ wchar_t *pszName;
+ Atom atmType;
+ int fmtRet;
+ unsigned long items, remain;
+ HWND *retHwnd, hWnd;
+ XWindowAttributes attr;
+
+ hWnd = 0;
+
+ /* See if we can get the cached HWND for this window... */
+ if (XGetWindowProperty (pWMInfo->pDisplay,
+ iWindow,
+ pWMInfo->atmPrivMap,
+ 0,
+ 1,
+ False,
+ XA_INTEGER,//pWMInfo->atmPrivMap,
+ &atmType,
+ &fmtRet,
+ &items,
+ &remain,
+ (unsigned char **) &retHwnd) == Success)
+ {
+ if (retHwnd)
+ {
+ hWnd = *retHwnd;
+ XFree (retHwnd);
+ }
+ }
+
+ /* Some sanity checks */
+ if (!hWnd) return;
+ if (!IsWindow (hWnd)) return;
+
+ /* Set the Windows window name */
+ GetWindowName (pWMInfo->pDisplay, iWindow, &pszName);
+ if (pszName)
+ {
+ /* Get the window attributes */
+ XGetWindowAttributes (pWMInfo->pDisplay,
+ iWindow,
+ &attr);
+ if (!attr.override_redirect)
+ {
+ SetWindowTextW (hWnd, pszName);
+ winUpdateIcon (iWindow);
+ }
+
+ free (pszName);
+ }
+}
+
+
+#if 0
+/*
+ * Fix up any differences between the X11 and Win32 window stacks
+ * starting at the window passed in
+ */
+static void
+PreserveWin32Stack(WMInfoPtr pWMInfo, Window iWindow, UINT direction)
+{
+ Atom atmType;
+ int fmtRet;
+ unsigned long items, remain;
+ HWND hWnd, *retHwnd;
+ DWORD myWinProcID, winProcID;
+ Window xWindow;
+ WINDOWPLACEMENT wndPlace;
+
+ hWnd = NULL;
+ /* See if we can get the cached HWND for this window... */
+ if (XGetWindowProperty (pWMInfo->pDisplay,
+ iWindow,
+ pWMInfo->atmPrivMap,
+ 0,
+ 1,
+ False,
+ XA_INTEGER,//pWMInfo->atmPrivMap,
+ &atmType,
+ &fmtRet,
+ &items,
+ &remain,
+ (unsigned char **) &retHwnd) == Success)
+ {
+ if (retHwnd)
+ {
+ hWnd = *retHwnd;
+ XFree (retHwnd);
+ }
+ }
+
+ if (!hWnd) return;
+
+ GetWindowThreadProcessId (hWnd, &myWinProcID);
+ hWnd = GetNextWindow (hWnd, direction);
+
+ while (hWnd) {
+ GetWindowThreadProcessId (hWnd, &winProcID);
+ if (winProcID == myWinProcID)
+ {
+ wndPlace.length = sizeof(WINDOWPLACEMENT);
+ GetWindowPlacement (hWnd, &wndPlace);
+ if ( !(wndPlace.showCmd==SW_HIDE ||
+ wndPlace.showCmd==SW_MINIMIZE) )
+ {
+ xWindow = (Window)GetProp (hWnd, WIN_WID_PROP);
+ if (xWindow)
+ {
+ if (direction==GW_HWNDPREV)
+ XRaiseWindow (pWMInfo->pDisplay, xWindow);
+ else
+ XLowerWindow (pWMInfo->pDisplay, xWindow);
+ }
+ }
+ }
+ hWnd = GetNextWindow(hWnd, direction);
+ }
+}
+#endif /* PreserveWin32Stack */
+
+
+/*
+ * winMultiWindowWMProc
+ */
+
+static void *
+winMultiWindowWMProc (void *pArg)
+{
+ WMProcArgPtr pProcArg = (WMProcArgPtr)pArg;
+ WMInfoPtr pWMInfo = pProcArg->pWMInfo;
+
+ pthread_cleanup_push(&winMultiWindowThreadExit, NULL);
+
+ /* Initialize the Window Manager */
+ winInitMultiWindowWM (pWMInfo, pProcArg);
+
+ winDebug ("winMultiWindowWMProc ()\n");
+
+ /* Loop until we explicitly break out */
+ for (;;)
+ {
+ WMMsgNodePtr pNode;
+
+#ifdef XWIN_MULTIWINDOWINTWM
+ if(g_fAnotherWMRunning)/* Another Window manager exists. */
+ {
+ Sleep (1000);
+ continue;
+ }
+#endif
+
+ /* Pop a message off of our queue */
+ pNode = PopMessage (&pWMInfo->wmMsgQueue, pWMInfo);
+ if (pNode == NULL)
+ {
+ /* Bail if PopMessage returns without a message */
+ /* NOTE: Remember that PopMessage is a blocking function. */
+ ErrorF ("winMultiWindowWMProc - Queue is Empty? Exiting.\n");
+ pthread_exit (NULL);
+ }
+
+ winDebug ("winMultiWindowWMProc - %d ms MSG: %d ID: %d\n",
+ GetTickCount (), (int)pNode->msg.msg, (int)pNode->msg.dwID);
+
+ /* Branch on the message type */
+ switch (pNode->msg.msg)
+ {
+ case WM_WM_RAISE:
+ winDebug ("\tWM_WM_RAISE\n");
+ /* Raise the window */
+ XRaiseWindow (pWMInfo->pDisplay, pNode->msg.iWindow);
+ break;
+
+ case WM_WM_LOWER:
+ winDebug ("\tWM_WM_LOWER\n");
+
+ /* Lower the window */
+ XLowerWindow (pWMInfo->pDisplay, pNode->msg.iWindow);
+ break;
+
+ case WM_WM_MAP:
+ winDebug ("\tWM_WM_MAP\n");
+ /* Put a note as to the HWND associated with this Window */
+ XChangeProperty (pWMInfo->pDisplay,
+ pNode->msg.iWindow,
+ pWMInfo->atmPrivMap,
+ XA_INTEGER,//pWMInfo->atmPrivMap,
+ 32,
+ PropModeReplace,
+ (unsigned char *) &(pNode->msg.hwndWindow),
+ 1);
+ UpdateName (pWMInfo, pNode->msg.iWindow);
+ winUpdateIcon (pNode->msg.iWindow);
+ {
+ HWND zstyle = HWND_NOTOPMOST;
+ winApplyHints (pWMInfo->pDisplay, pNode->msg.iWindow, pNode->msg.hwndWindow, &zstyle);
+ winUpdateWindowPosition (pNode->msg.hwndWindow, TRUE, &zstyle);
+ }
+ break;
+
+ case WM_WM_MAP2:
+ winDebug ("\tWM_WM_MAP2\n");
+
+ XChangeProperty (pWMInfo->pDisplay,
+ pNode->msg.iWindow,
+ pWMInfo->atmPrivMap,
+ XA_INTEGER,//pWMInfo->atmPrivMap,
+ 32,
+ PropModeReplace,
+ (unsigned char *) &(pNode->msg.hwndWindow),
+ 1);
+ break;
+
+ case WM_WM_MAP3:
+ winDebug ("\tWM_WM_MAP3\n");
+
+ /* Put a note as to the HWND associated with this Window */
+ XChangeProperty (pWMInfo->pDisplay,
+ pNode->msg.iWindow,
+ pWMInfo->atmPrivMap,
+ XA_INTEGER,//pWMInfo->atmPrivMap,
+ 32,
+ PropModeReplace,
+ (unsigned char *) &(pNode->msg.hwndWindow),
+ 1);
+ UpdateName (pWMInfo, pNode->msg.iWindow);
+ winUpdateIcon (pNode->msg.iWindow);
+ {
+ HWND zstyle = HWND_NOTOPMOST;
+ winApplyHints (pWMInfo->pDisplay, pNode->msg.iWindow, pNode->msg.hwndWindow, &zstyle);
+ winUpdateWindowPosition (pNode->msg.hwndWindow, TRUE, &zstyle);
+ }
+ break;
+
+ case WM_WM_UNMAP:
+ winDebug ("\tWM_WM_UNMAP\n");
+
+ /* Unmap the window */
+ XUnmapWindow (pWMInfo->pDisplay, pNode->msg.iWindow);
+ break;
+
+ case WM_WM_KILL:
+ winDebug ("\tWM_WM_KILL\n");
+ {
+ int i, n, found = 0;
+ Atom *protocols;
+
+ /* --- */
+ if (XGetWMProtocols (pWMInfo->pDisplay,
+ pNode->msg.iWindow,
+ &protocols,
+ &n))
+ {
+ for (i = 0; i < n; ++i)
+ if (protocols[i] == pWMInfo->atmWmDelete)
+ ++found;
+
+ XFree (protocols);
+ }
+
+ /* --- */
+ if (found)
+ SendXMessage (pWMInfo->pDisplay,
+ pNode->msg.iWindow,
+ pWMInfo->atmWmProtos,
+ pWMInfo->atmWmDelete);
+ else
+ XKillClient (pWMInfo->pDisplay,
+ pNode->msg.iWindow);
+ }
+ break;
+
+ case WM_WM_ACTIVATE:
+ winDebug ("\tWM_WM_ACTIVATE\n");
+
+ /* Set the input focus */
+ XSetInputFocus (pWMInfo->pDisplay,
+ pNode->msg.iWindow,
+ RevertToPointerRoot,
+ CurrentTime);
+ break;
+
+ case WM_WM_NAME_EVENT:
+ UpdateName (pWMInfo, pNode->msg.iWindow);
+ break;
+
+ case WM_WM_HINTS_EVENT:
+ winUpdateIcon (pNode->msg.iWindow);
+ break;
+
+ case WM_WM_CHANGE_STATE:
+ /* Minimize the window in Windows */
+ winMinimizeWindow (pNode->msg.iWindow);
+ break;
+
+ default:
+ ErrorF ("winMultiWindowWMProc - Unknown Message. Exiting.\n");
+ pthread_exit (NULL);
+ break;
+ }
+
+ /* Free the retrieved message */
+ free (pNode);
+
+ /* Flush any pending events on our display */
+ XFlush (pWMInfo->pDisplay);
+ }
+
+ /* Free the condition variable */
+ pthread_cond_destroy (&pWMInfo->wmMsgQueue.pcNotEmpty);
+
+ /* Free the mutex variable */
+ pthread_mutex_destroy (&pWMInfo->wmMsgQueue.pmMutex);
+
+ /* Free the passed-in argument */
+ free (pProcArg);
+
+ winDebug("-winMultiWindowWMProc ()\n");
+
+ pthread_cleanup_pop(0);
+
+ return NULL;
+}
+
+
+/*
+ * X message procedure
+ */
+
+static void *
+winMultiWindowXMsgProc (void *pArg)
+{
+ winWMMessageRec msg;
+ XMsgProcArgPtr pProcArg = (XMsgProcArgPtr) pArg;
+ char pszDisplay[512];
+ int iRetries;
+ XEvent event;
+ Atom atmWmName;
+ Atom atmWmHints;
+ Atom atmWmChange;
+ int iReturn;
+ XIconSize *xis;
+
+ pthread_cleanup_push(&winMultiWindowThreadExit, NULL);
+
+ winDebug ("winMultiWindowXMsgProc - Hello\n");
+
+ /* Check that argument pointer is not invalid */
+ if (pProcArg == NULL)
+ {
+ ErrorF ("winMultiWindowXMsgProc - pProcArg is NULL. Exiting.\n");
+ pthread_exit (NULL);
+ }
+
+ winDebug ("winMultiWindowXMsgProc - Calling pthread_mutex_lock ()\n");
+
+ /* Grab the server started mutex - pause until we get it */
+ iReturn = pthread_mutex_lock (pProcArg->ppmServerStarted);
+ if (iReturn != 0)
+ {
+ ErrorF ("winMultiWindowXMsgProc - pthread_mutex_lock () failed: %d. "
+ "Exiting.\n",
+ iReturn);
+ pthread_exit (NULL);
+ }
+
+ winDebug ("winMultiWindowXMsgProc - pthread_mutex_lock () returned.\n");
+
+ /* Release the server started mutex */
+ pthread_mutex_unlock (pProcArg->ppmServerStarted);
+
+ winDebug ("winMultiWindowXMsgProc - pthread_mutex_unlock () returned.\n");
+
+ /* Install our error handler */
+ XSetErrorHandler (winMultiWindowXMsgProcErrorHandler);
+ g_winMultiWindowXMsgProcThread = pthread_self();
+ g_winMultiWindowXMsgProcOldIOErrorHandler = XSetIOErrorHandler (winMultiWindowXMsgProcIOErrorHandler);
+
+ /* Set jump point for IO Error exits */
+ iReturn = setjmp (g_jmpXMsgProcEntry);
+
+ /* Check if we should continue operations */
+ if (iReturn != WIN_JMP_ERROR_IO
+ && iReturn != WIN_JMP_OKAY)
+ {
+ /* setjmp returned an unknown value, exit */
+ ErrorF ("winInitMultiWindowXMsgProc - setjmp returned: %d. Exiting.\n",
+ iReturn);
+ pthread_exit (NULL);
+ }
+ else if (iReturn == WIN_JMP_ERROR_IO)
+ {
+ ErrorF ("winInitMultiWindowXMsgProc - Caught IO Error. Exiting.\n");
+ pthread_exit (NULL);
+ }
+
+ /* Setup the display connection string x */
+ winGetDisplayName(pszDisplay, (int)pProcArg->dwScreen);
+
+ /* Print the display connection string */
+ winDebug ("winMultiWindowXMsgProc - DISPLAY=%s\n", pszDisplay);
+
+ /* Use our generated cookie for authentication */
+ winSetAuthorization();
+
+ /* Initialize retry count */
+ iRetries = 0;
+
+ /* Open the X display */
+ do
+ {
+ /* Try to open the display */
+ pProcArg->pDisplay = XOpenDisplay (pszDisplay);
+ if (pProcArg->pDisplay == NULL)
+ {
+ winDebug ("winMultiWindowXMsgProc - Could not open display, try: %d, "
+ "sleeping: %d\n",
+ iRetries + 1, WIN_CONNECT_DELAY);
+ ++iRetries;
+ sleep (WIN_CONNECT_DELAY);
+ continue;
+ }
+ else
+ break;
+ }
+ while (pProcArg->pDisplay == NULL && iRetries < WIN_CONNECT_RETRIES);
+
+ /* Make sure that the display opened */
+ if (pProcArg->pDisplay == NULL)
+ {
+ ErrorF ("winMultiWindowXMsgProc - Failed opening the display. "
+ "Exiting.\n");
+ pthread_exit (NULL);
+ }
+
+ winDebug ("winMultiWindowXMsgProc - XOpenDisplay () returned and "
+ "successfully opened the display.\n");
+
+ /* Check if another window manager is already running */
+#ifdef XWIN_MULTIWINDOWINTWM
+ g_fAnotherWMRunning = CheckAnotherWindowManager (pProcArg->pDisplay, pProcArg->dwScreen, pProcArg->pWMInfo->fAllowOtherWM);
+#else
+ g_fAnotherWMRunning = CheckAnotherWindowManager (pProcArg->pDisplay, pProcArg->dwScreen, FALSE);
+#endif
+
+ if (g_fAnotherWMRunning
+#ifdef XWIN_MULTIWINDOWINTWM
+ && !pProcArg->pWMInfo->fAllowOtherWM
+#endif
+ )
+ {
+ ErrorF ("winMultiWindowXMsgProc - "
+ "another window manager is running. Exiting.\n");
+ pthread_exit (NULL);
+ }
+
+ /* Set up the supported icon sizes */
+ xis = XAllocIconSize ();
+ if (xis)
+ {
+ xis->min_width = xis->min_height = 16;
+ xis->max_width = xis->max_height = 48;
+ xis->width_inc = xis->height_inc = 16;
+ XSetIconSizes (pProcArg->pDisplay,
+ RootWindow (pProcArg->pDisplay, pProcArg->dwScreen),
+ xis,
+ 1);
+ XFree (xis);
+ }
+
+ atmWmName = XInternAtom (pProcArg->pDisplay,
+ "WM_NAME",
+ False);
+ atmWmHints = XInternAtom (pProcArg->pDisplay,
+ "WM_HINTS",
+ False);
+ atmWmChange = XInternAtom (pProcArg->pDisplay,
+ "WM_CHANGE_STATE",
+ False);
+
+ /*
+ iiimxcf had a bug until 2009-04-27, assuming that the
+ WM_STATE atom exists, causing clients to fail with
+ a BadAtom X error if it doesn't.
+
+ Since this is on in the default Solaris 10 install,
+ workaround this by making sure it does exist...
+ */
+ XInternAtom(pProcArg->pDisplay, "WM_STATE", 0);
+
+ /* Loop until we explicitly break out */
+ while (1)
+ {
+ if (g_shutdown)
+ break;
+
+#ifdef XWIN_MULTIWINDOWINTWM
+ if (pProcArg->pWMInfo->fAllowOtherWM && !XPending (pProcArg->pDisplay))
+ {
+ if (CheckAnotherWindowManager (pProcArg->pDisplay, pProcArg->dwScreen, TRUE))
+ {
+ if (!g_fAnotherWMRunning)
+ {
+ g_fAnotherWMRunning = TRUE;
+ SendMessage(*(HWND*)pProcArg->hwndScreen, WM_UNMANAGE, 0, 0);
+ }
+ }
+ else
+ {
+ if (g_fAnotherWMRunning)
+ {
+ g_fAnotherWMRunning = FALSE;
+ SendMessage(*(HWND*)pProcArg->hwndScreen, WM_MANAGE, 0, 0);
+ }
+ }
+ Sleep (500);
+ continue;
+ }
+#endif
+
+ /* Fetch next event */
+ XNextEvent (pProcArg->pDisplay, &event);
+
+ /* Branch on event type */
+ if (event.type == MapNotify /* CreateNotify */)
+ {
+ XWindowAttributes attr;
+
+ XSelectInput (pProcArg->pDisplay,
+ event.xcreatewindow.window,
+ PropertyChangeMask);
+
+ /* Get the window attributes */
+ XGetWindowAttributes (pProcArg->pDisplay,
+ event.xcreatewindow.window,
+ &attr);
+
+ if (!attr.override_redirect && attr.class != InputOnly)
+ XSetWindowBorderWidth(pProcArg->pDisplay,
+ event.xcreatewindow.window,
+ 0);
+ }
+ else if (event.type == MapNotify)
+ {
+ /* Fake a reparentNotify event as SWT/Motif expects a
+ Window Manager to reparent a top-level window when
+ it is mapped and waits until they do.
+
+ We don't actually need to reparent, as the frame is
+ a native window, not an X window
+
+ We do this on MapNotify, not MapRequest like a real
+ Window Manager would, so we don't have do get involved
+ in actually mapping the window via it's (non-existent)
+ parent...
+
+ See sourceware bugzilla #9848
+ */
+
+ XWindowAttributes attr;
+ Window root;
+ Window parent;
+ Window *children;
+ unsigned int nchildren;
+
+ if (XGetWindowAttributes(event.xmap.display,
+ event.xmap.window,
+ &attr) &&
+ XQueryTree(event.xmap.display,
+ event.xmap.window,
+ &root, &parent, &children, &nchildren))
+ {
+ if (children) XFree(children);
+
+ /*
+ It's a top-level window if the parent window is a root window
+ Only non-override_redirect windows can get reparented
+ */
+ if ((attr.root == parent) && !event.xmap.override_redirect)
+ {
+ XEvent event_send;
+
+ event_send.type = ReparentNotify;
+ event_send.xreparent.event = event.xmap.window;
+ event_send.xreparent.window = event.xmap.window;
+ event_send.xreparent.parent = parent;
+ event_send.xreparent.x = attr.x;
+ event_send.xreparent.y = attr.y;
+ event_send.xreparent.override_redirect = False;
+
+ XSendEvent(event.xmap.display,
+ event.xmap.window,
+ True, StructureNotifyMask,
+ &event_send);
+ }
+ }
+ }
+ else if (event.type == ConfigureNotify)
+ {
+ if (!event.xconfigure.send_event)
+ {
+ /*
+ Java applications using AWT on JRE 1.6.0 break with non-reparenting WMs AWT
+ doesn't explicitly know about (See sun bug #6434227)
+
+ XDecoratedPeer.handleConfigureNotifyEvent() only processes non-synthetic
+ ConfigureNotify events to update window location if it's identified the
+ WM as a non-reparenting WM it knows about (compiz or lookingglass)
+
+ Rather than tell all sorts of lies to get XWM to recognize us as one of
+ those, simply send a synthetic ConfigureNotify for every non-synthetic one
+ */
+ XEvent event_send = event;
+ event_send.xconfigure.send_event = TRUE;
+ event_send.xconfigure.event = event.xconfigure.window;
+ XSendEvent(event.xconfigure.display,
+ event.xconfigure.window,
+ True, StructureNotifyMask,
+ &event_send);
+ }
+ }
+ else if (event.type == PropertyNotify
+ && event.xproperty.atom == atmWmName)
+ {
+ memset (&msg, 0, sizeof (msg));
+
+ msg.msg = WM_WM_NAME_EVENT;
+ msg.iWindow = event.xproperty.window;
+
+ /* Other fields ignored */
+ winSendMessageToWM (pProcArg->pWMInfo, &msg);
+ }
+ else if (event.type == PropertyNotify
+ && event.xproperty.atom == atmWmHints)
+ {
+ memset (&msg, 0, sizeof (msg));
+
+ msg.msg = WM_WM_HINTS_EVENT;
+ msg.iWindow = event.xproperty.window;
+
+ /* Other fields ignored */
+ winSendMessageToWM (pProcArg->pWMInfo, &msg);
+ }
+ else if (event.type == ClientMessage
+ && event.xclient.message_type == atmWmChange
+ && event.xclient.data.l[0] == IconicState)
+ {
+ winDebug ("winMultiWindowXMsgProc - WM_CHANGE_STATE - IconicState\n");
+
+ memset (&msg, 0, sizeof (msg));
+
+ msg.msg = WM_WM_CHANGE_STATE;
+ msg.iWindow = event.xclient.window;
+
+ winSendMessageToWM (pProcArg->pWMInfo, &msg);
+ }
+ }
+
+ XCloseDisplay (pProcArg->pDisplay);
+ pthread_cleanup_pop(0);
+ return NULL;
+}
+
+
+/*
+ * winInitWM - Entry point for the X server to spawn
+ * the Window Manager thread. Called from
+ * winscrinit.c/winFinishScreenInitFB ().
+ */
+
+Bool
+winInitWM (void **ppWMInfo,
+ pthread_t *ptWMProc,
+ pthread_t *ptXMsgProc,
+ pthread_mutex_t *ppmServerStarted,
+ int dwScreen,
+ HWND hwndScreen,
+ BOOL allowOtherWM)
+{
+ WMProcArgPtr pArg = (WMProcArgPtr) malloc (sizeof(WMProcArgRec));
+ WMInfoPtr pWMInfo = (WMInfoPtr) malloc (sizeof(WMInfoRec));
+ XMsgProcArgPtr pXMsgArg = (XMsgProcArgPtr) malloc (sizeof(XMsgProcArgRec));
+
+ /* Bail if the input parameters are bad */
+ if (pArg == NULL || pWMInfo == NULL)
+ {
+ ErrorF ("winInitWM - malloc failed.\n");
+ return FALSE;
+ }
+
+ /* Zero the allocated memory */
+ ZeroMemory (pArg, sizeof (WMProcArgRec));
+ ZeroMemory (pWMInfo, sizeof (WMInfoRec));
+ ZeroMemory (pXMsgArg, sizeof (XMsgProcArgRec));
+
+ /* Set a return pointer to the Window Manager info structure */
+ *ppWMInfo = pWMInfo;
+#ifdef XWIN_MULTIWINDOWINTWM
+ pWMInfo->fAllowOtherWM = allowOtherWM;
+#endif
+
+ /* Setup the argument structure for the thread function */
+ pArg->dwScreen = dwScreen;
+ pArg->pWMInfo = pWMInfo;
+ pArg->ppmServerStarted = ppmServerStarted;
+
+ /* Intialize the message queue */
+ if (!InitQueue (&pWMInfo->wmMsgQueue))
+ {
+ ErrorF ("winInitWM - InitQueue () failed.\n");
+ return FALSE;
+ }
+
+ /* Spawn a thread for the Window Manager */
+ if (pthread_create (ptWMProc, NULL, winMultiWindowWMProc, pArg))
+ {
+ /* Bail if thread creation failed */
+ ErrorF ("winInitWM - pthread_create failed for Window Manager.\n");
+ return FALSE;
+ }
+
+ /* Spawn the XNextEvent thread, will send messages to WM */
+ pXMsgArg->dwScreen = dwScreen;
+ pXMsgArg->pWMInfo = pWMInfo;
+ pXMsgArg->ppmServerStarted = ppmServerStarted;
+ pXMsgArg->hwndScreen = hwndScreen;
+ if (pthread_create (ptXMsgProc, NULL, winMultiWindowXMsgProc, pXMsgArg))
+ {
+ /* Bail if thread creation failed */
+ ErrorF ("winInitWM - pthread_create failed on XMSG.\n");
+ return FALSE;
+ }
+
+ winDebug ("winInitWM - Returning.\n");
+
+ return TRUE;
+}
+
+
+/*
+ * Window manager thread - setup
+ */
+
+static void
+winInitMultiWindowWM (WMInfoPtr pWMInfo, WMProcArgPtr pProcArg)
+{
+ int iRetries = 0;
+ char pszDisplay[512];
+ int iReturn;
+
+ winDebug ("winInitMultiWindowWM - Hello\n");
+
+ /* Check that argument pointer is not invalid */
+ if (pProcArg == NULL)
+ {
+ ErrorF ("winInitMultiWindowWM - pProcArg is NULL. Exiting.\n");
+ pthread_exit (NULL);
+ }
+
+ winDebug ("winInitMultiWindowWM - Calling pthread_mutex_lock ()\n");
+
+ /* Grab our garbage mutex to satisfy pthread_cond_wait */
+ iReturn = pthread_mutex_lock (pProcArg->ppmServerStarted);
+ if (iReturn != 0)
+ {
+ ErrorF ("winInitMultiWindowWM - pthread_mutex_lock () failed: %d. "
+ "Exiting.\n",
+ iReturn);
+ pthread_exit (NULL);
+ }
+
+ winDebug ("winInitMultiWindowWM - pthread_mutex_lock () returned.\n");
+
+ /* Release the server started mutex */
+ pthread_mutex_unlock (pProcArg->ppmServerStarted);
+
+ winDebug ("winInitMultiWindowWM - pthread_mutex_unlock () returned.\n");
+
+ /* Install our error handler */
+ XSetErrorHandler (winMultiWindowWMErrorHandler);
+ g_winMultiWindowWMThread = pthread_self();
+ g_winMultiWindowWMOldIOErrorHandler = XSetIOErrorHandler (winMultiWindowWMIOErrorHandler);
+
+ /* Set jump point for IO Error exits */
+ iReturn = setjmp (g_jmpWMEntry);
+
+ /* Check if we should continue operations */
+ if (iReturn != WIN_JMP_ERROR_IO
+ && iReturn != WIN_JMP_OKAY)
+ {
+ /* setjmp returned an unknown value, exit */
+ ErrorF ("winInitMultiWindowWM - setjmp returned: %d. Exiting.\n",
+ iReturn);
+ pthread_exit (NULL);
+ }
+ else if (iReturn == WIN_JMP_ERROR_IO)
+ {
+ ErrorF ("winInitMultiWindowWM - Caught IO Error. Exiting.\n");
+ pthread_exit (NULL);
+ }
+
+ /* Setup the display connection string x */
+ winGetDisplayName(pszDisplay, (int)pProcArg->dwScreen);
+
+ /* Print the display connection string */
+ winDebug ("winInitMultiWindowWM - DISPLAY=%s\n", pszDisplay);
+
+ /* Use our generated cookie for authentication */
+ winSetAuthorization();
+
+ /* Open the X display */
+ do
+ {
+ /* Try to open the display */
+ pWMInfo->pDisplay = XOpenDisplay (pszDisplay);
+ if (pWMInfo->pDisplay == NULL)
+ {
+ ErrorF ("winInitMultiWindowWM - Could not open display, try: %d, "
+ "sleeping: %d\n",
+ iRetries + 1, WIN_CONNECT_DELAY);
+ ++iRetries;
+ sleep (WIN_CONNECT_DELAY);
+ continue;
+ }
+ else
+ break;
+ }
+ while (pWMInfo->pDisplay == NULL && iRetries < WIN_CONNECT_RETRIES);
+
+ /* Make sure that the display opened */
+ if (pWMInfo->pDisplay == NULL)
+ {
+ ErrorF ("winInitMultiWindowWM - Failed opening the display. "
+ "Exiting.\n");
+ pthread_exit (NULL);
+ }
+
+ winDebug ("winInitMultiWindowWM - XOpenDisplay () returned and "
+ "successfully opened the display.\n");
+
+
+ /* Create some atoms */
+ pWMInfo->atmWmProtos = XInternAtom (pWMInfo->pDisplay,
+ "WM_PROTOCOLS",
+ False);
+ pWMInfo->atmWmDelete = XInternAtom (pWMInfo->pDisplay,
+ "WM_DELETE_WINDOW",
+ False);
+
+ pWMInfo->atmPrivMap = XInternAtom (pWMInfo->pDisplay,
+ WINDOWSWM_NATIVE_HWND,
+ False);
+
+
+ if (1) {
+ Cursor cursor = XCreateFontCursor (pWMInfo->pDisplay, XC_left_ptr);
+ if (cursor)
+ {
+ XDefineCursor (pWMInfo->pDisplay, DefaultRootWindow(pWMInfo->pDisplay), cursor);
+ XFreeCursor (pWMInfo->pDisplay, cursor);
+ }
+ }
+}
+
+
+/*
+ * winSendMessageToWM - Send a message from the X thread to the WM thread
+ */
+
+void
+winSendMessageToWM (void *pWMInfo, winWMMessagePtr pMsg)
+{
+ WMMsgNodePtr pNode;
+
+ winDebug ("winSendMessageToWM ()\n");
+
+ pNode = (WMMsgNodePtr)malloc(sizeof(WMMsgNodeRec));
+ if (pNode != NULL)
+ {
+ memcpy (&pNode->msg, pMsg, sizeof(winWMMessageRec));
+ PushMessage (&((WMInfoPtr)pWMInfo)->wmMsgQueue, pNode);
+ }
+}
+
+
+/*
+ * Window manager error handler
+ */
+
+static int
+winMultiWindowWMErrorHandler (Display *pDisplay, XErrorEvent *pErr)
+{
+ char pszErrorMsg[100];
+
+ if (pErr->request_code == X_ChangeWindowAttributes
+ && pErr->error_code == BadAccess)
+ {
+ ErrorF ("winMultiWindowWMErrorHandler - ChangeWindowAttributes "
+ "BadAccess.\n");
+ return 0;
+ }
+
+ XGetErrorText (pDisplay,
+ pErr->error_code,
+ pszErrorMsg,
+ sizeof (pszErrorMsg));
+ ErrorF ("winMultiWindowWMErrorHandler - ERROR: %s\n"
+ " errorCode %d\n"
+ " serial %d\n"
+ " resourceID 0x%x\n"
+ " majorCode %d\n"
+ " minorCode %d\n"
+ , pszErrorMsg
+ , pErr->error_code
+ , pErr->serial
+ , pErr->resourceid
+ , pErr->request_code
+ , pErr->minor_code);
+
+ return 0;
+}
+
+
+/*
+ * Window manager IO error handler
+ */
+
+static int
+winMultiWindowWMIOErrorHandler (Display *pDisplay)
+{
+ ErrorF ("winMultiWindowWMIOErrorHandler!\n\n");
+
+ if (pthread_equal(pthread_self(),g_winMultiWindowWMThread))
+ {
+ if (g_shutdown)
+ pthread_exit(NULL);
+
+ /* Restart at the main entry point */
+ longjmp (g_jmpWMEntry, WIN_JMP_ERROR_IO);
+ }
+
+ if (g_winMultiWindowWMOldIOErrorHandler)
+ g_winMultiWindowWMOldIOErrorHandler(pDisplay);
+
+ return 0;
+}
+
+
+/*
+ * X message procedure error handler
+ */
+
+static int
+winMultiWindowXMsgProcErrorHandler (Display *pDisplay, XErrorEvent *pErr)
+{
+ char pszErrorMsg[100];
+
+ XGetErrorText (pDisplay,
+ pErr->error_code,
+ pszErrorMsg,
+ sizeof (pszErrorMsg));
+ ErrorF ("winMultiWindowXMsgProcErrorHandler - ERROR: %s\n"
+ " errorCode %d\n"
+ " serial %d\n"
+ " resourceID 0x%x\n"
+ " majorCode %d\n"
+ " minorCode %d\n"
+ , pszErrorMsg
+ , pErr->error_code
+ , pErr->serial
+ , pErr->resourceid
+ , pErr->request_code
+ , pErr->minor_code);
+
+ return 0;
+}
+
+
+/*
+ * X message procedure IO error handler
+ */
+
+static int
+winMultiWindowXMsgProcIOErrorHandler (Display *pDisplay)
+{
+ ErrorF ("winMultiWindowXMsgProcIOErrorHandler!\n\n");
+
+ if (pthread_equal(pthread_self(),g_winMultiWindowXMsgProcThread))
+ {
+ /* Restart at the main entry point */
+ longjmp (g_jmpXMsgProcEntry, WIN_JMP_ERROR_IO);
+ }
+
+ if (g_winMultiWindowXMsgProcOldIOErrorHandler)
+ g_winMultiWindowXMsgProcOldIOErrorHandler(pDisplay);
+
+ return 0;
+}
+
+/*
+ * winMultiWindowThreadExit - Thread exit handler
+ */
+
+static void
+winMultiWindowThreadExit(void *arg)
+{
+ AbortDDX();
+
+ /* multiwindow client thread has exited, stop server as well */
+ TerminateProcess(GetCurrentProcess(),1);
+}
+
+/*
+ * Catch RedirectError to detect other window manager running
+ */
+
+static int
+winRedirectErrorHandler (Display *pDisplay, XErrorEvent *pErr)
+{
+ redirectError = TRUE;
+ return 0;
+}
+
+
+/*
+ * Check if another window manager is running
+ */
+
+static Bool
+CheckAnotherWindowManager (Display *pDisplay, DWORD dwScreen, Bool fAllowOtherWM)
+{
+ /*
+ Try to select the events which only one client at a time is allowed to select.
+ If this causes an error, another window manager is already running...
+ */
+ redirectError = FALSE;
+ XSetErrorHandler (winRedirectErrorHandler);
+ XSelectInput(pDisplay, RootWindow (pDisplay, dwScreen),
+ ResizeRedirectMask | SubstructureRedirectMask | ButtonPressMask);
+ XSync (pDisplay, 0);
+ XSetErrorHandler (winMultiWindowXMsgProcErrorHandler);
+
+ /*
+ Side effect: select the events we are actually interested in...
+
+ If other WMs are not allowed, also select one of the events which only one client
+ at a time is allowed to select, so other window managers won't start...
+ */
+ XSelectInput(pDisplay, RootWindow (pDisplay, dwScreen),
+ SubstructureNotifyMask | ( !fAllowOtherWM ? ButtonPressMask : 0));
+ XSync (pDisplay, 0);
+ return redirectError;
+}
+
+/*
+ * Notify the MWM thread we're exiting and not to reconnect
+ */
+
+void
+winDeinitMultiWindowWM (void)
+{
+ winDebug ("winDeinitMultiWindowWM - Noting shutdown in progress\n");
+ g_shutdown = TRUE;
+}
+
+/* Windows window styles */
+#define HINT_NOFRAME (1l<<0)
+#define HINT_BORDER (1L<<1)
+#define HINT_SIZEBOX (1l<<2)
+#define HINT_CAPTION (1l<<3)
+#define HINT_NOMAXIMIZE (1L<<4)
+/* These two are used on their own */
+#define HINT_MAX (1L<<0)
+#define HINT_MIN (1L<<1)
+
+static void
+winApplyHints (Display *pDisplay, Window iWindow, HWND hWnd, HWND *zstyle)
+{
+ static Atom windowState, motif_wm_hints, windowType;
+ static Atom hiddenState, fullscreenState, belowState, aboveState;
+ static Atom dockWindow;
+ static int generation;
+ Atom type, *pAtom = NULL;
+ int format;
+ unsigned long hint = 0, maxmin = 0, style, nitems = 0 , left = 0;
+ WindowPtr pWin = GetProp (hWnd, WIN_WINDOW_PROP);
+ MwmHints *mwm_hint = NULL;
+ WinXSizeHints SizeHints;
+
+ if (!hWnd) return;
+ if (!IsWindow (hWnd)) return;
+
+ if (generation != serverGeneration) {
+ generation = serverGeneration;
+ windowState = XInternAtom(pDisplay, "_NET_WM_STATE", False);
+ motif_wm_hints = XInternAtom(pDisplay, "_MOTIF_WM_HINTS", False);
+ windowType = XInternAtom(pDisplay, "_NET_WM_WINDOW_TYPE", False);
+ hiddenState = XInternAtom(pDisplay, "_NET_WM_STATE_HIDDEN", False);
+ fullscreenState = XInternAtom(pDisplay, "_NET_WM_STATE_FULLSCREEN", False);
+ belowState = XInternAtom(pDisplay, "_NET_WM_STATE_BELOW", False);
+ aboveState = XInternAtom(pDisplay, "_NET_WM_STATE_ABOVE", False);
+ dockWindow = XInternAtom(pDisplay, "_NET_WM_WINDOW_TYPE_DOCK", False);
+ }
+
+ if (XGetWindowProperty(pDisplay, iWindow, windowState, 0L,
+ 1L, False, XA_ATOM, &type, &format,
+ &nitems, &left, (unsigned char **)&pAtom) == Success)
+ {
+ if (pAtom && nitems == 1)
+ {
+ if (*pAtom == hiddenState) maxmin |= HINT_MIN;
+ else if (*pAtom == fullscreenState) maxmin |= HINT_MAX;
+ if (*pAtom == belowState) *zstyle = HWND_BOTTOM;
+ else if (*pAtom == aboveState) *zstyle = HWND_TOPMOST;
+ }
+ if (pAtom) XFree(pAtom);
+ }
+
+ nitems = left = 0;
+ if (XGetWindowProperty(pDisplay, iWindow, motif_wm_hints, 0L,
+ PropMwmHintsElements, False, motif_wm_hints, &type, &format,
+ &nitems, &left, (unsigned char **)&mwm_hint) == Success)
+ {
+ if (mwm_hint && nitems == PropMwmHintsElements && (mwm_hint->flags & MwmHintsDecorations))
+ {
+ if (!mwm_hint->decorations) hint |= HINT_NOFRAME;
+ else if (!(mwm_hint->decorations & MwmDecorAll))
+ {
+ if (mwm_hint->decorations & MwmDecorBorder) hint |= HINT_BORDER;
+ if (mwm_hint->decorations & MwmDecorHandle) hint |= HINT_SIZEBOX;
+ if (mwm_hint->decorations & MwmDecorTitle) hint |= HINT_CAPTION;
+ }
+ }
+ if (mwm_hint) XFree(mwm_hint);
+ }
+
+ nitems = left = 0;
+ pAtom = NULL;
+ if (XGetWindowProperty(pDisplay, iWindow, windowType, 0L,
+ 1L, False, XA_ATOM, &type, &format,
+ &nitems, &left, (unsigned char **)&pAtom) == Success)
+ {
+ if (pAtom && nitems == 1)
+ {
+ if (*pAtom == dockWindow)
+ {
+ hint = (hint & ~HINT_NOFRAME) | HINT_SIZEBOX; /* Xming puts a sizebox on dock windows */
+ *zstyle = HWND_TOPMOST;
+ }
+ }
+ if (pAtom) XFree(pAtom);
+ }
+
+ {
+ XSizeHints *normal_hint = XAllocSizeHints();
+ long supplied;
+ if (normal_hint && (XGetWMNormalHints(pDisplay, iWindow, normal_hint, &supplied) == Success))
+ {
+ if (normal_hint->flags & PMaxSize)
+ {
+ /* Not maximizable if a maximum size is specified */
+ hint |= HINT_NOMAXIMIZE;
+
+ if (normal_hint->flags & PMinSize)
+ {
+ /*
+ If both minimum size and maximum size are specified and are the same,
+ don't bother with a resizing frame
+ */
+ if ((normal_hint->min_width == normal_hint->max_width)
+ && (normal_hint->min_height == normal_hint->max_height))
+ hint = (hint & ~HINT_SIZEBOX);
+ }
+ }
+ }
+ XFree(normal_hint);
+ }
+
+ /* Override hint settings from above with settings from config file */
+ {
+ XClassHint class_hint = {0,0};
+
+ if (XGetClassHint(pDisplay, iWindow, &class_hint))
+ {
+ char *window_name = 0;
+ XFetchName(pDisplay, iWindow, &window_name);
+
+ style = winOverrideStyle(class_hint.res_name, class_hint.res_class, window_name);
+
+ if (class_hint.res_name) XFree(class_hint.res_name);
+ if (class_hint.res_class) XFree(class_hint.res_class);
+ if (window_name) XFree(window_name);
+ }
+ else
+ {
+ style = STYLE_NONE;
+ }
+ }
+
+ if (style & STYLE_TOPMOST) *zstyle = HWND_TOPMOST;
+ else if (style & STYLE_MAXIMIZE) maxmin = (hint & ~HINT_MIN) | HINT_MAX;
+ else if (style & STYLE_MINIMIZE) maxmin = (hint & ~HINT_MAX) | HINT_MIN;
+ else if (style & STYLE_BOTTOM) *zstyle = HWND_BOTTOM;
+
+ if (maxmin & HINT_MAX) SendMessage(hWnd, WM_SYSCOMMAND, SC_MAXIMIZE, 0);
+ else if (maxmin & HINT_MIN) SendMessage(hWnd, WM_SYSCOMMAND, SC_MINIMIZE, 0);
+
+ if (style & STYLE_NOTITLE)
+ hint = (hint & ~HINT_NOFRAME & ~HINT_BORDER & ~HINT_CAPTION) | HINT_SIZEBOX;
+ else if (style & STYLE_OUTLINE)
+ hint = (hint & ~HINT_NOFRAME & ~HINT_CAPTION) | HINT_BORDER;
+ else if (style & STYLE_NOFRAME)
+ hint = (hint & ~HINT_BORDER & ~HINT_CAPTION) | HINT_NOFRAME;
+
+ /* Now apply styles to window */
+ style = GetWindowLongPtr(hWnd, GWL_STYLE) & ~WS_CAPTION & ~WS_SIZEBOX; /* Just in case */
+ if (!hint) /* All on, but no resize of children is allowed */
+ style = style | WS_CAPTION;
+ else if (hint & HINT_NOFRAME) /* All off */
+ style = style & ~WS_CAPTION & ~WS_SIZEBOX;
+ else style = style | ((hint & HINT_BORDER) ? WS_BORDER : 0) |
+ ((hint & HINT_SIZEBOX) ? WS_SIZEBOX : 0) |
+ ((hint & HINT_CAPTION) ? WS_CAPTION : 0);
+
+ if (hint & HINT_NOMAXIMIZE)
+ style = style & ~WS_MAXIMIZEBOX;
+
+ if (!IsWindow (hWnd))
+ {
+ ErrorF("Windows window 0x%x has become invalid, so returning without applying hints\n",hWnd);
+ return;
+ }
+
+ if (winMultiWindowGetWMNormalHints(pWin, &SizeHints))
+ {
+ if (!(SizeHints.max_width&&SizeHints.max_height&&(SizeHints.min_width == SizeHints.max_width)&&(SizeHints.min_height == SizeHints.max_height) ))
+ style|=WS_SIZEBOX;
+ }
+ else
+ style|=WS_SIZEBOX;
+ SetWindowLongPtr (hWnd, GWL_STYLE, style);
+}
+
+void
+winUpdateWindowPosition (HWND hWnd, Bool reshape, HWND *zstyle)
+{
+ int iX, iY, iWidth, iHeight;
+ int iDx, iDy;
+ RECT rcNew;
+ WindowPtr pWin = GetProp (hWnd, WIN_WINDOW_PROP);
+ DrawablePtr pDraw = NULL;
+
+ if (!pWin) return;
+ pDraw = &pWin->drawable;
+ if (!pDraw) return;
+
+ /* Get the X and Y location of the X window */
+ iX = pWin->drawable.x + GetSystemMetrics (SM_XVIRTUALSCREEN);
+ iY = pWin->drawable.y + GetSystemMetrics (SM_YVIRTUALSCREEN);
+
+ /* Get the height and width of the X window */
+ iWidth = pWin->drawable.width;
+ iHeight = pWin->drawable.height;
+
+ /* Setup a rectangle with the X window position and size */
+ SetRect (&rcNew, iX, iY, iX + iWidth, iY + iHeight);
+
+ AdjustWindowRectEx (&rcNew, GetWindowLongPtr (hWnd, GWL_STYLE), FALSE, WS_EX_APPWINDOW);
+
+ /* Don't allow window decoration to disappear off to top-left as a result of this adjustment */
+ if (rcNew.left < GetSystemMetrics(SM_XVIRTUALSCREEN))
+ {
+ iDx = GetSystemMetrics(SM_XVIRTUALSCREEN) - rcNew.left;
+ rcNew.left += iDx;
+ rcNew.right += iDx;
+ }
+
+ if (rcNew.top < GetSystemMetrics(SM_YVIRTUALSCREEN))
+ {
+ iDy = GetSystemMetrics(SM_YVIRTUALSCREEN) - rcNew.top;
+ rcNew.top += iDy;
+ rcNew.bottom += iDy;
+ }
+
+ /* Position the Windows window */
+ SetWindowPos (hWnd, *zstyle, rcNew.left, rcNew.top,
+ rcNew.right - rcNew.left, rcNew.bottom - rcNew.top,
+ 0);
+
+ if (reshape)
+ {
+ winReshapeMultiWindow(pWin);
+ winUpdateRgnMultiWindow(pWin);
+ }
+}
diff --git a/xorg-server/hw/xwin/winmultiwindowwndproc.c b/xorg-server/hw/xwin/winmultiwindowwndproc.c index 10123c63a..91a488913 100644 --- a/xorg-server/hw/xwin/winmultiwindowwndproc.c +++ b/xorg-server/hw/xwin/winmultiwindowwndproc.c @@ -42,6 +42,13 @@ #include "winmsg.h"
#include "inputstr.h"
+#ifdef XKB
+#ifndef XKB_IN_SERVER
+#define XKB_IN_SERVER
+#endif
+#include <xkbsrv.h>
+#endif
+
extern void winUpdateWindowPosition (HWND hWnd, Bool reshape, HWND *zstyle);
@@ -322,9 +329,7 @@ winTopLevelWindowProc (HWND hwnd, UINT message, Bool needRestack = FALSE;
LRESULT ret;
-#if CYGDEBUG
winDebugWin32Message("winTopLevelWindowProc", hwnd, message, wParam, lParam);
-#endif
/* Check if the Windows window property for our X window pointer is valid */
if ((pWin = GetProp (hwnd, WIN_WINDOW_PROP)) != NULL)
@@ -357,31 +362,6 @@ winTopLevelWindowProc (HWND hwnd, UINT message, fWMMsgInitialized = TRUE;
-#if 0
- /*
- * Print some debugging information
- */
-
- ErrorF ("hWnd %08X\n", hwnd);
- ErrorF ("pWin %08X\n", pWin);
- ErrorF ("pDraw %08X\n", pDraw);
- ErrorF ("\ttype %08X\n", pWin->drawable.type);
- ErrorF ("\tclass %08X\n", pWin->drawable.class);
- ErrorF ("\tdepth %08X\n", pWin->drawable.depth);
- ErrorF ("\tbitsPerPixel %08X\n", pWin->drawable.bitsPerPixel);
- ErrorF ("\tid %08X\n", pWin->drawable.id);
- ErrorF ("\tx %08X\n", pWin->drawable.x);
- ErrorF ("\ty %08X\n", pWin->drawable.y);
- ErrorF ("\twidth %08X\n", pWin->drawable.width);
- ErrorF ("\thenght %08X\n", pWin->drawable.height);
- ErrorF ("\tpScreen %08X\n", pWin->drawable.pScreen);
- ErrorF ("\tserialNumber %08X\n", pWin->drawable.serialNumber);
- ErrorF ("g_iWindowPrivateKey %p\n", g_iWindowPrivateKey);
- ErrorF ("pWinPriv %08X\n", pWinPriv);
- ErrorF ("s_pScreenPriv %08X\n", s_pScreenPriv);
- ErrorF ("s_pScreenInfo %08X\n", s_pScreenInfo);
- ErrorF ("hwndScreen %08X\n", hwndScreen);
-#endif
}
/* Branch on message type */
@@ -413,10 +393,9 @@ winTopLevelWindowProc (HWND hwnd, UINT message, GetWindowRect(hwnd, &rWindow);
hRgnWindow = CreateRectRgnIndirect(&rWindow);
SetWindowRgn (hwnd, hRgnWindow, TRUE);
- DeleteObject(hRgnWindow);
}
- SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)XMING_SIGNATURE);
+ SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)VCXSRV_SIGNATURE);
return 0;
@@ -589,7 +568,10 @@ winTopLevelWindowProc (HWND hwnd, UINT message, break;
case WM_MOUSELEAVE:
- /* Mouse has left our client area */
+ /* We can't do anything without privates */
+ if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
+ break;
+ /* Mouse has left our client area */
/* Flag that we are no longer tracking */
s_fTracking = FALSE;
@@ -732,7 +714,7 @@ winTopLevelWindowProc (HWND hwnd, UINT message, if (wParam == VK_F4 && (GetKeyState (VK_MENU) & 0x8000))
break;
-#if CYGWINDOWING_DEBUG
+#ifdef WINDBG
if (wParam == VK_ESCAPE)
{
/* Place for debug: put any tests and dumps here */
@@ -743,27 +725,27 @@ winTopLevelWindowProc (HWND hwnd, UINT message, windPlace.length = sizeof (WINDOWPLACEMENT);
GetWindowPlacement (hwnd, &windPlace);
pRect = &windPlace.rcNormalPosition;
- ErrorF ("\nCYGWINDOWING Dump:\n"
+ winDebug ("\nCYGWINDOWING Dump:\n"
"\tdrawable: (%hd, %hd) - %hdx%hd\n", pDraw->x,
pDraw->y, pDraw->width, pDraw->height);
- ErrorF ("\twindPlace: (%ld, %ld) - %ldx%ld\n", pRect->left,
+ winDebug ("\twindPlace: (%ld, %ld) - %ldx%ld\n", pRect->left,
pRect->top, pRect->right - pRect->left,
pRect->bottom - pRect->top);
if (GetClientRect (hwnd, &rc))
{
pRect = &rc;
- ErrorF ("\tClientRect: (%ld, %ld) - %ldx%ld\n", pRect->left,
+ winDebug ("\tClientRect: (%ld, %ld) - %ldx%ld\n", pRect->left,
pRect->top, pRect->right - pRect->left,
pRect->bottom - pRect->top);
}
if (GetWindowRect (hwnd, &rc))
{
pRect = &rc;
- ErrorF ("\tWindowRect: (%ld, %ld) - %ldx%ld\n", pRect->left,
+ winDebug ("\tWindowRect: (%ld, %ld) - %ldx%ld\n", pRect->left,
pRect->top, pRect->right - pRect->left,
pRect->bottom - pRect->top);
}
- ErrorF ("\n");
+ winDebug ("\n");
}
#endif
@@ -800,9 +782,8 @@ winTopLevelWindowProc (HWND hwnd, UINT message, /* Tell our Window Manager thread to activate the window */
wmMsg.msg = WM_WM_ACTIVATE;
- if (fWMMsgInitialized)
- if (!pWin || !pWin->overrideRedirect) /* for OOo menus */
- winSendMessageToWM (s_pScreenPriv->pWMInfo, &wmMsg);
+ if (fWMMsgInitialized && pWin->realized && !pWin->overrideRedirect /* for OOo menus */)
+ winSendMessageToWM (s_pScreenPriv->pWMInfo, &wmMsg);
}
/* Prevent the mouse wheel from stalling when another window is minimized */
if (HIWORD(wParam) == 0 && LOWORD(wParam) == WA_ACTIVE &&
@@ -838,7 +819,7 @@ winTopLevelWindowProc (HWND hwnd, UINT message, /* Branch on if the window was killed in X already */
if (pWinPriv && !pWinPriv->fXKilled)
{
- ErrorF ("winTopLevelWindowProc - WM_DESTROY - WM_WM_KILL\n");
+ winDebug ("winTopLevelWindowProc - WM_DESTROY - WM_WM_KILL\n");
/* Tell our Window Manager thread to kill the window */
wmMsg.msg = WM_WM_KILL;
@@ -891,12 +872,10 @@ winTopLevelWindowProc (HWND hwnd, UINT message, else /* It is an overridden window so make it top of Z stack */
{
HWND forHwnd = GetForegroundWindow();
-#if CYGWINDOWING_DEBUG
- ErrorF ("overridden window is shown\n");
-#endif
+ winDebug ("overridden window is shown\n");
if (forHwnd != NULL)
{
- if (GetWindowLongPtr(forHwnd, GWLP_USERDATA) & (LONG_PTR)XMING_SIGNATURE)
+ if (GetWindowLongPtr(forHwnd, GWLP_USERDATA) & (LONG_PTR)VCXSRV_SIGNATURE)
{
if (GetWindowLongPtr(forHwnd, GWL_EXSTYLE) & WS_EX_TOPMOST)
SetWindowPos (hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
@@ -982,7 +961,7 @@ winTopLevelWindowProc (HWND hwnd, UINT message, case WM_SIZE:
/* see dix/window.c */
-#if CYGWINDOWING_DEBUG
+#ifdef WINDBG
{
char buf[64];
switch (wParam)
@@ -999,24 +978,34 @@ winTopLevelWindowProc (HWND hwnd, UINT message, default:
strcpy(buf, "UNKNOWN_FLAG");
}
- ErrorF ("winTopLevelWindowProc - WM_SIZE to %dx%d (%s) - %d ms\n",
+ winDebug ("winTopLevelWindowProc - WM_SIZE to %dx%d (%s) - %d ms\n",
(int)LOWORD(lParam), (int)HIWORD(lParam), buf,
(int)(GetTickCount ()));
}
#endif
/* Adjust the X Window to the moved Windows window */
winAdjustXWindow (pWin, hwnd);
+ if (wParam == SIZE_MINIMIZED) winReorderWindowsMultiWindow();
return 0; /* end of WM_SIZE handler */
+ case WM_STYLECHANGED:
+ /* when the style changes, adjust the window size so the client area remains the same */
+ {
+ LONG x,y;
+ DrawablePtr pDraw = &pWin->drawable;
+ x = pDraw->x - wBorderWidth(pWin);
+ y = pDraw->y - wBorderWidth(pWin);
+ winPositionWindowMultiWindow(pWin, x, y);
+ }
+ return 0;
+
case WM_MOUSEACTIVATE:
/* Check if this window needs to be made active when clicked */
if (!GetProp (pWinPriv->hWnd, WIN_NEEDMANAGE_PROP))
{
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winTopLevelWindowProc - WM_MOUSEACTIVATE - "
+ winDebug ("winTopLevelWindowProc - WM_MOUSEACTIVATE - "
"MA_NOACTIVATE\n");
-#endif
/* */
return MA_NOACTIVATE;
diff --git a/xorg-server/hw/xwin/winnativegdi.c b/xorg-server/hw/xwin/winnativegdi.c index 4d7afe898..ef95f834a 100644 --- a/xorg-server/hw/xwin/winnativegdi.c +++ b/xorg-server/hw/xwin/winnativegdi.c @@ -116,7 +116,7 @@ winCloseScreenNativeGDI (int nIndex, ScreenPtr pScreen) winScreenPriv(pScreen); winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - ErrorF ("winCloseScreenNativeGDI - Freeing screen resources\n"); + winDebug ("winCloseScreenNativeGDI - Freeing screen resources\n"); /* Flag that the screen is closed */ pScreenPriv->fClosed = TRUE; @@ -130,7 +130,7 @@ winCloseScreenNativeGDI (int nIndex, ScreenPtr pScreen) /* Delete the window property */ RemoveProp (pScreenPriv->hwndScreen, WIN_SCR_PROP); - ErrorF ("winCloseScreenNativeGDI - Destroying window\n"); + winDebug ("winCloseScreenNativeGDI - Destroying window\n"); /* Delete tray icon, if we have one */ if (!pScreenInfo->fNoTrayIcon) @@ -156,7 +156,7 @@ winCloseScreenNativeGDI (int nIndex, ScreenPtr pScreen) /* Free the screen privates for this screen */ free (pScreenPriv); - ErrorF ("winCloseScreenNativeGDI - Returning\n"); + winDebug ("winCloseScreenNativeGDI - Returning\n"); return TRUE; } @@ -215,7 +215,7 @@ winInitVisualsNativeGDI (ScreenPtr pScreen) } /* Tell the user how many bits per RGB we are using */ - ErrorF ("winInitVisualsNativeGDI - Using dwBitsPerRGB: %d\n", + winDebug ("winInitVisualsNativeGDI - Using dwBitsPerRGB: %d\n", (int) pScreenPriv->dwBitsPerRGB); /* Create a single visual according to the Windows screen depth */ @@ -238,7 +238,7 @@ winInitVisualsNativeGDI (ScreenPtr pScreen) break; case 8: - ErrorF ("winInitVisuals - Calling miSetVisualTypesAndMasks\n"); + winDebug ("winInitVisuals - Calling miSetVisualTypesAndMasks\n"); if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth, StaticColorMask, pScreenPriv->dwBitsPerRGB, @@ -257,9 +257,7 @@ winInitVisualsNativeGDI (ScreenPtr pScreen) return FALSE; } -#if 1 - ErrorF ("winInitVisualsNativeGDI - Returning\n"); -#endif + winDebug ("winInitVisualsNativeGDI - Returning\n"); return TRUE; } @@ -386,11 +384,13 @@ winCreateDIBNativeGDI (int iWidth, int iHeight, int iDepth, pbmih->biPlanes = 1; pbmih->biBitCount = iDepth; pbmih->biCompression = BI_RGB; + /* pbmih->biSizeImage = 0; pbmih->biXPelsPerMeter = 0; pbmih->biYPelsPerMeter = 0; pbmih->biClrUsed = 0; pbmih->biClrImportant = 0; + */ /* Setup color table for mono DIBs */ if (iDepth == 1) diff --git a/xorg-server/hw/xwin/winpfbdd.c b/xorg-server/hw/xwin/winpfbdd.c index a3990208d..02f6ffc1f 100644 --- a/xorg-server/hw/xwin/winpfbdd.c +++ b/xorg-server/hw/xwin/winpfbdd.c @@ -1,679 +1,675 @@ -/* - *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved. - * - *Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - *"Software"), to deal in the Software without restriction, including - *without limitation the rights to use, copy, modify, merge, publish, - *distribute, sublicense, and/or sell copies of the Software, and to - *permit persons to whom the Software is furnished to do so, subject to - *the following conditions: - * - *The above copyright notice and this permission notice shall be - *included in all copies or substantial portions of the Software. - * - *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR - *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - *Except as contained in this notice, the name of the XFree86 Project - *shall not be used in advertising or otherwise to promote the sale, use - *or other dealings in this Software without prior written authorization - *from the XFree86 Project. - * - * Authors: Dakshinamurthy Karra - * Suhaib M Siddiqi - * Peter Busch - * Harold L Hunt II - */ - -#ifdef HAVE_XWIN_CONFIG_H -#include <xwin-config.h> -#endif -#include "win.h" - - -/* - * Local function prototypes - */ - -static Bool -winAllocateFBPrimaryDD (ScreenPtr pScreen); - -static Bool -winCloseScreenPrimaryDD (int nIndex, ScreenPtr pScreen); - -static Bool -winInitVisualsPrimaryDD (ScreenPtr pScreen); - -static Bool -winAdjustVideoModePrimaryDD (ScreenPtr pScreen); - -static Bool -winActivateAppPrimaryDD (ScreenPtr pScreen); - -static Bool -winHotKeyAltTabPrimaryDD (ScreenPtr pScreen); - - -/* - * Create a DirectDraw primary surface - */ - -static Bool -winAllocateFBPrimaryDD (ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - HRESULT ddrval = DD_OK; - DDSURFACEDESC ddsd; - DDSURFACEDESC *pddsdPrimary = NULL; - DDSURFACEDESC *pddsdOffscreen = NULL; - RECT rcClient; - - ErrorF ("winAllocateFBPrimaryDD\n"); - - /* Get client area location in screen coords */ - GetClientRect (pScreenPriv->hwndScreen, &rcClient); - MapWindowPoints (pScreenPriv->hwndScreen, - HWND_DESKTOP, - (LPPOINT)&rcClient, 2); - - /* Create a DirectDraw object, store the address at lpdd */ - ddrval = (*g_fpDirectDrawCreate) (NULL, &pScreenPriv->pdd, NULL); - if (ddrval != DD_OK) - FatalError ("winAllocateFBPrimaryDD - Could not start DirectDraw\n"); - - /* Get a DirectDraw2 interface pointer */ - ddrval = IDirectDraw_QueryInterface (pScreenPriv->pdd, - &IID_IDirectDraw2, - (LPVOID*) &pScreenPriv->pdd2); - if (FAILED (ddrval)) - { - ErrorF ("winAllocateFBShadowDD - Failed DD2 query: %08x\n", - (unsigned int) ddrval); - return FALSE; - } - - - ErrorF ("winAllocateFBPrimaryDD - Created and initialized DD\n"); - - /* Are we windowed or fullscreen? */ - if (pScreenInfo->fFullScreen) - { - /* Full screen mode */ - ddrval = IDirectDraw2_SetCooperativeLevel (pScreenPriv->pdd2, - pScreenPriv->hwndScreen, - DDSCL_FULLSCREEN - | DDSCL_EXCLUSIVE); - if (FAILED (ddrval)) - FatalError ("winAllocateFBPrimaryDD - Could not set " - "cooperative level\n"); - - /* Change the video mode to the mode requested */ - ddrval = IDirectDraw2_SetDisplayMode (pScreenPriv->pdd2, - pScreenInfo->dwWidth, - pScreenInfo->dwHeight, - pScreenInfo->dwBPP, - pScreenInfo->dwRefreshRate, - 0); - if (FAILED (ddrval)) - FatalError ("winAllocateFBPrimaryDD - Could not set " - "full screen display mode\n"); - } - else - { - /* Windowed mode */ - ddrval = IDirectDraw2_SetCooperativeLevel (pScreenPriv->pdd2, - pScreenPriv->hwndScreen, - DDSCL_NORMAL); - if (FAILED (ddrval)) - FatalError ("winAllocateFBPrimaryDD - Could not set " - "cooperative level\n"); - } - - /* Describe the primary surface */ - ZeroMemory (&ddsd, sizeof (ddsd)); - ddsd.dwSize = sizeof (ddsd); - ddsd.dwFlags = DDSD_CAPS; - ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; - - /* Create the primary surface */ - ddrval = IDirectDraw2_CreateSurface (pScreenPriv->pdd2, - &ddsd, - &pScreenPriv->pddsPrimary, - NULL); - if (FAILED (ddrval)) - FatalError ("winAllocateFBPrimaryDD - Could not create primary " - "surface %08x\n", (unsigned int) ddrval); - - ErrorF ("winAllocateFBPrimaryDD - Created primary\n"); - - /* Allocate a DD surface description for our screen privates */ - pddsdPrimary = pScreenPriv->pddsdPrimary - = malloc (sizeof (DDSURFACEDESC)); - if (pddsdPrimary == NULL) - FatalError ("winAllocateFBPrimaryDD - Could not allocate surface " - "description memory\n"); - ZeroMemory (pddsdPrimary, sizeof (*pddsdPrimary)); - pddsdPrimary->dwSize = sizeof (*pddsdPrimary); - - /* Describe the offscreen surface to be created */ - /* - * NOTE: Do not use a DDSCAPS_VIDEOMEMORY surface, - * as drawing, locking, and unlocking take forever - * with video memory surfaces. In addition, - * video memory is a somewhat scarce resource, - * so you shouldn't be allocating video memory when - * you have the option of using system memory instead. - */ - ZeroMemory (&ddsd, sizeof (ddsd)); - ddsd.dwSize = sizeof (ddsd); - ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH; - ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY; - ddsd.dwHeight = pScreenInfo->dwHeight; - ddsd.dwWidth = pScreenInfo->dwWidth; - - /* Create the shadow surface */ - ddrval = IDirectDraw2_CreateSurface (pScreenPriv->pdd2, - &ddsd, - &pScreenPriv->pddsOffscreen, - NULL); - if (ddrval != DD_OK) - FatalError ("winAllocateFBPrimaryDD - Could not create shadow " - "surface\n"); - - ErrorF ("winAllocateFBPrimaryDD - Created offscreen\n"); - - /* Allocate a DD surface description for our screen privates */ - pddsdOffscreen = pScreenPriv->pddsdOffscreen - = malloc (sizeof (DDSURFACEDESC)); - if (pddsdOffscreen == NULL) - FatalError ("winAllocateFBPrimaryDD - Could not allocate surface " - "description memory\n"); - ZeroMemory (pddsdOffscreen, sizeof (*pddsdOffscreen)); - pddsdOffscreen->dwSize = sizeof (*pddsdOffscreen); - - ErrorF ("winAllocateFBPrimaryDD - Locking primary\n"); - - /* Lock the primary surface */ - ddrval = IDirectDrawSurface2_Lock (pScreenPriv->pddsPrimary, - pScreenInfo->fFullScreen ? NULL:&rcClient, - pddsdPrimary, - DDLOCK_WAIT, - NULL); - if (ddrval != DD_OK || pddsdPrimary->lpSurface == NULL) - FatalError ("winAllocateFBPrimaryDD - Could not lock " - "primary surface\n"); - - ErrorF ("winAllocateFBPrimaryDD - Locked primary\n"); - - /* We don't know how to deal with anything other than RGB */ - if (!(pddsdPrimary->ddpfPixelFormat.dwFlags & DDPF_RGB)) - FatalError ("winAllocateFBPrimaryDD - Color format other than RGB\n"); - - /* Grab the pitch from the surface desc */ - pScreenInfo->dwStride = (pddsdPrimary->u1.lPitch * 8) - / pScreenInfo->dwBPP; - - /* Save the pointer to our surface memory */ - pScreenInfo->pfb = pddsdPrimary->lpSurface; - - /* Grab the color depth and masks from the surface description */ - pScreenPriv->dwRedMask = pddsdPrimary->ddpfPixelFormat.u2.dwRBitMask; - pScreenPriv->dwGreenMask = pddsdPrimary->ddpfPixelFormat.u3.dwGBitMask; - pScreenPriv->dwBlueMask = pddsdPrimary->ddpfPixelFormat.u4.dwBBitMask; - - ErrorF ("winAllocateFBPrimaryDD - Returning\n"); - - return TRUE; -} - -static void -winFreeFBPrimaryDD (ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - - /* Free the offscreen surface, if there is one */ - if (pScreenPriv->pddsOffscreen) - { - IDirectDrawSurface2_Unlock (pScreenPriv->pddsOffscreen, NULL); - IDirectDrawSurface2_Release (pScreenPriv->pddsOffscreen); - pScreenPriv->pddsOffscreen = NULL; - } - - /* Release the primary surface, if there is one */ - if (pScreenPriv->pddsPrimary) - { - IDirectDrawSurface2_Unlock (pScreenPriv->pddsPrimary, NULL); - IDirectDrawSurface2_Release (pScreenPriv->pddsPrimary); - pScreenPriv->pddsPrimary = NULL; - } - - /* Free the DirectDraw object, if there is one */ - if (pScreenPriv->pdd) - { - IDirectDraw2_RestoreDisplayMode (pScreenPriv->pdd); - IDirectDraw2_Release (pScreenPriv->pdd); - pScreenPriv->pdd = NULL; - } - - /* Invalidate the ScreenInfo's fb pointer */ - pScreenInfo->pfb = NULL; -} - -static Bool -winInitScreenPrimaryDD(ScreenPtr pScreen) -{ - return winAllocateFBPrimaryDD(pScreen); -} - -/* - * Call the wrapped CloseScreen function. - * - * Free our resources and private structures. - */ - -static Bool -winCloseScreenPrimaryDD (int nIndex, ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - Bool fReturn; - - ErrorF ("winCloseScreenPrimaryDD - Freeing screen resources\n"); - - /* Flag that the screen is closed */ - pScreenPriv->fClosed = TRUE; - pScreenPriv->fActive = FALSE; - - /* Call the wrapped CloseScreen procedure */ - WIN_UNWRAP(CloseScreen); - if (pScreen->CloseScreen) - fReturn = (*pScreen->CloseScreen) (nIndex, pScreen); - - /* Delete the window property */ - RemoveProp (pScreenPriv->hwndScreen, WIN_SCR_PROP); - - winFreeFBPrimaryDD(pScreen); - - /* Delete tray icon, if we have one */ - if (!pScreenInfo->fNoTrayIcon) - winDeleteNotifyIcon (pScreenPriv); - - /* Free the exit confirmation dialog box, if it exists */ - if (g_hDlgExit != NULL) - { - DestroyWindow (g_hDlgExit); - g_hDlgExit = NULL; - } - - /* Kill our window */ - if (pScreenPriv->hwndScreen) - { - DestroyWindow (pScreenPriv->hwndScreen); - pScreenPriv->hwndScreen = NULL; - } - - /* Kill our screeninfo's pointer to the screen */ - pScreenInfo->pScreen = NULL; - - /* Free the screen privates for this screen */ - free ((pointer) pScreenPriv); - - return fReturn; -} - - -/* - * Tell mi what sort of visuals we need. - * - * Generally we only need one visual, as our screen can only - * handle one format at a time, I believe. You may want - * to verify that last sentence. - */ - -static Bool -winInitVisualsPrimaryDD (ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - DWORD dwRedBits, dwGreenBits, dwBlueBits; - - /* Count the number of ones in each color mask */ - dwRedBits = winCountBits (pScreenPriv->dwRedMask); - dwGreenBits = winCountBits (pScreenPriv->dwGreenMask); - dwBlueBits = winCountBits (pScreenPriv->dwBlueMask); - - /* Store the maximum number of ones in a color mask as the bitsPerRGB */ - if (dwRedBits > dwGreenBits && dwRedBits > dwBlueBits) - pScreenPriv->dwBitsPerRGB = dwRedBits; - else if (dwGreenBits > dwRedBits && dwGreenBits > dwBlueBits) - pScreenPriv->dwBitsPerRGB = dwGreenBits; - else - pScreenPriv->dwBitsPerRGB = dwBlueBits; - - ErrorF ("winInitVisualsPrimaryDD - Masks: %08x %08x %08x bpRGB: %d\n", - (unsigned int) pScreenPriv->dwRedMask, - (unsigned int) pScreenPriv->dwGreenMask, - (unsigned int) pScreenPriv->dwBlueMask, - (int) pScreenPriv->dwBitsPerRGB); - - /* Create a single visual according to the Windows screen depth */ - switch (pScreenInfo->dwDepth) - { - case 24: - case 16: - case 15: - if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth, - TrueColorMask, - pScreenPriv->dwBitsPerRGB, - TrueColor, - pScreenPriv->dwRedMask, - pScreenPriv->dwGreenMask, - pScreenPriv->dwBlueMask)) - { - ErrorF ("winInitVisualsPrimaryDD - " - "miSetVisualTypesAndMasks failed\n"); - return FALSE; - } - break; - - case 8: -#if CYGDEBUG - winDebug ("winInitVisuals - Calling miSetVisualTypesAndMasks\n"); -#endif /* CYGDEBUG */ - if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth, - PseudoColorMask, - pScreenPriv->dwBitsPerRGB, - PseudoColor, - pScreenPriv->dwRedMask, - pScreenPriv->dwGreenMask, - pScreenPriv->dwBlueMask)) - { - ErrorF ("winInitVisualsPrimaryDD - " - "miSetVisualTypesAndMasks failed\n"); - return FALSE; - } -#if CYGDEBUG - winDebug ("winInitVisualsPrimaryDD - Returned from " - "miSetVisualTypesAndMasks\n"); -#endif /* CYGDEBUG */ - break; - - default: - ErrorF ("winInitVisualsPrimaryDD - Unknown screen depth\n"); - return FALSE; - } - - ErrorF ("winInitVisualsPrimaryDD - Returning\n"); - - return TRUE; -} - - -static Bool -winAdjustVideoModePrimaryDD (ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - HDC hdc = NULL; - DWORD dwBPP; - - /* We're in serious trouble if we can't get a DC */ - hdc = GetDC (NULL); - if (hdc == NULL) - { - ErrorF ("winAdjustVideoModePrimaryDD - GetDC failed\n"); - return FALSE; - } - - /* Query GDI for current display depth */ - dwBPP = GetDeviceCaps (hdc, BITSPIXEL); - - /* DirectDraw can only change the depth in fullscreen mode */ - if (!(pScreenInfo->fFullScreen && - (pScreenInfo->dwBPP != WIN_DEFAULT_BPP))) - { - /* Otherwise, We'll use GDI's depth */ - pScreenInfo->dwBPP = dwBPP; - } - - /* Release our DC */ - ReleaseDC (NULL, hdc); - - return TRUE; -} - - -/* - * We need to blit our offscreen fb to - * the screen when we are activated, and we need to point - * the fb code back to the primary surface memory. - */ - -static Bool -winActivateAppPrimaryDD (ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - RECT rcSrc, rcClient; - HRESULT ddrval = DD_OK; - - /* Check for errors */ - if (pScreenPriv == NULL - || pScreenPriv->pddsPrimary == NULL - || pScreenPriv->pddsOffscreen == NULL) - return FALSE; - - /* Check for do-nothing */ - if (!pScreenPriv->fActive) - return TRUE; - - /* We are activating */ - ddrval = IDirectDrawSurface2_IsLost (pScreenPriv->pddsOffscreen); - if (ddrval == DD_OK) - { - IDirectDrawSurface2_Unlock (pScreenPriv->pddsOffscreen, - NULL); - /* - * We don't check for an error from Unlock, because it - * doesn't matter if the Unlock failed. - */ - } - - /* Restore both surfaces, just cause I like it that way */ - IDirectDrawSurface2_Restore (pScreenPriv->pddsOffscreen); - IDirectDrawSurface2_Restore (pScreenPriv->pddsPrimary); - - /* Get client area in screen coords */ - GetClientRect (pScreenPriv->hwndScreen, &rcClient); - MapWindowPoints (pScreenPriv->hwndScreen, - HWND_DESKTOP, - (LPPOINT)&rcClient, 2); - - /* Setup a source rectangle */ - rcSrc.left = 0; - rcSrc.top = 0; - rcSrc.right = pScreenInfo->dwWidth; - rcSrc.bottom = pScreenInfo->dwHeight; - - ddrval = IDirectDrawSurface2_Blt (pScreenPriv->pddsPrimary, - &rcClient, - pScreenPriv->pddsOffscreen, - &rcSrc, - DDBLT_WAIT, - NULL); - if (ddrval != DD_OK) - FatalError ("winActivateAppPrimaryDD () - Failed blitting offscreen " - "surface to primary surface %08x\n", (unsigned int) ddrval); - - /* Lock the primary surface */ - ddrval = IDirectDrawSurface2_Lock (pScreenPriv->pddsPrimary, - &rcClient, - pScreenPriv->pddsdPrimary, - DDLOCK_WAIT, - NULL); - if (ddrval != DD_OK - || pScreenPriv->pddsdPrimary->lpSurface == NULL) - FatalError ("winActivateAppPrimaryDD () - Could not lock " - "primary surface\n"); - - /* Notify FB of the new memory pointer */ - winUpdateFBPointer (pScreen, - pScreenPriv->pddsdPrimary->lpSurface); - - /* - * Register the Alt-Tab combo as a hotkey so we can copy - * the primary framebuffer before the display mode changes - */ - RegisterHotKey (pScreenPriv->hwndScreen, 1, MOD_ALT, 9); - - return TRUE; -} - - -/* - * Handle the Alt+Tab hotkey. - * - * We need to save the primary fb to an offscreen fb when - * we get deactivated, and point the fb code at the offscreen - * fb for the duration of the deactivation. - */ - -static Bool -winHotKeyAltTabPrimaryDD (ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - RECT rcClient, rcSrc; - HRESULT ddrval = DD_OK; - - ErrorF ("\nwinHotKeyAltTabPrimaryDD\n\n"); - - /* Alt+Tab was pressed, we will lose focus very soon */ - pScreenPriv->fActive = FALSE; - - /* Check for error conditions */ - if (pScreenPriv->pddsPrimary == NULL - || pScreenPriv->pddsOffscreen == NULL) - return FALSE; - - /* Get client area in screen coords */ - GetClientRect (pScreenPriv->hwndScreen, &rcClient); - MapWindowPoints (pScreenPriv->hwndScreen, - HWND_DESKTOP, - (LPPOINT)&rcClient, 2); - - /* Did we loose the primary surface? */ - ddrval = IDirectDrawSurface2_IsLost (pScreenPriv->pddsPrimary); - if (ddrval == DD_OK) - { - ddrval = IDirectDrawSurface2_Unlock (pScreenPriv->pddsPrimary, - NULL); - if (FAILED (ddrval)) - FatalError ("winHotKeyAltTabPrimaryDD - Failed unlocking primary " - "surface\n"); - } - - /* Setup a source rectangle */ - rcSrc.left = 0; - rcSrc.top = 0; - rcSrc.right = pScreenInfo->dwWidth; - rcSrc.bottom = pScreenInfo->dwHeight; - - /* Blit the primary surface to the offscreen surface */ - ddrval = IDirectDrawSurface2_Blt (pScreenPriv->pddsOffscreen, - NULL, /* should be rcDest */ - pScreenPriv->pddsPrimary, - NULL, - DDBLT_WAIT, - NULL); - if (ddrval == DDERR_SURFACELOST) - { - IDirectDrawSurface2_Restore (pScreenPriv->pddsOffscreen); - IDirectDrawSurface2_Restore (pScreenPriv->pddsPrimary); - - /* Blit the primary surface to the offscreen surface */ - ddrval = IDirectDrawSurface2_Blt (pScreenPriv->pddsOffscreen, - NULL, - pScreenPriv->pddsPrimary, - NULL, - DDBLT_WAIT, - NULL); - if (FAILED (ddrval)) - FatalError ("winHotKeyAltTabPrimaryDD - Failed blitting primary " - "surface to offscreen surface: %08x\n", - (unsigned int) ddrval); - } - else - { - FatalError ("winHotKeyAltTabPrimaryDD - Unknown error from " - "Blt: %08dx\n", (unsigned int) ddrval); - } - - /* Lock the offscreen surface */ - ddrval = IDirectDrawSurface2_Lock (pScreenPriv->pddsOffscreen, - NULL, - pScreenPriv->pddsdOffscreen, - DDLOCK_WAIT, - NULL); - if (ddrval != DD_OK - || pScreenPriv->pddsdPrimary->lpSurface == NULL) - FatalError ("winHotKeyAltTabPrimaryDD - Could not lock " - "offscreen surface\n"); - - /* Notify FB of the new memory pointer */ - winUpdateFBPointer (pScreen, - pScreenPriv->pddsdOffscreen->lpSurface); - - /* Unregister our hotkey */ - UnregisterHotKey (pScreenPriv->hwndScreen, 1); - - return TRUE; -} - - -/* Set engine specific functions */ -Bool -winSetEngineFunctionsPrimaryDD (ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - - /* Set our pointers */ - pScreenPriv->pwinAllocateFB = winAllocateFBPrimaryDD; - pScreenPriv->pwinFreeFB = winFreeFBPrimaryDD; - pScreenPriv->pwinShadowUpdate = (winShadowUpdateProcPtr) (void (*)(void))NoopDDA; - pScreenPriv->pwinInitScreen = winInitScreenPrimaryDD; - pScreenPriv->pwinCloseScreen = winCloseScreenPrimaryDD; - pScreenPriv->pwinInitVisuals = winInitVisualsPrimaryDD; - pScreenPriv->pwinAdjustVideoMode = winAdjustVideoModePrimaryDD; - if (pScreenInfo->fFullScreen) - pScreenPriv->pwinCreateBoundingWindow = winCreateBoundingWindowFullScreen; - else - pScreenPriv->pwinCreateBoundingWindow = winCreateBoundingWindowWindowed; - pScreenPriv->pwinFinishScreenInit = winFinishScreenInitFB; - pScreenPriv->pwinBltExposedRegions = (winBltExposedRegionsProcPtr) (void (*)(void))NoopDDA; - pScreenPriv->pwinActivateApp = winActivateAppPrimaryDD; - pScreenPriv->pwinRedrawScreen = NULL; - pScreenPriv->pwinRealizeInstalledPalette = NULL; - pScreenPriv->pwinInstallColormap = NULL; - pScreenPriv->pwinStoreColors = NULL; - pScreenPriv->pwinCreateColormap = NULL; - pScreenPriv->pwinDestroyColormap = NULL; - pScreenPriv->pwinHotKeyAltTab = winHotKeyAltTabPrimaryDD; - pScreenPriv->pwinCreatePrimarySurface = (winCreatePrimarySurfaceProcPtr) (void (*)(void))NoopDDA; - pScreenPriv->pwinReleasePrimarySurface = (winReleasePrimarySurfaceProcPtr) (void (*)(void))NoopDDA; -#ifdef XWIN_MULTIWINDOW - pScreenPriv->pwinFinishCreateWindowsWindow = - (winFinishCreateWindowsWindowProcPtr) (void (*)(void))NoopDDA; -#endif - - return TRUE; -} +/*
+ *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
+ *
+ *Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ *"Software"), to deal in the Software without restriction, including
+ *without limitation the rights to use, copy, modify, merge, publish,
+ *distribute, sublicense, and/or sell copies of the Software, and to
+ *permit persons to whom the Software is furnished to do so, subject to
+ *the following conditions:
+ *
+ *The above copyright notice and this permission notice shall be
+ *included in all copies or substantial portions of the Software.
+ *
+ *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
+ *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+ *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Dakshinamurthy Karra
+ * Suhaib M Siddiqi
+ * Peter Busch
+ * Harold L Hunt II
+ */
+
+#ifdef HAVE_XWIN_CONFIG_H
+#include <xwin-config.h>
+#endif
+#include "win.h"
+
+
+/*
+ * Local function prototypes
+ */
+
+static Bool
+winAllocateFBPrimaryDD (ScreenPtr pScreen);
+
+static Bool
+winCloseScreenPrimaryDD (int nIndex, ScreenPtr pScreen);
+
+static Bool
+winInitVisualsPrimaryDD (ScreenPtr pScreen);
+
+static Bool
+winAdjustVideoModePrimaryDD (ScreenPtr pScreen);
+
+static Bool
+winActivateAppPrimaryDD (ScreenPtr pScreen);
+
+static Bool
+winHotKeyAltTabPrimaryDD (ScreenPtr pScreen);
+
+
+/*
+ * Create a DirectDraw primary surface
+ */
+
+static Bool
+winAllocateFBPrimaryDD (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ HRESULT ddrval = DD_OK;
+ DDSURFACEDESC ddsd;
+ DDSURFACEDESC *pddsdPrimary = NULL;
+ DDSURFACEDESC *pddsdOffscreen = NULL;
+ RECT rcClient;
+
+ winDebug ("winAllocateFBPrimaryDD\n");
+
+ /* Get client area location in screen coords */
+ GetClientRect (pScreenPriv->hwndScreen, &rcClient);
+ MapWindowPoints (pScreenPriv->hwndScreen,
+ HWND_DESKTOP,
+ (LPPOINT)&rcClient, 2);
+
+ /* Create a DirectDraw object, store the address at lpdd */
+ ddrval = (*g_fpDirectDrawCreate) (NULL, &pScreenPriv->pdd, NULL);
+ if (ddrval != DD_OK)
+ FatalError ("winAllocateFBPrimaryDD - Could not start DirectDraw\n");
+
+ /* Get a DirectDraw2 interface pointer */
+ ddrval = IDirectDraw_QueryInterface (pScreenPriv->pdd,
+ &IID_IDirectDraw2,
+ (LPVOID*) &pScreenPriv->pdd2);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winAllocateFBShadowDD - Failed DD2 query: %08x\n",
+ (unsigned int) ddrval);
+ return FALSE;
+ }
+
+
+ winDebug ("winAllocateFBPrimaryDD - Created and initialized DD\n");
+
+ /* Are we windowed or fullscreen? */
+ if (pScreenInfo->fFullScreen)
+ {
+ /* Full screen mode */
+ ddrval = IDirectDraw2_SetCooperativeLevel (pScreenPriv->pdd2,
+ pScreenPriv->hwndScreen,
+ DDSCL_FULLSCREEN
+ | DDSCL_EXCLUSIVE);
+ if (FAILED (ddrval))
+ FatalError ("winAllocateFBPrimaryDD - Could not set "
+ "cooperative level\n");
+
+ /* Change the video mode to the mode requested */
+ ddrval = IDirectDraw2_SetDisplayMode (pScreenPriv->pdd2,
+ pScreenInfo->dwWidth,
+ pScreenInfo->dwHeight,
+ pScreenInfo->dwBPP,
+ pScreenInfo->dwRefreshRate,
+ 0);
+ if (FAILED (ddrval))
+ FatalError ("winAllocateFBPrimaryDD - Could not set "
+ "full screen display mode\n");
+ }
+ else
+ {
+ /* Windowed mode */
+ ddrval = IDirectDraw2_SetCooperativeLevel (pScreenPriv->pdd2,
+ pScreenPriv->hwndScreen,
+ DDSCL_NORMAL);
+ if (FAILED (ddrval))
+ FatalError ("winAllocateFBPrimaryDD - Could not set "
+ "cooperative level\n");
+ }
+
+ /* Describe the primary surface */
+ ZeroMemory (&ddsd, sizeof (ddsd));
+ ddsd.dwSize = sizeof (ddsd);
+ ddsd.dwFlags = DDSD_CAPS;
+ ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
+
+ /* Create the primary surface */
+ ddrval = IDirectDraw2_CreateSurface (pScreenPriv->pdd2,
+ &ddsd,
+ &pScreenPriv->pddsPrimary,
+ NULL);
+ if (FAILED (ddrval))
+ FatalError ("winAllocateFBPrimaryDD - Could not create primary "
+ "surface %08x\n", (unsigned int) ddrval);
+
+ winDebug ("winAllocateFBPrimaryDD - Created primary\n");
+
+ /* Allocate a DD surface description for our screen privates */
+ pddsdPrimary = pScreenPriv->pddsdPrimary
+ = malloc (sizeof (DDSURFACEDESC));
+ if (pddsdPrimary == NULL)
+ FatalError ("winAllocateFBPrimaryDD - Could not allocate surface "
+ "description memory\n");
+ ZeroMemory (pddsdPrimary, sizeof (*pddsdPrimary));
+ pddsdPrimary->dwSize = sizeof (*pddsdPrimary);
+
+ /* Describe the offscreen surface to be created */
+ /*
+ * NOTE: Do not use a DDSCAPS_VIDEOMEMORY surface,
+ * as drawing, locking, and unlocking take forever
+ * with video memory surfaces. In addition,
+ * video memory is a somewhat scarce resource,
+ * so you shouldn't be allocating video memory when
+ * you have the option of using system memory instead.
+ */
+ ZeroMemory (&ddsd, sizeof (ddsd));
+ ddsd.dwSize = sizeof (ddsd);
+ ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH;
+ ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY;
+ ddsd.dwHeight = pScreenInfo->dwHeight;
+ ddsd.dwWidth = pScreenInfo->dwWidth;
+
+ /* Create the shadow surface */
+ ddrval = IDirectDraw2_CreateSurface (pScreenPriv->pdd2,
+ &ddsd,
+ &pScreenPriv->pddsOffscreen,
+ NULL);
+ if (ddrval != DD_OK)
+ FatalError ("winAllocateFBPrimaryDD - Could not create shadow "
+ "surface\n");
+
+ winDebug ("winAllocateFBPrimaryDD - Created offscreen\n");
+
+ /* Allocate a DD surface description for our screen privates */
+ pddsdOffscreen = pScreenPriv->pddsdOffscreen
+ = malloc (sizeof (DDSURFACEDESC));
+ if (pddsdOffscreen == NULL)
+ FatalError ("winAllocateFBPrimaryDD - Could not allocate surface "
+ "description memory\n");
+ ZeroMemory (pddsdOffscreen, sizeof (*pddsdOffscreen));
+ pddsdOffscreen->dwSize = sizeof (*pddsdOffscreen);
+
+ winDebug ("winAllocateFBPrimaryDD - Locking primary\n");
+
+ /* Lock the primary surface */
+ ddrval = IDirectDrawSurface2_Lock (pScreenPriv->pddsPrimary,
+ pScreenInfo->fFullScreen ? NULL:&rcClient,
+ pddsdPrimary,
+ DDLOCK_WAIT,
+ NULL);
+ if (ddrval != DD_OK || pddsdPrimary->lpSurface == NULL)
+ FatalError ("winAllocateFBPrimaryDD - Could not lock "
+ "primary surface\n");
+
+ winDebug ("winAllocateFBPrimaryDD - Locked primary\n");
+
+ /* We don't know how to deal with anything other than RGB */
+ if (!(pddsdPrimary->ddpfPixelFormat.dwFlags & DDPF_RGB))
+ FatalError ("winAllocateFBPrimaryDD - Color format other than RGB\n");
+
+ /* Grab the pitch from the surface desc */
+ pScreenInfo->dwStride = (pddsdPrimary->u1.lPitch * 8)
+ / pScreenInfo->dwBPP;
+
+ /* Save the pointer to our surface memory */
+ pScreenInfo->pfb = pddsdPrimary->lpSurface;
+
+ /* Grab the color depth and masks from the surface description */
+ pScreenPriv->dwRedMask = pddsdPrimary->ddpfPixelFormat.u2.dwRBitMask;
+ pScreenPriv->dwGreenMask = pddsdPrimary->ddpfPixelFormat.u3.dwGBitMask;
+ pScreenPriv->dwBlueMask = pddsdPrimary->ddpfPixelFormat.u4.dwBBitMask;
+
+ winDebug ("winAllocateFBPrimaryDD - Returning\n");
+
+ return TRUE;
+}
+
+static void
+winFreeFBPrimaryDD (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+
+ /* Free the offscreen surface, if there is one */
+ if (pScreenPriv->pddsOffscreen)
+ {
+ IDirectDrawSurface2_Unlock (pScreenPriv->pddsOffscreen, NULL);
+ IDirectDrawSurface2_Release (pScreenPriv->pddsOffscreen);
+ pScreenPriv->pddsOffscreen = NULL;
+ }
+
+ /* Release the primary surface, if there is one */
+ if (pScreenPriv->pddsPrimary)
+ {
+ IDirectDrawSurface2_Unlock (pScreenPriv->pddsPrimary, NULL);
+ IDirectDrawSurface2_Release (pScreenPriv->pddsPrimary);
+ pScreenPriv->pddsPrimary = NULL;
+ }
+
+ /* Free the DirectDraw object, if there is one */
+ if (pScreenPriv->pdd)
+ {
+ IDirectDraw2_RestoreDisplayMode (pScreenPriv->pdd);
+ IDirectDraw2_Release (pScreenPriv->pdd);
+ pScreenPriv->pdd = NULL;
+ }
+
+ /* Invalidate the ScreenInfo's fb pointer */
+ pScreenInfo->pfb = NULL;
+}
+
+static Bool
+winInitScreenPrimaryDD(ScreenPtr pScreen)
+{
+ return winAllocateFBPrimaryDD(pScreen);
+}
+
+/*
+ * Call the wrapped CloseScreen function.
+ *
+ * Free our resources and private structures.
+ */
+
+static Bool
+winCloseScreenPrimaryDD (int nIndex, ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ Bool fReturn;
+
+ ErrorF ("winCloseScreenPrimaryDD - Freeing screen resources\n");
+
+ /* Flag that the screen is closed */
+ pScreenPriv->fClosed = TRUE;
+ pScreenPriv->fActive = FALSE;
+
+ /* Call the wrapped CloseScreen procedure */
+ WIN_UNWRAP(CloseScreen);
+ if (pScreen->CloseScreen)
+ fReturn = (*pScreen->CloseScreen) (nIndex, pScreen);
+
+ /* Delete the window property */
+ RemoveProp (pScreenPriv->hwndScreen, WIN_SCR_PROP);
+
+ winFreeFBPrimaryDD(pScreen);
+
+ /* Delete tray icon, if we have one */
+ if (!pScreenInfo->fNoTrayIcon)
+ winDeleteNotifyIcon (pScreenPriv);
+
+ /* Free the exit confirmation dialog box, if it exists */
+ if (g_hDlgExit != NULL)
+ {
+ DestroyWindow (g_hDlgExit);
+ g_hDlgExit = NULL;
+ }
+
+ /* Kill our window */
+ if (pScreenPriv->hwndScreen)
+ {
+ DestroyWindow (pScreenPriv->hwndScreen);
+ pScreenPriv->hwndScreen = NULL;
+ }
+
+ /* Kill our screeninfo's pointer to the screen */
+ pScreenInfo->pScreen = NULL;
+
+ /* Free the screen privates for this screen */
+ free ((pointer) pScreenPriv);
+
+ return fReturn;
+}
+
+
+/*
+ * Tell mi what sort of visuals we need.
+ *
+ * Generally we only need one visual, as our screen can only
+ * handle one format at a time, I believe. You may want
+ * to verify that last sentence.
+ */
+
+static Bool
+winInitVisualsPrimaryDD (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ DWORD dwRedBits, dwGreenBits, dwBlueBits;
+
+ /* Count the number of ones in each color mask */
+ dwRedBits = winCountBits (pScreenPriv->dwRedMask);
+ dwGreenBits = winCountBits (pScreenPriv->dwGreenMask);
+ dwBlueBits = winCountBits (pScreenPriv->dwBlueMask);
+
+ /* Store the maximum number of ones in a color mask as the bitsPerRGB */
+ if (dwRedBits > dwGreenBits && dwRedBits > dwBlueBits)
+ pScreenPriv->dwBitsPerRGB = dwRedBits;
+ else if (dwGreenBits > dwRedBits && dwGreenBits > dwBlueBits)
+ pScreenPriv->dwBitsPerRGB = dwGreenBits;
+ else
+ pScreenPriv->dwBitsPerRGB = dwBlueBits;
+
+ winDebug ("winInitVisualsPrimaryDD - Masks: %08x %08x %08x bpRGB: %d\n",
+ (unsigned int) pScreenPriv->dwRedMask,
+ (unsigned int) pScreenPriv->dwGreenMask,
+ (unsigned int) pScreenPriv->dwBlueMask,
+ (int) pScreenPriv->dwBitsPerRGB);
+
+ /* Create a single visual according to the Windows screen depth */
+ switch (pScreenInfo->dwDepth)
+ {
+ case 24:
+ case 16:
+ case 15:
+ if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth,
+ TrueColorMask,
+ pScreenPriv->dwBitsPerRGB,
+ TrueColor,
+ pScreenPriv->dwRedMask,
+ pScreenPriv->dwGreenMask,
+ pScreenPriv->dwBlueMask))
+ {
+ ErrorF ("winInitVisualsPrimaryDD - "
+ "miSetVisualTypesAndMasks failed\n");
+ return FALSE;
+ }
+ break;
+
+ case 8:
+ winDebug ("winInitVisuals - Calling miSetVisualTypesAndMasks\n");
+ if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth,
+ PseudoColorMask,
+ pScreenPriv->dwBitsPerRGB,
+ PseudoColor,
+ pScreenPriv->dwRedMask,
+ pScreenPriv->dwGreenMask,
+ pScreenPriv->dwBlueMask))
+ {
+ ErrorF ("winInitVisualsPrimaryDD - "
+ "miSetVisualTypesAndMasks failed\n");
+ return FALSE;
+ }
+ winDebug ("winInitVisualsPrimaryDD - Returned from "
+ "miSetVisualTypesAndMasks\n");
+ break;
+
+ default:
+ ErrorF ("winInitVisualsPrimaryDD - Unknown screen depth\n");
+ return FALSE;
+ }
+
+ winDebug ("winInitVisualsPrimaryDD - Returning\n");
+
+ return TRUE;
+}
+
+
+static Bool
+winAdjustVideoModePrimaryDD (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ HDC hdc = NULL;
+ DWORD dwBPP;
+
+ /* We're in serious trouble if we can't get a DC */
+ hdc = GetDC (NULL);
+ if (hdc == NULL)
+ {
+ ErrorF ("winAdjustVideoModePrimaryDD - GetDC failed\n");
+ return FALSE;
+ }
+
+ /* Query GDI for current display depth */
+ dwBPP = GetDeviceCaps (hdc, BITSPIXEL);
+
+ /* DirectDraw can only change the depth in fullscreen mode */
+ if (!(pScreenInfo->fFullScreen &&
+ (pScreenInfo->dwBPP != WIN_DEFAULT_BPP)))
+ {
+ /* Otherwise, We'll use GDI's depth */
+ pScreenInfo->dwBPP = dwBPP;
+ }
+
+ /* Release our DC */
+ ReleaseDC (NULL, hdc);
+
+ return TRUE;
+}
+
+
+/*
+ * We need to blit our offscreen fb to
+ * the screen when we are activated, and we need to point
+ * the fb code back to the primary surface memory.
+ */
+
+static Bool
+winActivateAppPrimaryDD (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ RECT rcSrc, rcClient;
+ HRESULT ddrval = DD_OK;
+
+ /* Check for errors */
+ if (pScreenPriv == NULL
+ || pScreenPriv->pddsPrimary == NULL
+ || pScreenPriv->pddsOffscreen == NULL)
+ return FALSE;
+
+ /* Check for do-nothing */
+ if (!pScreenPriv->fActive)
+ return TRUE;
+
+ /* We are activating */
+ ddrval = IDirectDrawSurface2_IsLost (pScreenPriv->pddsOffscreen);
+ if (ddrval == DD_OK)
+ {
+ IDirectDrawSurface2_Unlock (pScreenPriv->pddsOffscreen,
+ NULL);
+ /*
+ * We don't check for an error from Unlock, because it
+ * doesn't matter if the Unlock failed.
+ */
+ }
+
+ /* Restore both surfaces, just cause I like it that way */
+ IDirectDrawSurface2_Restore (pScreenPriv->pddsOffscreen);
+ IDirectDrawSurface2_Restore (pScreenPriv->pddsPrimary);
+
+ /* Get client area in screen coords */
+ GetClientRect (pScreenPriv->hwndScreen, &rcClient);
+ MapWindowPoints (pScreenPriv->hwndScreen,
+ HWND_DESKTOP,
+ (LPPOINT)&rcClient, 2);
+
+ /* Setup a source rectangle */
+ rcSrc.left = 0;
+ rcSrc.top = 0;
+ rcSrc.right = pScreenInfo->dwWidth;
+ rcSrc.bottom = pScreenInfo->dwHeight;
+
+ ddrval = IDirectDrawSurface2_Blt (pScreenPriv->pddsPrimary,
+ &rcClient,
+ pScreenPriv->pddsOffscreen,
+ &rcSrc,
+ DDBLT_WAIT,
+ NULL);
+ if (ddrval != DD_OK)
+ FatalError ("winActivateAppPrimaryDD () - Failed blitting offscreen "
+ "surface to primary surface %08x\n", (unsigned int) ddrval);
+
+ /* Lock the primary surface */
+ ddrval = IDirectDrawSurface2_Lock (pScreenPriv->pddsPrimary,
+ &rcClient,
+ pScreenPriv->pddsdPrimary,
+ DDLOCK_WAIT,
+ NULL);
+ if (ddrval != DD_OK
+ || pScreenPriv->pddsdPrimary->lpSurface == NULL)
+ FatalError ("winActivateAppPrimaryDD () - Could not lock "
+ "primary surface\n");
+
+ /* Notify FB of the new memory pointer */
+ winUpdateFBPointer (pScreen,
+ pScreenPriv->pddsdPrimary->lpSurface);
+
+ /*
+ * Register the Alt-Tab combo as a hotkey so we can copy
+ * the primary framebuffer before the display mode changes
+ */
+ RegisterHotKey (pScreenPriv->hwndScreen, 1, MOD_ALT, 9);
+
+ return TRUE;
+}
+
+
+/*
+ * Handle the Alt+Tab hotkey.
+ *
+ * We need to save the primary fb to an offscreen fb when
+ * we get deactivated, and point the fb code at the offscreen
+ * fb for the duration of the deactivation.
+ */
+
+static Bool
+winHotKeyAltTabPrimaryDD (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ RECT rcClient, rcSrc;
+ HRESULT ddrval = DD_OK;
+
+ winDebug ("\nwinHotKeyAltTabPrimaryDD\n\n");
+
+ /* Alt+Tab was pressed, we will lose focus very soon */
+ pScreenPriv->fActive = FALSE;
+
+ /* Check for error conditions */
+ if (pScreenPriv->pddsPrimary == NULL
+ || pScreenPriv->pddsOffscreen == NULL)
+ return FALSE;
+
+ /* Get client area in screen coords */
+ GetClientRect (pScreenPriv->hwndScreen, &rcClient);
+ MapWindowPoints (pScreenPriv->hwndScreen,
+ HWND_DESKTOP,
+ (LPPOINT)&rcClient, 2);
+
+ /* Did we loose the primary surface? */
+ ddrval = IDirectDrawSurface2_IsLost (pScreenPriv->pddsPrimary);
+ if (ddrval == DD_OK)
+ {
+ ddrval = IDirectDrawSurface2_Unlock (pScreenPriv->pddsPrimary,
+ NULL);
+ if (FAILED (ddrval))
+ FatalError ("winHotKeyAltTabPrimaryDD - Failed unlocking primary "
+ "surface\n");
+ }
+
+ /* Setup a source rectangle */
+ rcSrc.left = 0;
+ rcSrc.top = 0;
+ rcSrc.right = pScreenInfo->dwWidth;
+ rcSrc.bottom = pScreenInfo->dwHeight;
+
+ /* Blit the primary surface to the offscreen surface */
+ ddrval = IDirectDrawSurface2_Blt (pScreenPriv->pddsOffscreen,
+ NULL, /* should be rcDest */
+ pScreenPriv->pddsPrimary,
+ NULL,
+ DDBLT_WAIT,
+ NULL);
+ if (ddrval == DDERR_SURFACELOST)
+ {
+ IDirectDrawSurface2_Restore (pScreenPriv->pddsOffscreen);
+ IDirectDrawSurface2_Restore (pScreenPriv->pddsPrimary);
+
+ /* Blit the primary surface to the offscreen surface */
+ ddrval = IDirectDrawSurface2_Blt (pScreenPriv->pddsOffscreen,
+ NULL,
+ pScreenPriv->pddsPrimary,
+ NULL,
+ DDBLT_WAIT,
+ NULL);
+ if (FAILED (ddrval))
+ FatalError ("winHotKeyAltTabPrimaryDD - Failed blitting primary "
+ "surface to offscreen surface: %08x\n",
+ (unsigned int) ddrval);
+ }
+ else
+ {
+ FatalError ("winHotKeyAltTabPrimaryDD - Unknown error from "
+ "Blt: %08dx\n", (unsigned int) ddrval);
+ }
+
+ /* Lock the offscreen surface */
+ ddrval = IDirectDrawSurface2_Lock (pScreenPriv->pddsOffscreen,
+ NULL,
+ pScreenPriv->pddsdOffscreen,
+ DDLOCK_WAIT,
+ NULL);
+ if (ddrval != DD_OK
+ || pScreenPriv->pddsdPrimary->lpSurface == NULL)
+ FatalError ("winHotKeyAltTabPrimaryDD - Could not lock "
+ "offscreen surface\n");
+
+ /* Notify FB of the new memory pointer */
+ winUpdateFBPointer (pScreen,
+ pScreenPriv->pddsdOffscreen->lpSurface);
+
+ /* Unregister our hotkey */
+ UnregisterHotKey (pScreenPriv->hwndScreen, 1);
+
+ return TRUE;
+}
+
+
+/* Set engine specific functions */
+Bool
+winSetEngineFunctionsPrimaryDD (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+
+ /* Set our pointers */
+ pScreenPriv->pwinAllocateFB = winAllocateFBPrimaryDD;
+ pScreenPriv->pwinFreeFB = winFreeFBPrimaryDD;
+ pScreenPriv->pwinShadowUpdate = (winShadowUpdateProcPtr) (void (*)(void))NoopDDA;
+ pScreenPriv->pwinInitScreen = winInitScreenPrimaryDD;
+ pScreenPriv->pwinCloseScreen = winCloseScreenPrimaryDD;
+ pScreenPriv->pwinInitVisuals = winInitVisualsPrimaryDD;
+ pScreenPriv->pwinAdjustVideoMode = winAdjustVideoModePrimaryDD;
+ if (pScreenInfo->fFullScreen)
+ pScreenPriv->pwinCreateBoundingWindow = winCreateBoundingWindowFullScreen;
+ else
+ pScreenPriv->pwinCreateBoundingWindow = winCreateBoundingWindowWindowed;
+ pScreenPriv->pwinFinishScreenInit = winFinishScreenInitFB;
+ pScreenPriv->pwinBltExposedRegions = (winBltExposedRegionsProcPtr) (void (*)(void))NoopDDA;
+ pScreenPriv->pwinActivateApp = winActivateAppPrimaryDD;
+ pScreenPriv->pwinRedrawScreen = NULL;
+ pScreenPriv->pwinRealizeInstalledPalette = NULL;
+ pScreenPriv->pwinInstallColormap = NULL;
+ pScreenPriv->pwinStoreColors = NULL;
+ pScreenPriv->pwinCreateColormap = NULL;
+ pScreenPriv->pwinDestroyColormap = NULL;
+ pScreenPriv->pwinHotKeyAltTab = winHotKeyAltTabPrimaryDD;
+ pScreenPriv->pwinCreatePrimarySurface = (winCreatePrimarySurfaceProcPtr) (void (*)(void))NoopDDA;
+ pScreenPriv->pwinReleasePrimarySurface = (winReleasePrimarySurfaceProcPtr) (void (*)(void))NoopDDA;
+#ifdef XWIN_MULTIWINDOW
+ pScreenPriv->pwinFinishCreateWindowsWindow =
+ (winFinishCreateWindowsWindowProcPtr) (void (*)(void))NoopDDA;
+#endif
+
+ return TRUE;
+}
diff --git a/xorg-server/hw/xwin/winpixmap.c b/xorg-server/hw/xwin/winpixmap.c index 82b6bbb5c..2af95f225 100644 --- a/xorg-server/hw/xwin/winpixmap.c +++ b/xorg-server/hw/xwin/winpixmap.c @@ -70,11 +70,9 @@ winCreatePixmapNativeGDI (ScreenPtr pScreen, return NullPixmap;
}
-#if CYGDEBUG
winDebug ("winCreatePixmap () - w %d h %d d %d uh %d bw %d\n",
iWidth, iHeight, iDepth, usage_hint,
PixmapBytePad (iWidth, iDepth));
-#endif
/* Setup pixmap values */
pPixmap->drawable.type = DRAWABLE_PIXMAP;
@@ -114,11 +112,9 @@ winCreatePixmapNativeGDI (ScreenPtr pScreen, &pPixmapPriv->pbBits,
(BITMAPINFO **) &pPixmapPriv->pbmih);
-#if CYGDEBUG
winDebug ("winCreatePixmap () - Created a pixmap %08x, %dx%dx%d, for " \
"screen: %08x\n",
pPixmapPriv->hBitmap, iWidth, iHeight, iDepth, pScreen);
-#endif
return pPixmap;
}
@@ -135,9 +131,7 @@ winDestroyPixmapNativeGDI (PixmapPtr pPixmap) {
winPrivPixmapPtr pPixmapPriv = NULL;
-#if CYGDEBUG
winDebug ("winDestroyPixmapNativeGDI ()\n");
-#endif
/* Bail early if there is not a pixmap to destroy */
if (pPixmap == NULL)
@@ -149,10 +143,8 @@ winDestroyPixmapNativeGDI (PixmapPtr pPixmap) /* Get a handle to the pixmap privates */
pPixmapPriv = winGetPixmapPriv (pPixmap);
-#if CYGDEBUG
winDebug ("winDestroyPixmapNativeGDI - pPixmapPriv->hBitmap: %08x\n",
pPixmapPriv->hBitmap);
-#endif
/* Decrement reference count, return if nonzero */
--pPixmap->refcnt;
@@ -190,43 +182,3 @@ winModifyPixmapHeaderNativeGDI (PixmapPtr pPixmap, return TRUE;
}
-
-#if 0
-/*
- * Not used yet.
- * See cfb/cfbpixmap.c
- */
-
-static void
-winXRotatePixmapNativeGDI (PixmapPtr pPix, int rw)
-{
- ErrorF ("winXRotatePixmap()\n");
- /* fill in this function, look at CFB */
-}
-
-
-/*
- * Not used yet.
- * See cfb/cfbpixmap.c
- */
-static void
-winYRotatePixmapNativeGDI (PixmapPtr pPix, int rh)
-{
- ErrorF ("winYRotatePixmap()\n");
- /* fill in this function, look at CFB */
-}
-
-
-/*
- * Not used yet.
- * See cfb/cfbpixmap.c
- */
-
-static void
-winCopyRotatePixmapNativeGDI (PixmapPtr psrcPix, PixmapPtr *ppdstPix,
- int xrot, int yrot)
-{
- ErrorF ("winCopyRotatePixmap()\n");
- /* fill in this function, look at CFB */
-}
-#endif
diff --git a/xorg-server/hw/xwin/winpolyline.c b/xorg-server/hw/xwin/winpolyline.c index db9dd345b..bf98d73ec 100644 --- a/xorg-server/hw/xwin/winpolyline.c +++ b/xorg-server/hw/xwin/winpolyline.c @@ -45,7 +45,7 @@ winPolyLineNativeGDI (DrawablePtr pDrawable, { case LineSolid: if (pGC->lineWidth == 0) - return miZeroLine (pDrawable, pGC, mode, npt, ppt); + miZeroLine (pDrawable, pGC, mode, npt, ppt); else miWideLine (pDrawable, pGC, mode, npt, ppt); break; diff --git a/xorg-server/hw/xwin/winprefs.c b/xorg-server/hw/xwin/winprefs.c index d941c5169..e92e95f2b 100644 --- a/xorg-server/hw/xwin/winprefs.c +++ b/xorg-server/hw/xwin/winprefs.c @@ -1,832 +1,840 @@ -/* - * Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved. - * Copyright (C) Colin Harrison 2005-2008 - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of the XFree86 Project - * shall not be used in advertising or otherwise to promote the sale, use - * or other dealings in this Software without prior written authorization - * from the XFree86 Project. - * - * Authors: Earle F. Philhower, III - * Colin Harrison - */ - -#ifdef HAVE_XWIN_CONFIG_H -#include <xwin-config.h> -#endif -#include <stdio.h> -#include <stdlib.h> -#ifdef __CYGWIN__ -#include <sys/resource.h> -#endif -#include "win.h" - -#include <X11/Xwindows.h> -#include <shellapi.h> - -#include "winprefs.h" -#include "winmultiwindowclass.h" - -/* Where will the custom menu commands start counting from? */ -#define STARTMENUID WM_USER - -extern const char *winGetBaseDir(void); - -/* From winmultiwindowflex.l, the real parser */ -extern void parse_file (FILE *fp); - - -/* Currently in use command ID, incremented each new menu item created */ -static int g_cmdid = STARTMENUID; - - -/* Defined in DIX */ -extern char *display; - -/* Local function to handle comma-ified icon names */ -static HICON -LoadImageComma (char *fname, int sx, int sy, int flags); - - -/* - * Creates or appends a menu from a MENUPARSED structure - */ -static HMENU -MakeMenu (char *name, - HMENU editMenu, - int editItem) -{ - int i; - int item; - MENUPARSED *m; - HMENU hmenu, hsub; - - for (i=0; i<pref.menuItems; i++) - { - if (!strcmp(name, pref.menu[i].menuName)) - break; - } - - /* Didn't find a match, bummer */ - if (i==pref.menuItems) - { - ErrorF("MakeMenu: Can't find menu %s\n", name); - return NULL; - } - - m = &(pref.menu[i]); - - if (editMenu) - { - hmenu = editMenu; - item = editItem; - } - else - { - hmenu = CreatePopupMenu(); - if (!hmenu) - { - ErrorF("MakeMenu: Unable to CreatePopupMenu() %s\n", name); - return NULL; - } - item = 0; - } - - /* Add the menu items */ - for (i=0; i<m->menuItems; i++) - { - /* Only assign IDs one time... */ - if ( m->menuItem[i].commandID == 0 ) - m->menuItem[i].commandID = g_cmdid++; - - switch (m->menuItem[i].cmd) - { - case CMD_EXEC: - case CMD_ALWAYSONTOP: - case CMD_RELOAD: - InsertMenu (hmenu, - item, - MF_BYPOSITION|MF_ENABLED|MF_STRING, - m->menuItem[i].commandID, - m->menuItem[i].text); - break; - - case CMD_SEPARATOR: - InsertMenu (hmenu, - item, - MF_BYPOSITION|MF_SEPARATOR, - 0, - NULL); - break; - - case CMD_MENU: - /* Recursive! */ - hsub = MakeMenu (m->menuItem[i].param, 0, 0); - if (hsub) - InsertMenu (hmenu, - item, - MF_BYPOSITION|MF_POPUP|MF_ENABLED|MF_STRING, - (UINT_PTR)hsub, - m->menuItem[i].text); - break; - } - - /* If item==-1 (means to add at end of menu) don't increment) */ - if (item>=0) - item++; - } - - return hmenu; -} - - -#ifdef XWIN_MULTIWINDOW -/* - * Callback routine that is executed once per window class. - * Removes or creates custom window settings depending on LPARAM - */ -static wBOOL CALLBACK -ReloadEnumWindowsProc (HWND hwnd, LPARAM lParam) -{ - HICON hicon; - Window wid; - - if (!hwnd) { - ErrorF("ReloadEnumWindowsProc: hwnd==NULL!\n"); - return FALSE; - } - - /* It's our baby, either clean or dirty it */ - if (lParam==FALSE) - { - /* Reset the window's icon to undefined. */ - hicon = (HICON)SendMessage(hwnd, WM_SETICON, ICON_BIG, 0); - - /* If the old icon is generated on-the-fly, get rid of it, will regen */ - winDestroyIcon (hicon); - - /* Same for the small icon */ - hicon = (HICON)SendMessage(hwnd, WM_SETICON, ICON_SMALL, 0); - winDestroyIcon (hicon); - - /* Remove any menu additions; bRevert=TRUE destroys any modified menus */ - GetSystemMenu (hwnd, TRUE); - - /* This window is now clean of our taint (but with undefined icons) */ - } - else - { - /* winUpdateIcon() will set the icon default, dynamic, or from xwinrc */ - wid = (Window)GetProp (hwnd, WIN_WID_PROP); - if (wid) - winUpdateIcon (wid); - - /* Update the system menu for this window */ - SetupSysMenu ((unsigned long)hwnd); - - /* That was easy... */ - } - - return TRUE; -} -#endif - - -/* - * Removes any custom icons in classes, custom menus, etc. - * Frees all members in pref structure. - * Reloads the preferences file. - * Set custom icons and menus again. - */ -static void -ReloadPrefs (void) -{ - int i; - -#ifdef XWIN_MULTIWINDOW - /* First, iterate over all windows, deleting their icons and custom menus. - * This is really only needed because winDestroyIcon() will try to - * destroy the old global icons, which will have changed. - * It is probably better to set a windows USER_DATA to flag locally defined - * icons, and use that to accurately know when to destroy old icons. - */ - EnumThreadWindows (g_dwCurrentThreadID, ReloadEnumWindowsProc, FALSE); -#endif - - /* Now, free/clear all info from our prefs structure */ - for (i=0; i<pref.menuItems; i++) - free (pref.menu[i].menuItem); - free (pref.menu); - pref.menu = NULL; - pref.menuItems = 0; - - pref.rootMenuName[0] = 0; - - free (pref.sysMenu); - pref.sysMenuItems = 0; - - pref.defaultSysMenuName[0] = 0; - pref.defaultSysMenuPos = 0; - - pref.iconDirectory[0] = 0; - pref.defaultIconName[0] = 0; - pref.trayIconName[0] = 0; - - for (i=0; i<pref.iconItems; i++) - if (pref.icon[i].hicon) - DestroyIcon ((HICON)pref.icon[i].hicon); - free (pref.icon); - pref.icon = NULL; - pref.iconItems = 0; - - /* Free global default X icon */ - if (g_hIconX) - DestroyIcon (g_hIconX); - if (g_hSmallIconX) - DestroyIcon (g_hSmallIconX); - - /* Reset the custom command IDs */ - g_cmdid = STARTMENUID; - - /* Load the updated resource file */ - LoadPreferences(); - - g_hIconX = NULL; - g_hSmallIconX = NULL; - -#ifdef XWIN_MULTIWINDOW - winInitGlobalIcons(); -#endif - -#ifdef XWIN_MULTIWINDOW - /* Rebuild the icons and menus */ - EnumThreadWindows (g_dwCurrentThreadID, ReloadEnumWindowsProc, TRUE); -#endif - - /* Whew, done */ -} - -/* - * Check/uncheck the ALWAYSONTOP items in this menu - */ -void -HandleCustomWM_INITMENU(unsigned long hwndIn, - unsigned long hmenuIn) -{ - HWND hwnd; - HMENU hmenu; - DWORD dwExStyle; - int i, j; - - hwnd = (HWND)hwndIn; - hmenu = (HMENU)hmenuIn; - if (!hwnd || !hmenu) - return; - - if (GetWindowLongPtr(hwnd, GWL_EXSTYLE) & WS_EX_TOPMOST) - dwExStyle = MF_BYCOMMAND | MF_CHECKED; - else - dwExStyle = MF_BYCOMMAND | MF_UNCHECKED; - - for (i=0; i<pref.menuItems; i++) - for (j=0; j<pref.menu[i].menuItems; j++) - if (pref.menu[i].menuItem[j].cmd==CMD_ALWAYSONTOP) - CheckMenuItem (hmenu, pref.menu[i].menuItem[j].commandID, dwExStyle ); - -} - -/* - * Searches for the custom WM_COMMAND command ID and performs action. - * Return TRUE if command is proccessed, FALSE otherwise. - */ -Bool -HandleCustomWM_COMMAND (unsigned long hwndIn, - int command) -{ - HWND hwnd; - int i, j; - MENUPARSED *m; - DWORD dwExStyle; - - hwnd = (HWND)hwndIn; - - if (!command) - return FALSE; - - for (i=0; i<pref.menuItems; i++) - { - m = &(pref.menu[i]); - for (j=0; j<m->menuItems; j++) - { - if (command==m->menuItem[j].commandID) - { - /* Match! */ - switch(m->menuItem[j].cmd) - { -#ifdef __CYGWIN__ - case CMD_EXEC: - if (fork()==0) - { - struct rlimit rl; - unsigned long i; - - /* Close any open descriptors except for STD* */ - getrlimit (RLIMIT_NOFILE, &rl); - for (i = STDERR_FILENO+1; i < rl.rlim_cur; i++) - close(i); - - /* Disassociate any TTYs */ - setsid(); - - execl ("/bin/sh", - "/bin/sh", - "-c", - m->menuItem[j].param, - NULL); - exit (0); - } - else - return TRUE; - break; -#else - case CMD_EXEC: - { - /* Start process without console window */ - STARTUPINFO start; - PROCESS_INFORMATION child; - - memset (&start, 0, sizeof (start)); - start.cb = sizeof (start); - start.dwFlags = STARTF_USESHOWWINDOW; - start.wShowWindow = SW_HIDE; - - memset (&child, 0, sizeof (child)); - - if (CreateProcess (NULL, m->menuItem[j].param, NULL, NULL, FALSE, 0, - NULL, NULL, &start, &child)) - { - CloseHandle (child.hThread); - CloseHandle (child.hProcess); - } - else - MessageBox(NULL, m->menuItem[j].param, "Mingrc Exec Command Error!", MB_OK | MB_ICONEXCLAMATION); - } - return TRUE; -#endif - case CMD_ALWAYSONTOP: - if (!hwnd) - return FALSE; - - /* Get extended window style */ - dwExStyle = GetWindowLongPtr(hwnd, GWL_EXSTYLE); - - /* Handle topmost windows */ - if (dwExStyle & WS_EX_TOPMOST) - SetWindowPos (hwnd, - HWND_NOTOPMOST, - 0, 0, - 0, 0, - SWP_NOSIZE | SWP_NOMOVE); - else - SetWindowPos (hwnd, - HWND_TOPMOST, - 0, 0, - 0, 0, - SWP_NOSIZE | SWP_NOMOVE); -#if XWIN_MULTIWINDOW - /* Reflect the changed Z order */ - winReorderWindowsMultiWindow (); -#endif - return TRUE; - - case CMD_RELOAD: - ReloadPrefs(); - return TRUE; - - default: - return FALSE; - } - } /* match */ - } /* for j */ - } /* for i */ - - return FALSE; -} - - -#ifdef XWIN_MULTIWINDOW -/* - * Add the default or a custom menu depending on the class match - */ -void -SetupSysMenu (unsigned long hwndIn) -{ - HWND hwnd; - HMENU sys; - int i; - WindowPtr pWin; - char *res_name, *res_class; - - hwnd = (HWND)hwndIn; - if (!hwnd) - return; - - pWin = GetProp (hwnd, WIN_WINDOW_PROP); - - sys = GetSystemMenu (hwnd, FALSE); - if (!sys) - return; - - if (pWin) - { - /* First see if there's a class match... */ - if (winMultiWindowGetClassHint (pWin, &res_name, &res_class)) - { - for (i=0; i<pref.sysMenuItems; i++) - { - if (!strcmp(pref.sysMenu[i].match, res_name) || - !strcmp(pref.sysMenu[i].match, res_class) ) - { - free(res_name); - free(res_class); - - MakeMenu (pref.sysMenu[i].menuName, sys, - pref.sysMenu[i].menuPos==AT_START?0:-1); - return; - } - } - - /* No match, just free alloc'd strings */ - free(res_name); - free(res_class); - } /* Found wm_class */ - } /* if pwin */ - - /* Fallback to system default */ - if (pref.defaultSysMenuName[0]) - { - if (pref.defaultSysMenuPos==AT_START) - MakeMenu (pref.defaultSysMenuName, sys, 0); - else - MakeMenu (pref.defaultSysMenuName, sys, -1); - } -} -#endif - - -/* - * Possibly add a menu to the toolbar icon - */ -void -SetupRootMenu (unsigned long hmenuRoot) -{ - HMENU root; - - root = (HMENU)hmenuRoot; - if (!root) - return; - - if (pref.rootMenuName[0]) - { - MakeMenu(pref.rootMenuName, root, 0); - } -} - - -/* - * Check for and return an overridden default ICON specified in the prefs - */ -HICON -winOverrideDefaultIcon(int size) -{ - HICON hicon; - - if (pref.defaultIconName[0]) - { - hicon = LoadImageComma (pref.defaultIconName, size, size, 0); - if (hicon==NULL) - ErrorF ("winOverrideDefaultIcon: LoadImageComma(%s) failed\n", - pref.defaultIconName); - - return hicon; - } - - return 0; -} - - -/* - * Return the HICON to use in the taskbar notification area - */ -HICON -winTaskbarIcon(void) -{ - HICON hicon; - - hicon = 0; - /* First try and load an overridden, if success then return it */ - if (pref.trayIconName[0]) - { - hicon = LoadImageComma (pref.trayIconName, - GetSystemMetrics (SM_CXSMICON), - GetSystemMetrics (SM_CYSMICON), - 0 ); - } - - /* Otherwise return the default */ - if (!hicon) - hicon = (HICON) LoadImage (g_hInstance, - MAKEINTRESOURCE(IDI_XWIN), - IMAGE_ICON, - GetSystemMetrics (SM_CXSMICON), - GetSystemMetrics (SM_CYSMICON), - 0); - - return hicon; -} - - -/* - * Parse a filename to extract an icon: - * If fname is exactly ",nnn" then extract icon from our resource - * else if it is "file,nnn" then extract icon nnn from that file - * else try to load it as an .ico file and if that fails return NULL - */ -static HICON -LoadImageComma (char *fname, int sx, int sy, int flags) -{ - HICON hicon; - int index; - char file[PATH_MAX+NAME_MAX+2]; - - /* Some input error checking */ - if (!fname || !fname[0]) - return NULL; - - index = 0; - hicon = NULL; - - if (fname[0]==',') - { - /* It's the XWIN.EXE resource they want */ - index = atoi (fname+1); - hicon = LoadImage (g_hInstance, - MAKEINTRESOURCE(index), - IMAGE_ICON, - sx, - sy, - flags); - } - else - { - file[0] = 0; - /* Prepend path if not given a "X:\" filename */ - if ( !(fname[0] && fname[1]==':' && fname[2]=='\\') ) - { - strcpy (file, pref.iconDirectory); - if (pref.iconDirectory[0]) - if (fname[strlen(fname)-1]!='\\') - strcat (file, "\\"); - } - strcat (file, fname); - - if (strrchr (file, ',')) - { - /* Specified as <fname>,<index> */ - - *(strrchr (file, ',')) = 0; /* End string at comma */ - index = atoi (strrchr (fname, ',') + 1); - hicon = ExtractIcon (g_hInstance, file, index); - } - else - { - /* Just an .ico file... */ - - hicon = (HICON)LoadImage (NULL, - file, - IMAGE_ICON, - sx, - sy, - LR_LOADFROMFILE|flags); - } - } - return hicon; -} - -/* - * Check for a match of the window class to one specified in the - * ICONS{} section in the prefs file, and load the icon from a file - */ -HICON -winOverrideIcon (unsigned long longWin) -{ - WindowPtr pWin = (WindowPtr) longWin; - char *res_name, *res_class; - int i; - HICON hicon; - char *wmName; - - if (pWin==NULL) - return 0; - - /* If we can't find the class, we can't override from default! */ - if (!winMultiWindowGetClassHint (pWin, &res_name, &res_class)) - return 0; - - winMultiWindowGetWMName (pWin, &wmName); - - for (i=0; i<pref.iconItems; i++) { - if (!strcmp(pref.icon[i].match, res_name) || - !strcmp(pref.icon[i].match, res_class) || - (wmName && strstr(wmName, pref.icon[i].match))) - { - free (res_name); - free (res_class); - free(wmName); - - if (pref.icon[i].hicon) - return pref.icon[i].hicon; - - hicon = LoadImageComma (pref.icon[i].iconFile, 0, 0, LR_DEFAULTSIZE); - if (hicon==NULL) - ErrorF ("winOverrideIcon: LoadImageComma(%s) failed\n", - pref.icon[i].iconFile); - - pref.icon[i].hicon = hicon; - return hicon; - } - } - - /* Didn't find the icon, fail gracefully */ - free (res_name); - free (res_class); - free(wmName); - - return 0; -} - - -/* - * Should we free this icon or leave it in memory (is it part of our - * ICONS{} overrides)? - */ -int -winIconIsOverride(unsigned hiconIn) -{ - HICON hicon; - int i; - - hicon = (HICON)hiconIn; - - if (!hicon) - return 0; - - for (i=0; i<pref.iconItems; i++) - if ((HICON)pref.icon[i].hicon == hicon) - return 1; - - return 0; -} - - - -/* - * Try and open ~/.XWinrc and system.XWinrc - * Load it into prefs structure for use by other functions - */ -void -LoadPreferences (void) -{ - char *home; - char fname[PATH_MAX+NAME_MAX+2]; - FILE *prefFile; - char szDisplay[512]; - char *szEnvDisplay; - int i, j; - char param[PARAM_MAX+1]; - char *srcParam, *dstParam; - - /* First, clear all preference settings */ - memset (&pref, 0, sizeof(pref)); - prefFile = NULL; - - /* Now try and find a ~/.xwinrc file */ - home = getenv ("HOME"); - if (home) - { - strcpy (fname, home); - if (fname[strlen(fname)-1]!='/') - strcat (fname, "/"); - strcat (fname, ".XWinrc"); - - prefFile = fopen (fname, "r"); - if (prefFile) - ErrorF ("winPrefsLoadPreferences: %s\n", fname); - } - - /* No home file found, check system default */ - if (!prefFile) - { - char buffer[MAX_PATH]; -#ifdef RELOCATE_PROJECTROOT - snprintf(buffer, sizeof(buffer), "%s\\system.XWinrc", winGetBaseDir()); -#else - strncpy(buffer, SYSCONFDIR"/X11/system.XWinrc", sizeof(buffer)); -#endif - buffer[sizeof(buffer)-1] = 0; - prefFile = fopen (buffer, "r"); - if (prefFile) - ErrorF ("winPrefsLoadPreferences: %s\n", buffer); - } - - /* If we could open it, then read the settings and close it */ - if (prefFile) - { - parse_file (prefFile); - fclose (prefFile); - } - - /* Setup a DISPLAY environment variable, need to allocate on heap */ - /* because putenv doesn't copy the argument... */ - snprintf (szDisplay, 512, "DISPLAY=127.0.0.1:%s.0", display); - szEnvDisplay = (char *)(malloc (strlen(szDisplay)+1)); - if (szEnvDisplay) - { - strcpy (szEnvDisplay, szDisplay); - putenv (szEnvDisplay); - } - - /* Replace any "%display%" in menu commands with display string */ - snprintf (szDisplay, 512, "127.0.0.1:%s.0", display); - for (i=0; i<pref.menuItems; i++) - { - for (j=0; j<pref.menu[i].menuItems; j++) - { - if (pref.menu[i].menuItem[j].cmd==CMD_EXEC) - { - srcParam = pref.menu[i].menuItem[j].param; - dstParam = param; - while (*srcParam) { - if (!strncmp(srcParam, "%display%", 9)) - { - memcpy (dstParam, szDisplay, strlen(szDisplay)); - dstParam += strlen(szDisplay); - srcParam += 9; - } - else - { - *dstParam = *srcParam; - dstParam++; - srcParam++; - } - } - *dstParam = 0; - strcpy (pref.menu[i].menuItem[j].param, param); - } /* cmd==cmd_exec */ - } /* for all menuitems */ - } /* for all menus */ - -} - - -/* - * Check for a match of the window class to one specified in the - * STYLES{} section in the prefs file, and return the style type - */ -unsigned long -winOverrideStyle (char *res_name, char *res_class, char *wmName) -{ - int i; - - for (i=0; i<pref.styleItems; i++) { - if ((res_name && !strcmp(pref.style[i].match, res_name)) || - (res_class && !strcmp(pref.style[i].match, res_class)) || - (wmName && strstr(wmName, pref.style[i].match))) - { - if (pref.style[i].type) - return pref.style[i].type; - } - } - - /* Didn't find the style, fail gracefully */ - return STYLE_NONE; -} +/*
+ * Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
+ * Copyright (C) Colin Harrison 2005-2008
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name of the XFree86 Project
+ * shall not be used in advertising or otherwise to promote the sale, use
+ * or other dealings in this Software without prior written authorization
+ * from the XFree86 Project.
+ *
+ * Authors: Earle F. Philhower, III
+ * Colin Harrison
+ */
+
+#ifdef HAVE_XWIN_CONFIG_H
+#include <xwin-config.h>
+#endif
+#include <stdio.h>
+#include <stdlib.h>
+#ifdef __CYGWIN__
+#include <sys/resource.h>
+#endif
+#include "win.h"
+
+#include <X11/Xwindows.h>
+#include <shellapi.h>
+
+#include "winprefs.h"
+#include "winmultiwindowclass.h"
+
+/* Where will the custom menu commands start counting from? */
+#define STARTMENUID WM_USER
+
+extern const char *winGetBaseDir(void);
+
+extern const char *g_pszLogFile;
+
+/* From winmultiwindowflex.l, the real parser */
+extern void parse_file (FILE *fp);
+
+
+/* Currently in use command ID, incremented each new menu item created */
+static int g_cmdid = STARTMENUID;
+
+
+/* Defined in DIX */
+extern char *display;
+
+/* Local function to handle comma-ified icon names */
+static HICON
+LoadImageComma (char *fname, int sx, int sy, int flags);
+
+
+/*
+ * Creates or appends a menu from a MENUPARSED structure
+ */
+static HMENU
+MakeMenu (char *name,
+ HMENU editMenu,
+ int editItem)
+{
+ int i;
+ int item;
+ MENUPARSED *m;
+ HMENU hmenu, hsub;
+
+ for (i=0; i<pref.menuItems; i++)
+ {
+ if (!strcmp(name, pref.menu[i].menuName))
+ break;
+ }
+
+ /* Didn't find a match, bummer */
+ if (i==pref.menuItems)
+ {
+ ErrorF("MakeMenu: Can't find menu %s\n", name);
+ return NULL;
+ }
+
+ m = &(pref.menu[i]);
+
+ if (editMenu)
+ {
+ hmenu = editMenu;
+ item = editItem;
+ }
+ else
+ {
+ hmenu = CreatePopupMenu();
+ if (!hmenu)
+ {
+ ErrorF("MakeMenu: Unable to CreatePopupMenu() %s\n", name);
+ return NULL;
+ }
+ item = 0;
+ }
+
+ /* Add the menu items */
+ for (i=0; i<m->menuItems; i++)
+ {
+ /* Only assign IDs one time... */
+ if ( m->menuItem[i].commandID == 0 )
+ m->menuItem[i].commandID = g_cmdid++;
+
+ switch (m->menuItem[i].cmd)
+ {
+ case CMD_EXEC:
+ case CMD_ALWAYSONTOP:
+ case CMD_RELOAD:
+ InsertMenu (hmenu,
+ item,
+ MF_BYPOSITION|MF_ENABLED|MF_STRING,
+ m->menuItem[i].commandID,
+ m->menuItem[i].text);
+ break;
+
+ case CMD_SEPARATOR:
+ InsertMenu (hmenu,
+ item,
+ MF_BYPOSITION|MF_SEPARATOR,
+ 0,
+ NULL);
+ break;
+
+ case CMD_MENU:
+ /* Recursive! */
+ hsub = MakeMenu (m->menuItem[i].param, 0, 0);
+ if (hsub)
+ InsertMenu (hmenu,
+ item,
+ MF_BYPOSITION|MF_POPUP|MF_ENABLED|MF_STRING,
+ (UINT_PTR)hsub,
+ m->menuItem[i].text);
+ break;
+ }
+
+ /* If item==-1 (means to add at end of menu) don't increment) */
+ if (item>=0)
+ item++;
+ }
+
+ return hmenu;
+}
+
+
+#ifdef XWIN_MULTIWINDOW
+/*
+ * Callback routine that is executed once per window class.
+ * Removes or creates custom window settings depending on LPARAM
+ */
+static wBOOL CALLBACK
+ReloadEnumWindowsProc (HWND hwnd, LPARAM lParam)
+{
+ HICON hicon;
+ Window wid;
+
+ if (!hwnd) {
+ ErrorF("ReloadEnumWindowsProc: hwnd==NULL!\n");
+ return FALSE;
+ }
+
+ /* It's our baby, either clean or dirty it */
+ if (lParam==FALSE)
+ {
+ /* Reset the window's icon to undefined. */
+ hicon = (HICON)SendMessage(hwnd, WM_SETICON, ICON_BIG, 0);
+
+ /* If the old icon is generated on-the-fly, get rid of it, will regen */
+ winDestroyIcon (hicon);
+
+ /* Same for the small icon */
+ hicon = (HICON)SendMessage(hwnd, WM_SETICON, ICON_SMALL, 0);
+ winDestroyIcon (hicon);
+
+ /* Remove any menu additions; bRevert=TRUE destroys any modified menus */
+ GetSystemMenu (hwnd, TRUE);
+
+ /* This window is now clean of our taint (but with undefined icons) */
+ }
+ else
+ {
+ /* winUpdateIcon() will set the icon default, dynamic, or from xwinrc */
+ wid = (Window)GetProp (hwnd, WIN_WID_PROP);
+ if (wid)
+ winUpdateIcon (wid);
+
+ /* Update the system menu for this window */
+ SetupSysMenu ((unsigned long)hwnd);
+
+ /* That was easy... */
+ }
+
+ return TRUE;
+}
+#endif
+
+
+/*
+ * Removes any custom icons in classes, custom menus, etc.
+ * Frees all members in pref structure.
+ * Reloads the preferences file.
+ * Set custom icons and menus again.
+ */
+static void
+ReloadPrefs (void)
+{
+ int i;
+
+#ifdef XWIN_MULTIWINDOW
+ /* First, iterate over all windows, deleting their icons and custom menus.
+ * This is really only needed because winDestroyIcon() will try to
+ * destroy the old global icons, which will have changed.
+ * It is probably better to set a windows USER_DATA to flag locally defined
+ * icons, and use that to accurately know when to destroy old icons.
+ */
+ EnumThreadWindows (g_dwCurrentThreadID, ReloadEnumWindowsProc, FALSE);
+#endif
+
+ /* Now, free/clear all info from our prefs structure */
+ for (i=0; i<pref.menuItems; i++)
+ free (pref.menu[i].menuItem);
+ free (pref.menu);
+ pref.menu = NULL;
+ pref.menuItems = 0;
+
+ pref.rootMenuName[0] = 0;
+
+ free (pref.sysMenu);
+ pref.sysMenuItems = 0;
+
+ pref.defaultSysMenuName[0] = 0;
+ pref.defaultSysMenuPos = 0;
+
+ pref.iconDirectory[0] = 0;
+ pref.defaultIconName[0] = 0;
+ pref.trayIconName[0] = 0;
+
+ for (i=0; i<pref.iconItems; i++)
+ if (pref.icon[i].hicon)
+ DestroyIcon ((HICON)pref.icon[i].hicon);
+ free (pref.icon);
+ pref.icon = NULL;
+ pref.iconItems = 0;
+
+ /* Free global default X icon */
+ if (g_hIconX)
+ DestroyIcon (g_hIconX);
+ if (g_hSmallIconX)
+ DestroyIcon (g_hSmallIconX);
+
+ /* Reset the custom command IDs */
+ g_cmdid = STARTMENUID;
+
+ /* Load the updated resource file */
+ LoadPreferences();
+
+ g_hIconX = NULL;
+ g_hSmallIconX = NULL;
+
+#ifdef XWIN_MULTIWINDOW
+ winInitGlobalIcons();
+#endif
+
+#ifdef XWIN_MULTIWINDOW
+ /* Rebuild the icons and menus */
+ EnumThreadWindows (g_dwCurrentThreadID, ReloadEnumWindowsProc, TRUE);
+#endif
+
+ /* Whew, done */
+}
+
+/*
+ * Check/uncheck the ALWAYSONTOP items in this menu
+ */
+void
+HandleCustomWM_INITMENU(unsigned long hwndIn,
+ unsigned long hmenuIn)
+{
+ HWND hwnd;
+ HMENU hmenu;
+ DWORD dwExStyle;
+ int i, j;
+
+ hwnd = (HWND)hwndIn;
+ hmenu = (HMENU)hmenuIn;
+ if (!hwnd || !hmenu)
+ return;
+
+ if (GetWindowLongPtr(hwnd, GWL_EXSTYLE) & WS_EX_TOPMOST)
+ dwExStyle = MF_BYCOMMAND | MF_CHECKED;
+ else
+ dwExStyle = MF_BYCOMMAND | MF_UNCHECKED;
+
+ for (i=0; i<pref.menuItems; i++)
+ for (j=0; j<pref.menu[i].menuItems; j++)
+ if (pref.menu[i].menuItem[j].cmd==CMD_ALWAYSONTOP)
+ CheckMenuItem (hmenu, pref.menu[i].menuItem[j].commandID, dwExStyle );
+
+}
+
+/*
+ * Searches for the custom WM_COMMAND command ID and performs action.
+ * Return TRUE if command is proccessed, FALSE otherwise.
+ */
+Bool
+HandleCustomWM_COMMAND (unsigned long hwndIn,
+ int command)
+{
+ HWND hwnd;
+ int i, j;
+ MENUPARSED *m;
+ DWORD dwExStyle;
+
+ hwnd = (HWND)hwndIn;
+
+ if (!command)
+ return FALSE;
+
+ for (i=0; i<pref.menuItems; i++)
+ {
+ m = &(pref.menu[i]);
+ for (j=0; j<m->menuItems; j++)
+ {
+ if (command==m->menuItem[j].commandID)
+ {
+ /* Match! */
+ switch(m->menuItem[j].cmd)
+ {
+#ifdef __CYGWIN__
+ case CMD_EXEC:
+ if (fork()==0)
+ {
+ struct rlimit rl;
+ unsigned long i;
+
+ /* Close any open descriptors except for STD* */
+ getrlimit (RLIMIT_NOFILE, &rl);
+ for (i = STDERR_FILENO+1; i < rl.rlim_cur; i++)
+ close(i);
+
+ /* Disassociate any TTYs */
+ setsid();
+
+ execl ("/bin/sh",
+ "/bin/sh",
+ "-c",
+ m->menuItem[j].param,
+ NULL);
+ exit (0);
+ }
+ else
+ return TRUE;
+ break;
+#else
+ case CMD_EXEC:
+ {
+ /* Start process without console window */
+ STARTUPINFO start;
+ PROCESS_INFORMATION child;
+
+ memset (&start, 0, sizeof (start));
+ start.cb = sizeof (start);
+ //start.dwFlags = STARTF_USESHOWWINDOW;
+ //start.wShowWindow = SW_HIDE;
+
+ memset (&child, 0, sizeof (child));
+
+ if (CreateProcess (NULL, m->menuItem[j].param, NULL, NULL, FALSE, 0,
+ NULL, NULL, &start, &child))
+ {
+ CloseHandle (child.hThread);
+ CloseHandle (child.hProcess);
+ }
+ else
+ MessageBox(NULL, m->menuItem[j].param, "VcXsrv Exec Command Error!", MB_OK | MB_ICONEXCLAMATION);
+ }
+ return TRUE;
+#endif
+ case CMD_ALWAYSONTOP:
+ if (!hwnd)
+ return FALSE;
+
+ /* Get extended window style */
+ dwExStyle = GetWindowLongPtr(hwnd, GWL_EXSTYLE);
+
+ /* Handle topmost windows */
+ if (dwExStyle & WS_EX_TOPMOST)
+ SetWindowPos (hwnd,
+ HWND_NOTOPMOST,
+ 0, 0,
+ 0, 0,
+ SWP_NOSIZE | SWP_NOMOVE);
+ else
+ SetWindowPos (hwnd,
+ HWND_TOPMOST,
+ 0, 0,
+ 0, 0,
+ SWP_NOSIZE | SWP_NOMOVE);
+#if XWIN_MULTIWINDOW
+ /* Reflect the changed Z order */
+ winReorderWindowsMultiWindow ();
+#endif
+ return TRUE;
+
+ case CMD_RELOAD:
+ ReloadPrefs();
+ return TRUE;
+
+ default:
+ return FALSE;
+ }
+ } /* match */
+ } /* for j */
+ } /* for i */
+
+ return FALSE;
+}
+
+
+#ifdef XWIN_MULTIWINDOW
+/*
+ * Add the default or a custom menu depending on the class match
+ */
+void
+SetupSysMenu (unsigned long hwndIn)
+{
+ HWND hwnd;
+ HMENU sys;
+ int i;
+ WindowPtr pWin;
+ char *res_name, *res_class;
+
+ hwnd = (HWND)hwndIn;
+ if (!hwnd)
+ return;
+
+ pWin = GetProp (hwnd, WIN_WINDOW_PROP);
+
+ sys = GetSystemMenu (hwnd, FALSE);
+ if (!sys)
+ return;
+
+ if (pWin)
+ {
+ /* First see if there's a class match... */
+ if (winMultiWindowGetClassHint (pWin, &res_name, &res_class))
+ {
+ for (i=0; i<pref.sysMenuItems; i++)
+ {
+ if (!strcmp(pref.sysMenu[i].match, res_name) ||
+ !strcmp(pref.sysMenu[i].match, res_class) )
+ {
+ free(res_name);
+ free(res_class);
+
+ MakeMenu (pref.sysMenu[i].menuName, sys,
+ pref.sysMenu[i].menuPos==AT_START?0:-1);
+ return;
+ }
+ }
+
+ /* No match, just free alloc'd strings */
+ free(res_name);
+ free(res_class);
+ } /* Found wm_class */
+ } /* if pwin */
+
+ /* Fallback to system default */
+ if (pref.defaultSysMenuName[0])
+ {
+ if (pref.defaultSysMenuPos==AT_START)
+ MakeMenu (pref.defaultSysMenuName, sys, 0);
+ else
+ MakeMenu (pref.defaultSysMenuName, sys, -1);
+ }
+}
+#endif
+
+
+/*
+ * Possibly add a menu to the toolbar icon
+ */
+void
+SetupRootMenu (unsigned long hmenuRoot)
+{
+ HMENU root;
+
+ root = (HMENU)hmenuRoot;
+ if (!root)
+ return;
+
+ if (pref.rootMenuName[0])
+ {
+ MakeMenu(pref.rootMenuName, root, 0);
+ }
+}
+
+
+/*
+ * Check for and return an overridden default ICON specified in the prefs
+ */
+HICON
+winOverrideDefaultIcon(int size)
+{
+ HICON hicon;
+
+ if (pref.defaultIconName[0])
+ {
+ hicon = LoadImageComma (pref.defaultIconName, size, size, 0);
+ if (hicon==NULL)
+ ErrorF ("winOverrideDefaultIcon: LoadImageComma(%s) failed\n",
+ pref.defaultIconName);
+
+ return hicon;
+ }
+
+ return 0;
+}
+
+
+/*
+ * Return the HICON to use in the taskbar notification area
+ */
+HICON
+winTaskbarIcon(void)
+{
+ HICON hicon;
+
+ hicon = 0;
+ /* First try and load an overridden, if success then return it */
+ if (pref.trayIconName[0])
+ {
+ hicon = LoadImageComma (pref.trayIconName,
+ GetSystemMetrics (SM_CXSMICON),
+ GetSystemMetrics (SM_CYSMICON),
+ 0 );
+ }
+
+ /* Otherwise return the default */
+ if (!hicon)
+ hicon = (HICON) LoadImage (g_hInstance,
+ MAKEINTRESOURCE(IDI_XWIN),
+ IMAGE_ICON,
+ GetSystemMetrics (SM_CXSMICON),
+ GetSystemMetrics (SM_CYSMICON),
+ 0);
+
+ return hicon;
+}
+
+
+/*
+ * Parse a filename to extract an icon:
+ * If fname is exactly ",nnn" then extract icon from our resource
+ * else if it is "file,nnn" then extract icon nnn from that file
+ * else try to load it as an .ico file and if that fails return NULL
+ */
+static HICON
+LoadImageComma (char *fname, int sx, int sy, int flags)
+{
+ HICON hicon;
+ int index;
+ char file[PATH_MAX+NAME_MAX+2];
+
+ /* Some input error checking */
+ if (!fname || !fname[0])
+ return NULL;
+
+ index = 0;
+ hicon = NULL;
+
+ if (fname[0]==',')
+ {
+ /* It's the XWIN.EXE resource they want */
+ index = atoi (fname+1);
+ hicon = LoadImage (g_hInstance,
+ MAKEINTRESOURCE(index),
+ IMAGE_ICON,
+ sx,
+ sy,
+ flags);
+ }
+ else
+ {
+ file[0] = 0;
+ /* Prepend path if not given a "X:\" filename */
+ if ( !(fname[0] && fname[1]==':' && fname[2]=='\\') )
+ {
+ strcpy (file, pref.iconDirectory);
+ if (pref.iconDirectory[0])
+ if (fname[strlen(fname)-1]!='\\')
+ strcat (file, "\\");
+ }
+ strcat (file, fname);
+
+ if (strrchr (file, ','))
+ {
+ /* Specified as <fname>,<index> */
+
+ *(strrchr (file, ',')) = 0; /* End string at comma */
+ index = atoi (strrchr (fname, ',') + 1);
+ hicon = ExtractIcon (g_hInstance, file, index);
+ }
+ else
+ {
+ /* Just an .ico file... */
+
+ hicon = (HICON)LoadImage (NULL,
+ file,
+ IMAGE_ICON,
+ sx,
+ sy,
+ LR_LOADFROMFILE|flags);
+ }
+ }
+ return hicon;
+}
+
+/*
+ * Check for a match of the window class to one specified in the
+ * ICONS{} section in the prefs file, and load the icon from a file
+ */
+HICON
+winOverrideIcon (unsigned long longWin)
+{
+ WindowPtr pWin = (WindowPtr) longWin;
+ char *res_name, *res_class;
+ int i;
+ HICON hicon;
+ char *wmName;
+
+ if (pWin==NULL)
+ return 0;
+
+ /* If we can't find the class, we can't override from default! */
+ if (!winMultiWindowGetClassHint (pWin, &res_name, &res_class))
+ return 0;
+
+ winMultiWindowGetWMName (pWin, &wmName);
+
+ for (i=0; i<pref.iconItems; i++) {
+ if (!strcmp(pref.icon[i].match, res_name) ||
+ !strcmp(pref.icon[i].match, res_class) ||
+ (wmName && strstr(wmName, pref.icon[i].match)))
+ {
+ free (res_name);
+ free (res_class);
+ free(wmName);
+
+ if (pref.icon[i].hicon)
+ return pref.icon[i].hicon;
+
+ hicon = LoadImageComma (pref.icon[i].iconFile, 0, 0, LR_DEFAULTSIZE);
+ if (hicon==NULL)
+ ErrorF ("winOverrideIcon: LoadImageComma(%s) failed\n",
+ pref.icon[i].iconFile);
+
+ pref.icon[i].hicon = hicon;
+ return hicon;
+ }
+ }
+
+ /* Didn't find the icon, fail gracefully */
+ free (res_name);
+ free (res_class);
+ free(wmName);
+
+ return 0;
+}
+
+
+/*
+ * Should we free this icon or leave it in memory (is it part of our
+ * ICONS{} overrides)?
+ */
+int
+winIconIsOverride(unsigned hiconIn)
+{
+ HICON hicon;
+ int i;
+
+ hicon = (HICON)hiconIn;
+
+ if (!hicon)
+ return 0;
+
+ for (i=0; i<pref.iconItems; i++)
+ if ((HICON)pref.icon[i].hicon == hicon)
+ return 1;
+
+ return 0;
+}
+
+
+
+/*
+ * Try and open ~/.XWinrc and system.XWinrc
+ * Load it into prefs structure for use by other functions
+ */
+void
+LoadPreferences (void)
+{
+ char *home;
+ char fname[PATH_MAX+NAME_MAX+2];
+ FILE *prefFile;
+ char szDisplay[512];
+ char *szEnvDisplay;
+ int i, j;
+ char param[PARAM_MAX+1];
+ char *srcParam, *dstParam;
+
+ /* First, clear all preference settings */
+ memset (&pref, 0, sizeof(pref));
+ prefFile = NULL;
+
+ /* Now try and find a ~/.xwinrc file */
+ home = getenv ("HOME");
+ if (home)
+ {
+ strcpy (fname, home);
+ if (fname[strlen(fname)-1]!='/')
+ strcat (fname, "/");
+ strcat (fname, ".XWinrc");
+
+ prefFile = fopen (fname, "r");
+ if (prefFile)
+ {
+ winDebug ("winPrefsLoadPreferences: %s\n", fname);
+ }
+ }
+
+ /* No home file found, check system default */
+ if (!prefFile)
+ {
+ char buffer[MAX_PATH];
+#ifdef RELOCATE_PROJECTROOT
+ snprintf(buffer, sizeof(buffer), "%s\\system.XWinrc", winGetBaseDir());
+#else
+ strncpy(buffer, SYSCONFDIR"/X11/system.XWinrc", sizeof(buffer));
+#endif
+ buffer[sizeof(buffer)-1] = 0;
+ prefFile = fopen (buffer, "r");
+ if (prefFile)
+ {
+ winDebug ("winPrefsLoadPreferences: %s\n", buffer);
+ }
+ }
+
+ /* If we could open it, then read the settings and close it */
+ if (prefFile)
+ {
+ parse_file (prefFile);
+ fclose (prefFile);
+ }
+
+ /* Setup a DISPLAY environment variable, need to allocate on heap */
+ /* because putenv doesn't copy the argument... Always use screen 0 */
+ winGetDisplayName(szDisplay, 0);
+ szEnvDisplay = (char *)(malloc(strlen(szDisplay)+9/*strlen("DISPLAY=")+1*/));
+ snprintf(szEnvDisplay, 512, "DISPLAY=%s", szDisplay);
+ putenv (szEnvDisplay);
+
+ /* Replace any "%display%" in menu commands with display string */
+ for (i=0; i<pref.menuItems; i++)
+ {
+ for (j=0; j<pref.menu[i].menuItems; j++)
+ {
+ if (pref.menu[i].menuItem[j].cmd==CMD_EXEC)
+ {
+ srcParam = pref.menu[i].menuItem[j].param;
+ dstParam = param;
+ while (*srcParam) {
+ if (!strncmp(srcParam, "%display%", 9))
+ {
+ memcpy (dstParam, szDisplay, strlen(szDisplay));
+ dstParam += strlen(szDisplay);
+ srcParam += 9;
+ }
+ else if (!strncmp(srcParam, "%logfile%", 9))
+ {
+ memcpy (dstParam, g_pszLogFile, strlen(g_pszLogFile));
+ dstParam += strlen(g_pszLogFile);
+ srcParam += 9;
+ }
+ else
+ {
+ *dstParam = *srcParam;
+ dstParam++;
+ srcParam++;
+ }
+ }
+ *dstParam = 0;
+ strcpy (pref.menu[i].menuItem[j].param, param);
+ } /* cmd==cmd_exec */
+ } /* for all menuitems */
+ } /* for all menus */
+
+}
+
+
+/*
+ * Check for a match of the window class to one specified in the
+ * STYLES{} section in the prefs file, and return the style type
+ */
+unsigned long
+winOverrideStyle (char *res_name, char *res_class, char *wmName)
+{
+ int i;
+
+ for (i=0; i<pref.styleItems; i++) {
+ if ((res_name && !strcmp(pref.style[i].match, res_name)) ||
+ (res_class && !strcmp(pref.style[i].match, res_class)) ||
+ (wmName && strstr(wmName, pref.style[i].match)))
+ {
+ if (pref.style[i].type)
+ return pref.style[i].type;
+ }
+ }
+
+ /* Didn't find the style, fail gracefully */
+ return STYLE_NONE;
+}
diff --git a/xorg-server/hw/xwin/winprefs.h b/xorg-server/hw/xwin/winprefs.h index ecd0a3fbd..00f01348d 100644 --- a/xorg-server/hw/xwin/winprefs.h +++ b/xorg-server/hw/xwin/winprefs.h @@ -1,190 +1,190 @@ -#if !defined(WINPREFS_H) -#define WINPREFS_H -/* - * Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved. - * Copyright (C) Colin Harrison 2005-2008 - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of the XFree86 Project - * shall not be used in advertising or otherwise to promote the sale, use - * or other dealings in this Software without prior written authorization - * from the XFree86 Project. - * - * Authors: Earle F. Philhower, III - * Colin Harrison - */ - -/* Need Bool */ -#include <X11/Xdefs.h> -/* Need TRUE */ -#include "misc.h" - -/* Need to know how long paths can be... */ -#include <limits.h> -/* Xwindows redefines PATH_MAX to at least 1024 */ -#include <X11/Xwindows.h> - -#ifndef NAME_MAX -#define NAME_MAX PATH_MAX -#endif -#define MENU_MAX 128 /* Maximum string length of a menu name or item */ -#define PARAM_MAX (4*PATH_MAX) /* Maximum length of a parameter to a MENU */ - - -/* Supported commands in a MENU {} statement */ -typedef enum MENUCOMMANDTYPE -{ - CMD_EXEC, /* /bin/sh -c the parameter */ - CMD_MENU, /* Display a popup menu named param */ - CMD_SEPARATOR, /* Menu separator */ - CMD_ALWAYSONTOP, /* Toggle always-on-top mode */ - CMD_RELOAD /* Reparse the .XWINRC file */ -} MENUCOMMANDTYPE; - -#define STYLE_NONE (0L) /* Dummy the first entry */ -#define STYLE_NOTITLE (1L) /* Force window style no titlebar */ -#define STYLE_OUTLINE (1L<<1) /* Force window style just thin-line border */ -#define STYLE_NOFRAME (1L<<2) /* Force window style no frame */ -#define STYLE_TOPMOST (1L<<3) /* Open a window always-on-top */ -#define STYLE_MAXIMIZE (1L<<4) /* Open a window maximized */ -#define STYLE_MINIMIZE (1L<<5) /* Open a window minimized */ -#define STYLE_BOTTOM (1L<<6) /* Open a window at the bottom of the Z order */ - -/* Where to place a system menu */ -typedef enum MENUPOSITION -{ - AT_START, /* Place menu at the top of the system menu */ - AT_END /* Put it at the bottom of the menu (default) */ -} MENUPOSITION; - -/* Menu item definitions */ -typedef struct MENUITEM -{ - char text[MENU_MAX+1]; /* To be displayed in menu */ - MENUCOMMANDTYPE cmd; /* What should it do? */ - char param[PARAM_MAX+1]; /* Any parameters? */ - unsigned long commandID; /* Windows WM_COMMAND ID assigned at runtime */ -} MENUITEM; - -/* A completely read in menu... */ -typedef struct MENUPARSED -{ - char menuName[MENU_MAX+1]; /* What's it called in the text? */ - MENUITEM *menuItem; /* Array of items */ - int menuItems; /* How big's the array? */ -} MENUPARSED; - -/* To map between a window and a system menu to add for it */ -typedef struct SYSMENUITEM -{ - char match[MENU_MAX+1]; /* String to look for to apply this sysmenu */ - char menuName[MENU_MAX+1]; /* Which menu to show? Used to set *menu */ - MENUPOSITION menuPos; /* Where to place it (ignored in root) */ -} SYSMENUITEM; - -/* To redefine icons for certain window types */ -typedef struct ICONITEM -{ - char match[MENU_MAX+1]; /* What string to search for? */ - char iconFile[PATH_MAX+NAME_MAX+2]; /* Icon location, WIN32 path */ - HICON hicon; /* LoadImage() result */ -} ICONITEM; - -/* To redefine styles for certain window types */ -typedef struct STYLEITEM -{ - char match[MENU_MAX+1]; /* What string to search for? */ - unsigned long type; /* What should it do? */ -} STYLEITEM; - -typedef struct WINPREFS -{ - /* Menu information */ - MENUPARSED *menu; /* Array of created menus */ - int menuItems; /* How big? */ - - /* Taskbar menu settings */ - char rootMenuName[MENU_MAX+1]; /* Menu for taskbar icon */ - - /* System menu addition menus */ - SYSMENUITEM *sysMenu; - int sysMenuItems; - - /* Which menu to add to unmatched windows? */ - char defaultSysMenuName[MENU_MAX+1]; - MENUPOSITION defaultSysMenuPos; /* Where to place it */ - - /* Icon information */ - char iconDirectory[PATH_MAX+1]; /* Where do the .icos lie? (Win32 path) */ - char defaultIconName[NAME_MAX+1]; /* Replacement for x.ico */ - char trayIconName[NAME_MAX+1]; /* Replacement for tray icon */ - - ICONITEM *icon; - int iconItems; - - STYLEITEM *style; - int styleItems; - - /* Force exit flag */ - Bool fForceExit; - - /* Silent exit flag */ - Bool fSilentExit; - -} WINPREFS; - -/* The global pref settings structure loaded by the winprefyacc.y parser */ -extern WINPREFS pref; - - -/* Functions */ -void -LoadPreferences(void); - -void -SetupRootMenu (unsigned long hmenuRoot); - -void -SetupSysMenu (unsigned long hwndIn); - -void -HandleCustomWM_INITMENU(unsigned long hwndIn, - unsigned long hmenuIn); - -Bool -HandleCustomWM_COMMAND (unsigned long hwndIn, - int command); - -int -winIconIsOverride (unsigned hiconIn); - -HICON -winOverrideIcon (unsigned long longpWin); - -unsigned long -winOverrideStyle (char *res_name, char *res_class, char *wmName); - -HICON -winTaskbarIcon(void); - -HICON -winOverrideDefaultIcon(int size); -#endif +#if !defined(WINPREFS_H)
+#define WINPREFS_H
+/*
+ * Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
+ * Copyright (C) Colin Harrison 2005-2008
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name of the XFree86 Project
+ * shall not be used in advertising or otherwise to promote the sale, use
+ * or other dealings in this Software without prior written authorization
+ * from the XFree86 Project.
+ *
+ * Authors: Earle F. Philhower, III
+ * Colin Harrison
+ */
+
+/* Need Bool */
+#include <X11/Xdefs.h>
+/* Need TRUE */
+#include "misc.h"
+
+/* Need to know how long paths can be... */
+#include <limits.h>
+/* Xwindows redefines PATH_MAX to at least 1024 */
+#include <X11/Xwindows.h>
+
+#ifndef NAME_MAX
+#define NAME_MAX PATH_MAX
+#endif
+#define MENU_MAX 128 /* Maximum string length of a menu name or item */
+#define PARAM_MAX (4*PATH_MAX) /* Maximum length of a parameter to a MENU */
+
+
+/* Supported commands in a MENU {} statement */
+typedef enum MENUCOMMANDTYPE
+{
+ CMD_EXEC, /* /bin/sh -c the parameter */
+ CMD_MENU, /* Display a popup menu named param */
+ CMD_SEPARATOR, /* Menu separator */
+ CMD_ALWAYSONTOP, /* Toggle always-on-top mode */
+ CMD_RELOAD /* Reparse the .XWINRC file */
+} MENUCOMMANDTYPE;
+
+#define STYLE_NONE (0L) /* Dummy the first entry */
+#define STYLE_NOTITLE (1L) /* Force window style no titlebar */
+#define STYLE_OUTLINE (1L<<1) /* Force window style just thin-line border */
+#define STYLE_NOFRAME (1L<<2) /* Force window style no frame */
+#define STYLE_TOPMOST (1L<<3) /* Open a window always-on-top */
+#define STYLE_MAXIMIZE (1L<<4) /* Open a window maximized */
+#define STYLE_MINIMIZE (1L<<5) /* Open a window minimized */
+#define STYLE_BOTTOM (1L<<6) /* Open a window at the bottom of the Z order */
+
+/* Where to place a system menu */
+typedef enum MENUPOSITION
+{
+ AT_START, /* Place menu at the top of the system menu */
+ AT_END /* Put it at the bottom of the menu (default) */
+} MENUPOSITION;
+
+/* Menu item definitions */
+typedef struct MENUITEM
+{
+ char text[MENU_MAX+1]; /* To be displayed in menu */
+ MENUCOMMANDTYPE cmd; /* What should it do? */
+ char param[PARAM_MAX+1]; /* Any parameters? */
+ unsigned long commandID; /* Windows WM_COMMAND ID assigned at runtime */
+} MENUITEM;
+
+/* A completely read in menu... */
+typedef struct MENUPARSED
+{
+ char menuName[MENU_MAX+1]; /* What's it called in the text? */
+ MENUITEM *menuItem; /* Array of items */
+ int menuItems; /* How big's the array? */
+} MENUPARSED;
+
+/* To map between a window and a system menu to add for it */
+typedef struct SYSMENUITEM
+{
+ char match[MENU_MAX+1]; /* String to look for to apply this sysmenu */
+ char menuName[MENU_MAX+1]; /* Which menu to show? Used to set *menu */
+ MENUPOSITION menuPos; /* Where to place it (ignored in root) */
+} SYSMENUITEM;
+
+/* To redefine icons for certain window types */
+typedef struct ICONITEM
+{
+ char match[MENU_MAX+1]; /* What string to search for? */
+ char iconFile[PATH_MAX+NAME_MAX+2]; /* Icon location, WIN32 path */
+ HICON hicon; /* LoadImage() result */
+} ICONITEM;
+
+/* To redefine styles for certain window types */
+typedef struct STYLEITEM
+{
+ char match[MENU_MAX+1]; /* What string to search for? */
+ unsigned long type; /* What should it do? */
+} STYLEITEM;
+
+typedef struct WINPREFS
+{
+ /* Menu information */
+ MENUPARSED *menu; /* Array of created menus */
+ int menuItems; /* How big? */
+
+ /* Taskbar menu settings */
+ char rootMenuName[MENU_MAX+1]; /* Menu for taskbar icon */
+
+ /* System menu addition menus */
+ SYSMENUITEM *sysMenu;
+ int sysMenuItems;
+
+ /* Which menu to add to unmatched windows? */
+ char defaultSysMenuName[MENU_MAX+1];
+ MENUPOSITION defaultSysMenuPos; /* Where to place it */
+
+ /* Icon information */
+ char iconDirectory[PATH_MAX+1]; /* Where do the .icos lie? (Win32 path) */
+ char defaultIconName[NAME_MAX+1]; /* Replacement for x.ico */
+ char trayIconName[NAME_MAX+1]; /* Replacement for tray icon */
+
+ ICONITEM *icon;
+ int iconItems;
+
+ STYLEITEM *style;
+ int styleItems;
+
+ /* Force exit flag */
+ Bool fForceExit;
+
+ /* Silent exit flag */
+ Bool fSilentExit;
+
+} WINPREFS;
+
+/* The global pref settings structure loaded by the winprefyacc.y parser */
+extern WINPREFS pref;
+
+
+/* Functions */
+void
+LoadPreferences(void);
+
+void
+SetupRootMenu (unsigned long hmenuRoot);
+
+void
+SetupSysMenu (unsigned long hwndIn);
+
+void
+HandleCustomWM_INITMENU(unsigned long hwndIn,
+ unsigned long hmenuIn);
+
+Bool
+HandleCustomWM_COMMAND (unsigned long hwndIn,
+ int command);
+
+int
+winIconIsOverride (unsigned hiconIn);
+
+HICON
+winOverrideIcon (unsigned long longpWin);
+
+unsigned long
+winOverrideStyle (char *res_name, char *res_class, char *wmName);
+
+HICON
+winTaskbarIcon(void);
+
+HICON
+winOverrideDefaultIcon(int size);
+#endif
diff --git a/xorg-server/hw/xwin/winprefslex.l b/xorg-server/hw/xwin/winprefslex.l index 463dff4ca..5a443407f 100644 --- a/xorg-server/hw/xwin/winprefslex.l +++ b/xorg-server/hw/xwin/winprefslex.l @@ -41,8 +41,6 @@ extern YYSTYPE yylval; extern char *yytext; extern int yyparse(void); -extern void ErrorF (const char* /*f*/, ...); - int yylineno; /* Copy the parsed string, must be free()d in yacc parser */ diff --git a/xorg-server/hw/xwin/winprefsyacc.y b/xorg-server/hw/xwin/winprefsyacc.y index 0acf160e4..b9e961622 100644 --- a/xorg-server/hw/xwin/winprefsyacc.y +++ b/xorg-server/hw/xwin/winprefsyacc.y @@ -1,457 +1,460 @@ -%{ -/* - * Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved. - * Copyright (C) Colin Harrison 2005-2008 - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of the XFree86 Project - * shall not be used in advertising or otherwise to promote the sale, use - * or other dealings in this Software without prior written authorization - * from the XFree86 Project. - * - * Authors: Earle F. Philhower, III - * Colin Harrison - */ -/* $XFree86: $ */ - -#ifdef HAVE_XWIN_CONFIG_H -#include <xwin-config.h> -#endif -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include "winprefs.h" - -/* The following give better error messages in bison at the cost of a few KB */ -#define YYERROR_VERBOSE 1 - -/* YYLTYPE_IS_TRIVIAL and YYENABLE_NLS defined to suppress warnings */ -#define YYLTYPE_IS_TRIVIAL 1 -#define YYENABLE_NLS 0 - -/* The global pref settings */ -WINPREFS pref; - -/* The working menu */ -static MENUPARSED menu; - -/* Functions for parsing the tokens into out structure */ -/* Defined at the end section of this file */ - -static void SetIconDirectory (char *path); -static void SetDefaultIcon (char *fname); -static void SetRootMenu (char *menu); -static void SetDefaultSysMenu (char *menu, int pos); -static void SetTrayIcon (char *fname); - -static void OpenMenu(char *menuname); -static void AddMenuLine(char *name, MENUCOMMANDTYPE cmd, char *param); -static void CloseMenu(void); - -static void OpenIcons(void); -static void AddIconLine(char *matchstr, char *iconfile); -static void CloseIcons(void); - -static void OpenStyles(void); -static void AddStyleLine(char *matchstr, unsigned long style); -static void CloseStyles(void); - -static void OpenSysMenu(void); -static void AddSysMenuLine(char *matchstr, char *menuname, int pos); -static void CloseSysMenu(void); - -static int yyerror (char *s); - -extern void ErrorF (const char* /*f*/, ...); -extern char *yytext; -extern int yylex(void); - -%} - -%union { - char *sVal; - unsigned long uVal; - int iVal; -} - -%token NEWLINE -%token MENU -%token LB -%token RB -%token ICONDIRECTORY -%token DEFAULTICON -%token ICONS -%token STYLES -%token TOPMOST -%token MAXIMIZE -%token MINIMIZE -%token BOTTOM -%token NOTITLE -%token OUTLINE -%token NOFRAME -%token DEFAULTSYSMENU -%token SYSMENU -%token ROOTMENU -%token SEPARATOR -%token ATSTART -%token ATEND -%token EXEC -%token ALWAYSONTOP -%token DEBUGOUTPUT "DEBUG" -%token RELOAD -%token TRAYICON -%token FORCEEXIT -%token SILENTEXIT - -%token <sVal> STRING -%type <uVal> group1 -%type <uVal> group2 -%type <uVal> stylecombo -%type <iVal> atspot - -%% - -input: /* empty */ - | input line - ; - -line: NEWLINE - | command - ; - - -newline_or_nada: - | NEWLINE newline_or_nada - ; - -command: defaulticon - | icondirectory - | menu - | icons - | styles - | sysmenu - | rootmenu - | defaultsysmenu - | debug - | trayicon - | forceexit - | silentexit - ; - -trayicon: TRAYICON STRING NEWLINE { SetTrayIcon($2); free($2); } - ; - -rootmenu: ROOTMENU STRING NEWLINE { SetRootMenu($2); free($2); } - ; - -defaultsysmenu: DEFAULTSYSMENU STRING atspot NEWLINE { SetDefaultSysMenu($2, $3); free($2); } - ; - -defaulticon: DEFAULTICON STRING NEWLINE { SetDefaultIcon($2); free($2); } - ; - -icondirectory: ICONDIRECTORY STRING NEWLINE { SetIconDirectory($2); free($2); } - ; - -menuline: SEPARATOR NEWLINE newline_or_nada { AddMenuLine("-", CMD_SEPARATOR, ""); } - | STRING ALWAYSONTOP NEWLINE newline_or_nada { AddMenuLine($1, CMD_ALWAYSONTOP, ""); free($1); } - | STRING EXEC STRING NEWLINE newline_or_nada { AddMenuLine($1, CMD_EXEC, $3); free($1); free($3); } - | STRING MENU STRING NEWLINE newline_or_nada { AddMenuLine($1, CMD_MENU, $3); free($1); free($3); } - | STRING RELOAD NEWLINE newline_or_nada { AddMenuLine($1, CMD_RELOAD, ""); free($1); } - ; - -menulist: menuline - | menuline menulist - ; - -menu: MENU STRING LB { OpenMenu($2); free($2); } newline_or_nada menulist RB {CloseMenu();} - ; - -iconline: STRING STRING NEWLINE newline_or_nada { AddIconLine($1, $2); free($1); free($2); } - ; - -iconlist: iconline - | iconline iconlist - ; - -icons: ICONS LB {OpenIcons();} newline_or_nada iconlist RB {CloseIcons();} - ; - -group1: TOPMOST { $$=STYLE_TOPMOST; } - | MAXIMIZE { $$=STYLE_MAXIMIZE; } - | MINIMIZE { $$=STYLE_MINIMIZE; } - | BOTTOM { $$=STYLE_BOTTOM; } - ; - -group2: NOTITLE { $$=STYLE_NOTITLE; } - | OUTLINE { $$=STYLE_OUTLINE; } - | NOFRAME { $$=STYLE_NOFRAME; } - ; - -stylecombo: group1 { $$=$1; } - | group2 { $$=$1; } - | group1 group2 { $$=$1|$2; } - | group2 group1 { $$=$1|$2; } - ; - -styleline: STRING stylecombo NEWLINE newline_or_nada { AddStyleLine($1, $2); free($1); } - ; - -stylelist: styleline - | styleline stylelist - ; - -styles: STYLES LB {OpenStyles();} newline_or_nada stylelist RB {CloseStyles();} - ; - -atspot: { $$=AT_END; } - | ATSTART { $$=AT_START; } - | ATEND { $$=AT_END; } - ; - -sysmenuline: STRING STRING atspot NEWLINE newline_or_nada { AddSysMenuLine($1, $2, $3); free($1); free($2); } - ; - -sysmenulist: sysmenuline - | sysmenuline sysmenulist - ; - -sysmenu: SYSMENU LB NEWLINE {OpenSysMenu();} newline_or_nada sysmenulist RB {CloseSysMenu();} - ; - -forceexit: FORCEEXIT NEWLINE { pref.fForceExit = TRUE; } - ; - -silentexit: SILENTEXIT NEWLINE { pref.fSilentExit = TRUE; } - ; - -debug: DEBUGOUTPUT STRING NEWLINE { ErrorF("LoadPreferences: %s\n", $2); free($2); } - ; - - -%% -/* - * Errors in parsing abort and print log messages - */ -static int -yyerror (char *s) -{ - extern int yylineno; /* Handled by flex internally */ - - ErrorF("LoadPreferences: %s line %d\n", s, yylineno); - return 1; -} - -/* Miscellaneous functions to store TOKENs into the structure */ -static void -SetIconDirectory (char *path) -{ - strncpy (pref.iconDirectory, path, PATH_MAX); - pref.iconDirectory[PATH_MAX] = 0; -} - -static void -SetDefaultIcon (char *fname) -{ - strncpy (pref.defaultIconName, fname, NAME_MAX); - pref.defaultIconName[NAME_MAX] = 0; -} - -static void -SetTrayIcon (char *fname) -{ - strncpy (pref.trayIconName, fname, NAME_MAX); - pref.trayIconName[NAME_MAX] = 0; -} - -static void -SetRootMenu (char *menu) -{ - strncpy (pref.rootMenuName, menu, MENU_MAX); - pref.rootMenuName[MENU_MAX] = 0; -} - -static void -SetDefaultSysMenu (char *menu, int pos) -{ - strncpy (pref.defaultSysMenuName, menu, MENU_MAX); - pref.defaultSysMenuName[MENU_MAX] = 0; - pref.defaultSysMenuPos = pos; -} - -static void -OpenMenu (char *menuname) -{ - if (menu.menuItem) free(menu.menuItem); - menu.menuItem = NULL; - strncpy(menu.menuName, menuname, MENU_MAX); - menu.menuName[MENU_MAX] = 0; - menu.menuItems = 0; -} - -static void -AddMenuLine (char *text, MENUCOMMANDTYPE cmd, char *param) -{ - if (menu.menuItem==NULL) - menu.menuItem = (MENUITEM*)malloc(sizeof(MENUITEM)); - else - menu.menuItem = (MENUITEM*) - realloc(menu.menuItem, sizeof(MENUITEM)*(menu.menuItems+1)); - - strncpy (menu.menuItem[menu.menuItems].text, text, MENU_MAX); - menu.menuItem[menu.menuItems].text[MENU_MAX] = 0; - - menu.menuItem[menu.menuItems].cmd = cmd; - - strncpy(menu.menuItem[menu.menuItems].param, param, PARAM_MAX); - menu.menuItem[menu.menuItems].param[PARAM_MAX] = 0; - - menu.menuItem[menu.menuItems].commandID = 0; - - menu.menuItems++; -} - -static void -CloseMenu (void) -{ - if (menu.menuItem==NULL || menu.menuItems==0) - { - ErrorF("LoadPreferences: Empty menu detected\n"); - return; - } - - if (pref.menuItems) - pref.menu = (MENUPARSED*) - realloc (pref.menu, (pref.menuItems+1)*sizeof(MENUPARSED)); - else - pref.menu = (MENUPARSED*)malloc (sizeof(MENUPARSED)); - - memcpy (pref.menu+pref.menuItems, &menu, sizeof(MENUPARSED)); - pref.menuItems++; - - memset (&menu, 0, sizeof(MENUPARSED)); -} - -static void -OpenIcons (void) -{ - if (pref.icon != NULL) { - ErrorF("LoadPreferences: Redefining icon mappings\n"); - free(pref.icon); - pref.icon = NULL; - } - pref.iconItems = 0; -} - -static void -AddIconLine (char *matchstr, char *iconfile) -{ - if (pref.icon==NULL) - pref.icon = (ICONITEM*)malloc(sizeof(ICONITEM)); - else - pref.icon = (ICONITEM*) - realloc(pref.icon, sizeof(ICONITEM)*(pref.iconItems+1)); - - strncpy(pref.icon[pref.iconItems].match, matchstr, MENU_MAX); - pref.icon[pref.iconItems].match[MENU_MAX] = 0; - - strncpy(pref.icon[pref.iconItems].iconFile, iconfile, PATH_MAX+NAME_MAX+1); - pref.icon[pref.iconItems].iconFile[PATH_MAX+NAME_MAX+1] = 0; - - pref.icon[pref.iconItems].hicon = 0; - - pref.iconItems++; -} - -static void -CloseIcons (void) -{ -} - -static void -OpenStyles (void) -{ - if (pref.style != NULL) { - ErrorF("LoadPreferences: Redefining window style\n"); - free(pref.style); - pref.style = NULL; - } - pref.styleItems = 0; -} - -static void -AddStyleLine (char *matchstr, unsigned long style) -{ - if (pref.style==NULL) - pref.style = (STYLEITEM*)malloc(sizeof(STYLEITEM)); - else - pref.style = (STYLEITEM*) - realloc(pref.style, sizeof(STYLEITEM)*(pref.styleItems+1)); - - strncpy(pref.style[pref.styleItems].match, matchstr, MENU_MAX); - pref.style[pref.styleItems].match[MENU_MAX] = 0; - - pref.style[pref.styleItems].type = style; - - pref.styleItems++; -} - -static void -CloseStyles (void) -{ -} - -static void -OpenSysMenu (void) -{ - if (pref.sysMenu != NULL) { - ErrorF("LoadPreferences: Redefining system menu\n"); - free(pref.sysMenu); - pref.sysMenu = NULL; - } - pref.sysMenuItems = 0; -} - -static void -AddSysMenuLine (char *matchstr, char *menuname, int pos) -{ - if (pref.sysMenu==NULL) - pref.sysMenu = (SYSMENUITEM*)malloc(sizeof(SYSMENUITEM)); - else - pref.sysMenu = (SYSMENUITEM*) - realloc(pref.sysMenu, sizeof(SYSMENUITEM)*(pref.sysMenuItems+1)); - - strncpy (pref.sysMenu[pref.sysMenuItems].match, matchstr, MENU_MAX); - pref.sysMenu[pref.sysMenuItems].match[MENU_MAX] = 0; - - strncpy (pref.sysMenu[pref.sysMenuItems].menuName, menuname, MENU_MAX); - pref.sysMenu[pref.sysMenuItems].menuName[MENU_MAX] = 0; - - pref.sysMenu[pref.sysMenuItems].menuPos = pos; - - pref.sysMenuItems++; -} - -static void -CloseSysMenu (void) -{ -} - +%{
+/*
+ * Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
+ * Copyright (C) Colin Harrison 2005-2008
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name of the XFree86 Project
+ * shall not be used in advertising or otherwise to promote the sale, use
+ * or other dealings in this Software without prior written authorization
+ * from the XFree86 Project.
+ *
+ * Authors: Earle F. Philhower, III
+ * Colin Harrison
+ */
+/* $XFree86: $ */
+
+#ifdef HAVE_XWIN_CONFIG_H
+#include <xwin-config.h>
+#endif
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "winprefs.h"
+#include "winmsg.h"
+
+/* The following give better error messages in bison at the cost of a few KB */
+#define YYERROR_VERBOSE 1
+
+/* YYLTYPE_IS_TRIVIAL and YYENABLE_NLS defined to suppress warnings */
+#define YYLTYPE_IS_TRIVIAL 1
+#define YYENABLE_NLS 0
+
+/* The global pref settings */
+WINPREFS pref;
+
+/* The working menu */
+static MENUPARSED menu;
+
+/* Functions for parsing the tokens into out structure */
+/* Defined at the end section of this file */
+
+static void SetIconDirectory (char *path);
+static void SetDefaultIcon (char *fname);
+static void SetRootMenu (char *menu);
+static void SetDefaultSysMenu (char *menu, int pos);
+static void SetTrayIcon (char *fname);
+
+static void OpenMenu(char *menuname);
+static void AddMenuLine(char *name, MENUCOMMANDTYPE cmd, char *param);
+static void CloseMenu(void);
+
+static void OpenIcons(void);
+static void AddIconLine(char *matchstr, char *iconfile);
+static void CloseIcons(void);
+
+static void OpenStyles(void);
+static void AddStyleLine(char *matchstr, unsigned long style);
+static void CloseStyles(void);
+
+static void OpenSysMenu(void);
+static void AddSysMenuLine(char *matchstr, char *menuname, int pos);
+static void CloseSysMenu(void);
+
+static int yyerror (char *s);
+
+extern char *yytext;
+extern int yylex(void);
+
+#define YYMALLOC malloc
+#define YYFREE free
+
+%}
+
+%union {
+ char *sVal;
+ unsigned long uVal;
+ int iVal;
+}
+
+%token NEWLINE
+%token MENU
+%token LB
+%token RB
+%token ICONDIRECTORY
+%token DEFAULTICON
+%token ICONS
+%token STYLES
+%token TOPMOST
+%token MAXIMIZE
+%token MINIMIZE
+%token BOTTOM
+%token NOTITLE
+%token OUTLINE
+%token NOFRAME
+%token DEFAULTSYSMENU
+%token SYSMENU
+%token ROOTMENU
+%token SEPARATOR
+%token ATSTART
+%token ATEND
+%token EXEC
+%token ALWAYSONTOP
+%token DEBUGOUTPUT "DEBUG"
+%token RELOAD
+%token TRAYICON
+%token FORCEEXIT
+%token SILENTEXIT
+
+%token <sVal> STRING
+%type <uVal> group1
+%type <uVal> group2
+%type <uVal> stylecombo
+%type <iVal> atspot
+
+%%
+
+input: /* empty */
+ | input line
+ ;
+
+line: NEWLINE
+ | command
+ ;
+
+
+newline_or_nada:
+ | NEWLINE newline_or_nada
+ ;
+
+command: defaulticon
+ | icondirectory
+ | menu
+ | icons
+ | styles
+ | sysmenu
+ | rootmenu
+ | defaultsysmenu
+ | debug
+ | trayicon
+ | forceexit
+ | silentexit
+ ;
+
+trayicon: TRAYICON STRING NEWLINE { SetTrayIcon($2); free($2); }
+ ;
+
+rootmenu: ROOTMENU STRING NEWLINE { SetRootMenu($2); free($2); }
+ ;
+
+defaultsysmenu: DEFAULTSYSMENU STRING atspot NEWLINE { SetDefaultSysMenu($2, $3); free($2); }
+ ;
+
+defaulticon: DEFAULTICON STRING NEWLINE { SetDefaultIcon($2); free($2); }
+ ;
+
+icondirectory: ICONDIRECTORY STRING NEWLINE { SetIconDirectory($2); free($2); }
+ ;
+
+menuline: SEPARATOR NEWLINE newline_or_nada { AddMenuLine("-", CMD_SEPARATOR, ""); }
+ | STRING ALWAYSONTOP NEWLINE newline_or_nada { AddMenuLine($1, CMD_ALWAYSONTOP, ""); free($1); }
+ | STRING EXEC STRING NEWLINE newline_or_nada { AddMenuLine($1, CMD_EXEC, $3); free($1); free($3); }
+ | STRING MENU STRING NEWLINE newline_or_nada { AddMenuLine($1, CMD_MENU, $3); free($1); free($3); }
+ | STRING RELOAD NEWLINE newline_or_nada { AddMenuLine($1, CMD_RELOAD, ""); free($1); }
+ ;
+
+menulist: menuline
+ | menuline menulist
+ ;
+
+menu: MENU STRING LB { OpenMenu($2); free($2); } newline_or_nada menulist RB {CloseMenu();}
+ ;
+
+iconline: STRING STRING NEWLINE newline_or_nada { AddIconLine($1, $2); free($1); free($2); }
+ ;
+
+iconlist: iconline
+ | iconline iconlist
+ ;
+
+icons: ICONS LB {OpenIcons();} newline_or_nada iconlist RB {CloseIcons();}
+ ;
+
+group1: TOPMOST { $$=STYLE_TOPMOST; }
+ | MAXIMIZE { $$=STYLE_MAXIMIZE; }
+ | MINIMIZE { $$=STYLE_MINIMIZE; }
+ | BOTTOM { $$=STYLE_BOTTOM; }
+ ;
+
+group2: NOTITLE { $$=STYLE_NOTITLE; }
+ | OUTLINE { $$=STYLE_OUTLINE; }
+ | NOFRAME { $$=STYLE_NOFRAME; }
+ ;
+
+stylecombo: group1 { $$=$1; }
+ | group2 { $$=$1; }
+ | group1 group2 { $$=$1|$2; }
+ | group2 group1 { $$=$1|$2; }
+ ;
+
+styleline: STRING stylecombo NEWLINE newline_or_nada { AddStyleLine($1, $2); free($1); }
+ ;
+
+stylelist: styleline
+ | styleline stylelist
+ ;
+
+styles: STYLES LB {OpenStyles();} newline_or_nada stylelist RB {CloseStyles();}
+ ;
+
+atspot: { $$=AT_END; }
+ | ATSTART { $$=AT_START; }
+ | ATEND { $$=AT_END; }
+ ;
+
+sysmenuline: STRING STRING atspot NEWLINE newline_or_nada { AddSysMenuLine($1, $2, $3); free($1); free($2); }
+ ;
+
+sysmenulist: sysmenuline
+ | sysmenuline sysmenulist
+ ;
+
+sysmenu: SYSMENU LB NEWLINE {OpenSysMenu();} newline_or_nada sysmenulist RB {CloseSysMenu();}
+ ;
+
+forceexit: FORCEEXIT NEWLINE { pref.fForceExit = TRUE; }
+ ;
+
+silentexit: SILENTEXIT NEWLINE { pref.fSilentExit = TRUE; }
+ ;
+
+debug: DEBUGOUTPUT STRING NEWLINE { winDebug("LoadPreferences: %s\n", $2); free($2); }
+ ;
+
+
+%%
+/*
+ * Errors in parsing abort and print log messages
+ */
+static int
+yyerror (char *s)
+{
+ extern int yylineno; /* Handled by flex internally */
+
+ ErrorF("LoadPreferences: %s line %d\n", s, yylineno);
+ return 1;
+}
+
+/* Miscellaneous functions to store TOKENs into the structure */
+static void
+SetIconDirectory (char *path)
+{
+ strncpy (pref.iconDirectory, path, PATH_MAX);
+ pref.iconDirectory[PATH_MAX] = 0;
+}
+
+static void
+SetDefaultIcon (char *fname)
+{
+ strncpy (pref.defaultIconName, fname, NAME_MAX);
+ pref.defaultIconName[NAME_MAX] = 0;
+}
+
+static void
+SetTrayIcon (char *fname)
+{
+ strncpy (pref.trayIconName, fname, NAME_MAX);
+ pref.trayIconName[NAME_MAX] = 0;
+}
+
+static void
+SetRootMenu (char *menu)
+{
+ strncpy (pref.rootMenuName, menu, MENU_MAX);
+ pref.rootMenuName[MENU_MAX] = 0;
+}
+
+static void
+SetDefaultSysMenu (char *menu, int pos)
+{
+ strncpy (pref.defaultSysMenuName, menu, MENU_MAX);
+ pref.defaultSysMenuName[MENU_MAX] = 0;
+ pref.defaultSysMenuPos = pos;
+}
+
+static void
+OpenMenu (char *menuname)
+{
+ if (menu.menuItem) free(menu.menuItem);
+ menu.menuItem = NULL;
+ strncpy(menu.menuName, menuname, MENU_MAX);
+ menu.menuName[MENU_MAX] = 0;
+ menu.menuItems = 0;
+}
+
+static void
+AddMenuLine (char *text, MENUCOMMANDTYPE cmd, char *param)
+{
+ if (menu.menuItem==NULL)
+ menu.menuItem = (MENUITEM*)malloc(sizeof(MENUITEM));
+ else
+ menu.menuItem = (MENUITEM*)
+ realloc(menu.menuItem, sizeof(MENUITEM)*(menu.menuItems+1));
+
+ strncpy (menu.menuItem[menu.menuItems].text, text, MENU_MAX);
+ menu.menuItem[menu.menuItems].text[MENU_MAX] = 0;
+
+ menu.menuItem[menu.menuItems].cmd = cmd;
+
+ strncpy(menu.menuItem[menu.menuItems].param, param, PARAM_MAX);
+ menu.menuItem[menu.menuItems].param[PARAM_MAX] = 0;
+
+ menu.menuItem[menu.menuItems].commandID = 0;
+
+ menu.menuItems++;
+}
+
+static void
+CloseMenu (void)
+{
+ if (menu.menuItem==NULL || menu.menuItems==0)
+ {
+ ErrorF("LoadPreferences: Empty menu detected\n");
+ return;
+ }
+
+ if (pref.menuItems)
+ pref.menu = (MENUPARSED*)
+ realloc (pref.menu, (pref.menuItems+1)*sizeof(MENUPARSED));
+ else
+ pref.menu = (MENUPARSED*)malloc (sizeof(MENUPARSED));
+
+ memcpy (pref.menu+pref.menuItems, &menu, sizeof(MENUPARSED));
+ pref.menuItems++;
+
+ memset (&menu, 0, sizeof(MENUPARSED));
+}
+
+static void
+OpenIcons (void)
+{
+ if (pref.icon != NULL) {
+ winDebug("LoadPreferences: Redefining icon mappings\n");
+ free(pref.icon);
+ pref.icon = NULL;
+ }
+ pref.iconItems = 0;
+}
+
+static void
+AddIconLine (char *matchstr, char *iconfile)
+{
+ if (pref.icon==NULL)
+ pref.icon = (ICONITEM*)malloc(sizeof(ICONITEM));
+ else
+ pref.icon = (ICONITEM*)
+ realloc(pref.icon, sizeof(ICONITEM)*(pref.iconItems+1));
+
+ strncpy(pref.icon[pref.iconItems].match, matchstr, MENU_MAX);
+ pref.icon[pref.iconItems].match[MENU_MAX] = 0;
+
+ strncpy(pref.icon[pref.iconItems].iconFile, iconfile, PATH_MAX+NAME_MAX+1);
+ pref.icon[pref.iconItems].iconFile[PATH_MAX+NAME_MAX+1] = 0;
+
+ pref.icon[pref.iconItems].hicon = 0;
+
+ pref.iconItems++;
+}
+
+static void
+CloseIcons (void)
+{
+}
+
+static void
+OpenStyles (void)
+{
+ if (pref.style != NULL) {
+ winDebug("LoadPreferences: Redefining window style\n");
+ free(pref.style);
+ pref.style = NULL;
+ }
+ pref.styleItems = 0;
+}
+
+static void
+AddStyleLine (char *matchstr, unsigned long style)
+{
+ if (pref.style==NULL)
+ pref.style = (STYLEITEM*)malloc(sizeof(STYLEITEM));
+ else
+ pref.style = (STYLEITEM*)
+ realloc(pref.style, sizeof(STYLEITEM)*(pref.styleItems+1));
+
+ strncpy(pref.style[pref.styleItems].match, matchstr, MENU_MAX);
+ pref.style[pref.styleItems].match[MENU_MAX] = 0;
+
+ pref.style[pref.styleItems].type = style;
+
+ pref.styleItems++;
+}
+
+static void
+CloseStyles (void)
+{
+}
+
+static void
+OpenSysMenu (void)
+{
+ if (pref.sysMenu != NULL) {
+ winDebug("LoadPreferences: Redefining system menu\n");
+ free(pref.sysMenu);
+ pref.sysMenu = NULL;
+ }
+ pref.sysMenuItems = 0;
+}
+
+static void
+AddSysMenuLine (char *matchstr, char *menuname, int pos)
+{
+ if (pref.sysMenu==NULL)
+ pref.sysMenu = (SYSMENUITEM*)malloc(sizeof(SYSMENUITEM));
+ else
+ pref.sysMenu = (SYSMENUITEM*)
+ realloc(pref.sysMenu, sizeof(SYSMENUITEM)*(pref.sysMenuItems+1));
+
+ strncpy (pref.sysMenu[pref.sysMenuItems].match, matchstr, MENU_MAX);
+ pref.sysMenu[pref.sysMenuItems].match[MENU_MAX] = 0;
+
+ strncpy (pref.sysMenu[pref.sysMenuItems].menuName, menuname, MENU_MAX);
+ pref.sysMenu[pref.sysMenuItems].menuName[MENU_MAX] = 0;
+
+ pref.sysMenu[pref.sysMenuItems].menuPos = pos;
+
+ pref.sysMenuItems++;
+}
+
+static void
+CloseSysMenu (void)
+{
+}
+
diff --git a/xorg-server/hw/xwin/winprocarg.c b/xorg-server/hw/xwin/winprocarg.c index ddfe1f5b7..aab5091c9 100644 --- a/xorg-server/hw/xwin/winprocarg.c +++ b/xorg-server/hw/xwin/winprocarg.c @@ -44,6 +44,7 @@ from The Open Group. #ifdef XWIN_CLIPBOARD extern Bool g_fUnicodeClipboard; extern Bool g_fClipboard; +extern Bool g_fClipboardPrimary; #endif /* @@ -88,7 +89,7 @@ winInitializeScreenDefaults(void) dwWidth = GetSystemMetrics (SM_CXSCREEN); dwHeight = GetSystemMetrics (SM_CYSCREEN); - winErrorFVerb (2, "winInitializeScreenDefaults - w %d h %d\n", + winDebug ("winInitializeScreenDefaults - w %d h %d\n", (int) dwWidth, (int) dwHeight); /* Set a default DPI, if no parameter was passed */ @@ -113,6 +114,8 @@ winInitializeScreenDefaults(void) defaultScreenInfo.fDecoration = TRUE; #ifdef XWIN_MULTIWINDOWEXTWM defaultScreenInfo.fMWExtWM = FALSE; +#endif +#ifdef XWIN_MULTIWINDOWINTWM defaultScreenInfo.fInternalWM = FALSE; #endif defaultScreenInfo.fRootless = FALSE; @@ -139,7 +142,7 @@ winInitializeScreenDefaults(void) static void winInitializeScreen(int i) { - winErrorFVerb (2, "winInitializeScreen - %d\n",i); + winDebug ("winInitializeScreen - %d\n",i); /* Initialize default screen values, if needed */ winInitializeScreenDefaults(); @@ -155,7 +158,7 @@ void winInitializeScreens(int maxscreens) { int i; - winErrorFVerb (2, "winInitializeScreens - %i\n", maxscreens); + winDebug ("winInitializeScreens - %i\n", maxscreens); if (maxscreens > g_iNumScreens) { @@ -231,15 +234,13 @@ ddxProcessArgument (int argc, char *argv[], int i) * OsVendorInit () gets called, otherwise we will overwrite * settings changed by parameters such as -fullscreen, etc. */ - winErrorFVerb (2, "ddxProcessArgument - Initializing default " + winDebug ("ddxProcessArgument - Initializing default " "screens\n"); winInitializeScreenDefaults(); } } -#if CYGDEBUG winDebug ("ddxProcessArgument - arg: %s\n", argv[i]); -#endif /* * Look for the '-help' and similar options @@ -273,10 +274,8 @@ ddxProcessArgument (int argc, char *argv[], int i) int iWidth, iHeight, iX, iY; int iMonitor; -#if CYGDEBUG winDebug ("ddxProcessArgument - screen - argc: %d i: %d\n", argc, i); -#endif /* Display the usage message if the argument is malformed */ if (i + 1 >= argc) @@ -315,7 +314,7 @@ ddxProcessArgument (int argc, char *argv[], int i) "Querying monitors is not supported on NT4 and Win95\n"); } else if (data.bMonitorSpecifiedExists == TRUE) { - winErrorFVerb(2, "ddxProcessArgument - screen - Found Valid ``@Monitor'' = %d arg\n", iMonitor); + winDebug("ddxProcessArgument - screen - Found Valid ``@Monitor'' = %d arg\n", iMonitor); iArgsProcessed = 3; g_ScreenInfo[nScreenNum].fUserGaveHeightAndWidth = FALSE; g_ScreenInfo[nScreenNum].fUserGavePosition = TRUE; @@ -344,7 +343,7 @@ ddxProcessArgument (int argc, char *argv[], int i) (int *) &iWidth, (int *) &iHeight)) { - winErrorFVerb (2, "ddxProcessArgument - screen - Found ``WxD'' arg\n"); + winDebug ("ddxProcessArgument - screen - Found ``WxD'' arg\n"); iArgsProcessed = 3; g_ScreenInfo[nScreenNum].fUserGaveHeightAndWidth = TRUE; g_ScreenInfo[nScreenNum].dwWidth = iWidth; @@ -356,7 +355,7 @@ ddxProcessArgument (int argc, char *argv[], int i) (int *) &iX, (int *) &iY)) { - winErrorFVerb (2, "ddxProcessArgument - screen - Found ``X+Y'' arg\n"); + winDebug("ddxProcessArgument - screen - Found ``X+Y'' arg\n"); g_ScreenInfo[nScreenNum].fUserGavePosition = TRUE; g_ScreenInfo[nScreenNum].dwInitialX = iX; g_ScreenInfo[nScreenNum].dwInitialY = iY; @@ -400,7 +399,7 @@ ddxProcessArgument (int argc, char *argv[], int i) "Querying monitors is not supported on NT4 and Win95\n"); } else if (data.bMonitorSpecifiedExists == TRUE) { - winErrorFVerb (2, "ddxProcessArgument - screen - Found Valid ``@Monitor'' = %d arg\n", iMonitor); + winDebug ("ddxProcessArgument - screen - Found Valid ``@Monitor'' = %d arg\n", iMonitor); g_ScreenInfo[nScreenNum].fUserGavePosition = TRUE; g_ScreenInfo[nScreenNum].iMonitor = iMonitor; g_ScreenInfo[nScreenNum].dwInitialX = data.monitorOffsetX; @@ -424,7 +423,7 @@ ddxProcessArgument (int argc, char *argv[], int i) && 1 == sscanf (argv[i + 3], "%d", (int *) &iHeight)) { - winErrorFVerb (2, "ddxProcessArgument - screen - Found ``W D'' arg\n"); + winDebug ("ddxProcessArgument - screen - Found ``W D'' arg\n"); iArgsProcessed = 4; g_ScreenInfo[nScreenNum].fUserGaveHeightAndWidth = TRUE; g_ScreenInfo[nScreenNum].dwWidth = iWidth; @@ -437,7 +436,7 @@ ddxProcessArgument (int argc, char *argv[], int i) && 1 == sscanf (argv[i + 5], "%d", (int *) &iY)) { - winErrorFVerb (2, "ddxProcessArgument - screen - Found ``X Y'' arg\n"); + winDebug ("ddxProcessArgument - screen - Found ``X Y'' arg\n"); iArgsProcessed = 6; g_ScreenInfo[nScreenNum].fUserGavePosition = TRUE; g_ScreenInfo[nScreenNum].dwInitialX = iX; @@ -446,7 +445,7 @@ ddxProcessArgument (int argc, char *argv[], int i) } else { - winErrorFVerb (2, "ddxProcessArgument - screen - Did not find size arg. " + ErrorF ("ddxProcessArgument - screen - Did not find size arg. " "dwWidth: %d dwHeight: %d\n", (int) g_ScreenInfo[nScreenNum].dwWidth, (int) g_ScreenInfo[nScreenNum].dwHeight); @@ -577,7 +576,9 @@ ddxProcessArgument (int argc, char *argv[], int i) /* Indicate that we have processed this argument */ return 1; } - /* +#endif +#ifdef XWIN_MULTIWINDOWINTWM + /* * Look for the '-internalwm' argument */ if (IS_OPTION ("-internalwm")) @@ -729,6 +730,30 @@ ddxProcessArgument (int argc, char *argv[], int i) /* Indicate that we have processed this argument */ return 1; } + + /* + * Look for the '-clipboard' argument + */ + if (IS_OPTION ("-clipboardprimary")) + { + /* Now the default, we still accept the arg for backwards compatibility */ + g_fClipboardPrimary = TRUE; + + /* Indicate that we have processed this argument */ + return 1; + } + + /* + * Look for the '-noclipboard' argument + */ + if (IS_OPTION ("-noclipboardprimary")) + { + g_fClipboardPrimary = FALSE; + + /* Indicate that we have processed this argument */ + return 1; + } + #endif @@ -1191,7 +1216,7 @@ winLogCommandLine (int argc, char *argv[]) iCurrLen += strlen (argv[i]); } - ErrorF ("XWin was started with the following command line:\n\n" + winDebug ("XWin was started with the following command line:\n\n" "%s\n\n", g_pszCommandLine); } @@ -1203,15 +1228,17 @@ winLogCommandLine (int argc, char *argv[]) void winLogVersionInfo (void) { +#ifdef WINDBG static Bool s_fBeenHere = FALSE; if (s_fBeenHere) return; s_fBeenHere = TRUE; - ErrorF ("Welcome to the XWin X Server\n"); - ErrorF ("Vendor: %s\n", XVENDORNAME); - ErrorF ("Release: %d.%d.%d.%d (%d)\n", XORG_VERSION_MAJOR, XORG_VERSION_MINOR, XORG_VERSION_PATCH, XORG_VERSION_SNAP, XORG_VERSION_CURRENT); - ErrorF ("%s\n\n", BUILDERSTRING); - ErrorF ("Contact: %s\n", BUILDERADDR); + winDebug ("Welcome to the VcXsrv X Server\n"); + winDebug ("Vendor: %s\n", XVENDORNAME); + winDebug ("Release: %d.%d.%d.%d\n\n", XORG_VERSION_MAJOR, XORG_VERSION_MINOR, XORG_VERSION_PATCH, XORG_VERSION_SNAP); + winDebug ("%s\n\n", BUILDERSTRING); + winDebug ("Contact: %s\n\n", BUILDERADDR); +#endif } diff --git a/xorg-server/hw/xwin/winrandr.c b/xorg-server/hw/xwin/winrandr.c index c58119360..7b7ec0c60 100644 --- a/xorg-server/hw/xwin/winrandr.c +++ b/xorg-server/hw/xwin/winrandr.c @@ -1,223 +1,221 @@ -/* - *Copyright (C) 2001-2004 Harold L Hunt II All Rights Reserved. - *Copyright (C) 2009-2010 Jon TURNEY - * - *Permission is hereby granted, free of charge, to any person obtaining - *a copy of this software and associated documentation files (the - *"Software"), to deal in the Software without restriction, including - *without limitation the rights to use, copy, modify, merge, publish, - *distribute, sublicense, and/or sell copies of the Software, and to - *permit persons to whom the Software is furnished to do so, subject to - *the following conditions: - * - *The above copyright notice and this permission notice shall be - *included in all copies or substantial portions of the Software. - * - *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - *NONINFRINGEMENT. IN NO EVENT SHALL HAROLD L HUNT II BE LIABLE FOR - *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - *Except as contained in this notice, the name of the author(s) - *shall not be used in advertising or otherwise to promote the sale, use - *or other dealings in this Software without prior written authorization - *from the author(s) - * - * Authors: Harold L Hunt II - * Jon TURNEY - */ - -#ifdef HAVE_XWIN_CONFIG_H -#include <xwin-config.h> -#endif -#include "win.h" -#include "mivalidate.h" // for union _Validate used by windowstr.h - -#ifndef RANDR_12_INTERFACE -#error X server must have RandR 1.2 interface -#endif - - -/* - * Answer queries about the RandR features supported. - */ - -static Bool -winRandRGetInfo (ScreenPtr pScreen, Rotation *pRotations) -{ - winDebug ("winRandRGetInfo ()\n"); - - /* Don't support rotations */ - *pRotations = RR_Rotate_0; - - /* - The screen doesn't have to be limited to the actual - monitor size (we can have scrollbars :-), so what is - the upper limit? - */ - RRScreenSetSizeRange(pScreen, 0, 0, 4096, 4096); - - return TRUE; -} - -/* - -*/ -void -winDoRandRScreenSetSize (ScreenPtr pScreen, - CARD16 width, - CARD16 height, - CARD32 mmWidth, - CARD32 mmHeight) -{ - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - WindowPtr pRoot = pScreen->root; - - // Prevent screen updates while we change things around - SetRootClip(pScreen, FALSE); - - /* Update the screen size as requested */ - pScreenInfo->dwWidth = width; - pScreenInfo->dwHeight = height; - - /* Reallocate the framebuffer used by the drawing engine */ - (*pScreenPriv->pwinFreeFB)(pScreen); - if (!(*pScreenPriv->pwinAllocateFB)(pScreen)) - { - ErrorF ("winDoRandRScreenSetSize - Could not reallocate framebuffer\n"); - } - - pScreen->width = width; - pScreen->height = height; - pScreen->mmWidth = mmWidth; - pScreen->mmHeight = mmHeight; - - /* Update the screen pixmap to point to the new framebuffer */ - winUpdateFBPointer(pScreen, pScreenInfo->pfb); - - // pScreen->devPrivate == pScreen->GetScreenPixmap(screen) ? - // resize the root window - //pScreen->ResizeWindow(pRoot, 0, 0, width, height, NULL); - // does this emit a ConfigureNotify?? - - // Restore the ability to update screen, now with new dimensions - SetRootClip(pScreen, TRUE); - - // and arrange for it to be repainted - miPaintWindow(pRoot, &pRoot->borderClip, PW_BACKGROUND); - - /* Indicate that a screen size change took place */ - RRScreenSizeNotify(pScreen); -} - -/* - * Respond to resize request - */ -static -Bool -winRandRScreenSetSize (ScreenPtr pScreen, - CARD16 width, - CARD16 height, - CARD16 pixWidth, - CARD16 pixHeight, - CARD32 mmWidth, - CARD32 mmHeight) -{ - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - - winDebug ("winRandRScreenSetSize ()\n"); - - /* - It doesn't currently make sense to allow resize in fullscreen mode - (we'd actually have to list the supported resolutions) - */ - if (pScreenInfo->fFullScreen) - { - ErrorF ("winRandRScreenSetSize - resize not supported in fullscreen mode\n"); - return FALSE; - } - - /* - Client resize requests aren't allowed in rootless modes, even if - the X screen is monitor or virtual desktop size, we'd need to - resize the native display size - */ - if (FALSE -#ifdef XWIN_MULTIWINDOWEXTWM - || pScreenInfo->fMWExtWM -#endif - || pScreenInfo->fRootless -#ifdef XWIN_MULTIWINDOW - || pScreenInfo->fMultiWindow -#endif - ) - { - ErrorF ("winRandRScreenSetSize - resize not supported in rootless modes\n"); - return FALSE; - } - - winDoRandRScreenSetSize(pScreen, width, height, mmWidth, mmHeight); - - /* Cause the native window for the screen to resize itself */ - { - DWORD dwStyle, dwExStyle; - RECT rcClient; - - rcClient.left = 0; - rcClient.top = 0; - rcClient.right = width; - rcClient.bottom = height; - - ErrorF ("winRandRScreenSetSize new client area w: %d h: %d\n", width, height); - - /* Get the Windows window style and extended style */ - dwExStyle = GetWindowLongPtr(pScreenPriv->hwndScreen, GWL_EXSTYLE); - dwStyle = GetWindowLongPtr(pScreenPriv->hwndScreen, GWL_STYLE); - - /* - * Calculate the window size needed for the given client area - * adjusting for any decorations it will have - */ - AdjustWindowRectEx(&rcClient, dwStyle, FALSE, dwExStyle); - - ErrorF ("winRandRScreenSetSize new window area w: %ld h: %ld\n", rcClient.right-rcClient.left, rcClient.bottom-rcClient.top); - - SetWindowPos(pScreenPriv->hwndScreen, NULL, - 0, 0, rcClient.right-rcClient.left, rcClient.bottom-rcClient.top, - SWP_NOZORDER | SWP_NOMOVE); - } - - return TRUE; -} - -/* - * Initialize the RandR layer. - */ - -Bool -winRandRInit (ScreenPtr pScreen) -{ - rrScrPrivPtr pRRScrPriv; - winDebug ("winRandRInit ()\n"); - - if (!RRScreenInit (pScreen)) - { - ErrorF ("winRandRInit () - RRScreenInit () failed\n"); - return FALSE; - } - - /* Set some RandR function pointers */ - pRRScrPriv = rrGetScrPriv (pScreen); - pRRScrPriv->rrGetInfo = winRandRGetInfo; - pRRScrPriv->rrSetConfig = NULL; - pRRScrPriv->rrScreenSetSize = winRandRScreenSetSize; - pRRScrPriv->rrCrtcSet = NULL; - pRRScrPriv->rrCrtcSetGamma = NULL; - - return TRUE; -} +/*
+ *Copyright (C) 2001-2004 Harold L Hunt II All Rights Reserved.
+ *Copyright (C) 2009-2010 Jon TURNEY
+ *
+ *Permission is hereby granted, free of charge, to any person obtaining
+ *a copy of this software and associated documentation files (the
+ *"Software"), to deal in the Software without restriction, including
+ *without limitation the rights to use, copy, modify, merge, publish,
+ *distribute, sublicense, and/or sell copies of the Software, and to
+ *permit persons to whom the Software is furnished to do so, subject to
+ *the following conditions:
+ *
+ *The above copyright notice and this permission notice shall be
+ *included in all copies or substantial portions of the Software.
+ *
+ *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *NONINFRINGEMENT. IN NO EVENT SHALL HAROLD L HUNT II BE LIABLE FOR
+ *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+ *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *Except as contained in this notice, the name of the author(s)
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the author(s)
+ *
+ * Authors: Harold L Hunt II
+ * Jon TURNEY
+ */
+
+#ifdef HAVE_XWIN_CONFIG_H
+#include <xwin-config.h>
+#endif
+#include "win.h"
+#include "mivalidate.h" // for union _Validate used by windowstr.h
+
+#ifndef RANDR_12_INTERFACE
+#error X server must have RandR 1.2 interface
+#endif
+
+
+/*
+ * Answer queries about the RandR features supported.
+ */
+
+static Bool
+winRandRGetInfo (ScreenPtr pScreen, Rotation *pRotations)
+{
+ winDebug ("winRandRGetInfo ()\n");
+
+ /* Don't support rotations */
+ *pRotations = RR_Rotate_0;
+
+ /*
+ The screen doesn't have to be limited to the actual
+ monitor size (we can have scrollbars :-), so what is
+ the upper limit?
+ */
+ RRScreenSetSizeRange(pScreen, 0, 0, 4096, 4096);
+
+ return TRUE;
+}
+
+/*
+
+*/
+void
+winDoRandRScreenSetSize (ScreenPtr pScreen,
+ CARD16 width,
+ CARD16 height,
+ CARD32 mmWidth,
+ CARD32 mmHeight)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ WindowPtr pRoot = pScreen->root;
+
+ // Prevent screen updates while we change things around
+ SetRootClip(pScreen, FALSE);
+
+ /* Update the screen size as requested */
+ pScreenInfo->dwWidth = width;
+ pScreenInfo->dwHeight = height;
+
+ /* Reallocate the framebuffer used by the drawing engine */
+ (*pScreenPriv->pwinFreeFB)(pScreen);
+ if (!(*pScreenPriv->pwinAllocateFB)(pScreen))
+ {
+ ErrorF ("winDoRandRScreenSetSize - Could not reallocate framebuffer\n");
+ }
+
+ pScreen->width = width;
+ pScreen->height = height;
+ pScreen->mmWidth = mmWidth;
+ pScreen->mmHeight = mmHeight;
+
+ /* Update the screen pixmap to point to the new framebuffer */
+ winUpdateFBPointer(pScreen, pScreenInfo->pfb);
+
+ // pScreen->devPrivate == pScreen->GetScreenPixmap(screen) ?
+ // resize the root window
+ //pScreen->ResizeWindow(pRoot, 0, 0, width, height, NULL);
+ // does this emit a ConfigureNotify??
+
+ // Restore the ability to update screen, now with new dimensions
+ SetRootClip(pScreen, TRUE);
+
+ // and arrange for it to be repainted
+ miPaintWindow(pRoot, &pRoot->borderClip, PW_BACKGROUND);
+
+ /* Indicate that a screen size change took place */
+ RRScreenSizeNotify(pScreen);
+}
+
+/*
+ * Respond to resize request
+ */
+static
+Bool
+winRandRScreenSetSize (ScreenPtr pScreen,
+ CARD16 width,
+ CARD16 height,
+ CARD32 mmWidth,
+ CARD32 mmHeight)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+
+ winDebug ("winRandRScreenSetSize ()\n");
+
+ /*
+ It doesn't currently make sense to allow resize in fullscreen mode
+ (we'd actually have to list the supported resolutions)
+ */
+ if (pScreenInfo->fFullScreen)
+ {
+ ErrorF ("winRandRScreenSetSize - resize not supported in fullscreen mode\n");
+ return FALSE;
+ }
+
+ /*
+ Client resize requests aren't allowed in rootless modes, even if
+ the X screen is monitor or virtual desktop size, we'd need to
+ resize the native display size
+ */
+ if (FALSE
+#ifdef XWIN_MULTIWINDOWEXTWM
+ || pScreenInfo->fMWExtWM
+#endif
+ || pScreenInfo->fRootless
+#ifdef XWIN_MULTIWINDOW
+ || pScreenInfo->fMultiWindow
+#endif
+ )
+ {
+ ErrorF ("winRandRScreenSetSize - resize not supported in rootless modes\n");
+ return FALSE;
+ }
+
+ winDoRandRScreenSetSize(pScreen, width, height, mmWidth, mmHeight);
+
+ /* Cause the native window for the screen to resize itself */
+ {
+ DWORD dwStyle, dwExStyle;
+ RECT rcClient;
+
+ rcClient.left = 0;
+ rcClient.top = 0;
+ rcClient.right = width;
+ rcClient.bottom = height;
+
+ ErrorF ("winRandRScreenSetSize new client area w: %d h: %d\n", width, height);
+
+ /* Get the Windows window style and extended style */
+ dwExStyle = GetWindowLongPtr(pScreenPriv->hwndScreen, GWL_EXSTYLE);
+ dwStyle = GetWindowLongPtr(pScreenPriv->hwndScreen, GWL_STYLE);
+
+ /*
+ * Calculate the window size needed for the given client area
+ * adjusting for any decorations it will have
+ */
+ AdjustWindowRectEx(&rcClient, dwStyle, FALSE, dwExStyle);
+
+ ErrorF ("winRandRScreenSetSize new window area w: %ld h: %ld\n", rcClient.right-rcClient.left, rcClient.bottom-rcClient.top);
+
+ SetWindowPos(pScreenPriv->hwndScreen, NULL,
+ 0, 0, rcClient.right-rcClient.left, rcClient.bottom-rcClient.top,
+ SWP_NOZORDER | SWP_NOMOVE);
+ }
+
+ return TRUE;
+}
+
+/*
+ * Initialize the RandR layer.
+ */
+
+Bool
+winRandRInit (ScreenPtr pScreen)
+{
+ rrScrPrivPtr pRRScrPriv;
+ winDebug ("winRandRInit ()\n");
+
+ if (!RRScreenInit (pScreen))
+ {
+ ErrorF ("winRandRInit () - RRScreenInit () failed\n");
+ return FALSE;
+ }
+
+ /* Set some RandR function pointers */
+ pRRScrPriv = rrGetScrPriv (pScreen);
+ pRRScrPriv->rrGetInfo = winRandRGetInfo;
+ pRRScrPriv->rrSetConfig = NULL;
+ pRRScrPriv->rrScreenSetSize = winRandRScreenSetSize;
+ pRRScrPriv->rrCrtcSet = NULL;
+ pRRScrPriv->rrCrtcSetGamma = NULL;
+
+ return TRUE;
+}
diff --git a/xorg-server/hw/xwin/winregistry.c b/xorg-server/hw/xwin/winregistry.c index 3571b14d7..898ed978b 100644 --- a/xorg-server/hw/xwin/winregistry.c +++ b/xorg-server/hw/xwin/winregistry.c @@ -55,11 +55,11 @@ winGetRegistryDWORD (HKEY hkey, char *pszRegistryKey) if (dwDisposition == REG_CREATED_NEW_KEY) { - ErrorF ("winGetRegistryDWORD - Created new key: %s\n", pszRegistryKey); + winDebug ("winGetRegistryDWORD - Created new key: %s\n", pszRegistryKey); } else if (dwDisposition == REG_OPENED_EXISTING_KEY) { - ErrorF ("winGetRegistryDWORD - Opened existing key: %s\n", + winDebug ("winGetRegistryDWORD - Opened existing key: %s\n", pszRegistryKey); } diff --git a/xorg-server/hw/xwin/winresource.h b/xorg-server/hw/xwin/winresource.h index 7085117e6..6a04153f0 100644 --- a/xorg-server/hw/xwin/winresource.h +++ b/xorg-server/hw/xwin/winresource.h @@ -51,4 +51,6 @@ #define ID_ABOUT_CHANGELOG 302 #define ID_ABOUT_WEBSITE 303 +#define IDC_HOSTLIST 100 + #endif diff --git a/xorg-server/hw/xwin/winscrinit.c b/xorg-server/hw/xwin/winscrinit.c index 983ff5730..baa2b7f3a 100644 --- a/xorg-server/hw/xwin/winscrinit.c +++ b/xorg-server/hw/xwin/winscrinit.c @@ -1,773 +1,760 @@ -/* - *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved. - * - *Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - *"Software"), to deal in the Software without restriction, including - *without limitation the rights to use, copy, modify, merge, publish, - *distribute, sublicense, and/or sell copies of the Software, and to - *permit persons to whom the Software is furnished to do so, subject to - *the following conditions: - * - *The above copyright notice and this permission notice shall be - *included in all copies or substantial portions of the Software. - * - *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR - *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - *Except as contained in this notice, the name of the XFree86 Project - *shall not be used in advertising or otherwise to promote the sale, use - *or other dealings in this Software without prior written authorization - *from the XFree86 Project. - * - * Authors: Dakshinamurthy Karra - * Suhaib M Siddiqi - * Peter Busch - * Harold L Hunt II - * Kensuke Matsuzaki - */ - -#ifdef HAVE_XWIN_CONFIG_H -#include <xwin-config.h> -#endif -#include "win.h" -#include "winmsg.h" - - -#ifdef XWIN_MULTIWINDOWEXTWM -static RootlessFrameProcsRec -winMWExtWMProcs = { - winMWExtWMCreateFrame, - winMWExtWMDestroyFrame, - - winMWExtWMMoveFrame, - winMWExtWMResizeFrame, - winMWExtWMRestackFrame, - winMWExtWMReshapeFrame, - winMWExtWMUnmapFrame, - - winMWExtWMStartDrawing, - winMWExtWMStopDrawing, - winMWExtWMUpdateRegion, - winMWExtWMDamageRects, - winMWExtWMRootlessSwitchWindow, - NULL,//winMWExtWMDoReorderWindow, - NULL,//winMWExtWMHideWindow, - NULL,//winMWExtWMUpdateColorMap, - - NULL,//winMWExtWMCopyBytes, - winMWExtWMCopyWindow -}; -#endif - -/* - * Prototypes - */ - -/* - * Local functions - */ - -static Bool -winSaveScreen (ScreenPtr pScreen, int on); - - -/* - * Determine what type of screen we are initializing - * and call the appropriate procedure to intiailize - * that type of screen. - */ - -Bool -winScreenInit (int index, - ScreenPtr pScreen, - int argc, char **argv) -{ - winScreenInfoPtr pScreenInfo = &g_ScreenInfo[index]; - winPrivScreenPtr pScreenPriv; - HDC hdc; - DWORD dwInitialBPP; - -#if CYGDEBUG || YES - winDebug ("winScreenInit - dwWidth: %ld dwHeight: %ld\n", - pScreenInfo->dwWidth, pScreenInfo->dwHeight); -#endif - - /* Allocate privates for this screen */ - if (!winAllocatePrivates (pScreen)) - { - ErrorF ("winScreenInit - Couldn't allocate screen privates\n"); - return FALSE; - } - - /* Get a pointer to the privates structure that was allocated */ - pScreenPriv = winGetScreenPriv (pScreen); - - /* Save a pointer to this screen in the screen info structure */ - pScreenInfo->pScreen = pScreen; - - /* Save a pointer to the screen info in the screen privates structure */ - /* This allows us to get back to the screen info from a screen pointer */ - pScreenPriv->pScreenInfo = pScreenInfo; - - /* - * Determine which engine to use. - * - * NOTE: This is done once per screen because each screen possibly has - * a preferred engine specified on the command line. - */ - if (!winSetEngine (pScreen)) - { - ErrorF ("winScreenInit - winSetEngine () failed\n"); - return FALSE; - } - - /* Horribly misnamed function: Allow engine to adjust BPP for screen */ - dwInitialBPP = pScreenInfo->dwBPP; - - if (!(*pScreenPriv->pwinAdjustVideoMode) (pScreen)) - { - ErrorF ("winScreenInit - winAdjustVideoMode () failed\n"); - return FALSE; - } - - if (dwInitialBPP == WIN_DEFAULT_BPP) - { - /* No -depth parameter was passed, let the user know the depth being used */ - ErrorF ("winScreenInit - Using Windows display depth of %d bits per pixel\n", (int) pScreenInfo->dwBPP); - } - else if (dwInitialBPP != pScreenInfo->dwBPP) - { - /* Warn user if engine forced a depth different to -depth parameter */ - ErrorF ("winScreenInit - Command line depth of %d bpp overidden by engine, using %d bpp\n", (int) dwInitialBPP, (int) pScreenInfo->dwBPP); - } - else - { - ErrorF ("winScreenInit - Using command line depth of %d bpp\n", (int) pScreenInfo->dwBPP); - } - - /* Check for supported display depth */ - if (!(WIN_SUPPORTED_BPPS & (1 << (pScreenInfo->dwBPP - 1)))) - { - ErrorF ("winScreenInit - Unsupported display depth: %d\n" \ - "Change your Windows display depth to 15, 16, 24, or 32 bits " - "per pixel.\n", - (int) pScreenInfo->dwBPP); - ErrorF ("winScreenInit - Supported depths: %08x\n", - WIN_SUPPORTED_BPPS); -#if WIN_CHECK_DEPTH - return FALSE; -#endif - } - - /* - * Check that all monitors have the same display depth if we are using - * multiple monitors - */ - if (pScreenInfo->fMultipleMonitors - && !GetSystemMetrics (SM_SAMEDISPLAYFORMAT)) - { - ErrorF ("winScreenInit - Monitors do not all have same pixel format / " - "display depth.\n"); - if (pScreenInfo->dwEngine == WIN_SERVER_SHADOW_GDI) - { - ErrorF ("winScreenInit - Performance may suffer off primary display.\n"); - } - else - { - ErrorF ("winScreenInit - Using primary display only.\n"); - pScreenInfo->fMultipleMonitors = FALSE; - } - } - - /* Create display window */ - if (!(*pScreenPriv->pwinCreateBoundingWindow) (pScreen)) - { - ErrorF ("winScreenInit - pwinCreateBoundingWindow () " - "failed\n"); - return FALSE; - } - - /* Get a device context */ - hdc = GetDC (pScreenPriv->hwndScreen); - - /* Are we using multiple monitors? */ - if (pScreenInfo->fMultipleMonitors) - { - /* - * In this case, some of the defaults set in - * winInitializeScreenDefaults() are not correct ... - */ - if (!pScreenInfo->fUserGaveHeightAndWidth) - { - pScreenInfo->dwWidth = GetSystemMetrics (SM_CXVIRTUALSCREEN); - pScreenInfo->dwHeight = GetSystemMetrics (SM_CYVIRTUALSCREEN); - } - } - - /* Release the device context */ - ReleaseDC (pScreenPriv->hwndScreen, hdc); - - /* Clear the visuals list */ - miClearVisualTypes (); - - /* Call the engine dependent screen initialization procedure */ - if (!((*pScreenPriv->pwinFinishScreenInit) (index, pScreen, argc, argv))) - { - ErrorF ("winScreenInit - winFinishScreenInit () failed\n"); - - /* call the engine dependent screen close procedure to clean up from a failure */ - pScreenPriv->pwinCloseScreen(index, pScreen); - - return FALSE; - } - - if (!g_fSoftwareCursor) - winInitCursor(pScreen); - else - winErrorFVerb(2, "winScreenInit - Using software cursor\n"); - - /* - Note the screen origin in a normalized coordinate space where (0,0) is at the top left - of the native virtual desktop area - */ - pScreen->x = pScreenInfo->dwInitialX - GetSystemMetrics(SM_XVIRTUALSCREEN); - pScreen->y = pScreenInfo->dwInitialY - GetSystemMetrics(SM_YVIRTUALSCREEN); - - ErrorF("Screen %d added at virtual desktop coordinate (%d,%d).\n", - index, pScreen->x, pScreen->y); - -#if CYGDEBUG || YES - winDebug ("winScreenInit - returning\n"); -#endif - - return TRUE; -} - -static Bool -winCreateScreenResources(ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - Bool result; - - result = pScreenPriv->pwinCreateScreenResources(pScreen); - - /* Now the screen bitmap has been wrapped in a pixmap, - add that to the Shadow framebuffer */ - if (!shadowAdd(pScreen, pScreen->devPrivate, - pScreenPriv->pwinShadowUpdate, NULL, 0, 0)) - { - ErrorF ("winCreateScreenResources - shadowAdd () failed\n"); - return FALSE; - } - - return result; -} - -/* See Porting Layer Definition - p. 20 */ -Bool -winFinishScreenInitFB (int index, - ScreenPtr pScreen, - int argc, char **argv) -{ - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - VisualPtr pVisual = NULL; - char *pbits = NULL; -#if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW) - int iReturn; -#endif - - /* Create framebuffer */ - if (!(*pScreenPriv->pwinInitScreen) (pScreen)) - { - ErrorF ("winFinishScreenInitFB - Could not allocate framebuffer\n"); - return FALSE; - } - - /* - * Calculate the number of bits that are used to represent color in each pixel, - * the color depth for the screen - */ - if (pScreenInfo->dwBPP == 8) - pScreenInfo->dwDepth = 8; - else - pScreenInfo->dwDepth = winCountBits (pScreenPriv->dwRedMask) - + winCountBits (pScreenPriv->dwGreenMask) - + winCountBits (pScreenPriv->dwBlueMask); - - winErrorFVerb (2, "winFinishScreenInitFB - Masks: %08x %08x %08x\n", - (unsigned int) pScreenPriv->dwRedMask, - (unsigned int) pScreenPriv->dwGreenMask, - (unsigned int) pScreenPriv->dwBlueMask); - - /* Init visuals */ - if (!(*pScreenPriv->pwinInitVisuals) (pScreen)) - { - ErrorF ("winFinishScreenInitFB - winInitVisuals failed\n"); - return FALSE; - } - - /* Setup a local variable to point to the framebuffer */ - pbits = pScreenInfo->pfb; - - /* Apparently we need this for the render extension */ - miSetPixmapDepths (); - - /* Start fb initialization */ - if (!fbSetupScreen (pScreen, - pScreenInfo->pfb, - pScreenInfo->dwWidth, pScreenInfo->dwHeight, - monitorResolution, monitorResolution, - pScreenInfo->dwStride, - pScreenInfo->dwBPP)) - { - ErrorF ("winFinishScreenInitFB - fbSetupScreen failed\n"); - return FALSE; - } - - /* Override default colormap routines if visual class is dynamic */ - if (pScreenInfo->dwDepth == 8 - && (pScreenInfo->dwEngine == WIN_SERVER_SHADOW_GDI - || (pScreenInfo->dwEngine == WIN_SERVER_SHADOW_DDNL - && pScreenInfo->fFullScreen) - || (pScreenInfo->dwEngine == WIN_SERVER_SHADOW_DD - && pScreenInfo->fFullScreen))) - { - winSetColormapFunctions (pScreen); - - /* - * NOTE: Setting whitePixel to 255 causes Magic 7.1 to allocate its - * own colormap, as it cannot allocate 7 planes in the default - * colormap. Setting whitePixel to 1 allows Magic to get 7 - * planes in the default colormap, so it doesn't create its - * own colormap. This latter situation is highly desireable, - * as it keeps the Magic window viewable when switching to - * other X clients that use the default colormap. - */ - pScreen->blackPixel = 0; - pScreen->whitePixel = 1; - } - - /* Place our save screen function */ - pScreen->SaveScreen = winSaveScreen; - - /* Finish fb initialization */ - if (!fbFinishScreenInit (pScreen, - pScreenInfo->pfb, - pScreenInfo->dwWidth, pScreenInfo->dwHeight, - monitorResolution, monitorResolution, - pScreenInfo->dwStride, - pScreenInfo->dwBPP)) - { - ErrorF ("winFinishScreenInitFB - fbFinishScreenInit failed\n"); - return FALSE; - } - - /* Save a pointer to the root visual */ - for (pVisual = pScreen->visuals; - pVisual->vid != pScreen->rootVisual; - pVisual++); - pScreenPriv->pRootVisual = pVisual; - - /* - * Setup points to the block and wakeup handlers. Pass a pointer - * to the current screen as pWakeupdata. - */ - pScreen->BlockHandler = winBlockHandler; - pScreen->WakeupHandler = winWakeupHandler; - pScreen->blockData = pScreen; - pScreen->wakeupData = pScreen; - - /* Render extension initialization, calls miPictureInit */ - if (!fbPictureInit (pScreen, NULL, 0)) - { - ErrorF ("winFinishScreenInitFB - fbPictureInit () failed\n"); - return FALSE; - } - -#ifdef RANDR - /* Initialize resize and rotate support */ - if (!winRandRInit (pScreen)) - { - ErrorF ("winFinishScreenInitFB - winRandRInit () failed\n"); - return FALSE; - } -#endif - - /* Setup the cursor routines */ -#if CYGDEBUG - winDebug ("winFinishScreenInitFB - Calling miDCInitialize ()\n"); -#endif - miDCInitialize (pScreen, &g_winPointerCursorFuncs); - - /* KDrive does winCreateDefColormap right after miDCInitialize */ - /* Create a default colormap */ -#if CYGDEBUG - winDebug ("winFinishScreenInitFB - Calling winCreateDefColormap ()\n"); -#endif - if (!winCreateDefColormap (pScreen)) - { - ErrorF ("winFinishScreenInitFB - Could not create colormap\n"); - return FALSE; - } - - /* Initialize the shadow framebuffer layer */ - if ((pScreenInfo->dwEngine == WIN_SERVER_SHADOW_GDI - || pScreenInfo->dwEngine == WIN_SERVER_SHADOW_DD - || pScreenInfo->dwEngine == WIN_SERVER_SHADOW_DDNL) -#ifdef XWIN_MULTIWINDOWEXTWM - && !pScreenInfo->fMWExtWM -#endif - ) - { -#if CYGDEBUG - winDebug ("winFinishScreenInitFB - Calling shadowSetup ()\n"); -#endif - if (!shadowSetup(pScreen)) - { - ErrorF ("winFinishScreenInitFB - shadowSetup () failed\n"); - return FALSE; - } - - /* Wrap CreateScreenResources so we can add the screen pixmap - to the Shadow framebuffer after it's been created */ - pScreenPriv->pwinCreateScreenResources = pScreen->CreateScreenResources; - pScreen->CreateScreenResources = winCreateScreenResources; - } - -#ifdef XWIN_MULTIWINDOWEXTWM - /* Handle multi-window external window manager mode */ - if (pScreenInfo->fMWExtWM) - { - winDebug ("winScreenInit - MultiWindowExtWM - Calling RootlessInit\n"); - - RootlessInit(pScreen, &winMWExtWMProcs); - - winDebug ("winScreenInit - MultiWindowExtWM - RootlessInit returned\n"); - - rootless_CopyBytes_threshold = 0; - /* FIXME: How many? Profiling needed? */ - rootless_CopyWindow_threshold = 1; - - winWindowsWMExtensionInit (); - } -#endif - - /* Handle rootless mode */ - if (pScreenInfo->fRootless) - { - /* Define the WRAP macro temporarily for local use */ -#define WRAP(a) \ - if (pScreen->a) { \ - pScreenPriv->a = pScreen->a; \ - } else { \ - ErrorF("null screen fn " #a "\n"); \ - pScreenPriv->a = NULL; \ - } - - /* Save a pointer to each lower-level window procedure */ - WRAP(CreateWindow); - WRAP(DestroyWindow); - WRAP(RealizeWindow); - WRAP(UnrealizeWindow); - WRAP(PositionWindow); - WRAP(ChangeWindowAttributes); - WRAP(SetShape); - - /* Assign rootless window procedures to be top level procedures */ - pScreen->CreateWindow = winCreateWindowRootless; - pScreen->DestroyWindow = winDestroyWindowRootless; - pScreen->PositionWindow = winPositionWindowRootless; - /*pScreen->ChangeWindowAttributes = winChangeWindowAttributesRootless;*/ - pScreen->RealizeWindow = winMapWindowRootless; - pScreen->UnrealizeWindow = winUnmapWindowRootless; - pScreen->SetShape = winSetShapeRootless; - - /* Undefine the WRAP macro, as it is not needed elsewhere */ -#undef WRAP - } - - -#ifdef XWIN_MULTIWINDOW - /* Handle multi window mode */ - else if (pScreenInfo->fMultiWindow) - { - /* Define the WRAP macro temporarily for local use */ -#define WRAP(a) \ - if (pScreen->a) { \ - pScreenPriv->a = pScreen->a; \ - } else { \ - ErrorF("null screen fn " #a "\n"); \ - pScreenPriv->a = NULL; \ - } - - /* Save a pointer to each lower-level window procedure */ - WRAP(CreateWindow); - WRAP(DestroyWindow); - WRAP(RealizeWindow); - WRAP(UnrealizeWindow); - WRAP(PositionWindow); - WRAP(ChangeWindowAttributes); - WRAP(ReparentWindow); - WRAP(RestackWindow); - WRAP(ResizeWindow); - WRAP(MoveWindow); - WRAP(CopyWindow); - WRAP(SetShape); - - /* Assign multi-window window procedures to be top level procedures */ - pScreen->CreateWindow = winCreateWindowMultiWindow; - pScreen->DestroyWindow = winDestroyWindowMultiWindow; - pScreen->PositionWindow = winPositionWindowMultiWindow; - /*pScreen->ChangeWindowAttributes = winChangeWindowAttributesMultiWindow;*/ - pScreen->RealizeWindow = winMapWindowMultiWindow; - pScreen->UnrealizeWindow = winUnmapWindowMultiWindow; - pScreen->ReparentWindow = winReparentWindowMultiWindow; - pScreen->RestackWindow = winRestackWindowMultiWindow; - pScreen->ResizeWindow = winResizeWindowMultiWindow; - pScreen->MoveWindow = winMoveWindowMultiWindow; - pScreen->CopyWindow = winCopyWindowMultiWindow; - pScreen->SetShape = winSetShapeMultiWindow; - - /* Undefine the WRAP macro, as it is not needed elsewhere */ -#undef WRAP - } -#endif - - /* Wrap either fb's or shadow's CloseScreen with our CloseScreen */ - pScreenPriv->CloseScreen = pScreen->CloseScreen; - pScreen->CloseScreen = pScreenPriv->pwinCloseScreen; - -#if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW) - /* Create a mutex for modules in separate threads to wait for */ - iReturn = pthread_mutex_init (&pScreenPriv->pmServerStarted, NULL); - if (iReturn != 0) - { - ErrorF ("winFinishScreenInitFB - pthread_mutex_init () failed: %d\n", - iReturn); - return FALSE; - } - - /* Own the mutex for modules in separate threads */ - iReturn = pthread_mutex_lock (&pScreenPriv->pmServerStarted); - if (iReturn != 0) - { - ErrorF ("winFinishScreenInitFB - pthread_mutex_lock () failed: %d\n", - iReturn); - return FALSE; - } - - /* Set the ServerStarted flag to false */ - pScreenPriv->fServerStarted = FALSE; -#endif - -#ifdef XWIN_MULTIWINDOWEXTWM - pScreenPriv->fRestacking = FALSE; -#endif - -#if defined(XWIN_MULTIWINDOW) || defined(XWIN_MULTIWINDOWEXTWM) - if (FALSE -#ifdef XWIN_MULTIWINDOW - || pScreenInfo->fMultiWindow -#endif -#ifdef XWIN_MULTIWINDOWEXTWM - || pScreenInfo->fInternalWM -#endif - ) - { -#if CYGDEBUG || YES - winDebug ("winFinishScreenInitFB - Calling winInitWM.\n"); -#endif - - /* Initialize multi window mode */ - if (!winInitWM (&pScreenPriv->pWMInfo, - &pScreenPriv->ptWMProc, - &pScreenPriv->ptXMsgProc, - &pScreenPriv->pmServerStarted, - pScreenInfo->dwScreen, - (HWND)&pScreenPriv->hwndScreen, -#ifdef XWIN_MULTIWINDOWEXTWM - pScreenInfo->fInternalWM || -#endif - FALSE)) - { - ErrorF ("winFinishScreenInitFB - winInitWM () failed.\n"); - return FALSE; - } - } -#endif - - /* Tell the server that we are enabled */ - pScreenPriv->fEnabled = TRUE; - - /* Tell the server that we have a valid depth */ - pScreenPriv->fBadDepth = FALSE; - -#if CYGDEBUG || YES - winDebug ("winFinishScreenInitFB - returning\n"); -#endif - - return TRUE; -} - -#ifdef XWIN_NATIVEGDI -/* See Porting Layer Definition - p. 20 */ - -Bool -winFinishScreenInitNativeGDI (int index, - ScreenPtr pScreen, - int argc, char **argv) -{ - winScreenPriv(pScreen); - winScreenInfoPtr pScreenInfo = &g_ScreenInfo[index]; - VisualPtr pVisuals = NULL; - DepthPtr pDepths = NULL; - VisualID rootVisual = 0; - int nVisuals = 0, nDepths = 0, nRootDepth = 0; - - /* Ignore user input (mouse, keyboard) */ - pScreenInfo->fIgnoreInput = FALSE; - - /* Get device contexts for the screen and shadow bitmap */ - pScreenPriv->hdcScreen = GetDC (pScreenPriv->hwndScreen); - if (pScreenPriv->hdcScreen == NULL) - FatalError ("winFinishScreenInitNativeGDI - Couldn't get a DC\n"); - - /* Init visuals */ - if (!(*pScreenPriv->pwinInitVisuals) (pScreen)) - { - ErrorF ("winFinishScreenInitNativeGDI - pwinInitVisuals failed\n"); - return FALSE; - } - - /* Initialize the mi visuals */ - if (!miInitVisuals (&pVisuals, &pDepths, &nVisuals, &nDepths, &nRootDepth, - &rootVisual, - ((unsigned long)1 << (pScreenInfo->dwDepth - 1)), 8, - TrueColor)) - { - ErrorF ("winFinishScreenInitNativeGDI - miInitVisuals () failed\n"); - return FALSE; - } - - /* Initialize the CloseScreen procedure pointer */ - pScreen->CloseScreen = NULL; - - /* Initialize the mi code */ - if (!miScreenInit (pScreen, - NULL, /* No framebuffer */ - pScreenInfo->dwWidth, pScreenInfo->dwHeight, - monitorResolution, monitorResolution, - pScreenInfo->dwStride, - nRootDepth, nDepths, pDepths, rootVisual, - nVisuals, pVisuals)) - { - ErrorF ("winFinishScreenInitNativeGDI - miScreenInit failed\n"); - return FALSE; - } - - pScreen->defColormap = FakeClientID(0); - - /* - * Register our block and wakeup handlers; these procedures - * process messages in our Windows message queue; specifically, - * they process mouse and keyboard input. - */ - pScreen->BlockHandler = winBlockHandler; - pScreen->WakeupHandler = winWakeupHandler; - pScreen->blockData = pScreen; - pScreen->wakeupData = pScreen; - - /* Place our save screen function */ - pScreen->SaveScreen = winSaveScreen; - - /* Pixmaps */ - pScreen->CreatePixmap = winCreatePixmapNativeGDI; - pScreen->DestroyPixmap = winDestroyPixmapNativeGDI; - - /* Other Screen Routines */ - pScreen->QueryBestSize = winQueryBestSizeNativeGDI; - pScreen->SaveScreen = winSaveScreen; - pScreen->GetImage = miGetImage; - pScreen->GetSpans = winGetSpansNativeGDI; - - /* Window Procedures */ - pScreen->CreateWindow = winCreateWindowNativeGDI; - pScreen->DestroyWindow = winDestroyWindowNativeGDI; - pScreen->PositionWindow = winPositionWindowNativeGDI; - /*pScreen->ChangeWindowAttributes = winChangeWindowAttributesNativeGDI;*/ - pScreen->RealizeWindow = winMapWindowNativeGDI; - pScreen->UnrealizeWindow = winUnmapWindowNativeGDI; - - /* Paint window */ - pScreen->CopyWindow = winCopyWindowNativeGDI; - - /* Fonts */ - pScreen->RealizeFont = winRealizeFontNativeGDI; - pScreen->UnrealizeFont = winUnrealizeFontNativeGDI; - - /* GC */ - pScreen->CreateGC = winCreateGCNativeGDI; - - /* Colormap Routines */ - pScreen->CreateColormap = miInitializeColormap; - pScreen->DestroyColormap = (DestroyColormapProcPtr) (void (*)(void)) NoopDDA; - pScreen->InstallColormap = miInstallColormap; - pScreen->UninstallColormap = miUninstallColormap; - pScreen->ListInstalledColormaps = miListInstalledColormaps; - pScreen->StoreColors = (StoreColorsProcPtr) (void (*)(void)) NoopDDA; - pScreen->ResolveColor = miResolveColor; - - /* Bitmap */ - pScreen->BitmapToRegion = winPixmapToRegionNativeGDI; - - ErrorF ("winFinishScreenInitNativeGDI - calling miDCInitialize\n"); - - /* Set the default white and black pixel positions */ - pScreen->whitePixel = pScreen->blackPixel = (Pixel) 0; - - /* Initialize the cursor */ - if (!miDCInitialize (pScreen, &g_winPointerCursorFuncs)) - { - ErrorF ("winFinishScreenInitNativeGDI - miDCInitialize failed\n"); - return FALSE; - } - - /* Create a default colormap */ - if (!miCreateDefColormap (pScreen)) - { - ErrorF ("winFinishScreenInitNativeGDI - miCreateDefColormap () " - "failed\n"); - return FALSE; - } - - ErrorF ("winFinishScreenInitNativeGDI - miCreateDefColormap () " - "returned\n"); - - /* mi doesn't use a CloseScreen procedure, so no need to wrap */ - pScreen->CloseScreen = pScreenPriv->pwinCloseScreen; - - /* Tell the server that we are enabled */ - pScreenPriv->fEnabled = TRUE; - - ErrorF ("winFinishScreenInitNativeGDI - Successful addition of " - "screen %08x\n", - (unsigned int) pScreen); - - return TRUE; -} -#endif - - -/* See Porting Layer Definition - p. 33 */ -static Bool -winSaveScreen (ScreenPtr pScreen, int on) -{ - return TRUE; -} +/*
+ *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
+ *
+ *Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ *"Software"), to deal in the Software without restriction, including
+ *without limitation the rights to use, copy, modify, merge, publish,
+ *distribute, sublicense, and/or sell copies of the Software, and to
+ *permit persons to whom the Software is furnished to do so, subject to
+ *the following conditions:
+ *
+ *The above copyright notice and this permission notice shall be
+ *included in all copies or substantial portions of the Software.
+ *
+ *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
+ *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+ *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Dakshinamurthy Karra
+ * Suhaib M Siddiqi
+ * Peter Busch
+ * Harold L Hunt II
+ * Kensuke Matsuzaki
+ */
+
+#ifdef HAVE_XWIN_CONFIG_H
+#include <xwin-config.h>
+#endif
+#include "win.h"
+#include "winmsg.h"
+
+
+#ifdef XWIN_MULTIWINDOWEXTWM
+static RootlessFrameProcsRec
+winMWExtWMProcs = {
+ winMWExtWMCreateFrame,
+ winMWExtWMDestroyFrame,
+
+ winMWExtWMMoveFrame,
+ winMWExtWMResizeFrame,
+ winMWExtWMRestackFrame,
+ winMWExtWMReshapeFrame,
+ winMWExtWMUnmapFrame,
+
+ winMWExtWMStartDrawing,
+ winMWExtWMStopDrawing,
+ winMWExtWMUpdateRegion,
+ winMWExtWMDamageRects,
+ winMWExtWMRootlessSwitchWindow,
+ NULL,//winMWExtWMDoReorderWindow,
+ NULL,//winMWExtWMHideWindow,
+ NULL,//winMWExtWMUpdateColorMap,
+
+ NULL,//winMWExtWMCopyBytes,
+ winMWExtWMCopyWindow
+};
+#endif
+
+/*
+ * Prototypes
+ */
+
+/*
+ * Local functions
+ */
+
+static Bool
+winSaveScreen (ScreenPtr pScreen, int on);
+
+
+/*
+ * Determine what type of screen we are initializing
+ * and call the appropriate procedure to intiailize
+ * that type of screen.
+ */
+
+Bool
+winScreenInit (int index,
+ ScreenPtr pScreen,
+ int argc, char **argv)
+{
+ winScreenInfoPtr pScreenInfo = &g_ScreenInfo[index];
+ winPrivScreenPtr pScreenPriv;
+ HDC hdc;
+ DWORD dwInitialBPP;
+
+ winDebug ("winScreenInit - dwWidth: %ld dwHeight: %ld\n",
+ pScreenInfo->dwWidth, pScreenInfo->dwHeight);
+
+ /* Allocate privates for this screen */
+ if (!winAllocatePrivates (pScreen))
+ {
+ ErrorF ("winScreenInit - Couldn't allocate screen privates\n");
+ return FALSE;
+ }
+
+ /* Get a pointer to the privates structure that was allocated */
+ pScreenPriv = winGetScreenPriv (pScreen);
+
+ /* Save a pointer to this screen in the screen info structure */
+ pScreenInfo->pScreen = pScreen;
+
+ /* Save a pointer to the screen info in the screen privates structure */
+ /* This allows us to get back to the screen info from a screen pointer */
+ pScreenPriv->pScreenInfo = pScreenInfo;
+
+ /*
+ * Determine which engine to use.
+ *
+ * NOTE: This is done once per screen because each screen possibly has
+ * a preferred engine specified on the command line.
+ */
+ if (!winSetEngine (pScreen))
+ {
+ ErrorF ("winScreenInit - winSetEngine () failed\n");
+ return FALSE;
+ }
+
+ /* Horribly misnamed function: Allow engine to adjust BPP for screen */
+ dwInitialBPP = pScreenInfo->dwBPP;
+
+ if (pScreenPriv->pwinAdjustVideoMode && !(*pScreenPriv->pwinAdjustVideoMode) (pScreen))
+ {
+ ErrorF ("winScreenInit - winAdjustVideoMode () failed\n");
+ return FALSE;
+ }
+
+ if (dwInitialBPP == WIN_DEFAULT_BPP)
+ {
+ /* No -depth parameter was passed, let the user know the depth being used */
+ winDebug ("winScreenInit - Using Windows display depth of %d bits per pixel\n", (int) pScreenInfo->dwBPP);
+ }
+ else if (dwInitialBPP != pScreenInfo->dwBPP)
+ {
+ /* Warn user if engine forced a depth different to -depth parameter */
+ winDebug ("winScreenInit - Command line depth of %d bpp overidden by engine, using %d bpp\n", (int) dwInitialBPP, (int) pScreenInfo->dwBPP);
+ }
+ else
+ {
+ winDebug ("winScreenInit - Using command line depth of %d bpp\n", (int) pScreenInfo->dwBPP);
+ }
+
+ /* Check for supported display depth */
+ if (!(WIN_SUPPORTED_BPPS & (1 << (pScreenInfo->dwBPP - 1))))
+ {
+ ErrorF ("winScreenInit - Unsupported display depth: %d\n" \
+ "Change your Windows display depth to 15, 16, 24, or 32 bits "
+ "per pixel.\n",
+ (int) pScreenInfo->dwBPP);
+ ErrorF ("winScreenInit - Supported depths: %08x\n",
+ WIN_SUPPORTED_BPPS);
+#if WIN_CHECK_DEPTH
+ return FALSE;
+#endif
+ }
+
+ /*
+ * Check that all monitors have the same display depth if we are using
+ * multiple monitors
+ */
+ if (pScreenInfo->fMultipleMonitors
+ && !GetSystemMetrics (SM_SAMEDISPLAYFORMAT))
+ {
+ ErrorF ("winScreenInit - Monitors do not all have same pixel format / "
+ "display depth.\n");
+ if (pScreenInfo->dwEngine == WIN_SERVER_SHADOW_GDI)
+ {
+ ErrorF ("winScreenInit - Performance may suffer off primary display.\n");
+ }
+ else
+ {
+ ErrorF ("winScreenInit - Using primary display only.\n");
+ pScreenInfo->fMultipleMonitors = FALSE;
+ }
+ }
+
+ /* Create display window */
+ if (pScreenPriv->pwinCreateBoundingWindow && !(*pScreenPriv->pwinCreateBoundingWindow) (pScreen))
+ {
+ ErrorF ("winScreenInit - pwinCreateBoundingWindow () "
+ "failed\n");
+ return FALSE;
+ }
+
+ /* Get a device context */
+ hdc = GetDC (pScreenPriv->hwndScreen);
+
+ /* Are we using multiple monitors? */
+ if (pScreenInfo->fMultipleMonitors)
+ {
+ /*
+ * In this case, some of the defaults set in
+ * winInitializeScreenDefaults() are not correct ...
+ */
+ if (!pScreenInfo->fUserGaveHeightAndWidth)
+ {
+ pScreenInfo->dwWidth = GetSystemMetrics (SM_CXVIRTUALSCREEN);
+ pScreenInfo->dwHeight = GetSystemMetrics (SM_CYVIRTUALSCREEN);
+ }
+ }
+
+ /* Release the device context */
+ ReleaseDC (pScreenPriv->hwndScreen, hdc);
+
+ /* Clear the visuals list */
+ miClearVisualTypes ();
+
+ /* Call the engine dependent screen initialization procedure */
+ if (pScreenPriv->pwinFinishScreenInit && !((*pScreenPriv->pwinFinishScreenInit) (index, pScreen, argc, argv)))
+ {
+ ErrorF ("winScreenInit - winFinishScreenInit () failed\n");
+
+ /* call the engine dependent screen close procedure to clean up from a failure */
+ pScreenPriv->pwinCloseScreen(index, pScreen);
+
+ return FALSE;
+ }
+
+ if (!g_fSoftwareCursor)
+ winInitCursor(pScreen);
+#ifdef WINDBG
+ else
+ winDebug("winScreenInit - Using software cursor\n");
+#endif
+
+ /*
+ Note the screen origin in a normalized coordinate space where (0,0) is at the top left
+ of the native virtual desktop area
+ */
+ pScreen->x = pScreenInfo->dwInitialX - GetSystemMetrics(SM_XVIRTUALSCREEN);
+ pScreen->y = pScreenInfo->dwInitialY - GetSystemMetrics(SM_YVIRTUALSCREEN);
+
+ winDebug("Screen %d added at virtual desktop coordinate (%d,%d).\n",
+ index, pScreen->x, pScreen->y);
+ winDebug ("winScreenInit - returning\n");
+
+ return TRUE;
+}
+
+static Bool
+winCreateScreenResources(ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ Bool result;
+
+ result = pScreenPriv->pwinCreateScreenResources(pScreen);
+
+ /* Now the screen bitmap has been wrapped in a pixmap,
+ add that to the Shadow framebuffer */
+ if (!shadowAdd(pScreen, pScreen->devPrivate,
+ pScreenPriv->pwinShadowUpdate, NULL, 0, 0))
+ {
+ ErrorF ("winCreateScreenResources - shadowAdd () failed\n");
+ return FALSE;
+ }
+
+ return result;
+}
+
+/* See Porting Layer Definition - p. 20 */
+Bool
+winFinishScreenInitFB (int index,
+ ScreenPtr pScreen,
+ int argc, char **argv)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ VisualPtr pVisual = NULL;
+ char *pbits = NULL;
+#if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW)
+ int iReturn;
+#endif
+
+ /* Create framebuffer */
+ if (!(*pScreenPriv->pwinInitScreen) (pScreen))
+ {
+ ErrorF ("winFinishScreenInitFB - Could not allocate framebuffer\n");
+ return FALSE;
+ }
+
+ /*
+ * Calculate the number of bits that are used to represent color in each pixel,
+ * the color depth for the screen
+ */
+ if (pScreenInfo->dwBPP == 8)
+ pScreenInfo->dwDepth = 8;
+ else
+ pScreenInfo->dwDepth = winCountBits (pScreenPriv->dwRedMask)
+ + winCountBits (pScreenPriv->dwGreenMask)
+ + winCountBits (pScreenPriv->dwBlueMask);
+
+ winDebug ("winFinishScreenInitFB - Masks: %08x %08x %08x\n",
+ (unsigned int) pScreenPriv->dwRedMask,
+ (unsigned int) pScreenPriv->dwGreenMask,
+ (unsigned int) pScreenPriv->dwBlueMask);
+
+ /* Init visuals */
+ if (!(*pScreenPriv->pwinInitVisuals) (pScreen))
+ {
+ ErrorF ("winFinishScreenInitFB - winInitVisuals failed\n");
+ return FALSE;
+ }
+
+ /* Setup a local variable to point to the framebuffer */
+ pbits = pScreenInfo->pfb;
+
+ /* Apparently we need this for the render extension */
+ miSetPixmapDepths ();
+
+ /* Start fb initialization */
+ if (!fbSetupScreen (pScreen,
+ pScreenInfo->pfb,
+ pScreenInfo->dwWidth, pScreenInfo->dwHeight,
+ monitorResolution, monitorResolution,
+ pScreenInfo->dwStride,
+ pScreenInfo->dwBPP))
+ {
+ ErrorF ("winFinishScreenInitFB - fbSetupScreen failed\n");
+ return FALSE;
+ }
+
+ /* Override default colormap routines if visual class is dynamic */
+ if (pScreenInfo->dwDepth == 8
+ && (pScreenInfo->dwEngine == WIN_SERVER_SHADOW_GDI
+ || (pScreenInfo->dwEngine == WIN_SERVER_SHADOW_DDNL
+ && pScreenInfo->fFullScreen)
+ || (pScreenInfo->dwEngine == WIN_SERVER_SHADOW_DD
+ && pScreenInfo->fFullScreen)))
+ {
+ winSetColormapFunctions (pScreen);
+
+ /*
+ * NOTE: Setting whitePixel to 255 causes Magic 7.1 to allocate its
+ * own colormap, as it cannot allocate 7 planes in the default
+ * colormap. Setting whitePixel to 1 allows Magic to get 7
+ * planes in the default colormap, so it doesn't create its
+ * own colormap. This latter situation is highly desireable,
+ * as it keeps the Magic window viewable when switching to
+ * other X clients that use the default colormap.
+ */
+ pScreen->blackPixel = 0;
+ pScreen->whitePixel = 1;
+ }
+
+ /* Place our save screen function */
+ pScreen->SaveScreen = winSaveScreen;
+
+ /* Finish fb initialization */
+ if (!fbFinishScreenInit (pScreen,
+ pScreenInfo->pfb,
+ pScreenInfo->dwWidth, pScreenInfo->dwHeight,
+ monitorResolution, monitorResolution,
+ pScreenInfo->dwStride,
+ pScreenInfo->dwBPP))
+ {
+ ErrorF ("winFinishScreenInitFB - fbFinishScreenInit failed\n");
+ return FALSE;
+ }
+
+ /* Save a pointer to the root visual */
+ for (pVisual = pScreen->visuals;
+ pVisual->vid != pScreen->rootVisual;
+ pVisual++);
+ pScreenPriv->pRootVisual = pVisual;
+
+ /*
+ * Setup points to the block and wakeup handlers. Pass a pointer
+ * to the current screen as pWakeupdata.
+ */
+ pScreen->BlockHandler = winBlockHandler;
+ pScreen->WakeupHandler = winWakeupHandler;
+ pScreen->blockData = pScreen;
+ pScreen->wakeupData = pScreen;
+
+ /* Render extension initialization, calls miPictureInit */
+ if (!fbPictureInit (pScreen, NULL, 0))
+ {
+ ErrorF ("winFinishScreenInitFB - fbPictureInit () failed\n");
+ return FALSE;
+ }
+
+#ifdef RANDR
+ /* Initialize resize and rotate support */
+ if (!winRandRInit (pScreen))
+ {
+ ErrorF ("winFinishScreenInitFB - winRandRInit () failed\n");
+ return FALSE;
+ }
+#endif
+
+ /* Setup the cursor routines */
+ winDebug ("winFinishScreenInitFB - Calling miDCInitialize ()\n");
+ miDCInitialize (pScreen, &g_winPointerCursorFuncs);
+
+ /* KDrive does winCreateDefColormap right after miDCInitialize */
+ /* Create a default colormap */
+ winDebug ("winFinishScreenInitFB - Calling winCreateDefColormap ()\n");
+ if (!winCreateDefColormap (pScreen))
+ {
+ ErrorF ("winFinishScreenInitFB - Could not create colormap\n");
+ return FALSE;
+ }
+
+ /* Initialize the shadow framebuffer layer */
+ if ((pScreenInfo->dwEngine == WIN_SERVER_SHADOW_GDI
+ || pScreenInfo->dwEngine == WIN_SERVER_SHADOW_DD
+ || pScreenInfo->dwEngine == WIN_SERVER_SHADOW_DDNL)
+#ifdef XWIN_MULTIWINDOWEXTWM
+ && !pScreenInfo->fMWExtWM
+#endif
+ )
+ {
+ winDebug ("winFinishScreenInitFB - Calling shadowSetup ()\n");
+ if (!shadowSetup(pScreen))
+ {
+ ErrorF ("winFinishScreenInitFB - shadowSetup () failed\n");
+ return FALSE;
+ }
+
+ /* Wrap CreateScreenResources so we can add the screen pixmap
+ to the Shadow framebuffer after it's been created */
+ pScreenPriv->pwinCreateScreenResources = pScreen->CreateScreenResources;
+ pScreen->CreateScreenResources = winCreateScreenResources;
+ }
+
+#ifdef XWIN_MULTIWINDOWEXTWM
+ /* Handle multi-window external window manager mode */
+ if (pScreenInfo->fMWExtWM)
+ {
+ winDebug ("winScreenInit - MultiWindowExtWM - Calling RootlessInit\n");
+
+ RootlessInit(pScreen, &winMWExtWMProcs);
+
+ winDebug ("winScreenInit - MultiWindowExtWM - RootlessInit returned\n");
+
+ rootless_CopyBytes_threshold = 0;
+ /* FIXME: How many? Profiling needed? */
+ rootless_CopyWindow_threshold = 1;
+
+ winWindowsWMExtensionInit ();
+ }
+#endif
+
+ /* Handle rootless mode */
+ if (pScreenInfo->fRootless)
+ {
+ /* Define the WRAP macro temporarily for local use */
+#define WRAP(a) \
+ if (pScreen->a) { \
+ pScreenPriv->a = pScreen->a; \
+ } else { \
+ ErrorF("null screen fn " #a "\n"); \
+ pScreenPriv->a = NULL; \
+ }
+
+ /* Save a pointer to each lower-level window procedure */
+ WRAP(CreateWindow);
+ WRAP(DestroyWindow);
+ WRAP(RealizeWindow);
+ WRAP(UnrealizeWindow);
+ WRAP(PositionWindow);
+ WRAP(ChangeWindowAttributes);
+ WRAP(SetShape);
+
+ /* Assign rootless window procedures to be top level procedures */
+ pScreen->CreateWindow = winCreateWindowRootless;
+ pScreen->DestroyWindow = winDestroyWindowRootless;
+ pScreen->PositionWindow = winPositionWindowRootless;
+ /*pScreen->ChangeWindowAttributes = winChangeWindowAttributesRootless;*/
+ pScreen->RealizeWindow = winMapWindowRootless;
+ pScreen->UnrealizeWindow = winUnmapWindowRootless;
+ pScreen->SetShape = winSetShapeRootless;
+
+ /* Undefine the WRAP macro, as it is not needed elsewhere */
+#undef WRAP
+ }
+
+
+#ifdef XWIN_MULTIWINDOW
+ /* Handle multi window mode */
+ else if (pScreenInfo->fMultiWindow)
+ {
+ /* Define the WRAP macro temporarily for local use */
+#define WRAP(a) \
+ if (pScreen->a) { \
+ pScreenPriv->a = pScreen->a; \
+ } else { \
+ ErrorF("null screen fn " #a "\n"); \
+ pScreenPriv->a = NULL; \
+ }
+
+ /* Save a pointer to each lower-level window procedure */
+ WRAP(CreateWindow);
+ WRAP(DestroyWindow);
+ WRAP(RealizeWindow);
+ WRAP(UnrealizeWindow);
+ WRAP(PositionWindow);
+ WRAP(ChangeWindowAttributes);
+ WRAP(ReparentWindow);
+ WRAP(RestackWindow);
+ WRAP(ResizeWindow);
+ WRAP(MoveWindow);
+ WRAP(CopyWindow);
+ WRAP(SetShape);
+
+ /* Assign multi-window window procedures to be top level procedures */
+ pScreen->CreateWindow = winCreateWindowMultiWindow;
+ pScreen->DestroyWindow = winDestroyWindowMultiWindow;
+ pScreen->PositionWindow = winPositionWindowMultiWindow;
+ /*pScreen->ChangeWindowAttributes = winChangeWindowAttributesMultiWindow;*/
+ pScreen->RealizeWindow = winMapWindowMultiWindow;
+ pScreen->UnrealizeWindow = winUnmapWindowMultiWindow;
+ pScreen->ReparentWindow = winReparentWindowMultiWindow;
+ pScreen->RestackWindow = winRestackWindowMultiWindow;
+ pScreen->ResizeWindow = winResizeWindowMultiWindow;
+ pScreen->MoveWindow = winMoveWindowMultiWindow;
+ pScreen->CopyWindow = winCopyWindowMultiWindow;
+ pScreen->SetShape = winSetShapeMultiWindow;
+
+ /* Undefine the WRAP macro, as it is not needed elsewhere */
+#undef WRAP
+ }
+#endif
+
+ /* Wrap either fb's or shadow's CloseScreen with our CloseScreen */
+ pScreenPriv->CloseScreen = pScreen->CloseScreen;
+ pScreen->CloseScreen = pScreenPriv->pwinCloseScreen;
+
+#if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW)
+ /* Create a mutex for modules in separate threads to wait for */
+ iReturn = pthread_mutex_init (&pScreenPriv->pmServerStarted, NULL);
+ if (iReturn != 0)
+ {
+ ErrorF ("winFinishScreenInitFB - pthread_mutex_init () failed: %d\n",
+ iReturn);
+ return FALSE;
+ }
+
+ /* Own the mutex for modules in separate threads */
+ iReturn = pthread_mutex_lock (&pScreenPriv->pmServerStarted);
+ if (iReturn != 0)
+ {
+ ErrorF ("winFinishScreenInitFB - pthread_mutex_lock () failed: %d\n",
+ iReturn);
+ return FALSE;
+ }
+
+ /* Set the ServerStarted flag to false */
+ pScreenPriv->fServerStarted = FALSE;
+#endif
+
+#ifdef XWIN_MULTIWINDOWEXTWM
+ pScreenPriv->fRestacking = FALSE;
+#endif
+
+#if defined(XWIN_MULTIWINDOW) || defined(XWIN_MULTIWINDOWEXTWM)
+ if (FALSE
+#ifdef XWIN_MULTIWINDOW
+ || pScreenInfo->fMultiWindow
+#endif
+#ifdef XWIN_MULTIWINDOWINTWM
+ || pScreenInfo->fInternalWM
+#endif
+ )
+ {
+ winDebug ("winFinishScreenInitFB - Calling winInitWM.\n");
+
+ /* Initialize multi window mode */
+ if (!winInitWM (&pScreenPriv->pWMInfo,
+ &pScreenPriv->ptWMProc,
+ &pScreenPriv->ptXMsgProc,
+ &pScreenPriv->pmServerStarted,
+ pScreenInfo->dwScreen,
+ (HWND)&pScreenPriv->hwndScreen,
+#ifdef XWIN_MULTIWINDOWINTWM
+ pScreenInfo->fInternalWM ||
+#endif
+ FALSE))
+ {
+ ErrorF ("winFinishScreenInitFB - winInitWM () failed.\n");
+ return FALSE;
+ }
+ }
+#endif
+
+ /* Tell the server that we are enabled */
+ pScreenPriv->fEnabled = TRUE;
+
+ /* Tell the server that we have a valid depth */
+ pScreenPriv->fBadDepth = FALSE;
+
+ winDebug ("winFinishScreenInitFB - returning\n");
+
+ return TRUE;
+}
+
+#ifdef XWIN_NATIVEGDI
+/* See Porting Layer Definition - p. 20 */
+
+Bool
+winFinishScreenInitNativeGDI (int index,
+ ScreenPtr pScreen,
+ int argc, char **argv)
+{
+ winScreenPriv(pScreen);
+ winScreenInfoPtr pScreenInfo = &g_ScreenInfo[index];
+ VisualPtr pVisuals = NULL;
+ DepthPtr pDepths = NULL;
+ VisualID rootVisual = 0;
+ int nVisuals = 0, nDepths = 0, nRootDepth = 0;
+
+ /* Ignore user input (mouse, keyboard) */
+ pScreenInfo->fIgnoreInput = FALSE;
+
+ /* Get device contexts for the screen and shadow bitmap */
+ pScreenPriv->hdcScreen = GetDC (pScreenPriv->hwndScreen);
+ if (pScreenPriv->hdcScreen == NULL)
+ FatalError ("winFinishScreenInitNativeGDI - Couldn't get a DC\n");
+
+ /* Init visuals */
+ if (!(*pScreenPriv->pwinInitVisuals) (pScreen))
+ {
+ ErrorF ("winFinishScreenInitNativeGDI - pwinInitVisuals failed\n");
+ return FALSE;
+ }
+
+ /* Initialize the mi visuals */
+ if (!miInitVisuals (&pVisuals, &pDepths, &nVisuals, &nDepths, &nRootDepth,
+ &rootVisual,
+ ((unsigned long)1 << (pScreenInfo->dwDepth - 1)), 8,
+ TrueColor))
+ {
+ ErrorF ("winFinishScreenInitNativeGDI - miInitVisuals () failed\n");
+ return FALSE;
+ }
+
+ /* Initialize the CloseScreen procedure pointer */
+ pScreen->CloseScreen = NULL;
+
+ /* Initialize the mi code */
+ if (!miScreenInit (pScreen,
+ NULL, /* No framebuffer */
+ pScreenInfo->dwWidth, pScreenInfo->dwHeight,
+ monitorResolution, monitorResolution,
+ pScreenInfo->dwStride,
+ nRootDepth, nDepths, pDepths, rootVisual,
+ nVisuals, pVisuals))
+ {
+ ErrorF ("winFinishScreenInitNativeGDI - miScreenInit failed\n");
+ return FALSE;
+ }
+
+ pScreen->defColormap = FakeClientID(0);
+
+ /*
+ * Register our block and wakeup handlers; these procedures
+ * process messages in our Windows message queue; specifically,
+ * they process mouse and keyboard input.
+ */
+ pScreen->BlockHandler = winBlockHandler;
+ pScreen->WakeupHandler = winWakeupHandler;
+ pScreen->blockData = pScreen;
+ pScreen->wakeupData = pScreen;
+
+ /* Place our save screen function */
+ pScreen->SaveScreen = winSaveScreen;
+
+ /* Pixmaps */
+ pScreen->CreatePixmap = winCreatePixmapNativeGDI;
+ pScreen->DestroyPixmap = winDestroyPixmapNativeGDI;
+
+ /* Other Screen Routines */
+ pScreen->QueryBestSize = winQueryBestSizeNativeGDI;
+ pScreen->SaveScreen = winSaveScreen;
+ pScreen->GetImage = miGetImage;
+ pScreen->GetSpans = winGetSpansNativeGDI;
+
+ /* Window Procedures */
+ pScreen->CreateWindow = winCreateWindowNativeGDI;
+ pScreen->DestroyWindow = winDestroyWindowNativeGDI;
+ pScreen->PositionWindow = winPositionWindowNativeGDI;
+ /*pScreen->ChangeWindowAttributes = winChangeWindowAttributesNativeGDI;*/
+ pScreen->RealizeWindow = winMapWindowNativeGDI;
+ pScreen->UnrealizeWindow = winUnmapWindowNativeGDI;
+
+ /* Paint window */
+ pScreen->CopyWindow = winCopyWindowNativeGDI;
+
+ /* Fonts */
+ pScreen->RealizeFont = winRealizeFontNativeGDI;
+ pScreen->UnrealizeFont = winUnrealizeFontNativeGDI;
+
+ /* GC */
+ pScreen->CreateGC = winCreateGCNativeGDI;
+
+ /* Colormap Routines */
+ pScreen->CreateColormap = miInitializeColormap;
+ pScreen->DestroyColormap = (DestroyColormapProcPtr) (void (*)(void)) NoopDDA;
+ pScreen->InstallColormap = miInstallColormap;
+ pScreen->UninstallColormap = miUninstallColormap;
+ pScreen->ListInstalledColormaps = miListInstalledColormaps;
+ pScreen->StoreColors = (StoreColorsProcPtr) (void (*)(void)) NoopDDA;
+ pScreen->ResolveColor = miResolveColor;
+
+ /* Bitmap */
+ pScreen->BitmapToRegion = winPixmapToRegionNativeGDI;
+
+ winDebug ("winFinishScreenInitNativeGDI - calling miDCInitialize\n");
+
+ /* Set the default white and black pixel positions */
+ pScreen->whitePixel = pScreen->blackPixel = (Pixel) 0;
+
+ /* Initialize the cursor */
+ if (!miDCInitialize (pScreen, &g_winPointerCursorFuncs))
+ {
+ ErrorF ("winFinishScreenInitNativeGDI - miDCInitialize failed\n");
+ return FALSE;
+ }
+
+ /* Create a default colormap */
+ if (!miCreateDefColormap (pScreen))
+ {
+ ErrorF ("winFinishScreenInitNativeGDI - miCreateDefColormap () "
+ "failed\n");
+ return FALSE;
+ }
+
+ winDebug ("winFinishScreenInitNativeGDI - miCreateDefColormap () "
+ "returned\n");
+
+ /* mi doesn't use a CloseScreen procedure, so no need to wrap */
+ pScreen->CloseScreen = pScreenPriv->pwinCloseScreen;
+
+ /* Tell the server that we are enabled */
+ pScreenPriv->fEnabled = TRUE;
+
+ winDebug ("winFinishScreenInitNativeGDI - Successful addition of "
+ "screen %08x\n",
+ (unsigned int) pScreen);
+
+ return TRUE;
+}
+#endif
+
+
+/* See Porting Layer Definition - p. 33 */
+static Bool
+winSaveScreen (ScreenPtr pScreen, int on)
+{
+ return TRUE;
+}
diff --git a/xorg-server/hw/xwin/winsetsp.c b/xorg-server/hw/xwin/winsetsp.c index fa492b479..6150a9182 100644 --- a/xorg-server/hw/xwin/winsetsp.c +++ b/xorg-server/hw/xwin/winsetsp.c @@ -34,6 +34,11 @@ #endif
#include "win.h"
+typedef struct mybitmap
+{
+ BITMAPINFOHEADER bmiHeader;
+ RGBQUAD bmiColors[256]; /* Maximum palette used in case of 8-bit per pixel */
+} mybitmap_t;
/* See Porting Layer Definition - p. 55 */
void
@@ -49,7 +54,7 @@ winSetSpansNativeGDI (DrawablePtr pDrawable, PixmapPtr pPixmap = NULL;
winPrivPixmapPtr pPixmapPriv = NULL;
HBITMAP hbmpOrig = NULL;
- BITMAPINFO bmi;
+ mybitmap_t bmi;
HRGN hrgn = NULL, combined = NULL;
int nbox;
BoxPtr pbox;
@@ -90,7 +95,7 @@ winSetSpansNativeGDI (DrawablePtr pDrawable, while (iSpans--)
{
- ZeroMemory (&bmi, sizeof (BITMAPINFO));
+ ZeroMemory (&bmi, sizeof (mybitmap_t));
bmi.bmiHeader.biSize = sizeof (BITMAPINFOHEADER);
bmi.bmiHeader.biWidth = *piWidths;
bmi.bmiHeader.biHeight = 1;
@@ -112,7 +117,7 @@ winSetSpansNativeGDI (DrawablePtr pDrawable, 0, 0,
*piWidths, 1,
pSrcs,
- (BITMAPINFO *) &bmi,
+ (BITMAPINFO*)&bmi,
DIB_RGB_COLORS,
g_copyROP[pGC->alu]);
@@ -136,7 +141,7 @@ winSetSpansNativeGDI (DrawablePtr pDrawable, while (iSpans--)
{
- ZeroMemory (&bmi, sizeof (BITMAPINFO));
+ ZeroMemory (&bmi, sizeof (mybitmap_t));
bmi.bmiHeader.biSize = sizeof (BITMAPINFOHEADER);
bmi.bmiHeader.biWidth = *piWidths;
bmi.bmiHeader.biHeight = 1;
diff --git a/xorg-server/hw/xwin/winshaddd.c b/xorg-server/hw/xwin/winshaddd.c index 6dad2782f..0f6afe2f3 100644 --- a/xorg-server/hw/xwin/winshaddd.c +++ b/xorg-server/hw/xwin/winshaddd.c @@ -1,1367 +1,1326 @@ -/* - *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved. - * - *Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - *"Software"), to deal in the Software without restriction, including - *without limitation the rights to use, copy, modify, merge, publish, - *distribute, sublicense, and/or sell copies of the Software, and to - *permit persons to whom the Software is furnished to do so, subject to - *the following conditions: - * - *The above copyright notice and this permission notice shall be - *included in all copies or substantial portions of the Software. - * - *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR - *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - *Except as contained in this notice, the name of the XFree86 Project - *shall not be used in advertising or otherwise to promote the sale, use - *or other dealings in this Software without prior written authorization - *from the XFree86 Project. - * - * Authors: Dakshinamurthy Karra - * Suhaib M Siddiqi - * Peter Busch - * Harold L Hunt II - */ - -#ifdef HAVE_XWIN_CONFIG_H -#include <xwin-config.h> -#endif -#include "win.h" - - -/* - * FIXME: Headers are broken, DEFINE_GUID doesn't work correctly, - * so we have to redefine it here. - */ -#ifdef DEFINE_GUID -#undef DEFINE_GUID -#define DEFINE_GUID(n,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) const GUID n GUID_SECT = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}} -#endif /* DEFINE_GUID */ - - -/* - * FIXME: Headers are broken, IID_IDirectDraw2 has to be defined - * here manually. Should be handled by ddraw.h - */ -#ifndef IID_IDirectDraw2 -DEFINE_GUID( IID_IDirectDraw2,0xB3A6F3E0,0x2B43,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xB9,0x33,0x56 ); -#endif /* IID_IDirectDraw2 */ - - -/* - * Local prototypes - */ - -static Bool -winAllocateFBShadowDD (ScreenPtr pScreen); - -static void -winShadowUpdateDD (ScreenPtr pScreen, - shadowBufPtr pBuf); - -static Bool -winCloseScreenShadowDD (int nIndex, ScreenPtr pScreen); - -static Bool -winInitVisualsShadowDD (ScreenPtr pScreen); - -static Bool -winAdjustVideoModeShadowDD (ScreenPtr pScreen); - -static Bool -winBltExposedRegionsShadowDD (ScreenPtr pScreen); - -static Bool -winActivateAppShadowDD (ScreenPtr pScreen); - -static Bool -winRedrawScreenShadowDD (ScreenPtr pScreen); - -static Bool -winRealizeInstalledPaletteShadowDD (ScreenPtr pScreen); - -static Bool -winInstallColormapShadowDD (ColormapPtr pColormap); - -static Bool -winStoreColorsShadowDD (ColormapPtr pmap, - int ndef, - xColorItem *pdefs); - -static Bool -winCreateColormapShadowDD (ColormapPtr pColormap); - -static Bool -winDestroyColormapShadowDD (ColormapPtr pColormap); - -static Bool -winCreatePrimarySurfaceShadowDD (ScreenPtr pScreen); - -static Bool -winReleasePrimarySurfaceShadowDD (ScreenPtr pScreen); - - -/* - * Create the primary surface and attach the clipper. - * Used for both the initial surface creation and during - * WM_DISPLAYCHANGE messages. - */ - -static Bool -winCreatePrimarySurfaceShadowDD (ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - HRESULT ddrval = DD_OK; - DDSURFACEDESC ddsd; - - /* Describe the primary surface */ - ZeroMemory (&ddsd, sizeof (ddsd)); - ddsd.dwSize = sizeof (ddsd); - ddsd.dwFlags = DDSD_CAPS; - ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; - - /* Create the primary surface */ - ddrval = IDirectDraw2_CreateSurface (pScreenPriv->pdd2, - &ddsd, - &pScreenPriv->pddsPrimary, - NULL); - if (FAILED (ddrval)) - { - ErrorF ("winCreatePrimarySurfaceShadowDD - Could not create primary " - "surface: %08x\n", (unsigned int) ddrval); - return FALSE; - } - -#if CYGDEBUG - winDebug ("winCreatePrimarySurfaceShadowDD - Created primary surface\n"); -#endif - - /* - * Attach a clipper to the primary surface that will clip our blits to our - * display window. - */ - ddrval = IDirectDrawSurface2_SetClipper (pScreenPriv->pddsPrimary, - pScreenPriv->pddcPrimary); - if (FAILED (ddrval)) - { - ErrorF ("winCreatePrimarySurfaceShadowDD - Primary attach clipper " - "failed: %08x\n", - (unsigned int) ddrval); - return FALSE; - } - -#if CYGDEBUG - winDebug ("winCreatePrimarySurfaceShadowDD - Attached clipper to " - "primary surface\n"); -#endif - - /* Everything was correct */ - return TRUE; -} - - -/* - * Detach the clipper and release the primary surface. - * Called from WM_DISPLAYCHANGE. - */ - -static Bool -winReleasePrimarySurfaceShadowDD (ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - - ErrorF ("winReleasePrimarySurfaceShadowDD - Hello\n"); - - /* Release the primary surface and clipper, if they exist */ - if (pScreenPriv->pddsPrimary) - { - /* - * Detach the clipper from the primary surface. - * NOTE: We do this explicity for clarity. The Clipper is not released. - */ - IDirectDrawSurface2_SetClipper (pScreenPriv->pddsPrimary, - NULL); - - ErrorF ("winReleasePrimarySurfaceShadowDD - Detached clipper\n"); - - /* Release the primary surface */ - IDirectDrawSurface2_Release (pScreenPriv->pddsPrimary); - pScreenPriv->pddsPrimary = NULL; - } - - ErrorF ("winReleasePrimarySurfaceShadowDD - Released primary surface\n"); - - return TRUE; -} - - -/* - * Create a DirectDraw surface for the shadow framebuffer; also create - * a primary surface object so we can blit to the display. - * - * Install a DirectDraw clipper on our primary surface object - * that clips our blits to the unobscured client area of our display window. - */ - -static Bool -winAllocateFBShadowDD (ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - HRESULT ddrval = DD_OK; - DDSURFACEDESC ddsd; - DDSURFACEDESC *pddsdShadow = NULL; - -#if CYGDEBUG - winDebug ("winAllocateFBShadowDD\n"); -#endif - - /* Create a clipper */ - ddrval = (*g_fpDirectDrawCreateClipper) (0, - &pScreenPriv->pddcPrimary, - NULL); - if (FAILED (ddrval)) - { - ErrorF ("winAllocateFBShadowDD - Could not create clipper: %08x\n", - (unsigned int) ddrval); - return FALSE; - } - -#if CYGDEBUG - winDebug ("winAllocateFBShadowDD - Created a clipper\n"); -#endif - - /* Attach the clipper to our display window */ - ddrval = IDirectDrawClipper_SetHWnd (pScreenPriv->pddcPrimary, - 0, - pScreenPriv->hwndScreen); - if (FAILED (ddrval)) - { - ErrorF ("winAllocateFBShadowDD - Clipper not attached to " - "window: %08x\n", - (unsigned int) ddrval); - return FALSE; - } - -#if CYGDEBUG - winDebug ("winAllocateFBShadowDD - Attached clipper to window\n"); -#endif - - /* Create a DirectDraw object, store the address at lpdd */ - ddrval = (*g_fpDirectDrawCreate) (NULL, &pScreenPriv->pdd, NULL); - if (FAILED (ddrval)) - { - ErrorF ("winAllocateFBShadowDD - Could not start DirectDraw: %08x\n", - (unsigned int) ddrval); - return FALSE; - } - -#if CYGDEBUG - winDebug ("winAllocateFBShadowDD () - Created and initialized DD\n"); -#endif - - /* Get a DirectDraw2 interface pointer */ - ddrval = IDirectDraw_QueryInterface (pScreenPriv->pdd, - &IID_IDirectDraw2, - (LPVOID*) &pScreenPriv->pdd2); - if (FAILED (ddrval)) - { - ErrorF ("winAllocateFBShadowDD - Failed DD2 query: %08x\n", - (unsigned int) ddrval); - return FALSE; - } - - /* Are we full screen? */ - if (pScreenInfo->fFullScreen) - { - DDSURFACEDESC ddsdCurrent; - DWORD dwRefreshRateCurrent = 0; - HDC hdc = NULL; - - /* Set the cooperative level to full screen */ - ddrval = IDirectDraw2_SetCooperativeLevel (pScreenPriv->pdd2, - pScreenPriv->hwndScreen, - DDSCL_EXCLUSIVE - | DDSCL_FULLSCREEN); - if (FAILED (ddrval)) - { - ErrorF ("winAllocateFBShadowDD - Could not set " - "cooperative level: %08x\n", - (unsigned int) ddrval); - return FALSE; - } - - /* - * We only need to get the current refresh rate for comparison - * if a refresh rate has been passed on the command line. - */ - if (pScreenInfo->dwRefreshRate != 0) - { - ZeroMemory (&ddsdCurrent, sizeof (ddsdCurrent)); - ddsdCurrent.dwSize = sizeof (ddsdCurrent); - - /* Get information about current display settings */ - ddrval = IDirectDraw2_GetDisplayMode (pScreenPriv->pdd2, - &ddsdCurrent); - if (FAILED (ddrval)) - { - ErrorF ("winAllocateFBShadowDD - Could not get current " - "refresh rate: %08x. Continuing.\n", - (unsigned int) ddrval); - dwRefreshRateCurrent = 0; - } - else - { - /* Grab the current refresh rate */ - dwRefreshRateCurrent = ddsdCurrent.u2.dwRefreshRate; - } - } - - /* Clean up the refresh rate */ - if (dwRefreshRateCurrent == pScreenInfo->dwRefreshRate) - { - /* - * Refresh rate is non-specified or equal to current. - */ - pScreenInfo->dwRefreshRate = 0; - } - - /* Grab a device context for the screen */ - hdc = GetDC (NULL); - if (hdc == NULL) - { - ErrorF ("winAllocateFBShadowDD - GetDC () failed\n"); - return FALSE; - } - - /* Only change the video mode when different than current mode */ - if (!pScreenInfo->fMultipleMonitors - && (pScreenInfo->dwWidth != GetSystemMetrics (SM_CXSCREEN) - || pScreenInfo->dwHeight != GetSystemMetrics (SM_CYSCREEN) - || pScreenInfo->dwBPP != GetDeviceCaps (hdc, BITSPIXEL) - || pScreenInfo->dwRefreshRate != 0)) - { - ErrorF ("winAllocateFBShadowDD - Changing video mode\n"); - - /* Change the video mode to the mode requested, and use the driver default refresh rate on failure */ - ddrval = IDirectDraw2_SetDisplayMode (pScreenPriv->pdd2, - pScreenInfo->dwWidth, - pScreenInfo->dwHeight, - pScreenInfo->dwBPP, - pScreenInfo->dwRefreshRate, - 0); - if (FAILED (ddrval)) - { - ErrorF ("winAllocateFBShadowDD - Could not set "\ - "full screen display mode: %08x\n", - (unsigned int) ddrval); - ErrorF ("winAllocateFBShadowDD - Using default driver refresh rate\n"); - ddrval = IDirectDraw2_SetDisplayMode (pScreenPriv->pdd2, - pScreenInfo->dwWidth, - pScreenInfo->dwHeight, - pScreenInfo->dwBPP, - 0, - 0); - if (FAILED(ddrval)) - { - ErrorF ("winAllocateFBShadowDD - Could not set default refresh rate " - "full screen display mode: %08x\n", - (unsigned int) ddrval); - return FALSE; - } - } - } - else - { - ErrorF ("winAllocateFBShadowDD - Not changing video mode\n"); - } - - /* Release our DC */ - ReleaseDC (NULL, hdc); - hdc = NULL; - } - else - { - /* Set the cooperative level for windowed mode */ - ddrval = IDirectDraw2_SetCooperativeLevel (pScreenPriv->pdd2, - pScreenPriv->hwndScreen, - DDSCL_NORMAL); - if (FAILED (ddrval)) - { - ErrorF ("winAllocateFBShadowDD - Could not set "\ - "cooperative level: %08x\n", - (unsigned int) ddrval); - return FALSE; - } - } - - /* Create the primary surface */ - if (!winCreatePrimarySurfaceShadowDD (pScreen)) - { - ErrorF ("winAllocateFBShadowDD - winCreatePrimarySurfaceShadowDD " - "failed\n"); - return FALSE; - } - - /* Describe the shadow surface to be created */ - /* NOTE: Do not use a DDSCAPS_VIDEOMEMORY surface, - * as drawing, locking, and unlocking take forever - * with video memory surfaces. In addition, - * video memory is a somewhat scarce resource, - * so you shouldn't be allocating video memory when - * you have the option of using system memory instead. - */ - ZeroMemory (&ddsd, sizeof (ddsd)); - ddsd.dwSize = sizeof (ddsd); - ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH; - ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY; - ddsd.dwHeight = pScreenInfo->dwHeight; - ddsd.dwWidth = pScreenInfo->dwWidth; - - /* Create the shadow surface */ - ddrval = IDirectDraw2_CreateSurface (pScreenPriv->pdd2, - &ddsd, - &pScreenPriv->pddsShadow, - NULL); - if (FAILED (ddrval)) - { - ErrorF ("winAllocateFBShadowDD - Could not create shadow "\ - "surface: %08x\n", (unsigned int) ddrval); - return FALSE; - } - -#if CYGDEBUG - winDebug ("winAllocateFBShadowDD - Created shadow\n"); -#endif - - /* Allocate a DD surface description for our screen privates */ - pddsdShadow = pScreenPriv->pddsdShadow = malloc (sizeof (DDSURFACEDESC)); - if (pddsdShadow == NULL) - { - ErrorF ("winAllocateFBShadowDD - Could not allocate surface "\ - "description memory\n"); - return FALSE; - } - ZeroMemory (pddsdShadow, sizeof (*pddsdShadow)); - pddsdShadow->dwSize = sizeof (*pddsdShadow); - -#if CYGDEBUG - winDebug ("winAllocateFBShadowDD - Locking shadow\n"); -#endif - - /* Lock the shadow surface */ - ddrval = IDirectDrawSurface2_Lock (pScreenPriv->pddsShadow, - NULL, - pddsdShadow, - DDLOCK_WAIT, - NULL); - if (FAILED (ddrval) || pddsdShadow->lpSurface == NULL) - { - ErrorF ("winAllocateFBShadowDD - Could not lock shadow "\ - "surface: %08x\n", (unsigned int) ddrval); - return FALSE; - } - -#if CYGDEBUG - winDebug ("winAllocateFBShadowDD - Locked shadow\n"); -#endif - - /* We don't know how to deal with anything other than RGB */ - if (!(pddsdShadow->ddpfPixelFormat.dwFlags & DDPF_RGB)) - { - ErrorF ("winAllocateFBShadowDD - Color format other than RGB\n"); - return FALSE; - } - - /* Grab the pitch from the surface desc */ - pScreenInfo->dwStride = (pddsdShadow->u1.lPitch * 8) - / pScreenInfo->dwBPP; - - /* Save the pointer to our surface memory */ - pScreenInfo->pfb = pddsdShadow->lpSurface; - - /* Grab the color depth and masks from the surface description */ - pScreenPriv->dwRedMask = pddsdShadow->ddpfPixelFormat.u2.dwRBitMask; - pScreenPriv->dwGreenMask = pddsdShadow->ddpfPixelFormat.u3.dwGBitMask; - pScreenPriv->dwBlueMask = pddsdShadow->ddpfPixelFormat.u4.dwBBitMask; - -#if CYGDEBUG - winDebug ("winAllocateFBShadowDD - Returning\n"); -#endif - - return TRUE; -} - -static void -winFreeFBShadowDD (ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - - /* Free the shadow surface, if there is one */ - if (pScreenPriv->pddsShadow) - { - IDirectDrawSurface2_Unlock (pScreenPriv->pddsShadow, NULL); - IDirectDrawSurface2_Release (pScreenPriv->pddsShadow); - pScreenPriv->pddsShadow = NULL; - } - - /* Detach the clipper from the primary surface and release the primary surface, if there is one */ - winReleasePrimarySurfaceShadowDD(pScreen); - - /* Release the clipper object */ - if (pScreenPriv->pddcPrimary) - { - IDirectDrawClipper_Release (pScreenPriv->pddcPrimary); - pScreenPriv->pddcPrimary = NULL; - } - - /* Free the DirectDraw2 object, if there is one */ - if (pScreenPriv->pdd2) - { - IDirectDraw2_RestoreDisplayMode (pScreenPriv->pdd2); - IDirectDraw2_Release (pScreenPriv->pdd2); - pScreenPriv->pdd2 = NULL; - } - - /* Free the DirectDraw object, if there is one */ - if (pScreenPriv->pdd) - { - IDirectDraw_Release (pScreenPriv->pdd); - pScreenPriv->pdd = NULL; - } - - /* Invalidate the ScreenInfo's fb pointer */ - pScreenInfo->pfb = NULL; -} - -/* - * Transfer the damaged regions of the shadow framebuffer to the display. - */ - -static void -winShadowUpdateDD (ScreenPtr pScreen, - shadowBufPtr pBuf) -{ - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - RegionPtr damage = shadowDamage(pBuf); - HRESULT ddrval = DD_OK; - RECT rcDest, rcSrc; - POINT ptOrigin; - DWORD dwBox = RegionNumRects (damage); - BoxPtr pBox = RegionRects (damage); - HRGN hrgnTemp = NULL, hrgnCombined = NULL; - - /* - * Return immediately if the app is not active - * and we are fullscreen, or if we have a bad display depth - */ - if ((!pScreenPriv->fActive && pScreenInfo->fFullScreen) - || pScreenPriv->fBadDepth) return; - - /* Return immediately if we didn't get needed surfaces */ - if (!pScreenPriv->pddsPrimary || !pScreenPriv->pddsShadow) - return; - - /* Get the origin of the window in the screen coords */ - ptOrigin.x = pScreenInfo->dwXOffset; - ptOrigin.y = pScreenInfo->dwYOffset; - MapWindowPoints (pScreenPriv->hwndScreen, - HWND_DESKTOP, - (LPPOINT)&ptOrigin, 1); - - /* Unlock the shadow surface, so we can blit */ - ddrval = IDirectDrawSurface2_Unlock (pScreenPriv->pddsShadow, NULL); - if (FAILED (ddrval)) - { - ErrorF ("winShadowUpdateDD - Unlock failed\n"); - return; - } - - /* - * Handle small regions with multiple blits, - * handle large regions by creating a clipping region and - * doing a single blit constrained to that clipping region. - */ - if (pScreenInfo->dwClipUpdatesNBoxes == 0 - || dwBox < pScreenInfo->dwClipUpdatesNBoxes) - { - /* Loop through all boxes in the damaged region */ - while (dwBox--) - { - /* Assign damage box to source rectangle */ - rcSrc.left = pBox->x1; - rcSrc.top = pBox->y1; - rcSrc.right = pBox->x2; - rcSrc.bottom = pBox->y2; - - /* Calculate destination rectange */ - rcDest.left = ptOrigin.x + rcSrc.left; - rcDest.top = ptOrigin.y + rcSrc.top; - rcDest.right = ptOrigin.x + rcSrc.right; - rcDest.bottom = ptOrigin.y + rcSrc.bottom; - - /* Blit the damaged areas */ - ddrval = IDirectDrawSurface2_Blt (pScreenPriv->pddsPrimary, - &rcDest, - pScreenPriv->pddsShadow, - &rcSrc, - DDBLT_WAIT, - NULL); - - /* Get a pointer to the next box */ - ++pBox; - } - } - else - { - BoxPtr pBoxExtents = RegionExtents(damage); - - /* Compute a GDI region from the damaged region */ - hrgnCombined = CreateRectRgn (pBox->x1, pBox->y1, pBox->x2, pBox->y2); - dwBox--; - pBox++; - while (dwBox--) - { - hrgnTemp = CreateRectRgn (pBox->x1, pBox->y1, pBox->x2, pBox->y2); - CombineRgn (hrgnCombined, hrgnCombined, hrgnTemp, RGN_OR); - DeleteObject (hrgnTemp); - pBox++; - } - - /* Install the GDI region as a clipping region */ - SelectClipRgn (pScreenPriv->hdcScreen, hrgnCombined); - DeleteObject (hrgnCombined); - hrgnCombined = NULL; - - /* Calculating a bounding box for the source is easy */ - rcSrc.left = pBoxExtents->x1; - rcSrc.top = pBoxExtents->y1; - rcSrc.right = pBoxExtents->x2; - rcSrc.bottom = pBoxExtents->y2; - - /* Calculating a bounding box for the destination is trickier */ - rcDest.left = ptOrigin.x + rcSrc.left; - rcDest.top = ptOrigin.y + rcSrc.top; - rcDest.right = ptOrigin.x + rcSrc.right; - rcDest.bottom = ptOrigin.y + rcSrc.bottom; - - /* Our Blt should be clipped to the invalidated region */ - ddrval = IDirectDrawSurface2_Blt (pScreenPriv->pddsPrimary, - &rcDest, - pScreenPriv->pddsShadow, - &rcSrc, - DDBLT_WAIT, - NULL); - - /* Reset the clip region */ - SelectClipRgn (pScreenPriv->hdcScreen, NULL); - } - - /* Relock the shadow surface */ - ddrval = IDirectDrawSurface2_Lock (pScreenPriv->pddsShadow, - NULL, - pScreenPriv->pddsdShadow, - DDLOCK_WAIT, - NULL); - if (FAILED (ddrval)) - { - ErrorF ("winShadowUpdateDD - Lock failed\n"); - return; - } - - /* Has our memory pointer changed? */ - if (pScreenInfo->pfb != pScreenPriv->pddsdShadow->lpSurface) - { - ErrorF ("winShadowUpdateDD - Memory location of the shadow " - "surface has changed, trying to update the root window " - "pixmap header to point to the new address. If you get " - "this message and "PROJECT_NAME" freezes or crashes " - "after this message then send a problem report and your " - "%s file to " BUILDERADDR "\n", g_pszLogFile); - - /* Location of shadow framebuffer has changed */ - winUpdateFBPointer(pScreen, pScreenPriv->pddsdShadow->lpSurface); - } -} - -static Bool -winInitScreenShadowDD (ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - - /* Get a device context for the screen */ - pScreenPriv->hdcScreen = GetDC (pScreenPriv->hwndScreen); - - return winAllocateFBShadowDD(pScreen); -} - -/* - * Call the wrapped CloseScreen function. - * - * Free our resources and private structures. - */ - -static Bool -winCloseScreenShadowDD (int nIndex, ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - Bool fReturn; - -#if CYGDEBUG - winDebug ("winCloseScreenShadowDD - Freeing screen resources\n"); -#endif - - /* Flag that the screen is closed */ - pScreenPriv->fClosed = TRUE; - pScreenPriv->fActive = FALSE; - - /* Call the wrapped CloseScreen procedure */ - WIN_UNWRAP(CloseScreen); - if (pScreen->CloseScreen) - fReturn = (*pScreen->CloseScreen) (nIndex, pScreen); - - winFreeFBShadowDD(pScreen); - - /* Free the screen DC */ - ReleaseDC (pScreenPriv->hwndScreen, pScreenPriv->hdcScreen); - - /* Delete the window property */ - RemoveProp (pScreenPriv->hwndScreen, WIN_SCR_PROP); - - /* Delete tray icon, if we have one */ - if (!pScreenInfo->fNoTrayIcon) - winDeleteNotifyIcon (pScreenPriv); - - /* Free the exit confirmation dialog box, if it exists */ - if (g_hDlgExit != NULL) - { - DestroyWindow (g_hDlgExit); - g_hDlgExit = NULL; - } - - /* Kill our window */ - if (pScreenPriv->hwndScreen) - { - DestroyWindow (pScreenPriv->hwndScreen); - pScreenPriv->hwndScreen = NULL; - } - -#if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW) - /* Destroy the thread startup mutex */ - pthread_mutex_destroy (&pScreenPriv->pmServerStarted); -#endif - - /* Kill our screeninfo's pointer to the screen */ - pScreenInfo->pScreen = NULL; - - /* Free the screen privates for this screen */ - free ((pointer) pScreenPriv); - - return fReturn; -} - - -/* - * Tell mi what sort of visuals we need. - * - * Generally we only need one visual, as our screen can only - * handle one format at a time, I believe. You may want - * to verify that last sentence. - */ - -static Bool -winInitVisualsShadowDD (ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - DWORD dwRedBits, dwGreenBits, dwBlueBits; - - /* Count the number of ones in each color mask */ - dwRedBits = winCountBits (pScreenPriv->dwRedMask); - dwGreenBits = winCountBits (pScreenPriv->dwGreenMask); - dwBlueBits = winCountBits (pScreenPriv->dwBlueMask); - - /* Store the maximum number of ones in a color mask as the bitsPerRGB */ - if (dwRedBits == 0 || dwGreenBits == 0 || dwBlueBits == 0) - pScreenPriv->dwBitsPerRGB = 8; - else if (dwRedBits > dwGreenBits && dwRedBits > dwBlueBits) - pScreenPriv->dwBitsPerRGB = dwRedBits; - else if (dwGreenBits > dwRedBits && dwGreenBits > dwBlueBits) - pScreenPriv->dwBitsPerRGB = dwGreenBits; - else - pScreenPriv->dwBitsPerRGB = dwBlueBits; - - ErrorF ("winInitVisualsShadowDD - Masks %08x %08x %08x BPRGB %d d %d " - "bpp %d\n", - (unsigned int) pScreenPriv->dwRedMask, - (unsigned int) pScreenPriv->dwGreenMask, - (unsigned int) pScreenPriv->dwBlueMask, - (int) pScreenPriv->dwBitsPerRGB, - (int) pScreenInfo->dwDepth, - (int) pScreenInfo->dwBPP); - - /* Create a single visual according to the Windows screen depth */ - switch (pScreenInfo->dwDepth) - { - case 24: - case 16: - case 15: - /* Create the real visual */ - if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth, - TrueColorMask, - pScreenPriv->dwBitsPerRGB, - TrueColor, - pScreenPriv->dwRedMask, - pScreenPriv->dwGreenMask, - pScreenPriv->dwBlueMask)) - { - ErrorF ("winInitVisualsShadowDD - miSetVisualTypesAndMasks " - "failed for TrueColor\n"); - return FALSE; - } - -#ifdef XWIN_EMULATEPSEUDO - if (!pScreenInfo->fEmulatePseudo) - break; - - /* Setup a pseudocolor visual */ - if (!miSetVisualTypesAndMasks (8, - PseudoColorMask, - 8, - -1, - 0, - 0, - 0)) - { - ErrorF ("winInitVisualsShadowDD - miSetVisualTypesAndMasks " - "failed for PseudoColor\n"); - return FALSE; - } -#endif - break; - - case 8: - if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth, - pScreenInfo->fFullScreen - ? PseudoColorMask : StaticColorMask, - pScreenPriv->dwBitsPerRGB, - pScreenInfo->fFullScreen - ? PseudoColor : StaticColor, - pScreenPriv->dwRedMask, - pScreenPriv->dwGreenMask, - pScreenPriv->dwBlueMask)) - { - ErrorF ("winInitVisualsShadowDD - miSetVisualTypesAndMasks " - "failed\n"); - return FALSE; - } - break; - - default: - ErrorF ("winInitVisualsShadowDD - Unknown screen depth\n"); - return FALSE; - } - -#if CYGDEBUG - winDebug ("winInitVisualsShadowDD - Returning\n"); -#endif - - return TRUE; -} - - -/* - * Adjust the user proposed video mode - */ - -static Bool -winAdjustVideoModeShadowDD (ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - HDC hdc = NULL; - DWORD dwBPP; - - /* We're in serious trouble if we can't get a DC */ - hdc = GetDC (NULL); - if (hdc == NULL) - { - ErrorF ("winAdjustVideoModeShadowDD - GetDC () failed\n"); - return FALSE; - } - - /* Query GDI for current display depth */ - dwBPP = GetDeviceCaps (hdc, BITSPIXEL); - - /* DirectDraw can only change the depth in fullscreen mode */ - if (!(pScreenInfo->fFullScreen && - (pScreenInfo->dwBPP != WIN_DEFAULT_BPP))) - { - /* Otherwise, We'll use GDI's depth */ - pScreenInfo->dwBPP = dwBPP; - } - - /* Release our DC */ - ReleaseDC (NULL, hdc); - return TRUE; -} - - -/* - * Blt exposed regions to the screen - */ - -static Bool -winBltExposedRegionsShadowDD (ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - RECT rcSrc, rcDest; - POINT ptOrigin; - HDC hdcUpdate = NULL; - PAINTSTRUCT ps; - HRESULT ddrval = DD_OK; - Bool fReturn = TRUE; - Bool fLocked = TRUE; - int i; - - /* BeginPaint gives us an hdc that clips to the invalidated region */ - hdcUpdate = BeginPaint (pScreenPriv->hwndScreen, &ps); - if (hdcUpdate == NULL) - { - ErrorF ("winBltExposedRegionsShadowDD - BeginPaint () returned " - "a NULL device context handle. Aborting blit attempt.\n"); - return FALSE; - } - - /* Unlock the shadow surface, so we can blit */ - ddrval = IDirectDrawSurface2_Unlock (pScreenPriv->pddsShadow, NULL); - if (FAILED (ddrval)) - { - fReturn = FALSE; - goto winBltExposedRegionsShadowDD_Exit; - } - else - { - /* Flag that we have unlocked the shadow surface */ - fLocked = FALSE; - } - - /* Get the origin of the window in the screen coords */ - ptOrigin.x = pScreenInfo->dwXOffset; - ptOrigin.y = pScreenInfo->dwYOffset; - - MapWindowPoints (pScreenPriv->hwndScreen, - HWND_DESKTOP, - (LPPOINT)&ptOrigin, 1); - rcDest.left = ptOrigin.x; - rcDest.right = ptOrigin.x + pScreenInfo->dwWidth; - rcDest.top = ptOrigin.y; - rcDest.bottom = ptOrigin.y + pScreenInfo->dwHeight; - - /* Source can be enter shadow surface, as Blt should clip */ - rcSrc.left = 0; - rcSrc.top = 0; - rcSrc.right = pScreenInfo->dwWidth; - rcSrc.bottom = pScreenInfo->dwHeight; - - /* Try to regain the primary surface and blit again if we've lost it */ - for (i = 0; i <= WIN_REGAIN_SURFACE_RETRIES; ++i) - { - /* Our Blt should be clipped to the invalidated region */ - ddrval = IDirectDrawSurface2_Blt (pScreenPriv->pddsPrimary, - &rcDest, - pScreenPriv->pddsShadow, - &rcSrc, - DDBLT_WAIT, - NULL); - if (ddrval == DDERR_SURFACELOST) - { - /* Surface was lost */ - ErrorF ("winBltExposedRegionsShadowDD - IDirectDrawSurface2_Blt " - "reported that the primary surface was lost, " - "trying to restore, retry: %d\n", i + 1); - - /* Try to restore the surface, once */ - ddrval = IDirectDrawSurface2_Restore (pScreenPriv->pddsPrimary); - ErrorF ("winBltExposedRegionsShadowDD - " - "IDirectDrawSurface2_Restore returned: "); - if (ddrval == DD_OK) - ErrorF ("DD_OK\n"); - else if (ddrval == DDERR_WRONGMODE) - ErrorF ("DDERR_WRONGMODE\n"); - else if (ddrval == DDERR_INCOMPATIBLEPRIMARY) - ErrorF ("DDERR_INCOMPATIBLEPRIMARY\n"); - else if (ddrval == DDERR_UNSUPPORTED) - ErrorF ("DDERR_UNSUPPORTED\n"); - else if (ddrval == DDERR_INVALIDPARAMS) - ErrorF ("DDERR_INVALIDPARAMS\n"); - else if (ddrval == DDERR_INVALIDOBJECT) - ErrorF ("DDERR_INVALIDOBJECT\n"); - else - ErrorF ("unknown error: %08x\n", (unsigned int) ddrval); - - /* Loop around to try the blit one more time */ - continue; - } - else if (FAILED (ddrval)) - { - fReturn = FALSE; - ErrorF ("winBltExposedRegionsShadowDD - IDirectDrawSurface2_Blt " - "failed, but surface not lost: %08x %d\n", - (unsigned int) ddrval, (int) ddrval); - goto winBltExposedRegionsShadowDD_Exit; - } - else - { - /* Success, stop looping */ - break; - } - } - - /* Relock the shadow surface */ - ddrval = IDirectDrawSurface2_Lock (pScreenPriv->pddsShadow, - NULL, - pScreenPriv->pddsdShadow, - DDLOCK_WAIT, - NULL); - if (FAILED (ddrval)) - { - fReturn = FALSE; - ErrorF ("winBltExposedRegionsShadowDD - IDirectDrawSurface2_Lock " - "failed\n"); - goto winBltExposedRegionsShadowDD_Exit; - } - else - { - /* Indicate that we have relocked the shadow surface */ - fLocked = TRUE; - } - - /* Has our memory pointer changed? */ - if (pScreenInfo->pfb != pScreenPriv->pddsdShadow->lpSurface) - winUpdateFBPointer (pScreen, - pScreenPriv->pddsdShadow->lpSurface); - - winBltExposedRegionsShadowDD_Exit: - /* EndPaint frees the DC */ - if (hdcUpdate != NULL) - EndPaint (pScreenPriv->hwndScreen, &ps); - - /* - * Relock the surface if it is not locked. We don't care if locking fails, - * as it will cause the server to shutdown within a few more operations. - */ - if (!fLocked) - { - IDirectDrawSurface2_Lock (pScreenPriv->pddsShadow, - NULL, - pScreenPriv->pddsdShadow, - DDLOCK_WAIT, - NULL); - - /* Has our memory pointer changed? */ - if (pScreenInfo->pfb != pScreenPriv->pddsdShadow->lpSurface) - winUpdateFBPointer (pScreen, - pScreenPriv->pddsdShadow->lpSurface); - - fLocked = TRUE; - } - return fReturn; -} - - -/* - * Do any engine-specific appliation-activation processing - */ - -static Bool -winActivateAppShadowDD (ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - - /* - * Do we have a surface? - * Are we active? - * Are we fullscreen? - */ - if (pScreenPriv != NULL - && pScreenPriv->pddsPrimary != NULL - && pScreenPriv->fActive) - { - /* Primary surface was lost, restore it */ - IDirectDrawSurface2_Restore (pScreenPriv->pddsPrimary); - } - - return TRUE; -} - - -/* - * Reblit the shadow framebuffer to the screen. - */ - -static Bool -winRedrawScreenShadowDD (ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - HRESULT ddrval = DD_OK; - RECT rcSrc, rcDest; - POINT ptOrigin; - - /* Get the origin of the window in the screen coords */ - ptOrigin.x = pScreenInfo->dwXOffset; - ptOrigin.y = pScreenInfo->dwYOffset; - MapWindowPoints (pScreenPriv->hwndScreen, - HWND_DESKTOP, - (LPPOINT)&ptOrigin, 1); - rcDest.left = ptOrigin.x; - rcDest.right = ptOrigin.x + pScreenInfo->dwWidth; - rcDest.top = ptOrigin.y; - rcDest.bottom = ptOrigin.y + pScreenInfo->dwHeight; - - /* Source can be entire shadow surface, as Blt should clip for us */ - rcSrc.left = 0; - rcSrc.top = 0; - rcSrc.right = pScreenInfo->dwWidth; - rcSrc.bottom = pScreenInfo->dwHeight; - - /* Redraw the whole window, to take account for the new colors */ - ddrval = IDirectDrawSurface2_Blt (pScreenPriv->pddsPrimary, - &rcDest, - pScreenPriv->pddsShadow, - &rcSrc, - DDBLT_WAIT, - NULL); - if (FAILED (ddrval)) - { - ErrorF ("winRedrawScreenShadowDD - IDirectDrawSurface_Blt () " - "failed: %08x\n", - (unsigned int) ddrval); - } - - return TRUE; -} - - -/* - * Realize the currently installed colormap - */ - -static Bool -winRealizeInstalledPaletteShadowDD (ScreenPtr pScreen) -{ - return TRUE; -} - - -/* - * Install the specified colormap - */ - -static Bool -winInstallColormapShadowDD (ColormapPtr pColormap) -{ - ScreenPtr pScreen = pColormap->pScreen; - winScreenPriv(pScreen); - winCmapPriv(pColormap); - HRESULT ddrval = DD_OK; - - /* Install the DirectDraw palette on the primary surface */ - ddrval = IDirectDrawSurface2_SetPalette (pScreenPriv->pddsPrimary, - pCmapPriv->lpDDPalette); - if (FAILED (ddrval)) - { - ErrorF ("winInstallColormapShadowDD - Failed installing the " - "DirectDraw palette.\n"); - return FALSE; - } - - /* Save a pointer to the newly installed colormap */ - pScreenPriv->pcmapInstalled = pColormap; - - return TRUE; -} - - -/* - * Store the specified colors in the specified colormap - */ - -static Bool -winStoreColorsShadowDD (ColormapPtr pColormap, - int ndef, - xColorItem *pdefs) -{ - ScreenPtr pScreen = pColormap->pScreen; - winScreenPriv(pScreen); - winCmapPriv(pColormap); - ColormapPtr curpmap = pScreenPriv->pcmapInstalled; - HRESULT ddrval = DD_OK; - - /* Put the X colormap entries into the Windows logical palette */ - ddrval = IDirectDrawPalette_SetEntries (pCmapPriv->lpDDPalette, - 0, - pdefs[0].pixel, - ndef, - pCmapPriv->peColors - + pdefs[0].pixel); - if (FAILED (ddrval)) - { - ErrorF ("winStoreColorsShadowDD - SetEntries () failed\n"); - return FALSE; - } - - /* Don't install the DirectDraw palette if the colormap is not installed */ - if (pColormap != curpmap) - { - return TRUE; - } - - if (!winInstallColormapShadowDD (pColormap)) - { - ErrorF ("winStoreColorsShadowDD - Failed installing colormap\n"); - return FALSE; - } - - return TRUE; -} - - -/* - * Colormap initialization procedure - */ - -static Bool -winCreateColormapShadowDD (ColormapPtr pColormap) -{ - HRESULT ddrval = DD_OK; - ScreenPtr pScreen = pColormap->pScreen; - winScreenPriv(pScreen); - winCmapPriv(pColormap); - - /* Create a DirectDraw palette */ - ddrval = IDirectDraw2_CreatePalette (pScreenPriv->pdd, - DDPCAPS_8BIT | DDPCAPS_ALLOW256, - pCmapPriv->peColors, - &pCmapPriv->lpDDPalette, - NULL); - if (FAILED (ddrval)) - { - ErrorF ("winCreateColormapShadowDD - CreatePalette failed\n"); - return FALSE; - } - - return TRUE; -} - - -/* - * Colormap destruction procedure - */ - -static Bool -winDestroyColormapShadowDD (ColormapPtr pColormap) -{ - winScreenPriv(pColormap->pScreen); - winCmapPriv(pColormap); - HRESULT ddrval = DD_OK; - - /* - * Is colormap to be destroyed the default? - * - * Non-default colormaps should have had winUninstallColormap - * called on them before we get here. The default colormap - * will not have had winUninstallColormap called on it. Thus, - * we need to handle the default colormap in a special way. - */ - if (pColormap->flags & IsDefault) - { -#if CYGDEBUG - winDebug ("winDestroyColormapShadowDD - Destroying default " - "colormap\n"); -#endif - - /* - * FIXME: Walk the list of all screens, popping the default - * palette out of each screen device context. - */ - - /* Pop the palette out of the primary surface */ - ddrval = IDirectDrawSurface2_SetPalette (pScreenPriv->pddsPrimary, - NULL); - if (FAILED (ddrval)) - { - ErrorF ("winDestroyColormapShadowDD - Failed freeing the " - "default colormap DirectDraw palette.\n"); - return FALSE; - } - - /* Clear our private installed colormap pointer */ - pScreenPriv->pcmapInstalled = NULL; - } - - /* Release the palette */ - IDirectDrawPalette_Release (pCmapPriv->lpDDPalette); - - /* Invalidate the colormap privates */ - pCmapPriv->lpDDPalette = NULL; - - return TRUE; -} - - -/* - * Set engine specific functions - */ - -Bool -winSetEngineFunctionsShadowDD (ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - - /* Set our pointers */ - pScreenPriv->pwinAllocateFB = winAllocateFBShadowDD; - pScreenPriv->pwinFreeFB = winFreeFBShadowDD; - pScreenPriv->pwinShadowUpdate = winShadowUpdateDD; - pScreenPriv->pwinInitScreen = winInitScreenShadowDD; - pScreenPriv->pwinCloseScreen = winCloseScreenShadowDD; - pScreenPriv->pwinInitVisuals = winInitVisualsShadowDD; - pScreenPriv->pwinAdjustVideoMode = winAdjustVideoModeShadowDD; - if (pScreenInfo->fFullScreen) - pScreenPriv->pwinCreateBoundingWindow = winCreateBoundingWindowFullScreen; - else - pScreenPriv->pwinCreateBoundingWindow = winCreateBoundingWindowWindowed; - pScreenPriv->pwinFinishScreenInit = winFinishScreenInitFB; - pScreenPriv->pwinBltExposedRegions = winBltExposedRegionsShadowDD; - pScreenPriv->pwinActivateApp = winActivateAppShadowDD; - pScreenPriv->pwinRedrawScreen = winRedrawScreenShadowDD; - pScreenPriv->pwinRealizeInstalledPalette - = winRealizeInstalledPaletteShadowDD; - pScreenPriv->pwinInstallColormap = winInstallColormapShadowDD; - pScreenPriv->pwinStoreColors = winStoreColorsShadowDD; - pScreenPriv->pwinCreateColormap = winCreateColormapShadowDD; - pScreenPriv->pwinDestroyColormap = winDestroyColormapShadowDD; - pScreenPriv->pwinHotKeyAltTab = (winHotKeyAltTabProcPtr) (void (*)(void))NoopDDA; - pScreenPriv->pwinCreatePrimarySurface = winCreatePrimarySurfaceShadowDD; - pScreenPriv->pwinReleasePrimarySurface = winReleasePrimarySurfaceShadowDD; -#ifdef XWIN_MULTIWINDOW - pScreenPriv->pwinFinishCreateWindowsWindow = - (winFinishCreateWindowsWindowProcPtr) (void (*)(void))NoopDDA; -#endif - - return TRUE; -} +/*
+ *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
+ *
+ *Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ *"Software"), to deal in the Software without restriction, including
+ *without limitation the rights to use, copy, modify, merge, publish,
+ *distribute, sublicense, and/or sell copies of the Software, and to
+ *permit persons to whom the Software is furnished to do so, subject to
+ *the following conditions:
+ *
+ *The above copyright notice and this permission notice shall be
+ *included in all copies or substantial portions of the Software.
+ *
+ *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
+ *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+ *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Dakshinamurthy Karra
+ * Suhaib M Siddiqi
+ * Peter Busch
+ * Harold L Hunt II
+ */
+
+#ifdef HAVE_XWIN_CONFIG_H
+#include <xwin-config.h>
+#endif
+#include "win.h"
+
+
+/*
+
+
+/*
+ * Local prototypes
+ */
+
+static Bool
+winAllocateFBShadowDD (ScreenPtr pScreen);
+
+static void
+winShadowUpdateDD (ScreenPtr pScreen,
+ shadowBufPtr pBuf);
+
+static Bool
+winCloseScreenShadowDD (int nIndex, ScreenPtr pScreen);
+
+static Bool
+winInitVisualsShadowDD (ScreenPtr pScreen);
+
+static Bool
+winAdjustVideoModeShadowDD (ScreenPtr pScreen);
+
+static Bool
+winBltExposedRegionsShadowDD (ScreenPtr pScreen);
+
+static Bool
+winActivateAppShadowDD (ScreenPtr pScreen);
+
+static Bool
+winRedrawScreenShadowDD (ScreenPtr pScreen);
+
+static Bool
+winRealizeInstalledPaletteShadowDD (ScreenPtr pScreen);
+
+static Bool
+winInstallColormapShadowDD (ColormapPtr pColormap);
+
+static Bool
+winStoreColorsShadowDD (ColormapPtr pmap,
+ int ndef,
+ xColorItem *pdefs);
+
+static Bool
+winCreateColormapShadowDD (ColormapPtr pColormap);
+
+static Bool
+winDestroyColormapShadowDD (ColormapPtr pColormap);
+
+static Bool
+winCreatePrimarySurfaceShadowDD (ScreenPtr pScreen);
+
+static Bool
+winReleasePrimarySurfaceShadowDD (ScreenPtr pScreen);
+
+
+/*
+ * Create the primary surface and attach the clipper.
+ * Used for both the initial surface creation and during
+ * WM_DISPLAYCHANGE messages.
+ */
+
+static Bool
+winCreatePrimarySurfaceShadowDD (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ HRESULT ddrval = DD_OK;
+ DDSURFACEDESC ddsd;
+
+ /* Describe the primary surface */
+ ZeroMemory (&ddsd, sizeof (ddsd));
+ ddsd.dwSize = sizeof (ddsd);
+ ddsd.dwFlags = DDSD_CAPS;
+ ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
+
+ /* Create the primary surface */
+ ddrval = IDirectDraw2_CreateSurface (pScreenPriv->pdd2,
+ &ddsd,
+ &pScreenPriv->pddsPrimary,
+ NULL);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winCreatePrimarySurfaceShadowDD - Could not create primary "
+ "surface: %08x\n", (unsigned int) ddrval);
+ return FALSE;
+ }
+
+ winDebug ("winCreatePrimarySurfaceShadowDD - Created primary surface\n");
+
+ /*
+ * Attach a clipper to the primary surface that will clip our blits to our
+ * display window.
+ */
+ ddrval = IDirectDrawSurface2_SetClipper (pScreenPriv->pddsPrimary,
+ pScreenPriv->pddcPrimary);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winCreatePrimarySurfaceShadowDD - Primary attach clipper "
+ "failed: %08x\n",
+ (unsigned int) ddrval);
+ return FALSE;
+ }
+
+ winDebug ("winCreatePrimarySurfaceShadowDD - Attached clipper to "
+ "primary surface\n");
+
+ /* Everything was correct */
+ return TRUE;
+}
+
+
+/*
+ * Detach the clipper and release the primary surface.
+ * Called from WM_DISPLAYCHANGE.
+ */
+
+static Bool
+winReleasePrimarySurfaceShadowDD (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+
+ winDebug ("winReleasePrimarySurfaceShadowDD - Hello\n");
+
+ /* Release the primary surface and clipper, if they exist */
+ if (pScreenPriv->pddsPrimary)
+ {
+ /*
+ * Detach the clipper from the primary surface.
+ * NOTE: We do this explicity for clarity. The Clipper is not released.
+ */
+ IDirectDrawSurface2_SetClipper (pScreenPriv->pddsPrimary,
+ NULL);
+
+ winDebug ("winReleasePrimarySurfaceShadowDD - Detached clipper\n");
+
+ /* Release the primary surface */
+ IDirectDrawSurface2_Release (pScreenPriv->pddsPrimary);
+ pScreenPriv->pddsPrimary = NULL;
+ }
+
+ winDebug ("winReleasePrimarySurfaceShadowDD - Released primary surface\n");
+
+ return TRUE;
+}
+
+
+/*
+ * Create a DirectDraw surface for the shadow framebuffer; also create
+ * a primary surface object so we can blit to the display.
+ *
+ * Install a DirectDraw clipper on our primary surface object
+ * that clips our blits to the unobscured client area of our display window.
+ */
+
+static Bool
+winAllocateFBShadowDD (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ HRESULT ddrval = DD_OK;
+ DDSURFACEDESC ddsd;
+ DDSURFACEDESC *pddsdShadow = NULL;
+
+ winDebug ("winAllocateFBShadowDD\n");
+
+ /* Create a clipper */
+ ddrval = (*g_fpDirectDrawCreateClipper) (0,
+ &pScreenPriv->pddcPrimary,
+ NULL);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winAllocateFBShadowDD - Could not create clipper: %08x\n",
+ (unsigned int) ddrval);
+ return FALSE;
+ }
+
+ winDebug ("winAllocateFBShadowDD - Created a clipper\n");
+
+ /* Attach the clipper to our display window */
+ ddrval = IDirectDrawClipper_SetHWnd (pScreenPriv->pddcPrimary,
+ 0,
+ pScreenPriv->hwndScreen);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winAllocateFBShadowDD - Clipper not attached to "
+ "window: %08x\n",
+ (unsigned int) ddrval);
+ return FALSE;
+ }
+
+ winDebug ("winAllocateFBShadowDD - Attached clipper to window\n");
+
+ /* Create a DirectDraw object, store the address at lpdd */
+ ddrval = (*g_fpDirectDrawCreate) (NULL, &pScreenPriv->pdd, NULL);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winAllocateFBShadowDD - Could not start DirectDraw: %08x\n",
+ (unsigned int) ddrval);
+ return FALSE;
+ }
+
+ winDebug ("winAllocateFBShadowDD () - Created and initialized DD\n");
+
+ /* Get a DirectDraw2 interface pointer */
+ ddrval = IDirectDraw_QueryInterface (pScreenPriv->pdd,
+ &IID_IDirectDraw2,
+ (LPVOID*) &pScreenPriv->pdd2);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winAllocateFBShadowDD - Failed DD2 query: %08x\n",
+ (unsigned int) ddrval);
+ return FALSE;
+ }
+
+ /* Are we full screen? */
+ if (pScreenInfo->fFullScreen)
+ {
+ DDSURFACEDESC ddsdCurrent;
+ DWORD dwRefreshRateCurrent = 0;
+ HDC hdc = NULL;
+
+ /* Set the cooperative level to full screen */
+ ddrval = IDirectDraw2_SetCooperativeLevel (pScreenPriv->pdd2,
+ pScreenPriv->hwndScreen,
+ DDSCL_EXCLUSIVE
+ | DDSCL_FULLSCREEN);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winAllocateFBShadowDD - Could not set "
+ "cooperative level: %08x\n",
+ (unsigned int) ddrval);
+ return FALSE;
+ }
+
+ /*
+ * We only need to get the current refresh rate for comparison
+ * if a refresh rate has been passed on the command line.
+ */
+ if (pScreenInfo->dwRefreshRate != 0)
+ {
+ ZeroMemory (&ddsdCurrent, sizeof (ddsdCurrent));
+ ddsdCurrent.dwSize = sizeof (ddsdCurrent);
+
+ /* Get information about current display settings */
+ ddrval = IDirectDraw2_GetDisplayMode (pScreenPriv->pdd2,
+ &ddsdCurrent);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winAllocateFBShadowDD - Could not get current "
+ "refresh rate: %08x. Continuing.\n",
+ (unsigned int) ddrval);
+ dwRefreshRateCurrent = 0;
+ }
+ else
+ {
+ /* Grab the current refresh rate */
+ dwRefreshRateCurrent = ddsdCurrent.u2.dwRefreshRate;
+ }
+ }
+
+ /* Clean up the refresh rate */
+ if (dwRefreshRateCurrent == pScreenInfo->dwRefreshRate)
+ {
+ /*
+ * Refresh rate is non-specified or equal to current.
+ */
+ pScreenInfo->dwRefreshRate = 0;
+ }
+
+ /* Grab a device context for the screen */
+ hdc = GetDC (NULL);
+ if (hdc == NULL)
+ {
+ ErrorF ("winAllocateFBShadowDD - GetDC () failed\n");
+ return FALSE;
+ }
+
+ /* Only change the video mode when different than current mode */
+ if (!pScreenInfo->fMultipleMonitors
+ && (pScreenInfo->dwWidth != GetSystemMetrics (SM_CXSCREEN)
+ || pScreenInfo->dwHeight != GetSystemMetrics (SM_CYSCREEN)
+ || pScreenInfo->dwBPP != GetDeviceCaps (hdc, BITSPIXEL)
+ || pScreenInfo->dwRefreshRate != 0))
+ {
+ winDebug ("winAllocateFBShadowDD - Changing video mode\n");
+
+ /* Change the video mode to the mode requested, and use the driver default refresh rate on failure */
+ ddrval = IDirectDraw2_SetDisplayMode (pScreenPriv->pdd2,
+ pScreenInfo->dwWidth,
+ pScreenInfo->dwHeight,
+ pScreenInfo->dwBPP,
+ pScreenInfo->dwRefreshRate,
+ 0);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winAllocateFBShadowDD - Could not set "\
+ "full screen display mode: %08x\n",
+ (unsigned int) ddrval);
+ ErrorF ("winAllocateFBShadowDD - Using default driver refresh rate\n");
+ ddrval = IDirectDraw2_SetDisplayMode (pScreenPriv->pdd2,
+ pScreenInfo->dwWidth,
+ pScreenInfo->dwHeight,
+ pScreenInfo->dwBPP,
+ 0,
+ 0);
+ if (FAILED(ddrval))
+ {
+ ErrorF ("winAllocateFBShadowDD - Could not set default refresh rate "
+ "full screen display mode: %08x\n",
+ (unsigned int) ddrval);
+ return FALSE;
+ }
+ }
+ }
+ else
+ {
+ winDebug ("winAllocateFBShadowDD - Not changing video mode\n");
+ }
+
+ /* Release our DC */
+ ReleaseDC (NULL, hdc);
+ hdc = NULL;
+ }
+ else
+ {
+ /* Set the cooperative level for windowed mode */
+ ddrval = IDirectDraw2_SetCooperativeLevel (pScreenPriv->pdd2,
+ pScreenPriv->hwndScreen,
+ DDSCL_NORMAL);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winAllocateFBShadowDD - Could not set "\
+ "cooperative level: %08x\n",
+ (unsigned int) ddrval);
+ return FALSE;
+ }
+ }
+
+ /* Create the primary surface */
+ if (!winCreatePrimarySurfaceShadowDD (pScreen))
+ {
+ ErrorF ("winAllocateFBShadowDD - winCreatePrimarySurfaceShadowDD "
+ "failed\n");
+ return FALSE;
+ }
+
+ /* Describe the shadow surface to be created */
+ /* NOTE: Do not use a DDSCAPS_VIDEOMEMORY surface,
+ * as drawing, locking, and unlocking take forever
+ * with video memory surfaces. In addition,
+ * video memory is a somewhat scarce resource,
+ * so you shouldn't be allocating video memory when
+ * you have the option of using system memory instead.
+ */
+ ZeroMemory (&ddsd, sizeof (ddsd));
+ ddsd.dwSize = sizeof (ddsd);
+ ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH;
+ ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY;
+ ddsd.dwHeight = pScreenInfo->dwHeight;
+ ddsd.dwWidth = pScreenInfo->dwWidth;
+
+ /* Create the shadow surface */
+ ddrval = IDirectDraw2_CreateSurface (pScreenPriv->pdd2,
+ &ddsd,
+ &pScreenPriv->pddsShadow,
+ NULL);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winAllocateFBShadowDD - Could not create shadow "\
+ "surface: %08x\n", (unsigned int) ddrval);
+ return FALSE;
+ }
+
+ winDebug ("winAllocateFBShadowDD - Created shadow\n");
+
+ /* Allocate a DD surface description for our screen privates */
+ pddsdShadow = pScreenPriv->pddsdShadow = malloc (sizeof (DDSURFACEDESC));
+ if (pddsdShadow == NULL)
+ {
+ ErrorF ("winAllocateFBShadowDD - Could not allocate surface "\
+ "description memory\n");
+ return FALSE;
+ }
+ ZeroMemory (pddsdShadow, sizeof (*pddsdShadow));
+ pddsdShadow->dwSize = sizeof (*pddsdShadow);
+
+ winDebug ("winAllocateFBShadowDD - Locking shadow\n");
+
+ /* Lock the shadow surface */
+ ddrval = IDirectDrawSurface2_Lock (pScreenPriv->pddsShadow,
+ NULL,
+ pddsdShadow,
+ DDLOCK_WAIT,
+ NULL);
+ if (FAILED (ddrval) || pddsdShadow->lpSurface == NULL)
+ {
+ ErrorF ("winAllocateFBShadowDD - Could not lock shadow "\
+ "surface: %08x\n", (unsigned int) ddrval);
+ return FALSE;
+ }
+
+ winDebug ("winAllocateFBShadowDD - Locked shadow\n");
+
+ /* We don't know how to deal with anything other than RGB */
+ if (!(pddsdShadow->ddpfPixelFormat.dwFlags & DDPF_RGB))
+ {
+ ErrorF ("winAllocateFBShadowDD - Color format other than RGB\n");
+ return FALSE;
+ }
+
+ /* Grab the pitch from the surface desc */
+ pScreenInfo->dwStride = (pddsdShadow->u1.lPitch * 8)
+ / pScreenInfo->dwBPP;
+
+ /* Save the pointer to our surface memory */
+ pScreenInfo->pfb = pddsdShadow->lpSurface;
+
+ /* Grab the color depth and masks from the surface description */
+ pScreenPriv->dwRedMask = pddsdShadow->ddpfPixelFormat.u2.dwRBitMask;
+ pScreenPriv->dwGreenMask = pddsdShadow->ddpfPixelFormat.u3.dwGBitMask;
+ pScreenPriv->dwBlueMask = pddsdShadow->ddpfPixelFormat.u4.dwBBitMask;
+
+ winDebug ("winAllocateFBShadowDD - Returning\n");
+
+ return TRUE;
+}
+
+static void
+winFreeFBShadowDD (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+
+ /* Free the shadow surface, if there is one */
+ if (pScreenPriv->pddsShadow)
+ {
+ IDirectDrawSurface2_Unlock (pScreenPriv->pddsShadow, NULL);
+ IDirectDrawSurface2_Release (pScreenPriv->pddsShadow);
+ pScreenPriv->pddsShadow = NULL;
+ }
+
+ /* Detach the clipper from the primary surface and release the primary surface, if there is one */
+ winReleasePrimarySurfaceShadowDD(pScreen);
+
+ /* Release the clipper object */
+ if (pScreenPriv->pddcPrimary)
+ {
+ IDirectDrawClipper_Release (pScreenPriv->pddcPrimary);
+ pScreenPriv->pddcPrimary = NULL;
+ }
+
+ /* Free the DirectDraw2 object, if there is one */
+ if (pScreenPriv->pdd2)
+ {
+ IDirectDraw2_RestoreDisplayMode (pScreenPriv->pdd2);
+ IDirectDraw2_Release (pScreenPriv->pdd2);
+ pScreenPriv->pdd2 = NULL;
+ }
+
+ /* Free the DirectDraw object, if there is one */
+ if (pScreenPriv->pdd)
+ {
+ IDirectDraw_Release (pScreenPriv->pdd);
+ pScreenPriv->pdd = NULL;
+ }
+
+ /* Invalidate the ScreenInfo's fb pointer */
+ pScreenInfo->pfb = NULL;
+}
+
+/*
+ * Transfer the damaged regions of the shadow framebuffer to the display.
+ */
+
+static void
+winShadowUpdateDD (ScreenPtr pScreen,
+ shadowBufPtr pBuf)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ RegionPtr damage = shadowDamage(pBuf);
+ HRESULT ddrval = DD_OK;
+ RECT rcDest, rcSrc;
+ POINT ptOrigin;
+ DWORD dwBox = RegionNumRects (damage);
+ BoxPtr pBox = RegionRects (damage);
+ HRGN hrgnTemp = NULL, hrgnCombined = NULL;
+
+ /*
+ * Return immediately if the app is not active
+ * and we are fullscreen, or if we have a bad display depth
+ */
+ if ((!pScreenPriv->fActive && pScreenInfo->fFullScreen)
+ || pScreenPriv->fBadDepth) return;
+
+ /* Return immediately if we didn't get needed surfaces */
+ if (!pScreenPriv->pddsPrimary || !pScreenPriv->pddsShadow)
+ return;
+
+ /* Get the origin of the window in the screen coords */
+ ptOrigin.x = pScreenInfo->dwXOffset;
+ ptOrigin.y = pScreenInfo->dwYOffset;
+ MapWindowPoints (pScreenPriv->hwndScreen,
+ HWND_DESKTOP,
+ (LPPOINT)&ptOrigin, 1);
+
+ /* Unlock the shadow surface, so we can blit */
+ ddrval = IDirectDrawSurface2_Unlock (pScreenPriv->pddsShadow, NULL);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winShadowUpdateDD - Unlock failed\n");
+ return;
+ }
+
+ /*
+ * Handle small regions with multiple blits,
+ * handle large regions by creating a clipping region and
+ * doing a single blit constrained to that clipping region.
+ */
+ if (pScreenInfo->dwClipUpdatesNBoxes == 0
+ || dwBox < pScreenInfo->dwClipUpdatesNBoxes)
+ {
+ /* Loop through all boxes in the damaged region */
+ while (dwBox--)
+ {
+ /* Assign damage box to source rectangle */
+ rcSrc.left = pBox->x1;
+ rcSrc.top = pBox->y1;
+ rcSrc.right = pBox->x2;
+ rcSrc.bottom = pBox->y2;
+
+ /* Calculate destination rectange */
+ rcDest.left = ptOrigin.x + rcSrc.left;
+ rcDest.top = ptOrigin.y + rcSrc.top;
+ rcDest.right = ptOrigin.x + rcSrc.right;
+ rcDest.bottom = ptOrigin.y + rcSrc.bottom;
+
+ /* Blit the damaged areas */
+ ddrval = IDirectDrawSurface2_Blt (pScreenPriv->pddsPrimary,
+ &rcDest,
+ pScreenPriv->pddsShadow,
+ &rcSrc,
+ DDBLT_WAIT,
+ NULL);
+
+ /* Get a pointer to the next box */
+ ++pBox;
+ }
+ }
+ else
+ {
+ BoxPtr pBoxExtents = RegionExtents(damage);
+
+ /* Compute a GDI region from the damaged region */
+ hrgnCombined = CreateRectRgn (pBox->x1, pBox->y1, pBox->x2, pBox->y2);
+ dwBox--;
+ pBox++;
+ while (dwBox--)
+ {
+ hrgnTemp = CreateRectRgn (pBox->x1, pBox->y1, pBox->x2, pBox->y2);
+ CombineRgn (hrgnCombined, hrgnCombined, hrgnTemp, RGN_OR);
+ DeleteObject (hrgnTemp);
+ pBox++;
+ }
+
+ /* Install the GDI region as a clipping region */
+ SelectClipRgn (pScreenPriv->hdcScreen, hrgnCombined);
+ DeleteObject (hrgnCombined);
+ hrgnCombined = NULL;
+
+ /* Calculating a bounding box for the source is easy */
+ rcSrc.left = pBoxExtents->x1;
+ rcSrc.top = pBoxExtents->y1;
+ rcSrc.right = pBoxExtents->x2;
+ rcSrc.bottom = pBoxExtents->y2;
+
+ /* Calculating a bounding box for the destination is trickier */
+ rcDest.left = ptOrigin.x + rcSrc.left;
+ rcDest.top = ptOrigin.y + rcSrc.top;
+ rcDest.right = ptOrigin.x + rcSrc.right;
+ rcDest.bottom = ptOrigin.y + rcSrc.bottom;
+
+ /* Our Blt should be clipped to the invalidated region */
+ ddrval = IDirectDrawSurface2_Blt (pScreenPriv->pddsPrimary,
+ &rcDest,
+ pScreenPriv->pddsShadow,
+ &rcSrc,
+ DDBLT_WAIT,
+ NULL);
+
+ /* Reset the clip region */
+ SelectClipRgn (pScreenPriv->hdcScreen, NULL);
+ }
+
+ /* Relock the shadow surface */
+ ddrval = IDirectDrawSurface2_Lock (pScreenPriv->pddsShadow,
+ NULL,
+ pScreenPriv->pddsdShadow,
+ DDLOCK_WAIT,
+ NULL);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winShadowUpdateDD - Lock failed\n");
+ return;
+ }
+
+ /* Has our memory pointer changed? */
+ if (pScreenInfo->pfb != pScreenPriv->pddsdShadow->lpSurface)
+ {
+ extern const char *g_pszLogFile;
+ ErrorF ("winShadowUpdateDD - Memory location of the shadow "
+ "surface has changed, trying to update the root window "
+ "pixmap header to point to the new address. If you get "
+ "this message and "PROJECT_NAME" freezes or crashes "
+ "after this message then send a problem report and your "
+ "%s file to " BUILDERADDR "\n", g_pszLogFile);
+
+ /* Location of shadow framebuffer has changed */
+ winUpdateFBPointer(pScreen, pScreenPriv->pddsdShadow->lpSurface);
+ }
+}
+
+static Bool
+winInitScreenShadowDD (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+
+ /* Get a device context for the screen */
+ pScreenPriv->hdcScreen = GetDC (pScreenPriv->hwndScreen);
+
+ return winAllocateFBShadowDD(pScreen);
+}
+
+/*
+ * Call the wrapped CloseScreen function.
+ *
+ * Free our resources and private structures.
+ */
+
+static Bool
+winCloseScreenShadowDD (int nIndex, ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ Bool fReturn;
+
+ winDebug ("winCloseScreenShadowDD - Freeing screen resources\n");
+
+ /* Flag that the screen is closed */
+ pScreenPriv->fClosed = TRUE;
+ pScreenPriv->fActive = FALSE;
+
+ /* Call the wrapped CloseScreen procedure */
+ WIN_UNWRAP(CloseScreen);
+ if (pScreen->CloseScreen)
+ fReturn = (*pScreen->CloseScreen) (nIndex, pScreen);
+
+ winFreeFBShadowDD(pScreen);
+
+ /* Free the screen DC */
+ ReleaseDC (pScreenPriv->hwndScreen, pScreenPriv->hdcScreen);
+
+ /* Delete the window property */
+ RemoveProp (pScreenPriv->hwndScreen, WIN_SCR_PROP);
+
+ /* Delete tray icon, if we have one */
+ if (!pScreenInfo->fNoTrayIcon)
+ winDeleteNotifyIcon (pScreenPriv);
+
+ /* Free the exit confirmation dialog box, if it exists */
+ if (g_hDlgExit != NULL)
+ {
+ DestroyWindow (g_hDlgExit);
+ g_hDlgExit = NULL;
+ }
+
+ /* Kill our window */
+ if (pScreenPriv->hwndScreen)
+ {
+ DestroyWindow (pScreenPriv->hwndScreen);
+ pScreenPriv->hwndScreen = NULL;
+ }
+
+#if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW)
+ /* Destroy the thread startup mutex */
+ pthread_mutex_destroy (&pScreenPriv->pmServerStarted);
+#endif
+
+ /* Kill our screeninfo's pointer to the screen */
+ pScreenInfo->pScreen = NULL;
+
+ /* Free the screen privates for this screen */
+ free ((pointer) pScreenPriv);
+
+ return fReturn;
+}
+
+
+/*
+ * Tell mi what sort of visuals we need.
+ *
+ * Generally we only need one visual, as our screen can only
+ * handle one format at a time, I believe. You may want
+ * to verify that last sentence.
+ */
+
+static Bool
+winInitVisualsShadowDD (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ DWORD dwRedBits, dwGreenBits, dwBlueBits;
+
+ /* Count the number of ones in each color mask */
+ dwRedBits = winCountBits (pScreenPriv->dwRedMask);
+ dwGreenBits = winCountBits (pScreenPriv->dwGreenMask);
+ dwBlueBits = winCountBits (pScreenPriv->dwBlueMask);
+
+ /* Store the maximum number of ones in a color mask as the bitsPerRGB */
+ if (dwRedBits == 0 || dwGreenBits == 0 || dwBlueBits == 0)
+ pScreenPriv->dwBitsPerRGB = 8;
+ else if (dwRedBits > dwGreenBits && dwRedBits > dwBlueBits)
+ pScreenPriv->dwBitsPerRGB = dwRedBits;
+ else if (dwGreenBits > dwRedBits && dwGreenBits > dwBlueBits)
+ pScreenPriv->dwBitsPerRGB = dwGreenBits;
+ else
+ pScreenPriv->dwBitsPerRGB = dwBlueBits;
+
+ winDebug ("winInitVisualsShadowDD - Masks %08x %08x %08x BPRGB %d d %d "
+ "bpp %d\n",
+ (unsigned int) pScreenPriv->dwRedMask,
+ (unsigned int) pScreenPriv->dwGreenMask,
+ (unsigned int) pScreenPriv->dwBlueMask,
+ (int) pScreenPriv->dwBitsPerRGB,
+ (int) pScreenInfo->dwDepth,
+ (int) pScreenInfo->dwBPP);
+
+ /* Create a single visual according to the Windows screen depth */
+ switch (pScreenInfo->dwDepth)
+ {
+ case 24:
+ case 16:
+ case 15:
+ /* Create the real visual */
+ if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth,
+ TrueColorMask,
+ pScreenPriv->dwBitsPerRGB,
+ TrueColor,
+ pScreenPriv->dwRedMask,
+ pScreenPriv->dwGreenMask,
+ pScreenPriv->dwBlueMask))
+ {
+ ErrorF ("winInitVisualsShadowDD - miSetVisualTypesAndMasks "
+ "failed for TrueColor\n");
+ return FALSE;
+ }
+
+#ifdef XWIN_EMULATEPSEUDO
+ if (!pScreenInfo->fEmulatePseudo)
+ break;
+
+ /* Setup a pseudocolor visual */
+ if (!miSetVisualTypesAndMasks (8,
+ PseudoColorMask,
+ 8,
+ -1,
+ 0,
+ 0,
+ 0))
+ {
+ ErrorF ("winInitVisualsShadowDD - miSetVisualTypesAndMasks "
+ "failed for PseudoColor\n");
+ return FALSE;
+ }
+#endif
+ break;
+
+ case 8:
+ if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth,
+ pScreenInfo->fFullScreen
+ ? PseudoColorMask : StaticColorMask,
+ pScreenPriv->dwBitsPerRGB,
+ pScreenInfo->fFullScreen
+ ? PseudoColor : StaticColor,
+ pScreenPriv->dwRedMask,
+ pScreenPriv->dwGreenMask,
+ pScreenPriv->dwBlueMask))
+ {
+ ErrorF ("winInitVisualsShadowDD - miSetVisualTypesAndMasks "
+ "failed\n");
+ return FALSE;
+ }
+ break;
+
+ default:
+ ErrorF ("winInitVisualsShadowDD - Unknown screen depth\n");
+ return FALSE;
+ }
+
+ winDebug ("winInitVisualsShadowDD - Returning\n");
+
+ return TRUE;
+}
+
+
+/*
+ * Adjust the user proposed video mode
+ */
+
+static Bool
+winAdjustVideoModeShadowDD (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ HDC hdc = NULL;
+ DWORD dwBPP;
+
+ /* We're in serious trouble if we can't get a DC */
+ hdc = GetDC (NULL);
+ if (hdc == NULL)
+ {
+ ErrorF ("winAdjustVideoModeShadowDD - GetDC () failed\n");
+ return FALSE;
+ }
+
+ /* Query GDI for current display depth */
+ dwBPP = GetDeviceCaps (hdc, BITSPIXEL);
+
+ /* DirectDraw can only change the depth in fullscreen mode */
+ if (!(pScreenInfo->fFullScreen &&
+ (pScreenInfo->dwBPP != WIN_DEFAULT_BPP)))
+ {
+ /* Otherwise, We'll use GDI's depth */
+ pScreenInfo->dwBPP = dwBPP;
+ }
+
+ /* Release our DC */
+ ReleaseDC (NULL, hdc);
+ return TRUE;
+}
+
+
+/*
+ * Blt exposed regions to the screen
+ */
+
+static Bool
+winBltExposedRegionsShadowDD (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ RECT rcSrc, rcDest;
+ POINT ptOrigin;
+ HDC hdcUpdate = NULL;
+ PAINTSTRUCT ps;
+ HRESULT ddrval = DD_OK;
+ Bool fReturn = TRUE;
+ Bool fLocked = TRUE;
+ int i;
+
+ /* BeginPaint gives us an hdc that clips to the invalidated region */
+ hdcUpdate = BeginPaint (pScreenPriv->hwndScreen, &ps);
+ if (hdcUpdate == NULL)
+ {
+ ErrorF ("winBltExposedRegionsShadowDD - BeginPaint () returned "
+ "a NULL device context handle. Aborting blit attempt.\n");
+ return FALSE;
+ }
+
+ /* Unlock the shadow surface, so we can blit */
+ ddrval = IDirectDrawSurface2_Unlock (pScreenPriv->pddsShadow, NULL);
+ if (FAILED (ddrval))
+ {
+ fReturn = FALSE;
+ goto winBltExposedRegionsShadowDD_Exit;
+ }
+ else
+ {
+ /* Flag that we have unlocked the shadow surface */
+ fLocked = FALSE;
+ }
+
+ /* Get the origin of the window in the screen coords */
+ ptOrigin.x = pScreenInfo->dwXOffset;
+ ptOrigin.y = pScreenInfo->dwYOffset;
+
+ MapWindowPoints (pScreenPriv->hwndScreen,
+ HWND_DESKTOP,
+ (LPPOINT)&ptOrigin, 1);
+ rcDest.left = ptOrigin.x;
+ rcDest.right = ptOrigin.x + pScreenInfo->dwWidth;
+ rcDest.top = ptOrigin.y;
+ rcDest.bottom = ptOrigin.y + pScreenInfo->dwHeight;
+
+ /* Source can be enter shadow surface, as Blt should clip */
+ rcSrc.left = 0;
+ rcSrc.top = 0;
+ rcSrc.right = pScreenInfo->dwWidth;
+ rcSrc.bottom = pScreenInfo->dwHeight;
+
+ /* Try to regain the primary surface and blit again if we've lost it */
+ for (i = 0; i <= WIN_REGAIN_SURFACE_RETRIES; ++i)
+ {
+ /* Our Blt should be clipped to the invalidated region */
+ ddrval = IDirectDrawSurface2_Blt (pScreenPriv->pddsPrimary,
+ &rcDest,
+ pScreenPriv->pddsShadow,
+ &rcSrc,
+ DDBLT_WAIT,
+ NULL);
+ if (ddrval == DDERR_SURFACELOST)
+ {
+ /* Surface was lost */
+ ErrorF ("winBltExposedRegionsShadowDD - IDirectDrawSurface2_Blt "
+ "reported that the primary surface was lost, "
+ "trying to restore, retry: %d\n", i + 1);
+
+ /* Try to restore the surface, once */
+ ddrval = IDirectDrawSurface2_Restore (pScreenPriv->pddsPrimary);
+ ErrorF ("winBltExposedRegionsShadowDD - "
+ "IDirectDrawSurface2_Restore returned: ");
+ if (ddrval == DD_OK)
+ ErrorF ("DD_OK\n");
+ else if (ddrval == DDERR_WRONGMODE)
+ ErrorF ("DDERR_WRONGMODE\n");
+ else if (ddrval == DDERR_INCOMPATIBLEPRIMARY)
+ ErrorF ("DDERR_INCOMPATIBLEPRIMARY\n");
+ else if (ddrval == DDERR_UNSUPPORTED)
+ ErrorF ("DDERR_UNSUPPORTED\n");
+ else if (ddrval == DDERR_INVALIDPARAMS)
+ ErrorF ("DDERR_INVALIDPARAMS\n");
+ else if (ddrval == DDERR_INVALIDOBJECT)
+ ErrorF ("DDERR_INVALIDOBJECT\n");
+ else
+ ErrorF ("unknown error: %08x\n", (unsigned int) ddrval);
+
+ /* Loop around to try the blit one more time */
+ continue;
+ }
+ else if (FAILED (ddrval))
+ {
+ fReturn = FALSE;
+ ErrorF ("winBltExposedRegionsShadowDD - IDirectDrawSurface2_Blt "
+ "failed, but surface not lost: %08x %d\n",
+ (unsigned int) ddrval, (int) ddrval);
+ goto winBltExposedRegionsShadowDD_Exit;
+ }
+ else
+ {
+ /* Success, stop looping */
+ break;
+ }
+ }
+
+ /* Relock the shadow surface */
+ ddrval = IDirectDrawSurface2_Lock (pScreenPriv->pddsShadow,
+ NULL,
+ pScreenPriv->pddsdShadow,
+ DDLOCK_WAIT,
+ NULL);
+ if (FAILED (ddrval))
+ {
+ fReturn = FALSE;
+ ErrorF ("winBltExposedRegionsShadowDD - IDirectDrawSurface2_Lock "
+ "failed\n");
+ goto winBltExposedRegionsShadowDD_Exit;
+ }
+ else
+ {
+ /* Indicate that we have relocked the shadow surface */
+ fLocked = TRUE;
+ }
+
+ /* Has our memory pointer changed? */
+ if (pScreenInfo->pfb != pScreenPriv->pddsdShadow->lpSurface)
+ winUpdateFBPointer (pScreen,
+ pScreenPriv->pddsdShadow->lpSurface);
+
+ winBltExposedRegionsShadowDD_Exit:
+ /* EndPaint frees the DC */
+ if (hdcUpdate != NULL)
+ EndPaint (pScreenPriv->hwndScreen, &ps);
+
+ /*
+ * Relock the surface if it is not locked. We don't care if locking fails,
+ * as it will cause the server to shutdown within a few more operations.
+ */
+ if (!fLocked)
+ {
+ IDirectDrawSurface2_Lock (pScreenPriv->pddsShadow,
+ NULL,
+ pScreenPriv->pddsdShadow,
+ DDLOCK_WAIT,
+ NULL);
+
+ /* Has our memory pointer changed? */
+ if (pScreenInfo->pfb != pScreenPriv->pddsdShadow->lpSurface)
+ winUpdateFBPointer (pScreen,
+ pScreenPriv->pddsdShadow->lpSurface);
+
+ fLocked = TRUE;
+ }
+ return fReturn;
+}
+
+
+/*
+ * Do any engine-specific appliation-activation processing
+ */
+
+static Bool
+winActivateAppShadowDD (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+
+ /*
+ * Do we have a surface?
+ * Are we active?
+ * Are we fullscreen?
+ */
+ if (pScreenPriv != NULL
+ && pScreenPriv->pddsPrimary != NULL
+ && pScreenPriv->fActive)
+ {
+ /* Primary surface was lost, restore it */
+ IDirectDrawSurface2_Restore (pScreenPriv->pddsPrimary);
+ }
+
+ return TRUE;
+}
+
+
+/*
+ * Reblit the shadow framebuffer to the screen.
+ */
+
+static Bool
+winRedrawScreenShadowDD (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ HRESULT ddrval = DD_OK;
+ RECT rcSrc, rcDest;
+ POINT ptOrigin;
+
+ /* Get the origin of the window in the screen coords */
+ ptOrigin.x = pScreenInfo->dwXOffset;
+ ptOrigin.y = pScreenInfo->dwYOffset;
+ MapWindowPoints (pScreenPriv->hwndScreen,
+ HWND_DESKTOP,
+ (LPPOINT)&ptOrigin, 1);
+ rcDest.left = ptOrigin.x;
+ rcDest.right = ptOrigin.x + pScreenInfo->dwWidth;
+ rcDest.top = ptOrigin.y;
+ rcDest.bottom = ptOrigin.y + pScreenInfo->dwHeight;
+
+ /* Source can be entire shadow surface, as Blt should clip for us */
+ rcSrc.left = 0;
+ rcSrc.top = 0;
+ rcSrc.right = pScreenInfo->dwWidth;
+ rcSrc.bottom = pScreenInfo->dwHeight;
+
+ /* Redraw the whole window, to take account for the new colors */
+ ddrval = IDirectDrawSurface2_Blt (pScreenPriv->pddsPrimary,
+ &rcDest,
+ pScreenPriv->pddsShadow,
+ &rcSrc,
+ DDBLT_WAIT,
+ NULL);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winRedrawScreenShadowDD - IDirectDrawSurface_Blt () "
+ "failed: %08x\n",
+ (unsigned int) ddrval);
+ }
+
+ return TRUE;
+}
+
+
+/*
+ * Realize the currently installed colormap
+ */
+
+static Bool
+winRealizeInstalledPaletteShadowDD (ScreenPtr pScreen)
+{
+ return TRUE;
+}
+
+
+/*
+ * Install the specified colormap
+ */
+
+static Bool
+winInstallColormapShadowDD (ColormapPtr pColormap)
+{
+ ScreenPtr pScreen = pColormap->pScreen;
+ winScreenPriv(pScreen);
+ winCmapPriv(pColormap);
+ HRESULT ddrval = DD_OK;
+
+ /* Install the DirectDraw palette on the primary surface */
+ ddrval = IDirectDrawSurface2_SetPalette (pScreenPriv->pddsPrimary,
+ pCmapPriv->lpDDPalette);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winInstallColormapShadowDD - Failed installing the "
+ "DirectDraw palette.\n");
+ return FALSE;
+ }
+
+ /* Save a pointer to the newly installed colormap */
+ pScreenPriv->pcmapInstalled = pColormap;
+
+ return TRUE;
+}
+
+
+/*
+ * Store the specified colors in the specified colormap
+ */
+
+static Bool
+winStoreColorsShadowDD (ColormapPtr pColormap,
+ int ndef,
+ xColorItem *pdefs)
+{
+ ScreenPtr pScreen = pColormap->pScreen;
+ winScreenPriv(pScreen);
+ winCmapPriv(pColormap);
+ ColormapPtr curpmap = pScreenPriv->pcmapInstalled;
+ HRESULT ddrval = DD_OK;
+
+ /* Put the X colormap entries into the Windows logical palette */
+ ddrval = IDirectDrawPalette_SetEntries (pCmapPriv->lpDDPalette,
+ 0,
+ pdefs[0].pixel,
+ ndef,
+ pCmapPriv->peColors
+ + pdefs[0].pixel);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winStoreColorsShadowDD - SetEntries () failed\n");
+ return FALSE;
+ }
+
+ /* Don't install the DirectDraw palette if the colormap is not installed */
+ if (pColormap != curpmap)
+ {
+ return TRUE;
+ }
+
+ if (!winInstallColormapShadowDD (pColormap))
+ {
+ ErrorF ("winStoreColorsShadowDD - Failed installing colormap\n");
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+
+/*
+ * Colormap initialization procedure
+ */
+
+static Bool
+winCreateColormapShadowDD (ColormapPtr pColormap)
+{
+ HRESULT ddrval = DD_OK;
+ ScreenPtr pScreen = pColormap->pScreen;
+ winScreenPriv(pScreen);
+ winCmapPriv(pColormap);
+
+ /* Create a DirectDraw palette */
+ ddrval = IDirectDraw2_CreatePalette (pScreenPriv->pdd,
+ DDPCAPS_8BIT | DDPCAPS_ALLOW256,
+ pCmapPriv->peColors,
+ &pCmapPriv->lpDDPalette,
+ NULL);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winCreateColormapShadowDD - CreatePalette failed\n");
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+
+/*
+ * Colormap destruction procedure
+ */
+
+static Bool
+winDestroyColormapShadowDD (ColormapPtr pColormap)
+{
+ winScreenPriv(pColormap->pScreen);
+ winCmapPriv(pColormap);
+ HRESULT ddrval = DD_OK;
+
+ /*
+ * Is colormap to be destroyed the default?
+ *
+ * Non-default colormaps should have had winUninstallColormap
+ * called on them before we get here. The default colormap
+ * will not have had winUninstallColormap called on it. Thus,
+ * we need to handle the default colormap in a special way.
+ */
+ if (pColormap->flags & IsDefault)
+ {
+ winDebug ("winDestroyColormapShadowDD - Destroying default "
+ "colormap\n");
+
+ /*
+ * FIXME: Walk the list of all screens, popping the default
+ * palette out of each screen device context.
+ */
+
+ /* Pop the palette out of the primary surface */
+ ddrval = IDirectDrawSurface2_SetPalette (pScreenPriv->pddsPrimary,
+ NULL);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winDestroyColormapShadowDD - Failed freeing the "
+ "default colormap DirectDraw palette.\n");
+ return FALSE;
+ }
+
+ /* Clear our private installed colormap pointer */
+ pScreenPriv->pcmapInstalled = NULL;
+ }
+
+ /* Release the palette */
+ IDirectDrawPalette_Release (pCmapPriv->lpDDPalette);
+
+ /* Invalidate the colormap privates */
+ pCmapPriv->lpDDPalette = NULL;
+
+ return TRUE;
+}
+
+
+/*
+ * Set engine specific functions
+ */
+
+Bool
+winSetEngineFunctionsShadowDD (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+
+ /* Set our pointers */
+ pScreenPriv->pwinAllocateFB = winAllocateFBShadowDD;
+ pScreenPriv->pwinFreeFB = winFreeFBShadowDD;
+ pScreenPriv->pwinShadowUpdate = winShadowUpdateDD;
+ pScreenPriv->pwinInitScreen = winInitScreenShadowDD;
+ pScreenPriv->pwinCloseScreen = winCloseScreenShadowDD;
+ pScreenPriv->pwinInitVisuals = winInitVisualsShadowDD;
+ pScreenPriv->pwinAdjustVideoMode = winAdjustVideoModeShadowDD;
+ if (pScreenInfo->fFullScreen)
+ pScreenPriv->pwinCreateBoundingWindow = winCreateBoundingWindowFullScreen;
+ else
+ pScreenPriv->pwinCreateBoundingWindow = winCreateBoundingWindowWindowed;
+ pScreenPriv->pwinFinishScreenInit = winFinishScreenInitFB;
+ pScreenPriv->pwinBltExposedRegions = winBltExposedRegionsShadowDD;
+ pScreenPriv->pwinActivateApp = winActivateAppShadowDD;
+ pScreenPriv->pwinRedrawScreen = winRedrawScreenShadowDD;
+ pScreenPriv->pwinRealizeInstalledPalette
+ = winRealizeInstalledPaletteShadowDD;
+ pScreenPriv->pwinInstallColormap = winInstallColormapShadowDD;
+ pScreenPriv->pwinStoreColors = winStoreColorsShadowDD;
+ pScreenPriv->pwinCreateColormap = winCreateColormapShadowDD;
+ pScreenPriv->pwinDestroyColormap = winDestroyColormapShadowDD;
+ pScreenPriv->pwinHotKeyAltTab = (winHotKeyAltTabProcPtr) (void (*)(void))NoopDDA;
+ pScreenPriv->pwinCreatePrimarySurface = winCreatePrimarySurfaceShadowDD;
+ pScreenPriv->pwinReleasePrimarySurface = winReleasePrimarySurfaceShadowDD;
+#ifdef XWIN_MULTIWINDOW
+ pScreenPriv->pwinFinishCreateWindowsWindow =
+ (winFinishCreateWindowsWindowProcPtr) (void (*)(void))NoopDDA;
+#endif
+
+ return TRUE;
+}
diff --git a/xorg-server/hw/xwin/winshadddnl.c b/xorg-server/hw/xwin/winshadddnl.c index 63d48adb6..da3c56160 100644 --- a/xorg-server/hw/xwin/winshadddnl.c +++ b/xorg-server/hw/xwin/winshadddnl.c @@ -1,1397 +1,1360 @@ -/* - *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved. - * - *Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - *"Software"), to deal in the Software without restriction, including - *without limitation the rights to use, copy, modify, merge, publish, - *distribute, sublicense, and/or sell copies of the Software, and to - *permit persons to whom the Software is furnished to do so, subject to - *the following conditions: - * - *The above copyright notice and this permission notice shall be - *included in all copies or substantial portions of the Software. - * - *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR - *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - *Except as contained in this notice, the name of the XFree86 Project - *shall not be used in advertising or otherwise to promote the sale, use - *or other dealings in this Software without prior written authorization - *from the XFree86 Project. - * - * Authors: Dakshinamurthy Karra - * Suhaib M Siddiqi - * Peter Busch - * Harold L Hunt II - */ - -#ifdef HAVE_XWIN_CONFIG_H -#include <xwin-config.h> -#endif -#include "win.h" - - -/* - * FIXME: Headers are broken, DEFINE_GUID doesn't work correctly, - * so we have to redefine it here. - */ -#ifdef DEFINE_GUID -#undef DEFINE_GUID -#define DEFINE_GUID(n,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) const GUID n GUID_SECT = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}} -#endif /* DEFINE_GUID */ - -/* - * FIXME: Headers are broken, IID_IDirectDraw4 has to be defined - * here manually. Should be handled by ddraw.h - */ -#ifndef IID_IDirectDraw4 -DEFINE_GUID( IID_IDirectDraw4, 0x9c59509a,0x39bd,0x11d1,0x8c,0x4a,0x00,0xc0,0x4f,0xd9,0x30,0xc5 ); -#endif /* IID_IDirectDraw4 */ - -#define FAIL_MSG_MAX_BLT 10 - - -/* - * Local prototypes - */ - -static Bool -winAllocateFBShadowDDNL (ScreenPtr pScreen); - -static void -winShadowUpdateDDNL (ScreenPtr pScreen, - shadowBufPtr pBuf); - -static Bool -winCloseScreenShadowDDNL (int nIndex, ScreenPtr pScreen); - -static Bool -winInitVisualsShadowDDNL (ScreenPtr pScreen); - -static Bool -winAdjustVideoModeShadowDDNL (ScreenPtr pScreen); - -static Bool -winBltExposedRegionsShadowDDNL (ScreenPtr pScreen); - -static Bool -winActivateAppShadowDDNL (ScreenPtr pScreen); - -static Bool -winRedrawScreenShadowDDNL (ScreenPtr pScreen); - -static Bool -winRealizeInstalledPaletteShadowDDNL (ScreenPtr pScreen); - -static Bool -winInstallColormapShadowDDNL (ColormapPtr pColormap); - -static Bool -winStoreColorsShadowDDNL (ColormapPtr pmap, - int ndef, - xColorItem *pdefs); - -static Bool -winCreateColormapShadowDDNL (ColormapPtr pColormap); - -static Bool -winDestroyColormapShadowDDNL (ColormapPtr pColormap); - -static Bool -winCreatePrimarySurfaceShadowDDNL (ScreenPtr pScreen); - -static Bool -winReleasePrimarySurfaceShadowDDNL (ScreenPtr pScreen); - - -/* - * Create the primary surface and attach the clipper. - * Used for both the initial surface creation and during - * WM_DISPLAYCHANGE messages. - */ - -static Bool -winCreatePrimarySurfaceShadowDDNL (ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - HRESULT ddrval = DD_OK; - DDSURFACEDESC2 ddsd; - - winDebug ("winCreatePrimarySurfaceShadowDDNL - Creating primary surface\n"); - - /* Describe the primary surface */ - ZeroMemory (&ddsd, sizeof (ddsd)); - ddsd.dwSize = sizeof (ddsd); - ddsd.dwFlags = DDSD_CAPS; - ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; - - /* Create the primary surface */ - ddrval = IDirectDraw4_CreateSurface (pScreenPriv->pdd4, - &ddsd, - &pScreenPriv->pddsPrimary4, - NULL); - pScreenPriv->fRetryCreateSurface = FALSE; - if (FAILED (ddrval)) - { - if (ddrval == DDERR_NOEXCLUSIVEMODE) - { - /* Recreating the surface failed. Mark screen to retry later */ - pScreenPriv->fRetryCreateSurface = TRUE; - winDebug ("winCreatePrimarySurfaceShadowDDNL - Could not create " - "primary surface: DDERR_NOEXCLUSIVEMODE\n"); - } - else - { - ErrorF ("winCreatePrimarySurfaceShadowDDNL - Could not create " - "primary surface: %08x\n", (unsigned int) ddrval); - } - return FALSE; - } - -#if 1 - winDebug ("winCreatePrimarySurfaceShadowDDNL - Created primary surface\n"); -#endif - - /* Attach our clipper to our primary surface handle */ - ddrval = IDirectDrawSurface4_SetClipper (pScreenPriv->pddsPrimary4, - pScreenPriv->pddcPrimary); - if (FAILED (ddrval)) - { - ErrorF ("winCreatePrimarySurfaceShadowDDNL - Primary attach clipper " - "failed: %08x\n", - (unsigned int) ddrval); - return FALSE; - } - -#if 1 - winDebug ("winCreatePrimarySurfaceShadowDDNL - Attached clipper to primary " - "surface\n"); -#endif - - /* Everything was correct */ - return TRUE; -} - - -/* - * Detach the clipper and release the primary surface. - * Called from WM_DISPLAYCHANGE. - */ - -static Bool -winReleasePrimarySurfaceShadowDDNL (ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - - winDebug ("winReleasePrimarySurfaceShadowDDNL - Hello\n"); - - /* Release the primary surface and clipper, if they exist */ - if (pScreenPriv->pddsPrimary4) - { - /* - * Detach the clipper from the primary surface. - * NOTE: We do this explicity for clarity. The Clipper is not released. - */ - IDirectDrawSurface4_SetClipper (pScreenPriv->pddsPrimary4, - NULL); - - winDebug ("winReleasePrimarySurfaceShadowDDNL - Detached clipper\n"); - - /* Release the primary surface */ - IDirectDrawSurface4_Release (pScreenPriv->pddsPrimary4); - pScreenPriv->pddsPrimary4 = NULL; - } - - winDebug ("winReleasePrimarySurfaceShadowDDNL - Released primary surface\n"); - - return TRUE; -} - - -/* - * Create a DirectDraw surface for the shadow framebuffer; also create - * a primary surface object so we can blit to the display. - * - * Install a DirectDraw clipper on our primary surface object - * that clips our blits to the unobscured client area of our display window. - */ - -Bool -winAllocateFBShadowDDNL (ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - HRESULT ddrval = DD_OK; - DDSURFACEDESC2 ddsdShadow; - char *lpSurface = NULL; - DDPIXELFORMAT ddpfPrimary; - -#if CYGDEBUG - winDebug ("winAllocateFBShadowDDNL - w %d h %d d %d\n", - pScreenInfo->dwWidth, pScreenInfo->dwHeight, pScreenInfo->dwDepth); -#endif - - /* Set the padded screen width */ - pScreenInfo->dwPaddedWidth = PixmapBytePad (pScreenInfo->dwWidth, - pScreenInfo->dwBPP); - - /* Allocate memory for our shadow surface */ - lpSurface = malloc (pScreenInfo->dwPaddedWidth * pScreenInfo->dwHeight); - if (lpSurface == NULL) - { - ErrorF ("winAllocateFBShadowDDNL - Could not allocate bits\n"); - return FALSE; - } - - /* - * Initialize the framebuffer memory so we don't get a - * strange display at startup - */ - ZeroMemory (lpSurface, pScreenInfo->dwPaddedWidth * pScreenInfo->dwHeight); - - /* Create a clipper */ - ddrval = (*g_fpDirectDrawCreateClipper) (0, - &pScreenPriv->pddcPrimary, - NULL); - if (FAILED (ddrval)) - { - ErrorF ("winAllocateFBShadowDDNL - Could not attach clipper: %08x\n", - (unsigned int) ddrval); - return FALSE; - } - -#if CYGDEBUG - winDebug ("winAllocateFBShadowDDNL - Created a clipper\n"); -#endif - - /* Attach the clipper to our display window */ - ddrval = IDirectDrawClipper_SetHWnd (pScreenPriv->pddcPrimary, - 0, - pScreenPriv->hwndScreen); - if (FAILED (ddrval)) - { - ErrorF ("winAllocateFBShadowDDNL - Clipper not attached " - "to window: %08x\n", - (unsigned int) ddrval); - return FALSE; - } - -#if CYGDEBUG - winDebug ("winAllocateFBShadowDDNL - Attached clipper to window\n"); -#endif - - /* Create a DirectDraw object, store the address at lpdd */ - ddrval = (*g_fpDirectDrawCreate) (NULL, - (LPDIRECTDRAW*) &pScreenPriv->pdd, - NULL); - if (FAILED (ddrval)) - { - ErrorF ("winAllocateFBShadowDDNL - Could not start " - "DirectDraw: %08x\n", - (unsigned int) ddrval); - return FALSE; - } - -#if CYGDEBUG - winDebug ("winAllocateFBShadowDDNL - Created and initialized DD\n"); -#endif - - /* Get a DirectDraw4 interface pointer */ - ddrval = IDirectDraw_QueryInterface (pScreenPriv->pdd, - &IID_IDirectDraw4, - (LPVOID*) &pScreenPriv->pdd4); - if (FAILED (ddrval)) - { - ErrorF ("winAllocateFBShadowDDNL - Failed DD4 query: %08x\n", - (unsigned int) ddrval); - return FALSE; - } - - /* Are we full screen? */ - if (pScreenInfo->fFullScreen) - { - DDSURFACEDESC2 ddsdCurrent; - DWORD dwRefreshRateCurrent = 0; - HDC hdc = NULL; - - /* Set the cooperative level to full screen */ - ddrval = IDirectDraw4_SetCooperativeLevel (pScreenPriv->pdd4, - pScreenPriv->hwndScreen, - DDSCL_EXCLUSIVE - | DDSCL_FULLSCREEN); - if (FAILED (ddrval)) - { - ErrorF ("winAllocateFBShadowDDNL - Could not set " - "cooperative level: %08x\n", - (unsigned int) ddrval); - return FALSE; - } - - /* - * We only need to get the current refresh rate for comparison - * if a refresh rate has been passed on the command line. - */ - if (pScreenInfo->dwRefreshRate != 0) - { - ZeroMemory (&ddsdCurrent, sizeof (ddsdCurrent)); - ddsdCurrent.dwSize = sizeof (ddsdCurrent); - - /* Get information about current display settings */ - ddrval = IDirectDraw4_GetDisplayMode (pScreenPriv->pdd4, - &ddsdCurrent); - if (FAILED (ddrval)) - { - ErrorF ("winAllocateFBShadowDDNL - Could not get current " - "refresh rate: %08x. Continuing.\n", - (unsigned int) ddrval); - dwRefreshRateCurrent = 0; - } - else - { - /* Grab the current refresh rate */ - dwRefreshRateCurrent = ddsdCurrent.u2.dwRefreshRate; - } - } - - /* Clean up the refresh rate */ - if (dwRefreshRateCurrent == pScreenInfo->dwRefreshRate) - { - /* - * Refresh rate is non-specified or equal to current. - */ - pScreenInfo->dwRefreshRate = 0; - } - - /* Grab a device context for the screen */ - hdc = GetDC (NULL); - if (hdc == NULL) - { - ErrorF ("winAllocateFBShadowDDNL - GetDC () failed\n"); - return FALSE; - } - - /* Only change the video mode when different than current mode */ - if (!pScreenInfo->fMultipleMonitors - && (pScreenInfo->dwWidth != GetSystemMetrics (SM_CXSCREEN) - || pScreenInfo->dwHeight != GetSystemMetrics (SM_CYSCREEN) - || pScreenInfo->dwBPP != GetDeviceCaps (hdc, BITSPIXEL) - || pScreenInfo->dwRefreshRate != 0)) - { - winDebug ("winAllocateFBShadowDDNL - Changing video mode\n"); - - /* Change the video mode to the mode requested, and use the driver default refresh rate on failure */ - ddrval = IDirectDraw4_SetDisplayMode (pScreenPriv->pdd4, - pScreenInfo->dwWidth, - pScreenInfo->dwHeight, - pScreenInfo->dwBPP, - pScreenInfo->dwRefreshRate, - 0); - if (FAILED (ddrval)) - { - ErrorF ("winAllocateFBShadowDDNL - Could not set " - "full screen display mode: %08x\n", - (unsigned int) ddrval); - ErrorF ("winAllocateFBShadowDDNL - Using default driver refresh rate\n"); - ddrval = IDirectDraw4_SetDisplayMode (pScreenPriv->pdd4, - pScreenInfo->dwWidth, - pScreenInfo->dwHeight, - pScreenInfo->dwBPP, - 0, - 0); - if (FAILED(ddrval)) - { - ErrorF ("winAllocateFBShadowDDNL - Could not set default refresh rate " - "full screen display mode: %08x\n", - (unsigned int) ddrval); - return FALSE; - } - } - } - else - { - winDebug ("winAllocateFBShadowDDNL - Not changing video mode\n"); - } - - /* Release our DC */ - ReleaseDC (NULL, hdc); - hdc = NULL; - } - else - { - /* Set the cooperative level for windowed mode */ - ddrval = IDirectDraw4_SetCooperativeLevel (pScreenPriv->pdd4, - pScreenPriv->hwndScreen, - DDSCL_NORMAL); - if (FAILED (ddrval)) - { - ErrorF ("winAllocateFBShadowDDNL - Could not set " - "cooperative level: %08x\n", - (unsigned int) ddrval); - return FALSE; - } - } - - /* Create the primary surface */ - if (!winCreatePrimarySurfaceShadowDDNL (pScreen)) - { - ErrorF ("winAllocateFBShadowDDNL - winCreatePrimarySurfaceShadowDDNL " - "failed\n"); - return FALSE; - } - - /* Get primary surface's pixel format */ - ZeroMemory (&ddpfPrimary, sizeof (ddpfPrimary)); - ddpfPrimary.dwSize = sizeof (ddpfPrimary); - ddrval = IDirectDrawSurface4_GetPixelFormat (pScreenPriv->pddsPrimary4, - &ddpfPrimary); - if (FAILED (ddrval)) - { - ErrorF ("winAllocateFBShadowDDNL - Could not get primary " - "pixformat: %08x\n", - (unsigned int) ddrval); - return FALSE; - } - -#if CYGDEBUG - winDebug ("winAllocateFBShadowDDNL - Primary masks: %08x %08x %08x " - "dwRGBBitCount: %d\n", - ddpfPrimary.u2.dwRBitMask, - ddpfPrimary.u3.dwGBitMask, - ddpfPrimary.u4.dwBBitMask, - ddpfPrimary.u1.dwRGBBitCount); -#endif - - /* Describe the shadow surface to be created */ - /* - * NOTE: Do not use a DDSCAPS_VIDEOMEMORY surface, - * as drawing, locking, and unlocking take forever - * with video memory surfaces. In addition, - * video memory is a somewhat scarce resource, - * so you shouldn't be allocating video memory when - * you have the option of using system memory instead. - */ - ZeroMemory (&ddsdShadow, sizeof (ddsdShadow)); - ddsdShadow.dwSize = sizeof (ddsdShadow); - ddsdShadow.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH - | DDSD_LPSURFACE | DDSD_PITCH | DDSD_PIXELFORMAT; - ddsdShadow.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY; - ddsdShadow.dwHeight = pScreenInfo->dwHeight; - ddsdShadow.dwWidth = pScreenInfo->dwWidth; - ddsdShadow.u1.lPitch = pScreenInfo->dwPaddedWidth; - ddsdShadow.lpSurface = lpSurface; - ddsdShadow.u4.ddpfPixelFormat = ddpfPrimary; - - winDebug ("winAllocateFBShadowDDNL - lPitch: %d\n", - (int) pScreenInfo->dwPaddedWidth); - - /* Create the shadow surface */ - ddrval = IDirectDraw4_CreateSurface (pScreenPriv->pdd4, - &ddsdShadow, - &pScreenPriv->pddsShadow4, - NULL); - if (FAILED (ddrval)) - { - ErrorF ("winAllocateFBShadowDDNL - Could not create shadow " - "surface: %08x\n", (unsigned int) ddrval); - return FALSE; - } - -#if CYGDEBUG || YES - winDebug ("winAllocateFBShadowDDNL - Created shadow pitch: %d\n", - (int) ddsdShadow.u1.lPitch); -#endif - - /* Grab the pitch from the surface desc */ - pScreenInfo->dwStride = (ddsdShadow.u1.lPitch * 8) - / pScreenInfo->dwBPP; - -#if CYGDEBUG || YES - winDebug ("winAllocateFBShadowDDNL - Created shadow stride: %d\n", - (int) pScreenInfo->dwStride); -#endif - - /* Save the pointer to our surface memory */ - pScreenInfo->pfb = lpSurface; - - /* Grab the masks from the surface description */ - pScreenPriv->dwRedMask = ddsdShadow.u4.ddpfPixelFormat.u2.dwRBitMask; - pScreenPriv->dwGreenMask = ddsdShadow.u4.ddpfPixelFormat.u3.dwGBitMask; - pScreenPriv->dwBlueMask = ddsdShadow.u4.ddpfPixelFormat.u4.dwBBitMask; - -#if CYGDEBUG - winDebug ("winAllocateFBShadowDDNL - Returning\n"); -#endif - - return TRUE; -} - -static void -winFreeFBShadowDDNL(ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - - /* Free the shadow surface, if there is one */ - if (pScreenPriv->pddsShadow4) - { - IDirectDrawSurface4_Release (pScreenPriv->pddsShadow4); - free (pScreenInfo->pfb); - pScreenInfo->pfb = NULL; - pScreenPriv->pddsShadow4 = NULL; - } - - /* Detach the clipper from the primary surface and release the primary surface, if there is one */ - winReleasePrimarySurfaceShadowDDNL(pScreen); - - /* Release the clipper object */ - if (pScreenPriv->pddcPrimary) - { - IDirectDrawClipper_Release (pScreenPriv->pddcPrimary); - pScreenPriv->pddcPrimary = NULL; - } - - /* Free the DirectDraw4 object, if there is one */ - if (pScreenPriv->pdd4) - { - IDirectDraw4_RestoreDisplayMode (pScreenPriv->pdd4); - IDirectDraw4_Release (pScreenPriv->pdd4); - pScreenPriv->pdd4 = NULL; - } - - /* Free the DirectDraw object, if there is one */ - if (pScreenPriv->pdd) - { - IDirectDraw_Release (pScreenPriv->pdd); - pScreenPriv->pdd = NULL; - } - - /* Invalidate the ScreenInfo's fb pointer */ - pScreenInfo->pfb = NULL; -} - -#if defined(XWIN_MULTIWINDOW) || defined(XWIN_MULTIWINDOWEXTWM) -/* - * Create a DirectDraw surface for the new multi-window window - */ - -static -Bool -winFinishCreateWindowsWindowDDNL (WindowPtr pWin) -{ - winWindowPriv(pWin); - winPrivScreenPtr pScreenPriv = pWinPriv->pScreenPriv; - HRESULT ddrval = DD_OK; - DDSURFACEDESC2 ddsd; - int iWidth, iHeight; - int iX, iY; - - winDebug ("winFinishCreateWindowsWindowDDNL!\n\n"); - - iX = pWin->drawable.x + GetSystemMetrics (SM_XVIRTUALSCREEN); - iY = pWin->drawable.y + GetSystemMetrics (SM_YVIRTUALSCREEN); - - iWidth = pWin->drawable.width; - iHeight = pWin->drawable.height; - - /* Describe the primary surface */ - ZeroMemory (&ddsd, sizeof (ddsd)); - ddsd.dwSize = sizeof (ddsd); - ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT; - ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; - ddsd.dwHeight = iHeight; - ddsd.dwWidth = iWidth; - - /* Create the primary surface */ - ddrval = IDirectDraw4_CreateSurface (pScreenPriv->pdd4, - &ddsd, - &pWinPriv->pddsPrimary4, - NULL); - if (FAILED (ddrval)) - { - ErrorF ("winFinishCreateWindowsWindowDDNL - Could not create primary " - "surface: %08x\n", - (unsigned int)ddrval); - return FALSE; - } - return TRUE; -} -#endif - - -/* - * Transfer the damaged regions of the shadow framebuffer to the display. - */ - -static void -winShadowUpdateDDNL (ScreenPtr pScreen, - shadowBufPtr pBuf) -{ - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - RegionPtr damage = shadowDamage(pBuf); - HRESULT ddrval = DD_OK; - RECT rcDest, rcSrc; - POINT ptOrigin; - DWORD dwBox = RegionNumRects (damage); - BoxPtr pBox = RegionRects (damage); - HRGN hrgnTemp = NULL, hrgnCombined = NULL; - - /* - * Return immediately if the app is not active - * and we are fullscreen, or if we have a bad display depth - */ - if ((!pScreenPriv->fActive && pScreenInfo->fFullScreen) - || pScreenPriv->fBadDepth) return; - - /* Return immediately if we didn't get needed surfaces */ - if (!pScreenPriv->pddsPrimary4 || !pScreenPriv->pddsShadow4) - return; - - /* Get the origin of the window in the screen coords */ - ptOrigin.x = pScreenInfo->dwXOffset; - ptOrigin.y = pScreenInfo->dwYOffset; - MapWindowPoints (pScreenPriv->hwndScreen, - HWND_DESKTOP, - (LPPOINT)&ptOrigin, 1); - - /* - * Handle small regions with multiple blits, - * handle large regions by creating a clipping region and - * doing a single blit constrained to that clipping region. - */ - if (pScreenInfo->dwClipUpdatesNBoxes == 0 - || dwBox < pScreenInfo->dwClipUpdatesNBoxes) - { - /* Loop through all boxes in the damaged region */ - while (dwBox--) - { - /* Assign damage box to source rectangle */ - rcSrc.left = pBox->x1; - rcSrc.top = pBox->y1; - rcSrc.right = pBox->x2; - rcSrc.bottom = pBox->y2; - - /* Calculate destination rectangle */ - rcDest.left = ptOrigin.x + rcSrc.left; - rcDest.top = ptOrigin.y + rcSrc.top; - rcDest.right = ptOrigin.x + rcSrc.right; - rcDest.bottom = ptOrigin.y + rcSrc.bottom; - - /* Blit the damaged areas */ - ddrval = IDirectDrawSurface4_Blt (pScreenPriv->pddsPrimary4, - &rcDest, - pScreenPriv->pddsShadow4, - &rcSrc, - DDBLT_WAIT, - NULL); - if (FAILED (ddrval)) - { - static int s_iFailCount = 0; - - if (s_iFailCount < FAIL_MSG_MAX_BLT) - { - ErrorF ("winShadowUpdateDDNL - IDirectDrawSurface4_Blt () " - "failed: %08x\n", - (unsigned int) ddrval); - - ++s_iFailCount; - - if (s_iFailCount == FAIL_MSG_MAX_BLT) - { - ErrorF ("winShadowUpdateDDNL - IDirectDrawSurface4_Blt " - "failure message maximum (%d) reached. No " - "more failure messages will be printed.\n", - FAIL_MSG_MAX_BLT); - } - } - } - - /* Get a pointer to the next box */ - ++pBox; - } - } - else - { - BoxPtr pBoxExtents = RegionExtents(damage); - - /* Compute a GDI region from the damaged region */ - hrgnCombined = CreateRectRgn (pBox->x1, pBox->y1, pBox->x2, pBox->y2); - dwBox--; - pBox++; - while (dwBox--) - { - hrgnTemp = CreateRectRgn (pBox->x1, pBox->y1, pBox->x2, pBox->y2); - CombineRgn (hrgnCombined, hrgnCombined, hrgnTemp, RGN_OR); - DeleteObject (hrgnTemp); - pBox++; - } - - /* Install the GDI region as a clipping region */ - SelectClipRgn (pScreenPriv->hdcScreen, hrgnCombined); - DeleteObject (hrgnCombined); - hrgnCombined = NULL; - -#if CYGDEBUG - winDebug ("winShadowUpdateDDNL - be x1 %d y1 %d x2 %d y2 %d\n", - pBoxExtents->x1, pBoxExtents->y1, - pBoxExtents->x2, pBoxExtents->y2); -#endif - - /* Calculating a bounding box for the source is easy */ - rcSrc.left = pBoxExtents->x1; - rcSrc.top = pBoxExtents->y1; - rcSrc.right = pBoxExtents->x2; - rcSrc.bottom = pBoxExtents->y2; - - /* Calculating a bounding box for the destination is trickier */ - rcDest.left = ptOrigin.x + rcSrc.left; - rcDest.top = ptOrigin.y + rcSrc.top; - rcDest.right = ptOrigin.x + rcSrc.right; - rcDest.bottom = ptOrigin.y + rcSrc.bottom; - - /* Our Blt should be clipped to the invalidated region */ - ddrval = IDirectDrawSurface4_Blt (pScreenPriv->pddsPrimary4, - &rcDest, - pScreenPriv->pddsShadow4, - &rcSrc, - DDBLT_WAIT, - NULL); - - /* Reset the clip region */ - SelectClipRgn (pScreenPriv->hdcScreen, NULL); - } -} - -static Bool -winInitScreenShadowDDNL(ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - - /* Get a device context for the screen */ - pScreenPriv->hdcScreen = GetDC (pScreenPriv->hwndScreen); - - return winAllocateFBShadowDDNL(pScreen); -} - -/* - * Call the wrapped CloseScreen function. - * - * Free our resources and private structures. - */ - -static Bool -winCloseScreenShadowDDNL (int nIndex, ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - Bool fReturn; - -#if CYGDEBUG - winDebug ("winCloseScreenShadowDDNL - Freeing screen resources\n"); -#endif - - /* Flag that the screen is closed */ - pScreenPriv->fClosed = TRUE; - pScreenPriv->fActive = FALSE; - - /* Call the wrapped CloseScreen procedure */ - WIN_UNWRAP(CloseScreen); - if (pScreen->CloseScreen) - fReturn = (*pScreen->CloseScreen) (nIndex, pScreen); - - winFreeFBShadowDDNL(pScreen); - - /* Free the screen DC */ - ReleaseDC (pScreenPriv->hwndScreen, pScreenPriv->hdcScreen); - - /* Delete the window property */ - RemoveProp (pScreenPriv->hwndScreen, WIN_SCR_PROP); - - /* Delete tray icon, if we have one */ - if (!pScreenInfo->fNoTrayIcon) - winDeleteNotifyIcon (pScreenPriv); - - /* Free the exit confirmation dialog box, if it exists */ - if (g_hDlgExit != NULL) - { - DestroyWindow (g_hDlgExit); - g_hDlgExit = NULL; - } - - /* Kill our window */ - if (pScreenPriv->hwndScreen) - { - DestroyWindow (pScreenPriv->hwndScreen); - pScreenPriv->hwndScreen = NULL; - } - -#if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW) - /* Destroy the thread startup mutex */ - pthread_mutex_destroy (&pScreenPriv->pmServerStarted); -#endif - - /* Kill our screeninfo's pointer to the screen */ - pScreenInfo->pScreen = NULL; - - /* Free the screen privates for this screen */ - free ((pointer) pScreenPriv); - - return fReturn; -} - - -/* - * Tell mi what sort of visuals we need. - * - * Generally we only need one visual, as our screen can only - * handle one format at a time, I believe. You may want - * to verify that last sentence. - */ - -static Bool -winInitVisualsShadowDDNL (ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - DWORD dwRedBits, dwGreenBits, dwBlueBits; - - /* Count the number of ones in each color mask */ - dwRedBits = winCountBits (pScreenPriv->dwRedMask); - dwGreenBits = winCountBits (pScreenPriv->dwGreenMask); - dwBlueBits = winCountBits (pScreenPriv->dwBlueMask); - - /* Store the maximum number of ones in a color mask as the bitsPerRGB */ - if (dwRedBits == 0 || dwGreenBits == 0 || dwBlueBits == 0) - pScreenPriv->dwBitsPerRGB = 8; - else if (dwRedBits > dwGreenBits && dwRedBits > dwBlueBits) - pScreenPriv->dwBitsPerRGB = dwRedBits; - else if (dwGreenBits > dwRedBits && dwGreenBits > dwBlueBits) - pScreenPriv->dwBitsPerRGB = dwGreenBits; - else - pScreenPriv->dwBitsPerRGB = dwBlueBits; - - winDebug ("winInitVisualsShadowDDNL - Masks %08x %08x %08x BPRGB %d d %d " - "bpp %d\n", - (unsigned int) pScreenPriv->dwRedMask, - (unsigned int) pScreenPriv->dwGreenMask, - (unsigned int) pScreenPriv->dwBlueMask, - (int) pScreenPriv->dwBitsPerRGB, - (int) pScreenInfo->dwDepth, - (int) pScreenInfo->dwBPP); - - /* Create a single visual according to the Windows screen depth */ - switch (pScreenInfo->dwDepth) - { - case 24: - case 16: - case 15: - /* Setup the real visual */ - if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth, - TrueColorMask, - pScreenPriv->dwBitsPerRGB, - -1, - pScreenPriv->dwRedMask, - pScreenPriv->dwGreenMask, - pScreenPriv->dwBlueMask)) - { - ErrorF ("winInitVisualsShadowDDNL - miSetVisualTypesAndMasks " - "failed for TrueColor\n"); - return FALSE; - } - -#ifdef XWIN_EMULATEPSEUDO - if (!pScreenInfo->fEmulatePseudo) - break; - - /* Setup a pseudocolor visual */ - if (!miSetVisualTypesAndMasks (8, - PseudoColorMask, - 8, - -1, - 0, - 0, - 0)) - { - ErrorF ("winInitVisualsShadowDDNL - miSetVisualTypesAndMasks " - "failed for PseudoColor\n"); - return FALSE; - } -#endif - break; - - case 8: - if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth, - pScreenInfo->fFullScreen - ? PseudoColorMask : StaticColorMask, - pScreenPriv->dwBitsPerRGB, - pScreenInfo->fFullScreen - ? PseudoColor : StaticColor, - pScreenPriv->dwRedMask, - pScreenPriv->dwGreenMask, - pScreenPriv->dwBlueMask)) - { - ErrorF ("winInitVisualsShadowDDNL - miSetVisualTypesAndMasks " - "failed\n"); - return FALSE; - } - break; - - default: - ErrorF ("winInitVisualsShadowDDNL - Unknown screen depth\n"); - return FALSE; - } - -#if CYGDEBUG - winDebug ("winInitVisualsShadowDDNL - Returning\n"); -#endif - - return TRUE; -} - - -/* - * Adjust the user proposed video mode - */ - -static Bool -winAdjustVideoModeShadowDDNL (ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - HDC hdc = NULL; - DWORD dwBPP; - - /* We're in serious trouble if we can't get a DC */ - hdc = GetDC (NULL); - if (hdc == NULL) - { - ErrorF ("winAdjustVideoModeShadowDDNL - GetDC () failed\n"); - return FALSE; - } - - /* Query GDI for current display depth */ - dwBPP = GetDeviceCaps (hdc, BITSPIXEL); - - /* DirectDraw can only change the depth in fullscreen mode */ - if (!(pScreenInfo->fFullScreen && - (pScreenInfo->dwBPP != WIN_DEFAULT_BPP))) - { - /* Otherwise, We'll use GDI's depth */ - pScreenInfo->dwBPP = dwBPP; - } - - /* Release our DC */ - ReleaseDC (NULL, hdc); - - return TRUE; -} - - -/* - * Blt exposed regions to the screen - */ - -static Bool -winBltExposedRegionsShadowDDNL (ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - RECT rcSrc, rcDest; - POINT ptOrigin; - HDC hdcUpdate; - PAINTSTRUCT ps; - HRESULT ddrval = DD_OK; - Bool fReturn = TRUE; - int i; - - /* Quite common case. The primary surface was lost (maybe because of depth - * change). Try to create a new primary surface. Bail out if this fails */ - if (pScreenPriv->pddsPrimary4 == NULL && pScreenPriv->fRetryCreateSurface && - !winCreatePrimarySurfaceShadowDDNL(pScreen)) - { - Sleep(100); - return FALSE; - } - if (pScreenPriv->pddsPrimary4 == NULL) - return FALSE; - - /* BeginPaint gives us an hdc that clips to the invalidated region */ - hdcUpdate = BeginPaint (pScreenPriv->hwndScreen, &ps); - if (hdcUpdate == NULL) - { - fReturn = FALSE; - ErrorF ("winBltExposedRegionsShadowDDNL - BeginPaint () returned " - "a NULL device context handle. Aborting blit attempt.\n"); - goto winBltExposedRegionsShadowDDNL_Exit; - } - - /* Get the origin of the window in the screen coords */ - ptOrigin.x = pScreenInfo->dwXOffset; - ptOrigin.y = pScreenInfo->dwYOffset; - - MapWindowPoints (pScreenPriv->hwndScreen, - HWND_DESKTOP, - (LPPOINT)&ptOrigin, 1); - rcDest.left = ptOrigin.x; - rcDest.right = ptOrigin.x + pScreenInfo->dwWidth; - rcDest.top = ptOrigin.y; - rcDest.bottom = ptOrigin.y + pScreenInfo->dwHeight; - - /* Source can be entire shadow surface, as Blt should clip for us */ - rcSrc.left = 0; - rcSrc.top = 0; - rcSrc.right = pScreenInfo->dwWidth; - rcSrc.bottom = pScreenInfo->dwHeight; - - /* Try to regain the primary surface and blit again if we've lost it */ - for (i = 0; i <= WIN_REGAIN_SURFACE_RETRIES; ++i) - { - /* Our Blt should be clipped to the invalidated region */ - ddrval = IDirectDrawSurface4_Blt (pScreenPriv->pddsPrimary4, - &rcDest, - pScreenPriv->pddsShadow4, - &rcSrc, - DDBLT_WAIT, - NULL); - if (ddrval == DDERR_SURFACELOST) - { - /* Surface was lost */ - winErrorFVerb (1, "winBltExposedRegionsShadowDDNL - " - "IDirectDrawSurface4_Blt reported that the primary " - "surface was lost, trying to restore, retry: %d\n", i + 1); - - /* Try to restore the surface, once */ - - ddrval = IDirectDrawSurface4_Restore (pScreenPriv->pddsPrimary4); - winDebug ("winBltExposedRegionsShadowDDNL - " - "IDirectDrawSurface4_Restore returned: "); - if (ddrval == DD_OK) - winDebug ("DD_OK\n"); - else if (ddrval == DDERR_WRONGMODE) - winDebug ("DDERR_WRONGMODE\n"); - else if (ddrval == DDERR_INCOMPATIBLEPRIMARY) - winDebug ("DDERR_INCOMPATIBLEPRIMARY\n"); - else if (ddrval == DDERR_UNSUPPORTED) - winDebug ("DDERR_UNSUPPORTED\n"); - else if (ddrval == DDERR_INVALIDPARAMS) - winDebug ("DDERR_INVALIDPARAMS\n"); - else if (ddrval == DDERR_INVALIDOBJECT) - winDebug ("DDERR_INVALIDOBJECT\n"); - else - winDebug ("unknown error: %08x\n", (unsigned int) ddrval); - - /* Loop around to try the blit one more time */ - continue; - } - else if (FAILED (ddrval)) - { - fReturn = FALSE; - winErrorFVerb (1, "winBltExposedRegionsShadowDDNL - " - "IDirectDrawSurface4_Blt failed, but surface not " - "lost: %08x %d\n", - (unsigned int) ddrval, (int) ddrval); - goto winBltExposedRegionsShadowDDNL_Exit; - } - else - { - /* Success, stop looping */ - break; - } - } - - winBltExposedRegionsShadowDDNL_Exit: - /* EndPaint frees the DC */ - if (hdcUpdate != NULL) - EndPaint (pScreenPriv->hwndScreen, &ps); - return fReturn; -} - - -/* - * Do any engine-specific application-activation processing - */ - -static Bool -winActivateAppShadowDDNL (ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - - /* - * Do we have a surface? - * Are we active? - * Are we full screen? - */ - if (pScreenPriv != NULL - && pScreenPriv->pddsPrimary4 != NULL - && pScreenPriv->fActive) - { - /* Primary surface was lost, restore it */ - IDirectDrawSurface4_Restore (pScreenPriv->pddsPrimary4); - } - - return TRUE; -} - - -/* - * Reblit the shadow framebuffer to the screen. - */ - -static Bool -winRedrawScreenShadowDDNL (ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - HRESULT ddrval = DD_OK; - RECT rcSrc, rcDest; - POINT ptOrigin; - - /* Get the origin of the window in the screen coords */ - ptOrigin.x = pScreenInfo->dwXOffset; - ptOrigin.y = pScreenInfo->dwYOffset; - MapWindowPoints (pScreenPriv->hwndScreen, - HWND_DESKTOP, - (LPPOINT)&ptOrigin, 1); - rcDest.left = ptOrigin.x; - rcDest.right = ptOrigin.x + pScreenInfo->dwWidth; - rcDest.top = ptOrigin.y; - rcDest.bottom = ptOrigin.y + pScreenInfo->dwHeight; - - /* Source can be entire shadow surface, as Blt should clip for us */ - rcSrc.left = 0; - rcSrc.top = 0; - rcSrc.right = pScreenInfo->dwWidth; - rcSrc.bottom = pScreenInfo->dwHeight; - - /* Redraw the whole window, to take account for the new colors */ - ddrval = IDirectDrawSurface4_Blt (pScreenPriv->pddsPrimary4, - &rcDest, - pScreenPriv->pddsShadow4, - &rcSrc, - DDBLT_WAIT, - NULL); - if (FAILED (ddrval)) - { - ErrorF ("winRedrawScreenShadowDDNL - IDirectDrawSurface4_Blt () " - "failed: %08x\n", - (unsigned int) ddrval); - } - - return TRUE; -} - - -/* - * Realize the currently installed colormap - */ - -static Bool -winRealizeInstalledPaletteShadowDDNL (ScreenPtr pScreen) -{ - return TRUE; -} - - -/* - * Install the specified colormap - */ - -static Bool -winInstallColormapShadowDDNL (ColormapPtr pColormap) -{ - ScreenPtr pScreen = pColormap->pScreen; - winScreenPriv(pScreen); - winCmapPriv(pColormap); - HRESULT ddrval = DD_OK; - - /* Install the DirectDraw palette on the primary surface */ - ddrval = IDirectDrawSurface4_SetPalette (pScreenPriv->pddsPrimary4, - pCmapPriv->lpDDPalette); - if (FAILED (ddrval)) - { - ErrorF ("winInstallColormapShadowDDNL - Failed installing the " - "DirectDraw palette.\n"); - return FALSE; - } - - /* Save a pointer to the newly installed colormap */ - pScreenPriv->pcmapInstalled = pColormap; - - return TRUE; -} - - -/* - * Store the specified colors in the specified colormap - */ - -static Bool -winStoreColorsShadowDDNL (ColormapPtr pColormap, - int ndef, - xColorItem *pdefs) -{ - ScreenPtr pScreen = pColormap->pScreen; - winScreenPriv(pScreen); - winCmapPriv(pColormap); - ColormapPtr curpmap = pScreenPriv->pcmapInstalled; - HRESULT ddrval = DD_OK; - - /* Put the X colormap entries into the Windows logical palette */ - ddrval = IDirectDrawPalette_SetEntries (pCmapPriv->lpDDPalette, - 0, - pdefs[0].pixel, - ndef, - pCmapPriv->peColors - + pdefs[0].pixel); - if (FAILED (ddrval)) - { - ErrorF ("winStoreColorsShadowDDNL - SetEntries () failed: %08x\n", (unsigned int) ddrval); - return FALSE; - } - - /* Don't install the DirectDraw palette if the colormap is not installed */ - if (pColormap != curpmap) - { - return TRUE; - } - - if (!winInstallColormapShadowDDNL (pColormap)) - { - ErrorF ("winStoreColorsShadowDDNL - Failed installing colormap\n"); - return FALSE; - } - - return TRUE; -} - - -/* - * Colormap initialization procedure - */ - -static Bool -winCreateColormapShadowDDNL (ColormapPtr pColormap) -{ - HRESULT ddrval = DD_OK; - ScreenPtr pScreen = pColormap->pScreen; - winScreenPriv(pScreen); - winCmapPriv(pColormap); - - /* Create a DirectDraw palette */ - ddrval = IDirectDraw4_CreatePalette (pScreenPriv->pdd4, - DDPCAPS_8BIT | DDPCAPS_ALLOW256, - pCmapPriv->peColors, - &pCmapPriv->lpDDPalette, - NULL); - if (FAILED (ddrval)) - { - ErrorF ("winCreateColormapShadowDDNL - CreatePalette failed\n"); - return FALSE; - } - - return TRUE; -} - - -/* - * Colormap destruction procedure - */ - -static Bool -winDestroyColormapShadowDDNL (ColormapPtr pColormap) -{ - winScreenPriv(pColormap->pScreen); - winCmapPriv(pColormap); - HRESULT ddrval = DD_OK; - - /* - * Is colormap to be destroyed the default? - * - * Non-default colormaps should have had winUninstallColormap - * called on them before we get here. The default colormap - * will not have had winUninstallColormap called on it. Thus, - * we need to handle the default colormap in a special way. - */ - if (pColormap->flags & IsDefault) - { -#if CYGDEBUG - winDebug ("winDestroyColormapShadowDDNL - Destroying default colormap\n"); -#endif - - /* - * FIXME: Walk the list of all screens, popping the default - * palette out of each screen device context. - */ - - /* Pop the palette out of the primary surface */ - ddrval = IDirectDrawSurface4_SetPalette (pScreenPriv->pddsPrimary4, - NULL); - if (FAILED (ddrval)) - { - ErrorF ("winDestroyColormapShadowDDNL - Failed freeing the " - "default colormap DirectDraw palette.\n"); - return FALSE; - } - - /* Clear our private installed colormap pointer */ - pScreenPriv->pcmapInstalled = NULL; - } - - /* Release the palette */ - IDirectDrawPalette_Release (pCmapPriv->lpDDPalette); - - /* Invalidate the colormap privates */ - pCmapPriv->lpDDPalette = NULL; - - return TRUE; -} - - -/* - * Set pointers to our engine specific functions - */ - -Bool -winSetEngineFunctionsShadowDDNL (ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - - /* Set our pointers */ - pScreenPriv->pwinAllocateFB = winAllocateFBShadowDDNL; - pScreenPriv->pwinFreeFB = winFreeFBShadowDDNL; - pScreenPriv->pwinShadowUpdate = winShadowUpdateDDNL; - pScreenPriv->pwinInitScreen = winInitScreenShadowDDNL; - pScreenPriv->pwinCloseScreen = winCloseScreenShadowDDNL; - pScreenPriv->pwinInitVisuals = winInitVisualsShadowDDNL; - pScreenPriv->pwinAdjustVideoMode = winAdjustVideoModeShadowDDNL; - if (pScreenInfo->fFullScreen) - pScreenPriv->pwinCreateBoundingWindow = winCreateBoundingWindowFullScreen; - else - pScreenPriv->pwinCreateBoundingWindow = winCreateBoundingWindowWindowed; - pScreenPriv->pwinFinishScreenInit = winFinishScreenInitFB; - pScreenPriv->pwinBltExposedRegions = winBltExposedRegionsShadowDDNL; - pScreenPriv->pwinActivateApp = winActivateAppShadowDDNL; - pScreenPriv->pwinRedrawScreen = winRedrawScreenShadowDDNL; - pScreenPriv->pwinRealizeInstalledPalette - = winRealizeInstalledPaletteShadowDDNL; - pScreenPriv->pwinInstallColormap = winInstallColormapShadowDDNL; - pScreenPriv->pwinStoreColors = winStoreColorsShadowDDNL; - pScreenPriv->pwinCreateColormap = winCreateColormapShadowDDNL; - pScreenPriv->pwinDestroyColormap = winDestroyColormapShadowDDNL; - pScreenPriv->pwinHotKeyAltTab = (winHotKeyAltTabProcPtr) (void (*)(void))NoopDDA; - pScreenPriv->pwinCreatePrimarySurface = winCreatePrimarySurfaceShadowDDNL; - pScreenPriv->pwinReleasePrimarySurface = winReleasePrimarySurfaceShadowDDNL; -#ifdef XWIN_MULTIWINDOW - pScreenPriv->pwinFinishCreateWindowsWindow - = winFinishCreateWindowsWindowDDNL; -#endif - - return TRUE; -} +/*
+ *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
+ *
+ *Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ *"Software"), to deal in the Software without restriction, including
+ *without limitation the rights to use, copy, modify, merge, publish,
+ *distribute, sublicense, and/or sell copies of the Software, and to
+ *permit persons to whom the Software is furnished to do so, subject to
+ *the following conditions:
+ *
+ *The above copyright notice and this permission notice shall be
+ *included in all copies or substantial portions of the Software.
+ *
+ *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
+ *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+ *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Dakshinamurthy Karra
+ * Suhaib M Siddiqi
+ * Peter Busch
+ * Harold L Hunt II
+ */
+
+#ifdef HAVE_XWIN_CONFIG_H
+#include <xwin-config.h>
+#endif
+#include "win.h"
+
+
+/*
+ * FIXME: Headers are broken, DEFINE_GUID doesn't work correctly,
+ * so we have to redefine it here.
+ */
+#ifndef _MSC_VER
+#ifdef DEFINE_GUID
+#undef DEFINE_GUID
+#define DEFINE_GUID(n,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) const GUID n GUID_SECT = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}
+#endif /* DEFINE_GUID */
+#endif
+
+/*
+ * FIXME: Headers are broken, IID_IDirectDraw4 has to be defined
+ * here manually. Should be handled by ddraw.h
+ */
+#ifndef IID_IDirectDraw4
+DEFINE_GUID( IID_IDirectDraw4, 0x9c59509a,0x39bd,0x11d1,0x8c,0x4a,0x00,0xc0,0x4f,0xd9,0x30,0xc5 );
+#endif /* IID_IDirectDraw4 */
+
+#define FAIL_MSG_MAX_BLT 10
+
+
+/*
+ * Local prototypes
+ */
+
+static Bool
+winAllocateFBShadowDDNL (ScreenPtr pScreen);
+
+static void
+winShadowUpdateDDNL (ScreenPtr pScreen,
+ shadowBufPtr pBuf);
+
+static Bool
+winCloseScreenShadowDDNL (int nIndex, ScreenPtr pScreen);
+
+static Bool
+winInitVisualsShadowDDNL (ScreenPtr pScreen);
+
+static Bool
+winAdjustVideoModeShadowDDNL (ScreenPtr pScreen);
+
+static Bool
+winBltExposedRegionsShadowDDNL (ScreenPtr pScreen);
+
+static Bool
+winActivateAppShadowDDNL (ScreenPtr pScreen);
+
+static Bool
+winRedrawScreenShadowDDNL (ScreenPtr pScreen);
+
+static Bool
+winRealizeInstalledPaletteShadowDDNL (ScreenPtr pScreen);
+
+static Bool
+winInstallColormapShadowDDNL (ColormapPtr pColormap);
+
+static Bool
+winStoreColorsShadowDDNL (ColormapPtr pmap,
+ int ndef,
+ xColorItem *pdefs);
+
+static Bool
+winCreateColormapShadowDDNL (ColormapPtr pColormap);
+
+static Bool
+winDestroyColormapShadowDDNL (ColormapPtr pColormap);
+
+static Bool
+winCreatePrimarySurfaceShadowDDNL (ScreenPtr pScreen);
+
+static Bool
+winReleasePrimarySurfaceShadowDDNL (ScreenPtr pScreen);
+
+static HRESULT myIDirectDrawSurface4_Blt( ScreenPtr pScreen, RECT *pRect, RECT *prcSrc)
+{
+ HRESULT ddrval = DD_OK;
+ unsigned i;
+ winScreenPriv(pScreen);
+
+ for (i = 0; i < 3; ++i)
+ {
+ ddrval = IDirectDrawSurface4_Blt(pScreenPriv->pddsPrimary4, pRect, pScreenPriv->pddsShadow4, prcSrc, DDBLT_WAIT, NULL);
+ /* Try to regain the primary surface and blit again if we've lost it */
+ if (ddrval == DDERR_SURFACELOST)
+ {
+ /* Surface was lost */
+ ErrorF ("IDirectDrawSurface4_Blt reported that the primary "
+ "surface was lost, trying to restore, retry: %d\n", i + 1);
+
+ /* Try to restore the surface, once */
+
+ if (i==1)
+ {
+ ErrorF("Recreating DDraw surface because restoring of surface didn't work.\n");
+ winAllocateFBShadowDDNL(pScreen);
+ }
+ else
+ {
+ ddrval = IDirectDraw4_RestoreAllSurfaces (pScreenPriv->pdd4);
+ ErrorF ("IDirectDraw4_RestoreAllSurfaces returned: ");
+ if (ddrval == DD_OK)
+ ErrorF ("DD_OK\n");
+ else if (ddrval == DDERR_WRONGMODE)
+ ErrorF ("DDERR_WRONGMODE\n");
+ else if (ddrval == DDERR_INCOMPATIBLEPRIMARY)
+ ErrorF ("DDERR_INCOMPATIBLEPRIMARY\n");
+ else if (ddrval == DDERR_UNSUPPORTED)
+ ErrorF ("DDERR_UNSUPPORTED\n");
+ else if (ddrval == DDERR_INVALIDPARAMS)
+ ErrorF ("DDERR_INVALIDPARAMS\n");
+ else if (ddrval == DDERR_INVALIDOBJECT)
+ ErrorF ("DDERR_INVALIDOBJECT\n");
+ else
+ ErrorF ("unknown error: %08x\n", ddrval);
+ }
+ /* Loop around to try the blit one more time */
+ continue;
+ }
+ else if (FAILED (ddrval))
+ {
+ ErrorF ("IDirectDrawSurface4_Blt failed, but surface not "
+ "lost: %08x %d\n", ddrval, ddrval);
+ }
+ break;
+ }
+ return ddrval;
+}
+
+
+/*
+ * Create the primary surface and attach the clipper.
+ * Used for both the initial surface creation and during
+ * WM_DISPLAYCHANGE messages.
+ */
+
+static Bool
+winCreatePrimarySurfaceShadowDDNL (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ HRESULT ddrval = DD_OK;
+ DDSURFACEDESC2 ddsd;
+
+ winDebug ("winCreatePrimarySurfaceShadowDDNL - Creating primary surface\n");
+
+ /* Describe the primary surface */
+ ZeroMemory (&ddsd, sizeof (ddsd));
+ ddsd.dwSize = sizeof (ddsd);
+ ddsd.dwFlags = DDSD_CAPS;
+ ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
+
+ /* Create the primary surface */
+ ddrval = IDirectDraw4_CreateSurface (pScreenPriv->pdd4,
+ &ddsd,
+ &pScreenPriv->pddsPrimary4,
+ NULL);
+ pScreenPriv->fRetryCreateSurface = FALSE;
+ if (FAILED (ddrval))
+ {
+ if (ddrval == DDERR_NOEXCLUSIVEMODE)
+ {
+ /* Recreating the surface failed. Mark screen to retry later */
+ pScreenPriv->fRetryCreateSurface = TRUE;
+ winDebug ("winCreatePrimarySurfaceShadowDDNL - Could not create "
+ "primary surface: DDERR_NOEXCLUSIVEMODE\n");
+ }
+ else
+ {
+ ErrorF ("winCreatePrimarySurfaceShadowDDNL - Could not create "
+ "primary surface: %08x\n", (unsigned int) ddrval);
+ }
+ return FALSE;
+ }
+
+ winDebug ("winCreatePrimarySurfaceShadowDDNL - Created primary surface\n");
+
+ /* Attach our clipper to our primary surface handle */
+ ddrval = IDirectDrawSurface4_SetClipper (pScreenPriv->pddsPrimary4,
+ pScreenPriv->pddcPrimary);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winCreatePrimarySurfaceShadowDDNL - Primary attach clipper "
+ "failed: %08x\n",
+ (unsigned int) ddrval);
+ return FALSE;
+ }
+
+ winDebug ("winCreatePrimarySurfaceShadowDDNL - Attached clipper to primary "
+ "surface\n");
+
+ /* Everything was correct */
+ return TRUE;
+}
+
+
+static void ClosePrimarySurfaceShadowDDNL (winPrivScreenPtr pScreenPriv)
+{
+ /* Release the primary surface and clipper, if they exist */
+ if (pScreenPriv->pddsPrimary4)
+ {
+ /*
+ * Detach the clipper from the primary surface.
+ * NOTE: We do this explicity for clarity. The Clipper is not released.
+ */
+ IDirectDrawSurface4_SetClipper (pScreenPriv->pddsPrimary4, NULL);
+
+ winDebug ("winReleasePrimarySurfaceShadowDDNL - Detached clipper\n");
+
+ /* Release the primary surface */
+ IDirectDrawSurface4_Release (pScreenPriv->pddsPrimary4);
+ pScreenPriv->pddsPrimary4 = NULL;
+ }
+
+}
+
+static void ReleaseDDNL(winPrivScreenPtr pScreenPriv)
+{
+ /* Release the clipper object */
+ if (pScreenPriv->pddcPrimary)
+ {
+ IDirectDrawClipper_Release (pScreenPriv->pddcPrimary);
+ pScreenPriv->pddcPrimary = NULL;
+ }
+
+ /* Free the DirectDraw4 object, if there is one */
+ if (pScreenPriv->pdd4)
+ {
+ IDirectDraw4_RestoreDisplayMode (pScreenPriv->pdd4);
+ IDirectDraw4_Release (pScreenPriv->pdd4);
+ pScreenPriv->pdd4 = NULL;
+ }
+
+ /* Free the DirectDraw object, if there is one */
+ if (pScreenPriv->pdd)
+ {
+ IDirectDraw_Release (pScreenPriv->pdd);
+ pScreenPriv->pdd = NULL;
+ }
+}
+
+/*
+ * Detach the clipper and release the primary surface.
+ * Called from WM_DISPLAYCHANGE.
+ */
+
+static Bool
+winReleasePrimarySurfaceShadowDDNL (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+
+ winDebug ("winReleasePrimarySurfaceShadowDDNL - Hello\n");
+
+ ClosePrimarySurfaceShadowDDNL(pScreenPriv);
+
+ winDebug ("winReleasePrimarySurfaceShadowDDNL - Released primary surface\n");
+
+ return TRUE;
+}
+
+
+/*
+ * Create a DirectDraw surface for the shadow framebuffer; also create
+ * a primary surface object so we can blit to the display.
+ *
+ * Install a DirectDraw clipper on our primary surface object
+ * that clips our blits to the unobscured client area of our display window.
+ */
+
+Bool
+winAllocateFBShadowDDNL (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ HRESULT ddrval = DD_OK;
+ DDSURFACEDESC2 ddsdShadow;
+ char *lpSurface = NULL;
+ DDPIXELFORMAT ddpfPrimary;
+
+ winDebug ("winAllocateFBShadowDDNL - w %d h %d d %d\n",
+ pScreenInfo->dwWidth, pScreenInfo->dwHeight, pScreenInfo->dwDepth);
+
+ /* Set the padded screen width */
+ pScreenInfo->dwPaddedWidth = PixmapBytePad (pScreenInfo->dwWidth,
+ pScreenInfo->dwBPP);
+
+ if ( pScreenInfo->pfb)
+ {
+ ErrorF("winAllocateFBShadowDDNL calling for the second time, reallocating\n");
+ lpSurface=pScreenInfo->pfb;
+
+ if (pScreenPriv->pddsShadow4)
+ {
+ IDirectDrawSurface4_Release (pScreenPriv->pddsShadow4);
+ pScreenPriv->pddsShadow4 = NULL;
+ }
+ ClosePrimarySurfaceShadowDDNL(pScreenPriv);
+ ReleaseDDNL(pScreenPriv);
+ }
+ else
+ {
+ /* Allocate memory for our shadow surface */
+ lpSurface = malloc (pScreenInfo->dwPaddedWidth * pScreenInfo->dwHeight);
+ if (lpSurface == NULL)
+ {
+ ErrorF ("winAllocateFBShadowDDNL - Could not allocate bits\n");
+ return FALSE;
+ }
+
+ /*
+ * Initialize the framebuffer memory so we don't get a
+ * strange display at startup
+ */
+ ZeroMemory (lpSurface, pScreenInfo->dwPaddedWidth * pScreenInfo->dwHeight);
+ }
+ /* Create a clipper */
+ ddrval = (*g_fpDirectDrawCreateClipper) (0,
+ &pScreenPriv->pddcPrimary,
+ NULL);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winAllocateFBShadowDDNL - Could not attach clipper: %08x\n",
+ (unsigned int) ddrval);
+ return FALSE;
+ }
+
+ winDebug ("winAllocateFBShadowDDNL - Created a clipper\n");
+
+ /* Attach the clipper to our display window */
+ ddrval = IDirectDrawClipper_SetHWnd (pScreenPriv->pddcPrimary,
+ 0,
+ pScreenPriv->hwndScreen);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winAllocateFBShadowDDNL - Clipper not attached "
+ "to window: %08x\n",
+ (unsigned int) ddrval);
+ return FALSE;
+ }
+
+ winDebug ("winAllocateFBShadowDDNL - Attached clipper to window\n");
+
+ /* Create a DirectDraw object, store the address at lpdd */
+ ddrval = (*g_fpDirectDrawCreate) (NULL,
+ (LPDIRECTDRAW*) &pScreenPriv->pdd,
+ NULL);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winAllocateFBShadowDDNL - Could not start "
+ "DirectDraw: %08x\n",
+ (unsigned int) ddrval);
+ return FALSE;
+ }
+
+ winDebug ("winAllocateFBShadowDDNL - Created and initialized DD\n");
+
+ /* Get a DirectDraw4 interface pointer */
+ ddrval = IDirectDraw_QueryInterface (pScreenPriv->pdd,
+ &IID_IDirectDraw4,
+ (LPVOID*) &pScreenPriv->pdd4);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winAllocateFBShadowDDNL - Failed DD4 query: %08x\n",
+ (unsigned int) ddrval);
+ return FALSE;
+ }
+
+ /* Are we full screen? */
+ if (pScreenInfo->fFullScreen)
+ {
+ DDSURFACEDESC2 ddsdCurrent;
+ DWORD dwRefreshRateCurrent = 0;
+ HDC hdc = NULL;
+
+ /* Set the cooperative level to full screen */
+ ddrval = IDirectDraw4_SetCooperativeLevel (pScreenPriv->pdd4,
+ pScreenPriv->hwndScreen,
+ DDSCL_EXCLUSIVE
+ | DDSCL_FULLSCREEN);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winAllocateFBShadowDDNL - Could not set "
+ "cooperative level: %08x\n",
+ (unsigned int) ddrval);
+ return FALSE;
+ }
+
+ /*
+ * We only need to get the current refresh rate for comparison
+ * if a refresh rate has been passed on the command line.
+ */
+ if (pScreenInfo->dwRefreshRate != 0)
+ {
+ ZeroMemory (&ddsdCurrent, sizeof (ddsdCurrent));
+ ddsdCurrent.dwSize = sizeof (ddsdCurrent);
+
+ /* Get information about current display settings */
+ ddrval = IDirectDraw4_GetDisplayMode (pScreenPriv->pdd4,
+ &ddsdCurrent);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winAllocateFBShadowDDNL - Could not get current "
+ "refresh rate: %08x. Continuing.\n",
+ (unsigned int) ddrval);
+ dwRefreshRateCurrent = 0;
+ }
+ else
+ {
+ /* Grab the current refresh rate */
+ dwRefreshRateCurrent = ddsdCurrent.u2.dwRefreshRate;
+ }
+ }
+
+ /* Clean up the refresh rate */
+ if (dwRefreshRateCurrent == pScreenInfo->dwRefreshRate)
+ {
+ /*
+ * Refresh rate is non-specified or equal to current.
+ */
+ pScreenInfo->dwRefreshRate = 0;
+ }
+
+ /* Grab a device context for the screen */
+ hdc = GetDC (NULL);
+ if (hdc == NULL)
+ {
+ ErrorF ("winAllocateFBShadowDDNL - GetDC () failed\n");
+ return FALSE;
+ }
+
+ /* Only change the video mode when different than current mode */
+ if (!pScreenInfo->fMultipleMonitors
+ && (pScreenInfo->dwWidth != GetSystemMetrics (SM_CXSCREEN)
+ || pScreenInfo->dwHeight != GetSystemMetrics (SM_CYSCREEN)
+ || pScreenInfo->dwBPP != GetDeviceCaps (hdc, BITSPIXEL)
+ || pScreenInfo->dwRefreshRate != 0))
+ {
+ winDebug ("winAllocateFBShadowDDNL - Changing video mode\n");
+
+ /* Change the video mode to the mode requested, and use the driver default refresh rate on failure */
+ ddrval = IDirectDraw4_SetDisplayMode (pScreenPriv->pdd4,
+ pScreenInfo->dwWidth,
+ pScreenInfo->dwHeight,
+ pScreenInfo->dwBPP,
+ pScreenInfo->dwRefreshRate,
+ 0);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winAllocateFBShadowDDNL - Could not set "
+ "full screen display mode: %08x\n",
+ (unsigned int) ddrval);
+ ErrorF ("winAllocateFBShadowDDNL - Using default driver refresh rate\n");
+ ddrval = IDirectDraw4_SetDisplayMode (pScreenPriv->pdd4,
+ pScreenInfo->dwWidth,
+ pScreenInfo->dwHeight,
+ pScreenInfo->dwBPP,
+ 0,
+ 0);
+ if (FAILED(ddrval))
+ {
+ ErrorF ("winAllocateFBShadowDDNL - Could not set default refresh rate "
+ "full screen display mode: %08x\n",
+ (unsigned int) ddrval);
+ return FALSE;
+ }
+ }
+ }
+ else
+ {
+ winDebug ("winAllocateFBShadowDDNL - Not changing video mode\n");
+ }
+
+ /* Release our DC */
+ ReleaseDC (NULL, hdc);
+ hdc = NULL;
+ }
+ else
+ {
+ /* Set the cooperative level for windowed mode */
+ ddrval = IDirectDraw4_SetCooperativeLevel (pScreenPriv->pdd4,
+ pScreenPriv->hwndScreen,
+ DDSCL_NORMAL);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winAllocateFBShadowDDNL - Could not set "
+ "cooperative level: %08x\n",
+ (unsigned int) ddrval);
+ return FALSE;
+ }
+ }
+
+ /* Create the primary surface */
+ if (!winCreatePrimarySurfaceShadowDDNL (pScreen))
+ {
+ ErrorF ("winAllocateFBShadowDDNL - winCreatePrimarySurfaceShadowDDNL "
+ "failed\n");
+ return FALSE;
+ }
+
+ /* Get primary surface's pixel format */
+ ZeroMemory (&ddpfPrimary, sizeof (ddpfPrimary));
+ ddpfPrimary.dwSize = sizeof (ddpfPrimary);
+ ddrval = IDirectDrawSurface4_GetPixelFormat (pScreenPriv->pddsPrimary4,
+ &ddpfPrimary);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winAllocateFBShadowDDNL - Could not get primary "
+ "pixformat: %08x\n",
+ (unsigned int) ddrval);
+ return FALSE;
+ }
+
+ winDebug ("winAllocateFBShadowDDNL - Primary masks: %08x %08x %08x "
+ "dwRGBBitCount: %d\n",
+ ddpfPrimary.u2.dwRBitMask,
+ ddpfPrimary.u3.dwGBitMask,
+ ddpfPrimary.u4.dwBBitMask,
+ ddpfPrimary.u1.dwRGBBitCount);
+
+ /* Describe the shadow surface to be created */
+ /*
+ * NOTE: Do not use a DDSCAPS_VIDEOMEMORY surface,
+ * as drawing, locking, and unlocking take forever
+ * with video memory surfaces. In addition,
+ * video memory is a somewhat scarce resource,
+ * so you shouldn't be allocating video memory when
+ * you have the option of using system memory instead.
+ */
+ ZeroMemory (&ddsdShadow, sizeof (ddsdShadow));
+ ddsdShadow.dwSize = sizeof (ddsdShadow);
+ ddsdShadow.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH
+ | DDSD_LPSURFACE | DDSD_PITCH | DDSD_PIXELFORMAT;
+ ddsdShadow.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY;
+ ddsdShadow.dwHeight = pScreenInfo->dwHeight;
+ ddsdShadow.dwWidth = pScreenInfo->dwWidth;
+ ddsdShadow.u1.lPitch = pScreenInfo->dwPaddedWidth;
+ ddsdShadow.lpSurface = lpSurface;
+ ddsdShadow.u4.ddpfPixelFormat = ddpfPrimary;
+
+ winDebug ("winAllocateFBShadowDDNL - lPitch: %d\n",
+ (int) pScreenInfo->dwPaddedWidth);
+
+ /* Create the shadow surface */
+ ddrval = IDirectDraw4_CreateSurface (pScreenPriv->pdd4,
+ &ddsdShadow,
+ &pScreenPriv->pddsShadow4,
+ NULL);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winAllocateFBShadowDDNL - Could not create shadow "
+ "surface: %08x\n", (unsigned int) ddrval);
+ return FALSE;
+ }
+
+ winDebug ("winAllocateFBShadowDDNL - Created shadow pitch: %d\n",
+ (int) ddsdShadow.u1.lPitch);
+
+ /* Grab the pitch from the surface desc */
+ pScreenInfo->dwStride = (ddsdShadow.u1.lPitch * 8)
+ / pScreenInfo->dwBPP;
+
+ winDebug ("winAllocateFBShadowDDNL - Created shadow stride: %d\n",
+ (int) pScreenInfo->dwStride);
+
+ /* Save the pointer to our surface memory */
+ pScreenInfo->pfb = lpSurface;
+
+ /* Grab the masks from the surface description */
+ pScreenPriv->dwRedMask = ddsdShadow.u4.ddpfPixelFormat.u2.dwRBitMask;
+ pScreenPriv->dwGreenMask = ddsdShadow.u4.ddpfPixelFormat.u3.dwGBitMask;
+ pScreenPriv->dwBlueMask = ddsdShadow.u4.ddpfPixelFormat.u4.dwBBitMask;
+
+ winDebug ("winAllocateFBShadowDDNL - Returning\n");
+
+ return TRUE;
+}
+
+static void
+winFreeFBShadowDDNL(ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+
+ /* Free the shadow surface, if there is one */
+ if (pScreenPriv->pddsShadow4)
+ {
+ IDirectDrawSurface4_Release (pScreenPriv->pddsShadow4);
+ free (pScreenInfo->pfb);
+ pScreenInfo->pfb = NULL;
+ pScreenPriv->pddsShadow4 = NULL;
+ }
+
+ /* Detach the clipper from the primary surface and release the primary surface, if there is one */
+ winReleasePrimarySurfaceShadowDDNL(pScreen);
+
+ ReleaseDDNL(pScreenPriv);
+
+ /* Invalidate the ScreenInfo's fb pointer */
+ pScreenInfo->pfb = NULL;
+}
+
+#if defined(XWIN_MULTIWINDOW) || defined(XWIN_MULTIWINDOWEXTWM)
+/*
+ * Create a DirectDraw surface for the new multi-window window
+ */
+
+static
+Bool
+winFinishCreateWindowsWindowDDNL (WindowPtr pWin)
+{
+ winWindowPriv(pWin);
+ winPrivScreenPtr pScreenPriv = pWinPriv->pScreenPriv;
+ HRESULT ddrval = DD_OK;
+ DDSURFACEDESC2 ddsd;
+ int iWidth, iHeight;
+ int iX, iY;
+
+ winDebug ("winFinishCreateWindowsWindowDDNL!\n\n");
+
+ iX = pWin->drawable.x + GetSystemMetrics (SM_XVIRTUALSCREEN);
+ iY = pWin->drawable.y + GetSystemMetrics (SM_YVIRTUALSCREEN);
+
+ iWidth = pWin->drawable.width;
+ iHeight = pWin->drawable.height;
+
+ /* Describe the primary surface */
+ ZeroMemory (&ddsd, sizeof (ddsd));
+ ddsd.dwSize = sizeof (ddsd);
+ ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT;
+ ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
+ ddsd.dwHeight = iHeight;
+ ddsd.dwWidth = iWidth;
+
+ /* Create the primary surface */
+ ddrval = IDirectDraw4_CreateSurface (pScreenPriv->pdd4,
+ &ddsd,
+ &pWinPriv->pddsPrimary4,
+ NULL);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winFinishCreateWindowsWindowDDNL - Could not create primary "
+ "surface: %08x\n",
+ (unsigned int)ddrval);
+ return FALSE;
+ }
+ return TRUE;
+}
+#endif
+
+
+/*
+ * Transfer the damaged regions of the shadow framebuffer to the display.
+ */
+
+static void
+winShadowUpdateDDNL (ScreenPtr pScreen,
+ shadowBufPtr pBuf)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ RegionPtr damage = shadowDamage(pBuf);
+ RECT rcDest, rcSrc;
+ POINT ptOrigin;
+ DWORD dwBox = RegionNumRects (damage);
+ BoxPtr pBox = RegionRects (damage);
+ HRGN hrgnTemp = NULL, hrgnCombined = NULL;
+
+ /*
+ * Return immediately if the app is not active
+ * and we are fullscreen, or if we have a bad display depth
+ */
+ if ((!pScreenPriv->fActive && pScreenInfo->fFullScreen)
+ || pScreenPriv->fBadDepth) return;
+
+ /* Return immediately if we didn't get needed surfaces */
+ if (!pScreenPriv->pddsPrimary4 || !pScreenPriv->pddsShadow4)
+ return;
+
+ /* Get the origin of the window in the screen coords */
+ ptOrigin.x = pScreenInfo->dwXOffset;
+ ptOrigin.y = pScreenInfo->dwYOffset;
+ MapWindowPoints (pScreenPriv->hwndScreen,
+ HWND_DESKTOP,
+ (LPPOINT)&ptOrigin, 1);
+
+ /*
+ * Handle small regions with multiple blits,
+ * handle large regions by creating a clipping region and
+ * doing a single blit constrained to that clipping region.
+ */
+ if (pScreenInfo->dwClipUpdatesNBoxes == 0
+ || dwBox < pScreenInfo->dwClipUpdatesNBoxes)
+ {
+ /* Loop through all boxes in the damaged region */
+ while (dwBox--)
+ {
+ /* Assign damage box to source rectangle */
+ rcSrc.left = pBox->x1;
+ rcSrc.top = pBox->y1;
+ rcSrc.right = pBox->x2;
+ rcSrc.bottom = pBox->y2;
+
+ /* Calculate destination rectangle */
+ rcDest.left = ptOrigin.x + rcSrc.left;
+ rcDest.top = ptOrigin.y + rcSrc.top;
+ rcDest.right = ptOrigin.x + rcSrc.right;
+ rcDest.bottom = ptOrigin.y + rcSrc.bottom;
+
+ /* Blit the damaged areas */
+ if (pScreenPriv->pddsPrimary4)
+ myIDirectDrawSurface4_Blt (pScreen,
+ &rcDest,
+ &rcSrc);
+
+ /* Get a pointer to the next box */
+ ++pBox;
+ }
+ }
+ else
+ {
+ BoxPtr pBoxExtents = RegionExtents(damage);
+
+ /* Compute a GDI region from the damaged region */
+ hrgnCombined = CreateRectRgn (pBox->x1, pBox->y1, pBox->x2, pBox->y2);
+ dwBox--;
+ pBox++;
+ while (dwBox--)
+ {
+ hrgnTemp = CreateRectRgn (pBox->x1, pBox->y1, pBox->x2, pBox->y2);
+ CombineRgn (hrgnCombined, hrgnCombined, hrgnTemp, RGN_OR);
+ DeleteObject (hrgnTemp);
+ pBox++;
+ }
+
+ /* Install the GDI region as a clipping region */
+ SelectClipRgn (pScreenPriv->hdcScreen, hrgnCombined);
+ DeleteObject (hrgnCombined);
+ hrgnCombined = NULL;
+
+ winDebug ("winShadowUpdateDDNL - be x1 %d y1 %d x2 %d y2 %d\n",
+ pBoxExtents->x1, pBoxExtents->y1,
+ pBoxExtents->x2, pBoxExtents->y2);
+
+ /* Calculating a bounding box for the source is easy */
+ rcSrc.left = pBoxExtents->x1;
+ rcSrc.top = pBoxExtents->y1;
+ rcSrc.right = pBoxExtents->x2;
+ rcSrc.bottom = pBoxExtents->y2;
+
+ /* Calculating a bounding box for the destination is trickier */
+ rcDest.left = ptOrigin.x + rcSrc.left;
+ rcDest.top = ptOrigin.y + rcSrc.top;
+ rcDest.right = ptOrigin.x + rcSrc.right;
+ rcDest.bottom = ptOrigin.y + rcSrc.bottom;
+
+ /* Our Blt should be clipped to the invalidated region */
+ myIDirectDrawSurface4_Blt (pScreen, &rcDest, &rcSrc);
+
+ /* Reset the clip region */
+ SelectClipRgn (pScreenPriv->hdcScreen, NULL);
+ }
+}
+
+static Bool
+winInitScreenShadowDDNL(ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+
+ /* Get a device context for the screen */
+ pScreenPriv->hdcScreen = GetDC (pScreenPriv->hwndScreen);
+
+ return winAllocateFBShadowDDNL(pScreen);
+}
+
+/*
+ * Call the wrapped CloseScreen function.
+ *
+ * Free our resources and private structures.
+ */
+
+static Bool
+winCloseScreenShadowDDNL (int nIndex, ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ Bool fReturn;
+
+ winDebug ("winCloseScreenShadowDDNL - Freeing screen resources\n");
+
+ /* Flag that the screen is closed */
+ pScreenPriv->fClosed = TRUE;
+ pScreenPriv->fActive = FALSE;
+
+ /* Call the wrapped CloseScreen procedure */
+ WIN_UNWRAP(CloseScreen);
+ if (pScreen->CloseScreen)
+ fReturn = (*pScreen->CloseScreen) (nIndex, pScreen);
+
+ winFreeFBShadowDDNL(pScreen);
+
+ /* Free the screen DC */
+ ReleaseDC (pScreenPriv->hwndScreen, pScreenPriv->hdcScreen);
+
+ /* Delete the window property */
+ RemoveProp (pScreenPriv->hwndScreen, WIN_SCR_PROP);
+
+ /* Delete tray icon, if we have one */
+ if (!pScreenInfo->fNoTrayIcon)
+ winDeleteNotifyIcon (pScreenPriv);
+
+ /* Free the exit confirmation dialog box, if it exists */
+ if (g_hDlgExit != NULL)
+ {
+ DestroyWindow (g_hDlgExit);
+ g_hDlgExit = NULL;
+ }
+
+ /* Kill our window */
+ if (pScreenPriv->hwndScreen)
+ {
+ DestroyWindow (pScreenPriv->hwndScreen);
+ pScreenPriv->hwndScreen = NULL;
+ }
+
+#if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW)
+ /* Destroy the thread startup mutex */
+ pthread_mutex_destroy (&pScreenPriv->pmServerStarted);
+#endif
+
+ /* Kill our screeninfo's pointer to the screen */
+ pScreenInfo->pScreen = NULL;
+
+ /* Free the screen privates for this screen */
+ free ((pointer) pScreenPriv);
+
+ return fReturn;
+}
+
+
+/*
+ * Tell mi what sort of visuals we need.
+ *
+ * Generally we only need one visual, as our screen can only
+ * handle one format at a time, I believe. You may want
+ * to verify that last sentence.
+ */
+
+static Bool
+winInitVisualsShadowDDNL (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ DWORD dwRedBits, dwGreenBits, dwBlueBits;
+
+ /* Count the number of ones in each color mask */
+ dwRedBits = winCountBits (pScreenPriv->dwRedMask);
+ dwGreenBits = winCountBits (pScreenPriv->dwGreenMask);
+ dwBlueBits = winCountBits (pScreenPriv->dwBlueMask);
+
+ /* Store the maximum number of ones in a color mask as the bitsPerRGB */
+ if (dwRedBits == 0 || dwGreenBits == 0 || dwBlueBits == 0)
+ pScreenPriv->dwBitsPerRGB = 8;
+ else if (dwRedBits > dwGreenBits && dwRedBits > dwBlueBits)
+ pScreenPriv->dwBitsPerRGB = dwRedBits;
+ else if (dwGreenBits > dwRedBits && dwGreenBits > dwBlueBits)
+ pScreenPriv->dwBitsPerRGB = dwGreenBits;
+ else
+ pScreenPriv->dwBitsPerRGB = dwBlueBits;
+
+ winDebug ("winInitVisualsShadowDDNL - Masks %08x %08x %08x BPRGB %d d %d "
+ "bpp %d\n",
+ (unsigned int) pScreenPriv->dwRedMask,
+ (unsigned int) pScreenPriv->dwGreenMask,
+ (unsigned int) pScreenPriv->dwBlueMask,
+ (int) pScreenPriv->dwBitsPerRGB,
+ (int) pScreenInfo->dwDepth,
+ (int) pScreenInfo->dwBPP);
+
+ /* Create a single visual according to the Windows screen depth */
+ switch (pScreenInfo->dwDepth)
+ {
+ case 24:
+ case 16:
+ case 15:
+ /* Setup the real visual */
+ if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth,
+ TrueColorMask,
+ pScreenPriv->dwBitsPerRGB,
+ -1,
+ pScreenPriv->dwRedMask,
+ pScreenPriv->dwGreenMask,
+ pScreenPriv->dwBlueMask))
+ {
+ ErrorF ("winInitVisualsShadowDDNL - miSetVisualTypesAndMasks "
+ "failed for TrueColor\n");
+ return FALSE;
+ }
+
+#ifdef XWIN_EMULATEPSEUDO
+ if (!pScreenInfo->fEmulatePseudo)
+ break;
+
+ /* Setup a pseudocolor visual */
+ if (!miSetVisualTypesAndMasks (8,
+ PseudoColorMask,
+ 8,
+ -1,
+ 0,
+ 0,
+ 0))
+ {
+ ErrorF ("winInitVisualsShadowDDNL - miSetVisualTypesAndMasks "
+ "failed for PseudoColor\n");
+ return FALSE;
+ }
+#endif
+ break;
+
+ case 8:
+ if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth,
+ pScreenInfo->fFullScreen
+ ? PseudoColorMask : StaticColorMask,
+ pScreenPriv->dwBitsPerRGB,
+ pScreenInfo->fFullScreen
+ ? PseudoColor : StaticColor,
+ pScreenPriv->dwRedMask,
+ pScreenPriv->dwGreenMask,
+ pScreenPriv->dwBlueMask))
+ {
+ ErrorF ("winInitVisualsShadowDDNL - miSetVisualTypesAndMasks "
+ "failed\n");
+ return FALSE;
+ }
+ break;
+
+ default:
+ ErrorF ("winInitVisualsShadowDDNL - Unknown screen depth\n");
+ return FALSE;
+ }
+
+ winDebug ("winInitVisualsShadowDDNL - Returning\n");
+
+ return TRUE;
+}
+
+
+/*
+ * Adjust the user proposed video mode
+ */
+
+static Bool
+winAdjustVideoModeShadowDDNL (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ HDC hdc = NULL;
+ DWORD dwBPP;
+
+ /* We're in serious trouble if we can't get a DC */
+ hdc = GetDC (NULL);
+ if (hdc == NULL)
+ {
+ ErrorF ("winAdjustVideoModeShadowDDNL - GetDC () failed\n");
+ return FALSE;
+ }
+
+ /* Query GDI for current display depth */
+ dwBPP = GetDeviceCaps (hdc, BITSPIXEL);
+
+ /* DirectDraw can only change the depth in fullscreen mode */
+ if (!(pScreenInfo->fFullScreen &&
+ (pScreenInfo->dwBPP != WIN_DEFAULT_BPP)))
+ {
+ /* Otherwise, We'll use GDI's depth */
+ pScreenInfo->dwBPP = dwBPP;
+ }
+
+ /* Release our DC */
+ ReleaseDC (NULL, hdc);
+
+ return TRUE;
+}
+
+
+/*
+ * Blt exposed regions to the screen
+ */
+
+static Bool
+winBltExposedRegionsShadowDDNL (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ RECT rcSrc, rcDest;
+ POINT ptOrigin;
+ HDC hdcUpdate;
+ PAINTSTRUCT ps;
+ HRESULT ddrval = DD_OK;
+ Bool fReturn = TRUE;
+ int i;
+
+ /* Quite common case. The primary surface was lost (maybe because of depth
+ * change). Try to create a new primary surface. Bail out if this fails */
+ if (pScreenPriv->pddsPrimary4 == NULL && pScreenPriv->fRetryCreateSurface &&
+ !winCreatePrimarySurfaceShadowDDNL(pScreen))
+ {
+ Sleep(100);
+ return FALSE;
+ }
+ if (pScreenPriv->pddsPrimary4 == NULL)
+ return FALSE;
+
+ /* BeginPaint gives us an hdc that clips to the invalidated region */
+ hdcUpdate = BeginPaint (pScreenPriv->hwndScreen, &ps);
+ if (hdcUpdate == NULL)
+ {
+ fReturn = FALSE;
+ ErrorF ("winBltExposedRegionsShadowDDNL - BeginPaint () returned "
+ "a NULL device context handle. Aborting blit attempt.\n");
+ goto winBltExposedRegionsShadowDDNL_Exit;
+ }
+
+ /* Get the origin of the window in the screen coords */
+ ptOrigin.x = pScreenInfo->dwXOffset;
+ ptOrigin.y = pScreenInfo->dwYOffset;
+
+ MapWindowPoints (pScreenPriv->hwndScreen,
+ HWND_DESKTOP,
+ (LPPOINT)&ptOrigin, 1);
+ rcDest.left = ptOrigin.x;
+ rcDest.right = ptOrigin.x + pScreenInfo->dwWidth;
+ rcDest.top = ptOrigin.y;
+ rcDest.bottom = ptOrigin.y + pScreenInfo->dwHeight;
+
+ /* Source can be entire shadow surface, as Blt should clip for us */
+ rcSrc.left = 0;
+ rcSrc.top = 0;
+ rcSrc.right = pScreenInfo->dwWidth;
+ rcSrc.bottom = pScreenInfo->dwHeight;
+
+ /* Our Blt should be clipped to the invalidated region */
+ ddrval = myIDirectDrawSurface4_Blt (pScreen, &rcDest, &rcSrc);
+ if (FAILED (ddrval))
+ {
+ fReturn = FALSE;
+ }
+
+winBltExposedRegionsShadowDDNL_Exit:
+ /* EndPaint frees the DC */
+ if (hdcUpdate != NULL)
+ EndPaint (pScreenPriv->hwndScreen, &ps);
+ return fReturn;
+}
+
+
+/*
+ * Do any engine-specific application-activation processing
+ */
+
+static Bool
+winActivateAppShadowDDNL (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+
+ /*
+ * Do we have a surface?
+ * Are we active?
+ * Are we full screen?
+ */
+ if (pScreenPriv != NULL
+ && pScreenPriv->pddsPrimary4 != NULL
+ && pScreenPriv->fActive)
+ {
+ /* Primary surface was lost, restore it */
+ IDirectDrawSurface4_Restore (pScreenPriv->pddsPrimary4);
+ }
+
+ return TRUE;
+}
+
+
+/*
+ * Reblit the shadow framebuffer to the screen.
+ */
+
+static Bool
+winRedrawScreenShadowDDNL (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ RECT rcSrc, rcDest;
+ POINT ptOrigin;
+
+ /* Get the origin of the window in the screen coords */
+ ptOrigin.x = pScreenInfo->dwXOffset;
+ ptOrigin.y = pScreenInfo->dwYOffset;
+ MapWindowPoints (pScreenPriv->hwndScreen,
+ HWND_DESKTOP,
+ (LPPOINT)&ptOrigin, 1);
+ rcDest.left = ptOrigin.x;
+ rcDest.right = ptOrigin.x + pScreenInfo->dwWidth;
+ rcDest.top = ptOrigin.y;
+ rcDest.bottom = ptOrigin.y + pScreenInfo->dwHeight;
+
+ /* Source can be entire shadow surface, as Blt should clip for us */
+ rcSrc.left = 0;
+ rcSrc.top = 0;
+ rcSrc.right = pScreenInfo->dwWidth;
+ rcSrc.bottom = pScreenInfo->dwHeight;
+
+ /* Redraw the whole window, to take account for the new colors */
+ myIDirectDrawSurface4_Blt (pScreen, &rcDest, &rcSrc);
+ return TRUE;
+}
+
+
+/*
+ * Realize the currently installed colormap
+ */
+
+static Bool
+winRealizeInstalledPaletteShadowDDNL (ScreenPtr pScreen)
+{
+ return TRUE;
+}
+
+
+/*
+ * Install the specified colormap
+ */
+
+static Bool
+winInstallColormapShadowDDNL (ColormapPtr pColormap)
+{
+ ScreenPtr pScreen = pColormap->pScreen;
+ winScreenPriv(pScreen);
+ winCmapPriv(pColormap);
+ HRESULT ddrval = DD_OK;
+
+ /* Install the DirectDraw palette on the primary surface */
+ ddrval = IDirectDrawSurface4_SetPalette (pScreenPriv->pddsPrimary4,
+ pCmapPriv->lpDDPalette);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winInstallColormapShadowDDNL - Failed installing the "
+ "DirectDraw palette.\n");
+ return FALSE;
+ }
+
+ /* Save a pointer to the newly installed colormap */
+ pScreenPriv->pcmapInstalled = pColormap;
+
+ return TRUE;
+}
+
+
+/*
+ * Store the specified colors in the specified colormap
+ */
+
+static Bool
+winStoreColorsShadowDDNL (ColormapPtr pColormap,
+ int ndef,
+ xColorItem *pdefs)
+{
+ ScreenPtr pScreen = pColormap->pScreen;
+ winScreenPriv(pScreen);
+ winCmapPriv(pColormap);
+ ColormapPtr curpmap = pScreenPriv->pcmapInstalled;
+ HRESULT ddrval = DD_OK;
+
+ /* Put the X colormap entries into the Windows logical palette */
+ ddrval = IDirectDrawPalette_SetEntries (pCmapPriv->lpDDPalette,
+ 0,
+ pdefs[0].pixel,
+ ndef,
+ pCmapPriv->peColors
+ + pdefs[0].pixel);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winStoreColorsShadowDDNL - SetEntries () failed: %08x\n", (unsigned int) ddrval);
+ return FALSE;
+ }
+
+ /* Don't install the DirectDraw palette if the colormap is not installed */
+ if (pColormap != curpmap)
+ {
+ return TRUE;
+ }
+
+ if (!winInstallColormapShadowDDNL (pColormap))
+ {
+ ErrorF ("winStoreColorsShadowDDNL - Failed installing colormap\n");
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+
+/*
+ * Colormap initialization procedure
+ */
+
+static Bool
+winCreateColormapShadowDDNL (ColormapPtr pColormap)
+{
+ HRESULT ddrval = DD_OK;
+ ScreenPtr pScreen = pColormap->pScreen;
+ winScreenPriv(pScreen);
+ winCmapPriv(pColormap);
+
+ /* Create a DirectDraw palette */
+ ddrval = IDirectDraw4_CreatePalette (pScreenPriv->pdd4,
+ DDPCAPS_8BIT | DDPCAPS_ALLOW256,
+ pCmapPriv->peColors,
+ &pCmapPriv->lpDDPalette,
+ NULL);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winCreateColormapShadowDDNL - CreatePalette failed\n");
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+
+/*
+ * Colormap destruction procedure
+ */
+
+static Bool
+winDestroyColormapShadowDDNL (ColormapPtr pColormap)
+{
+ winScreenPriv(pColormap->pScreen);
+ winCmapPriv(pColormap);
+ HRESULT ddrval = DD_OK;
+
+ /*
+ * Is colormap to be destroyed the default?
+ *
+ * Non-default colormaps should have had winUninstallColormap
+ * called on them before we get here. The default colormap
+ * will not have had winUninstallColormap called on it. Thus,
+ * we need to handle the default colormap in a special way.
+ */
+ if (pColormap->flags & IsDefault)
+ {
+ winDebug ("winDestroyColormapShadowDDNL - Destroying default colormap\n");
+
+ /*
+ * FIXME: Walk the list of all screens, popping the default
+ * palette out of each screen device context.
+ */
+
+ /* Pop the palette out of the primary surface */
+ ddrval = IDirectDrawSurface4_SetPalette (pScreenPriv->pddsPrimary4,
+ NULL);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winDestroyColormapShadowDDNL - Failed freeing the "
+ "default colormap DirectDraw palette.\n");
+ return FALSE;
+ }
+
+ /* Clear our private installed colormap pointer */
+ pScreenPriv->pcmapInstalled = NULL;
+ }
+
+ /* Release the palette */
+ IDirectDrawPalette_Release (pCmapPriv->lpDDPalette);
+
+ /* Invalidate the colormap privates */
+ pCmapPriv->lpDDPalette = NULL;
+
+ return TRUE;
+}
+
+
+/*
+ * Set pointers to our engine specific functions
+ */
+
+Bool
+winSetEngineFunctionsShadowDDNL (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+
+ /* Set our pointers */
+ pScreenPriv->pwinAllocateFB = winAllocateFBShadowDDNL;
+ pScreenPriv->pwinFreeFB = winFreeFBShadowDDNL;
+ pScreenPriv->pwinShadowUpdate = winShadowUpdateDDNL;
+ pScreenPriv->pwinInitScreen = winInitScreenShadowDDNL;
+ pScreenPriv->pwinCloseScreen = winCloseScreenShadowDDNL;
+ pScreenPriv->pwinInitVisuals = winInitVisualsShadowDDNL;
+ pScreenPriv->pwinAdjustVideoMode = winAdjustVideoModeShadowDDNL;
+ if (pScreenInfo->fFullScreen)
+ pScreenPriv->pwinCreateBoundingWindow = winCreateBoundingWindowFullScreen;
+ else
+ pScreenPriv->pwinCreateBoundingWindow = winCreateBoundingWindowWindowed;
+ pScreenPriv->pwinFinishScreenInit = winFinishScreenInitFB;
+ pScreenPriv->pwinBltExposedRegions = winBltExposedRegionsShadowDDNL;
+ pScreenPriv->pwinActivateApp = winActivateAppShadowDDNL;
+ pScreenPriv->pwinRedrawScreen = winRedrawScreenShadowDDNL;
+ pScreenPriv->pwinRealizeInstalledPalette
+ = winRealizeInstalledPaletteShadowDDNL;
+ pScreenPriv->pwinInstallColormap = winInstallColormapShadowDDNL;
+ pScreenPriv->pwinStoreColors = winStoreColorsShadowDDNL;
+ pScreenPriv->pwinCreateColormap = winCreateColormapShadowDDNL;
+ pScreenPriv->pwinDestroyColormap = winDestroyColormapShadowDDNL;
+ pScreenPriv->pwinHotKeyAltTab = (winHotKeyAltTabProcPtr) (void (*)(void))NoopDDA;
+ pScreenPriv->pwinCreatePrimarySurface = winCreatePrimarySurfaceShadowDDNL;
+ pScreenPriv->pwinReleasePrimarySurface = winReleasePrimarySurfaceShadowDDNL;
+#ifdef XWIN_MULTIWINDOW
+ pScreenPriv->pwinFinishCreateWindowsWindow
+ = winFinishCreateWindowsWindowDDNL;
+#endif
+
+ return TRUE;
+}
diff --git a/xorg-server/hw/xwin/winshadgdi.c b/xorg-server/hw/xwin/winshadgdi.c index 1e7cb006c..bcb2051fc 100644 --- a/xorg-server/hw/xwin/winshadgdi.c +++ b/xorg-server/hw/xwin/winshadgdi.c @@ -1,1260 +1,1238 @@ -/* - *Copyright (C) 2001-2004 Harold L Hunt II All Rights Reserved. - * - *Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - *"Software"), to deal in the Software without restriction, including - *without limitation the rights to use, copy, modify, merge, publish, - *distribute, sublicense, and/or sell copies of the Software, and to - *permit persons to whom the Software is furnished to do so, subject to - *the following conditions: - * - *The above copyright notice and this permission notice shall be - *included in all copies or substantial portions of the Software. - * - *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - *NONINFRINGEMENT. IN NO EVENT SHALL HAROLD L HUNT II BE LIABLE FOR - *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - *Except as contained in this notice, the name of Harold L Hunt II - *shall not be used in advertising or otherwise to promote the sale, use - *or other dealings in this Software without prior written authorization - *from Harold L Hunt II. - * - * Authors: Harold L Hunt II - */ - -#ifdef HAVE_XWIN_CONFIG_H -#include <xwin-config.h> -#endif -#include "win.h" - - -/* - * Local function prototypes - */ - -#ifdef XWIN_MULTIWINDOW -static wBOOL CALLBACK -winRedrawAllProcShadowGDI (HWND hwnd, LPARAM lParam); - -static wBOOL CALLBACK -winRedrawDamagedWindowShadowGDI (HWND hwnd, LPARAM lParam); -#endif - -static Bool -winAllocateFBShadowGDI (ScreenPtr pScreen); - -static void -winShadowUpdateGDI (ScreenPtr pScreen, - shadowBufPtr pBuf); - -static Bool -winCloseScreenShadowGDI (int nIndex, ScreenPtr pScreen); - -static Bool -winInitVisualsShadowGDI (ScreenPtr pScreen); - -static Bool -winAdjustVideoModeShadowGDI (ScreenPtr pScreen); - -static Bool -winBltExposedRegionsShadowGDI (ScreenPtr pScreen); - -static Bool -winActivateAppShadowGDI (ScreenPtr pScreen); - -static Bool -winRedrawScreenShadowGDI (ScreenPtr pScreen); - -static Bool -winRealizeInstalledPaletteShadowGDI (ScreenPtr pScreen); - -static Bool -winInstallColormapShadowGDI (ColormapPtr pColormap); - -static Bool -winStoreColorsShadowGDI (ColormapPtr pmap, - int ndef, - xColorItem *pdefs); - -static Bool -winCreateColormapShadowGDI (ColormapPtr pColormap); - -static Bool -winDestroyColormapShadowGDI (ColormapPtr pColormap); - - -/* - * Internal function to get the DIB format that is compatible with the screen - */ - -static -Bool -winQueryScreenDIBFormat (ScreenPtr pScreen, BITMAPINFOHEADER *pbmih) -{ - winScreenPriv(pScreen); - HBITMAP hbmp; -#if CYGDEBUG - LPDWORD pdw = NULL; -#endif - - /* Create a memory bitmap compatible with the screen */ - hbmp = CreateCompatibleBitmap (pScreenPriv->hdcScreen, 1, 1); - if (hbmp == NULL) - { - ErrorF ("winQueryScreenDIBFormat - CreateCompatibleBitmap failed\n"); - return FALSE; - } - - /* Initialize our bitmap info header */ - ZeroMemory (pbmih, sizeof (BITMAPINFOHEADER) + 256 * sizeof (RGBQUAD)); - pbmih->biSize = sizeof (BITMAPINFOHEADER); - - /* Get the biBitCount */ - if (!GetDIBits (pScreenPriv->hdcScreen, - hbmp, - 0, 1, - NULL, - (BITMAPINFO*) pbmih, - DIB_RGB_COLORS)) - { - ErrorF ("winQueryScreenDIBFormat - First call to GetDIBits failed\n"); - DeleteObject (hbmp); - return FALSE; - } - -#if CYGDEBUG - /* Get a pointer to bitfields */ - pdw = (DWORD*) ((CARD8*)pbmih + sizeof (BITMAPINFOHEADER)); - - winDebug ("winQueryScreenDIBFormat - First call masks: %08x %08x %08x\n", - pdw[0], pdw[1], pdw[2]); -#endif - - /* Get optimal color table, or the optimal bitfields */ - if (!GetDIBits (pScreenPriv->hdcScreen, - hbmp, - 0, 1, - NULL, - (BITMAPINFO*)pbmih, - DIB_RGB_COLORS)) - { - ErrorF ("winQueryScreenDIBFormat - Second call to GetDIBits " - "failed\n"); - DeleteObject (hbmp); - return FALSE; - } - - /* Free memory */ - DeleteObject (hbmp); - - return TRUE; -} - - -/* - * Internal function to determine the GDI bits per rgb and bit masks - */ - -static -Bool -winQueryRGBBitsAndMasks (ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - BITMAPINFOHEADER *pbmih = NULL; - Bool fReturn = TRUE; - LPDWORD pdw = NULL; - DWORD dwRedBits, dwGreenBits, dwBlueBits; - - /* Color masks for 8 bpp are standardized */ - if (GetDeviceCaps (pScreenPriv->hdcScreen, RASTERCAPS) & RC_PALETTE) - { - /* - * RGB BPP for 8 bit palletes is always 8 - * and the color masks are always 0. - */ - pScreenPriv->dwBitsPerRGB = 8; - pScreenPriv->dwRedMask = 0x0L; - pScreenPriv->dwGreenMask = 0x0L; - pScreenPriv->dwBlueMask = 0x0L; - return TRUE; - } - - /* Color masks for 24 bpp are standardized */ - if (GetDeviceCaps (pScreenPriv->hdcScreen, PLANES) - * GetDeviceCaps (pScreenPriv->hdcScreen, BITSPIXEL) == 24) - { - ErrorF ("winQueryRGBBitsAndMasks - GetDeviceCaps (BITSPIXEL) " - "returned 24 for the screen. Using default 24bpp masks.\n"); - - /* 8 bits per primary color */ - pScreenPriv->dwBitsPerRGB = 8; - - /* Set screen privates masks */ - pScreenPriv->dwRedMask = WIN_24BPP_MASK_RED; - pScreenPriv->dwGreenMask = WIN_24BPP_MASK_GREEN; - pScreenPriv->dwBlueMask = WIN_24BPP_MASK_BLUE; - - return TRUE; - } - - /* Allocate a bitmap header and color table */ - pbmih = (BITMAPINFOHEADER*) malloc (sizeof (BITMAPINFOHEADER) - + 256 * sizeof (RGBQUAD)); - if (pbmih == NULL) - { - ErrorF ("winQueryRGBBitsAndMasks - malloc failed\n"); - return FALSE; - } - - /* Get screen description */ - if (winQueryScreenDIBFormat (pScreen, pbmih)) - { - /* Get a pointer to bitfields */ - pdw = (DWORD*) ((CARD8*)pbmih + sizeof (BITMAPINFOHEADER)); - -#if CYGDEBUG - winDebug ("%s - Masks: %08x %08x %08x\n", __FUNCTION__, - pdw[0], pdw[1], pdw[2]); - winDebug ("%s - Bitmap: %dx%d %d bpp %d planes\n", __FUNCTION__, - pbmih->biWidth, pbmih->biHeight, pbmih->biBitCount, pbmih->biPlanes); - winDebug ("%s - Compression: %d %s\n", __FUNCTION__, - pbmih->biCompression, - (pbmih->biCompression == BI_RGB?"(BI_RGB)": - (pbmih->biCompression == BI_RLE8?"(BI_RLE8)": - (pbmih->biCompression == BI_RLE4?"(BI_RLE4)": - (pbmih->biCompression == BI_BITFIELDS?"(BI_BITFIELDS)":"" - ))))); -#endif - - /* Handle BI_RGB case, which is returned by Wine */ - if (pbmih->biCompression == BI_RGB) - { - dwRedBits = 5; - dwGreenBits = 5; - dwBlueBits = 5; - - pScreenPriv->dwBitsPerRGB = 5; - - /* Set screen privates masks */ - pScreenPriv->dwRedMask = 0x7c00; - pScreenPriv->dwGreenMask = 0x03e0; - pScreenPriv->dwBlueMask = 0x001f; - } - else - { - /* Count the number of bits in each mask */ - dwRedBits = winCountBits (pdw[0]); - dwGreenBits = winCountBits (pdw[1]); - dwBlueBits = winCountBits (pdw[2]); - - /* Find maximum bits per red, green, blue */ - if (dwRedBits > dwGreenBits && dwRedBits > dwBlueBits) - pScreenPriv->dwBitsPerRGB = dwRedBits; - else if (dwGreenBits > dwRedBits && dwGreenBits > dwBlueBits) - pScreenPriv->dwBitsPerRGB = dwGreenBits; - else - pScreenPriv->dwBitsPerRGB = dwBlueBits; - - /* Set screen privates masks */ - pScreenPriv->dwRedMask = pdw[0]; - pScreenPriv->dwGreenMask = pdw[1]; - pScreenPriv->dwBlueMask = pdw[2]; - } - } - else - { - ErrorF ("winQueryRGBBitsAndMasks - winQueryScreenDIBFormat failed\n"); - free (pbmih); - fReturn = FALSE; - } - - /* Free memory */ - free (pbmih); - - return fReturn; -} - - -#ifdef XWIN_MULTIWINDOW -/* - * Redraw all ---? - */ - -static wBOOL CALLBACK -winRedrawAllProcShadowGDI (HWND hwnd, LPARAM lParam) -{ - if (hwnd == (HWND)lParam) - return TRUE; - InvalidateRect (hwnd, NULL, FALSE); - UpdateWindow (hwnd); - return TRUE; -} - -static wBOOL CALLBACK -winRedrawDamagedWindowShadowGDI (HWND hwnd, LPARAM lParam) -{ - BoxPtr pDamage = (BoxPtr)lParam; - RECT rcClient, rcDamage, rcRedraw; - POINT topLeft, bottomRight; - - if (IsIconic (hwnd)) - return TRUE; /* Don't care minimized windows */ - - /* Convert the damaged area from Screen coords to Client coords */ - topLeft.x = pDamage->x1; topLeft.y = pDamage->y1; - bottomRight.x = pDamage->x2; bottomRight.y = pDamage->y2; - topLeft.x += GetSystemMetrics (SM_XVIRTUALSCREEN); - bottomRight.x += GetSystemMetrics (SM_XVIRTUALSCREEN); - topLeft.y += GetSystemMetrics (SM_YVIRTUALSCREEN); - bottomRight.y += GetSystemMetrics (SM_YVIRTUALSCREEN); - ScreenToClient (hwnd, &topLeft); - ScreenToClient (hwnd, &bottomRight); - SetRect (&rcDamage, topLeft.x, topLeft.y, bottomRight.x, bottomRight.y); - - GetClientRect (hwnd, &rcClient); - - if (IntersectRect (&rcRedraw, &rcClient, &rcDamage)) - { - InvalidateRect (hwnd, &rcRedraw, FALSE); - UpdateWindow (hwnd); - } - return TRUE; -} -#endif - - -/* - * Allocate a DIB for the shadow framebuffer GDI server - */ - -static Bool -winAllocateFBShadowGDI (ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - DIBSECTION dibsection; - Bool fReturn = TRUE; - - /* Describe shadow bitmap to be created */ - pScreenPriv->pbmih->biWidth = pScreenInfo->dwWidth; - pScreenPriv->pbmih->biHeight = -pScreenInfo->dwHeight; - - ErrorF ("winAllocateFBShadowGDI - Creating DIB with width: %d height: %d " - "depth: %d\n", - (int) pScreenPriv->pbmih->biWidth, (int) -pScreenPriv->pbmih->biHeight, pScreenPriv->pbmih->biBitCount); - - /* Create a DI shadow bitmap with a bit pointer */ - pScreenPriv->hbmpShadow = CreateDIBSection (pScreenPriv->hdcScreen, - (BITMAPINFO *) pScreenPriv->pbmih, - DIB_RGB_COLORS, - (VOID**) &pScreenInfo->pfb, - NULL, - 0); - if (pScreenPriv->hbmpShadow == NULL || pScreenInfo->pfb == NULL) - { - winW32Error (2, "winAllocateFBShadowGDI - CreateDIBSection failed:"); - return FALSE; - } - else - { -#if CYGDEBUG - winDebug ("winAllocateFBShadowGDI - Shadow buffer allocated\n"); -#endif - } - - /* Get information about the bitmap that was allocated */ - GetObject (pScreenPriv->hbmpShadow, - sizeof (dibsection), - &dibsection); - -#if CYGDEBUG || YES - /* Print information about bitmap allocated */ - winDebug ("winAllocateFBShadowGDI - Dibsection width: %d height: %d " - "depth: %d size image: %d\n", - (int) dibsection.dsBmih.biWidth, (int) dibsection.dsBmih.biHeight, - dibsection.dsBmih.biBitCount, - (int) dibsection.dsBmih.biSizeImage); -#endif - - /* Select the shadow bitmap into the shadow DC */ - SelectObject (pScreenPriv->hdcShadow, - pScreenPriv->hbmpShadow); - -#if CYGDEBUG - winDebug ("winAllocateFBShadowGDI - Attempting a shadow blit\n"); -#endif - - /* Do a test blit from the shadow to the screen, I think */ - fReturn = BitBlt (pScreenPriv->hdcScreen, - 0, 0, - pScreenInfo->dwWidth, pScreenInfo->dwHeight, - pScreenPriv->hdcShadow, - 0, 0, - SRCCOPY); - if (fReturn) - { -#if CYGDEBUG - winDebug ("winAllocateFBShadowGDI - Shadow blit success\n"); -#endif - } - else - { - winW32Error (2, "winAllocateFBShadowGDI - Shadow blit failure\n"); -#if 0 - return FALSE; -#else - /* ago: ignore this error. The blit fails with wine, but does not - * cause any problems later. */ - - fReturn = TRUE; -#endif - } - - /* Look for height weirdness */ - if (dibsection.dsBmih.biHeight < 0) - { - dibsection.dsBmih.biHeight = -dibsection.dsBmih.biHeight; - } - - /* Set screeninfo stride */ - pScreenInfo->dwStride = ((dibsection.dsBmih.biSizeImage - / dibsection.dsBmih.biHeight) - * 8) / pScreenInfo->dwBPP; - -#if CYGDEBUG || YES - winDebug ("winAllocateFBShadowGDI - Created shadow stride: %d\n", - (int) pScreenInfo->dwStride); -#endif - -#ifdef XWIN_MULTIWINDOW - /* Redraw all windows */ - if (pScreenInfo->fMultiWindow) - EnumThreadWindows (g_dwCurrentThreadID, winRedrawAllProcShadowGDI, 0); -#endif - - return fReturn; -} - -static void -winFreeFBShadowGDI (ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - - /* Free the shadow bitmap */ - DeleteObject (pScreenPriv->hbmpShadow); - - /* Invalidate the ScreenInfo's fb pointer */ - pScreenInfo->pfb = NULL; -} - -/* - * Blit the damaged regions of the shadow fb to the screen - */ - -static void -winShadowUpdateGDI (ScreenPtr pScreen, - shadowBufPtr pBuf) -{ - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - RegionPtr damage = shadowDamage(pBuf); - DWORD dwBox = RegionNumRects (damage); - BoxPtr pBox = RegionRects (damage); - int x, y, w, h; - HRGN hrgnTemp = NULL, hrgnCombined = NULL; -#ifdef XWIN_UPDATESTATS - static DWORD s_dwNonUnitRegions = 0; - static DWORD s_dwTotalUpdates = 0; - static DWORD s_dwTotalBoxes = 0; -#endif - BoxPtr pBoxExtents = RegionExtents(damage); - - /* - * Return immediately if the app is not active - * and we are fullscreen, or if we have a bad display depth - */ - if ((!pScreenPriv->fActive && pScreenInfo->fFullScreen) - || pScreenPriv->fBadDepth) return; - -#ifdef XWIN_UPDATESTATS - ++s_dwTotalUpdates; - s_dwTotalBoxes += dwBox; - - if (dwBox != 1) - { - ++s_dwNonUnitRegions; - ErrorF ("winShadowUpdatGDI - dwBox: %d\n", dwBox); - } - - if ((s_dwTotalUpdates % 100) == 0) - ErrorF ("winShadowUpdateGDI - %d%% non-unity regions, avg boxes: %d " - "nu: %d tu: %d\n", - (s_dwNonUnitRegions * 100) / s_dwTotalUpdates, - s_dwTotalBoxes / s_dwTotalUpdates, - s_dwNonUnitRegions, s_dwTotalUpdates); -#endif /* XWIN_UPDATESTATS */ - - /* - * Handle small regions with multiple blits, - * handle large regions by creating a clipping region and - * doing a single blit constrained to that clipping region. - */ - if (!pScreenInfo->fMultiWindow && - (pScreenInfo->dwClipUpdatesNBoxes == 0 || - dwBox < pScreenInfo->dwClipUpdatesNBoxes)) - { - /* Loop through all boxes in the damaged region */ - while (dwBox--) - { - /* - * Calculate x offset, y offset, width, and height for - * current damage box - */ - x = pBox->x1; - y = pBox->y1; - w = pBox->x2 - pBox->x1; - h = pBox->y2 - pBox->y1; - - BitBlt (pScreenPriv->hdcScreen, - x, y, - w, h, - pScreenPriv->hdcShadow, - x, y, - SRCCOPY); - - /* Get a pointer to the next box */ - ++pBox; - } - } - else if (!pScreenInfo->fMultiWindow) - { - /* Compute a GDI region from the damaged region */ - hrgnCombined = CreateRectRgn (pBox->x1, pBox->y1, pBox->x2, pBox->y2); - dwBox--; - pBox++; - while (dwBox--) - { - hrgnTemp = CreateRectRgn (pBox->x1, pBox->y1, pBox->x2, pBox->y2); - CombineRgn (hrgnCombined, hrgnCombined, hrgnTemp, RGN_OR); - DeleteObject (hrgnTemp); - pBox++; - } - - /* Install the GDI region as a clipping region */ - SelectClipRgn (pScreenPriv->hdcScreen, hrgnCombined); - DeleteObject (hrgnCombined); - hrgnCombined = NULL; - - /* - * Blit the shadow buffer to the screen, - * constrained to the clipping region. - */ - BitBlt (pScreenPriv->hdcScreen, - pBoxExtents->x1, pBoxExtents->y1, - pBoxExtents->x2 - pBoxExtents->x1, - pBoxExtents->y2 - pBoxExtents->y1, - pScreenPriv->hdcShadow, - pBoxExtents->x1, pBoxExtents->y1, - SRCCOPY); - - /* Reset the clip region */ - SelectClipRgn (pScreenPriv->hdcScreen, NULL); - } - -#ifdef XWIN_MULTIWINDOW - /* Redraw all multiwindow windows */ - if (pScreenInfo->fMultiWindow) - EnumThreadWindows (g_dwCurrentThreadID, - winRedrawDamagedWindowShadowGDI, - (LPARAM)pBoxExtents); -#endif -} - - -static Bool -winInitScreenShadowGDI (ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - - /* Get device contexts for the screen and shadow bitmap */ - pScreenPriv->hdcScreen = GetDC (pScreenPriv->hwndScreen); - pScreenPriv->hdcShadow = CreateCompatibleDC (pScreenPriv->hdcScreen); - - /* Allocate bitmap info header */ - pScreenPriv->pbmih = (BITMAPINFOHEADER*) malloc (sizeof (BITMAPINFOHEADER) - + 256 * sizeof (RGBQUAD)); - if (pScreenPriv->pbmih == NULL) - { - ErrorF ("winInitScreenShadowGDI - malloc () failed\n"); - return FALSE; - } - - /* Query the screen format */ - if (!winQueryScreenDIBFormat (pScreen, pScreenPriv->pbmih)) - { - ErrorF ("winInitScreenShadowGDI - winQueryScreenDIBFormat failed\n"); - return FALSE; - } - - /* Determine our color masks */ - if (!winQueryRGBBitsAndMasks (pScreen)) - { - ErrorF ("winInitScreenShadowGDI - winQueryRGBBitsAndMasks failed\n"); - return FALSE; - } - - return winAllocateFBShadowGDI(pScreen); -} - -/* See Porting Layer Definition - p. 33 */ -/* - * We wrap whatever CloseScreen procedure was specified by fb; - * a pointer to said procedure is stored in our privates. - */ - -static Bool -winCloseScreenShadowGDI (int nIndex, ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - Bool fReturn; - -#if CYGDEBUG - winDebug ("winCloseScreenShadowGDI - Freeing screen resources\n"); -#endif - - /* Flag that the screen is closed */ - pScreenPriv->fClosed = TRUE; - pScreenPriv->fActive = FALSE; - - /* Call the wrapped CloseScreen procedure */ - WIN_UNWRAP(CloseScreen); - if (pScreen->CloseScreen) - fReturn = (*pScreen->CloseScreen) (nIndex, pScreen); - - /* Delete the window property */ - RemoveProp (pScreenPriv->hwndScreen, WIN_SCR_PROP); - - /* Free the shadow DC; which allows the bitmap to be freed */ - DeleteDC (pScreenPriv->hdcShadow); - - winFreeFBShadowGDI(pScreen); - - /* Free the screen DC */ - ReleaseDC (pScreenPriv->hwndScreen, pScreenPriv->hdcScreen); - - /* Delete tray icon, if we have one */ - if (!pScreenInfo->fNoTrayIcon) - winDeleteNotifyIcon (pScreenPriv); - - /* Free the exit confirmation dialog box, if it exists */ - if (g_hDlgExit != NULL) - { - DestroyWindow (g_hDlgExit); - g_hDlgExit = NULL; - } - - /* Kill our window */ - if (pScreenPriv->hwndScreen) - { - DestroyWindow (pScreenPriv->hwndScreen); - pScreenPriv->hwndScreen = NULL; - } - -#if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW) - /* Destroy the thread startup mutex */ - pthread_mutex_destroy (&pScreenPriv->pmServerStarted); -#endif - - /* Invalidate our screeninfo's pointer to the screen */ - pScreenInfo->pScreen = NULL; - - /* Free the screen privates for this screen */ - free ((pointer) pScreenPriv); - - return fReturn; -} - - -/* - * Tell mi what sort of visuals we need. - * - * Generally we only need one visual, as our screen can only - * handle one format at a time, I believe. You may want - * to verify that last sentence. - */ - -static Bool -winInitVisualsShadowGDI (ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - - /* Display debugging information */ - ErrorF ("winInitVisualsShadowGDI - Masks %08x %08x %08x BPRGB %d d %d " - "bpp %d\n", - (unsigned int) pScreenPriv->dwRedMask, - (unsigned int) pScreenPriv->dwGreenMask, - (unsigned int) pScreenPriv->dwBlueMask, - (int) pScreenPriv->dwBitsPerRGB, - (int) pScreenInfo->dwDepth, - (int) pScreenInfo->dwBPP); - - /* Create a single visual according to the Windows screen depth */ - switch (pScreenInfo->dwDepth) - { - case 24: - case 16: - case 15: - /* Setup the real visual */ - if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth, - TrueColorMask, - pScreenPriv->dwBitsPerRGB, - -1, - pScreenPriv->dwRedMask, - pScreenPriv->dwGreenMask, - pScreenPriv->dwBlueMask)) - { - ErrorF ("winInitVisualsShadowGDI - miSetVisualTypesAndMasks " - "failed\n"); - return FALSE; - } - -#ifdef XWIN_EMULATEPSEUDO - if (!pScreenInfo->fEmulatePseudo) - break; - - /* Setup a pseudocolor visual */ - if (!miSetVisualTypesAndMasks (8, - PseudoColorMask, - 8, - -1, - 0, - 0, - 0)) - { - ErrorF ("winInitVisualsShadowGDI - miSetVisualTypesAndMasks " - "failed for PseudoColor\n"); - return FALSE; - } -#endif - break; - - case 8: - if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth, - PseudoColorMask, - pScreenPriv->dwBitsPerRGB, - PseudoColor, - pScreenPriv->dwRedMask, - pScreenPriv->dwGreenMask, - pScreenPriv->dwBlueMask)) - { - ErrorF ("winInitVisualsShadowGDI - miSetVisualTypesAndMasks " - "failed\n"); - return FALSE; - } - break; - - default: - ErrorF ("winInitVisualsShadowGDI - Unknown screen depth\n"); - return FALSE; - } - -#if CYGDEBUG - winDebug ("winInitVisualsShadowGDI - Returning\n"); -#endif - - return TRUE; -} - - -/* - * Adjust the proposed video mode - */ - -static Bool -winAdjustVideoModeShadowGDI (ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - HDC hdc; - DWORD dwBPP; - - hdc = GetDC (NULL); - - /* We're in serious trouble if we can't get a DC */ - if (hdc == NULL) - { - ErrorF ("winAdjustVideoModeShadowGDI - GetDC () failed\n"); - return FALSE; - } - - /* Query GDI for current display depth */ - dwBPP = GetDeviceCaps (hdc, BITSPIXEL); - - /* GDI cannot change the screen depth, so always use GDI's depth */ - pScreenInfo->dwBPP = dwBPP; - - /* Release our DC */ - ReleaseDC (NULL, hdc); - hdc = NULL; - - return TRUE; -} - - -/* - * Blt exposed regions to the screen - */ - -static Bool -winBltExposedRegionsShadowGDI (ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - winPrivCmapPtr pCmapPriv = NULL; - HDC hdcUpdate; - PAINTSTRUCT ps; - - /* BeginPaint gives us an hdc that clips to the invalidated region */ - hdcUpdate = BeginPaint (pScreenPriv->hwndScreen, &ps); - - /* Realize the palette, if we have one */ - if (pScreenPriv->pcmapInstalled != NULL) - { - pCmapPriv = winGetCmapPriv (pScreenPriv->pcmapInstalled); - - SelectPalette (hdcUpdate, pCmapPriv->hPalette, FALSE); - RealizePalette (hdcUpdate); - } - - /* Our BitBlt will be clipped to the invalidated region */ - BitBlt (hdcUpdate, - 0, 0, - pScreenInfo->dwWidth, pScreenInfo->dwHeight, - pScreenPriv->hdcShadow, - 0, 0, - SRCCOPY); - - /* EndPaint frees the DC */ - EndPaint (pScreenPriv->hwndScreen, &ps); - -#ifdef XWIN_MULTIWINDOW - /* Redraw all windows */ - if (pScreenInfo->fMultiWindow) - EnumThreadWindows(g_dwCurrentThreadID, winRedrawAllProcShadowGDI, - (LPARAM)pScreenPriv->hwndScreen); -#endif - - return TRUE; -} - - -/* - * Do any engine-specific appliation-activation processing - */ - -static Bool -winActivateAppShadowGDI (ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - - /* - * 2004/04/12 - Harold - We perform the restoring or minimizing - * manually for ShadowGDI in fullscreen modes so that this engine - * will perform just like ShadowDD and ShadowDDNL in fullscreen mode; - * if we do not do this then our fullscreen window will appear in the - * z-order when it is deactivated and it can be uncovered by resizing - * or minimizing another window that is on top of it, which is not how - * the DirectDraw engines work. Therefore we keep this code here to - * make sure that all engines work the same in fullscreen mode. - */ - - /* - * Are we active? - * Are we fullscreen? - */ - if (pScreenPriv->fActive - && pScreenInfo->fFullScreen) - { - /* - * Activating, attempt to bring our window - * to the top of the display - */ - ShowWindow (pScreenPriv->hwndScreen, SW_RESTORE); - } - else if (!pScreenPriv->fActive - && pScreenInfo->fFullScreen) - { - /* - * Deactivating, stuff our window onto the - * task bar. - */ - ShowWindow (pScreenPriv->hwndScreen, SW_MINIMIZE); - } - - return TRUE; -} - - -/* - * Reblit the shadow framebuffer to the screen. - */ - -static Bool -winRedrawScreenShadowGDI (ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - - /* Redraw the whole window, to take account for the new colors */ - BitBlt (pScreenPriv->hdcScreen, - 0, 0, - pScreenInfo->dwWidth, pScreenInfo->dwHeight, - pScreenPriv->hdcShadow, - 0, 0, - SRCCOPY); - -#ifdef XWIN_MULTIWINDOW - /* Redraw all windows */ - if (pScreenInfo->fMultiWindow) - EnumThreadWindows(g_dwCurrentThreadID, winRedrawAllProcShadowGDI, 0); -#endif - - return TRUE; -} - - - -/* - * Realize the currently installed colormap - */ - -static Bool -winRealizeInstalledPaletteShadowGDI (ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - winPrivCmapPtr pCmapPriv = NULL; - -#if CYGDEBUG - winDebug ("winRealizeInstalledPaletteShadowGDI\n"); -#endif - - /* Don't do anything if there is not a colormap */ - if (pScreenPriv->pcmapInstalled == NULL) - { -#if CYGDEBUG - winDebug ("winRealizeInstalledPaletteShadowGDI - No colormap " - "installed\n"); -#endif - return TRUE; - } - - pCmapPriv = winGetCmapPriv (pScreenPriv->pcmapInstalled); - - /* Realize our palette for the screen */ - if (RealizePalette (pScreenPriv->hdcScreen) == GDI_ERROR) - { - ErrorF ("winRealizeInstalledPaletteShadowGDI - RealizePalette () " - "failed\n"); - return FALSE; - } - - /* Set the DIB color table */ - if (SetDIBColorTable (pScreenPriv->hdcShadow, - 0, - WIN_NUM_PALETTE_ENTRIES, - pCmapPriv->rgbColors) == 0) - { - ErrorF ("winRealizeInstalledPaletteShadowGDI - SetDIBColorTable () " - "failed\n"); - return FALSE; - } - - return TRUE; -} - - -/* - * Install the specified colormap - */ - -static Bool -winInstallColormapShadowGDI (ColormapPtr pColormap) -{ - ScreenPtr pScreen = pColormap->pScreen; - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - winCmapPriv(pColormap); - - /* - * Tell Windows to install the new colormap - */ - if (SelectPalette (pScreenPriv->hdcScreen, - pCmapPriv->hPalette, - FALSE) == NULL) - { - ErrorF ("winInstallColormapShadowGDI - SelectPalette () failed\n"); - return FALSE; - } - - /* Realize the palette */ - if (GDI_ERROR == RealizePalette (pScreenPriv->hdcScreen)) - { - ErrorF ("winInstallColormapShadowGDI - RealizePalette () failed\n"); - return FALSE; - } - - /* Set the DIB color table */ - if (SetDIBColorTable (pScreenPriv->hdcShadow, - 0, - WIN_NUM_PALETTE_ENTRIES, - pCmapPriv->rgbColors) == 0) - { - ErrorF ("winInstallColormapShadowGDI - SetDIBColorTable () failed\n"); - return FALSE; - } - - /* Redraw the whole window, to take account for the new colors */ - BitBlt (pScreenPriv->hdcScreen, - 0, 0, - pScreenInfo->dwWidth, pScreenInfo->dwHeight, - pScreenPriv->hdcShadow, - 0, 0, - SRCCOPY); - - /* Save a pointer to the newly installed colormap */ - pScreenPriv->pcmapInstalled = pColormap; - -#ifdef XWIN_MULTIWINDOW - /* Redraw all windows */ - if (pScreenInfo->fMultiWindow) - EnumThreadWindows (g_dwCurrentThreadID, winRedrawAllProcShadowGDI, 0); -#endif - - return TRUE; -} - - -/* - * Store the specified colors in the specified colormap - */ - -static Bool -winStoreColorsShadowGDI (ColormapPtr pColormap, - int ndef, - xColorItem *pdefs) -{ - ScreenPtr pScreen = pColormap->pScreen; - winScreenPriv(pScreen); - winCmapPriv(pColormap); - ColormapPtr curpmap = pScreenPriv->pcmapInstalled; - - /* Put the X colormap entries into the Windows logical palette */ - if (SetPaletteEntries (pCmapPriv->hPalette, - pdefs[0].pixel, - ndef, - pCmapPriv->peColors + pdefs[0].pixel) == 0) - { - ErrorF ("winStoreColorsShadowGDI - SetPaletteEntries () failed\n"); - return FALSE; - } - - /* Don't install the Windows palette if the colormap is not installed */ - if (pColormap != curpmap) - { - return TRUE; - } - - /* Try to install the newly modified colormap */ - if (!winInstallColormapShadowGDI (pColormap)) - { - ErrorF ("winInstallColormapShadowGDI - winInstallColormapShadowGDI " - "failed\n"); - return FALSE; - } - -#if 0 - /* Tell Windows that the palette has changed */ - RealizePalette (pScreenPriv->hdcScreen); - - /* Set the DIB color table */ - if (SetDIBColorTable (pScreenPriv->hdcShadow, - pdefs[0].pixel, - ndef, - pCmapPriv->rgbColors + pdefs[0].pixel) == 0) - { - ErrorF ("winInstallColormapShadowGDI - SetDIBColorTable () failed\n"); - return FALSE; - } - - /* Save a pointer to the newly installed colormap */ - pScreenPriv->pcmapInstalled = pColormap; -#endif - - return TRUE; -} - - -/* - * Colormap initialization procedure - */ - -static Bool -winCreateColormapShadowGDI (ColormapPtr pColormap) -{ - LPLOGPALETTE lpPaletteNew = NULL; - DWORD dwEntriesMax; - VisualPtr pVisual; - HPALETTE hpalNew = NULL; - winCmapPriv(pColormap); - - /* Get a pointer to the visual that the colormap belongs to */ - pVisual = pColormap->pVisual; - - /* Get the maximum number of palette entries for this visual */ - dwEntriesMax = pVisual->ColormapEntries; - - /* Allocate a Windows logical color palette with max entries */ - lpPaletteNew = malloc (sizeof (LOGPALETTE) - + (dwEntriesMax - 1) * sizeof (PALETTEENTRY)); - if (lpPaletteNew == NULL) - { - ErrorF ("winCreateColormapShadowGDI - Couldn't allocate palette " - "with %d entries\n", - (int) dwEntriesMax); - return FALSE; - } - - /* Zero out the colormap */ - ZeroMemory (lpPaletteNew, sizeof (LOGPALETTE) - + (dwEntriesMax - 1) * sizeof (PALETTEENTRY)); - - /* Set the logical palette structure */ - lpPaletteNew->palVersion = 0x0300; - lpPaletteNew->palNumEntries = dwEntriesMax; - - /* Tell Windows to create the palette */ - hpalNew = CreatePalette (lpPaletteNew); - if (hpalNew == NULL) - { - ErrorF ("winCreateColormapShadowGDI - CreatePalette () failed\n"); - free (lpPaletteNew); - return FALSE; - } - - /* Save the Windows logical palette handle in the X colormaps' privates */ - pCmapPriv->hPalette = hpalNew; - - /* Free the palette initialization memory */ - free (lpPaletteNew); - - return TRUE; -} - - -/* - * Colormap destruction procedure - */ - -static Bool -winDestroyColormapShadowGDI (ColormapPtr pColormap) -{ - winScreenPriv(pColormap->pScreen); - winCmapPriv(pColormap); - - /* - * Is colormap to be destroyed the default? - * - * Non-default colormaps should have had winUninstallColormap - * called on them before we get here. The default colormap - * will not have had winUninstallColormap called on it. Thus, - * we need to handle the default colormap in a special way. - */ - if (pColormap->flags & IsDefault) - { -#if CYGDEBUG - winDebug ("winDestroyColormapShadowGDI - Destroying default " - "colormap\n"); -#endif - - /* - * FIXME: Walk the list of all screens, popping the default - * palette out of each screen device context. - */ - - /* Pop the palette out of the device context */ - SelectPalette (pScreenPriv->hdcScreen, - GetStockObject (DEFAULT_PALETTE), - FALSE); - - /* Clear our private installed colormap pointer */ - pScreenPriv->pcmapInstalled = NULL; - } - - /* Try to delete the logical palette */ - if (DeleteObject (pCmapPriv->hPalette) == 0) - { - ErrorF ("winDestroyColormap - DeleteObject () failed\n"); - return FALSE; - } - - /* Invalidate the colormap privates */ - pCmapPriv->hPalette = NULL; - - return TRUE; -} - - -/* - * Set engine specific funtions - */ - -Bool -winSetEngineFunctionsShadowGDI (ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - - /* Set our pointers */ - pScreenPriv->pwinAllocateFB = winAllocateFBShadowGDI; - pScreenPriv->pwinFreeFB = winFreeFBShadowGDI; - pScreenPriv->pwinShadowUpdate = winShadowUpdateGDI; - pScreenPriv->pwinInitScreen = winInitScreenShadowGDI; - pScreenPriv->pwinCloseScreen = winCloseScreenShadowGDI; - pScreenPriv->pwinInitVisuals = winInitVisualsShadowGDI; - pScreenPriv->pwinAdjustVideoMode = winAdjustVideoModeShadowGDI; - if (pScreenInfo->fFullScreen) - pScreenPriv->pwinCreateBoundingWindow = winCreateBoundingWindowFullScreen; - else - pScreenPriv->pwinCreateBoundingWindow = winCreateBoundingWindowWindowed; - pScreenPriv->pwinFinishScreenInit = winFinishScreenInitFB; - pScreenPriv->pwinBltExposedRegions = winBltExposedRegionsShadowGDI; - pScreenPriv->pwinActivateApp = winActivateAppShadowGDI; - pScreenPriv->pwinRedrawScreen = winRedrawScreenShadowGDI; - pScreenPriv->pwinRealizeInstalledPalette = - winRealizeInstalledPaletteShadowGDI; - pScreenPriv->pwinInstallColormap = winInstallColormapShadowGDI; - pScreenPriv->pwinStoreColors = winStoreColorsShadowGDI; - pScreenPriv->pwinCreateColormap = winCreateColormapShadowGDI; - pScreenPriv->pwinDestroyColormap = winDestroyColormapShadowGDI; - pScreenPriv->pwinHotKeyAltTab = (winHotKeyAltTabProcPtr) (void (*)(void))NoopDDA; - pScreenPriv->pwinCreatePrimarySurface - = (winCreatePrimarySurfaceProcPtr) (void (*)(void))NoopDDA; - pScreenPriv->pwinReleasePrimarySurface - = (winReleasePrimarySurfaceProcPtr) (void (*)(void))NoopDDA; -#ifdef XWIN_MULTIWINDOW - pScreenPriv->pwinFinishCreateWindowsWindow = - (winFinishCreateWindowsWindowProcPtr) (void (*)(void))NoopDDA; -#endif - - return TRUE; -} +/*
+ *Copyright (C) 2001-2004 Harold L Hunt II All Rights Reserved.
+ *
+ *Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ *"Software"), to deal in the Software without restriction, including
+ *without limitation the rights to use, copy, modify, merge, publish,
+ *distribute, sublicense, and/or sell copies of the Software, and to
+ *permit persons to whom the Software is furnished to do so, subject to
+ *the following conditions:
+ *
+ *The above copyright notice and this permission notice shall be
+ *included in all copies or substantial portions of the Software.
+ *
+ *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *NONINFRINGEMENT. IN NO EVENT SHALL HAROLD L HUNT II BE LIABLE FOR
+ *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+ *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *Except as contained in this notice, the name of Harold L Hunt II
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from Harold L Hunt II.
+ *
+ * Authors: Harold L Hunt II
+ */
+
+#ifdef HAVE_XWIN_CONFIG_H
+#include <xwin-config.h>
+#endif
+#include "win.h"
+
+
+/*
+ * Local function prototypes
+ */
+
+#ifdef XWIN_MULTIWINDOW
+static wBOOL CALLBACK
+winRedrawAllProcShadowGDI (HWND hwnd, LPARAM lParam);
+
+static wBOOL CALLBACK
+winRedrawDamagedWindowShadowGDI (HWND hwnd, LPARAM lParam);
+#endif
+
+static Bool
+winAllocateFBShadowGDI (ScreenPtr pScreen);
+
+static void
+winShadowUpdateGDI (ScreenPtr pScreen,
+ shadowBufPtr pBuf);
+
+static Bool
+winCloseScreenShadowGDI (int nIndex, ScreenPtr pScreen);
+
+static Bool
+winInitVisualsShadowGDI (ScreenPtr pScreen);
+
+static Bool
+winAdjustVideoModeShadowGDI (ScreenPtr pScreen);
+
+static Bool
+winBltExposedRegionsShadowGDI (ScreenPtr pScreen);
+
+static Bool
+winActivateAppShadowGDI (ScreenPtr pScreen);
+
+static Bool
+winRedrawScreenShadowGDI (ScreenPtr pScreen);
+
+static Bool
+winRealizeInstalledPaletteShadowGDI (ScreenPtr pScreen);
+
+static Bool
+winInstallColormapShadowGDI (ColormapPtr pColormap);
+
+static Bool
+winStoreColorsShadowGDI (ColormapPtr pmap,
+ int ndef,
+ xColorItem *pdefs);
+
+static Bool
+winCreateColormapShadowGDI (ColormapPtr pColormap);
+
+static Bool
+winDestroyColormapShadowGDI (ColormapPtr pColormap);
+
+
+/*
+ * Internal function to get the DIB format that is compatible with the screen
+ */
+
+static
+Bool
+winQueryScreenDIBFormat (ScreenPtr pScreen, BITMAPINFOHEADER *pbmih)
+{
+ winScreenPriv(pScreen);
+ HBITMAP hbmp;
+#ifdef WINDBG
+ LPDWORD pdw = NULL;
+#endif
+
+ /* Create a memory bitmap compatible with the screen */
+ hbmp = CreateCompatibleBitmap (pScreenPriv->hdcScreen, 1, 1);
+ if (hbmp == NULL)
+ {
+ ErrorF ("winQueryScreenDIBFormat - CreateCompatibleBitmap failed\n");
+ return FALSE;
+ }
+
+ /* Initialize our bitmap info header */
+ ZeroMemory (pbmih, sizeof (BITMAPINFOHEADER) + 256 * sizeof (RGBQUAD));
+ pbmih->biSize = sizeof (BITMAPINFOHEADER);
+
+ /* Get the biBitCount */
+ if (!GetDIBits (pScreenPriv->hdcScreen,
+ hbmp,
+ 0, 1,
+ NULL,
+ (BITMAPINFO*) pbmih,
+ DIB_RGB_COLORS))
+ {
+ ErrorF ("winQueryScreenDIBFormat - First call to GetDIBits failed\n");
+ DeleteObject (hbmp);
+ return FALSE;
+ }
+
+#ifdef WINDBG
+ /* Get a pointer to bitfields */
+ pdw = (DWORD*) ((CARD8*)pbmih + sizeof (BITMAPINFOHEADER));
+
+ winDebug ("winQueryScreenDIBFormat - First call masks: %08x %08x %08x\n",
+ pdw[0], pdw[1], pdw[2]);
+#endif
+
+ /* Get optimal color table, or the optimal bitfields */
+ if (!GetDIBits (pScreenPriv->hdcScreen,
+ hbmp,
+ 0, 1,
+ NULL,
+ (BITMAPINFO*)pbmih,
+ DIB_RGB_COLORS))
+ {
+ ErrorF ("winQueryScreenDIBFormat - Second call to GetDIBits "
+ "failed\n");
+ DeleteObject (hbmp);
+ return FALSE;
+ }
+
+ /* Free memory */
+ DeleteObject (hbmp);
+
+ return TRUE;
+}
+
+
+/*
+ * Internal function to determine the GDI bits per rgb and bit masks
+ */
+
+static
+Bool
+winQueryRGBBitsAndMasks (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ BITMAPINFOHEADER *pbmih = NULL;
+ Bool fReturn = TRUE;
+ LPDWORD pdw = NULL;
+ DWORD dwRedBits, dwGreenBits, dwBlueBits;
+
+ /* Color masks for 8 bpp are standardized */
+ if (GetDeviceCaps (pScreenPriv->hdcScreen, RASTERCAPS) & RC_PALETTE)
+ {
+ /*
+ * RGB BPP for 8 bit palletes is always 8
+ * and the color masks are always 0.
+ */
+ pScreenPriv->dwBitsPerRGB = 8;
+ pScreenPriv->dwRedMask = 0x0L;
+ pScreenPriv->dwGreenMask = 0x0L;
+ pScreenPriv->dwBlueMask = 0x0L;
+ return TRUE;
+ }
+
+ /* Color masks for 24 bpp are standardized */
+ if (GetDeviceCaps (pScreenPriv->hdcScreen, PLANES)
+ * GetDeviceCaps (pScreenPriv->hdcScreen, BITSPIXEL) == 24)
+ {
+ winDebug ("winQueryRGBBitsAndMasks - GetDeviceCaps (BITSPIXEL) "
+ "returned 24 for the screen. Using default 24bpp masks.\n");
+
+ /* 8 bits per primary color */
+ pScreenPriv->dwBitsPerRGB = 8;
+
+ /* Set screen privates masks */
+ pScreenPriv->dwRedMask = WIN_24BPP_MASK_RED;
+ pScreenPriv->dwGreenMask = WIN_24BPP_MASK_GREEN;
+ pScreenPriv->dwBlueMask = WIN_24BPP_MASK_BLUE;
+
+ return TRUE;
+ }
+
+ /* Allocate a bitmap header and color table */
+ pbmih = (BITMAPINFOHEADER*) malloc (sizeof (BITMAPINFOHEADER)
+ + 256 * sizeof (RGBQUAD));
+ if (pbmih == NULL)
+ {
+ ErrorF ("winQueryRGBBitsAndMasks - malloc failed\n");
+ return FALSE;
+ }
+
+ /* Get screen description */
+ if (winQueryScreenDIBFormat (pScreen, pbmih))
+ {
+ /* Get a pointer to bitfields */
+ pdw = (DWORD*) ((CARD8*)pbmih + sizeof (BITMAPINFOHEADER));
+
+#ifdef WINDBG
+ winDebug ("%s - Masks: %08x %08x %08x\n", __FUNCTION__,
+ pdw[0], pdw[1], pdw[2]);
+ winDebug ("%s - Bitmap: %dx%d %d bpp %d planes\n", __FUNCTION__,
+ pbmih->biWidth, pbmih->biHeight, pbmih->biBitCount, pbmih->biPlanes);
+ winDebug ("%s - Compression: %d %s\n", __FUNCTION__,
+ pbmih->biCompression,
+ (pbmih->biCompression == BI_RGB?"(BI_RGB)":
+ (pbmih->biCompression == BI_RLE8?"(BI_RLE8)":
+ (pbmih->biCompression == BI_RLE4?"(BI_RLE4)":
+ (pbmih->biCompression == BI_BITFIELDS?"(BI_BITFIELDS)":""
+ )))));
+#endif
+
+ /* Handle BI_RGB case, which is returned by Wine */
+ if (pbmih->biCompression == BI_RGB)
+ {
+ dwRedBits = 5;
+ dwGreenBits = 5;
+ dwBlueBits = 5;
+
+ pScreenPriv->dwBitsPerRGB = 5;
+
+ /* Set screen privates masks */
+ pScreenPriv->dwRedMask = 0x7c00;
+ pScreenPriv->dwGreenMask = 0x03e0;
+ pScreenPriv->dwBlueMask = 0x001f;
+ }
+ else
+ {
+ /* Count the number of bits in each mask */
+ dwRedBits = winCountBits (pdw[0]);
+ dwGreenBits = winCountBits (pdw[1]);
+ dwBlueBits = winCountBits (pdw[2]);
+
+ /* Find maximum bits per red, green, blue */
+ if (dwRedBits > dwGreenBits && dwRedBits > dwBlueBits)
+ pScreenPriv->dwBitsPerRGB = dwRedBits;
+ else if (dwGreenBits > dwRedBits && dwGreenBits > dwBlueBits)
+ pScreenPriv->dwBitsPerRGB = dwGreenBits;
+ else
+ pScreenPriv->dwBitsPerRGB = dwBlueBits;
+
+ /* Set screen privates masks */
+ pScreenPriv->dwRedMask = pdw[0];
+ pScreenPriv->dwGreenMask = pdw[1];
+ pScreenPriv->dwBlueMask = pdw[2];
+ }
+ }
+ else
+ {
+ ErrorF ("winQueryRGBBitsAndMasks - winQueryScreenDIBFormat failed\n");
+ free (pbmih);
+ fReturn = FALSE;
+ }
+
+ /* Free memory */
+ free (pbmih);
+
+ return fReturn;
+}
+
+
+#ifdef XWIN_MULTIWINDOW
+/*
+ * Redraw all ---?
+ */
+
+static wBOOL CALLBACK
+winRedrawAllProcShadowGDI (HWND hwnd, LPARAM lParam)
+{
+ if (hwnd == (HWND)lParam)
+ return TRUE;
+ InvalidateRect (hwnd, NULL, FALSE);
+ UpdateWindow (hwnd);
+ return TRUE;
+}
+
+static wBOOL CALLBACK
+winRedrawDamagedWindowShadowGDI (HWND hwnd, LPARAM lParam)
+{
+ BoxPtr pDamage = (BoxPtr)lParam;
+ RECT rcClient, rcDamage, rcRedraw;
+ POINT topLeft, bottomRight;
+
+ if (IsIconic (hwnd))
+ return TRUE; /* Don't care minimized windows */
+
+ /* Convert the damaged area from Screen coords to Client coords */
+ topLeft.x = pDamage->x1; topLeft.y = pDamage->y1;
+ bottomRight.x = pDamage->x2; bottomRight.y = pDamage->y2;
+ topLeft.x += GetSystemMetrics (SM_XVIRTUALSCREEN);
+ bottomRight.x += GetSystemMetrics (SM_XVIRTUALSCREEN);
+ topLeft.y += GetSystemMetrics (SM_YVIRTUALSCREEN);
+ bottomRight.y += GetSystemMetrics (SM_YVIRTUALSCREEN);
+ ScreenToClient (hwnd, &topLeft);
+ ScreenToClient (hwnd, &bottomRight);
+ SetRect (&rcDamage, topLeft.x, topLeft.y, bottomRight.x, bottomRight.y);
+
+ GetClientRect (hwnd, &rcClient);
+
+ if (IntersectRect (&rcRedraw, &rcClient, &rcDamage))
+ {
+ InvalidateRect (hwnd, &rcRedraw, FALSE);
+ UpdateWindow (hwnd);
+ }
+ return TRUE;
+}
+#endif
+
+
+/*
+ * Allocate a DIB for the shadow framebuffer GDI server
+ */
+
+static Bool
+winAllocateFBShadowGDI (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ DIBSECTION dibsection;
+ Bool fReturn = TRUE;
+
+ /* Describe shadow bitmap to be created */
+ pScreenPriv->pbmih->biWidth = pScreenInfo->dwWidth;
+ pScreenPriv->pbmih->biHeight = -pScreenInfo->dwHeight;
+
+ winDebug ("winAllocateFBShadowGDI - Creating DIB with width: %d height: %d "
+ "depth: %d\n",
+ (int) pScreenPriv->pbmih->biWidth, (int) -pScreenPriv->pbmih->biHeight, pScreenPriv->pbmih->biBitCount);
+
+ /* Create a DI shadow bitmap with a bit pointer */
+ pScreenPriv->hbmpShadow = CreateDIBSection (pScreenPriv->hdcScreen,
+ (BITMAPINFO *) pScreenPriv->pbmih,
+ DIB_RGB_COLORS,
+ (VOID**) &pScreenInfo->pfb,
+ NULL,
+ 0);
+ if (pScreenPriv->hbmpShadow == NULL || pScreenInfo->pfb == NULL)
+ {
+ winW32Error ("winAllocateFBShadowGDI - CreateDIBSection failed:");
+ return FALSE;
+ }
+ else
+ {
+ winDebug ("winAllocateFBShadowGDI - Shadow buffer allocated\n");
+ }
+
+ /* Get information about the bitmap that was allocated */
+ GetObject (pScreenPriv->hbmpShadow,
+ sizeof (dibsection),
+ &dibsection);
+
+ /* Print information about bitmap allocated */
+ winDebug ("winAllocateFBShadowGDI - Dibsection width: %d height: %d "
+ "depth: %d size image: %d\n",
+ (int) dibsection.dsBmih.biWidth, (int) dibsection.dsBmih.biHeight,
+ dibsection.dsBmih.biBitCount,
+ (int) dibsection.dsBmih.biSizeImage);
+
+ /* Select the shadow bitmap into the shadow DC */
+ SelectObject (pScreenPriv->hdcShadow,
+ pScreenPriv->hbmpShadow);
+
+ winDebug ("winAllocateFBShadowGDI - Attempting a shadow blit\n");
+
+ /* Do a test blit from the shadow to the screen, I think */
+ fReturn = BitBlt (pScreenPriv->hdcScreen,
+ 0, 0,
+ pScreenInfo->dwWidth, pScreenInfo->dwHeight,
+ pScreenPriv->hdcShadow,
+ 0, 0,
+ SRCCOPY);
+ if (fReturn)
+ {
+ winDebug ("winAllocateFBShadowGDI - Shadow blit success\n");
+ }
+ else
+ {
+ winW32Error ("winAllocateFBShadowGDI - Shadow blit failure\n");
+ /* ago: ignore this error. The blit fails with wine, but does not
+ * cause any problems later. */
+
+ fReturn = TRUE;
+ }
+
+ /* Look for height weirdness */
+ if (dibsection.dsBmih.biHeight < 0)
+ {
+ dibsection.dsBmih.biHeight = -dibsection.dsBmih.biHeight;
+ }
+
+ /* Set screeninfo stride */
+ pScreenInfo->dwStride = ((dibsection.dsBmih.biSizeImage
+ / dibsection.dsBmih.biHeight)
+ * 8) / pScreenInfo->dwBPP;
+
+ winDebug ("winAllocateFBShadowGDI - Created shadow stride: %d\n",
+ (int) pScreenInfo->dwStride);
+
+#ifdef XWIN_MULTIWINDOW
+ /* Redraw all windows */
+ if (pScreenInfo->fMultiWindow)
+ EnumThreadWindows (g_dwCurrentThreadID, winRedrawAllProcShadowGDI, 0);
+#endif
+
+ return fReturn;
+}
+
+static void
+winFreeFBShadowGDI (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+
+ /* Free the shadow bitmap */
+ DeleteObject (pScreenPriv->hbmpShadow);
+
+ /* Invalidate the ScreenInfo's fb pointer */
+ pScreenInfo->pfb = NULL;
+}
+
+/*
+ * Blit the damaged regions of the shadow fb to the screen
+ */
+
+static void
+winShadowUpdateGDI (ScreenPtr pScreen,
+ shadowBufPtr pBuf)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ RegionPtr damage = shadowDamage(pBuf);
+ DWORD dwBox = RegionNumRects (damage);
+ BoxPtr pBox = RegionRects (damage);
+ int x, y, w, h;
+ HRGN hrgnTemp = NULL, hrgnCombined = NULL;
+#ifdef XWIN_UPDATESTATS
+ static DWORD s_dwNonUnitRegions = 0;
+ static DWORD s_dwTotalUpdates = 0;
+ static DWORD s_dwTotalBoxes = 0;
+#endif
+ BoxPtr pBoxExtents = RegionExtents(damage);
+
+ /*
+ * Return immediately if the app is not active
+ * and we are fullscreen, or if we have a bad display depth
+ */
+ if ((!pScreenPriv->fActive && pScreenInfo->fFullScreen)
+ || pScreenPriv->fBadDepth) return;
+
+#ifdef XWIN_UPDATESTATS
+ ++s_dwTotalUpdates;
+ s_dwTotalBoxes += dwBox;
+
+ if (dwBox != 1)
+ {
+ ++s_dwNonUnitRegions;
+ winDebug ("winShadowUpdatGDI - dwBox: %d\n", dwBox);
+ }
+
+ if ((s_dwTotalUpdates % 100) == 0)
+ {
+ winDebug ("winShadowUpdateGDI - %d%% non-unity regions, avg boxes: %d "
+ "nu: %d tu: %d\n",
+ (s_dwNonUnitRegions * 100) / s_dwTotalUpdates,
+ s_dwTotalBoxes / s_dwTotalUpdates,
+ s_dwNonUnitRegions, s_dwTotalUpdates);
+ }
+#endif /* XWIN_UPDATESTATS */
+
+ /*
+ * Handle small regions with multiple blits,
+ * handle large regions by creating a clipping region and
+ * doing a single blit constrained to that clipping region.
+ */
+ if (!pScreenInfo->fMultiWindow &&
+ (pScreenInfo->dwClipUpdatesNBoxes == 0 ||
+ dwBox < pScreenInfo->dwClipUpdatesNBoxes))
+ {
+ /* Loop through all boxes in the damaged region */
+ while (dwBox--)
+ {
+ /*
+ * Calculate x offset, y offset, width, and height for
+ * current damage box
+ */
+ x = pBox->x1;
+ y = pBox->y1;
+ w = pBox->x2 - pBox->x1;
+ h = pBox->y2 - pBox->y1;
+
+ BitBlt (pScreenPriv->hdcScreen,
+ x, y,
+ w, h,
+ pScreenPriv->hdcShadow,
+ x, y,
+ SRCCOPY);
+
+ /* Get a pointer to the next box */
+ ++pBox;
+ }
+ }
+ else if (!pScreenInfo->fMultiWindow)
+ {
+ /* Compute a GDI region from the damaged region */
+ hrgnCombined = CreateRectRgn (pBox->x1, pBox->y1, pBox->x2, pBox->y2);
+ dwBox--;
+ pBox++;
+ while (dwBox--)
+ {
+ hrgnTemp = CreateRectRgn (pBox->x1, pBox->y1, pBox->x2, pBox->y2);
+ CombineRgn (hrgnCombined, hrgnCombined, hrgnTemp, RGN_OR);
+ DeleteObject (hrgnTemp);
+ pBox++;
+ }
+
+ /* Install the GDI region as a clipping region */
+ SelectClipRgn (pScreenPriv->hdcScreen, hrgnCombined);
+ DeleteObject (hrgnCombined);
+ hrgnCombined = NULL;
+
+ /*
+ * Blit the shadow buffer to the screen,
+ * constrained to the clipping region.
+ */
+ BitBlt (pScreenPriv->hdcScreen,
+ pBoxExtents->x1, pBoxExtents->y1,
+ pBoxExtents->x2 - pBoxExtents->x1,
+ pBoxExtents->y2 - pBoxExtents->y1,
+ pScreenPriv->hdcShadow,
+ pBoxExtents->x1, pBoxExtents->y1,
+ SRCCOPY);
+
+ /* Reset the clip region */
+ SelectClipRgn (pScreenPriv->hdcScreen, NULL);
+ }
+
+#ifdef XWIN_MULTIWINDOW
+ /* Redraw all multiwindow windows */
+ if (pScreenInfo->fMultiWindow)
+ EnumThreadWindows (g_dwCurrentThreadID,
+ winRedrawDamagedWindowShadowGDI,
+ (LPARAM)pBoxExtents);
+#endif
+}
+
+
+static Bool
+winInitScreenShadowGDI (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+
+ /* Get device contexts for the screen and shadow bitmap */
+ pScreenPriv->hdcScreen = GetDC (pScreenPriv->hwndScreen);
+ pScreenPriv->hdcShadow = CreateCompatibleDC (pScreenPriv->hdcScreen);
+
+ /* Allocate bitmap info header */
+ pScreenPriv->pbmih = (BITMAPINFOHEADER*) malloc (sizeof (BITMAPINFOHEADER)
+ + 256 * sizeof (RGBQUAD));
+ if (pScreenPriv->pbmih == NULL)
+ {
+ ErrorF ("winInitScreenShadowGDI - malloc () failed\n");
+ return FALSE;
+ }
+
+ /* Query the screen format */
+ if (!winQueryScreenDIBFormat (pScreen, pScreenPriv->pbmih))
+ {
+ ErrorF ("winInitScreenShadowGDI - winQueryScreenDIBFormat failed\n");
+ return FALSE;
+ }
+
+ /* Determine our color masks */
+ if (!winQueryRGBBitsAndMasks (pScreen))
+ {
+ ErrorF ("winInitScreenShadowGDI - winQueryRGBBitsAndMasks failed\n");
+ return FALSE;
+ }
+
+ return winAllocateFBShadowGDI(pScreen);
+}
+
+/* See Porting Layer Definition - p. 33 */
+/*
+ * We wrap whatever CloseScreen procedure was specified by fb;
+ * a pointer to said procedure is stored in our privates.
+ */
+
+static Bool
+winCloseScreenShadowGDI (int nIndex, ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ Bool fReturn;
+
+ winDebug ("winCloseScreenShadowGDI - Freeing screen resources\n");
+
+ /* Flag that the screen is closed */
+ pScreenPriv->fClosed = TRUE;
+ pScreenPriv->fActive = FALSE;
+
+ /* Call the wrapped CloseScreen procedure */
+ WIN_UNWRAP(CloseScreen);
+ if (pScreen->CloseScreen)
+ fReturn = (*pScreen->CloseScreen) (nIndex, pScreen);
+
+ /* Delete the window property */
+ RemoveProp (pScreenPriv->hwndScreen, WIN_SCR_PROP);
+
+ /* Free the shadow DC; which allows the bitmap to be freed */
+ DeleteDC (pScreenPriv->hdcShadow);
+
+ winFreeFBShadowGDI(pScreen);
+
+ /* Free the screen DC */
+ ReleaseDC (pScreenPriv->hwndScreen, pScreenPriv->hdcScreen);
+
+ /* Delete tray icon, if we have one */
+ if (!pScreenInfo->fNoTrayIcon)
+ winDeleteNotifyIcon (pScreenPriv);
+
+ /* Free the exit confirmation dialog box, if it exists */
+ if (g_hDlgExit != NULL)
+ {
+ DestroyWindow (g_hDlgExit);
+ g_hDlgExit = NULL;
+ }
+
+ /* Kill our window */
+ if (pScreenPriv->hwndScreen)
+ {
+ DestroyWindow (pScreenPriv->hwndScreen);
+ pScreenPriv->hwndScreen = NULL;
+ }
+
+#if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW)
+ /* Destroy the thread startup mutex */
+ pthread_mutex_destroy (&pScreenPriv->pmServerStarted);
+#endif
+
+ /* Invalidate our screeninfo's pointer to the screen */
+ pScreenInfo->pScreen = NULL;
+
+ /* Free the screen privates for this screen */
+ free ((pointer) pScreenPriv);
+
+ return fReturn;
+}
+
+
+/*
+ * Tell mi what sort of visuals we need.
+ *
+ * Generally we only need one visual, as our screen can only
+ * handle one format at a time, I believe. You may want
+ * to verify that last sentence.
+ */
+
+static Bool
+winInitVisualsShadowGDI (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+
+ /* Display debugging information */
+ winDebug ("winInitVisualsShadowGDI - Masks %08x %08x %08x BPRGB %d d %d "
+ "bpp %d\n",
+ (unsigned int) pScreenPriv->dwRedMask,
+ (unsigned int) pScreenPriv->dwGreenMask,
+ (unsigned int) pScreenPriv->dwBlueMask,
+ (int) pScreenPriv->dwBitsPerRGB,
+ (int) pScreenInfo->dwDepth,
+ (int) pScreenInfo->dwBPP);
+
+ /* Create a single visual according to the Windows screen depth */
+ switch (pScreenInfo->dwDepth)
+ {
+ case 24:
+ case 16:
+ case 15:
+ /* Setup the real visual */
+ if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth,
+ TrueColorMask,
+ pScreenPriv->dwBitsPerRGB,
+ -1,
+ pScreenPriv->dwRedMask,
+ pScreenPriv->dwGreenMask,
+ pScreenPriv->dwBlueMask))
+ {
+ ErrorF ("winInitVisualsShadowGDI - miSetVisualTypesAndMasks "
+ "failed\n");
+ return FALSE;
+ }
+
+#ifdef XWIN_EMULATEPSEUDO
+ if (!pScreenInfo->fEmulatePseudo)
+ break;
+
+ /* Setup a pseudocolor visual */
+ if (!miSetVisualTypesAndMasks (8,
+ PseudoColorMask,
+ 8,
+ -1,
+ 0,
+ 0,
+ 0))
+ {
+ ErrorF ("winInitVisualsShadowGDI - miSetVisualTypesAndMasks "
+ "failed for PseudoColor\n");
+ return FALSE;
+ }
+#endif
+ break;
+
+ case 8:
+ if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth,
+ PseudoColorMask,
+ pScreenPriv->dwBitsPerRGB,
+ PseudoColor,
+ pScreenPriv->dwRedMask,
+ pScreenPriv->dwGreenMask,
+ pScreenPriv->dwBlueMask))
+ {
+ ErrorF ("winInitVisualsShadowGDI - miSetVisualTypesAndMasks "
+ "failed\n");
+ return FALSE;
+ }
+ break;
+
+ default:
+ ErrorF ("winInitVisualsShadowGDI - Unknown screen depth\n");
+ return FALSE;
+ }
+
+ winDebug ("winInitVisualsShadowGDI - Returning\n");
+
+ return TRUE;
+}
+
+
+/*
+ * Adjust the proposed video mode
+ */
+
+static Bool
+winAdjustVideoModeShadowGDI (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ HDC hdc;
+ DWORD dwBPP;
+
+ hdc = GetDC (NULL);
+
+ /* We're in serious trouble if we can't get a DC */
+ if (hdc == NULL)
+ {
+ ErrorF ("winAdjustVideoModeShadowGDI - GetDC () failed\n");
+ return FALSE;
+ }
+
+ /* Query GDI for current display depth */
+ dwBPP = GetDeviceCaps (hdc, BITSPIXEL);
+
+ /* GDI cannot change the screen depth, so always use GDI's depth */
+ pScreenInfo->dwBPP = dwBPP;
+
+ /* Release our DC */
+ ReleaseDC (NULL, hdc);
+ hdc = NULL;
+
+ return TRUE;
+}
+
+
+/*
+ * Blt exposed regions to the screen
+ */
+
+static Bool
+winBltExposedRegionsShadowGDI (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ winPrivCmapPtr pCmapPriv = NULL;
+ HDC hdcUpdate;
+ PAINTSTRUCT ps;
+
+ /* BeginPaint gives us an hdc that clips to the invalidated region */
+ hdcUpdate = BeginPaint (pScreenPriv->hwndScreen, &ps);
+
+ /* Realize the palette, if we have one */
+ if (pScreenPriv->pcmapInstalled != NULL)
+ {
+ pCmapPriv = winGetCmapPriv (pScreenPriv->pcmapInstalled);
+
+ SelectPalette (hdcUpdate, pCmapPriv->hPalette, FALSE);
+ RealizePalette (hdcUpdate);
+ }
+
+ /* Our BitBlt will be clipped to the invalidated region */
+ BitBlt (hdcUpdate,
+ 0, 0,
+ pScreenInfo->dwWidth, pScreenInfo->dwHeight,
+ pScreenPriv->hdcShadow,
+ 0, 0,
+ SRCCOPY);
+
+ /* EndPaint frees the DC */
+ EndPaint (pScreenPriv->hwndScreen, &ps);
+
+#ifdef XWIN_MULTIWINDOW
+ /* Redraw all windows */
+ if (pScreenInfo->fMultiWindow)
+ EnumThreadWindows(g_dwCurrentThreadID, winRedrawAllProcShadowGDI,
+ (LPARAM)pScreenPriv->hwndScreen);
+#endif
+
+ return TRUE;
+}
+
+
+/*
+ * Do any engine-specific appliation-activation processing
+ */
+
+static Bool
+winActivateAppShadowGDI (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+
+ /*
+ * 2004/04/12 - Harold - We perform the restoring or minimizing
+ * manually for ShadowGDI in fullscreen modes so that this engine
+ * will perform just like ShadowDD and ShadowDDNL in fullscreen mode;
+ * if we do not do this then our fullscreen window will appear in the
+ * z-order when it is deactivated and it can be uncovered by resizing
+ * or minimizing another window that is on top of it, which is not how
+ * the DirectDraw engines work. Therefore we keep this code here to
+ * make sure that all engines work the same in fullscreen mode.
+ */
+
+ /*
+ * Are we active?
+ * Are we fullscreen?
+ */
+ if (pScreenPriv->fActive
+ && pScreenInfo->fFullScreen)
+ {
+ /*
+ * Activating, attempt to bring our window
+ * to the top of the display
+ */
+ ShowWindow (pScreenPriv->hwndScreen, SW_RESTORE);
+ }
+ else if (!pScreenPriv->fActive
+ && pScreenInfo->fFullScreen)
+ {
+ /*
+ * Deactivating, stuff our window onto the
+ * task bar.
+ */
+ ShowWindow (pScreenPriv->hwndScreen, SW_MINIMIZE);
+ }
+
+ return TRUE;
+}
+
+
+/*
+ * Reblit the shadow framebuffer to the screen.
+ */
+
+static Bool
+winRedrawScreenShadowGDI (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+
+ /* Redraw the whole window, to take account for the new colors */
+ BitBlt (pScreenPriv->hdcScreen,
+ 0, 0,
+ pScreenInfo->dwWidth, pScreenInfo->dwHeight,
+ pScreenPriv->hdcShadow,
+ 0, 0,
+ SRCCOPY);
+
+#ifdef XWIN_MULTIWINDOW
+ /* Redraw all windows */
+ if (pScreenInfo->fMultiWindow)
+ EnumThreadWindows(g_dwCurrentThreadID, winRedrawAllProcShadowGDI, 0);
+#endif
+
+ return TRUE;
+}
+
+
+
+/*
+ * Realize the currently installed colormap
+ */
+
+static Bool
+winRealizeInstalledPaletteShadowGDI (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winPrivCmapPtr pCmapPriv = NULL;
+
+ winDebug ("winRealizeInstalledPaletteShadowGDI\n");
+
+ /* Don't do anything if there is not a colormap */
+ if (pScreenPriv->pcmapInstalled == NULL)
+ {
+ winDebug ("winRealizeInstalledPaletteShadowGDI - No colormap "
+ "installed\n");
+ return TRUE;
+ }
+
+ pCmapPriv = winGetCmapPriv (pScreenPriv->pcmapInstalled);
+
+ /* Realize our palette for the screen */
+ if (RealizePalette (pScreenPriv->hdcScreen) == GDI_ERROR)
+ {
+ ErrorF ("winRealizeInstalledPaletteShadowGDI - RealizePalette () "
+ "failed\n");
+ return FALSE;
+ }
+
+ /* Set the DIB color table */
+ if (SetDIBColorTable (pScreenPriv->hdcShadow,
+ 0,
+ WIN_NUM_PALETTE_ENTRIES,
+ pCmapPriv->rgbColors) == 0)
+ {
+ ErrorF ("winRealizeInstalledPaletteShadowGDI - SetDIBColorTable () "
+ "failed\n");
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+
+/*
+ * Install the specified colormap
+ */
+
+static Bool
+winInstallColormapShadowGDI (ColormapPtr pColormap)
+{
+ ScreenPtr pScreen = pColormap->pScreen;
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ winCmapPriv(pColormap);
+
+ /*
+ * Tell Windows to install the new colormap
+ */
+ if (SelectPalette (pScreenPriv->hdcScreen,
+ pCmapPriv->hPalette,
+ FALSE) == NULL)
+ {
+ ErrorF ("winInstallColormapShadowGDI - SelectPalette () failed\n");
+ return FALSE;
+ }
+
+ /* Realize the palette */
+ if (GDI_ERROR == RealizePalette (pScreenPriv->hdcScreen))
+ {
+ ErrorF ("winInstallColormapShadowGDI - RealizePalette () failed\n");
+ return FALSE;
+ }
+
+ /* Set the DIB color table */
+ if (SetDIBColorTable (pScreenPriv->hdcShadow,
+ 0,
+ WIN_NUM_PALETTE_ENTRIES,
+ pCmapPriv->rgbColors) == 0)
+ {
+ ErrorF ("winInstallColormapShadowGDI - SetDIBColorTable () failed\n");
+ return FALSE;
+ }
+
+ /* Redraw the whole window, to take account for the new colors */
+ BitBlt (pScreenPriv->hdcScreen,
+ 0, 0,
+ pScreenInfo->dwWidth, pScreenInfo->dwHeight,
+ pScreenPriv->hdcShadow,
+ 0, 0,
+ SRCCOPY);
+
+ /* Save a pointer to the newly installed colormap */
+ pScreenPriv->pcmapInstalled = pColormap;
+
+#ifdef XWIN_MULTIWINDOW
+ /* Redraw all windows */
+ if (pScreenInfo->fMultiWindow)
+ EnumThreadWindows (g_dwCurrentThreadID, winRedrawAllProcShadowGDI, 0);
+#endif
+
+ return TRUE;
+}
+
+
+/*
+ * Store the specified colors in the specified colormap
+ */
+
+static Bool
+winStoreColorsShadowGDI (ColormapPtr pColormap,
+ int ndef,
+ xColorItem *pdefs)
+{
+ ScreenPtr pScreen = pColormap->pScreen;
+ winScreenPriv(pScreen);
+ winCmapPriv(pColormap);
+ ColormapPtr curpmap = pScreenPriv->pcmapInstalled;
+
+ /* Put the X colormap entries into the Windows logical palette */
+ if (SetPaletteEntries (pCmapPriv->hPalette,
+ pdefs[0].pixel,
+ ndef,
+ pCmapPriv->peColors + pdefs[0].pixel) == 0)
+ {
+ ErrorF ("winStoreColorsShadowGDI - SetPaletteEntries () failed\n");
+ return FALSE;
+ }
+
+ /* Don't install the Windows palette if the colormap is not installed */
+ if (pColormap != curpmap)
+ {
+ return TRUE;
+ }
+
+ /* Try to install the newly modified colormap */
+ if (!winInstallColormapShadowGDI (pColormap))
+ {
+ ErrorF ("winInstallColormapShadowGDI - winInstallColormapShadowGDI "
+ "failed\n");
+ return FALSE;
+ }
+
+#if 0
+ /* Tell Windows that the palette has changed */
+ RealizePalette (pScreenPriv->hdcScreen);
+
+ /* Set the DIB color table */
+ if (SetDIBColorTable (pScreenPriv->hdcShadow,
+ pdefs[0].pixel,
+ ndef,
+ pCmapPriv->rgbColors + pdefs[0].pixel) == 0)
+ {
+ ErrorF ("winInstallColormapShadowGDI - SetDIBColorTable () failed\n");
+ return FALSE;
+ }
+
+ /* Save a pointer to the newly installed colormap */
+ pScreenPriv->pcmapInstalled = pColormap;
+#endif
+
+ return TRUE;
+}
+
+
+/*
+ * Colormap initialization procedure
+ */
+
+static Bool
+winCreateColormapShadowGDI (ColormapPtr pColormap)
+{
+ LPLOGPALETTE lpPaletteNew = NULL;
+ DWORD dwEntriesMax;
+ VisualPtr pVisual;
+ HPALETTE hpalNew = NULL;
+ winCmapPriv(pColormap);
+
+ /* Get a pointer to the visual that the colormap belongs to */
+ pVisual = pColormap->pVisual;
+
+ /* Get the maximum number of palette entries for this visual */
+ dwEntriesMax = pVisual->ColormapEntries;
+
+ /* Allocate a Windows logical color palette with max entries */
+ lpPaletteNew = malloc (sizeof (LOGPALETTE)
+ + (dwEntriesMax - 1) * sizeof (PALETTEENTRY));
+ if (lpPaletteNew == NULL)
+ {
+ ErrorF ("winCreateColormapShadowGDI - Couldn't allocate palette "
+ "with %d entries\n",
+ (int) dwEntriesMax);
+ return FALSE;
+ }
+
+ /* Zero out the colormap */
+ ZeroMemory (lpPaletteNew, sizeof (LOGPALETTE)
+ + (dwEntriesMax - 1) * sizeof (PALETTEENTRY));
+
+ /* Set the logical palette structure */
+ lpPaletteNew->palVersion = 0x0300;
+ lpPaletteNew->palNumEntries = dwEntriesMax;
+
+ /* Tell Windows to create the palette */
+ hpalNew = CreatePalette (lpPaletteNew);
+ if (hpalNew == NULL)
+ {
+ ErrorF ("winCreateColormapShadowGDI - CreatePalette () failed\n");
+ free (lpPaletteNew);
+ return FALSE;
+ }
+
+ /* Save the Windows logical palette handle in the X colormaps' privates */
+ pCmapPriv->hPalette = hpalNew;
+
+ /* Free the palette initialization memory */
+ free (lpPaletteNew);
+
+ return TRUE;
+}
+
+
+/*
+ * Colormap destruction procedure
+ */
+
+static Bool
+winDestroyColormapShadowGDI (ColormapPtr pColormap)
+{
+ winScreenPriv(pColormap->pScreen);
+ winCmapPriv(pColormap);
+
+ /*
+ * Is colormap to be destroyed the default?
+ *
+ * Non-default colormaps should have had winUninstallColormap
+ * called on them before we get here. The default colormap
+ * will not have had winUninstallColormap called on it. Thus,
+ * we need to handle the default colormap in a special way.
+ */
+ if (pColormap->flags & IsDefault)
+ {
+ winDebug ("winDestroyColormapShadowGDI - Destroying default "
+ "colormap\n");
+
+ /*
+ * FIXME: Walk the list of all screens, popping the default
+ * palette out of each screen device context.
+ */
+
+ /* Pop the palette out of the device context */
+ SelectPalette (pScreenPriv->hdcScreen,
+ GetStockObject (DEFAULT_PALETTE),
+ FALSE);
+
+ /* Clear our private installed colormap pointer */
+ pScreenPriv->pcmapInstalled = NULL;
+ }
+
+ /* Try to delete the logical palette */
+ if (DeleteObject (pCmapPriv->hPalette) == 0)
+ {
+ ErrorF ("winDestroyColormap - DeleteObject () failed\n");
+ return FALSE;
+ }
+
+ /* Invalidate the colormap privates */
+ pCmapPriv->hPalette = NULL;
+
+ return TRUE;
+}
+
+
+/*
+ * Set engine specific funtions
+ */
+
+Bool
+winSetEngineFunctionsShadowGDI (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+
+ /* Set our pointers */
+ pScreenPriv->pwinAllocateFB = winAllocateFBShadowGDI;
+ pScreenPriv->pwinFreeFB = winFreeFBShadowGDI;
+ pScreenPriv->pwinShadowUpdate = winShadowUpdateGDI;
+ pScreenPriv->pwinInitScreen = winInitScreenShadowGDI;
+ pScreenPriv->pwinCloseScreen = winCloseScreenShadowGDI;
+ pScreenPriv->pwinInitVisuals = winInitVisualsShadowGDI;
+ pScreenPriv->pwinAdjustVideoMode = winAdjustVideoModeShadowGDI;
+ if (pScreenInfo->fFullScreen)
+ pScreenPriv->pwinCreateBoundingWindow = winCreateBoundingWindowFullScreen;
+ else
+ pScreenPriv->pwinCreateBoundingWindow = winCreateBoundingWindowWindowed;
+ pScreenPriv->pwinFinishScreenInit = winFinishScreenInitFB;
+ pScreenPriv->pwinBltExposedRegions = winBltExposedRegionsShadowGDI;
+ pScreenPriv->pwinActivateApp = winActivateAppShadowGDI;
+ pScreenPriv->pwinRedrawScreen = winRedrawScreenShadowGDI;
+ pScreenPriv->pwinRealizeInstalledPalette =
+ winRealizeInstalledPaletteShadowGDI;
+ pScreenPriv->pwinInstallColormap = winInstallColormapShadowGDI;
+ pScreenPriv->pwinStoreColors = winStoreColorsShadowGDI;
+ pScreenPriv->pwinCreateColormap = winCreateColormapShadowGDI;
+ pScreenPriv->pwinDestroyColormap = winDestroyColormapShadowGDI;
+ pScreenPriv->pwinHotKeyAltTab = (winHotKeyAltTabProcPtr) (void (*)(void))NoopDDA;
+ pScreenPriv->pwinCreatePrimarySurface
+ = (winCreatePrimarySurfaceProcPtr) (void (*)(void))NoopDDA;
+ pScreenPriv->pwinReleasePrimarySurface
+ = (winReleasePrimarySurfaceProcPtr) (void (*)(void))NoopDDA;
+#ifdef XWIN_MULTIWINDOW
+ pScreenPriv->pwinFinishCreateWindowsWindow =
+ (winFinishCreateWindowsWindowProcPtr) (void (*)(void))NoopDDA;
+#endif
+
+ return TRUE;
+}
diff --git a/xorg-server/hw/xwin/wintrayicon.c b/xorg-server/hw/xwin/wintrayicon.c index 895b47caf..01d53bc44 100644 --- a/xorg-server/hw/xwin/wintrayicon.c +++ b/xorg-server/hw/xwin/wintrayicon.c @@ -36,35 +36,57 @@ #include <shellapi.h> #include "winprefs.h" +static NOTIFYICONDATA nid; /* * Initialize the tray icon */ void -winInitNotifyIcon (winPrivScreenPtr pScreenPriv) +winInitNotifyIcon (winPrivScreenPtr pScreenPriv, Bool Modify) { winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - NOTIFYICONDATA nid = {0}; + char HostName[256]; - nid.cbSize = sizeof (NOTIFYICONDATA); - nid.hWnd = pScreenPriv->hwndScreen; - nid.uID = pScreenInfo->dwScreen; - nid.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP; - nid.uCallbackMessage = WM_TRAYICON; - nid.hIcon = winTaskbarIcon (); + if (!Modify) + { + nid.cbSize = sizeof (NOTIFYICONDATA); + nid.hWnd = pScreenPriv->hwndScreen; + nid.uID = pScreenInfo->dwScreen; + nid.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP; + nid.uCallbackMessage = WM_TRAYICON; + nid.hIcon = winTaskbarIcon (); - /* Save handle to the icon so it can be freed later */ - pScreenPriv->hiconNotifyIcon = nid.hIcon; + /* Save handle to the icon so it can be freed later */ + pScreenPriv->hiconNotifyIcon = nid.hIcon; + } + + gethostname(HostName,256); /* Set display and screen-specific tooltip text */ - snprintf (nid.szTip, + if (g_pszQueryHost) + { + snprintf (nid.szTip, + sizeof (nid.szTip), + "%s - %s:%s.%d - %d clients", + g_pszQueryHost, + HostName, + display, + (int) pScreenInfo->dwScreen, + pScreenPriv->iConnectedClients); + } + else + { + snprintf (nid.szTip, sizeof (nid.szTip), - PROJECT_NAME " Server:%s.%d", + "%s:%s.%d - %d clients", + HostName, display, - (int) pScreenInfo->dwScreen); + (int) pScreenInfo->dwScreen, + pScreenPriv->iConnectedClients); + } /* Add the tray icon */ - if (!Shell_NotifyIcon (NIM_ADD, &nid)) + if (!Shell_NotifyIcon ((Modify) ? NIM_MODIFY : NIM_ADD, &nid)) ErrorF ("winInitNotifyIcon - Shell_NotifyIcon Failed\n"); } @@ -77,29 +99,16 @@ void winDeleteNotifyIcon (winPrivScreenPtr pScreenPriv) { winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - NOTIFYICONDATA nid = {0}; - -#if 0 - ErrorF ("winDeleteNotifyIcon\n"); -#endif - - nid.cbSize = sizeof (NOTIFYICONDATA); - nid.hWnd = pScreenPriv->hwndScreen; - nid.uID = pScreenInfo->dwScreen; + if (!pScreenPriv->hiconNotifyIcon) + return; + /* Delete the tray icon */ - if (!Shell_NotifyIcon (NIM_DELETE, &nid)) - { - ErrorF ("winDeleteNotifyIcon - Shell_NotifyIcon failed\n"); - return; - } + Shell_NotifyIcon (NIM_DELETE, &nid); /* Free the icon that was loaded */ - if (pScreenPriv->hiconNotifyIcon != NULL - && DestroyIcon (pScreenPriv->hiconNotifyIcon) == 0) - { - ErrorF ("winDeleteNotifyIcon - DestroyIcon failed\n"); - } + DestroyIcon (pScreenPriv->hiconNotifyIcon); + pScreenPriv->hiconNotifyIcon = NULL; } @@ -119,6 +128,17 @@ winHandleIconMessage (HWND hwnd, UINT message, switch (lParam) { + case WM_MOUSEMOVE: + { + static int PrevNrClients; + int NrClients=GetLiveClients(pScreenPriv); + if (NrClients!=PrevNrClients) + { + PrevNrClients=NrClients; + winInitNotifyIcon (pScreenPriv, TRUE); + } + } + break; case WM_LBUTTONUP: /* Restack and bring all windows to top */ SetForegroundWindow (hwnd); diff --git a/xorg-server/hw/xwin/winvideo.c b/xorg-server/hw/xwin/winvideo.c index ed205448d..10f48b564 100644 --- a/xorg-server/hw/xwin/winvideo.c +++ b/xorg-server/hw/xwin/winvideo.c @@ -1,208 +1,208 @@ -/* - *Copyright (C) 2003-2004 Harold L Hunt II All Rights Reserved. - * - *Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - *"Software"), to deal in the Software without restriction, including - *without limitation the rights to use, copy, modify, merge, publish, - *distribute, sublicense, and/or sell copies of the Software, and to - *permit persons to whom the Software is furnished to do so, subject to - *the following conditions: - * - *The above copyright notice and this permission notice shall be - *included in all copies or substantial portions of the Software. - * - *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - *NONINFRINGEMENT. IN NO EVENT SHALL HAROLD L HUNT II BE LIABLE FOR - *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - *Except as contained in this notice, the name of Harold L Hunt II - *shall not be used in advertising or otherwise to promote the sale, use - *or other dealings in this Software without prior written authorization - *from Harold L Hunt II. - * - * Authors: Harold L Hunt II - */ - -#ifdef HAVE_XWIN_CONFIG_H -#include <xwin-config.h> -#endif -#include "win.h" -#include <X11/extensions/Xv.h> -#include <X11/extensions/Xvproto.h> - -void -winInitVideo (ScreenPtr pScreen); - -/* - * winInitVideo - Initialize support for the X Video (Xv) Extension. - */ - -void -winInitVideo (ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - - if (pScreenInfo->dwBPP > 8) - { - - } - - -} - - - - - - - -#if 0 -#include "../xfree86/common/xf86.h" -#include "../Xext/xvdix.h" -#include "../xfree86/common/xf86xv.h" -#include <X11/extensions/Xv.h> -#endif - - - -#if 0 -/* client libraries expect an encoding */ -static XF86VideoEncodingRec DummyEncoding[1] = -{ - { - 0, - "XV_IMAGE", - IMAGE_MAX_WIDTH, IMAGE_MAX_HEIGHT, - {1, 1} - } -}; - -#define NUM_FORMATS 3 - -static XF86VideoFormatRec Formats[NUM_FORMATS] = -{ - {15, TrueColor}, {16, TrueColor}, {24, TrueColor} -}; - -#define NUM_ATTRIBUTES 3 - -static XF86AttributeRec Attributes[NUM_ATTRIBUTES] = -{ - {XvSettable | XvGettable, 0, (1 << 24) - 1, "XV_COLORKEY"}, - {XvSettable | XvGettable, -128, 127, "XV_BRIGHTNESS"}, - {XvSettable | XvGettable, 0, 255, "XV_CONTRAST"} -}; - -#define NUM_IMAGES 4 - -static XF86ImageRec Images[NUM_IMAGES] = -{ - XVIMAGE_YUY2, - XVIMAGE_YV12, - XVIMAGE_I420, - XVIMAGE_UYVY -}; - - - -/* - * winInitVideo - Initialize support for the X Video (Xv) Extension. - */ - -void -winInitVideo (ScreenPtr pScreen) -{ - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - XF86VideoAdaptorPtr newAdaptor = NULL; - - if (pScreenInfo->dwBPP > 8) - { - newAdaptor = I810SetupImageVideo (pScreen); - I810InitOffscreenImages (pScreen); - } - - xf86XVScreenInit (pScreen, adaptors, 1); -} - - -static XF86VideoAdaptorPtr -winSetupImageVideo (ScreenPtr pScreen) -{ - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; -#if 0 - I810Ptr pI810 = I810PTR(pScrn); -#endif - XF86VideoAdaptorPtr adapt; - - if (!(adapt = calloc(1, sizeof(XF86VideoAdaptorRec)))) - return NULL; - - adapt->type = XvWindowMask | XvInputMask | XvImageMask; - adapt->flags = VIDEO_OVERLAID_IMAGES | VIDEO_CLIP_TO_VIEWPORT; - adapt->name = PROJECT_NAME " Video Overlay"; - adapt->nEncodings = 1; - adapt->pEncodings = DummyEncoding; - adapt->nFormats = NUM_FORMATS; - adapt->pFormats = Formats; - adapt->nPorts = 1; - adapt->pPortPrivates = NULL; - - adapt->pPortPrivates[0].ptr = NULL; - adapt->pAttributes = Attributes; - adapt->nImages = NUM_IMAGES; - adapt->nAttributes = NUM_ATTRIBUTES; - adapt->pImages = Images; - adapt->PutVideo = NULL; - adapt->PutStill = NULL; - adapt->GetVideo = NULL; - adapt->GetStill = NULL; -#if 0 - adapt->StopVideo = I810StopVideo; - adapt->SetPortAttribute = I810SetPortAttribute; - adapt->GetPortAttribute = I810GetPortAttribute; - adapt->QueryBestSize = I810QueryBestSize; - adapt->PutImage = I810PutImage; - adapt->QueryImageAttributes = I810QueryImageAttributes; -#endif - -#if 0 - pPriv->colorKey = pI810->colorKey & ((1 << pScrn->depth) - 1); -#endif - pPriv->videoStatus = 0; - pPriv->brightness = 0; - pPriv->contrast = 64; - pPriv->linear = NULL; - pPriv->currentBuf = 0; - -#if 0 - /* gotta uninit this someplace */ - RegionNull(&pPriv->clip); -#endif - -#if 0 - pI810->adaptor = adapt; - - pI810->BlockHandler = pScreen->BlockHandler; - pScreen->BlockHandler = I810BlockHandler; -#endif - -#if 0 - xvBrightness = MAKE_ATOM("XV_BRIGHTNESS"); - xvContrast = MAKE_ATOM("XV_CONTRAST"); - xvColorKey = MAKE_ATOM("XV_COLORKEY"); -#endif - -#if 0 - I810ResetVideo(pScrn); -#endif - - return adapt; -} -#endif +/*
+ *Copyright (C) 2003-2004 Harold L Hunt II All Rights Reserved.
+ *
+ *Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ *"Software"), to deal in the Software without restriction, including
+ *without limitation the rights to use, copy, modify, merge, publish,
+ *distribute, sublicense, and/or sell copies of the Software, and to
+ *permit persons to whom the Software is furnished to do so, subject to
+ *the following conditions:
+ *
+ *The above copyright notice and this permission notice shall be
+ *included in all copies or substantial portions of the Software.
+ *
+ *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *NONINFRINGEMENT. IN NO EVENT SHALL HAROLD L HUNT II BE LIABLE FOR
+ *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+ *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *Except as contained in this notice, the name of Harold L Hunt II
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from Harold L Hunt II.
+ *
+ * Authors: Harold L Hunt II
+ */
+
+#ifdef HAVE_XWIN_CONFIG_H
+#include <xwin-config.h>
+#endif
+#include "win.h"
+#include <X11/extensions/Xv.h>
+#include <X11/extensions/Xvproto.h>
+
+void
+winInitVideo (ScreenPtr pScreen);
+
+/*
+ * winInitVideo - Initialize support for the X Video (Xv) Extension.
+ */
+
+void
+winInitVideo (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+
+ if (pScreenInfo->dwBPP > 8)
+ {
+
+ }
+
+
+}
+
+
+
+
+
+
+
+#if 0
+#include "../xfree86/common/xf86.h"
+#include "../Xext/xvdix.h"
+#include "../xfree86/common/xf86xv.h"
+#include <X11/extensions/Xv.h>
+#endif
+
+
+
+#if 0
+/* client libraries expect an encoding */
+static XF86VideoEncodingRec DummyEncoding[1] =
+{
+ {
+ 0,
+ "XV_IMAGE",
+ IMAGE_MAX_WIDTH, IMAGE_MAX_HEIGHT,
+ {1, 1}
+ }
+};
+
+#define NUM_FORMATS 3
+
+static XF86VideoFormatRec Formats[NUM_FORMATS] =
+{
+ {15, TrueColor}, {16, TrueColor}, {24, TrueColor}
+};
+
+#define NUM_ATTRIBUTES 3
+
+static XF86AttributeRec Attributes[NUM_ATTRIBUTES] =
+{
+ {XvSettable | XvGettable, 0, (1 << 24) - 1, "XV_COLORKEY"},
+ {XvSettable | XvGettable, -128, 127, "XV_BRIGHTNESS"},
+ {XvSettable | XvGettable, 0, 255, "XV_CONTRAST"}
+};
+
+#define NUM_IMAGES 4
+
+static XF86ImageRec Images[NUM_IMAGES] =
+{
+ XVIMAGE_YUY2,
+ XVIMAGE_YV12,
+ XVIMAGE_I420,
+ XVIMAGE_UYVY
+};
+
+
+
+/*
+ * winInitVideo - Initialize support for the X Video (Xv) Extension.
+ */
+
+void
+winInitVideo (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ XF86VideoAdaptorPtr newAdaptor = NULL;
+
+ if (pScreenInfo->dwBPP > 8)
+ {
+ newAdaptor = I810SetupImageVideo (pScreen);
+ I810InitOffscreenImages (pScreen);
+ }
+
+ xf86XVScreenInit (pScreen, adaptors, 1);
+}
+
+
+static XF86VideoAdaptorPtr
+winSetupImageVideo (ScreenPtr pScreen)
+{
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+#if 0
+ I810Ptr pI810 = I810PTR(pScrn);
+#endif
+ XF86VideoAdaptorPtr adapt;
+
+ if (!(adapt = calloc(1, sizeof(XF86VideoAdaptorRec))))
+ return NULL;
+
+ adapt->type = XvWindowMask | XvInputMask | XvImageMask;
+ adapt->flags = VIDEO_OVERLAID_IMAGES | VIDEO_CLIP_TO_VIEWPORT;
+ adapt->name = PROJECT_NAME " Video Overlay";
+ adapt->nEncodings = 1;
+ adapt->pEncodings = DummyEncoding;
+ adapt->nFormats = NUM_FORMATS;
+ adapt->pFormats = Formats;
+ adapt->nPorts = 1;
+ adapt->pPortPrivates = NULL;
+
+ adapt->pPortPrivates[0].ptr = NULL;
+ adapt->pAttributes = Attributes;
+ adapt->nImages = NUM_IMAGES;
+ adapt->nAttributes = NUM_ATTRIBUTES;
+ adapt->pImages = Images;
+ adapt->PutVideo = NULL;
+ adapt->PutStill = NULL;
+ adapt->GetVideo = NULL;
+ adapt->GetStill = NULL;
+#if 0
+ adapt->StopVideo = I810StopVideo;
+ adapt->SetPortAttribute = I810SetPortAttribute;
+ adapt->GetPortAttribute = I810GetPortAttribute;
+ adapt->QueryBestSize = I810QueryBestSize;
+ adapt->PutImage = I810PutImage;
+ adapt->QueryImageAttributes = I810QueryImageAttributes;
+#endif
+
+#if 0
+ pPriv->colorKey = pI810->colorKey & ((1 << pScrn->depth) - 1);
+#endif
+ pPriv->videoStatus = 0;
+ pPriv->brightness = 0;
+ pPriv->contrast = 64;
+ pPriv->linear = NULL;
+ pPriv->currentBuf = 0;
+
+#if 0
+ /* gotta uninit this someplace */
+ RegionNull(&pPriv->clip);
+#endif
+
+#if 0
+ pI810->adaptor = adapt;
+
+ pI810->BlockHandler = pScreen->BlockHandler;
+ pScreen->BlockHandler = I810BlockHandler;
+#endif
+
+#if 0
+ xvBrightness = MAKE_ATOM("XV_BRIGHTNESS");
+ xvContrast = MAKE_ATOM("XV_CONTRAST");
+ xvColorKey = MAKE_ATOM("XV_COLORKEY");
+#endif
+
+#if 0
+ I810ResetVideo(pScrn);
+#endif
+
+ return adapt;
+}
+#endif
diff --git a/xorg-server/hw/xwin/winwin32rootless.c b/xorg-server/hw/xwin/winwin32rootless.c index 8f9917a7b..2f8ace57a 100644 --- a/xorg-server/hw/xwin/winwin32rootless.c +++ b/xorg-server/hw/xwin/winwin32rootless.c @@ -1,1070 +1,883 @@ -/* - *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved. - * - *Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - *"Software"), to deal in the Software without restriction, including - *without limitation the rights to use, copy, modify, merge, publish, - *distribute, sublicense, and/or sell copies of the Software, and to - *permit persons to whom the Software is furnished to do so, subject to - *the following conditions: - * - *The above copyright notice and this permission notice shall be - *included in all copies or substantial portions of the Software. - * - *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR - *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - *Except as contained in this notice, the name of the XFree86 Project - *shall not be used in advertising or otherwise to promote the sale, use - *or other dealings in this Software without prior written authorization - *from the XFree86 Project. - * - * Authors: Kensuke Matsuzaki - * Earle F. Philhower, III - * Harold L Hunt II - */ -/* - * Look at hw/darwin/quartz/xpr/xprFrame.c and hw/darwin/quartz/cr/crFrame.c - */ -#ifdef HAVE_XWIN_CONFIG_H -#include <xwin-config.h> -#endif -#include "win.h" -#include <winuser.h> -#define _WINDOWSWM_SERVER_ -#include <X11/extensions/windowswmstr.h> -#include "dixevents.h" -#include "winmultiwindowclass.h" -#include <X11/Xatom.h> - - -/* - * Constant defines - */ - -#ifndef ULW_COLORKEY -#define ULW_COLORKEY 0x00000001 -#endif -#ifndef ULW_ALPHA -#define ULW_ALPHA 0x00000002 -#endif -#ifndef ULW_OPAQUE -#define ULW_OPAQUE 0x00000004 -#endif -#define AC_SRC_ALPHA 0x01 - -/* - * Local function - */ - -DEFINE_ATOM_HELPER(AtmWindowsWmNativeHwnd, WINDOWSWM_NATIVE_HWND) -static void -winMWExtWMSetNativeProperty (RootlessWindowPtr pFrame); - -/* - * Global variables - */ - -Bool g_fNoConfigureWindow = FALSE; - -/* - * Internal function to get the DIB format that is compatible with the screen - * Fixme: Share code with winshadgdi.c - */ - -static -Bool -winMWExtWMQueryDIBFormat (win32RootlessWindowPtr pRLWinPriv, BITMAPINFOHEADER *pbmih) -{ - HBITMAP hbmp; -#if CYGMULTIWINDOW_DEBUG - LPDWORD pdw = NULL; -#endif - - /* Create a memory bitmap compatible with the screen */ - hbmp = CreateCompatibleBitmap (pRLWinPriv->hdcScreen, 1, 1); - if (hbmp == NULL) - { - ErrorF ("winMWExtWMQueryDIBFormat - CreateCompatibleBitmap failed\n"); - return FALSE; - } - - /* Initialize our bitmap info header */ - ZeroMemory (pbmih, sizeof (BITMAPINFOHEADER) + 256 * sizeof (RGBQUAD)); - pbmih->biSize = sizeof (BITMAPINFOHEADER); - - /* Get the biBitCount */ - if (!GetDIBits (pRLWinPriv->hdcScreen, - hbmp, - 0, 1, - NULL, - (BITMAPINFO*) pbmih, - DIB_RGB_COLORS)) - { - ErrorF ("winMWExtWMQueryDIBFormat - First call to GetDIBits failed\n"); - DeleteObject (hbmp); - return FALSE; - } - -#if CYGMULTIWINDOW_DEBUG - /* Get a pointer to bitfields */ - pdw = (DWORD*) ((CARD8*)pbmih + sizeof (BITMAPINFOHEADER)); - - winDebug ("winMWExtWMQueryDIBFormat - First call masks: %08x %08x %08x\n", - (unsigned int)pdw[0], (unsigned int)pdw[1], (unsigned int)pdw[2]); -#endif - - /* Get optimal color table, or the optimal bitfields */ - if (!GetDIBits (pRLWinPriv->hdcScreen, - hbmp, - 0, 1, - NULL, - (BITMAPINFO*)pbmih, - DIB_RGB_COLORS)) - { - ErrorF ("winMWExtWMQueryDIBFormat - Second call to GetDIBits " - "failed\n"); - DeleteObject (hbmp); - return FALSE; - } - - /* Free memory */ - DeleteObject (hbmp); - - return TRUE; -} - -static HRGN -winMWExtWMCreateRgnFromRegion (RegionPtr pShape) -{ - int nRects; - BoxPtr pRects, pEnd; - HRGN hRgn, hRgnRect; - - if (pShape == NULL) return NULL; - - nRects = RegionNumRects(pShape); - pRects = RegionRects(pShape); - - hRgn = CreateRectRgn (0, 0, 0, 0); - if (hRgn == NULL) - { - ErrorF ("winReshape - Initial CreateRectRgn (%d, %d, %d, %d) " - "failed: %d\n", - 0, 0, 0, 0, (int) GetLastError ()); - } - - /* Loop through all rectangles in the X region */ - for (pEnd = pRects + nRects; pRects < pEnd; pRects++) - { - /* Create a Windows region for the X rectangle */ - hRgnRect = CreateRectRgn (pRects->x1, - pRects->y1, - pRects->x2, - pRects->y2); - if (hRgnRect == NULL) - { - ErrorF ("winReshape - Loop CreateRectRgn (%d, %d, %d, %d) " - "failed: %d\n", - pRects->x1, - pRects->y1, - pRects->x2, - pRects->y2, - (int) GetLastError ()); - } - - /* Merge the Windows region with the accumulated region */ - if (CombineRgn (hRgn, hRgn, hRgnRect, RGN_OR) == ERROR) - { - ErrorF ("winReshape - CombineRgn () failed: %d\n", - (int) GetLastError ()); - } - - /* Delete the temporary Windows region */ - DeleteObject (hRgnRect); - } - - return hRgn; -} - -static void -InitWin32RootlessEngine (win32RootlessWindowPtr pRLWinPriv) -{ - pRLWinPriv->hdcScreen = GetDC (pRLWinPriv->hWnd); - pRLWinPriv->hdcShadow = CreateCompatibleDC (pRLWinPriv->hdcScreen); - pRLWinPriv->hbmpShadow = NULL; - - /* Allocate bitmap info header */ - pRLWinPriv->pbmihShadow = (BITMAPINFOHEADER*) malloc (sizeof (BITMAPINFOHEADER) - + 256 * sizeof (RGBQUAD)); - if (pRLWinPriv->pbmihShadow == NULL) - { - ErrorF ("InitWin32RootlessEngine - malloc () failed\n"); - return; - } - - /* Query the screen format */ - winMWExtWMQueryDIBFormat (pRLWinPriv, - pRLWinPriv->pbmihShadow); -} - -Bool -winMWExtWMCreateFrame (RootlessWindowPtr pFrame, ScreenPtr pScreen, - int newX, int newY, RegionPtr pShape) -{ -#define CLASS_NAME_LENGTH 512 - Bool fResult = TRUE; - win32RootlessWindowPtr pRLWinPriv; - WNDCLASSEX wc; - char pszClass[CLASS_NAME_LENGTH], pszWindowID[12]; - HICON hIcon; - HICON hIconSmall; - char *res_name, *res_class, *res_role; - static int s_iWindowID = 0; - -#if CYGMULTIWINDOW_DEBUG - winDebug ("winMWExtWMCreateFrame %d %d - %d %d\n", - newX, newY, pFrame->width, pFrame->height); -#endif - - pRLWinPriv = (win32RootlessWindowPtr) malloc (sizeof (win32RootlessWindowRec)); - pRLWinPriv->pFrame = pFrame; - pRLWinPriv->pfb = NULL; - pRLWinPriv->hbmpShadow = NULL; - pRLWinPriv->hdcShadow = NULL; - pRLWinPriv->hdcScreen = NULL; - pRLWinPriv->pbmihShadow = NULL; - pRLWinPriv->fResized = TRUE; - pRLWinPriv->fClose = FALSE; - pRLWinPriv->fRestackingNow = FALSE; - pRLWinPriv->fDestroyed = FALSE; - pRLWinPriv->fMovingOrSizing = FALSE; - - // Store the implementation private frame ID - pFrame->wid = (RootlessFrameID) pRLWinPriv; - - winSelectIcons(pFrame->win, &hIcon, &hIconSmall); - - /* Set standard class name prefix so we can identify window easily */ - strncpy (pszClass, WINDOW_CLASS_X, sizeof(pszClass)); - - if (winMultiWindowGetClassHint (pFrame->win, &res_name, &res_class)) - { - strncat (pszClass, "-", 1); - strncat (pszClass, res_name, CLASS_NAME_LENGTH - strlen (pszClass)); - strncat (pszClass, "-", 1); - strncat (pszClass, res_class, CLASS_NAME_LENGTH - strlen (pszClass)); - - /* Check if a window class is provided by the WM_WINDOW_ROLE property, - * if not use the WM_CLASS information. - * For further information see: - * http://tronche.com/gui/x/icccm/sec-5.html - */ - if (winMultiWindowGetWindowRole (pFrame->win, &res_role) ) - { - strcat (pszClass, "-"); - strcat (pszClass, res_role); - free (res_role); - } - - free (res_name); - free (res_class); - } - - /* Add incrementing window ID to make unique class name */ - snprintf (pszWindowID, sizeof(pszWindowID), "-%x", s_iWindowID++); - pszWindowID[sizeof(pszWindowID)-1] = 0; - strcat (pszClass, pszWindowID); - -#if CYGMULTIWINDOW_DEBUG - winDebug ("winCreateWindowsWindow - Creating class: %s\n", pszClass); -#endif - - /* Setup our window class */ - wc.cbSize = sizeof(wc); - wc.style = CS_HREDRAW | CS_VREDRAW; - wc.lpfnWndProc = winMWExtWMWindowProc; - wc.cbClsExtra = 0; - wc.cbWndExtra = 0; - wc.hInstance = g_hInstance; - wc.hIcon = hIcon; - wc.hIconSm = hIconSmall; - wc.hCursor = 0; - wc.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH); - wc.lpszMenuName = NULL; - wc.lpszClassName = pszClass; - RegisterClassEx (&wc); - - /* Create the window */ - g_fNoConfigureWindow = TRUE; - pRLWinPriv->hWnd = CreateWindowExA (WS_EX_TOOLWINDOW, /* Extended styles */ - pszClass, /* Class name */ - WINDOW_TITLE_X, /* Window name */ - WS_POPUP | WS_CLIPCHILDREN, - newX, /* Horizontal position */ - newY, /* Vertical position */ - pFrame->width, /* Right edge */ - pFrame->height, /* Bottom edge */ - (HWND) NULL, /* No parent or owner window */ - (HMENU) NULL, /* No menu */ - GetModuleHandle (NULL), /* Instance handle */ - pRLWinPriv); /* ScreenPrivates */ - if (pRLWinPriv->hWnd == NULL) - { - ErrorF ("winMWExtWMCreateFrame - CreateWindowExA () failed: %d\n", - (int) GetLastError ()); - fResult = FALSE; - } - -#if CYGMULTIWINDOW_DEBUG - winDebug ("winMWExtWMCreateFrame - ShowWindow\n"); -#endif - - //ShowWindow (pRLWinPriv->hWnd, SW_SHOWNOACTIVATE); - g_fNoConfigureWindow = FALSE; - - if (pShape != NULL) - { - winMWExtWMReshapeFrame (pFrame->wid, pShape); - } - -#if CYGMULTIWINDOW_DEBUG - winDebug ("winMWExtWMCreateFrame - (%08x) %08x\n", - (int) pFrame->wid, (int) pRLWinPriv->hWnd); -#if 0 - { - WindowPtr pWin2 = NULL; - win32RootlessWindowPtr pRLWinPriv2 = NULL; - - /* Check if the Windows window property for our X window pointer is valid */ - if ((pWin2 = (WindowPtr)GetProp (pRLWinPriv->hWnd, WIN_WINDOW_PROP)) != NULL) - { - pRLWinPriv2 = (win32RootlessWindowPtr) RootlessFrameForWindow (pWin2, FALSE); - } - winDebug ("winMWExtWMCreateFrame2 (%08x) %08x\n", - pRLWinPriv2, pRLWinPriv2->hWnd); - if (pRLWinPriv != pRLWinPriv2 || pRLWinPriv->hWnd != pRLWinPriv2->hWnd) - { - winDebug ("Error param missmatch\n"); - } - } -#endif -#endif - - winMWExtWMSetNativeProperty (pFrame); - - return fResult; -} - -void -winMWExtWMDestroyFrame (RootlessFrameID wid) -{ - win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) wid; - HICON hIcon; - HICON hIconSm; - HMODULE hInstance; - int iReturn; - char pszClass[CLASS_NAME_LENGTH]; - -#if CYGMULTIWINDOW_DEBUG - winDebug ("winMWExtWMDestroyFrame (%08x) %08x\n", - (int) pRLWinPriv, (int) pRLWinPriv->hWnd); -#if 0 - { - WindowPtr pWin2 = NULL; - win32RootlessWindowPtr pRLWinPriv2 = NULL; - - /* Check if the Windows window property for our X window pointer is valid */ - if ((pWin2 = (WindowPtr)GetProp (pRLWinPriv->hWnd, WIN_WINDOW_PROP)) != NULL) - { - pRLWinPriv2 = (win32RootlessWindowPtr) RootlessFrameForWindow (pWin2, FALSE); - } - winDebug ("winMWExtWMDestroyFrame2 (%08x) %08x\n", - pRLWinPriv2, pRLWinPriv2->hWnd); - if (pRLWinPriv != pRLWinPriv2 || pRLWinPriv->hWnd != pRLWinPriv2->hWnd) - { - winDebug ("Error param missmatch\n"); - *(int*)0 = 1;//raise exseption - } - } -#endif -#endif - - /* Store the info we need to destroy after this window is gone */ - hInstance = (HINSTANCE) GetClassLongPtr (pRLWinPriv->hWnd, GCLP_HMODULE); - hIcon = (HICON)SendMessage(pRLWinPriv->hWnd, WM_GETICON, ICON_BIG, 0); - hIconSm = (HICON)SendMessage(pRLWinPriv->hWnd, WM_GETICON, ICON_SMALL, 0); - iReturn = GetClassName (pRLWinPriv->hWnd, pszClass, CLASS_NAME_LENGTH); - - pRLWinPriv->fClose = TRUE; - pRLWinPriv->fDestroyed = TRUE; - - /* Destroy the Windows window */ - DestroyWindow (pRLWinPriv->hWnd); - - /* Only if we were able to get the name */ - if (iReturn) - { -#if CYGMULTIWINDOW_DEBUG - winDebug ("winMWExtWMDestroyFrame - Unregistering %s: ", pszClass); -#endif - iReturn = UnregisterClass (pszClass, hInstance); - } - -#if CYGMULTIWINDOW_DEBUG - winDebug ("winMWExtWMDestroyFramew - Deleting Icon\n"); -#endif - - winDestroyIcon(hIcon); - winDestroyIcon(hIconSm); - -#if CYGMULTIWINDOW_DEBUG - winDebug ("winMWExtWMDestroyFrame - done\n"); -#endif -} - -void -winMWExtWMMoveFrame (RootlessFrameID wid, ScreenPtr pScreen, int iNewX, int iNewY) -{ - win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) wid; - RECT rcNew; - DWORD dwExStyle; - DWORD dwStyle; - int iX, iY, iWidth, iHeight; - -#if CYGMULTIWINDOW_DEBUG - winDebug ("winMWExtWMMoveFrame (%08x) (%d %d)\n", (int) pRLWinPriv, iNewX, iNewY); -#endif - - /* Get the Windows window style and extended style */ - dwExStyle = GetWindowLongPtr (pRLWinPriv->hWnd, GWL_EXSTYLE); - dwStyle = GetWindowLongPtr (pRLWinPriv->hWnd, GWL_STYLE); - - /* Get the X and Y location of the X window */ - iX = iNewX + GetSystemMetrics (SM_XVIRTUALSCREEN); - iY = iNewY + GetSystemMetrics (SM_YVIRTUALSCREEN); - - /* Get the height and width of the X window */ - iWidth = pRLWinPriv->pFrame->width; - iHeight = pRLWinPriv->pFrame->height; - - /* Store the origin, height, and width in a rectangle structure */ - SetRect (&rcNew, iX, iY, iX + iWidth, iY + iHeight); - -#ifdef CYGMULTIWINDOW_DEBUG - winDebug("\tWindow {%d, %d, %d, %d}, {%d, %d}\n", - rcNew.left, rcNew.top, rcNew.right, rcNew.bottom, - rcNew.right - rcNew.left, rcNew.bottom - rcNew.top); -#endif - /* - * Calculate the required size of the Windows window rectangle, - * given the size of the Windows window client area. - */ - AdjustWindowRectEx (&rcNew, dwStyle, FALSE, dwExStyle); - -#ifdef CYGMULTIWINDOW_DEBUG - winDebug("\tAdjusted {%d, %d, %d, %d}, {%d, %d}\n", - rcNew.left, rcNew.top, rcNew.right, rcNew.bottom, - rcNew.right - rcNew.left, rcNew.bottom - rcNew.top); -#endif - g_fNoConfigureWindow = TRUE; - SetWindowPos (pRLWinPriv->hWnd, NULL, rcNew.left, rcNew.top, 0, 0, - SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOZORDER); - g_fNoConfigureWindow = FALSE; -#if CYGMULTIWINDOW_DEBUG - winDebug ("winMWExtWMMoveFrame (%08x) done\n", (int) pRLWinPriv); -#endif -} - -void -winMWExtWMResizeFrame (RootlessFrameID wid, ScreenPtr pScreen, - int iNewX, int iNewY, - unsigned int uiNewWidth, unsigned int uiNewHeight, - unsigned int uiGravity) -{ - win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) wid; - RECT rcNew; - RECT rcOld; - DWORD dwExStyle; - DWORD dwStyle; - int iX, iY; - -#if CYGMULTIWINDOW_DEBUG - winDebug ("winMWExtWMResizeFrame (%08x) (%d %d)-(%d %d)\n", - (int) pRLWinPriv, iNewX, iNewY, uiNewWidth, uiNewHeight); -#endif - - pRLWinPriv->fResized = TRUE; - - /* Get the Windows window style and extended style */ - dwExStyle = GetWindowLongPtr (pRLWinPriv->hWnd, GWL_EXSTYLE); - dwStyle = GetWindowLongPtr (pRLWinPriv->hWnd, GWL_STYLE); - - /* Get the X and Y location of the X window */ - iX = iNewX + GetSystemMetrics (SM_XVIRTUALSCREEN); - iY = iNewY + GetSystemMetrics (SM_YVIRTUALSCREEN); - - /* Store the origin, height, and width in a rectangle structure */ - SetRect (&rcNew, iX, iY, iX + uiNewWidth, iY + uiNewHeight); - - /* - * Calculate the required size of the Windows window rectangle, - * given the size of the Windows window client area. - */ - AdjustWindowRectEx (&rcNew, dwStyle, FALSE, dwExStyle); - - /* Get a rectangle describing the old Windows window */ - GetWindowRect (pRLWinPriv->hWnd, &rcOld); - - /* Check if the old rectangle and new rectangle are the same */ - if (!EqualRect (&rcNew, &rcOld)) - { - - g_fNoConfigureWindow = TRUE; - MoveWindow (pRLWinPriv->hWnd, - rcNew.left, rcNew.top, - rcNew.right - rcNew.left, rcNew.bottom - rcNew.top, - TRUE); - g_fNoConfigureWindow = FALSE; - } -} - -void -winMWExtWMRestackFrame (RootlessFrameID wid, RootlessFrameID nextWid) -{ - win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) wid; - win32RootlessWindowPtr pRLNextWinPriv = (win32RootlessWindowPtr) nextWid; - winScreenPriv(pRLWinPriv->pFrame->win->drawable.pScreen); - winScreenInfo *pScreenInfo = NULL; - DWORD dwCurrentProcessID = GetCurrentProcessId (); - DWORD dwWindowProcessID = 0; - HWND hWnd; - Bool fFirst = TRUE; - Bool fNeedRestack = TRUE; -#if CYGMULTIWINDOW_DEBUG - winDebug ("winMWExtWMRestackFrame (%08x)\n", (int) pRLWinPriv); -#endif - - if (pScreenPriv->fRestacking) return; - - if (pScreenPriv) pScreenInfo = pScreenPriv->pScreenInfo; - - pRLWinPriv->fRestackingNow = TRUE; - - /* Show window */ - if(!IsWindowVisible (pRLWinPriv->hWnd)) - ShowWindow (pRLWinPriv->hWnd, SW_SHOWNOACTIVATE); - - if (pRLNextWinPriv == NULL) - { -#if CYGMULTIWINDOW_DEBUG - winDebug ("Win %08x is top\n", pRLWinPriv); -#endif - pScreenPriv->widTop = wid; - SetWindowPos (pRLWinPriv->hWnd, HWND_TOP, - 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE); - } - else if (winIsInternalWMRunning(pScreenInfo)) - { - /* using mulwinidow wm */ -#if CYGMULTIWINDOW_DEBUG - winDebug ("Win %08x is not top\n", pRLWinPriv); -#endif - for (hWnd = GetNextWindow (pRLWinPriv->hWnd, GW_HWNDPREV); - fNeedRestack && hWnd != NULL; - hWnd = GetNextWindow (hWnd, GW_HWNDPREV)) - { - GetWindowThreadProcessId (hWnd, &dwWindowProcessID); - - if ((dwWindowProcessID == dwCurrentProcessID) - && GetProp (hWnd, WIN_WINDOW_PROP)) - { - if (hWnd == pRLNextWinPriv->hWnd) - { - /* Enable interleave X window and Windows window */ - if (!fFirst) - { -#if CYGMULTIWINDOW_DEBUG - winDebug ("raise: Insert after Win %08x\n", pRLNextWinPriv); -#endif - SetWindowPos (pRLWinPriv->hWnd, pRLNextWinPriv->hWnd, - 0, 0, 0, 0, - SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE); - } - else - { -#if CYGMULTIWINDOW_DEBUG - winDebug ("No change\n"); -#endif - } - fNeedRestack = FALSE; - break; - } - if (fFirst) fFirst = FALSE; - } - } - - for (hWnd = GetNextWindow (pRLWinPriv->hWnd, GW_HWNDNEXT); - fNeedRestack && hWnd != NULL; - hWnd = GetNextWindow (hWnd, GW_HWNDNEXT)) - { - GetWindowThreadProcessId (hWnd, &dwWindowProcessID); - - if ((dwWindowProcessID == dwCurrentProcessID) - && GetProp (hWnd, WIN_WINDOW_PROP)) - { - if (hWnd == pRLNextWinPriv->hWnd) - { -#if CYGMULTIWINDOW_DEBUG - winDebug ("lower: Insert after Win %08x\n", pRLNextWinPriv); -#endif - SetWindowPos (pRLWinPriv->hWnd, pRLNextWinPriv->hWnd, - 0, 0, 0, 0, - SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE); - fNeedRestack = FALSE; - break; - } - } - } - } - else - { - /* using general wm like twm, wmaker etc. - Interleave X window and Windows window will cause problem. */ - SetWindowPos (pRLWinPriv->hWnd, pRLNextWinPriv->hWnd, - 0, 0, 0, 0, - SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE); -#if 0 -#endif - } -#if CYGMULTIWINDOW_DEBUG - winDebug ("winMWExtWMRestackFrame - done (%08x)\n", (int) pRLWinPriv); -#endif - - pRLWinPriv->fRestackingNow = FALSE; -} - -void -winMWExtWMReshapeFrame (RootlessFrameID wid, RegionPtr pShape) -{ - win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) wid; - HRGN hRgn, hRgnWindow, hRgnClient; - RECT rcWindow, rcClient; -#if CYGMULTIWINDOW_DEBUG - winDebug ("winMWExtWMReshapeFrame (%08x)\n", (int) pRLWinPriv); -#endif - - hRgn = winMWExtWMCreateRgnFromRegion (pShape); - - /* Create region for non-client area */ - GetWindowRect (pRLWinPriv->hWnd, &rcWindow); - GetClientRect (pRLWinPriv->hWnd, &rcClient); - MapWindowPoints (pRLWinPriv->hWnd, HWND_DESKTOP, (LPPOINT)&rcClient, 2); - OffsetRgn (hRgn, rcClient.left - rcWindow.left, rcClient.top - rcWindow.top); - OffsetRect (&rcClient, -rcWindow.left, -rcWindow.top); - OffsetRect (&rcWindow, -rcWindow.left, -rcWindow.top); - hRgnWindow = CreateRectRgnIndirect (&rcWindow); - hRgnClient = CreateRectRgnIndirect (&rcClient); - CombineRgn (hRgnWindow, hRgnWindow, hRgnClient, RGN_DIFF); - CombineRgn (hRgn, hRgnWindow, hRgn, RGN_OR); - - - SetWindowRgn (pRLWinPriv->hWnd, hRgn, TRUE); - - DeleteObject (hRgnWindow); - DeleteObject (hRgnClient); -} - -void -winMWExtWMUnmapFrame (RootlessFrameID wid) -{ - win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) wid; -#if CYGMULTIWINDOW_DEBUG - winDebug ("winMWExtWMUnmapFrame (%08x)\n", (int) pRLWinPriv); -#endif - - g_fNoConfigureWindow = TRUE; - //ShowWindow (pRLWinPriv->hWnd, SW_MINIMIZE); - ShowWindow (pRLWinPriv->hWnd, SW_HIDE); - g_fNoConfigureWindow = FALSE; -} - -/* - * Fixme: Code sharing with winshadgdi.c and other engine support - */ -void -winMWExtWMStartDrawing (RootlessFrameID wid, char **pixelData, int *bytesPerRow) -{ - win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) wid; - winPrivScreenPtr pScreenPriv = NULL; - winScreenInfo *pScreenInfo = NULL; - ScreenPtr pScreen = NULL; - DIBSECTION dibsection; - Bool fReturn = TRUE; - HDC hdcNew; - HBITMAP hbmpNew; -#if CYGMULTIWINDOW_DEBUG - winDebug ("winMWExtWMStartDrawing (%08x) %08x\n", (int) pRLWinPriv, pRLWinPriv->fDestroyed); -#endif - - if (!pRLWinPriv->fDestroyed) - { - pScreen = pRLWinPriv->pFrame->win->drawable.pScreen; - if (pScreen) pScreenPriv = winGetScreenPriv(pScreen); - if (pScreenPriv) pScreenInfo = pScreenPriv->pScreenInfo; - -#if CYGMULTIWINDOW_DEBUG - winDebug ("\tpScreenPriv %08X\n", (int) pScreenPriv); - winDebug ("\tpScreenInfo %08X\n", (int) pScreenInfo); - winDebug ("\t(%d, %d)\n", (int)pRLWinPriv->pFrame->width, - (int) pRLWinPriv->pFrame->height); -#endif - if (pRLWinPriv->hdcScreen == NULL) - { - InitWin32RootlessEngine (pRLWinPriv); - } - - if (pRLWinPriv->fResized) - { - /* width * bpp must be multiple of 4 to match 32bit alignment */ - int stridesize; - int misalignment; - - pRLWinPriv->pbmihShadow->biWidth = pRLWinPriv->pFrame->width; - pRLWinPriv->pbmihShadow->biHeight = -pRLWinPriv->pFrame->height; - - stridesize = pRLWinPriv->pFrame->width * (pScreenInfo->dwBPP >> 3); - misalignment = stridesize & 3; - if (misalignment != 0) - { - stridesize += 4 - misalignment; - pRLWinPriv->pbmihShadow->biWidth = stridesize / (pScreenInfo->dwBPP >> 3); - winDebug("\tresizing to %d (was %d)\n", - pRLWinPriv->pbmihShadow->biWidth, pRLWinPriv->pFrame->width); - } - - hdcNew = CreateCompatibleDC (pRLWinPriv->hdcScreen); - /* Create a DI shadow bitmap with a bit pointer */ - hbmpNew = CreateDIBSection (pRLWinPriv->hdcScreen, - (BITMAPINFO *) pRLWinPriv->pbmihShadow, - DIB_RGB_COLORS, - (VOID**) &pRLWinPriv->pfb, - NULL, - 0); - if (hbmpNew == NULL || pRLWinPriv->pfb == NULL) - { - ErrorF ("winMWExtWMStartDrawing - CreateDIBSection failed\n"); - //return FALSE; - } - else - { -#if CYGMULTIWINDOW_DEBUG - winDebug ("winMWExtWMStartDrawing - Shadow buffer allocated\n"); -#endif - } - - /* Get information about the bitmap that was allocated */ - GetObject (hbmpNew, sizeof (dibsection), &dibsection); - -#if CYGMULTIWINDOW_DEBUG - /* Print information about bitmap allocated */ - winDebug ("winMWExtWMStartDrawing - Dibsection width: %d height: %d " - "depth: %d size image: %d\n", - (unsigned int)dibsection.dsBmih.biWidth, - (unsigned int)dibsection.dsBmih.biHeight, - (unsigned int)dibsection.dsBmih.biBitCount, - (unsigned int)dibsection.dsBmih.biSizeImage); -#endif - - /* Select the shadow bitmap into the shadow DC */ - SelectObject (hdcNew, hbmpNew); - -#if CYGMULTIWINDOW_DEBUG - winDebug ("winMWExtWMStartDrawing - Attempting a shadow blit\n"); -#endif - - /* Blit from the old shadow to the new shadow */ - fReturn = BitBlt (hdcNew, - 0, 0, - pRLWinPriv->pFrame->width, pRLWinPriv->pFrame->height, - pRLWinPriv->hdcShadow, - 0, 0, - SRCCOPY); - if (fReturn) - { -#if CYGMULTIWINDOW_DEBUG - winDebug ("winMWExtWMStartDrawing - Shadow blit success\n"); -#endif - } - else - { - ErrorF ("winMWExtWMStartDrawing - Shadow blit failure\n"); - } - - /* Look for height weirdness */ - if (dibsection.dsBmih.biHeight < 0) - { - /* FIXME: Figure out why biHeight is sometimes negative */ - ErrorF ("winMWExtWMStartDrawing - WEIRDNESS - " - "biHeight still negative: %d\n", - (int) dibsection.dsBmih.biHeight); - ErrorF ("winMWExtWMStartDrawing - WEIRDNESS - " - "Flipping biHeight sign\n"); - dibsection.dsBmih.biHeight = -dibsection.dsBmih.biHeight; - } - - pRLWinPriv->dwWidthBytes = dibsection.dsBm.bmWidthBytes; - -#if CYGMULTIWINDOW_DEBUG - winDebug ("winMWExtWMStartDrawing - bytesPerRow: %d\n", - (unsigned int)dibsection.dsBm.bmWidthBytes); -#endif - - /* Free the old shadow bitmap */ - DeleteObject (pRLWinPriv->hdcShadow); - DeleteObject (pRLWinPriv->hbmpShadow); - - pRLWinPriv->hdcShadow = hdcNew; - pRLWinPriv->hbmpShadow = hbmpNew; - - pRLWinPriv->fResized = FALSE; -#if CYGMULTIWINDOW_DEBUG && FALSE - winDebug ("winMWExtWMStartDrawing - 0x%08x %d\n", - (unsigned int)pRLWinPriv->pfb, - (unsigned int)dibsection.dsBm.bmWidthBytes); -#endif - } - } - else - { - ErrorF ("winMWExtWMStartDrawing - Already window was destroyed \n"); - } -#if CYGMULTIWINDOW_DEBUG - winDebug ("winMWExtWMStartDrawing - done (0x%08x) 0x%08x %d\n", - (int) pRLWinPriv, - (unsigned int)pRLWinPriv->pfb, (unsigned int)pRLWinPriv->dwWidthBytes); -#endif - *pixelData = pRLWinPriv->pfb; - *bytesPerRow = pRLWinPriv->dwWidthBytes; -} - -void -winMWExtWMStopDrawing (RootlessFrameID wid, Bool fFlush) -{ -#if 0 - win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) wid; - BLENDFUNCTION bfBlend; - SIZE szWin; - POINT ptSrc; -#if CYGMULTIWINDOW_DEBUG || TRUE - winDebug ("winMWExtWMStopDrawing (%08x)\n", pRLWinPriv); -#endif - szWin.cx = pRLWinPriv->dwWidth; - szWin.cy = pRLWinPriv->dwHeight; - ptSrc.x = 0; - ptSrc.y = 0; - bfBlend.BlendOp = AC_SRC_OVER; - bfBlend.BlendFlags = 0; - bfBlend.SourceConstantAlpha = 255; - bfBlend.AlphaFormat = AC_SRC_ALPHA; - - if (!UpdateLayeredWindow (pRLWinPriv->hWnd, - NULL, NULL, &szWin, - pRLWinPriv->hdcShadow, &ptSrc, - 0, &bfBlend, ULW_ALPHA)) - { - ErrorF ("winMWExtWMStopDrawing - UpdateLayeredWindow failed\n"); - } -#endif -} - -void -winMWExtWMUpdateRegion (RootlessFrameID wid, RegionPtr pDamage) -{ - win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) wid; -#if 0 - BLENDFUNCTION bfBlend; - SIZE szWin; - POINT ptSrc; -#endif -#if CYGMULTIWINDOW_DEBUG && 0 - winDebug ("winMWExtWMUpdateRegion (%08x)\n", pRLWinPriv); -#endif -#if 0 - szWin.cx = pRLWinPriv->dwWidth; - szWin.cy = pRLWinPriv->dwHeight; - ptSrc.x = 0; - ptSrc.y = 0; - bfBlend.BlendOp = AC_SRC_OVER; - bfBlend.BlendFlags = 0; - bfBlend.SourceConstantAlpha = 255; - bfBlend.AlphaFormat = AC_SRC_ALPHA; - - if (!UpdateLayeredWindow (pRLWinPriv->hWnd, - NULL, NULL, &szWin, - pRLWinPriv->hdcShadow, &ptSrc, - 0, &bfBlend, ULW_ALPHA)) - { - LPVOID lpMsgBuf; - - /* Display a fancy error message */ - FormatMessage (FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, - GetLastError (), - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPTSTR) &lpMsgBuf, - 0, NULL); - - ErrorF ("winMWExtWMUpdateRegion - UpdateLayeredWindow failed: %s\n", - (LPSTR)lpMsgBuf); - LocalFree (lpMsgBuf); - } -#endif - if (!g_fNoConfigureWindow) UpdateWindow (pRLWinPriv->hWnd); -} - -void -winMWExtWMDamageRects (RootlessFrameID wid, int nCount, const BoxRec *pRects, - int shift_x, int shift_y) -{ - win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) wid; - const BoxRec *pEnd; -#if CYGMULTIWINDOW_DEBUG && 0 - winDebug ("winMWExtWMDamageRects (%08x, %d, %08x, %d, %d)\n", - pRLWinPriv, nCount, pRects, shift_x, shift_y); -#endif - - for (pEnd = pRects + nCount; pRects < pEnd; pRects++) { - RECT rcDmg; - rcDmg.left = pRects->x1 + shift_x; - rcDmg.top = pRects->y1 + shift_y; - rcDmg.right = pRects->x2 + shift_x; - rcDmg.bottom = pRects->y2 + shift_y; - - InvalidateRect (pRLWinPriv->hWnd, &rcDmg, FALSE); - } -} - -void -winMWExtWMRootlessSwitchWindow (RootlessWindowPtr pFrame, WindowPtr oldWin) -{ - win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) pFrame->wid; -#if CYGMULTIWINDOW_DEBUG - winDebug ("winMWExtWMRootlessSwitchWindow (%08x) %08x\n", - (int) pRLWinPriv, (int) pRLWinPriv->hWnd); -#endif - pRLWinPriv->pFrame = pFrame; - pRLWinPriv->fResized = TRUE; - - /* Set the window extended style flags */ - SetWindowLongPtr (pRLWinPriv->hWnd, GWL_EXSTYLE, WS_EX_TOOLWINDOW); - - /* Set the window standard style flags */ - SetWindowLongPtr (pRLWinPriv->hWnd, GWL_STYLE, - WS_POPUP | WS_CLIPCHILDREN); - - DeleteProperty (serverClient, oldWin, AtmWindowsWmNativeHwnd ()); - winMWExtWMSetNativeProperty (pFrame); -#if CYGMULTIWINDOW_DEBUG -#if 0 - { - WindowPtr pWin2 = NULL; - win32RootlessWindowPtr pRLWinPriv2 = NULL; - - /* Check if the Windows window property for our X window pointer is valid */ - if ((pWin2 = (WindowPtr)GetProp (pRLWinPriv->hWnd, WIN_WINDOW_PROP)) != NULL) - { - pRLWinPriv2 = (win32RootlessWindowPtr) RootlessFrameForWindow (pWin2, FALSE); - } - winDebug ("winMWExtWMSwitchFrame2 (%08x) %08x\n", - pRLWinPriv2, pRLWinPriv2->hWnd); - if (pRLWinPriv != pRLWinPriv2 || pRLWinPriv->hWnd != pRLWinPriv2->hWnd) - { - winDebug ("Error param missmatch\n"); - } - } -#endif -#endif -} - -void -winMWExtWMCopyBytes (unsigned int width, unsigned int height, - const void *src, unsigned int srcRowBytes, - void *dst, unsigned int dstRowBytes) -{ -#if CYGMULTIWINDOW_DEBUG - winDebug ("winMWExtWMCopyBytes - Not implemented\n"); -#endif -} - -void -winMWExtWMCopyWindow (RootlessFrameID wid, int nDstRects, const BoxRec *pDstRects, - int nDx, int nDy) -{ - win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) wid; - const BoxRec *pEnd; - RECT rcDmg; -#if CYGMULTIWINDOW_DEBUG - winDebug ("winMWExtWMCopyWindow (%08x, %d, %08x, %d, %d)\n", - (int) pRLWinPriv, nDstRects, (int) pDstRects, nDx, nDy); -#endif - - for (pEnd = pDstRects + nDstRects; pDstRects < pEnd; pDstRects++) - { -#if CYGMULTIWINDOW_DEBUG - winDebug ("BitBlt (%d, %d, %d, %d) (%d, %d)\n", - pDstRects->x1, pDstRects->y1, - pDstRects->x2 - pDstRects->x1, - pDstRects->y2 - pDstRects->y1, - pDstRects->x1 + nDx, - pDstRects->y1 + nDy); -#endif - - if (!BitBlt (pRLWinPriv->hdcShadow, - pDstRects->x1, pDstRects->y1, - pDstRects->x2 - pDstRects->x1, - pDstRects->y2 - pDstRects->y1, - pRLWinPriv->hdcShadow, - pDstRects->x1 + nDx, pDstRects->y1 + nDy, - SRCCOPY)) - { - ErrorF ("winMWExtWMCopyWindow - BitBlt failed.\n"); - } - - rcDmg.left = pDstRects->x1; - rcDmg.top = pDstRects->y1; - rcDmg.right = pDstRects->x2; - rcDmg.bottom = pDstRects->y2; - - InvalidateRect (pRLWinPriv->hWnd, &rcDmg, FALSE); - } -#if CYGMULTIWINDOW_DEBUG - winDebug ("winMWExtWMCopyWindow - done\n"); -#endif -} - - -/* - * winMWExtWMSetNativeProperty - */ - -static void -winMWExtWMSetNativeProperty (RootlessWindowPtr pFrame) -{ - win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) pFrame->wid; - long lData; - - /* FIXME: move this to WindowsWM extension */ - - lData = (long) pRLWinPriv->hWnd; - dixChangeWindowProperty(serverClient, pFrame->win, AtmWindowsWmNativeHwnd(), - XA_INTEGER, 32, PropModeReplace, 1, &lData, TRUE); -} +/*
+ *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
+ *
+ *Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ *"Software"), to deal in the Software without restriction, including
+ *without limitation the rights to use, copy, modify, merge, publish,
+ *distribute, sublicense, and/or sell copies of the Software, and to
+ *permit persons to whom the Software is furnished to do so, subject to
+ *the following conditions:
+ *
+ *The above copyright notice and this permission notice shall be
+ *included in all copies or substantial portions of the Software.
+ *
+ *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
+ *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+ *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Kensuke Matsuzaki
+ * Earle F. Philhower, III
+ * Harold L Hunt II
+ */
+/*
+ * Look at hw/darwin/quartz/xpr/xprFrame.c and hw/darwin/quartz/cr/crFrame.c
+ */
+#ifdef HAVE_XWIN_CONFIG_H
+#include <xwin-config.h>
+#endif
+#include "win.h"
+#include <winuser.h>
+#define _WINDOWSWM_SERVER_
+#include <X11/extensions/windowswmstr.h>
+#include "dixevents.h"
+#include "winmultiwindowclass.h"
+#include <X11/Xatom.h>
+
+
+/*
+ * Constant defines
+ */
+
+#ifndef ULW_COLORKEY
+#define ULW_COLORKEY 0x00000001
+#endif
+#ifndef ULW_ALPHA
+#define ULW_ALPHA 0x00000002
+#endif
+#ifndef ULW_OPAQUE
+#define ULW_OPAQUE 0x00000004
+#endif
+#define AC_SRC_ALPHA 0x01
+
+/*
+ * Local function
+ */
+
+DEFINE_ATOM_HELPER(AtmWindowsWmNativeHwnd, WINDOWSWM_NATIVE_HWND)
+static void
+winMWExtWMSetNativeProperty (RootlessWindowPtr pFrame);
+
+/*
+ * Global variables
+ */
+
+Bool g_fNoConfigureWindow = FALSE;
+
+/*
+ * Internal function to get the DIB format that is compatible with the screen
+ * Fixme: Share code with winshadgdi.c
+ */
+
+static
+Bool
+winMWExtWMQueryDIBFormat (win32RootlessWindowPtr pRLWinPriv, BITMAPINFOHEADER *pbmih)
+{
+ HBITMAP hbmp;
+#ifdef _DEBUG
+ LPDWORD pdw = NULL;
+#endif
+
+ /* Create a memory bitmap compatible with the screen */
+ hbmp = CreateCompatibleBitmap (pRLWinPriv->hdcScreen, 1, 1);
+ if (hbmp == NULL)
+ {
+ ErrorF ("winMWExtWMQueryDIBFormat - CreateCompatibleBitmap failed\n");
+ return FALSE;
+ }
+
+ /* Initialize our bitmap info header */
+ ZeroMemory (pbmih, sizeof (BITMAPINFOHEADER) + 256 * sizeof (RGBQUAD));
+ pbmih->biSize = sizeof (BITMAPINFOHEADER);
+
+ /* Get the biBitCount */
+ if (!GetDIBits (pRLWinPriv->hdcScreen,
+ hbmp,
+ 0, 1,
+ NULL,
+ (BITMAPINFO*) pbmih,
+ DIB_RGB_COLORS))
+ {
+ ErrorF ("winMWExtWMQueryDIBFormat - First call to GetDIBits failed\n");
+ DeleteObject (hbmp);
+ return FALSE;
+ }
+
+#ifdef _DEBUG
+ /* Get a pointer to bitfields */
+ pdw = (DWORD*) ((CARD8*)pbmih + sizeof (BITMAPINFOHEADER));
+
+ winDebug ("winMWExtWMQueryDIBFormat - First call masks: %08x %08x %08x\n",
+ (unsigned int)pdw[0], (unsigned int)pdw[1], (unsigned int)pdw[2]);
+#endif
+
+ /* Get optimal color table, or the optimal bitfields */
+ if (!GetDIBits (pRLWinPriv->hdcScreen,
+ hbmp,
+ 0, 1,
+ NULL,
+ (BITMAPINFO*)pbmih,
+ DIB_RGB_COLORS))
+ {
+ ErrorF ("winMWExtWMQueryDIBFormat - Second call to GetDIBits "
+ "failed\n");
+ DeleteObject (hbmp);
+ return FALSE;
+ }
+
+ /* Free memory */
+ DeleteObject (hbmp);
+
+ return TRUE;
+}
+
+static HRGN
+winMWExtWMCreateRgnFromRegion (RegionPtr pShape)
+{
+ int nRects;
+ BoxPtr pRects, pEnd;
+ HRGN hRgn, hRgnRect;
+
+ if (pShape == NULL) return NULL;
+
+ nRects = RegionNumRects(pShape);
+ pRects = RegionRects(pShape);
+
+ hRgn = CreateRectRgn (0, 0, 0, 0);
+ if (hRgn == NULL)
+ {
+ ErrorF ("winReshape - Initial CreateRectRgn (%d, %d, %d, %d) "
+ "failed: %d\n",
+ 0, 0, 0, 0, (int) GetLastError ());
+ }
+
+ /* Loop through all rectangles in the X region */
+ for (pEnd = pRects + nRects; pRects < pEnd; pRects++)
+ {
+ /* Create a Windows region for the X rectangle */
+ hRgnRect = CreateRectRgn (pRects->x1,
+ pRects->y1,
+ pRects->x2,
+ pRects->y2);
+ if (hRgnRect == NULL)
+ {
+ ErrorF ("winReshape - Loop CreateRectRgn (%d, %d, %d, %d) "
+ "failed: %d\n",
+ pRects->x1,
+ pRects->y1,
+ pRects->x2,
+ pRects->y2,
+ (int) GetLastError ());
+ }
+
+ /* Merge the Windows region with the accumulated region */
+ if (CombineRgn (hRgn, hRgn, hRgnRect, RGN_OR) == ERROR)
+ {
+ ErrorF ("winReshape - CombineRgn () failed: %d\n",
+ (int) GetLastError ());
+ }
+
+ /* Delete the temporary Windows region */
+ DeleteObject (hRgnRect);
+ }
+
+ return hRgn;
+}
+
+static void
+InitWin32RootlessEngine (win32RootlessWindowPtr pRLWinPriv)
+{
+ pRLWinPriv->hdcScreen = GetDC (pRLWinPriv->hWnd);
+ pRLWinPriv->hdcShadow = CreateCompatibleDC (pRLWinPriv->hdcScreen);
+ pRLWinPriv->hbmpShadow = NULL;
+
+ /* Allocate bitmap info header */
+ pRLWinPriv->pbmihShadow = (BITMAPINFOHEADER*) malloc (sizeof (BITMAPINFOHEADER)
+ + 256 * sizeof (RGBQUAD));
+ if (pRLWinPriv->pbmihShadow == NULL)
+ {
+ ErrorF ("InitWin32RootlessEngine - malloc () failed\n");
+ return;
+ }
+
+ /* Query the screen format */
+ winMWExtWMQueryDIBFormat (pRLWinPriv,
+ pRLWinPriv->pbmihShadow);
+}
+
+Bool
+winMWExtWMCreateFrame (RootlessWindowPtr pFrame, ScreenPtr pScreen,
+ int newX, int newY, RegionPtr pShape)
+{
+#define CLASS_NAME_LENGTH 512
+ Bool fResult = TRUE;
+ win32RootlessWindowPtr pRLWinPriv;
+ WNDCLASSEX wc;
+ char pszClass[CLASS_NAME_LENGTH], pszWindowID[12];
+ HICON hIcon;
+ HICON hIconSmall;
+ char *res_name, *res_class, *res_role;
+ static int s_iWindowID = 0;
+
+ winDebug ("winMWExtWMCreateFrame %d %d - %d %d\n",
+ newX, newY, pFrame->width, pFrame->height);
+
+ pRLWinPriv = (win32RootlessWindowPtr) malloc (sizeof (win32RootlessWindowRec));
+ pRLWinPriv->pFrame = pFrame;
+ pRLWinPriv->pfb = NULL;
+ pRLWinPriv->hbmpShadow = NULL;
+ pRLWinPriv->hdcShadow = NULL;
+ pRLWinPriv->hdcScreen = NULL;
+ pRLWinPriv->pbmihShadow = NULL;
+ pRLWinPriv->fResized = TRUE;
+ pRLWinPriv->fClose = FALSE;
+ pRLWinPriv->fRestackingNow = FALSE;
+ pRLWinPriv->fDestroyed = FALSE;
+ pRLWinPriv->fMovingOrSizing = FALSE;
+
+ // Store the implementation private frame ID
+ pFrame->wid = (RootlessFrameID) pRLWinPriv;
+
+ winSelectIcons(pFrame->win, &hIcon, &hIconSmall);
+
+ /* Set standard class name prefix so we can identify window easily */
+ strncpy (pszClass, WINDOW_CLASS_X, sizeof(pszClass));
+
+ if (winMultiWindowGetClassHint (pFrame->win, &res_name, &res_class))
+ {
+ strncat (pszClass, "-", 1);
+ strncat (pszClass, res_name, CLASS_NAME_LENGTH - strlen (pszClass));
+ strncat (pszClass, "-", 1);
+ strncat (pszClass, res_class, CLASS_NAME_LENGTH - strlen (pszClass));
+
+ /* Check if a window class is provided by the WM_WINDOW_ROLE property,
+ * if not use the WM_CLASS information.
+ * For further information see:
+ * http://tronche.com/gui/x/icccm/sec-5.html
+ */
+ if (winMultiWindowGetWindowRole (pFrame->win, &res_role) )
+ {
+ strcat (pszClass, "-");
+ strcat (pszClass, res_role);
+ free (res_role);
+ }
+
+ free (res_name);
+ free (res_class);
+ }
+
+ /* Add incrementing window ID to make unique class name */
+ snprintf (pszWindowID, sizeof(pszWindowID), "-%x", s_iWindowID++);
+ pszWindowID[sizeof(pszWindowID)-1] = 0;
+ strcat (pszClass, pszWindowID);
+
+ winDebug ("winCreateWindowsWindow - Creating class: %s\n", pszClass);
+
+ /* Setup our window class */
+ wc.cbSize = sizeof(wc);
+ wc.style = CS_HREDRAW | CS_VREDRAW;
+ wc.lpfnWndProc = winMWExtWMWindowProc;
+ wc.cbClsExtra = 0;
+ wc.cbWndExtra = 0;
+ wc.hInstance = g_hInstance;
+ wc.hIcon = hIcon;
+ wc.hIconSm = hIconSmall;
+ wc.hCursor = 0;
+ wc.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH);
+ wc.lpszMenuName = NULL;
+ wc.lpszClassName = pszClass;
+ RegisterClassEx (&wc);
+
+ /* Create the window */
+ g_fNoConfigureWindow = TRUE;
+ pRLWinPriv->hWnd = CreateWindowExA (WS_EX_TOOLWINDOW, /* Extended styles */
+ pszClass, /* Class name */
+ WINDOW_TITLE_X, /* Window name */
+ WS_POPUP | WS_CLIPCHILDREN,
+ newX, /* Horizontal position */
+ newY, /* Vertical position */
+ pFrame->width, /* Right edge */
+ pFrame->height, /* Bottom edge */
+ (HWND) NULL, /* No parent or owner window */
+ (HMENU) NULL, /* No menu */
+ GetModuleHandle (NULL), /* Instance handle */
+ pRLWinPriv); /* ScreenPrivates */
+ if (pRLWinPriv->hWnd == NULL)
+ {
+ ErrorF ("winMWExtWMCreateFrame - CreateWindowExA () failed: %d\n",
+ (int) GetLastError ());
+ fResult = FALSE;
+ }
+
+ winDebug ("winMWExtWMCreateFrame - ShowWindow\n");
+
+ //ShowWindow (pRLWinPriv->hWnd, SW_SHOWNOACTIVATE);
+ g_fNoConfigureWindow = FALSE;
+
+ if (pShape != NULL)
+ {
+ winMWExtWMReshapeFrame (pFrame->wid, pShape);
+ }
+
+ winDebug ("winMWExtWMCreateFrame - (%08x) %08x\n",
+ (int) pFrame->wid, (int) pRLWinPriv->hWnd);
+
+ winMWExtWMSetNativeProperty (pFrame);
+
+ return fResult;
+}
+
+void
+winMWExtWMDestroyFrame (RootlessFrameID wid)
+{
+ win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) wid;
+ HICON hIcon;
+ HICON hIconSm;
+ HMODULE hInstance;
+ int iReturn;
+ char pszClass[CLASS_NAME_LENGTH];
+
+ winDebug ("winMWExtWMDestroyFrame (%08x) %08x\n",
+ (int) pRLWinPriv, (int) pRLWinPriv->hWnd);
+
+ /* Store the info we need to destroy after this window is gone */
+ hInstance = (HINSTANCE) GetClassLongPtr (pRLWinPriv->hWnd, GCLP_HMODULE);
+ hIcon = (HICON)SendMessage(pRLWinPriv->hWnd, WM_GETICON, ICON_BIG, 0);
+ hIconSm = (HICON)SendMessage(pRLWinPriv->hWnd, WM_GETICON, ICON_SMALL, 0);
+ iReturn = GetClassName (pRLWinPriv->hWnd, pszClass, CLASS_NAME_LENGTH);
+
+ pRLWinPriv->fClose = TRUE;
+ pRLWinPriv->fDestroyed = TRUE;
+
+ /* Destroy the Windows window */
+ DestroyWindow (pRLWinPriv->hWnd);
+
+ /* Only if we were able to get the name */
+ if (iReturn)
+ {
+ winDebug ("winMWExtWMDestroyFrame - Unregistering %s: ", pszClass);
+ iReturn = UnregisterClass (pszClass, hInstance);
+
+ winDebug ("winMWExtWMDestroyFramew - Deleting Icon\n");
+ }
+
+ winDestroyIcon(hiconClass);
+ winDestroyIcon(hiconSmClass);
+
+ winDebug ("winMWExtWMDestroyFrame - done\n");
+}
+
+void
+winMWExtWMMoveFrame (RootlessFrameID wid, ScreenPtr pScreen, int iNewX, int iNewY)
+{
+ win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) wid;
+ RECT rcNew;
+ DWORD dwExStyle;
+ DWORD dwStyle;
+ int iX, iY, iWidth, iHeight;
+
+ winDebug ("winMWExtWMMoveFrame (%08x) (%d %d)\n", (int) pRLWinPriv, iNewX, iNewY);
+
+ /* Get the Windows window style and extended style */
+ dwExStyle = GetWindowLongPtr (pRLWinPriv->hWnd, GWL_EXSTYLE);
+ dwStyle = GetWindowLongPtr (pRLWinPriv->hWnd, GWL_STYLE);
+
+ /* Get the X and Y location of the X window */
+ iX = iNewX + GetSystemMetrics (SM_XVIRTUALSCREEN);
+ iY = iNewY + GetSystemMetrics (SM_YVIRTUALSCREEN);
+
+ /* Get the height and width of the X window */
+ iWidth = pRLWinPriv->pFrame->width;
+ iHeight = pRLWinPriv->pFrame->height;
+
+ /* Store the origin, height, and width in a rectangle structure */
+ SetRect (&rcNew, iX, iY, iX + iWidth, iY + iHeight);
+
+ winDebug("\tWindow {%d, %d, %d, %d}, {%d, %d}\n",
+ rcNew.left, rcNew.top, rcNew.right, rcNew.bottom,
+ rcNew.right - rcNew.left, rcNew.bottom - rcNew.top);
+ /*
+ * Calculate the required size of the Windows window rectangle,
+ * given the size of the Windows window client area.
+ */
+ AdjustWindowRectEx (&rcNew, dwStyle, FALSE, dwExStyle);
+
+ winDebug("\tAdjusted {%d, %d, %d, %d}, {%d, %d}\n",
+ rcNew.left, rcNew.top, rcNew.right, rcNew.bottom,
+ rcNew.right - rcNew.left, rcNew.bottom - rcNew.top);
+ g_fNoConfigureWindow = TRUE;
+ SetWindowPos (pRLWinPriv->hWnd, NULL, rcNew.left, rcNew.top, 0, 0,
+ SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOZORDER);
+ g_fNoConfigureWindow = FALSE;
+ winDebug ("winMWExtWMMoveFrame (%08x) done\n", (int) pRLWinPriv);
+}
+
+void
+winMWExtWMResizeFrame (RootlessFrameID wid, ScreenPtr pScreen,
+ int iNewX, int iNewY,
+ unsigned int uiNewWidth, unsigned int uiNewHeight,
+ unsigned int uiGravity)
+{
+ win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) wid;
+ RECT rcNew;
+ RECT rcOld;
+ DWORD dwExStyle;
+ DWORD dwStyle;
+ int iX, iY;
+
+ winDebug ("winMWExtWMResizeFrame (%08x) (%d %d)-(%d %d)\n",
+ (int) pRLWinPriv, iNewX, iNewY, uiNewWidth, uiNewHeight);
+
+ pRLWinPriv->fResized = TRUE;
+
+ /* Get the Windows window style and extended style */
+ dwExStyle = GetWindowLongPtr (pRLWinPriv->hWnd, GWL_EXSTYLE);
+ dwStyle = GetWindowLongPtr (pRLWinPriv->hWnd, GWL_STYLE);
+
+ /* Get the X and Y location of the X window */
+ iX = iNewX + GetSystemMetrics (SM_XVIRTUALSCREEN);
+ iY = iNewY + GetSystemMetrics (SM_YVIRTUALSCREEN);
+
+ /* Store the origin, height, and width in a rectangle structure */
+ SetRect (&rcNew, iX, iY, iX + uiNewWidth, iY + uiNewHeight);
+
+ /*
+ * Calculate the required size of the Windows window rectangle,
+ * given the size of the Windows window client area.
+ */
+ AdjustWindowRectEx (&rcNew, dwStyle, FALSE, dwExStyle);
+
+ /* Get a rectangle describing the old Windows window */
+ GetWindowRect (pRLWinPriv->hWnd, &rcOld);
+
+ /* Check if the old rectangle and new rectangle are the same */
+ if (!EqualRect (&rcNew, &rcOld))
+ {
+
+ g_fNoConfigureWindow = TRUE;
+ MoveWindow (pRLWinPriv->hWnd,
+ rcNew.left, rcNew.top,
+ rcNew.right - rcNew.left, rcNew.bottom - rcNew.top,
+ TRUE);
+ g_fNoConfigureWindow = FALSE;
+ }
+}
+
+void
+winMWExtWMRestackFrame (RootlessFrameID wid, RootlessFrameID nextWid)
+{
+ win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) wid;
+ win32RootlessWindowPtr pRLNextWinPriv = (win32RootlessWindowPtr) nextWid;
+ winScreenPriv(pRLWinPriv->pFrame->win->drawable.pScreen);
+ winScreenInfo *pScreenInfo = NULL;
+ DWORD dwCurrentProcessID = GetCurrentProcessId ();
+ DWORD dwWindowProcessID = 0;
+ HWND hWnd;
+ Bool fFirst = TRUE;
+ Bool fNeedRestack = TRUE;
+
+ winDebug ("winMWExtWMRestackFrame (%08x)\n", (int) pRLWinPriv);
+
+
+ if (pScreenPriv->fRestacking) return;
+
+ if (pScreenPriv) pScreenInfo = pScreenPriv->pScreenInfo;
+
+ pRLWinPriv->fRestackingNow = TRUE;
+
+ /* Show window */
+ if(!IsWindowVisible (pRLWinPriv->hWnd))
+ ShowWindow (pRLWinPriv->hWnd, SW_SHOWNOACTIVATE);
+
+ if (pRLNextWinPriv == NULL)
+ {
+ winDebug ("Win %08x is top\n", pRLWinPriv);
+ pScreenPriv->widTop = wid;
+ SetWindowPos (pRLWinPriv->hWnd, HWND_TOP,
+ 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE);
+ }
+#ifdef XWIN_MULTIWINDOWINTWM
+ else if (winIsInternalWMRunning(pScreenInfo))
+ {
+ /* using mulwinidow wm */
+ winDebug ("Win %08x is not top\n", pRLWinPriv);
+
+ for (hWnd = GetNextWindow (pRLWinPriv->hWnd, GW_HWNDPREV);
+ fNeedRestack && hWnd != NULL;
+ hWnd = GetNextWindow (hWnd, GW_HWNDPREV))
+ {
+ GetWindowThreadProcessId (hWnd, &dwWindowProcessID);
+
+ if ((dwWindowProcessID == dwCurrentProcessID)
+ && GetProp (hWnd, WIN_WINDOW_PROP))
+ {
+ if (hWnd == pRLNextWinPriv->hWnd)
+ {
+ /* Enable interleave X window and Windows window */
+ if (!fFirst)
+ {
+ winDebug ("raise: Insert after Win %08x\n", pRLNextWinPriv);
+
+ SetWindowPos (pRLWinPriv->hWnd, pRLNextWinPriv->hWnd,
+ 0, 0, 0, 0,
+ SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE);
+ }
+ else
+ {
+ winDebug ("No change\n");
+ }
+ fNeedRestack = FALSE;
+ break;
+ }
+ if (fFirst) fFirst = FALSE;
+ }
+ }
+
+ for (hWnd = GetNextWindow (pRLWinPriv->hWnd, GW_HWNDNEXT);
+ fNeedRestack && hWnd != NULL;
+ hWnd = GetNextWindow (hWnd, GW_HWNDNEXT))
+ {
+ GetWindowThreadProcessId (hWnd, &dwWindowProcessID);
+
+ if ((dwWindowProcessID == dwCurrentProcessID)
+ && GetProp (hWnd, WIN_WINDOW_PROP))
+ {
+ if (hWnd == pRLNextWinPriv->hWnd)
+ {
+ winDebug ("lower: Insert after Win %08x\n", pRLNextWinPriv);
+
+ SetWindowPos (pRLWinPriv->hWnd, pRLNextWinPriv->hWnd,
+ 0, 0, 0, 0,
+ SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE);
+ fNeedRestack = FALSE;
+ break;
+ }
+ }
+ }
+ }
+#endif
+ else
+ {
+ /* using general wm like twm, wmaker etc.
+ Interleave X window and Windows window will cause problem. */
+ SetWindowPos (pRLWinPriv->hWnd, pRLNextWinPriv->hWnd,
+ 0, 0, 0, 0,
+ SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE);
+ }
+ winDebug ("winMWExtWMRestackFrame - done (%08x)\n", (int) pRLWinPriv);
+
+ pRLWinPriv->fRestackingNow = FALSE;
+}
+
+void
+winMWExtWMReshapeFrame (RootlessFrameID wid, RegionPtr pShape)
+{
+ win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) wid;
+ HRGN hRgn, hRgnWindow, hRgnClient;
+ RECT rcWindow, rcClient;
+
+ winDebug ("winMWExtWMReshapeFrame (%08x)\n", (int) pRLWinPriv);
+
+ hRgn = winMWExtWMCreateRgnFromRegion (pShape);
+
+ /* Create region for non-client area */
+ GetWindowRect (pRLWinPriv->hWnd, &rcWindow);
+ GetClientRect (pRLWinPriv->hWnd, &rcClient);
+ MapWindowPoints (pRLWinPriv->hWnd, HWND_DESKTOP, (LPPOINT)&rcClient, 2);
+ OffsetRgn (hRgn, rcClient.left - rcWindow.left, rcClient.top - rcWindow.top);
+ OffsetRect (&rcClient, -rcWindow.left, -rcWindow.top);
+ OffsetRect (&rcWindow, -rcWindow.left, -rcWindow.top);
+ hRgnWindow = CreateRectRgnIndirect (&rcWindow);
+ hRgnClient = CreateRectRgnIndirect (&rcClient);
+ CombineRgn (hRgnWindow, hRgnWindow, hRgnClient, RGN_DIFF);
+ CombineRgn (hRgn, hRgnWindow, hRgn, RGN_OR);
+
+
+ SetWindowRgn (pRLWinPriv->hWnd, hRgn, TRUE);
+
+ DeleteObject (hRgnWindow);
+ DeleteObject (hRgnClient);
+}
+
+void
+winMWExtWMUnmapFrame (RootlessFrameID wid)
+{
+ win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) wid;
+
+ winDebug ("winMWExtWMUnmapFrame (%08x)\n", (int) pRLWinPriv);
+
+ g_fNoConfigureWindow = TRUE;
+ //ShowWindow (pRLWinPriv->hWnd, SW_MINIMIZE);
+ ShowWindow (pRLWinPriv->hWnd, SW_HIDE);
+ g_fNoConfigureWindow = FALSE;
+}
+
+/*
+ * Fixme: Code sharing with winshadgdi.c and other engine support
+ */
+void
+winMWExtWMStartDrawing (RootlessFrameID wid, char **pixelData, int *bytesPerRow)
+{
+ win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) wid;
+ winPrivScreenPtr pScreenPriv = NULL;
+ winScreenInfo *pScreenInfo = NULL;
+ ScreenPtr pScreen = NULL;
+ DIBSECTION dibsection;
+ Bool fReturn = TRUE;
+ HDC hdcNew;
+ HBITMAP hbmpNew;
+
+ winDebug ("winMWExtWMStartDrawing (%08x) %08x\n", (int) pRLWinPriv, pRLWinPriv->fDestroyed);
+
+ if (!pRLWinPriv->fDestroyed)
+ {
+ pScreen = pRLWinPriv->pFrame->win->drawable.pScreen;
+ if (pScreen) pScreenPriv = winGetScreenPriv(pScreen);
+ if (pScreenPriv) pScreenInfo = pScreenPriv->pScreenInfo;
+
+ winDebug ("\tpScreenPriv %08X\n", (int) pScreenPriv);
+ winDebug ("\tpScreenInfo %08X\n", (int) pScreenInfo);
+ winDebug ("\t(%d, %d)\n", (int)pRLWinPriv->pFrame->width,
+ (int) pRLWinPriv->pFrame->height);
+
+ if (pRLWinPriv->hdcScreen == NULL)
+ {
+ InitWin32RootlessEngine (pRLWinPriv);
+ }
+
+ if (pRLWinPriv->fResized)
+ {
+ /* width * bpp must be multiple of 4 to match 32bit alignment */
+ int stridesize;
+ int misalignment;
+
+ pRLWinPriv->pbmihShadow->biWidth = pRLWinPriv->pFrame->width;
+ pRLWinPriv->pbmihShadow->biHeight = -pRLWinPriv->pFrame->height;
+
+ stridesize = pRLWinPriv->pFrame->width * (pScreenInfo->dwBPP >> 3);
+ misalignment = stridesize & 3;
+ if (misalignment != 0)
+ {
+ stridesize += 4 - misalignment;
+ pRLWinPriv->pbmihShadow->biWidth = stridesize / (pScreenInfo->dwBPP >> 3);
+ winDebug("\tresizing to %d (was %d)\n",
+ pRLWinPriv->pbmihShadow->biWidth, pRLWinPriv->pFrame->width);
+ }
+
+ hdcNew = CreateCompatibleDC (pRLWinPriv->hdcScreen);
+ /* Create a DI shadow bitmap with a bit pointer */
+ hbmpNew = CreateDIBSection (pRLWinPriv->hdcScreen,
+ (BITMAPINFO *) pRLWinPriv->pbmihShadow,
+ DIB_RGB_COLORS,
+ (VOID**) &pRLWinPriv->pfb,
+ NULL,
+ 0);
+ if (hbmpNew == NULL || pRLWinPriv->pfb == NULL)
+ {
+ ErrorF ("winMWExtWMStartDrawing - CreateDIBSection failed\n");
+ //return FALSE;
+ }
+ else
+ {
+ winDebug ("winMWExtWMStartDrawing - Shadow buffer allocated\n");
+ }
+
+ /* Get information about the bitmap that was allocated */
+ GetObject (hbmpNew, sizeof (dibsection), &dibsection);
+
+ /* Print information about bitmap allocated */
+ winDebug ("winMWExtWMStartDrawing - Dibsection width: %d height: %d "
+ "depth: %d size image: %d\n",
+ (unsigned int)dibsection.dsBmih.biWidth,
+ (unsigned int)dibsection.dsBmih.biHeight,
+ (unsigned int)dibsection.dsBmih.biBitCount,
+ (unsigned int)dibsection.dsBmih.biSizeImage);
+
+ /* Select the shadow bitmap into the shadow DC */
+ SelectObject (hdcNew, hbmpNew);
+
+ winDebug ("winMWExtWMStartDrawing - Attempting a shadow blit\n");
+
+ /* Blit from the old shadow to the new shadow */
+ fReturn = BitBlt (hdcNew,
+ 0, 0,
+ pRLWinPriv->pFrame->width, pRLWinPriv->pFrame->height,
+ pRLWinPriv->hdcShadow,
+ 0, 0,
+ SRCCOPY);
+ if (fReturn)
+ {
+ winDebug ("winMWExtWMStartDrawing - Shadow blit success\n");
+ }
+ else
+ {
+ ErrorF ("winMWExtWMStartDrawing - Shadow blit failure\n");
+ }
+
+ /* Look for height weirdness */
+ if (dibsection.dsBmih.biHeight < 0)
+ {
+ /* FIXME: Figure out why biHeight is sometimes negative */
+ ErrorF ("winMWExtWMStartDrawing - WEIRDNESS - "
+ "biHeight still negative: %d\n",
+ (int) dibsection.dsBmih.biHeight);
+ ErrorF ("winMWExtWMStartDrawing - WEIRDNESS - "
+ "Flipping biHeight sign\n");
+ dibsection.dsBmih.biHeight = -dibsection.dsBmih.biHeight;
+ }
+
+ pRLWinPriv->dwWidthBytes = dibsection.dsBm.bmWidthBytes;
+
+ winDebug ("winMWExtWMStartDrawing - bytesPerRow: %d\n",
+ (unsigned int)dibsection.dsBm.bmWidthBytes);
+
+ /* Free the old shadow bitmap */
+ DeleteObject (pRLWinPriv->hdcShadow);
+ DeleteObject (pRLWinPriv->hbmpShadow);
+
+ pRLWinPriv->hdcShadow = hdcNew;
+ pRLWinPriv->hbmpShadow = hbmpNew;
+
+ pRLWinPriv->fResized = FALSE;
+ winDebug ("winMWExtWMStartDrawing - 0x%08x %d\n",
+ (unsigned int)pRLWinPriv->pfb,
+ (unsigned int)dibsection.dsBm.bmWidthBytes);
+ }
+ }
+ else
+ {
+ ErrorF ("winMWExtWMStartDrawing - Already window was destroyed \n");
+ }
+ winDebug ("winMWExtWMStartDrawing - done (0x%08x) 0x%08x %d\n",
+ (int) pRLWinPriv,
+ (unsigned int)pRLWinPriv->pfb, (unsigned int)pRLWinPriv->dwWidthBytes);
+ *pixelData = pRLWinPriv->pfb;
+ *bytesPerRow = pRLWinPriv->dwWidthBytes;
+}
+
+void
+winMWExtWMStopDrawing (RootlessFrameID wid, Bool fFlush)
+{
+}
+
+void
+winMWExtWMUpdateRegion (RootlessFrameID wid, RegionPtr pDamage)
+{
+ win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) wid;
+ if (!g_fNoConfigureWindow) UpdateWindow (pRLWinPriv->hWnd);
+}
+
+void
+winMWExtWMDamageRects (RootlessFrameID wid, int nCount, const BoxRec *pRects,
+ int shift_x, int shift_y)
+{
+ win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) wid;
+ const BoxRec *pEnd;
+ winDebug ("winMWExtWMDamageRects (%08x, %d, %08x, %d, %d)\n",
+ pRLWinPriv, nCount, pRects, shift_x, shift_y);
+
+ for (pEnd = pRects + nCount; pRects < pEnd; pRects++) {
+ RECT rcDmg;
+ rcDmg.left = pRects->x1 + shift_x;
+ rcDmg.top = pRects->y1 + shift_y;
+ rcDmg.right = pRects->x2 + shift_x;
+ rcDmg.bottom = pRects->y2 + shift_y;
+
+ InvalidateRect (pRLWinPriv->hWnd, &rcDmg, FALSE);
+ }
+}
+
+void
+winMWExtWMRootlessSwitchWindow (RootlessWindowPtr pFrame, WindowPtr oldWin)
+{
+ win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) pFrame->wid;
+ winDebug ("winMWExtWMRootlessSwitchWindow (%08x) %08x\n",
+ (int) pRLWinPriv, (int) pRLWinPriv->hWnd);
+ pRLWinPriv->pFrame = pFrame;
+ pRLWinPriv->fResized = TRUE;
+
+ /* Set the window extended style flags */
+ SetWindowLongPtr (pRLWinPriv->hWnd, GWL_EXSTYLE, WS_EX_TOOLWINDOW);
+
+ /* Set the window standard style flags */
+ SetWindowLongPtr (pRLWinPriv->hWnd, GWL_STYLE,
+ WS_POPUP | WS_CLIPCHILDREN);
+
+ DeleteProperty (serverClient, oldWin, AtmWindowsWmNativeHwnd ());
+ winMWExtWMSetNativeProperty (pFrame);
+}
+
+void
+winMWExtWMCopyBytes (unsigned int width, unsigned int height,
+ const void *src, unsigned int srcRowBytes,
+ void *dst, unsigned int dstRowBytes)
+{
+ winDebug ("winMWExtWMCopyBytes - Not implemented\n");
+}
+
+void
+winMWExtWMCopyWindow (RootlessFrameID wid, int nDstRects, const BoxRec *pDstRects,
+ int nDx, int nDy)
+{
+ win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) wid;
+ const BoxRec *pEnd;
+ RECT rcDmg;
+ winDebug ("winMWExtWMCopyWindow (%08x, %d, %08x, %d, %d)\n",
+ (int) pRLWinPriv, nDstRects, (int) pDstRects, nDx, nDy);
+
+ for (pEnd = pDstRects + nDstRects; pDstRects < pEnd; pDstRects++)
+ {
+ winDebug ("BitBlt (%d, %d, %d, %d) (%d, %d)\n",
+ pDstRects->x1, pDstRects->y1,
+ pDstRects->x2 - pDstRects->x1,
+ pDstRects->y2 - pDstRects->y1,
+ pDstRects->x1 + nDx,
+ pDstRects->y1 + nDy);
+
+ if (!BitBlt (pRLWinPriv->hdcShadow,
+ pDstRects->x1, pDstRects->y1,
+ pDstRects->x2 - pDstRects->x1,
+ pDstRects->y2 - pDstRects->y1,
+ pRLWinPriv->hdcShadow,
+ pDstRects->x1 + nDx, pDstRects->y1 + nDy,
+ SRCCOPY))
+ {
+ ErrorF ("winMWExtWMCopyWindow - BitBlt failed.\n");
+ }
+
+ rcDmg.left = pDstRects->x1;
+ rcDmg.top = pDstRects->y1;
+ rcDmg.right = pDstRects->x2;
+ rcDmg.bottom = pDstRects->y2;
+
+ InvalidateRect (pRLWinPriv->hWnd, &rcDmg, FALSE);
+ }
+ winDebug ("winMWExtWMCopyWindow - done\n");
+}
+
+
+/*
+ * winMWExtWMSetNativeProperty
+ */
+
+static void
+winMWExtWMSetNativeProperty (RootlessWindowPtr pFrame)
+{
+ win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) pFrame->wid;
+ long lData;
+
+ /* FIXME: move this to WindowsWM extension */
+
+ lData = (long) pRLWinPriv->hWnd;
+ dixChangeWindowProperty(serverClient, pFrame->win, AtmWindowsWmNativeHwnd(),
+ XA_INTEGER, 32, PropModeReplace, 1, &lData, TRUE);
+}
diff --git a/xorg-server/hw/xwin/winwin32rootlesswindow.c b/xorg-server/hw/xwin/winwin32rootlesswindow.c index 60e1f8bea..bfb35e70f 100644 --- a/xorg-server/hw/xwin/winwin32rootlesswindow.c +++ b/xorg-server/hw/xwin/winwin32rootlesswindow.c @@ -230,23 +230,18 @@ winMWExtWMUpdateWindowDecoration (win32RootlessWindowPtr pRLWinPriv, /* Get current window placement */
GetWindowPlacement (pRLWinPriv->hWnd, &wndPlace);
+#ifdef XWIN_MULTIWINDOWINTWM
if (winIsInternalWMRunning(pScreenInfo))
{
if (!pRLWinPriv->pFrame->win->overrideRedirect)
fDecorate = TRUE;
}
-#if 0
- if (wndPlace.showCmd == SW_HIDE)
- return;//showCmd = SWP_HIDEWINDOW;
- else
- showCmd = SWP_SHOWWINDOW;
-#else
+#endif
if (wndPlace.showCmd == SW_HIDE)
return;
if (IsWindowVisible (pRLWinPriv->hWnd))
showCmd = SWP_SHOWWINDOW;
-#endif
showCmd |= SWP_NOMOVE | SWP_FRAMECHANGED | SWP_NOACTIVATE | SWP_NOZORDER;
@@ -388,7 +383,7 @@ winMWExtWMUpdateWindowDecoration (win32RootlessWindowPtr pRLWinPriv, }
}
-
+#ifdef XWIN_MULTIWINDOWINTWM
/*
* winIsInternalWMRunning (winScreenInfoPtr pScreenInfo)
*/
@@ -397,7 +392,7 @@ winIsInternalWMRunning (winScreenInfoPtr pScreenInfo) {
return pScreenInfo->fInternalWM && !pScreenInfo->fAnotherWMRunning;
}
-
+#endif
/*
* winMWExtWMRestackWindows
diff --git a/xorg-server/hw/xwin/winwin32rootlesswndproc.c b/xorg-server/hw/xwin/winwin32rootlesswndproc.c index 47a1abe73..c8a6e66c3 100644 --- a/xorg-server/hw/xwin/winwin32rootlesswndproc.c +++ b/xorg-server/hw/xwin/winwin32rootlesswndproc.c @@ -433,7 +433,6 @@ winMWExtWMWindowProc (HWND hwnd, UINT message, wmMsg.iHeight = pRLWinPriv->pFrame->height;
fWMMsgInitialized = TRUE;
-#if CYGDEBUG
winDebugWin32Message("winMWExtWMWindowProc", hwnd, message, wParam, lParam);
winDebug ("\thWnd %08X\n", hwnd);
@@ -442,7 +441,6 @@ winMWExtWMWindowProc (HWND hwnd, UINT message, winDebug ("\thwndScreen %08X\n", hwndScreen);
winDebug ("winMWExtWMWindowProc (%08x) %08x %08x %08x\n",
pRLWinPriv, message, wParam, lParam);
-#endif
}
/* Branch on message type */
switch (message)
@@ -458,9 +456,8 @@ winMWExtWMWindowProc (HWND hwnd, UINT message, return 0;
case WM_CLOSE:
-#if CYGMULTIWINDOW_DEBUG
winDebug ("winMWExtWMWindowProc - WM_CLOSE %d\n", pRLWinPriv->fClose);
-#endif
+
/* Tell window-manager to close window */
if (pRLWinPriv->fClose)
{
@@ -468,6 +465,7 @@ winMWExtWMWindowProc (HWND hwnd, UINT message, }
else
{
+#ifdef XWIN_MULTIWINDOWINTWM
if (winIsInternalWMRunning(pScreenInfo))
{
/* Tell our Window Manager thread to kill the window */
@@ -475,6 +473,7 @@ winMWExtWMWindowProc (HWND hwnd, UINT message, if (fWMMsgInitialized)
winSendMessageToWM (pScreenPriv->pWMInfo, &wmMsg);
}
+#endif
winWindowsWMSendEvent(WindowsWMControllerNotify,
WindowsWMControllerNotifyMask,
1,
@@ -694,23 +693,24 @@ winMWExtWMWindowProc (HWND hwnd, UINT message, return 0;
case WM_MOUSEACTIVATE:
-#if CYGMULTIWINDOW_DEBUG
winDebug ("winMWExtWMWindowProc - WM_MOUSEACTIVATE\n");
-#endif
-#if 1
+
+#ifdef XWIN_MULTIWINDOWINTWM
/* Check if this window needs to be made active when clicked */
if (winIsInternalWMRunning(pScreenInfo) && pWin->overrideRedirect)
{
-#if CYGMULTIWINDOW_DEBUG
winDebug ("winMWExtWMWindowProc - WM_MOUSEACTIVATE - "
"MA_NOACTIVATE\n");
-#endif
/* */
return MA_NOACTIVATE;
}
#endif
- if (!winIsInternalWMRunning(pScreenInfo) && !IsMouseActive (pWin))
+ if (
+#ifdef XWIN_MULTIWINDOWINTWM
+ !winIsInternalWMRunning(pScreenInfo) &&
+#endif
+ !IsMouseActive (pWin))
return MA_NOACTIVATE;
break;
@@ -776,9 +776,7 @@ winMWExtWMWindowProc (HWND hwnd, UINT message, return 0;
case WM_ERASEBKGND:
-#if CYGDEBUG
winDebug ("winMWExtWMWindowProc - WM_ERASEBKGND\n");
-#endif
/*
* Pretend that we did erase the background but we don't care,
* since we repaint the entire region anyhow
@@ -822,11 +820,10 @@ winMWExtWMWindowProc (HWND hwnd, UINT message, break;
case WM_ACTIVATE:
-#if CYGMULTIWINDOW_DEBUG
winDebug ("winMWExtWMWindowProc - WM_ACTIVATE\n");
-#endif
if (LOWORD(wParam) != WA_INACTIVE)
{
+#ifdef XWIN_MULTIWINDOWINTWM
if (winIsInternalWMRunning(pScreenInfo))
{
#if 0
@@ -841,6 +838,7 @@ winMWExtWMWindowProc (HWND hwnd, UINT message, if (!pWin || !pWin->overrideRedirect) /* for OOo menus */
winSendMessageToWM (pScreenPriv->pWMInfo, &wmMsg);
}
+#endif
winWindowsWMSendEvent(WindowsWMControllerNotify,
WindowsWMControllerNotifyMask,
1,
@@ -858,24 +856,23 @@ winMWExtWMWindowProc (HWND hwnd, UINT message, {
if (pRLWinPriv->fRestackingNow || pScreenPriv->fRestacking)
{
-#if CYGMULTIWINDOW_DEBUG
winDebug ("Win %08x is now restacking.\n", (unsigned int)pRLWinPriv);
-#endif
break;
}
- if (winIsInternalWMRunning(pScreenInfo) || IsRaiseOnClick (pWin))
+ if (
+#ifdef XWIN_MULTIWINDOWINTWM
+ winIsInternalWMRunning(pScreenInfo) ||
+#endif
+ IsRaiseOnClick (pWin))
{
-#if CYGMULTIWINDOW_DEBUG
winDebug ("Win %08x has WINDOWSWM_RAISE_ON_CLICK.\n", (unsigned int)pRLWinPriv);
-#endif
break;
}
-#if CYGMULTIWINDOW_DEBUG
winDebug ("Win %08x forbid to change z order (%08x).\n",
(unsigned int)pRLWinPriv, (unsigned int)pWinPos->hwndInsertAfter);
-#endif
+
pWinPos->flags |= SWP_NOZORDER;
}
break;
@@ -908,14 +905,14 @@ winMWExtWMWindowProc (HWND hwnd, UINT message, }
#endif
-#if CYGMULTIWINDOW_DEBUG
winDebug ("\t(%d, %d)\n", (short) LOWORD(lParam), (short) HIWORD(lParam));
-#endif
+
if (!pRLWinPriv->fMovingOrSizing)
{
+#ifdef XWIN_MULTIWINDOWINTWM
if (winIsInternalWMRunning(pScreenInfo))
winAdjustXWindow (pWin, hwnd);
-
+#endif
winMWExtWMMoveXWindow (pWin,
(LOWORD(lParam) - wBorderWidth (pWin)
- GetSystemMetrics (SM_XVIRTUALSCREEN)),
@@ -925,14 +922,14 @@ winMWExtWMWindowProc (HWND hwnd, UINT message, return 0;
case WM_SHOWWINDOW:
-#if CYGMULTIWINDOW_DEBUG || TRUE
winDebug ("winMWExtWMWindowProc - WM_SHOWWINDOW - %d ms\n",
(unsigned int)GetTickCount ());
-#endif
+
/* Bail out if the window is being hidden */
if (!wParam)
return 0;
+#ifdef XWIN_MULTIWINDOWINTWM
if (!pScreenInfo->fInternalWM)//XXXX
return 0;
@@ -940,9 +937,8 @@ winMWExtWMWindowProc (HWND hwnd, UINT message, if (winIsInternalWMRunning(pScreenInfo))
{
-#if CYGMULTIWINDOW_DEBUG || TRUE
winDebug ("\tMapWindow\n");
-#endif
+
/* Tell X to map the window */
MapWindow (pWin, wClient(pWin));
@@ -959,6 +955,9 @@ winMWExtWMWindowProc (HWND hwnd, UINT message, if (fWMMsgInitialized)
winSendMessageToWM (pScreenPriv->pWMInfo, &wmMsg);
}
+#else
+ return 0;
+#endif
break;
case WM_SIZING:
@@ -969,7 +968,7 @@ winMWExtWMWindowProc (HWND hwnd, UINT message, case WM_WINDOWPOSCHANGED:
{
pWinPos = (LPWINDOWPOS) lParam;
-#if CYGMULTIWINDOW_DEBUG
+#ifdef _DEBUG
winDebug("winMWExtWMWindowProc - WM_WINDOWPOSCHANGED\n");
winDebug("\tflags: %s%s%s%s%s%s%s%s%s%s%s%s\n",
(pWinPos->flags & SWP_DRAWFRAME)?"SWP_DRAWFRAME ":"",
@@ -991,22 +990,21 @@ winMWExtWMWindowProc (HWND hwnd, UINT message, #endif
if (pWinPos->flags & SWP_HIDEWINDOW) break;
+#ifdef XWIN_MULTIWINDOWINTWM
/* Reorder if window z order was changed */
if ((pScreenPriv != NULL)
&& !(pWinPos->flags & SWP_NOZORDER)
&& !(pWinPos->flags & SWP_SHOWWINDOW)
&& winIsInternalWMRunning(pScreenInfo))
{
-#if CYGMULTIWINDOW_DEBUG
winDebug ("\twindow z order was changed\n");
-#endif
+
if (pWinPos->hwndInsertAfter == HWND_TOP
||pWinPos->hwndInsertAfter == HWND_TOPMOST
||pWinPos->hwndInsertAfter == HWND_NOTOPMOST)
{
-#if CYGMULTIWINDOW_DEBUG
winDebug ("\traise to top\n");
-#endif
+
/* Raise the window to the top in Z order */
wmMsg.msg = WM_WM_RAISE;
if (fWMMsgInitialized)
@@ -1040,9 +1038,8 @@ winMWExtWMWindowProc (HWND hwnd, UINT message, raise it in X stack. */
if (hWndAbove == NULL)
{
-#if CYGMULTIWINDOW_DEBUG
winDebug ("\traise to top\n");
-#endif
+
/* Raise the window to the top in Z order */
wmMsg.msg = WM_WM_RAISE;
if (fWMMsgInitialized)
@@ -1051,12 +1048,12 @@ winMWExtWMWindowProc (HWND hwnd, UINT message, }
#endif
}
+#endif
if (!(pWinPos->flags & SWP_NOSIZE)) {
if (IsIconic(hwnd)){
-#if CYGMULTIWINDOW_DEBUG
winDebug ("\tIconic -> MINIMIZED\n");
-#endif
+#ifdef XWIN_MULTIWINDOWINTWM
if (winIsInternalWMRunning(pScreenInfo))
{
/* Raise the window to the top in Z order */
@@ -1064,6 +1061,7 @@ winMWExtWMWindowProc (HWND hwnd, UINT message, if (fWMMsgInitialized)
winSendMessageToWM (pScreenPriv->pWMInfo, &wmMsg);
}
+#endif
winWindowsWMSendEvent(WindowsWMControllerNotify,
WindowsWMControllerNotifyMask,
1,
@@ -1071,9 +1069,8 @@ winMWExtWMWindowProc (HWND hwnd, UINT message, pWin->drawable.id,
0, 0, 0, 0);
} else if (IsZoomed(hwnd)){
-#if CYGMULTIWINDOW_DEBUG
winDebug ("\tZoomed -> MAXIMIZED\n");
-#endif
+
winWindowsWMSendEvent(WindowsWMControllerNotify,
WindowsWMControllerNotifyMask,
1,
@@ -1081,9 +1078,8 @@ winMWExtWMWindowProc (HWND hwnd, UINT message, pWin->drawable.id,
0, 0, 0, 0);
} else {
-#if CYGMULTIWINDOW_DEBUG
winDebug ("\tnone -> RESTORED\n");
-#endif
+
winWindowsWMSendEvent(WindowsWMControllerNotify,
WindowsWMControllerNotifyMask,
1,
@@ -1101,12 +1097,12 @@ winMWExtWMWindowProc (HWND hwnd, UINT message, if (!(pWinPos->flags & SWP_NOMOVE)
&&!(pWinPos->flags & SWP_NOSIZE)) {
-#if CYGMULTIWINDOW_DEBUG
winDebug ("\tmove & resize\n");
-#endif
+
+#ifdef XWIN_MULTIWINDOWINTWM
if (winIsInternalWMRunning(pScreenInfo))
winAdjustXWindow (pWin, hwnd);
-
+#endif
winMWExtWMMoveResizeXWindow (pWin,
rcClient.left - wBorderWidth (pWin)
- GetSystemMetrics (SM_XVIRTUALSCREEN),
@@ -1117,12 +1113,11 @@ winMWExtWMWindowProc (HWND hwnd, UINT message, rcClient.bottom - rcClient.top
- wBorderWidth (pWin)*2);
} else if (!(pWinPos->flags & SWP_NOMOVE)) {
-#if CYGMULTIWINDOW_DEBUG
winDebug ("\tmove\n");
-#endif
+#ifdef XWIN_MULTIWINDOWINTWM
if (winIsInternalWMRunning(pScreenInfo))
winAdjustXWindow (pWin, hwnd);
-
+#endif
winMWExtWMMoveResizeXWindow (pWin,
rcClient.left - wBorderWidth (pWin)
- GetSystemMetrics (SM_XVIRTUALSCREEN),
@@ -1133,24 +1128,23 @@ winMWExtWMWindowProc (HWND hwnd, UINT message, rcClient.bottom - rcClient.top
- wBorderWidth (pWin)*2);
} else if (!(pWinPos->flags & SWP_NOMOVE)) {
-#if CYGMULTIWINDOW_DEBUG
winDebug ("\tmove\n");
-#endif
+
+#ifdef XWIN_MULTIWINDOWINTWM
if (winIsInternalWMRunning(pScreenInfo))
winAdjustXWindow (pWin, hwnd);
-
+#endif
winMWExtWMMoveXWindow (pWin,
rcClient.left - wBorderWidth (pWin)
- GetSystemMetrics (SM_XVIRTUALSCREEN),
rcClient.top - wBorderWidth (pWin)
- GetSystemMetrics (SM_YVIRTUALSCREEN));
} else if (!(pWinPos->flags & SWP_NOSIZE)) {
-#if CYGMULTIWINDOW_DEBUG
winDebug ("\tresize\n");
-#endif
+#ifdef XWIN_MULTIWINDOWINTWM
if (winIsInternalWMRunning(pScreenInfo))
winAdjustXWindow (pWin, hwnd);
-
+#endif
winMWExtWMResizeXWindow (pWin,
rcClient.right - rcClient.left
- wBorderWidth (pWin)*2,
@@ -1160,30 +1154,27 @@ winMWExtWMWindowProc (HWND hwnd, UINT message, }
}
}
-#if CYGMULTIWINDOW_DEBUG
winDebug ("winMWExtWMWindowProc - WM_WINDOWPOSCHANGED - done.\n");
-#endif
+
return 0;
case WM_SIZE:
/* see dix/window.c */
/* FIXME: Maximize/Restore? */
-#if CYGMULTIWINDOW_DEBUG
winDebug ("winMWExtWMWindowProc - WM_SIZE - %d ms\n",
(unsigned int)GetTickCount ());
-#endif
-#if CYGMULTIWINDOW_DEBUG
+
winDebug ("\t(%d, %d) %d\n", (short) LOWORD(lParam), (short) HIWORD(lParam), g_fNoConfigureWindow);
-#endif
+
if (g_fNoConfigureWindow) break;
/* Branch on type of resizing occurring */
switch (wParam)
{
case SIZE_MINIMIZED:
-#if CYGMULTIWINDOW_DEBUG
winDebug ("\tSIZE_MINIMIZED\n");
-#endif
+
+#ifdef XWIN_MULTIWINDOWINTWM
if (winIsInternalWMRunning(pScreenInfo))
{
/* Raise the window to the top in Z order */
@@ -1191,6 +1182,7 @@ winMWExtWMWindowProc (HWND hwnd, UINT message, if (fWMMsgInitialized)
winSendMessageToWM (pScreenPriv->pWMInfo, &wmMsg);
}
+#endif
winWindowsWMSendEvent(WindowsWMControllerNotify,
WindowsWMControllerNotifyMask,
1,
@@ -1201,9 +1193,8 @@ winMWExtWMWindowProc (HWND hwnd, UINT message, break;
case SIZE_RESTORED:
-#if CYGMULTIWINDOW_DEBUG
winDebug ("\tSIZE_RESTORED\n");
-#endif
+
winWindowsWMSendEvent(WindowsWMControllerNotify,
WindowsWMControllerNotifyMask,
1,
@@ -1230,9 +1221,10 @@ winMWExtWMWindowProc (HWND hwnd, UINT message, /* Perform the resize and notify the X client */
if (!pRLWinPriv->fMovingOrSizing)
{
+#ifdef XWIN_MULTIWINDOWINTWM
if (winIsInternalWMRunning(pScreenInfo))
winAdjustXWindow (pWin, hwnd);
-
+#endif
winMWExtWMResizeXWindow (pWin,
(short) LOWORD(lParam)
- wBorderWidth (pWin)*2,
@@ -1248,12 +1240,14 @@ winMWExtWMWindowProc (HWND hwnd, UINT message, #endif
if (wParam)
{
+#ifdef XWIN_MULTIWINDOWINTWM
if (winIsInternalWMRunning(pScreenInfo))
{
}
else
{
}
+#endif
winWindowsWMSendEvent(WindowsWMActivationNotify,
WindowsWMActivationNotifyMask,
1,
@@ -1283,26 +1277,26 @@ winMWExtWMWindowProc (HWND hwnd, UINT message, break;
case WM_ENTERSIZEMOVE:
-#if CYGMULTIWINDOW_DEBUG
winDebug ("winMWExtWMWindowProc - WM_ENTERSIZEMOVE - %d ms\n",
(unsigned int)GetTickCount ());
-#endif
+
pRLWinPriv->fMovingOrSizing = TRUE;
break;
case WM_EXITSIZEMOVE:
-#if CYGMULTIWINDOW_DEBUG
winDebug ("winMWExtWMWindowProc - WM_EXITSIZEMOVE - %d ms\n",
(unsigned int)GetTickCount ());
-#endif
+
pRLWinPriv->fMovingOrSizing = FALSE;
GetClientRect (hwnd, &rcClient);
MapWindowPoints (hwnd, HWND_DESKTOP, (LPPOINT)&rcClient, 2);
+#ifdef XWIN_MULTIWINDOWINTWM
if (winIsInternalWMRunning(pScreenInfo))
winAdjustXWindow (pWin, hwnd);
+#endif
winMWExtWMMoveResizeXWindow (pWin,
rcClient.left - wBorderWidth (pWin)
@@ -1316,11 +1310,11 @@ winMWExtWMWindowProc (HWND hwnd, UINT message, break;
case WM_MANAGE:
- ErrorF ("winMWExtWMWindowProc - WM_MANAGE\n");
+ winDebug ("winMWExtWMWindowProc - WM_MANAGE\n");
break;
case WM_UNMANAGE:
- ErrorF ("winMWExtWMWindowProc - WM_UNMANAGE\n");
+ winDebug ("winMWExtWMWindowProc - WM_UNMANAGE\n");
break;
default:
diff --git a/xorg-server/hw/xwin/winwindow.c b/xorg-server/hw/xwin/winwindow.c index 7975d71a9..b83ea9485 100644 --- a/xorg-server/hw/xwin/winwindow.c +++ b/xorg-server/hw/xwin/winwindow.c @@ -63,9 +63,7 @@ winCreateWindowNativeGDI (WindowPtr pWin) winWindowPriv(pWin); winScreenPriv(pScreen); -#if CYGDEBUG - winTrace ("winCreateWindowNativeGDI (%p)\n", pWin); -#endif + winDebug ("winCreateWindowNativeGDI (%p)\n", pWin); WIN_UNWRAP(CreateWindow); fResult = (*pScreen->CreateWindow) (pWin); @@ -86,9 +84,7 @@ winDestroyWindowNativeGDI (WindowPtr pWin) winWindowPriv(pWin); winScreenPriv(pScreen); -#if CYGDEBUG - winTrace ("winDestroyWindowNativeGDI (%p)\n", pWin); -#endif + winDebug ("winDestroyWindowNativeGDI (%p)\n", pWin); WIN_UNWRAP(DestroyWindow); fResult = (*pScreen->DestroyWindow)(pWin); @@ -109,9 +105,7 @@ winPositionWindowNativeGDI (WindowPtr pWin, int x, int y) winWindowPriv(pWin); winScreenPriv(pScreen); -#if CYGDEBUG - winTrace ("winPositionWindowNativeGDI (%p)\n", pWin); -#endif + winDebug ("winPositionWindowNativeGDI (%p)\n", pWin); WIN_UNWRAP(PositionWindow); fResult = (*pScreen->PositionWindow)(pWin, x, y); @@ -140,10 +134,6 @@ winCopyWindowNativeGDI (WindowPtr pWin, ScreenPtr pScreen = pWin->drawable.pScreen; winScreenPriv(pScreen); -#if 0 - ErrorF ("winCopyWindow\n"); -#endif - /* Get a pointer to the root window */ pwinRoot = pWin->drawable.pScreen->root; @@ -183,19 +173,9 @@ winCopyWindowNativeGDI (WindowPtr pWin, pBoxDst = RegionRects(prgnDst); ppt = pptSrc; -#if 0 - ErrorF ("winCopyWindow - x1\tx2\ty1\ty2\tx\ty\n"); -#endif - /* BitBlt each source to the destination point */ for (i = nbox; --i >= 0; pBoxDst++, ppt++) { -#if 0 - ErrorF ("winCopyWindow - %d\t%d\t%d\t%d\t%d\t%d\n", - pBoxDst->x1, pBoxDst->x2, pBoxDst->y1, pBoxDst->y2, - ppt->x, ppt->y); -#endif - BitBlt (pScreenPriv->hdcScreen, pBoxDst->x1, pBoxDst->y1, pBoxDst->x2 - pBoxDst->x1, pBoxDst->y2 - pBoxDst->y1, @@ -221,9 +201,7 @@ winChangeWindowAttributesNativeGDI (WindowPtr pWin, unsigned long mask) winWindowPriv(pWin); winScreenPriv(pScreen); -#if CYGDEBUG - winTrace ("winChangeWindowAttributesNativeGDI (%p)\n", pWin); -#endif + winDebug ("winChangeWindowAttributesNativeGDI (%p)\n", pWin); WIN_UNWRAP(ChangeWindowAttributes); fResult = (*pScreen->ChangeWindowAttributes)(pWin, mask); @@ -249,9 +227,7 @@ winUnmapWindowNativeGDI (WindowPtr pWin) winWindowPriv(pWin); winScreenPriv(pScreen); -#if CYGDEBUG - winTrace ("winUnmapWindowNativeGDI (%p)\n", pWin); -#endif + winDebug ("winUnmapWindowNativeGDI (%p)\n", pWin); WIN_UNWRAP(UnrealizeWindow); fResult = (*pScreen->UnrealizeWindow)(pWin); @@ -273,9 +249,7 @@ winMapWindowNativeGDI (WindowPtr pWin) winWindowPriv(pWin); winScreenPriv(pScreen); -#if CYGDEBUG - winTrace ("winMapWindowNativeGDI (%p)\n", pWin); -#endif + winDebug ("winMapWindowNativeGDI (%p)\n", pWin); WIN_UNWRAP(RealizeWindow); fResult = (*pScreen->RealizeWindow)(pWin); @@ -298,9 +272,7 @@ winCreateWindowRootless (WindowPtr pWin) winWindowPriv(pWin); winScreenPriv(pScreen); -#if CYGDEBUG - winTrace ("winCreateWindowRootless (%p)\n", pWin); -#endif + winDebug ("winCreateWindowRootless (%p)\n", pWin); WIN_UNWRAP(CreateWindow); fResult = (*pScreen->CreateWindow) (pWin); @@ -323,9 +295,7 @@ winDestroyWindowRootless (WindowPtr pWin) winWindowPriv(pWin); winScreenPriv(pScreen); -#if CYGDEBUG - winTrace ("winDestroyWindowRootless (%p)\n", pWin); -#endif + winDebug ("winDestroyWindowRootless (%p)\n", pWin); WIN_UNWRAP(DestroyWindow); fResult = (*pScreen->DestroyWindow)(pWin); @@ -353,10 +323,7 @@ winPositionWindowRootless (WindowPtr pWin, int x, int y) ScreenPtr pScreen = pWin->drawable.pScreen; winScreenPriv(pScreen); - -#if CYGDEBUG - winTrace ("winPositionWindowRootless (%p)\n", pWin); -#endif + winDebug ("winPositionWindowRootless (%p)\n", pWin); WIN_UNWRAP(PositionWindow); fResult = (*pScreen->PositionWindow)(pWin, x, y); @@ -378,9 +345,7 @@ winChangeWindowAttributesRootless (WindowPtr pWin, unsigned long mask) ScreenPtr pScreen = pWin->drawable.pScreen; winScreenPriv(pScreen); -#if CYGDEBUG - winTrace ("winChangeWindowAttributesRootless (%p)\n", pWin); -#endif + winDebug ("winChangeWindowAttributesRootless (%p)\n", pWin); WIN_UNWRAP(ChangeWindowAttributes); fResult = (*pScreen->ChangeWindowAttributes)(pWin, mask); @@ -404,9 +369,7 @@ winUnmapWindowRootless (WindowPtr pWin) winWindowPriv(pWin); winScreenPriv(pScreen); -#if CYGDEBUG - winTrace ("winUnmapWindowRootless (%p)\n", pWin); -#endif + winDebug ("winUnmapWindowRootless (%p)\n", pWin); WIN_UNWRAP(UnrealizeWindow); fResult = (*pScreen->UnrealizeWindow)(pWin); @@ -435,9 +398,7 @@ winMapWindowRootless (WindowPtr pWin) ScreenPtr pScreen = pWin->drawable.pScreen; winScreenPriv(pScreen); -#if CYGDEBUG - winTrace ("winMapWindowRootless (%p)\n", pWin); -#endif + winDebug ("winMapWindowRootless (%p)\n", pWin); WIN_UNWRAP(RealizeWindow); fResult = (*pScreen->RealizeWindow)(pWin); @@ -457,9 +418,7 @@ winSetShapeRootless (WindowPtr pWin, int kind) ScreenPtr pScreen = pWin->drawable.pScreen; winScreenPriv(pScreen); -#if CYGDEBUG - winTrace ("winSetShapeRootless (%p, %i)\n", pWin, kind); -#endif + winDebug ("winSetShapeRootless (%p, %i)\n", pWin, kind); WIN_UNWRAP(SetShape); (*pScreen->SetShape)(pWin, kind); @@ -488,9 +447,7 @@ winAddRgn (WindowPtr pWin, pointer data) /* If pWin is not Root */ if (pWin->parent != NULL) { -#if CYGDEBUG winDebug ("winAddRgn ()\n"); -#endif if (pWin->mapped) { iBorder = wBorderWidth (pWin); @@ -505,8 +462,8 @@ winAddRgn (WindowPtr pWin, pointer data) if (hRgnWin == NULL) { - ErrorF ("winAddRgn - CreateRectRgn () failed\n"); - ErrorF (" Rect %d %d %d %d\n", + winDebug ("winAddRgn - CreateRectRgn () failed\n"); + winDebug (" Rect %d %d %d %d\n", iX, iY, iX + iWidth, iY + iHeight); } @@ -570,9 +527,7 @@ winReshapeRootless (WindowPtr pWin) HRGN hRgn, hRgnRect; winWindowPriv(pWin); -#if CYGDEBUG winDebug ("winReshapeRootless ()\n"); -#endif /* Bail if the window is the root window */ if (pWin->parent == NULL) diff --git a/xorg-server/hw/xwin/winwindow.h b/xorg-server/hw/xwin/winwindow.h index cf2f93f0a..8778fc696 100644 --- a/xorg-server/hw/xwin/winwindow.h +++ b/xorg-server/hw/xwin/winwindow.h @@ -41,29 +41,23 @@ /* Constant strings */ #ifndef PROJECT_NAME -# define PROJECT_NAME "Cygwin/X" +# define PROJECT_NAME "VcXsrv" #endif -#define EXECUTABLE_NAME "XWin" -#define WINDOW_CLASS "cygwin/x" -#define WINDOW_TITLE PROJECT_NAME ":%s.%d" -#define WINDOW_TITLE_XDMCP "%s:%s.%d" -#define WIN_SCR_PROP "cyg_screen_prop rl" -#define WINDOW_CLASS_X "cygwin/x X rl" +#define EXECUTABLE_NAME "VcXsrv" +#define WINDOW_CLASS "VcXsrv/x" +#define WINDOW_TITLE PROJECT_NAME " Server - Display %s:%s.%d" +#define WINDOW_TITLE_XDMCP PROJECT_NAME " Server - %s - Display %s:%s.%d" +#define WIN_SCR_PROP "vcxsrv_screen_prop rl" +#define WINDOW_CLASS_X "vcxsrv/x X rl" #define WINDOW_TITLE_X PROJECT_NAME " X" -#define WIN_WINDOW_PROP "cyg_window_prop_rl" +#define WIN_WINDOW_PROP "vcxsrv_window_prop_rl" #ifdef HAS_DEVWINDOWS # define WIN_MSG_QUEUE_FNAME "/dev/windows" #endif -#define WIN_WID_PROP "cyg_wid_prop_rl" -#define WIN_NEEDMANAGE_PROP "cyg_override_redirect_prop_rl" -#ifndef CYGMULTIWINDOW_DEBUG -#define CYGMULTIWINDOW_DEBUG NO -#endif -#ifndef CYGWINDOWING_DEBUG -#define CYGWINDOWING_DEBUG NO -#endif +#define WIN_WID_PROP "vcxsrv_wid_prop_rl" +#define WIN_NEEDMANAGE_PROP "vcxsrv_override_redirect_prop_rl" -#define XMING_SIGNATURE 0x12345678L +#define VCXSRV_SIGNATURE 0xdeaddeadL typedef struct _winPrivScreenRec *winPrivScreenPtr; @@ -77,6 +71,8 @@ typedef struct DWORD dwDummy; HRGN hRgn; HWND hWnd; + BOOL GlCtxWnd; + BOOL OpenGlWindow; winPrivScreenPtr pScreenPriv; Bool fXKilled; @@ -120,6 +116,8 @@ typedef struct _winWMMessageRec{ #define WM_WM_MAP3 (WM_USER + 13) #define WM_MANAGE (WM_USER + 100) #define WM_UNMANAGE (WM_USER + 102) +#define WM_WM_REINIT (WM_USER + 200) + #define MwmHintsDecorations (1L << 1) diff --git a/xorg-server/hw/xwin/winwindowswm.c b/xorg-server/hw/xwin/winwindowswm.c index 966732a5a..f839171e9 100644 --- a/xorg-server/hw/xwin/winwindowswm.c +++ b/xorg-server/hw/xwin/winwindowswm.c @@ -261,10 +261,8 @@ winWindowsWMSendEvent (int type, unsigned int mask, int which, int arg, WMEventPtr *pHead, pEvent;
ClientPtr client;
xWindowsWMNotifyEvent se;
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winWindowsWMSendEvent %d %d %d %d, %d %d - %d %d\n",
+ winDebug ("winWindowsWMSendEvent %d %d %d %d, %d %d - %d %d\n",
type, mask, which, arg, x, y, w, h);
-#endif
dixLookupResourceByType((pointer) &pHead, eventResource, eventResourceType,
NullClient, DixUnknownAccess);
if (!pHead)
@@ -272,16 +270,13 @@ winWindowsWMSendEvent (int type, unsigned int mask, int which, int arg, for (pEvent = *pHead; pEvent; pEvent = pEvent->next)
{
client = pEvent->client;
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winWindowsWMSendEvent - x%08x\n", (int) client);
-#endif
+ winDebug ("winWindowsWMSendEvent - x%08x\n", (int) client);
if ((pEvent->mask & mask) == 0)
{
continue;
}
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winWindowsWMSendEvent - send\n");
-#endif
+ winDebug ("winWindowsWMSendEvent - send\n");
+
se.type = type + WMEventBase;
se.kind = which;
se.window = window;
@@ -341,10 +336,8 @@ ProcWindowsWMFrameGetRect (ClientPtr client) RECT rcNew;
REQUEST(xWindowsWMFrameGetRectReq);
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("ProcWindowsWMFrameGetRect %d %d\n",
+ winDebug ("ProcWindowsWMFrameGetRect %d %d\n",
(sizeof(xWindowsWMFrameGetRectReq) >> 2), (int) client->req_len);
-#endif
REQUEST_SIZE_MATCH(xWindowsWMFrameGetRectReq);
rep.type = X_Reply;
@@ -363,10 +356,8 @@ ProcWindowsWMFrameGetRect (ClientPtr client) SetRect (&rcNew, stuff->ix, stuff->iy,
stuff->ix + stuff->iw, stuff->iy + stuff->ih);
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("ProcWindowsWMFrameGetRect - %d %d %d %d\n",
+ winDebug ("ProcWindowsWMFrameGetRect - %d %d %d %d\n",
stuff->ix, stuff->iy, stuff->ix + stuff->iw, stuff->iy + stuff->ih);
-#endif
/*
* Calculate the required size of the Windows window rectangle,
@@ -377,10 +368,8 @@ ProcWindowsWMFrameGetRect (ClientPtr client) rep.y = rcNew.top;
rep.w = rcNew.right - rcNew.left;
rep.h = rcNew.bottom - rcNew.top;
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("ProcWindowsWMFrameGetRect - %d %d %d %d\n",
+ winDebug ("ProcWindowsWMFrameGetRect - %d %d %d %d\n",
rep.x, rep.y, rep.w, rep.h);
-#endif
WriteToClient(client, sizeof(xWindowsWMFrameGetRectReply), (char *)&rep);
return Success;
@@ -399,26 +388,22 @@ ProcWindowsWMFrameDraw (ClientPtr client) REQUEST_SIZE_MATCH (xWindowsWMFrameDrawReq);
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("ProcWindowsWMFrameDraw\n");
-#endif
+ winDebug ("ProcWindowsWMFrameDraw\n");
+
rc = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess);
if (rc != Success)
return rc;
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("ProcWindowsWMFrameDraw - Window found\n");
-#endif
+
+ winDebug ("ProcWindowsWMFrameDraw - Window found\n");
pRLWinPriv = (win32RootlessWindowPtr) RootlessFrameForWindow (pWin, TRUE);
if (pRLWinPriv == 0) return BadWindow;
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("ProcWindowsWMFrameDraw - HWND 0x%08x 0x%08x 0x%08x\n",
+ winDebug ("ProcWindowsWMFrameDraw - HWND 0x%08x 0x%08x 0x%08x\n",
(int) pRLWinPriv->hWnd, (int) stuff->frame_style,
(int) stuff->frame_style_ex);
- ErrorF ("ProcWindowsWMFrameDraw - %d %d %d %d\n",
+ winDebug ("ProcWindowsWMFrameDraw - %d %d %d %d\n",
stuff->ix, stuff->iy, stuff->iw, stuff->ih);
-#endif
/* Store the origin, height, and width in a rectangle structure */
SetRect (&rcNew, stuff->ix, stuff->iy,
@@ -470,9 +455,7 @@ ProcWindowsWMFrameDraw (ClientPtr client) winMWExtWMReshapeFrame (pRLWinPriv, &newShape);
RegionUninit(&newShape);
}
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("ProcWindowsWMFrameDraw - done\n");
-#endif
+ winDebug ("ProcWindowsWMFrameDraw - done\n");
return Success;
}
@@ -487,18 +470,14 @@ ProcWindowsWMFrameSetTitle(ClientPtr client) win32RootlessWindowPtr pRLWinPriv;
int rc;
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("ProcWindowsWMFrameSetTitle\n");
-#endif
+ winDebug ("ProcWindowsWMFrameSetTitle\n");
REQUEST_AT_LEAST_SIZE(xWindowsWMFrameSetTitleReq);
rc = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess);
if (rc != Success)
return rc;
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("ProcWindowsWMFrameSetTitle - Window found\n");
-#endif
+ winDebug ("ProcWindowsWMFrameSetTitle - Window found\n");
title_length = stuff->title_length;
title_max = (stuff->length << 2) - sizeof(xWindowsWMFrameSetTitleReq);
@@ -506,9 +485,7 @@ ProcWindowsWMFrameSetTitle(ClientPtr client) if (title_max < title_length)
return BadValue;
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("ProcWindowsWMFrameSetTitle - length is valid\n");
-#endif
+ winDebug ("ProcWindowsWMFrameSetTitle - length is valid\n");
title_bytes = malloc (title_length+1);
strncpy (title_bytes, (unsigned char *) &stuff[1], title_length);
@@ -527,9 +504,7 @@ ProcWindowsWMFrameSetTitle(ClientPtr client) free (title_bytes);
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("ProcWindowsWMFrameSetTitle - done\n");
-#endif
+ winDebug ("ProcWindowsWMFrameSetTitle - done\n");
return Success;
}
diff --git a/xorg-server/hw/xwin/winwndproc.c b/xorg-server/hw/xwin/winwndproc.c index bccd6f9f2..e1cb77508 100644 --- a/xorg-server/hw/xwin/winwndproc.c +++ b/xorg-server/hw/xwin/winwndproc.c @@ -43,10 +43,16 @@ #include "winmonitors.h" #include "inputstr.h" +#ifndef XKB_IN_SERVER +#define XKB_IN_SERVER +#endif +#include <xkbsrv.h> + /* * Global variables */ +extern Bool g_fClipboardStarted; Bool g_fCursor = TRUE; Bool g_fButton[3] = { FALSE, FALSE, FALSE }; @@ -71,9 +77,7 @@ winWindowProc (HWND hwnd, UINT message, int iScanCode; int i; -#if CYGDEBUG winDebugWin32Message("winWindowProc", hwnd, message, wParam, lParam); -#endif /* Watch for server regeneration */ if (g_ulServerGeneration != s_ulServerGeneration) @@ -86,9 +90,7 @@ winWindowProc (HWND hwnd, UINT message, if ((s_pScreenPriv == NULL || hwnd != s_hwndLastPrivates) && (s_pScreenPriv = GetProp (hwnd, WIN_SCR_PROP)) != NULL) { -#if CYGDEBUG winDebug ("winWindowProc - Setting privates handle\n"); -#endif s_pScreenInfo = s_pScreenPriv->pScreenInfo; s_pScreen = s_pScreenInfo->pScreen; s_hwndLastPrivates = hwnd; @@ -109,9 +111,7 @@ winWindowProc (HWND hwnd, UINT message, s_pScreenPriv); case WM_CREATE: -#if CYGDEBUG winDebug ("winWindowProc - WM_CREATE\n"); -#endif /* * Add a property to our display window that references @@ -144,7 +144,7 @@ winWindowProc (HWND hwnd, UINT message, s_pScreenPriv->hwndScreen = hwnd; - winInitNotifyIcon (s_pScreenPriv); + winInitNotifyIcon (s_pScreenPriv,FALSE); } return 0; @@ -178,7 +178,7 @@ winWindowProc (HWND hwnd, UINT message, break; } - ErrorF ("winWindowProc - WM_DISPLAYCHANGE - new width: %d " + winDebug ("winWindowProc - WM_DISPLAYCHANGE - new width: %d " "new height: %d new bpp: %d\n", LOWORD (lParam), HIWORD (lParam), wParam); @@ -201,7 +201,7 @@ winWindowProc (HWND hwnd, UINT message, )) { /* Cannot display the visual until the depth is restored */ - ErrorF ("winWindowProc - Disruptive change in depth\n"); + winDebug ("winWindowProc - Disruptive change in depth\n"); /* Display depth change dialog */ winDisplayDepthChangeDialog (s_pScreenPriv); @@ -248,7 +248,7 @@ winWindowProc (HWND hwnd, UINT message, #endif )) { - DWORD dwWidth, dwHeight; + DWORD dwWidth = 0, dwHeight = 0; if (s_pScreenInfo->fMultipleMonitors) { @@ -314,15 +314,31 @@ winWindowProc (HWND hwnd, UINT message, winDebug ("winWindowProc - WM_DISPLAYCHANGE - Releasing and recreating primary surface\n"); - /* Release the old primary surface */ - (*s_pScreenPriv->pwinReleasePrimarySurface) (s_pScreen); - - /* Create the new primary surface */ - (*s_pScreenPriv->pwinCreatePrimarySurface) (s_pScreen); + /* Reallocate the framebuffer used by the drawing engine */ + (*s_pScreenPriv->pwinFreeFB)(s_pScreen); + if (!(*s_pScreenPriv->pwinAllocateFB)(s_pScreen)) + { + ErrorF ("winWindowProc - WM_DISPLAYCHANGE - Could not reallocate framebuffer\n"); + } + /* Update the screen pixmap to point to the new framebuffer */ + winUpdateFBPointer(s_pScreen, s_pScreenPriv->pScreenInfo->pfb); + // Restore the ability to update screen, now with new dimensions + SetRootClip(s_pScreen, TRUE); + + // and arrange for it to be repainted + miPaintWindow(s_pScreen->root, &s_pScreen->root->borderClip, PW_BACKGROUND); } } break; + + case WM_SYSCOMMAND: + if (wParam == SC_MAXIMIZE||wParam == SC_RESTORE) + { + winDebug("Posting WM_EXITSIZEMOVE message since windows does not send it when the maximised/restored button is clicked.\n"); + PostMessage(hwnd, WM_EXITSIZEMOVE, 0, 0); + } + break; case WM_SIZE: { @@ -330,9 +346,7 @@ winWindowProc (HWND hwnd, UINT message, RECT rcWindow; int iWidth, iHeight; -#if CYGDEBUG winDebug ("winWindowProc - WM_SIZE\n"); -#endif /* Break if we do not allow resizing */ if ((s_pScreenInfo->iResizeMode == notAllowed) @@ -351,7 +365,7 @@ winWindowProc (HWND hwnd, UINT message, if (wParam == SIZE_MINIMIZED) return 0; - ErrorF ("winWindowProc - WM_SIZE - new client area w: %d h: %d\n", + winDebug ("winWindowProc - WM_SIZE - new client area w: %d h: %d\n", LOWORD (lParam), HIWORD (lParam)); if (s_pScreenInfo->iResizeMode == resizeWithRandr) @@ -433,13 +447,13 @@ winWindowProc (HWND hwnd, UINT message, s_pScreenInfo->dwYOffset = -si.nPos; } return 0; - + case WM_ENTERSIZEMOVE: - ErrorF("winWindowProc - WM_ENTERSIZEMOVE\n"); + winDebug("winWindowProc - WM_ENTERSIZEMOVE\n"); break; case WM_EXITSIZEMOVE: - ErrorF("winWindowProc - WM_EXITSIZEMOVE\n"); + winDebug("winWindowProc - WM_EXITSIZEMOVE\n"); if (s_pScreenInfo->iResizeMode == resizeWithRandr) { @@ -470,9 +484,7 @@ winWindowProc (HWND hwnd, UINT message, SCROLLINFO si; int iVertPos; -#if CYGDEBUG winDebug ("winWindowProc - WM_VSCROLL\n"); -#endif /* Get vertical scroll bar info */ si.cbSize = sizeof (si); @@ -555,9 +567,7 @@ winWindowProc (HWND hwnd, UINT message, SCROLLINFO si; int iHorzPos; -#if CYGDEBUG winDebug ("winWindowProc - WM_HSCROLL\n"); -#endif /* Get horizontal scroll bar info */ si.cbSize = sizeof (si); @@ -641,10 +651,8 @@ winWindowProc (HWND hwnd, UINT message, int iCaptionHeight; int iBorderHeight, iBorderWidth; -#if CYGDEBUG winDebug ("winWindowProc - WM_GETMINMAXINFO - pScreenInfo: %08x\n", s_pScreenInfo); -#endif /* Can't do anything without screen info */ if (s_pScreenInfo == NULL @@ -687,9 +695,7 @@ winWindowProc (HWND hwnd, UINT message, return 0; case WM_ERASEBKGND: -#if CYGDEBUG winDebug ("winWindowProc - WM_ERASEBKGND\n"); -#endif /* * Pretend that we did erase the background but we don't care, * the application uses the full window estate. This avoids some @@ -698,9 +704,6 @@ winWindowProc (HWND hwnd, UINT message, return TRUE; case WM_PAINT: -#if CYGDEBUG - winDebug ("winWindowProc - WM_PAINT\n"); -#endif /* Only paint if we have privates and the server is enabled */ if (s_pScreenPriv == NULL || !s_pScreenPriv->fEnabled @@ -721,9 +724,7 @@ winWindowProc (HWND hwnd, UINT message, case WM_PALETTECHANGED: { -#if CYGDEBUG winDebug ("winWindowProc - WM_PALETTECHANGED\n"); -#endif /* * Don't process if we don't have privates or a colormap, * or if we have an invalid depth. @@ -991,9 +992,7 @@ winWindowProc (HWND hwnd, UINT message, case WM_MOUSEWHEEL: if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput) break; -#if CYGDEBUG winDebug ("winWindowProc - WM_MOUSEWHEEL\n"); -#endif winMouseWheel (s_pScreen, GET_WHEEL_DELTA_WPARAM(wParam)); break; @@ -1045,7 +1044,7 @@ winWindowProc (HWND hwnd, UINT message, * user enters Alt + F4 and is surprised when the application * quits. */ - ErrorF ("winWindowProc - WM_*KEYDOWN - Closekey hit, quitting\n"); + winDebug ("winWindowProc - WM_*KEYDOWN - Closekey hit, quitting\n"); /* Display Exit dialog */ winDisplayExitDialog (s_pScreenPriv); @@ -1138,7 +1137,7 @@ winWindowProc (HWND hwnd, UINT message, /* TODO: Override display of window when we have a bad depth */ if (LOWORD(wParam) != WA_INACTIVE && s_pScreenPriv->fBadDepth) { - ErrorF ("winWindowProc - WM_ACTIVATE - Bad depth, trying " + winDebug ("winWindowProc - WM_ACTIVATE - Bad depth, trying " "to override window activation\n"); /* Minimize the window */ @@ -1160,9 +1159,7 @@ winWindowProc (HWND hwnd, UINT message, return 0; } -#if CYGDEBUG winDebug ("winWindowProc - WM_ACTIVATE\n"); -#endif /* * Focus is being changed to another window. @@ -1188,9 +1185,7 @@ winWindowProc (HWND hwnd, UINT message, || s_pScreenInfo->fIgnoreInput) break; -#if CYGDEBUG || TRUE winDebug ("winWindowProc - WM_ACTIVATEAPP\n"); -#endif /* Activate or deactivate */ s_pScreenPriv->fActive = wParam; @@ -1206,13 +1201,13 @@ winWindowProc (HWND hwnd, UINT message, #ifdef XWIN_CLIPBOARD /* Make sure the clipboard chain is ok. */ - winFixClipboardChain (); + winFixClipboardChain (0); #endif /* Call engine specific screen activation/deactivation function */ (*s_pScreenPriv->pwinActivateApp) (s_pScreen); -#ifdef XWIN_MULTIWINDOWEXTWM +#ifdef XWIN_MULTIWINDOWINTWM if (s_pScreenPriv->fActive) { /* Restack all window unless using built-in wm. */ @@ -1260,6 +1255,7 @@ winWindowProc (HWND hwnd, UINT message, if (s_pScreenInfo->fMultiWindow) winDeinitMultiWindowWM (); #endif + g_fClipboardStarted=FALSE; /* This is to avoid dead-locls caused by the clipboard thread still doing some stuff */ GiveUp (0); return 0; @@ -1278,32 +1274,36 @@ winWindowProc (HWND hwnd, UINT message, #ifdef XWIN_MULTIWINDOWEXTWM case WM_MANAGE: - ErrorF ("winWindowProc - WM_MANAGE\n"); + winDebug ("winWindowProc - WM_MANAGE\n"); s_pScreenInfo->fAnotherWMRunning = FALSE; +#ifdef XWIN_MULTIWINDOWINTWM if (s_pScreenInfo->fInternalWM) { EnumThreadWindows (g_dwCurrentThreadID, winMWExtWMDecorateWindow, 0); //RootlessRepositionWindows (s_pScreen); } +#endif break; case WM_UNMANAGE: - ErrorF ("winWindowProc - WM_UNMANAGE\n"); + winDebug ("winWindowProc - WM_UNMANAGE\n"); s_pScreenInfo->fAnotherWMRunning = TRUE; +#ifdef XWIN_MULTIWINDOWINTWM if (s_pScreenInfo->fInternalWM) { EnumThreadWindows (g_dwCurrentThreadID, winMWExtWMDecorateWindow, 0); winMWExtWMRestackWindows (s_pScreen); } +#endif break; #endif default: if(message == s_uTaskbarRestart) { - winInitNotifyIcon (s_pScreenPriv); + winInitNotifyIcon (s_pScreenPriv,FALSE); } break; } diff --git a/xorg-server/hw/xwin/xdmcphostselect.c b/xorg-server/hw/xwin/xdmcphostselect.c new file mode 100644 index 000000000..3196da4af --- /dev/null +++ b/xorg-server/hw/xwin/xdmcphostselect.c @@ -0,0 +1,183 @@ +#ifdef HAVE_XWIN_CONFIG_H
+#include <xwin-config.h>
+#endif
+#include "win.h"
+
+void XdmcpHostSelected(int HostIndex);
+
+static HWND g_hDlgHosts;
+static char HostToConnect[128];
+
+static void SelectHost(int Index)
+{
+ int i;
+ char HostName[128];
+ int HostIndex=SendDlgItemMessage(g_hDlgHosts, IDC_HOSTLIST, LB_GETITEMDATA, (WPARAM)Index, 0);
+
+ HostToConnect[0]=0;
+ SendDlgItemMessage(g_hDlgHosts, IDC_HOSTLIST, LB_GETTEXT, (WPARAM)Index, (LPARAM)HostToConnect);
+ g_pszQueryHost=HostToConnect;
+
+ gethostname(HostName,128);
+
+ XdmcpHostSelected(HostIndex);
+
+ for (i = 0; i < g_iNumScreens; ++i)
+ {
+ /* Change the window title to reflect the host we are connecting to */
+ if (g_ScreenInfo[i].pScreen)
+ {
+ char szTitle[256];
+
+ winScreenPriv(g_ScreenInfo[i].pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ snprintf (szTitle, sizeof (szTitle), WINDOW_TITLE_XDMCP, HostToConnect, HostName, display, (int) pScreenInfo->dwScreen);
+ SetWindowText(pScreenPriv->hwndScreen,szTitle);
+ }
+ }
+
+ DestroyWindow (g_hDlgHosts);
+ g_hDlgHosts = NULL;
+}
+
+/*
+ * Process messages for the about dialog.
+ */
+
+static wBOOL CALLBACK DisplayXdmcpHostsDlgProc (HWND hwndDialog, UINT message, WPARAM wParam, LPARAM lParam)
+{
+ /* Branch on message type */
+ switch (message)
+ {
+ case WM_INITDIALOG:
+ {
+ HWND hwndDesk=GetForegroundWindow();
+ RECT rc, rcDlg, rcDesk;
+
+ GetWindowRect (hwndDesk, &rcDesk);
+ GetWindowRect (hwndDialog, &rcDlg);
+ CopyRect (&rc, &rcDesk);
+
+ OffsetRect (&rcDlg, -rcDlg.left, -rcDlg.top);
+ OffsetRect (&rc, -rc.left, -rc.top);
+ OffsetRect (&rc, -rcDlg.right, -rcDlg.bottom);
+
+ SetWindowPos (hwndDialog,
+ HWND_TOPMOST,
+ rcDesk.left + (rc.right / 2),
+ rcDesk.top + (rc.bottom / 2),
+ 0, 0,
+ SWP_NOSIZE | SWP_FRAMECHANGED);
+ return TRUE;
+ }
+ break;
+ case WM_MOUSEMOVE:
+ case WM_NCMOUSEMOVE:
+ /* Show the cursor if it is hidden */
+ if (g_fSoftwareCursor && !g_fCursor)
+ {
+ g_fCursor = TRUE;
+ ShowCursor (TRUE);
+ }
+ return TRUE;
+
+ case WM_COMMAND:
+ switch (LOWORD (wParam))
+ {
+ case IDOK:
+ {
+ int Index;
+ winDebug ("DisplayXdmcpHostsDlgProc - WM_COMMAND - IDOK or IDCANCEL\n");
+
+ /* Retreive the host to connect to */
+ Index=SendDlgItemMessage(g_hDlgHosts, IDC_HOSTLIST, LB_GETCURSEL, 0, 0);
+ if (Index==LB_ERR)
+ {
+ MessageBox(hwndDialog,"Please select a host to connect to!","Error",MB_OK);
+ }
+ else
+ {
+ SelectHost(Index);
+ }
+
+ return TRUE;
+ }
+ break;
+ case IDCANCEL:
+ winDebug ("DisplayXdmcpHostsDlgProc - WM_COMMAND - IDCANCEL\n");
+
+ DestroyWindow (g_hDlgHosts);
+ AbortDDX();
+ TerminateProcess(GetCurrentProcess(),1); /* Exit the application */
+
+ return TRUE;
+ break;
+ case IDC_HOSTLIST:
+ if (HIWORD(wParam)==LBN_DBLCLK)
+ {
+ int Index=SendDlgItemMessage(g_hDlgHosts, IDC_HOSTLIST, LB_GETCURSEL, 0, 0);
+ SelectHost(Index);
+ return TRUE;
+ }
+ break;
+ }
+ break;
+
+ case WM_CLOSE:
+ ErrorF ("DisplayXdmcpHostsDlgProc - WM_CLOSE\n");
+
+ DestroyWindow (g_hDlgHosts);
+ g_hDlgHosts = NULL;
+ AbortDDX();
+ TerminateProcess(GetCurrentProcess(),1); /* Exit the application */
+
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+int XdmcpHostAddName(const char *HostName, int HostIndex)
+{
+ int Index=SendDlgItemMessage(g_hDlgHosts, IDC_HOSTLIST, LB_FINDSTRINGEXACT, -1, (LPARAM)HostName);
+ if (LB_ERR==Index)
+ {
+ Index=SendDlgItemMessage(g_hDlgHosts, IDC_HOSTLIST, LB_ADDSTRING, 0, (LPARAM)HostName);
+ SendDlgItemMessage(g_hDlgHosts, IDC_HOSTLIST, LB_SETITEMDATA, (WPARAM)Index, (LPARAM)HostIndex);
+ return -1;
+ }
+ else
+ return SendDlgItemMessage(g_hDlgHosts, IDC_HOSTLIST, LB_GETITEMDATA, (WPARAM)Index, 0);
+}
+/*
+ * Display the host selection dialog box
+ */
+
+void DisplayXdmcpHostsDialog(void)
+{
+ /* Check if dialog already exists */
+ if (g_hDlgHosts != NULL)
+ {
+ /* Dialog box already exists, display it */
+ ShowWindow (g_hDlgHosts, SW_SHOWDEFAULT);
+
+ /* User has lost the dialog. Show them where it is. */
+ SetForegroundWindow (g_hDlgHosts);
+
+ return;
+ }
+
+ /*
+ * Display the about box
+ */
+ g_hDlgHosts = CreateDialogParam (g_hInstance, "XDMCP_HOSTS", NULL, DisplayXdmcpHostsDlgProc, 0);
+
+ /* Show the dialog box */
+ ShowWindow (g_hDlgHosts, SW_SHOW);
+
+ /* Needed to get keyboard controls (tab, arrows, enter, esc) to work */
+ SetForegroundWindow (g_hDlgHosts);
+
+ /* Set focus to the OK button */
+ PostMessage (g_hDlgAbout, WM_NEXTDLGCTL, (WPARAM)GetDlgItem (g_hDlgHosts, IDOK), TRUE);
+}
diff --git a/xorg-server/hw/xwin/xlaunch/Makefile b/xorg-server/hw/xwin/xlaunch/Makefile deleted file mode 100644 index f7cf923df..000000000 --- a/xorg-server/hw/xwin/xlaunch/Makefile +++ /dev/null @@ -1,79 +0,0 @@ -# -# Copyright (c) 2005 Alexander Gottwald -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# the rights to use, copy, modify, merge, publish, distribute, sublicense, -# and/or sell copies of the Software, and to permit persons to whom the -# Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR -# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. -# -# Except as contained in this notice, the name(s) of the above copyright -# holders shall not be used in advertising or otherwise to promote the sale, -# use or other dealings in this Software without prior written authorization. -# -WINDRES=windres - -TARGET=mingw -#DEBUG_FLAGS=-D_DEBUG - -OS_FLAGS_mingw=-mno-cygwin -OS_FLAGS=$(OS_FLAGS_$(TARGET)) $(DEBUG_FLAGS) - -X11_DIR_$(TARGET)=/usr/X11R6 -X11_DIR_mingw=../../../../../exports -X11_DIR=$(X11_DIR_$(TARGET)) -X11_INCLUDE=-I$(X11_DIR)/include -X11_LIBDIR=-L$(X11_DIR)/lib -X11_LIBS_$(TARGET)=-lX11 -X11_LIBS_mingw=-lX11 -lwsock32 -X11_LIBS=$(X11_LIBS_$(TARGET)) - -PROGRAMFILES:=$(shell cygpath -u $(PROGRAMFILES)) -#MSXML_DIR=$(PROGRAMFILES)/MSXML 4.0 -MSXML_DIR=$(PROGRAMFILES)/Microsoft XML Parser SDK -MSXML_INCLUDE="-I$(MSXML_DIR)/inc" -MSXML_LIBDIR="-L$(MSXML_DIR)/lib" -MSXML_LIBS= - - -CXXFLAGS=-g $(OS_FLAGS) $(X11_INCLUDE) $(MSXML_INCLUDE) -LDFLAGS=-mwindows $(X11_LIBDIR) $(MSXML_LIBDIR) -LIBS=-lcomctl32 -lole32 -loleaut32 $(X11_LIBS) $(MSXML_LIBS) -all:xlaunch.exe -%.res: %.rc - $(WINDRES) -O coff -o $@ $< - -WINDOW_PARTS=window util dialog wizard -WINDOW_OBJECTS=$(foreach file,$(WINDOW_PARTS),window/$(file).o) - -RESOURCES_IMAGES=resources/multiwindow.bmp resources/fullscreen.bmp \ - resources/windowed.bmp resources/nodecoration.bmp - -resources/resources.res: resources/resources.rc resources/resources.h \ - resources/images.rc resources/dialog.rc resources/strings.rc \ - $(RESOURCES_IMAGES) -xlaunch.exe: $(WINDOW_OBJECTS) main.o config.o resources/resources.res - $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) - - -window/dialog.o: window/dialog.cc window/dialog.h window/window.h window/util.h -window/frame.o: window/frame.cc window/frame.h window/window.h -window/util.o: window/util.cc window/util.h -window/window.o: window/window.cc window/window.h window/util.h -window/wizard.o: window/wizard.cc window/wizard.h window/dialog.h \ - window/window.h window/util.h -main.o: main.cc window/util.h window/wizard.h window/dialog.h \ - window/window.h resources/resources.h config.h -config.o: config.cc config.h diff --git a/xorg-server/hw/xwin/xlaunch/config.cc b/xorg-server/hw/xwin/xlaunch/config.cc index b6bf65ae3..c7ac398fb 100644 --- a/xorg-server/hw/xwin/xlaunch/config.cc +++ b/xorg-server/hw/xwin/xlaunch/config.cc @@ -1,282 +1,198 @@ -/* - * Copyright (c) 2005 Alexander Gottwald - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ -#include "config.h" -#include "window/util.h" -#include <msxml2.h> -#include <stdexcept> - -const CLSID CLSID_DOMDocument40 = {0x88d969c0,0xf192,0x11d4,0xa6,0x5f,0x00,0x40,0x96,0x32,0x51,0xe5}; -const CLSID CLSID_DOMDocument30 = {0xf5078f32,0xc551,0x11d3,0x89,0xb9,0x00,0x00,0xf8,0x1f,0xe2,0x21}; -const IID IID_IXMLDOMDocument2 = {0x2933BF95,0x7B36,0x11d2,0xB2,0x0E,0x00,0xC0,0x4F,0x98,0x3E,0x60}; - -#define HRCALL(x, msg) if (FAILED(x)) { throw std::runtime_error("OLE Error:" msg " failed"); }; - -char *wcconvert(const wchar_t *wstr) -{ - int chars = WideCharToMultiByte(CP_ACP, 0, wstr, -1, NULL, 0, NULL, NULL); - if (chars == 0) - throw win32_error("WideCharToMultiByte"); - char *mbstr = new char[chars]; - chars = WideCharToMultiByte(CP_ACP, 0, wstr, -1, mbstr, chars, NULL, NULL); - if (chars == 0) - throw win32_error("WideCharToMultiByte"); - return mbstr; -} - -wchar_t *mbconvert(const char *mbstr) -{ - int chars = MultiByteToWideChar(CP_ACP, 0, mbstr, -1, NULL, 0); - if (chars == 0) - throw win32_error("MultiByteToWideChar"); - wchar_t *wstr = new wchar_t[chars]; - chars = MultiByteToWideChar(CP_ACP, 0, mbstr, -1, wstr, chars); - if (chars == 0) - throw win32_error("MultiByteToWideChar"); - return wstr; -} - -VARIANT VariantString(const char *filename) -{ - - wchar_t *str = mbconvert(filename); - - VARIANT var; - VariantInit(&var); - V_BSTR(&var) = SysAllocString(str); - V_VT(&var) = VT_BSTR; - - delete [] str; - return var; -} - -VARIANT VariantString(const wchar_t *str) -{ - VARIANT var; - VariantInit(&var); - V_BSTR(&var) = SysAllocString(str); - V_VT(&var) = VT_BSTR; - return var; -} - -IXMLDOMDocument2 *CreateDocument() -{ - IXMLDOMDocument2 *doc = NULL; - - CoInitialize(NULL); - - HRCALL(CoCreateInstance(CLSID_DOMDocument40, NULL, CLSCTX_INPROC_SERVER, - IID_IXMLDOMDocument2, (void**)&doc), "CoCreateInstance"); - - try { - HRCALL(doc->put_async(VARIANT_FALSE), "put_async"); - HRCALL(doc->put_validateOnParse(VARIANT_FALSE), "put_validateOnParse"); - HRCALL(doc->put_resolveExternals(VARIANT_FALSE), "put_resolveExternals"); - - IXMLDOMProcessingInstruction *pi = NULL; - IXMLDOMElement *root = NULL; - BSTR xml = SysAllocString(L"xml"); - BSTR ver = SysAllocString(L"version='1.0'"); - HRCALL(doc->createProcessingInstruction(xml,ver, &pi), - "createProcessingInstruction"); - HRCALL(doc->appendChild(pi, NULL), - "appendChild"); - pi->Release(); - SysFreeString(xml); - SysFreeString(ver); - - BSTR elemname = SysAllocString(L"XLaunch"); - HRCALL(doc->createElement(elemname, &root), "createElement"); - HRCALL(doc->appendChild(root, NULL), "appendChild"); - SysFreeString(elemname); - } catch (...) - { - doc->Release(); - throw; - } - return doc; -} - -void setAttribute(IXMLDOMElement *elem, const wchar_t *name, const wchar_t *value) -{ - BSTR str = SysAllocString(name); - VARIANT var = VariantString(value); - HRCALL(elem->setAttribute(str, var), "setAttribute"); - VariantClear(&var); - SysFreeString(str); -} - -void setAttribute(IXMLDOMElement *elem, const wchar_t *name, const char *value) -{ - wchar_t *wstr = mbconvert(value); - setAttribute(elem, name, wstr); - delete [] wstr; - return; -} - -void CConfig::Save(const char *filename) -{ - IXMLDOMDocument2 *doc = CreateDocument(); - IXMLDOMElement *root = NULL; - - HRCALL(doc->get_documentElement(&root), "get_documentElement"); - - switch (window) - { - case MultiWindow: - setAttribute(root, L"WindowMode", L"MultiWindow"); - break; - case Fullscreen: - setAttribute(root, L"WindowMode", L"Fullscreen"); - break; - default: - case Windowed: - setAttribute(root, L"WindowMode", L"Windowed"); - break; - case Nodecoration: - setAttribute(root, L"WindowMode", L"Nodecoration"); - break; - } - switch (client) - { - default: - case NoClient: - setAttribute(root, L"ClientMode", L"NoClient"); - break; - case StartProgram: - setAttribute(root, L"ClientMode", L"StartProgram"); - break; - case XDMCP: - setAttribute(root, L"ClientMode", L"XDMCP"); - break; - } - setAttribute(root, L"LocalClient", local?L"True":L"False"); - setAttribute(root, L"Display", display.c_str()); - setAttribute(root, L"Program", program.c_str()); - setAttribute(root, L"RemoteProtocol", protocol.c_str()); - setAttribute(root, L"RemoteHost", host.c_str()); - setAttribute(root, L"RemoteUser", user.c_str()); - setAttribute(root, L"XDMCPHost", xdmcp_host.c_str()); - setAttribute(root, L"XDMCPBroadcast", broadcast?L"True":L"False"); - setAttribute(root, L"XDMCPIndirect", indirect?L"True":L"False"); - setAttribute(root, L"Clipboard", clipboard?L"True":L"False"); - setAttribute(root, L"ExtraParams", extra_params.c_str()); - - VARIANT var = VariantString(filename); - HRCALL(doc->save(var), "save"); - VariantClear(&var); - - - root->Release(); - doc->Release(); -} - -BOOL getAttribute(IXMLDOMElement *elem, const wchar_t *name, std::string &ret) -{ - VARIANT var; - HRCALL(elem->getAttribute((OLECHAR*)name, &var), "getAttribute"); - if (V_VT(&var) != VT_NULL && V_VT(&var) == VT_BSTR) - { - char *str = wcconvert(V_BSTR(&var)); - ret = str; - delete [] str; - return true; - } - return false; -} - -BOOL getAttributeBool(IXMLDOMElement *elem, const wchar_t *name, bool &ret) -{ - std::string str; - if (getAttribute(elem, name, str)) - { - if (str == "True") - ret = true; - else - ret = false; - return true; - } - return false; -} - - -void CConfig::Load(const char *filename) -{ - IXMLDOMDocument2 *doc = CreateDocument(); - IXMLDOMElement *root = NULL; - - VARIANT var = VariantString(filename); - VARIANT_BOOL status; - HRCALL(doc->load(var, &status), "load"); - VariantClear(&var); - - if (status == VARIANT_FALSE) - { - doc->Release(); - return; - } - - HRCALL(doc->get_documentElement(&root), "get_documentElement"); - - std::string windowMode; - std::string clientMode; - - if (getAttribute(root, L"WindowMode", windowMode)) - { - if (windowMode == "MultiWindow") - window = MultiWindow; - else if (windowMode == "Fullscreen") - window = Fullscreen; - else if (windowMode == "Windowed") - window = Windowed; - else if (windowMode == "Nodecoration") - window = Nodecoration; - } - if (getAttribute(root, L"ClientMode", clientMode)) - { - if (clientMode == "NoClient") - client = NoClient; - else if (clientMode == "StartProgram") - client = StartProgram; - else if (clientMode == "XDMCP") - client = XDMCP; - } - - getAttributeBool(root, L"LocalClient", local); - getAttribute(root, L"Display", display); - getAttribute(root, L"Program", program); - getAttribute(root, L"RemoteProtocol", protocol); - getAttribute(root, L"RemoteHost", host); - getAttribute(root, L"RemoteUser", user); - getAttribute(root, L"XDMCPHost", xdmcp_host); - getAttributeBool(root, L"XDMCPBroadcast", broadcast); - getAttributeBool(root, L"XDMCPIndirect", indirect); - getAttributeBool(root, L"Clipboard", clipboard); - getAttribute(root, L"ExtraParams", extra_params); - - - doc->Release(); -} - +/*
+ * Copyright (c) 2005 Alexander Gottwald
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name(s) of the above copyright
+ * holders shall not be used in advertising or otherwise to promote the sale,
+ * use or other dealings in this Software without prior written authorization.
+ */
+#include <libxml/parser.h>
+#include <libxml/tree.h>
+#include "config.h"
+#include "window/util.h"
+#include <stdexcept>
+
+xmlDocPtr CreateDocument()
+{
+ xmlDocPtr doc = xmlNewDoc(BAD_CAST "1.0");
+ xmlNodePtr root_node = xmlNewNode(NULL, BAD_CAST "XLaunch");
+ xmlDocSetRootElement(doc, root_node);
+
+ return doc;
+
+}
+
+void setAttribute(xmlNodePtr elem, const char *name, const char *value)
+{
+ xmlNewProp(elem, BAD_CAST name, BAD_CAST value);
+}
+
+void CConfig::Save(const char *filename)
+{
+ xmlDocPtr doc = CreateDocument();
+ xmlNodePtr root = xmlDocGetRootElement(doc);
+
+ switch (window)
+ {
+ case MultiWindow:
+ setAttribute(root, "WindowMode", "MultiWindow");
+ break;
+ case Fullscreen:
+ setAttribute(root, "WindowMode", "Fullscreen");
+ break;
+ default:
+ case Windowed:
+ setAttribute(root, "WindowMode", "Windowed");
+ break;
+ case Nodecoration:
+ setAttribute(root, "WindowMode", "Nodecoration");
+ break;
+ }
+ switch (client)
+ {
+ default:
+ case NoClient:
+ setAttribute(root, "ClientMode", "NoClient");
+ break;
+ case StartProgram:
+ setAttribute(root, "ClientMode", "StartProgram");
+ break;
+ case XDMCP:
+ setAttribute(root, "ClientMode", "XDMCP");
+ break;
+ }
+ setAttribute(root, "LocalClient", local?"True":"False");
+ setAttribute(root, "Display", display.c_str());
+ setAttribute(root, "LocalProgram", localprogram.c_str());
+ setAttribute(root, "RemoteProgram", remoteprogram.c_str());
+ setAttribute(root, "RemotePassword", remotepassword.c_str());
+ setAttribute(root, "RemoteHost", host.c_str());
+ setAttribute(root, "RemoteUser", user.c_str());
+ setAttribute(root, "XDMCPHost", xdmcp_host.c_str());
+ setAttribute(root, "XDMCPBroadcast", broadcast?"True":"False");
+ setAttribute(root, "XDMCPIndirect", indirect?"True":"False");
+ setAttribute(root, "Clipboard", clipboard?"True":"False");
+ setAttribute(root, "ClipboardPrimary", clipboardprimary?"True":"False");
+ setAttribute(root, "ExtraParams", extra_params.c_str());
+ setAttribute(root, "Wgl", wgl?"True":"False");
+ setAttribute(root, "DisableAC", disableac?"True":"False");
+ setAttribute(root, "XDMCPTerminate", xdmcpterminate?"True":"False");
+
+ xmlSaveFormatFileEnc(filename, doc, "UTF-8", 1);
+
+ /*free the document */
+ xmlFreeDoc(doc);
+
+ /*
+ *Free the global variables that may
+ *have been allocated by the parser.
+ */
+ xmlCleanupParser();
+}
+
+BOOL getAttribute(xmlNodePtr elem, const char *name, std::string &ret)
+{
+ char *pVal=(char*)xmlGetProp(elem,BAD_CAST name);
+ if (!pVal)
+ return false;
+ ret=pVal;
+ return true;
+}
+
+BOOL getAttributeBool(xmlNodePtr elem, const char *name, bool &ret)
+{
+ const char *pVal=(char*)xmlGetProp(elem, BAD_CAST name);
+ if (!pVal)
+ return false;
+
+ std::string str(pVal);
+
+ if (str == "True")
+ ret = true;
+ else
+ ret = false;
+ return true;
+}
+
+
+void CConfig::Load(const char *filename)
+{
+ xmlDocPtr doc = xmlReadFile(filename, NULL, 0);
+
+ xmlNodePtr root;
+
+ if (doc == NULL)
+ {
+ return;
+ }
+
+ root = xmlDocGetRootElement(doc);
+
+ std::string windowMode;
+ std::string clientMode;
+
+ if (getAttribute(root, "WindowMode", windowMode))
+ {
+ if (windowMode == "MultiWindow")
+ window = MultiWindow;
+ else if (windowMode == "Fullscreen")
+ window = Fullscreen;
+ else if (windowMode == "Windowed")
+ window = Windowed;
+ else if (windowMode == "Nodecoration")
+ window = Nodecoration;
+ }
+ if (getAttribute(root, "ClientMode", clientMode))
+ {
+ if (clientMode == "NoClient")
+ client = NoClient;
+ else if (clientMode == "StartProgram")
+ client = StartProgram;
+ else if (clientMode == "XDMCP")
+ client = XDMCP;
+ }
+
+ getAttributeBool(root, "LocalClient", local);
+ getAttribute(root, "Display", display);
+ getAttribute(root, "LocalProgram", localprogram);
+ getAttribute(root, "RemoteProgram", remoteprogram);
+ getAttribute(root, "RemotePassword", remotepassword);
+ getAttribute(root, "RemoteHost", host);
+ getAttribute(root, "RemoteUser", user);
+ getAttribute(root, "XDMCPHost", xdmcp_host);
+ getAttributeBool(root, "XDMCPBroadcast", broadcast);
+ getAttributeBool(root, "XDMCPIndirect", indirect);
+ getAttributeBool(root, "Clipboard", clipboard);
+ getAttributeBool(root, "ClipboardPrimary", clipboardprimary);
+ getAttribute(root, "ExtraParams", extra_params);
+ getAttributeBool(root, "Wgl", wgl);
+ getAttributeBool(root, "DisableAC", disableac);
+ getAttributeBool(root, "XDMCPTerminate", xdmcpterminate);
+
+ /*free the document */
+ xmlFreeDoc(doc);
+
+ /*
+ *Free the global variables that may
+ *have been allocated by the parser.
+ */
+ xmlCleanupParser();
+}
+
diff --git a/xorg-server/hw/xwin/xlaunch/config.h b/xorg-server/hw/xwin/xlaunch/config.h index f0aed3cf1..ecd22fe75 100644 --- a/xorg-server/hw/xwin/xlaunch/config.h +++ b/xorg-server/hw/xwin/xlaunch/config.h @@ -22,39 +22,68 @@ * Except as contained in this notice, the name(s) of the above copyright * holders shall not be used in advertising or otherwise to promote the sale, * use or other dealings in this Software without prior written authorization. + * + * Authors: Alexander Gottwald, Colin Harrison */ #ifndef __CONFIG_H__ #define __CONFIG_H__ +#define UNICODE +#define _UNICODE + +#define PROG_NUMBER 10 +#define HOST_NUMBER 10 +#define MAX_MESSAGE 256 +#define MAX_CAPTION 128 +#include <windows.h> #include <string> +#include <vector> struct CConfig { enum {MultiWindow, Fullscreen, Windowed, Nodecoration} window; enum {NoClient, StartProgram, XDMCP} client; bool local; std::string display; - std::string protocol; - std::string program; + std::string localprogram; + std::string remoteprogram; + bool compress; std::string host; std::string user; + std::string remotepassword; bool broadcast; bool indirect; std::string xdmcp_host; bool clipboard; + bool clipboardprimary; + bool wgl; + bool disableac; + bool xdmcpterminate; std::string extra_params; #ifdef _DEBUG - CConfig() : window(MultiWindow), client(StartProgram), local(false), display("1"), - protocol("Putty"), program("xterm"), host("lupus"), user("ago"), - broadcast(false), indirect(false), xdmcp_host("lupus"), - clipboard(true), extra_params() {}; + CConfig() : window(MultiWindow), client(NoClient), display("1"), #else - CConfig() : window(MultiWindow), client(StartProgram), local(false), display("0"), - protocol("Putty"), program("xterm"), host(""), user(""), - broadcast(true), indirect(false), xdmcp_host(""), - clipboard(true), extra_params() {}; + CConfig() : window(MultiWindow), client(NoClient), display("0"), #endif - void Load(const char* filename); - void Save(const char* filename); + local(false), + remotepassword(""), + localprogram("xcalc"), + remoteprogram("xterm"), + compress(false), + host(""), + user(""), + broadcast(false), + indirect(false), + xdmcp_host(""), + clipboard(true), + clipboardprimary(true), + extra_params(), + disableac(true), + wgl(true), + xdmcpterminate(false) + { + }; + void Load(const char * filename); + void Save(const char * filename); }; #endif diff --git a/xorg-server/hw/xwin/xlaunch/main.cc b/xorg-server/hw/xwin/xlaunch/main.cc index 2247d3aaf..0a80630f0 100644 --- a/xorg-server/hw/xwin/xlaunch/main.cc +++ b/xorg-server/hw/xwin/xlaunch/main.cc @@ -34,6 +34,8 @@ #include <X11/Xlib.h> +#include <stdlib.h> + /// @brief Send WM_ENDSESSION to all program windows. /// This will shutdown the started xserver BOOL CALLBACK KillWindowsProc(HWND hwnd, LPARAM lParam) @@ -48,7 +50,7 @@ class CMyWizard : public CWizard { public: private: - CConfig config; /// Storage for config options. + CConfig config; /// Storage for config options. public: /// @brief Constructor. /// Set wizard pages. @@ -59,307 +61,339 @@ class CMyWizard : public CWizard AddPage(IDD_PROGRAM, IDS_PROGRAM_TITLE, IDS_PROGRAM_SUBTITLE); AddPage(IDD_XDMCP, IDS_XDMCP_TITLE, IDS_XDMCP_SUBTITLE); //AddPage(IDD_FONTPATH, IDS_FONTPATH_TITLE, IDS_FONTPATH_SUBTITLE); - AddPage(IDD_CLIPBOARD, IDS_CLIPBOARD_TITLE, IDS_CLIPBOARD_SUBTITLE); + AddPage(IDD_EXTRA, IDS_EXTRA_TITLE, IDS_EXTRA_SUBTITLE); AddPage(IDD_FINISH, IDS_FINISH_TITLE, IDS_FINISH_SUBTITLE); } - virtual void LoadConfig(const char *filename) - { - try { - config.Load(filename); - } catch (std::runtime_error &e) - { - printf("Fehler: %s\n", e.what()); - } - } + virtual void LoadConfig(const char *filename) + { + try { + config.Load(filename); + } catch (std::runtime_error &e) + { + char Message[255]; + sprintf(Message,"Failure: %s\n", e.what()); + MessageBox(NULL,Message,"Exception",MB_OK); + } + } /// @brief Handle the PSN_WIZNEXT message. /// @param hwndDlg Handle to active page dialog. /// @param index Index of current page. /// @return TRUE if the message was handled. FALSE otherwise. - virtual BOOL WizardNext(HWND hwndDlg, unsigned index) - { + virtual BOOL WizardNext(HWND hwndDlg, unsigned index) + { #ifdef _DEBUG - printf("%s %d\n", __FUNCTION__, index); + printf("%s %d\n", __FUNCTION__, index); #endif - switch (PageID(index)) - { - case IDD_DISPLAY: + switch (PageID(index)) + { + case IDD_DISPLAY: // Check for select window mode - if (IsDlgButtonChecked(hwndDlg, IDC_MULTIWINDOW)) - config.window = CConfig::MultiWindow; - else if (IsDlgButtonChecked(hwndDlg, IDC_FULLSCREEN)) - config.window = CConfig::Fullscreen; - else if (IsDlgButtonChecked(hwndDlg, IDC_WINDOWED)) - config.window = CConfig::Windowed; - else if (IsDlgButtonChecked(hwndDlg, IDC_NODECORATION)) - config.window = CConfig::Nodecoration; - else - { - SetWindowLong(hwndDlg, DWL_MSGRESULT, -1); - return TRUE; - } + if (IsDlgButtonChecked(hwndDlg, IDC_MULTIWINDOW)) + config.window = CConfig::MultiWindow; + else if (IsDlgButtonChecked(hwndDlg, IDC_FULLSCREEN)) + config.window = CConfig::Fullscreen; + else if (IsDlgButtonChecked(hwndDlg, IDC_WINDOWED)) + config.window = CConfig::Windowed; + else if (IsDlgButtonChecked(hwndDlg, IDC_NODECORATION)) + config.window = CConfig::Nodecoration; + else + { + SetWindowLong(hwndDlg, DWL_MSGRESULT, -1); + return TRUE; + } // Get selected display number - { - char buffer[512]; - GetDlgItemText(hwndDlg, IDC_DISPLAY, buffer, 512); - buffer[511] = 0; - config.display = buffer; + { + char buffer[512]; + GetDlgItemText(hwndDlg, IDC_DISPLAY, buffer, 512); + buffer[511] = 0; + config.display = buffer; } // Check for valid input if (config.display.empty()) - SetWindowLong(hwndDlg, DWL_MSGRESULT, -1); + { + MessageBox(hwndDlg,"Please fill in a display number.","Error",MB_OK); + SetWindowLong(hwndDlg, DWL_MSGRESULT, -1); + } else SetWindowLong(hwndDlg, DWL_MSGRESULT, IDD_CLIENTS); - return TRUE; - case IDD_CLIENTS: + return TRUE; + case IDD_CLIENTS: // Check for select client startup method - if (IsDlgButtonChecked(hwndDlg, IDC_CLIENT)) - { - config.client = CConfig::StartProgram; - SetWindowLong(hwndDlg, DWL_MSGRESULT, IDD_PROGRAM); - } else if (IsDlgButtonChecked(hwndDlg, IDC_XDMCP)) - { - config.client = CConfig::XDMCP; - SetWindowLong(hwndDlg, DWL_MSGRESULT, IDD_XDMCP); - } else if (IsDlgButtonChecked(hwndDlg, IDC_CLIENT_NONE)) - { - config.client = CConfig::NoClient; - SetWindowLong(hwndDlg, DWL_MSGRESULT, IDD_CLIPBOARD); - } else - SetWindowLong(hwndDlg, DWL_MSGRESULT, -1); - return TRUE; - case IDD_PROGRAM: + if (IsDlgButtonChecked(hwndDlg, IDC_CLIENT)) + { + config.client = CConfig::StartProgram; + SetWindowLong(hwndDlg, DWL_MSGRESULT, IDD_PROGRAM); + } else if (IsDlgButtonChecked(hwndDlg, IDC_XDMCP)) + { + config.client = CConfig::XDMCP; + SetWindowLong(hwndDlg, DWL_MSGRESULT, IDD_XDMCP); + } else if (IsDlgButtonChecked(hwndDlg, IDC_CLIENT_NONE)) + { + config.client = CConfig::NoClient; + SetWindowLong(hwndDlg, DWL_MSGRESULT, IDD_EXTRA); + } else + SetWindowLong(hwndDlg, DWL_MSGRESULT, -1); + return TRUE; + case IDD_PROGRAM: // Check wether local or remote client should be started - if (IsDlgButtonChecked(hwndDlg, IDC_CLIENT_LOCAL)) - config.local = true; - else if (IsDlgButtonChecked(hwndDlg, IDC_CLIENT_REMOTE)) - config.local = false; - else - { - SetWindowLong(hwndDlg, DWL_MSGRESULT, -1); - return TRUE; - } + if (IsDlgButtonChecked(hwndDlg, IDC_CLIENT_LOCAL)) + config.local = true; + else if (IsDlgButtonChecked(hwndDlg, IDC_CLIENT_REMOTE)) + config.local = false; + else + { + SetWindowLong(hwndDlg, DWL_MSGRESULT, -1); + return TRUE; + } // Read program, user and host name - { - char buffer[512]; - GetDlgItemText(hwndDlg, IDC_CLIENT_USER, buffer, 512); - buffer[511] = 0; - config.user = buffer; - GetDlgItemText(hwndDlg, IDC_CLIENT_HOST, buffer, 512); - buffer[511] = 0; - config.host = buffer; - GetDlgItemText(hwndDlg, IDC_CLIENT_PROGRAM, buffer, 512); - buffer[511] = 0; - config.program = buffer; - } + { + char buffer[512]; + GetDlgItemText(hwndDlg, IDC_CLIENT_USER, buffer, 512); + buffer[511] = 0; + config.user = buffer; + GetDlgItemText(hwndDlg, IDC_CLIENT_HOST, buffer, 512); + buffer[511] = 0; + config.host = buffer; + GetDlgItemText(hwndDlg, IDC_CLIENT_PROGRAM, buffer, 512); + buffer[511] = 0; + config.localprogram = buffer; + GetDlgItemText(hwndDlg, IDC_CLIENT_REMOTEPROGRAM, buffer, 512); + buffer[511] = 0; + config.remoteprogram = buffer; + GetDlgItemText(hwndDlg, IDC_CLIENT_PASSWORD, buffer, 512); + buffer[511] = 0; + config.remotepassword = buffer; + } // Check for valid input - if (!config.local && (config.host.empty() || config.program.empty())) - SetWindowLong(hwndDlg, DWL_MSGRESULT, -1); - else - SetWindowLong(hwndDlg, DWL_MSGRESULT, IDD_CLIPBOARD); - return TRUE; - case IDD_XDMCP: + if (!config.local && (config.host.empty() || config.localprogram.empty() || config.remoteprogram.empty())) + SetWindowLong(hwndDlg, DWL_MSGRESULT, -1); + else + SetWindowLong(hwndDlg, DWL_MSGRESULT, IDD_EXTRA); + return TRUE; + case IDD_XDMCP: // Check for broadcast - if (IsDlgButtonChecked(hwndDlg, IDC_XDMCP_BROADCAST)) - config.broadcast = true; - else if (IsDlgButtonChecked(hwndDlg, IDC_XDMCP_QUERY)) - config.broadcast = false; - else - { - SetWindowLong(hwndDlg, DWL_MSGRESULT, -1); - return TRUE; - } + if (IsDlgButtonChecked(hwndDlg, IDC_XDMCP_BROADCAST)) + config.broadcast = true; + else if (IsDlgButtonChecked(hwndDlg, IDC_XDMCP_QUERY)) + config.broadcast = false; + else + { + SetWindowLong(hwndDlg, DWL_MSGRESULT, -1); + return TRUE; + } // Check for indirect mode - if (IsDlgButtonChecked(hwndDlg, IDC_XDMCP_INDIRECT)) - config.indirect = true; - else - config.indirect = false; + if (IsDlgButtonChecked(hwndDlg, IDC_XDMCP_INDIRECT)) + config.indirect = true; + else + config.indirect = false; // Read hostname - { - char buffer[512]; - GetDlgItemText(hwndDlg, IDC_XDMCP_HOST, buffer, 512); - buffer[511] = 0; - config.xdmcp_host = buffer; - } + { + char buffer[512]; + GetDlgItemText(hwndDlg, IDC_XDMCP_HOST, buffer, 512); + buffer[511] = 0; + config.xdmcp_host = buffer; + } // Check for valid input - if (!config.broadcast && config.xdmcp_host.empty()) - SetWindowLong(hwndDlg, DWL_MSGRESULT, -1); - else - SetWindowLong(hwndDlg, DWL_MSGRESULT, IDD_CLIPBOARD); - return TRUE; - case IDD_CLIPBOARD: + if (!config.broadcast && config.xdmcp_host.empty()) + SetWindowLong(hwndDlg, DWL_MSGRESULT, -1); + else + SetWindowLong(hwndDlg, DWL_MSGRESULT, IDD_EXTRA); + if (IsDlgButtonChecked(hwndDlg, IDC_XDMCP_TERMINATE)) + config.xdmcpterminate = true; + else + config.xdmcpterminate = false; + return TRUE; + case IDD_EXTRA: // check for clipboard if (IsDlgButtonChecked(hwndDlg, IDC_CLIPBOARD)) config.clipboard = true; else config.clipboard = false; + // check for clipboard primary selection + if (IsDlgButtonChecked(hwndDlg, IDC_CLIPBOARDPRIMARY)) + config.clipboardprimary = true; + else + config.clipboardprimary = false; + // check for wgl + if (IsDlgButtonChecked(hwndDlg, IDC_WGL)) + config.wgl = true; + else + config.wgl = false; + // check for access control + if (IsDlgButtonChecked(hwndDlg, IDC_DISABLEAC)) + config.disableac = true; + else + config.disableac = false; // read parameters - { - char buffer[512]; - GetDlgItemText(hwndDlg, IDC_EXTRA_PARAMS, buffer, 512); - buffer[511] = 0; - config.extra_params = buffer; - } + { + char buffer[512]; + GetDlgItemText(hwndDlg, IDC_EXTRA_PARAMS, buffer, 512); + buffer[511] = 0; + config.extra_params = buffer; + } SetWindowLong(hwndDlg, DWL_MSGRESULT, IDD_FINISH); return TRUE; - default: - break; - } - return FALSE; - } + default: + break; + } + return FALSE; + } /// @brief Handle PSN_WIZFINISH message. /// @param hwndDlg Handle to active page dialog. /// @param index Index of current page. /// @return TRUE if the message was handled. FALSE otherwise. - virtual BOOL WizardFinish(HWND hwndDlg, unsigned index) - { + virtual BOOL WizardFinish(HWND hwndDlg, unsigned index) + { #ifdef _DEBUG - printf("finish %d\n", index); + printf("finish %d\n", index); #endif - return FALSE; - } + return FALSE; + } /// @brief Handle PSN_WIZBACK message. /// Basicly handles switching to proper page (skipping XDMCP or program page /// if required). /// @param hwndDlg Handle to active page dialog. /// @param index Index of current page. /// @return TRUE if the message was handled. FALSE otherwise. - virtual BOOL WizardBack(HWND hwndDlg, unsigned index) - { - switch (PageID(index)) - { - case IDD_PROGRAM: - case IDD_XDMCP: - SetWindowLong(hwndDlg, DWL_MSGRESULT, IDD_CLIENTS); - return TRUE; - case IDD_FONTPATH: - case IDD_CLIPBOARD: // temporary. fontpath is disabled - switch (config.client) - { - case CConfig::NoClient: - SetWindowLong(hwndDlg, DWL_MSGRESULT, IDD_CLIENTS); - return TRUE; - case CConfig::StartProgram: - SetWindowLong(hwndDlg, DWL_MSGRESULT, IDD_PROGRAM); - return TRUE; - case CConfig::XDMCP: - SetWindowLong(hwndDlg, DWL_MSGRESULT, IDD_XDMCP); - return TRUE; - } - break; - } - return FALSE; - } + virtual BOOL WizardBack(HWND hwndDlg, unsigned index) + { + switch (PageID(index)) + { + case IDD_PROGRAM: + case IDD_XDMCP: + SetWindowLong(hwndDlg, DWL_MSGRESULT, IDD_CLIENTS); + return TRUE; + case IDD_FONTPATH: + case IDD_EXTRA: // temporary. fontpath is disabled + switch (config.client) + { + case CConfig::NoClient: + SetWindowLong(hwndDlg, DWL_MSGRESULT, IDD_CLIENTS); + return TRUE; + case CConfig::StartProgram: + SetWindowLong(hwndDlg, DWL_MSGRESULT, IDD_PROGRAM); + return TRUE; + case CConfig::XDMCP: + SetWindowLong(hwndDlg, DWL_MSGRESULT, IDD_XDMCP); + return TRUE; + } + break; + } + return FALSE; + } /// @brief Handle PSN_SETACTIVE message. /// @param hwndDlg Handle to active page dialog. /// @param index Index of current page. /// @return TRUE if the message was handled. FALSE otherwise. - virtual BOOL WizardActivate(HWND hwndDlg, unsigned index) - { + virtual BOOL WizardActivate(HWND hwndDlg, unsigned index) + { #ifdef _DEBUG - printf("%s %d\n", __FUNCTION__, index); + printf("%s %d\n", __FUNCTION__, index); #endif - switch (PageID(index)) - { - case IDD_CLIENTS: + switch (PageID(index)) + { + case IDD_CLIENTS: // Enable or disable XDMCP radiobutton and text - EnableWindow(GetDlgItem(hwndDlg, IDC_XDMCP), config.window != CConfig::MultiWindow); - EnableWindow(GetDlgItem(hwndDlg, IDC_XDMCP_DESC), config.window != CConfig::MultiWindow); - break; - } - return FALSE; - } + if (config.window != CConfig::MultiWindow) + { + EnableWindow(GetDlgItem(hwndDlg, IDC_XDMCP), true); + EnableWindow(GetDlgItem(hwndDlg, IDC_XDMCP_DESC), true); + } + else + { + if (IsDlgButtonChecked(hwndDlg, IDC_XDMCP)) + CheckRadioButton(hwndDlg, IDC_CLIENT_NONE, IDC_CLIENT, IDC_CLIENT_NONE); + EnableWindow(GetDlgItem(hwndDlg, IDC_XDMCP), false); + EnableWindow(GetDlgItem(hwndDlg, IDC_XDMCP_DESC), false); + } + break; + } + return FALSE; + } protected: /// @brief Enable or disable the control for remote clients. /// @param hwndDlg Handle to active page dialog. /// @param state State of control group. - void EnableRemoteProgramGroup(HWND hwndDlg, BOOL state) - { - EnableWindow(GetDlgItem(hwndDlg, IDC_CLIENT_PROTOCOL), state); - EnableWindow(GetDlgItem(hwndDlg, IDC_CLIENT_HOST), state); - EnableWindow(GetDlgItem(hwndDlg, IDC_CLIENT_USER), state); - EnableWindow(GetDlgItem(hwndDlg, IDC_CLIENT_PROTOCOL_DESC), state); - EnableWindow(GetDlgItem(hwndDlg, IDC_CLIENT_HOST_DESC), state); - EnableWindow(GetDlgItem(hwndDlg, IDC_CLIENT_USER_DESC), state); - } + void EnableRemoteProgramGroup(HWND hwndDlg, BOOL state) + { + EnableWindow(GetDlgItem(hwndDlg, IDC_CLIENT_PASSWORD), state); + EnableWindow(GetDlgItem(hwndDlg, IDC_CLIENT_HOST), state); + EnableWindow(GetDlgItem(hwndDlg, IDC_CLIENT_USER), state); + EnableWindow(GetDlgItem(hwndDlg, IDC_CLIENT_PASSWORD_DESC), state); + EnableWindow(GetDlgItem(hwndDlg, IDC_CLIENT_HOST_DESC), state); + EnableWindow(GetDlgItem(hwndDlg, IDC_CLIENT_USER_DESC), state); + EnableWindow(GetDlgItem(hwndDlg, IDC_CLIENT_REMOTEPROGRAM), state); + EnableWindow(GetDlgItem(hwndDlg, IDC_CLIENT_REMOTEPROGRAM_DESC), state); + EnableWindow(GetDlgItem(hwndDlg, IDC_CLIENT_PROGRAM), !state); + EnableWindow(GetDlgItem(hwndDlg, IDC_CLIENT_PROGRAM_DESC), !state); + } /// @brief Enable or disable the control for XDMCP connection. /// @param hwndDlg Handle to active page dialog. /// @param state State of control group. - void EnableXDMCPQueryGroup(HWND hwndDlg, BOOL state) - { - EnableWindow(GetDlgItem(hwndDlg, IDC_XDMCP_HOST), state); - EnableWindow(GetDlgItem(hwndDlg, IDC_XDMCP_INDIRECT), state); - } + void EnableXDMCPQueryGroup(HWND hwndDlg, BOOL state) + { + EnableWindow(GetDlgItem(hwndDlg, IDC_XDMCP_HOST), state); + EnableWindow(GetDlgItem(hwndDlg, IDC_XDMCP_INDIRECT), state); + } /// @brief Fill program box with default values. /// @param hwndDlg Handle to active page dialog. - void FillProgramBox(HWND hwndDlg) - { - HWND cbwnd = GetDlgItem(hwndDlg, IDC_CLIENT_PROGRAM); - if (cbwnd == NULL) - return; - SendMessage(cbwnd, CB_RESETCONTENT, 0, 0); - SendMessage(cbwnd, CB_ADDSTRING, 0, (LPARAM) "xterm"); - SendMessage(cbwnd, CB_ADDSTRING, 0, (LPARAM) "startkde"); - SendMessage(cbwnd, CB_ADDSTRING, 0, (LPARAM) "gnome-session"); - SendMessage(cbwnd, CB_ADDSTRING, 0, (LPARAM) ".xinitrc"); - SendMessage(cbwnd, CB_ADDSTRING, 0, (LPARAM) "wmaker"); - SendMessage(cbwnd, CB_SETCURSEL, 0, 0); - } - /// @brief Fill protocol box with default values. - /// @param hwndDlg Handle to active page dialog. - void FillProtocolBox(HWND hwndDlg) - { - HWND cbwnd = GetDlgItem(hwndDlg, IDC_CLIENT_PROTOCOL); - if (cbwnd == NULL) - return; - SendMessage(cbwnd, CB_RESETCONTENT, 0, 0); - SendMessage(cbwnd, CB_ADDSTRING, 0, (LPARAM) "Putty"); - //SendMessage(cbwnd, CB_ADDSTRING, 0, (LPARAM) "OpenSSH"); - SendMessage(cbwnd, CB_SETCURSEL, 0, 0); - } - void ShowSaveDialog(HWND parent) - { - char szTitle[512]; - char szFilter[512]; - char szFileTitle[512]; - char szFile[MAX_PATH]; - HINSTANCE hInst = GetModuleHandle(NULL); - - LoadString(hInst, IDS_SAVE_TITLE, szTitle, sizeof(szTitle)); - LoadString(hInst, IDS_SAVE_FILETITLE, szFileTitle, sizeof(szFileTitle)); - LoadString(hInst, IDS_SAVE_FILTER, szFilter, sizeof(szFilter)); - for (unsigned i=0; szFilter[i]; i++) - if (szFilter[i] == '%') - szFilter[i] = '\0'; - - strcpy(szFile, "config.xlaunch"); - - OPENFILENAME ofn; - memset(&ofn, 0, sizeof(OPENFILENAME)); - ofn.lStructSize = sizeof(OPENFILENAME); - ofn.hwndOwner = parent; - ofn.lpstrFilter = szFilter; - ofn.lpstrFile= szFile; - ofn.nMaxFile = sizeof(szFile)/ sizeof(*szFile); - ofn.lpstrFileTitle = szFileTitle; - ofn.nMaxFileTitle = sizeof(szFileTitle); - ofn.lpstrInitialDir = (LPSTR)NULL; - ofn.Flags = OFN_SHOWHELP | OFN_OVERWRITEPROMPT; - ofn.lpstrTitle = szTitle; - - if (GetSaveFileName(&ofn)) - { - try { - config.Save(ofn.lpstrFile); - } catch (std::runtime_error &e) - { - printf("Fehler: %s\n", e.what()); - } - } - } + void FillProgramBox(HWND hwndDlg) + { + HWND cbwnd = GetDlgItem(hwndDlg, IDC_CLIENT_PROGRAM); + if (cbwnd == NULL) + return; + SendMessage(cbwnd, CB_RESETCONTENT, 0, 0); + SendMessage(cbwnd, CB_ADDSTRING, 0, (LPARAM) "xcalc"); + SendMessage(cbwnd, CB_ADDSTRING, 0, (LPARAM) "xclock"); + SendMessage(cbwnd, CB_ADDSTRING, 0, (LPARAM) "xwininfo"); + SendMessage(cbwnd, CB_SETCURSEL, 0, 0); + } + void ShowSaveDialog(HWND parent) + { + char szTitle[512]; + char szFilter[512]; + char szFileTitle[512]; + char szFile[MAX_PATH]; + HINSTANCE hInst = GetModuleHandle(NULL); + + LoadString(hInst, IDS_SAVE_TITLE, szTitle, sizeof(szTitle)); + LoadString(hInst, IDS_SAVE_FILETITLE, szFileTitle, sizeof(szFileTitle)); + LoadString(hInst, IDS_SAVE_FILTER, szFilter, sizeof(szFilter)); + for (unsigned i=0; szFilter[i]; i++) + if (szFilter[i] == '%') + szFilter[i] = '\0'; + + strcpy(szFile, "config.xlaunch"); + + OPENFILENAME ofn; + memset(&ofn, 0, sizeof(OPENFILENAME)); + ofn.lStructSize = sizeof(OPENFILENAME); + ofn.hwndOwner = parent; + ofn.lpstrFilter = szFilter; + ofn.lpstrFile= szFile; + ofn.nMaxFile = sizeof(szFile)/ sizeof(*szFile); + ofn.lpstrFileTitle = szFileTitle; + ofn.nMaxFileTitle = sizeof(szFileTitle); + ofn.lpstrInitialDir = (LPSTR)NULL; + ofn.Flags = OFN_SHOWHELP | OFN_OVERWRITEPROMPT; + ofn.lpstrTitle = szTitle; + + if (GetSaveFileName(&ofn)) + { + try { + config.Save(ofn.lpstrFile); + } catch (std::runtime_error &e) + { + char Message[255]; + sprintf(Message,"Failure: %s\n", e.what()); + MessageBox(NULL,Message,"Exception",MB_OK); + } + } + } public: - + /// @brief Handle messages fo the dialog pages. /// @param hwndDlg Handle of active dialog. /// @param uMsg Message code. @@ -376,64 +410,70 @@ class CMyWizard : public CWizard { case IDD_DISPLAY: // Init display dialog. Enable correct check buttons - switch (config.window) - { - default: - case CConfig::MultiWindow: - CheckRadioButton(hwndDlg, IDC_MULTIWINDOW, IDC_NODECORATION, IDC_MULTIWINDOW); - break; - case CConfig::Fullscreen: - CheckRadioButton(hwndDlg, IDC_MULTIWINDOW, IDC_NODECORATION, IDC_FULLSCREEN); - break; - case CConfig::Windowed: - CheckRadioButton(hwndDlg, IDC_MULTIWINDOW, IDC_NODECORATION, IDC_WINDOWED); - break; - case CConfig::Nodecoration: - CheckRadioButton(hwndDlg, IDC_MULTIWINDOW, IDC_NODECORATION, IDC_NODECORATION); - break; - } + switch (config.window) + { + default: + case CConfig::MultiWindow: + CheckRadioButton(hwndDlg, IDC_MULTIWINDOW, IDC_NODECORATION, IDC_MULTIWINDOW); + break; + case CConfig::Fullscreen: + CheckRadioButton(hwndDlg, IDC_MULTIWINDOW, IDC_NODECORATION, IDC_FULLSCREEN); + break; + case CConfig::Windowed: + CheckRadioButton(hwndDlg, IDC_MULTIWINDOW, IDC_NODECORATION, IDC_WINDOWED); + break; + case CConfig::Nodecoration: + CheckRadioButton(hwndDlg, IDC_MULTIWINDOW, IDC_NODECORATION, IDC_NODECORATION); + break; + } // Set display number SetDlgItemText(hwndDlg, IDC_DISPLAY, config.display.c_str()); break; case IDD_CLIENTS: // Init client dialog. Enable correct check buttons - switch (config.client) - { - default: - case CConfig::NoClient: - CheckRadioButton(hwndDlg, IDC_CLIENT_NONE, IDC_CLIENT, IDC_CLIENT_NONE); - break; - case CConfig::StartProgram: - CheckRadioButton(hwndDlg, IDC_CLIENT_NONE, IDC_CLIENT, IDC_CLIENT); - break; - case CConfig::XDMCP: - CheckRadioButton(hwndDlg, IDC_CLIENT_NONE, IDC_CLIENT, IDC_XDMCP); - break; - } + switch (config.client) + { + default: + case CConfig::NoClient: + CheckRadioButton(hwndDlg, IDC_CLIENT_NONE, IDC_CLIENT, IDC_CLIENT_NONE); + break; + case CConfig::StartProgram: + CheckRadioButton(hwndDlg, IDC_CLIENT_NONE, IDC_CLIENT, IDC_CLIENT); + break; + case CConfig::XDMCP: + CheckRadioButton(hwndDlg, IDC_CLIENT_NONE, IDC_CLIENT, IDC_XDMCP); + break; + } break; - case IDD_PROGRAM: + case IDD_PROGRAM: // Init program dialog. Check local and remote buttons CheckRadioButton(hwndDlg, IDC_CLIENT_LOCAL, IDC_CLIENT_REMOTE, config.local?IDC_CLIENT_LOCAL:IDC_CLIENT_REMOTE); - EnableRemoteProgramGroup(hwndDlg, config.local?FALSE:TRUE); + EnableRemoteProgramGroup(hwndDlg, config.local?FALSE:TRUE); // Fill combo boxes - FillProgramBox(hwndDlg); - FillProtocolBox(hwndDlg); + FillProgramBox(hwndDlg); // Set edit fields - if (!config.program.empty()) - SetDlgItemText(hwndDlg, IDC_CLIENT_PROGRAM, config.program.c_str()); - SetDlgItemText(hwndDlg, IDC_CLIENT_USER, config.user.c_str()); - SetDlgItemText(hwndDlg, IDC_CLIENT_HOST, config.host.c_str()); - break; - case IDD_XDMCP: + if (!config.localprogram.empty()) + SetDlgItemText(hwndDlg, IDC_CLIENT_PROGRAM, config.localprogram.c_str()); + if (!config.remoteprogram.empty()) + SetDlgItemText(hwndDlg, IDC_CLIENT_REMOTEPROGRAM, config.remoteprogram.c_str()); + SetDlgItemText(hwndDlg, IDC_CLIENT_USER, config.user.c_str()); + SetDlgItemText(hwndDlg, IDC_CLIENT_HOST, config.host.c_str()); + SetDlgItemText(hwndDlg, IDC_CLIENT_PASSWORD, config.remotepassword.c_str()); + break; + case IDD_XDMCP: // Init XDMCP dialog. Check broadcast and indirect button CheckRadioButton(hwndDlg, IDC_XDMCP_QUERY, IDC_XDMCP_BROADCAST, config.broadcast?IDC_XDMCP_BROADCAST:IDC_XDMCP_QUERY); CheckDlgButton(hwndDlg, IDC_XDMCP_INDIRECT, config.indirect?BST_CHECKED:BST_UNCHECKED); - EnableXDMCPQueryGroup(hwndDlg, config.broadcast?FALSE:TRUE); + EnableXDMCPQueryGroup(hwndDlg, config.broadcast?FALSE:TRUE); // Set hostname - SetDlgItemText(hwndDlg, IDC_XDMCP_HOST, config.xdmcp_host.c_str()); - break; - case IDD_CLIPBOARD: + SetDlgItemText(hwndDlg, IDC_XDMCP_HOST, config.xdmcp_host.c_str()); + CheckDlgButton(hwndDlg, IDC_XDMCP_TERMINATE, config.xdmcpterminate?BST_CHECKED:BST_UNCHECKED); + break; + case IDD_EXTRA: CheckDlgButton(hwndDlg, IDC_CLIPBOARD, config.clipboard?BST_CHECKED:BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_CLIPBOARDPRIMARY, config.clipboardprimary?BST_CHECKED:BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_WGL, config.wgl?BST_CHECKED:BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_DISABLEAC, config.disableac?BST_CHECKED:BST_UNCHECKED); SetDlgItemText(hwndDlg, IDC_EXTRA_PARAMS, config.extra_params.c_str()); break; @@ -453,15 +493,15 @@ class CMyWizard : public CWizard // Disable unavailable controls case IDC_CLIENT_REMOTE: case IDC_CLIENT_LOCAL: - EnableRemoteProgramGroup(hwndDlg, LOWORD(wParam) == IDC_CLIENT_REMOTE); + EnableRemoteProgramGroup(hwndDlg, LOWORD(wParam) == IDC_CLIENT_REMOTE); + break; + case IDC_XDMCP_QUERY: + case IDC_XDMCP_BROADCAST: + EnableXDMCPQueryGroup(hwndDlg, LOWORD(wParam) == IDC_XDMCP_QUERY); + break; + case IDC_FINISH_SAVE: + ShowSaveDialog(hwndDlg); break; - case IDC_XDMCP_QUERY: - case IDC_XDMCP_BROADCAST: - EnableXDMCPQueryGroup(hwndDlg, LOWORD(wParam) == IDC_XDMCP_QUERY); - break; - case IDC_FINISH_SAVE: - ShowSaveDialog(hwndDlg); - break; } } // pass messages to parent @@ -489,54 +529,57 @@ class CMyWizard : public CWizard return NULL; } - /// @brief Do the actual start of Xming and clients - void StartUp() - { - std::string buffer; - std::string client; + /// @brief Do the actual start of VCXsrv and clients + void StartUp() + { + std::string buffer; + std::string client; // Construct display strings - std::string display_id = ":" + config.display; - std::string display = "localhost" + display_id + ":0"; - -#ifdef _DEBUG - // Debug only: Switch to Xming installation directory - SetCurrentDirectory("C:\\Programme\\Xming"); -#endif + std::string display_id = ":" + config.display; + std::string display = "DISPLAY=127.0.0.1" + display_id + ".0"; - // Build Xming commandline - buffer = "Xming " + display_id + " "; - switch (config.window) - { - case CConfig::MultiWindow: - buffer += "-multiwindow "; - break; - case CConfig::Fullscreen: - buffer += "-fullscreen "; - break; - case CConfig::Nodecoration: - buffer += "-nodecoration "; - break; - default: - break; - } + // Build Xsrv commandline + buffer = "vcxsrv " + display_id + " "; + switch (config.window) + { + case CConfig::MultiWindow: + buffer += "-multiwindow "; + break; + case CConfig::Fullscreen: + buffer += "-fullscreen "; + break; + case CConfig::Nodecoration: + buffer += "-nodecoration "; + break; + default: + break; + } // Add XDMCP parameter - if (config.client == CConfig::XDMCP) - { - if (config.broadcast) - buffer += "-broadcast "; - else - { - if (config.indirect) - buffer += "-indirect "; - else - buffer += "-query "; - buffer += config.xdmcp_host; - buffer += " "; - } - } + if (config.client == CConfig::XDMCP) + { + if (config.broadcast) + buffer += "-broadcast "; + else + { + if (config.indirect) + buffer += "-indirect "; + else + buffer += "-query "; + buffer += config.xdmcp_host; + buffer += " "; + } + if (config.xdmcpterminate) + buffer += "-terminate "; + } if (config.clipboard) buffer += "-clipboard "; + if (!config.clipboardprimary) + buffer += "-noclipboardprimary "; + if (config.wgl) + buffer += "-wgl "; + if (config.disableac) + buffer += "-ac "; if (!config.extra_params.empty()) { buffer += config.extra_params; @@ -544,52 +587,57 @@ class CMyWizard : public CWizard } // Construct client commandline - if (config.client == CConfig::StartProgram) - { - if (!config.local) - { - char cmdline[512]; + if (config.client == CConfig::StartProgram) + { + if (!config.local) + { + char cmdline[512]; std::string host = config.host; + std::string remotepassword; if (!config.user.empty()) host = config.user + "@" + config.host; - if (config.protocol == "Putty") - snprintf(cmdline,512,"plink -X %s %s", - host.c_str(),config.program.c_str()); - else - snprintf(cmdline,512,"ssh -Y %s %s", - host.c_str(),config.program.c_str()); - client += cmdline; - } else - client += config.program.c_str(); - } + if (!config.remotepassword.empty()) + remotepassword=std::string(" -pw ")+config.remotepassword; + _snprintf(cmdline,512,"plink -ssh -X%s %s %s", + remotepassword.c_str(), host.c_str(),config.remoteprogram.c_str()); + client += cmdline; + } + else + { + client += config.localprogram.c_str(); + } + } // Prepare program startup - STARTUPINFO si, sic; - PROCESS_INFORMATION pi, pic; - HANDLE handles[2]; - DWORD hcount = 0; + STARTUPINFO si, sic; + PROCESS_INFORMATION pi, pic; + HANDLE handles[2]; + DWORD hcount = 0; Display *dpy = NULL; - ZeroMemory( &si, sizeof(si) ); - si.cb = sizeof(si); - ZeroMemory( &pi, sizeof(pi) ); - ZeroMemory( &sic, sizeof(sic) ); - sic.cb = sizeof(sic); - ZeroMemory( &pic, sizeof(pic) ); + ZeroMemory( &si, sizeof(si) ); + si.cb = sizeof(si); + ZeroMemory( &pi, sizeof(pi) ); + ZeroMemory( &sic, sizeof(sic) ); + sic.cb = sizeof(sic); + ZeroMemory( &pic, sizeof(pic) ); - // Start Xming process. + // Start VCXsrv process. #ifdef _DEBUG - printf("%s\n", buffer.c_str()); + printf("%s\n", buffer.c_str()); #endif - if( !CreateProcess( NULL, (CHAR*)buffer.c_str(), NULL, NULL, - FALSE, 0, NULL, NULL, &si, &pi )) - throw win32_error("CreateProcess failed"); - handles[hcount++] = pi.hProcess; - - if (!client.empty()) - { + char CurDir[MAX_PATH]; + GetModuleFileName(NULL,CurDir,MAX_PATH); + *strrchr(CurDir,'\\')=0; + if( !CreateProcess( NULL, (CHAR*)buffer.c_str(), NULL, NULL, + FALSE, 0, NULL, CurDir, &si, &pi )) + throw win32_error("CreateProcess failed"); + handles[hcount++] = pi.hProcess; + + if (!client.empty()) + { // Set DISPLAY variable - SetEnvironmentVariable("DISPLAY",display.c_str()); + _putenv(display.c_str()); // Wait for server to startup dpy = WaitForServer(pi.hProcess); @@ -597,59 +645,62 @@ class CMyWizard : public CWizard { while (hcount--) TerminateProcess(handles[hcount], (DWORD)-1); - throw std::runtime_error("Connection to server failed"); + throw std::runtime_error("Connection to server failed"); } #ifdef _DEBUG - printf("%s\n", client.c_str()); + printf("%s\n", client.c_str()); #endif // Hide a console window // FIXME: This may make it impossible to enter the password - sic.dwFlags = STARTF_USESHOWWINDOW; - sic.wShowWindow = SW_HIDE; - - // Start the child process. - if( !CreateProcess( NULL, (CHAR*)client.c_str(), NULL, NULL, - FALSE, 0, NULL, NULL, &sic, &pic )) - { + sic.dwFlags = STARTF_USESHOWWINDOW; + sic.wShowWindow = SW_HIDE; + + // Start the child process. + if( !CreateProcess( NULL, (CHAR*)client.c_str(), NULL, NULL, + FALSE, 0, NULL, CurDir, &sic, &pic )) + { DWORD err = GetLastError(); while (hcount--) TerminateProcess(handles[hcount], (DWORD)-1); - throw win32_error("CreateProcess failed", err); - } - handles[hcount++] = pic.hProcess; - } + throw win32_error("CreateProcess failed", err); + } + handles[hcount++] = pic.hProcess; + } - // Wait until any child process exits. - DWORD ret = WaitForMultipleObjects(hcount, handles, FALSE, INFINITE ); + // Wait until any child process exits. + DWORD ret = WaitForMultipleObjects(hcount, handles, FALSE, INFINITE ); #ifdef _DEBUG - printf("killing process!\n"); + printf("killing process!\n"); #endif - // Check if Xming is still running - DWORD exitcode; - GetExitCodeProcess(pi.hProcess, &exitcode); - unsigned counter = 0; - while (exitcode == STILL_ACTIVE) - { - if (++counter > 10) - TerminateProcess(pi.hProcess, (DWORD)-1); - else - // Shutdown Xming (the soft way!) - EnumThreadWindows(pi.dwThreadId, KillWindowsProc, 0); - Sleep(500); - GetExitCodeProcess(pi.hProcess, &exitcode); - } - // Kill the client - TerminateProcess(pic.hProcess, (DWORD)-1); + // Check if Xsrv is still running, but only when we started a local program + if (config.local) + { + DWORD exitcode; + GetExitCodeProcess(pi.hProcess, &exitcode); + unsigned counter = 0; + while (exitcode == STILL_ACTIVE) + { + if (++counter > 10) + TerminateProcess(pi.hProcess, (DWORD)-1); + else + // Shutdown Xsrv (the soft way!) + EnumThreadWindows(pi.dwThreadId, KillWindowsProc, 0); + Sleep(500); + GetExitCodeProcess(pi.hProcess, &exitcode); + } + // Kill the client + TerminateProcess(pic.hProcess, (DWORD)-1); + } - // Close process and thread handles. - CloseHandle( pi.hProcess ); - CloseHandle( pi.hThread ); - CloseHandle( pic.hProcess ); - CloseHandle( pic.hThread ); - } + // Close process and thread handles. + CloseHandle( pi.hProcess ); + CloseHandle( pi.hThread ); + CloseHandle( pic.hProcess ); + CloseHandle( pic.hThread ); + } }; int main(int argc, char **argv) @@ -658,39 +709,41 @@ int main(int argc, char **argv) InitCommonControls(); CMyWizard dialog; - bool skip_wizard = false; + bool skip_wizard = false; - for (int i = 1; i < argc; i++) - { - if (argv[i] == NULL) - continue; - - std::string arg(argv[i]); - if (arg == "-load" && i + 1 < argc) - { - i++; - dialog.LoadConfig(argv[i]); - continue; - } - if (arg == "-run" && i + 1 < argc) - { - i++; - dialog.LoadConfig(argv[i]); - skip_wizard = true; - continue; - } - } + for (int i = 1; i < argc; i++) + { + if (argv[i] == NULL) + continue; + + std::string arg(argv[i]); + if (arg == "-load" && i + 1 < argc) + { + i++; + dialog.LoadConfig(argv[i]); + continue; + } + if (arg == "-run" && i + 1 < argc) + { + i++; + dialog.LoadConfig(argv[i]); + skip_wizard = true; + continue; + } + } - int ret = 0; + int ret = 0; if (skip_wizard || (ret =dialog.ShowModal()) != 0) - dialog.StartUp(); + dialog.StartUp(); #ifdef _DEBUG - printf("return %d\n", ret); + printf("return %d\n", ret); #endif - return 0; + return 0; } catch (std::runtime_error &e) { - printf("Fehler: %s\n", e.what()); + char Message[255]; + sprintf(Message,"Failure: %s\n", e.what()); + MessageBox(NULL,Message,"Exception",MB_OK); return -1; } } diff --git a/xorg-server/hw/xwin/xlaunch/makefile b/xorg-server/hw/xwin/xlaunch/makefile new file mode 100644 index 000000000..b97d7ecb6 --- /dev/null +++ b/xorg-server/hw/xwin/xlaunch/makefile @@ -0,0 +1,36 @@ +INCLUDELIBFILES = window\$(OBJDIR)\window.lib \
+ $(MHMAKECONF)\libx11\src\$(OBJDIR)\libx11.lib \
+ $(MHMAKECONF)\libxcb\src\$(OBJDIR)\libxcb.lib \
+ $(MHMAKECONF)\libxau\$(OBJDIR)\libxau.lib \
+ $(MHMAKECONF)\libx11\src\xlibi18n\$(OBJDIR)\libi18n.lib \
+ $(MHMAKECONF)\libx11\modules\lc\xlocale\$(OBJDIR)\libxlocale.lib \
+ $(MHMAKECONF)\libx11\modules\lc\utf8\$(OBJDIR)\libxlcUTF8Load.lib \
+ $(MHMAKECONF)\libx11\modules\lc\gen\$(OBJDIR)\liblcGenConvLoad.lib \
+ $(MHMAKECONF)\libx11\modules\lc\def\$(OBJDIR)\libxlcDef.lib \
+ $(MHMAKECONF)\libx11\src\xkb\$(OBJDIR)\libxkb.lib \
+ $(MHMAKECONF)\libx11\modules\im\ximcp\$(OBJDIR)\libximcp.lib \
+ $(MHMAKECONF)\libx11\modules\om\generic\$(OBJDIR)\libxomGeneric.lib
+
+CSRCS=config.cc main.cc
+
+INCLUDES += $(MHMAKECONF)\libxml2\include
+
+WINAPP = xlaunch
+
+RESOURCES = resources.rc
+
+$(OBJDIR)\%.res : resources\%.rc $(wildcard resources\*.rc)
+ $(RC) $(RCFLAGS) $(RCDEFINES:%=-d "%") $(RCINCLUDES:%=-i %) -Fo$(relpath $@) $<
+
+LIBDIRS=$(dir $(INCLUDELIBFILES))
+
+load_makefile $(LIBDIRS:%$(OBJDIR)\=%makefile MAKESERVER=$(MAKESERVER) DEBUG=$(DEBUG);)
+
+LINKLIBS += $(MHMAKECONF)\libxml2\lib\libxml2.lib
+
+ifeq ($(DEBUG),1)
+LINKLIBS += $(MHMAKECONF)\pthreads\pthreadVC2d.lib
+else
+LINKLIBS += $(MHMAKECONF)\pthreads\pthreadVC2.lib
+endif
+
diff --git a/xorg-server/hw/xwin/xlaunch/resources/dialog.rc b/xorg-server/hw/xwin/xlaunch/resources/dialog.rc index 8b00df4ef..d7f1aa46f 100644 --- a/xorg-server/hw/xwin/xlaunch/resources/dialog.rc +++ b/xorg-server/hw/xwin/xlaunch/resources/dialog.rc @@ -68,19 +68,25 @@ STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSM CAPTION STR_CAPTION_PROGRAM FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN - LTEXT STR_CLIENT_PROGRAM_DESC,IDC_CLIENT_PROGRAM_DESC,7,14,64,10 - COMBOBOX IDC_CLIENT_PROGRAM,70,12,64,54,CBS_DROPDOWN | WS_VSCROLL + AUTORADIOBUTTON STR_CLIENT_LOCAL,IDC_CLIENT_LOCAL,7,14,300,10 + AUTORADIOBUTTON STR_CLIENT_REMOTE,IDC_CLIENT_REMOTE,7,50,300,10 - AUTORADIOBUTTON STR_CLIENT_LOCAL,IDC_CLIENT_LOCAL,7,28,300,10 - AUTORADIOBUTTON STR_CLIENT_REMOTE,IDC_CLIENT_REMOTE,7,42,300,10 + LTEXT STR_CLIENT_PROGRAM_DESC,IDC_CLIENT_PROGRAM_DESC,19,28,64,10 + COMBOBOX IDC_CLIENT_PROGRAM,100,26,64,54,CBS_DROPDOWN | WS_VSCROLL + + + LTEXT STR_CLIENT_REMOTEPROGRAM_DESC,IDC_CLIENT_REMOTEPROGRAM_DESC,19,64,70,10 + EDITTEXT IDC_CLIENT_REMOTEPROGRAM,100,62,200,12, WS_BORDER | WS_TABSTOP | ES_AUTOHSCROLL + + LTEXT STR_CLIENT_PASSWORD_DESC,IDC_CLIENT_PASSWORD_DESC,19,78,70,10 + EDITTEXT IDC_CLIENT_PASSWORD,100,76,64,12, WS_BORDER | WS_TABSTOP | ES_AUTOHSCROLL - LTEXT STR_CLIENT_PROTOCOL_DESC,IDC_CLIENT_PROTOCOL_DESC,19,56,70,10 - COMBOBOX IDC_CLIENT_PROTOCOL,100,54,64,54,CBS_DROPDOWNLIST | WS_VSCROLL + + LTEXT STR_CLIENT_HOST_DESC,IDC_CLIENT_HOST_DESC,19,92,70,10 + EDITTEXT IDC_CLIENT_HOST,100,90,64,12, WS_BORDER | WS_TABSTOP | ES_AUTOHSCROLL - LTEXT STR_CLIENT_HOST_DESC,IDC_CLIENT_HOST_DESC,19,70,70,10 - LTEXT STR_CLIENT_USER_DESC,IDC_CLIENT_USER_DESC,19,84,70,10 - EDITTEXT IDC_CLIENT_HOST,100,68,64,12 - EDITTEXT IDC_CLIENT_USER,100,82,64,12 + LTEXT STR_CLIENT_USER_DESC,IDC_CLIENT_USER_DESC,19,106,70,10 + EDITTEXT IDC_CLIENT_USER,100,104,64,12, WS_BORDER | WS_TABSTOP | ES_AUTOHSCROLL END IDD_XDMCP DIALOGEX 0, 0, 317, 143 @@ -92,19 +98,29 @@ BEGIN EDITTEXT IDC_XDMCP_HOST,78,12,64,12 AUTOCHECKBOX STR_XDMCP_INDIRECT,IDC_XDMCP_INDIRECT,19,28,280,10 AUTORADIOBUTTON STR_XDMCP_BROADCAST, IDC_XDMCP_BROADCAST,7,42,300,10 - LTEXT STR_XDMCP_QUERY_DESC,IDC_XDMCP_QUERY_DESC,7,56,300,42 + LTEXT STR_XDMCP_QUERY_DESC,IDC_XDMCP_QUERY_DESC,7,66,300,42 + AUTOCHECKBOX STR_XDMCP_TERMINATE,IDC_XDMCP_TERMINATE,7,94,300,10 END -IDD_CLIPBOARD DIALOGEX 0, 0, 317, 143 +IDD_EXTRA DIALOGEX 0, 0, 317, 143 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU | DS_CENTERMOUSE -CAPTION STR_CAPTION_CLIPBOARD +CAPTION STR_CAPTION_EXTRA FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN - AUTOCHECKBOX STR_CLIPBOARD,IDC_CLIPBOARD,7,14,300,10 - LTEXT STR_CLIPBOARD_DESC,IDC_CLIPBOARD_DESC,19,28,280,27 + AUTOCHECKBOX STR_CLIPBOARD,IDC_CLIPBOARD,7,10,300,10 + LTEXT STR_CLIPBOARD_DESC,IDC_CLIPBOARD_DESC,19,20,280,27 + + AUTOCHECKBOX STR_CLIPBOARDPRIMARY,IDC_CLIPBOARDPRIMARY,19,30,300,10 + LTEXT STR_CLIPBOARDPRIMARY_DESC,IDC_CLIPBOARDPRIMARY_DESC,31,40,280,27 + + AUTOCHECKBOX STR_WGL,IDC_WGL,7,52,300,10 + LTEXT STR_WGL_DESC,IDC_WGL_DESC,19,62,280,27 + + AUTOCHECKBOX STR_DISABLEAC,IDC_DISABLEAC,7,82,300,10 + LTEXT STR_DISABLEAC_DESC,IDC_DISABLEAC_DESC,19,92,280,27 - LTEXT STR_EXTRA_PARAMS_DESC,IDC_EXTRA_PARAMS_DESC,7,56,280,10 - EDITTEXT IDC_EXTRA_PARAMS,7,70,128,12 + LTEXT STR_EXTRA_PARAMS_DESC,IDC_EXTRA_PARAMS_DESC,7,105,280,10 + EDITTEXT IDC_EXTRA_PARAMS,7,115,300,12, WS_BORDER | WS_TABSTOP | ES_AUTOHSCROLL END IDD_FINISH DIALOGEX 0, 0, 317, 143 diff --git a/xorg-server/hw/xwin/xlaunch/resources/resources.h b/xorg-server/hw/xwin/xlaunch/resources/resources.h index 470005192..03f3dac1f 100644 --- a/xorg-server/hw/xwin/xlaunch/resources/resources.h +++ b/xorg-server/hw/xwin/xlaunch/resources/resources.h @@ -24,76 +24,88 @@ * use or other dealings in this Software without prior written authorization.
*/
-#define IDC_STATIC -1
+#define IDC_STATIC -1
-#define IDD_WELCOME 100
-#define IDD_FINISH 101
-#define IDD_DISPLAY 102
-#define IDD_CLIENTS 103
-#define IDD_PROGRAM 104
-#define IDD_XDMCP 105
-#define IDD_FONTPATH 106
-#define IDD_CLIPBOARD 107
+#define IDD_WELCOME 100
+#define IDD_FINISH 101
+#define IDD_DISPLAY 102
+#define IDD_CLIENTS 103
+#define IDD_PROGRAM 104
+#define IDD_XDMCP 105
+#define IDD_FONTPATH 106
+#define IDD_EXTRA 107
-#define IDS_DISPLAY_TITLE 300
-#define IDS_DISPLAY_SUBTITLE 301
-#define IDS_CLIENTS_TITLE 302
-#define IDS_CLIENTS_SUBTITLE 303
-#define IDS_PROGRAM_TITLE 304
-#define IDS_PROGRAM_SUBTITLE 305
-#define IDS_XDMCP_TITLE 306
-#define IDS_XDMCP_SUBTITLE 307
-#define IDS_FONTPATH_TITLE 308
-#define IDS_FONTPATH_SUBTITLE 309
-#define IDS_FINISH_TITLE 310
-#define IDS_FINISH_SUBTITLE 311
-#define IDS_CLIPBOARD_TITLE 312
-#define IDS_CLIPBOARD_SUBTITLE 313
-#define IDS_SAVE_TITLE 320
-#define IDS_SAVE_FILETITLE 321
-#define IDS_SAVE_FILTER 322
-
-#define IDC_MULTIWINDOW 200
-#define IDC_WINDOWED 201
-#define IDC_FULLSCREEN 202
-#define IDC_NODECORATION 203
-#define IDC_MULTIWINDOW_IMG 204
-#define IDC_WINDOWED_IMG 205
-#define IDC_FULLSCREEN_IMG 206
-#define IDC_NODECORATION_IMG 207
-#define IDC_DISPLAY 208
-#define IDC_DISPLAY_DESC 209
+#define IDI_XLAUNCH 108
+
+#define IDC_MULTIWINDOW 200
+#define IDC_WINDOWED 201
+#define IDC_FULLSCREEN 202
+#define IDC_NODECORATION 203
+#define IDC_MULTIWINDOW_IMG 204
+#define IDC_WINDOWED_IMG 205
+#define IDC_FULLSCREEN_IMG 206
+#define IDC_NODECORATION_IMG 207
+#define IDC_DISPLAY 208
+#define IDC_DISPLAY_DESC 209
-#define IDC_CLIENT_NONE 210
-#define IDC_XDMCP 211
-#define IDC_CLIENT 212
-#define IDC_CLIENT_LOCAL 213
-#define IDC_CLIENT_REMOTE 214
-#define IDC_CLIENT_HOST 215
-#define IDC_CLIENT_USER 216
-#define IDC_CLIENT_PROTOCOL 217
-#define IDC_CLIENT_CONFIGURE 218
-#define IDC_CLIENT_PROGRAM 219
-#define IDC_XDMCP_QUERY 220
-#define IDC_XDMCP_BROADCAST 221
-#define IDC_XDMCP_INDIRECT 222
-#define IDC_XDMCP_HOST 223
-#define IDC_CLIENT_NONE_DESC 224
-#define IDC_XDMCP_DESC 225
-#define IDC_CLIENT_DESC 226
-#define IDC_XDMCP_QUERY_DESC 227
-#define IDC_CLIENT_PROGRAM_DESC 228
-#define IDC_CLIENT_HOST_DESC 229
-#define IDC_CLIENT_USER_DESC 230
-#define IDC_CLIENT_PROTOCOL_DESC 231
+#define IDC_CLIENT_NONE 210
+#define IDC_XDMCP 211
+#define IDC_CLIENT 212
+#define IDC_CLIENT_LOCAL 213
+#define IDC_CLIENT_REMOTE 214
+#define IDC_CLIENT_HOST 215
+#define IDC_CLIENT_USER 216
+#define IDC_CLIENT_PASSWORD 217
+#define IDC_CLIENT_CONFIGURE 218
+#define IDC_CLIENT_PROGRAM 219
+#define IDC_XDMCP_QUERY 220
+#define IDC_XDMCP_BROADCAST 221
+#define IDC_XDMCP_INDIRECT 222
+#define IDC_XDMCP_HOST 223
+#define IDC_CLIENT_NONE_DESC 224
+#define IDC_XDMCP_DESC 225
+#define IDC_CLIENT_DESC 226
+#define IDC_XDMCP_QUERY_DESC 227
+#define IDC_CLIENT_PROGRAM_DESC 228
+#define IDC_CLIENT_HOST_DESC 229
+#define IDC_CLIENT_USER_DESC 230
+#define IDC_CLIENT_PASSWORD_DESC 231
+#define IDC_CLIENT_REMOTEPROGRAM 232
+#define IDC_CLIENT_REMOTEPROGRAM_DESC 233
-#define IDC_FONTPATH_DESC 240
+#define IDC_FONTPATH_DESC 240
-#define IDC_FINISH_DESC 250
-#define IDC_FINISH_SAVE 251
-#define IDC_FINISH_SAVE_DESC 252
+#define IDC_FINISH_DESC 250
+#define IDC_FINISH_SAVE 251
+#define IDC_FINISH_SAVE_DESC 252
-#define IDC_CLIPBOARD 260
-#define IDC_CLIPBOARD_DESC 261
-#define IDC_EXTRA_PARAMS 262
-#define IDC_EXTRA_PARAMS_DESC 263
+#define IDC_CLIPBOARD 260
+#define IDC_CLIPBOARD_DESC 261
+#define IDC_EXTRA_PARAMS 262
+#define IDC_EXTRA_PARAMS_DESC 263
+#define IDC_WGL 264
+#define IDC_WGL_DESC 265
+#define IDC_CLIPBOARDPRIMARY 266
+#define IDC_CLIPBOARDPRIMARY_DESC 267
+#define IDC_DISABLEAC 268
+#define IDC_DISABLEAC_DESC 269
+#define IDC_XDMCP_TERMINATE 270
+
+#define IDS_DISPLAY_TITLE 300
+#define IDS_DISPLAY_SUBTITLE 301
+#define IDS_CLIENTS_TITLE 302
+#define IDS_CLIENTS_SUBTITLE 303
+#define IDS_PROGRAM_TITLE 304
+#define IDS_PROGRAM_SUBTITLE 305
+#define IDS_XDMCP_TITLE 306
+#define IDS_XDMCP_SUBTITLE 307
+#define IDS_FONTPATH_TITLE 308
+#define IDS_FONTPATH_SUBTITLE 309
+#define IDS_FINISH_TITLE 310
+#define IDS_FINISH_SUBTITLE 311
+#define IDS_EXTRA_TITLE 312
+#define IDS_EXTRA_SUBTITLE 313
+#define IDS_SAVE_TITLE 320
+#define IDS_SAVE_FILETITLE 321
+#define IDS_SAVE_FILTER 322
+
diff --git a/xorg-server/hw/xwin/xlaunch/resources/resources.rc b/xorg-server/hw/xwin/xlaunch/resources/resources.rc index 07fd52f32..e3df4610a 100644 --- a/xorg-server/hw/xwin/xlaunch/resources/resources.rc +++ b/xorg-server/hw/xwin/xlaunch/resources/resources.rc @@ -28,3 +28,5 @@ #include "resources.h" #include "images.rc" #include "dialog.rc" + +IDI_XLAUNCH ICON "..\\..\\X.ico" diff --git a/xorg-server/hw/xwin/xlaunch/resources/strings.rc b/xorg-server/hw/xwin/xlaunch/resources/strings.rc index 5a9cd281b..dab2b30af 100644 --- a/xorg-server/hw/xwin/xlaunch/resources/strings.rc +++ b/xorg-server/hw/xwin/xlaunch/resources/strings.rc @@ -40,13 +40,15 @@ #define STR_XDMCP_DESC "This will start a remote XDMCP session. Starting local clients later is limited. This option is not available with the ""Multiple windows"" mode." #define STR_CAPTION_PROGRAM "Start program" -#define STR_CLIENT_PROGRAM_DESC "Start program" +#define STR_CLIENT_PROGRAM_DESC "Local program" #define STR_CLIENT_LOCAL "Start program on this computer" #define STR_CLIENT_REMOTE "Start program on remote computer" -#define STR_CLIENT_PROTOCOL_DESC "Connect using" +#define STR_CLIENT_PASSWORD_DESC "Password" #define STR_CLIENT_HOST_DESC "Connect to computer" #define STR_CLIENT_USER_DESC "Login as user" +#define STR_CLIENT_REMOTEPROGRAM_DESC "Remote program" + #define STR_CAPTION_XDMCP "XDMCP settings" #define STR_XDMCP_QUERY "Connect to host" @@ -57,18 +59,27 @@ #define STR_CAPTION_FONTPATH "Fontpath settings" -#define STR_CAPTION_CLIPBOARD "Clipboard settings" +#define STR_CAPTION_EXTRA "Extra settings" #define STR_CLIPBOARD "Clipboard" #define STR_CLIPBOARD_DESC "Start the integrated clipboard manager" -#define STR_EXTRA_PARAMS_DESC "Additional parameters for Xming" +#define STR_CLIPBOARDPRIMARY "Primary Selection" +#define STR_CLIPBOARDPRIMARY_DESC "Also map the PRIMARY selection to the windows clipboard." +#define STR_WGL "Native opengl" +#define STR_WGL_DESC "Use the native windows opengl library (wgl). Make sure to export the LIBGL_ALWAYS_INDIRECT environment variable." +#define STR_EXTRA_PARAMS_DESC "Additional parameters for VcXsrv" + +#define STR_DISABLEAC "Disable access control" +#define STR_DISABLEAC_DESC "Use this when you want vcxsrv to accept connections from all clients." + +#define STR_XDMCP_TERMINATE "Terminate on server reset." #define STR_CAPTION_FINISH "Finish configuration" -#define STR_FINISH_DESC "Configuration is complete. Clish Finish to start Xming." +#define STR_FINISH_DESC "Configuration is complete. Click Finish to start VcXsrv." #define STR_FINISH_SAVE_DESC "You may also save the configuration for later use." #define STR_FINISH_SAVE "Save configuration" #define STR_DISPLAY_TITLE "Select display settings" -#define STR_DISPLAY_SUBTITLE "Choose how Xming display programs" +#define STR_DISPLAY_SUBTITLE "Choose how VcXsrv display programs" #define STR_CLIENTS_TITLE "Select how to start clients" #define STR_CLIENTS_SUBTITLE "" #define STR_PROGRAM_TITLE "Specify the program to start" @@ -79,8 +90,8 @@ #define STR_FONTPATH_SUBTITLE "" #define STR_FINISH_TITLE "Configuration complete" #define STR_FINISH_SUBTITLE "" -#define STR_CLIPBOARD_TITLE "Clipboard settings" -#define STR_CLIPBOARD_SUBTITLE "" +#define STR_EXTRA_TITLE "Extra settings" +#define STR_EXTRA_SUBTITLE "" #define STR_SAVE_TITLE "Save configuration" #define STR_SAVE_FILETITLE "Filename" @@ -100,9 +111,9 @@ BEGIN IDS_FONTPATH_SUBTITLE STR_FONTPATH_SUBTITLE IDS_FINISH_TITLE STR_FINISH_TITLE IDS_FINISH_SUBTITLE STR_FINISH_SUBTITLE - IDS_CLIPBOARD_TITLE STR_CLIPBOARD_TITLE - IDS_CLIPBOARD_SUBTITLE STR_CLIPBOARD_SUBTITLE - IDS_SAVE_TITLE STR_SAVE_TITLE + IDS_EXTRA_TITLE STR_EXTRA_TITLE + IDS_EXTRA_SUBTITLE STR_EXTRA_SUBTITLE + IDS_SAVE_TITLE STR_SAVE_TITLE IDS_SAVE_FILETITLE STR_SAVE_FILETITLE IDS_SAVE_FILTER STR_SAVE_FILTER END diff --git a/xorg-server/hw/xwin/xlaunch/window/makefile b/xorg-server/hw/xwin/xlaunch/window/makefile new file mode 100644 index 000000000..18a33e728 --- /dev/null +++ b/xorg-server/hw/xwin/xlaunch/window/makefile @@ -0,0 +1,4 @@ +CSRCS=dialog.cc util.cc window.cc wizard.cc
+
+LIBRARY = window
+
diff --git a/xorg-server/hw/xwin/xlaunch/window/util.cc b/xorg-server/hw/xwin/xlaunch/window/util.cc index fb7e87297..6f768348e 100644 --- a/xorg-server/hw/xwin/xlaunch/window/util.cc +++ b/xorg-server/hw/xwin/xlaunch/window/util.cc @@ -25,6 +25,8 @@ */ #include "util.h" +const char * MessageDebug::notify_names[NOTIFY_NAMES_LEN]; + std::string win32_error::message(DWORD errorcode) { LPVOID lpMsgBuf; diff --git a/xorg-server/hw/xwin/xlaunch/window/util.h b/xorg-server/hw/xwin/xlaunch/window/util.h index cd21da657..a1196b115 100644 --- a/xorg-server/hw/xwin/xlaunch/window/util.h +++ b/xorg-server/hw/xwin/xlaunch/window/util.h @@ -28,7 +28,7 @@ #include <windows.h> #include <stdexcept> - +#include <string> class win32_error : public std::runtime_error { @@ -39,7 +39,7 @@ class win32_error : public std::runtime_error }; #define MESSAGE_NAMES_LEN 1024 -#define NOTIFY_NAMES_LEN 0 +#define NOTIFY_NAMES_LEN 1 class MessageDebug { protected: diff --git a/xorg-server/hw/xwin/xlaunch/window/wizard.h b/xorg-server/hw/xwin/xlaunch/window/wizard.h index a2361c51c..c576cc093 100644 --- a/xorg-server/hw/xwin/xlaunch/window/wizard.h +++ b/xorg-server/hw/xwin/xlaunch/window/wizard.h @@ -29,7 +29,6 @@ #include "dialog.h"
#include <vector>
-#define _WIN32_IE 0x0500
#include <prsht.h>
class CWizard : public CBaseDialog
|