summaryrefslogtreecommitdiff
path: root/xc/programs/Xserver/hw/xwin/win.h
diff options
context:
space:
mode:
Diffstat (limited to 'xc/programs/Xserver/hw/xwin/win.h')
-rw-r--r--xc/programs/Xserver/hw/xwin/win.h246
1 files changed, 209 insertions, 37 deletions
diff --git a/xc/programs/Xserver/hw/xwin/win.h b/xc/programs/Xserver/hw/xwin/win.h
index dd4866dd8..1883ebb0d 100644
--- a/xc/programs/Xserver/hw/xwin/win.h
+++ b/xc/programs/Xserver/hw/xwin/win.h
@@ -29,8 +29,9 @@
* Suhaib M Siddiqi
* Peter Busch
* Harold L Hunt II
+ * MATSUZAKI Kensuke
*/
-/* $XFree86: xc/programs/Xserver/hw/xwin/win.h,v 1.27 2001/11/21 08:51:24 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/win.h,v 1.31 2002/10/17 08:18:21 alanh Exp $ */
#ifndef _WIN_H_
#define _WIN_H_
@@ -46,8 +47,11 @@
/*
* Build toggles for experimental features
*/
-#define WIN_NATIVE_GDI_SUPPORT YES
-#define WIN_LAYER_SUPPORT YES
+#define WIN_NATIVE_GDI_SUPPORT YES
+#define WIN_LAYER_SUPPORT NO
+#define WIN_NEW_KEYBOARD_SUPPORT NO
+#define WIN_EMULATE_PSEUDO_SUPPORT YES
+#define WIN_UPDATE_STATS NO
/* Turn debug messages on or off */
#define CYGDEBUG NO
@@ -61,17 +65,18 @@
#define NEED_EVENTS
-#define WIN_DEFAULT_WIDTH 640
-#define WIN_DEFAULT_HEIGHT 480
-#define WIN_DEFAULT_DEPTH 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_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
+#define WIN_DEFAULT_EMULATE_PSEUDO FALSE
+#define WIN_DEFAULT_USER_GAVE_HEIGHT_AND_WIDTH FALSE
#define WIN_DIB_MAXIMUM_SIZE 0x08000000 /* 16 MB on Windows 95, 98, Me */
#define WIN_DIB_MAXIMUM_SIZE_MB (WIN_DIB_MAXIMUM_SIZE / 8 / 1024 / 1024)
@@ -82,11 +87,17 @@
#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_DEPTHS ( (1 << (32-1)) | (1 << (24-1)) \
- | (1 << (16-1)) | (1 << (15-1)) | (1 << (8-1)))
+#define WIN_SUPPORTED_BPPS ( (1 << (32 - 1)) | (1 << (24 - 1)) \
+ | (1 << (16 - 1)) | (1 << (15 - 1)) \
+ | (1 << ( 8 - 1)))
#define WIN_CHECK_DEPTH YES
#define WIN_E3B_OFF -1
@@ -106,10 +117,17 @@
#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>
@@ -191,13 +209,13 @@ if (fDebugProcMsg) \
\
iLength = sprintf (NULL, str, ##__VA_ARGS__); \
\
- pszTemp = xalloc (iLength + 1); \
+ pszTemp = malloc (iLength + 1); \
\
sprintf (pszTemp, str, ##__VA_ARGS__); \
\
MessageBox (NULL, pszTemp, szFunctionName, MB_OK); \
\
- xfree (pszTemp); \
+ free (pszTemp); \
}
#else
#define DEBUG_MSG(str,...)
@@ -260,10 +278,15 @@ typedef Bool (*winCreateColormapProcPtr)(ColormapPtr pColormap);
typedef Bool (*winDestroyColormapProcPtr)(ColormapPtr pColormap);
-typedef Bool (*winHotKeyAltTabPtr)(ScreenPtr);
+typedef Bool (*winHotKeyAltTabProcPtr)(ScreenPtr);
+
+typedef Bool (*winCreatePrimarySurfaceProcPtr)(ScreenPtr);
+
+typedef Bool (*winReleasePrimarySurfaceProcPtr)(ScreenPtr);
+
/*
- * Privates structures
+ * Window privates
*/
typedef struct
@@ -271,12 +294,22 @@ typedef struct
DWORD dwDummy;
} winPrivWinRec, *winPrivWinPtr;
+
+/*
+ * GC (graphics context) privates
+ */
+
typedef struct
{
HDC hdc;
HDC hdcMem;
} winPrivGCRec, *winPrivGCPtr;
+
+/*
+ * Pixmap privates
+ */
+
typedef struct
{
HDC hdcSelected;
@@ -286,6 +319,11 @@ typedef struct
BITMAPINFOHEADER *pbmih;
} winPrivPixmapRec, *winPrivPixmapPtr;
+
+/*
+ * Colormap privates
+ */
+
typedef struct
{
HPALETTE hPalette;
@@ -294,34 +332,80 @@ typedef struct
PALETTEENTRY peColors[WIN_NUM_PALETTE_ENTRIES];
} winPrivCmapRec, *winPrivCmapPtr;
+
+#if WIN_NEW_KEYBOARD_SUPPORT
+/*
+ * Keyboard event structure
+ */
+
+typedef struct
+{
+ DWORD dwXKeycodes[WIN_MAX_KEYS_PER_KEY];
+ DWORD dwReleaseModifiers;
+} winKeyEventsRec, winKeyEventsPtr;
+
+#endif /* WIN_NEW_KEYBOARD_SUPPORT */
+
+/*
+ * 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;
DWORD dwWidth;
DWORD dwPaddedWidth;
+
+ /*
+ * 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;
DWORD dwHeight;
DWORD dwWidth_mm;
DWORD dwHeight_mm;
+
+ /* Offset of the screen in the window when using scrollbars */
+ DWORD dwXOffset;
+ DWORD dwYOffset;
+
+ DWORD dwBPP;
DWORD dwDepth;
DWORD dwRefreshRate;
- DWORD dwStrideBytes;
- DWORD dwStride;
- DWORD dwBPP;
char *pfb;
XWDColor *pXWDCmap;
XWDFileHeader *pXWDHeader;
DWORD dwEngine;
DWORD dwEnginePreferred;
- DWORD dwEnginesSupported;
+ DWORD dwClipUpdatesNBoxes;
+ Bool fEmulatePseudo;
Bool fFullScreen;
+ Bool fDecoration;
+ Bool fRootless;
+ Bool fLessPointer;
+ Bool fScrollbars;
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
{
winScreenInfoPtr pScreenInfo;
@@ -329,7 +413,7 @@ typedef struct
Bool fEnabled;
Bool fClosed;
Bool fActive;
- Bool fCursor;
+ Bool fBadDepth;
int iDeltaZ;
@@ -347,10 +431,16 @@ typedef struct
void *display;
int window;
+ /* Last width, height, and depth of the Windows display */
+ DWORD dwLastWindowsWidth;
+ DWORD dwLastWindowsHeight;
+ DWORD dwLastWindowsBitsPixel;
+
/* Layer support */
+#if WIN_LAYER_SUPPORT
DWORD dwLayerKind;
- DWORD dwOrigDepth;
LayerPtr pLayer;
+#endif
/* Palette management */
ColormapPtr pcmapInstalled;
@@ -406,9 +496,33 @@ typedef struct
winStoreColorsProcPtr pwinStoreColors;
winCreateColormapProcPtr pwinCreateColormap;
winDestroyColormapProcPtr pwinDestroyColormap;
- winHotKeyAltTabPtr pwinHotKeyAltTab;
+ winHotKeyAltTabProcPtr pwinHotKeyAltTab;
+ winCreatePrimarySurfaceProcPtr pwinCreatePrimarySurface;
+ winReleasePrimarySurfaceProcPtr pwinReleasePrimarySurface;
+
+ /* Window Procedures for Rootless mode */
+ CreateWindowProcPtr CreateWindow;
+ DestroyWindowProcPtr DestroyWindow;
+ PositionWindowProcPtr PositionWindow;
+ ChangeWindowAttributesProcPtr ChangeWindowAttributes;
+ RealizeWindowProcPtr RealizeWindow;
+ UnrealizeWindowProcPtr UnrealizeWindow;
+ ValidateTreeProcPtr ValidateTree;
+ PostValidateTreeProcPtr PostValidateTree;
+ WindowExposuresProcPtr WindowExposures;
+ PaintWindowBackgroundProcPtr PaintWindowBackground;
+ PaintWindowBorderProcPtr PaintWindowBorder;
+ CopyWindowProcPtr CopyWindow;
+ ClearToBackgroundProcPtr ClearToBackground;
+ ClipNotifyProcPtr ClipNotify;
+ RestackWindowProcPtr RestackWindow;
} winPrivScreenRec, *winPrivScreenPtr;
+
+/*
+ * Extern declares for general global variables
+ */
+
extern winScreenInfo g_ScreenInfo[];
extern miPointerScreenFuncRec g_winPointerCursorFuncs;
extern DWORD g_dwEvents;
@@ -419,6 +533,20 @@ extern int g_iGCPrivateIndex;
extern int g_iPixmapPrivateIndex;
extern unsigned long g_ulServerGeneration;
extern CARD32 g_c32LastInputEventTime;
+extern DWORD g_dwEnginesSupported;
+extern HINSTANCE g_hInstance;
+extern HWND g_hDlgDepthChange;
+
+/*
+ * Extern declares for dynamically loaded libraries and function pointers
+ */
+
+extern HMODULE g_hmodDirectDraw;
+extern FARPROC g_fpDirectDrawCreate;
+extern FARPROC g_fpDirectDrawCreateClipper;
+
+extern HMODULE g_hmodCommonControls;
+extern FARPROC g_fpTrackMouseEvent;
/*
@@ -512,13 +640,6 @@ extern CARD32 g_c32LastInputEventTime;
* BEGIN DDX and DIX Function Prototypes
*/
-/*
- * InitOutput.c
- */
-
-DWORD
-winBitsPerPixel (DWORD dwDepth);
-
/*
* winallpriv.c
@@ -610,6 +731,9 @@ winCreateBoundingWindowWindowed (ScreenPtr pScreen);
* wincursor.c
*/
+void
+winPointerWarpCursor (ScreenPtr pScreen, int x, int y);
+
Bool
winCursorOffScreen (ScreenPtr *ppScreen, int *x, int *y);
@@ -621,12 +745,15 @@ winCrossScreen (ScreenPtr pScreen, Bool fEntering);
* winengine.c
*/
-Bool
-winDetectSupportedEngines (ScreenPtr pScreen);
+void
+winDetectSupportedEngines ();
Bool
winSetEngine (ScreenPtr pScreen);
+Bool
+winGetDDProcAddresses ();
+
/*
* winerror.c
@@ -711,8 +838,13 @@ winGetSpansNativeGDI (DrawablePtr pDrawable,
* winkeybd.c
*/
+#if WIN_NEW_KEYBOARD_SUPPORT
+winKeyEventsRec
+winTranslateKey (DWORD dwVirtualKey, DWORD dwKeyData);
+#else
void
winTranslateKey (WPARAM wParam, LPARAM lParam, int *piScanCode);
+#endif
void
winGetKeyMappings (KeySymsPtr pKeySyms, CARD8 *pModMap);
@@ -740,16 +872,23 @@ Bool
winIsFakeCtrl_L (UINT message, WPARAM wParam, LPARAM lParam);
void
-winKeybdReleaseModifierKeys ();
+winKeybdReleaseKeys ();
void
winSendKeyEvent (DWORD dwKey, Bool fDown);
+#if WIN_NEW_KEYBOARD_SUPPORT
+void
+winProcessKeyEvent (DWORD dwVirtKey, DWORD dwKeyData);
+#endif
+
/*
* winlayer.c
*/
+#if WIN_LAYER_SUPPORT
+
LayerPtr
winLayerCreate (ScreenPtr pScreen);
@@ -759,6 +898,7 @@ winLayerAdd (WindowPtr pWindow, pointer value);
int
winLayerRemove (WindowPtr pWindow, pointer value);
+#ifdef RANDR
Bool
winRandRGetInfo (ScreenPtr pScreen, Rotation *pRotations);
@@ -770,6 +910,8 @@ winRandRSetConfig (ScreenPtr pScreen,
Bool
winRandRInit (ScreenPtr pScreen);
+#endif /* RANDR */
+#endif /* WIN_LAYER_SUPPORT */
/*
@@ -1033,6 +1175,12 @@ winCreateColormapShadowDD (ColormapPtr pColormap);
Bool
winDestroyColormapShadowDD (ColormapPtr pColormap);
+Bool
+winCreatePrimarySurfaceShadowDD (ScreenPtr pScreen);
+
+Bool
+winReleasePrimarySurfaceShadowDD (ScreenPtr pScreen);
+
/*
* winshadddnl.c
@@ -1083,6 +1231,12 @@ winCreateColormapShadowDDNL (ColormapPtr pColormap);
Bool
winDestroyColormapShadowDDNL (ColormapPtr pColormap);
+Bool
+winCreatePrimarySurfaceShadowDDNL (ScreenPtr pScreen);
+
+Bool
+winReleasePrimarySurfaceShadowDDNL (ScreenPtr pScreen);
+
/*
* winshadgdi.c
@@ -1169,6 +1323,24 @@ winUnmapWindowNativeGDI (WindowPtr pWindow);
Bool
winMapWindowNativeGDI (WindowPtr pWindow);
+Bool
+winCreateWindowPRootless (WindowPtr pWindow);
+
+Bool
+winDestroyWindowPRootless (WindowPtr pWindow);
+
+Bool
+winPositionWindowPRootless (WindowPtr pWindow, int x, int y);
+
+Bool
+winChangeWindowAttributesPRootless (WindowPtr pWindow, unsigned long mask);
+
+Bool
+winUnmapWindowPRootless (WindowPtr pWindow);
+
+Bool
+winMapWindowPRootless (WindowPtr pWindow);
+
/*
* winwndproc.c