2 *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
4 *Permission is hereby granted, free of charge, to any person obtaining
5 * a copy of this software and associated documentation files (the
6 *"Software"), to deal in the Software without restriction, including
7 *without limitation the rights to use, copy, modify, merge, publish,
8 *distribute, sublicense, and/or sell copies of the Software, and to
9 *permit persons to whom the Software is furnished to do so, subject to
10 *the following conditions:
12 *The above copyright notice and this permission notice shall be
13 *included in all copies or substantial portions of the Software.
15 *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
19 *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
20 *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 *Except as contained in this notice, the name of the XFree86 Project
24 *shall not be used in advertising or otherwise to promote the sale, use
25 *or other dealings in this Software without prior written authorization
26 *from the XFree86 Project.
28 * Authors: Dakshinamurthy Karra
45 /* We can handle WM_MOUSEHWHEEL even though _WIN32_WINNT < 0x0600 */
46 #ifndef WM_MOUSEHWHEEL
47 #define WM_MOUSEHWHEEL 0x020E
50 /* Turn debug messages on or off */
55 #define WIN_DEFAULT_BPP 0
56 #define WIN_DEFAULT_WHITEPIXEL 255
57 #define WIN_DEFAULT_BLACKPIXEL 0
58 #define WIN_DEFAULT_LINEBIAS 0
59 #define WIN_DEFAULT_E3B_TIME 50 /* milliseconds */
60 #define WIN_DEFAULT_DPI 96
61 #define WIN_DEFAULT_REFRESH 0
62 #define WIN_DEFAULT_WIN_KILL TRUE
63 #define WIN_DEFAULT_UNIX_KILL FALSE
64 #define WIN_DEFAULT_CLIP_UPDATES_NBOXES 0
65 #ifdef XWIN_EMULATEPSEUDO
66 #define WIN_DEFAULT_EMULATE_PSEUDO FALSE
68 #define WIN_DEFAULT_USER_GAVE_HEIGHT_AND_WIDTH FALSE
71 * Windows only supports 256 color palettes
73 #define WIN_NUM_PALETTE_ENTRIES 256
76 * Number of times to call Restore in an attempt to restore the primary surface
78 #define WIN_REGAIN_SURFACE_RETRIES 1
81 * Build a supported display depths mask by shifting one to the left
82 * by the number of bits in the supported depth.
84 #define WIN_SUPPORTED_BPPS ( (1 << (32 - 1)) | (1 << (24 - 1)) \
85 | (1 << (16 - 1)) | (1 << (15 - 1)) \
87 #define WIN_CHECK_DEPTH YES
90 * Timer IDs for WM_TIMER
92 #define WIN_E3B_TIMER_ID 1
93 #define WIN_POLLING_MOUSE_TIMER_ID 2
95 #define MOUSE_POLLING_INTERVAL 50
97 #define WIN_E3B_OFF -1
98 #define WIN_E3B_DEFAULT 0
100 #define WIN_FD_INVALID -1
102 #define WIN_SERVER_NONE 0x0L /* 0 */
103 #define WIN_SERVER_SHADOW_GDI 0x1L /* 1 */
104 #define WIN_SERVER_SHADOW_DD 0x2L /* 2 */
105 #define WIN_SERVER_SHADOW_DDNL 0x4L /* 4 */
106 #ifdef XWIN_PRIMARYFB
107 #define WIN_SERVER_PRIMARY_DD 0x8L /* 8 */
109 #ifdef XWIN_NATIVEGDI
110 #define WIN_SERVER_NATIVE_GDI 0x10L /* 16 */
113 #define AltMapIndex Mod1MapIndex
114 #define NumLockMapIndex Mod2MapIndex
115 #define AltLangMapIndex Mod3MapIndex
116 #define KanaMapIndex Mod4MapIndex
117 #define ScrollLockMapIndex Mod5MapIndex
119 #define WIN_MOD_LALT 0x00000001
120 #define WIN_MOD_RALT 0x00000002
121 #define WIN_MOD_LCONTROL 0x00000004
122 #define WIN_MOD_RCONTROL 0x00000008
124 #define WIN_24BPP_MASK_RED 0x00FF0000
125 #define WIN_24BPP_MASK_GREEN 0x0000FF00
126 #define WIN_24BPP_MASK_BLUE 0x000000FF
128 #define WIN_MAX_KEYS_PER_KEY 4
130 #define NONAMELESSUNION
132 #include <sys/types.h>
133 #include <sys/stat.h>
137 #if defined(XWIN_MULTIWINDOWEXTWM) || defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW)
138 #define HANDLE void *
144 #include <sys/mman.h>
147 #endif /* MAP_FILE */
148 #endif /* HAVE_MMAP */
151 #include <X11/Xproto.h>
153 #include <X11/Xprotostr.h>
154 #include "scrnintstr.h"
155 #include "pixmapstr.h"
158 #include "gcstruct.h"
159 #include "colormap.h"
160 #include "colormapst.h"
161 #include "miscstruct.h"
162 #include "servermd.h"
163 #include "windowstr.h"
166 #include "mifillarc.h"
169 #include "mipointer.h"
170 #include "X11/keysym.h"
176 #include "rootless.h"
179 #include "picturestr.h"
182 #include "randrstr.h"
189 #include "winresource.h"
192 * Define Windows constants
195 #define WM_TRAYICON (WM_USER + 1000)
196 #define WM_INIT_SYS_MENU (WM_USER + 1001)
197 #define WM_GIVEUP (WM_USER + 1002)
200 #include "winwindow.h"
208 #define DEBUG_MSG(str,...) \
213 if (asprintf (&pszTemp, str, ##__VA_ARGS__) != -1) { \
214 MessageBox (NULL, pszTemp, szFunctionName, MB_OK); \
219 #define DEBUG_MSG(str,...)
223 #define DEBUG_FN_NAME(str) PTSTR szFunctionName = str
225 #define DEBUG_FN_NAME(str)
229 #define DEBUGVARS BOOL fDebugProcMsg = FALSE
235 #define DEBUGPROC_MSG fDebugProcMsg = TRUE
237 #define DEBUGPROC_MSG
240 #define PROFILEPOINT(point,thresh)\
242 static unsigned int PROFPT##point = 0;\
243 if (++PROFPT##point % thresh == 0)\
244 ErrorF (#point ": PROFILEPOINT hit %u times\n", PROFPT##point);\
247 #define DEFINE_ATOM_HELPER(func,atom_name) \
248 static Atom func (void) { \
249 static int generation; \
251 if (generation != serverGeneration) { \
252 generation = serverGeneration; \
253 atom = MakeAtom (atom_name, strlen (atom_name), TRUE); \
259 * Typedefs for engine dependent function pointers
262 typedef Bool (*winAllocateFBProcPtr
) (ScreenPtr
);
264 typedef void (*winFreeFBProcPtr
) (ScreenPtr
);
266 typedef void (*winShadowUpdateProcPtr
) (ScreenPtr
, shadowBufPtr
);
268 typedef Bool (*winInitScreenProcPtr
) (ScreenPtr
);
270 typedef Bool (*winCloseScreenProcPtr
) (ScreenPtr
);
272 typedef Bool (*winInitVisualsProcPtr
) (ScreenPtr
);
274 typedef Bool (*winAdjustVideoModeProcPtr
) (ScreenPtr
);
276 typedef Bool (*winCreateBoundingWindowProcPtr
) (ScreenPtr
);
278 typedef Bool (*winFinishScreenInitProcPtr
) (int, ScreenPtr
, int, char **);
280 typedef Bool (*winBltExposedRegionsProcPtr
) (ScreenPtr
);
282 typedef Bool (*winActivateAppProcPtr
) (ScreenPtr
);
284 typedef Bool (*winRedrawScreenProcPtr
) (ScreenPtr pScreen
);
286 typedef Bool (*winRealizeInstalledPaletteProcPtr
) (ScreenPtr pScreen
);
288 typedef Bool (*winInstallColormapProcPtr
) (ColormapPtr pColormap
);
290 typedef Bool (*winStoreColorsProcPtr
) (ColormapPtr pmap
,
291 int ndef
, xColorItem
* pdefs
);
293 typedef Bool (*winCreateColormapProcPtr
) (ColormapPtr pColormap
);
295 typedef Bool (*winDestroyColormapProcPtr
) (ColormapPtr pColormap
);
297 typedef Bool (*winHotKeyAltTabProcPtr
) (ScreenPtr
);
299 typedef Bool (*winCreatePrimarySurfaceProcPtr
) (ScreenPtr
);
301 typedef Bool (*winReleasePrimarySurfaceProcPtr
) (ScreenPtr
);
303 typedef Bool (*winFinishCreateWindowsWindowProcPtr
) (WindowPtr pWin
);
305 typedef Bool (*winCreateScreenResourcesProc
) (ScreenPtr
);
307 #ifdef XWIN_NATIVEGDI
308 /* Typedefs for native GDI wrappers */
309 typedef Bool (*RealizeFontPtr
) (ScreenPtr pScreen
, FontPtr pFont
);
310 typedef Bool (*UnrealizeFontPtr
) (ScreenPtr pScreen
, FontPtr pFont
);
314 * GC (graphics context) privates
320 } winPrivGCRec
, *winPrivGCPtr
;
330 DWORD dwScanlineBytes
;
331 BITMAPINFOHEADER
*pbmih
;
332 } winPrivPixmapRec
, *winPrivPixmapPtr
;
340 LPDIRECTDRAWPALETTE lpDDPalette
;
341 RGBQUAD rgbColors
[WIN_NUM_PALETTE_ENTRIES
];
342 PALETTEENTRY peColors
[WIN_NUM_PALETTE_ENTRIES
];
343 } winPrivCmapRec
, *winPrivCmapPtr
;
346 * Windows Cursor handling.
350 /* from GetSystemMetrics */
356 QueryBestSizeProcPtr QueryBestSize
;
357 miPointerSpriteFuncPtr spriteFuncs
;
365 resizeWithScrollbars
,
370 * Screen information structure that we need before privates are available
371 * in the server startup sequence.
377 /* Did the user specify a height and width? */
378 Bool fUserGaveHeightAndWidth
;
390 /* Did the user specify a screen position? */
391 Bool fUserGavePosition
;
396 * dwStride is the number of whole pixels that occupy a scanline,
397 * including those pixels that are not displayed. This is basically
398 * a rounding up of the width.
402 /* Offset of the screen in the window when using scrollbars */
411 DWORD dwEnginePreferred
;
412 DWORD dwClipUpdatesNBoxes
;
413 #ifdef XWIN_EMULATEPSEUDO
418 #ifdef XWIN_MULTIWINDOWEXTWM
421 Bool fAnotherWMRunning
;
424 #ifdef XWIN_MULTIWINDOW
427 #if defined(XWIN_MULTIWINDOW) || defined(XWIN_MULTIWINDOWEXTWM)
428 Bool fMultiMonitorOverride
;
430 Bool fMultipleMonitors
;
432 winResizeMode iResizeMode
;
435 /* Windows (Alt+F4) and Unix (Ctrl+Alt+Backspace) Killkey */
437 Bool fUseUnixKillKey
;
440 /* Did the user explicitly set this screen? */
441 Bool fExplicitScreen
;
442 } winScreenInfo
, *winScreenInfoPtr
;
448 typedef struct _winPrivScreenRec
{
449 winScreenInfoPtr pScreenInfo
;
459 int iConnectedClients
;
461 CloseScreenProcPtr CloseScreen
;
468 DWORD dwModeKeyStates
;
470 /* Handle to icons that must be freed */
471 HICON hiconNotifyIcon
;
473 /* Palette management */
474 ColormapPtr pcmapInstalled
;
476 /* Pointer to the root visual so we only have to look it up once */
477 VisualPtr pRootVisual
;
479 /* 3 button emulation variables */
481 Bool fE3BFakeButton2Sent
;
483 /* Privates used by shadow fb GDI server */
488 BITMAPINFOHEADER
*pbmih
;
490 /* Privates used by shadow fb and primary fb DirectDraw servers */
492 LPDIRECTDRAWSURFACE2 pddsPrimary
;
495 /* Privates used by shadow fb DirectDraw server */
496 LPDIRECTDRAWSURFACE2 pddsShadow
;
497 LPDDSURFACEDESC pddsdShadow
;
499 /* Privates used by primary fb DirectDraw server */
500 LPDIRECTDRAWSURFACE2 pddsOffscreen
;
501 LPDDSURFACEDESC pddsdOffscreen
;
502 LPDDSURFACEDESC pddsdPrimary
;
504 /* Privates used by shadow fb DirectDraw Nonlocking server */
506 LPDIRECTDRAWSURFACE4 pddsShadow4
;
507 LPDIRECTDRAWSURFACE4 pddsPrimary4
;
508 BOOL fRetryCreateSurface
;
510 /* Privates used by both shadow fb DirectDraw servers */
511 LPDIRECTDRAWCLIPPER pddcPrimary
;
513 #ifdef XWIN_MULTIWINDOWEXTWM
514 /* Privates used by multi-window external window manager */
515 RootlessFrameID widTop
;
519 #ifdef XWIN_MULTIWINDOW
520 /* Privates used by multi-window */
522 pthread_t ptXMsgProc
;
526 #if defined(XWIN_MULTIWINDOW) || defined(XWIN_MULTIWINDOWEXTWM)
527 /* Privates used by both multi-window and rootless */
528 Bool fRootWindowShown
;
531 #if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW)
532 /* Privates used for any module running in a seperate thread */
533 pthread_mutex_t pmServerStarted
;
537 /* Engine specific functions */
538 winAllocateFBProcPtr pwinAllocateFB
;
539 winFreeFBProcPtr pwinFreeFB
;
540 winShadowUpdateProcPtr pwinShadowUpdate
;
541 winInitScreenProcPtr pwinInitScreen
;
542 winCloseScreenProcPtr pwinCloseScreen
;
543 winInitVisualsProcPtr pwinInitVisuals
;
544 winAdjustVideoModeProcPtr pwinAdjustVideoMode
;
545 winCreateBoundingWindowProcPtr pwinCreateBoundingWindow
;
546 winFinishScreenInitProcPtr pwinFinishScreenInit
;
547 winBltExposedRegionsProcPtr pwinBltExposedRegions
;
548 winActivateAppProcPtr pwinActivateApp
;
549 winRedrawScreenProcPtr pwinRedrawScreen
;
550 winRealizeInstalledPaletteProcPtr pwinRealizeInstalledPalette
;
551 winInstallColormapProcPtr pwinInstallColormap
;
552 winStoreColorsProcPtr pwinStoreColors
;
553 winCreateColormapProcPtr pwinCreateColormap
;
554 winDestroyColormapProcPtr pwinDestroyColormap
;
555 winHotKeyAltTabProcPtr pwinHotKeyAltTab
;
556 winCreatePrimarySurfaceProcPtr pwinCreatePrimarySurface
;
557 winReleasePrimarySurfaceProcPtr pwinReleasePrimarySurface
;
559 winCreateScreenResourcesProc pwinCreateScreenResources
;
561 #ifdef XWIN_MULTIWINDOW
562 /* Window Procedures for MultiWindow mode */
563 winFinishCreateWindowsWindowProcPtr pwinFinishCreateWindowsWindow
;
566 /* Window Procedures for Rootless mode */
567 CreateWindowProcPtr CreateWindow
;
568 DestroyWindowProcPtr DestroyWindow
;
569 PositionWindowProcPtr PositionWindow
;
570 ChangeWindowAttributesProcPtr ChangeWindowAttributes
;
571 RealizeWindowProcPtr RealizeWindow
;
572 UnrealizeWindowProcPtr UnrealizeWindow
;
573 ValidateTreeProcPtr ValidateTree
;
574 PostValidateTreeProcPtr PostValidateTree
;
575 CopyWindowProcPtr CopyWindow
;
576 ClearToBackgroundProcPtr ClearToBackground
;
577 ClipNotifyProcPtr ClipNotify
;
578 RestackWindowProcPtr RestackWindow
;
579 ReparentWindowProcPtr ReparentWindow
;
580 ResizeWindowProcPtr ResizeWindow
;
581 MoveWindowProcPtr MoveWindow
;
582 SetShapeProcPtr SetShape
;
586 #ifdef XWIN_NATIVEGDI
587 RealizeFontPtr RealizeFont
;
588 UnrealizeFontPtr UnrealizeFont
;
593 #ifdef XWIN_MULTIWINDOWEXTWM
595 RootlessWindowPtr pFrame
;
598 BITMAPINFOHEADER
*pbmihShadow
;
605 BOOL fMovingOrSizing
;
606 BOOL fDestroyed
; //for debug
608 } win32RootlessWindowRec
, *win32RootlessWindowPtr
;
614 } WindowIDPairRec
, *WindowIDPairPtr
;
617 * Extern declares for general global variables
620 #include "winglobals.h"
622 extern winScreenInfo
*g_ScreenInfo
;
623 extern miPointerScreenFuncRec g_winPointerCursorFuncs
;
624 extern DWORD g_dwEvents
;
626 #ifdef HAS_DEVWINDOWS
627 extern int g_fdMessageQueue
;
629 extern DevPrivateKeyRec g_iScreenPrivateKeyRec
;
631 #define g_iScreenPrivateKey (&g_iScreenPrivateKeyRec)
632 extern DevPrivateKeyRec g_iCmapPrivateKeyRec
;
634 #define g_iCmapPrivateKey (&g_iCmapPrivateKeyRec)
635 extern DevPrivateKeyRec g_iGCPrivateKeyRec
;
637 #define g_iGCPrivateKey (&g_iGCPrivateKeyRec)
638 extern DevPrivateKeyRec g_iPixmapPrivateKeyRec
;
640 #define g_iPixmapPrivateKey (&g_iPixmapPrivateKeyRec)
641 extern DevPrivateKeyRec g_iWindowPrivateKeyRec
;
643 #define g_iWindowPrivateKey (&g_iWindowPrivateKeyRec)
645 extern unsigned long g_ulServerGeneration
;
646 extern DWORD g_dwEnginesSupported
;
647 extern HINSTANCE g_hInstance
;
648 extern int g_copyROP
[];
649 extern int g_patternROP
[];
650 extern const char *g_pszQueryHost
;
651 extern DeviceIntPtr g_pwinPointer
;
652 extern DeviceIntPtr g_pwinKeyboard
;
655 * Extern declares for dynamically loaded library function pointers
658 extern FARPROC g_fpDirectDrawCreate
;
659 extern FARPROC g_fpDirectDrawCreateClipper
;
662 * Screen privates macros
665 #define winGetScreenPriv(pScreen) ((winPrivScreenPtr) \
666 dixLookupPrivate(&(pScreen)->devPrivates, g_iScreenPrivateKey))
668 #define winSetScreenPriv(pScreen,v) \
669 dixSetPrivate(&(pScreen)->devPrivates, g_iScreenPrivateKey, v)
671 #define winScreenPriv(pScreen) \
672 winPrivScreenPtr pScreenPriv = winGetScreenPriv(pScreen)
675 * Colormap privates macros
678 #define winGetCmapPriv(pCmap) ((winPrivCmapPtr) \
679 dixLookupPrivate(&(pCmap)->devPrivates, g_iCmapPrivateKey))
681 #define winSetCmapPriv(pCmap,v) \
682 dixSetPrivate(&(pCmap)->devPrivates, g_iCmapPrivateKey, v)
684 #define winCmapPriv(pCmap) \
685 winPrivCmapPtr pCmapPriv = winGetCmapPriv(pCmap)
691 #define winGetGCPriv(pGC) ((winPrivGCPtr) \
692 dixLookupPrivate(&(pGC)->devPrivates, g_iGCPrivateKey))
694 #define winSetGCPriv(pGC,v) \
695 dixSetPrivate(&(pGC)->devPrivates, g_iGCPrivateKey, v)
697 #define winGCPriv(pGC) \
698 winPrivGCPtr pGCPriv = winGetGCPriv(pGC)
701 * Pixmap privates macros
704 #define winGetPixmapPriv(pPixmap) ((winPrivPixmapPtr) \
705 dixLookupPrivate(&(pPixmap)->devPrivates, g_iPixmapPrivateKey))
707 #define winSetPixmapPriv(pPixmap,v) \
708 dixLookupPrivate(&(pPixmap)->devPrivates, g_iPixmapPrivateKey, v)
710 #define winPixmapPriv(pPixmap) \
711 winPrivPixmapPtr pPixmapPriv = winGetPixmapPriv(pPixmap)
714 * Window privates macros
717 #define winGetWindowPriv(pWin) ((winPrivWinPtr) \
718 dixLookupPrivate(&(pWin)->devPrivates, g_iWindowPrivateKey))
720 #define winSetWindowPriv(pWin,v) \
721 dixLookupPrivate(&(pWin)->devPrivates, g_iWindowPrivateKey, v)
723 #define winWindowPriv(pWin) \
724 winPrivWinPtr pWinPriv = winGetWindowPriv(pWin)
729 #define _WIN_WRAP(priv, real, mem, func) {\
730 priv->mem = real->mem; \
734 #define _WIN_UNWRAP(priv, real, mem) {\
735 real->mem = priv->mem; \
738 #define WIN_WRAP(mem, func) _WIN_WRAP(pScreenPriv, pScreen, mem, func)
740 #define WIN_UNWRAP(mem) _WIN_UNWRAP(pScreenPriv, pScreen, mem)
743 * BEGIN DDX and DIX Function Prototypes
751 winAllocatePrivates(ScreenPtr pScreen
);
754 winInitCmapPrivates(ColormapPtr pCmap
, int index
);
757 winAllocateCmapPrivates(ColormapPtr pCmap
);
763 #if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW)
765 winGenerateAuthorization(void);
766 void winSetAuthorization(void);
775 winBlockHandler(ScreenPtr pScreen
,
776 pointer pTimeout
, pointer pReadMask
);
778 #ifdef XWIN_NATIVEGDI
784 winPixmapToRegionNativeGDI(PixmapPtr pPix
);
787 #ifdef XWIN_CLIPBOARD
793 winInitClipboard(void);
796 winFixClipboardChain(void);
804 winSetColormapFunctions(ScreenPtr pScreen
);
807 winCreateDefColormap(ScreenPtr pScreen
);
814 winCreateBoundingWindowFullScreen(ScreenPtr pScreen
);
817 winCreateBoundingWindowWindowed(ScreenPtr pScreen
);
824 winDisplayExitDialog(winPrivScreenPtr pScreenPriv
);
827 winDisplayDepthChangeDialog(winPrivScreenPtr pScreenPriv
);
830 winDisplayAboutDialog(winPrivScreenPtr pScreenPriv
);
837 winDetectSupportedEngines(void);
840 winSetEngine(ScreenPtr pScreen
);
843 winGetDDProcAddresses(void);
846 winReleaseDDProcAddresses(void);
854 OsVendorVErrorF(const char *pszFormat
, va_list va_args
)
855 _X_ATTRIBUTE_PRINTF(1, 0);
859 winMessageBoxF(const char *pszError
, UINT uType
, ...)
860 _X_ATTRIBUTE_PRINTF(1, 3);
862 #ifdef XWIN_NATIVEGDI
869 winFillSpansNativeGDI(DrawablePtr pDrawable
,
872 DDXPointPtr pPoints
, int *pWidths
, int fSorted
);
875 #ifdef XWIN_NATIVEGDI
881 winRealizeFontNativeGDI(ScreenPtr pScreen
, FontPtr pFont
);
884 winUnrealizeFontNativeGDI(ScreenPtr pScreen
, FontPtr pFont
);
887 #ifdef XWIN_NATIVEGDI
893 winCreateGCNativeGDI(GCPtr pGC
);
896 #ifdef XWIN_NATIVEGDI
903 winGetSpansNativeGDI(DrawablePtr pDrawable
,
905 DDXPointPtr pPoints
, int *pWidths
, int nSpans
, char *pDst
);
913 winInitializeGlobals(void);
920 winTranslateKey(WPARAM wParam
, LPARAM lParam
);
923 winKeybdProc(DeviceIntPtr pDeviceInt
, int iState
);
926 winInitializeModeKeyStates(void);
929 winRestoreModeKeyStates(void);
932 winIsFakeCtrl_L(UINT message
, WPARAM wParam
, LPARAM lParam
);
935 winKeybdReleaseKeys(void);
938 winSendKeyEvent(DWORD dwKey
, Bool fDown
);
940 BOOL
winCheckKeyPressed(WPARAM wParam
, LPARAM lParam
);
943 winFixShiftKeys(int iScanCode
);
950 winInstallKeyboardHookLL(void);
953 winRemoveKeyboardHookLL(void);
959 #ifdef XWIN_NATIVEGDI
962 winQueryBestSizeNativeGDI(int class, unsigned short *pWidth
,
963 unsigned short *pHeight
, ScreenPtr pScreen
);
967 winCountBits(DWORD dw
);
970 winUpdateFBPointer(ScreenPtr pScreen
, void *pbits
);
972 #ifdef XWIN_NATIVEGDI
973 BOOL
winPaintBackground(HWND hwnd
, COLORREF colorref
);
981 winMouseProc(DeviceIntPtr pDeviceInt
, int iState
);
984 winMouseWheel(int *iTotalDeltaZ
, int iDeltaZ
, int iButtonUp
, int iButtonDown
);
987 winMouseButtonsSendEvent(int iEventType
, int iButton
);
991 winMouseButtonsHandle(ScreenPtr pScreen
,
992 int iEventType
, int iButton
, WPARAM wParam
);
995 winEnqueueMotion(int x
, int y
);
997 #ifdef XWIN_NATIVEGDI
1003 winCreateDIBNativeGDI(int iWidth
, int iHeight
, int iDepth
,
1004 BYTE
** ppbBits
, BITMAPINFO
** ppbmi
);
1007 winSetEngineFunctionsNativeGDI(ScreenPtr pScreen
);
1010 #ifdef XWIN_PRIMARYFB
1016 winSetEngineFunctionsPrimaryDD(ScreenPtr pScreen
);
1019 #ifdef XWIN_NATIVEGDI
1026 winCreatePixmapNativeGDI(ScreenPtr pScreen
, int width
, int height
, int depth
,
1027 unsigned usage_hint
);
1030 winDestroyPixmapNativeGDI(PixmapPtr pPixmap
);
1034 winModifyPixmapHeaderNativeGDI(PixmapPtr pPixmap
,
1035 int iWidth
, int iHeight
,
1038 int devKind
, pointer pPixData
);
1041 #ifdef XWIN_NATIVEGDI
1048 winPolyLineNativeGDI(DrawablePtr pDrawable
,
1049 GCPtr pGC
, int mode
, int npt
, DDXPointPtr ppt
);
1056 winScreenInit(ScreenPtr pScreen
, int argc
, char **argv
);
1059 winFinishScreenInitFB(int index
, ScreenPtr pScreen
, int argc
, char **argv
);
1061 #if defined(XWIN_NATIVEGDI)
1064 winFinishScreenInitNativeGDI(int index
,
1065 ScreenPtr pScreen
, int argc
, char **argv
);
1068 #ifdef XWIN_NATIVEGDI
1075 winSetSpansNativeGDI(DrawablePtr pDrawable
,
1078 DDXPointPtr pPoints
, int *pWidth
, int nSpans
, int fSorted
);
1086 winSetEngineFunctionsShadowDD(ScreenPtr pScreen
);
1093 winSetEngineFunctionsShadowDDNL(ScreenPtr pScreen
);
1100 winSetEngineFunctionsShadowGDI(ScreenPtr pScreen
);
1108 winWakeupHandler(ScreenPtr pScreen
,
1109 unsigned long ulResult
, pointer pReadmask
);
1115 #ifdef XWIN_NATIVEGDI
1117 winCreateWindowNativeGDI(WindowPtr pWin
);
1120 winDestroyWindowNativeGDI(WindowPtr pWin
);
1123 winPositionWindowNativeGDI(WindowPtr pWin
, int x
, int y
);
1127 winCopyWindowNativeGDI(WindowPtr pWin
, DDXPointRec ptOldOrg
, RegionPtr prgnSrc
);
1130 winChangeWindowAttributesNativeGDI(WindowPtr pWin
, unsigned long mask
);
1133 winUnmapWindowNativeGDI(WindowPtr pWindow
);
1136 winMapWindowNativeGDI(WindowPtr pWindow
);
1140 winCreateWindowRootless(WindowPtr pWindow
);
1143 winDestroyWindowRootless(WindowPtr pWindow
);
1146 winPositionWindowRootless(WindowPtr pWindow
, int x
, int y
);
1149 winChangeWindowAttributesRootless(WindowPtr pWindow
, unsigned long mask
);
1152 winUnmapWindowRootless(WindowPtr pWindow
);
1155 winMapWindowRootless(WindowPtr pWindow
);
1158 winSetShapeRootless(WindowPtr pWindow
, int kind
);
1160 #ifdef XWIN_MULTIWINDOW
1162 * winmultiwindowshape.c
1166 winReshapeMultiWindow(WindowPtr pWin
);
1169 winSetShapeMultiWindow(WindowPtr pWindow
, int kind
);
1172 winUpdateRgnMultiWindow(WindowPtr pWindow
);
1175 #ifdef XWIN_MULTIWINDOW
1177 * winmultiwindowwindow.c
1181 winCreateWindowMultiWindow(WindowPtr pWindow
);
1184 winDestroyWindowMultiWindow(WindowPtr pWindow
);
1187 winPositionWindowMultiWindow(WindowPtr pWindow
, int x
, int y
);
1190 winChangeWindowAttributesMultiWindow(WindowPtr pWindow
, unsigned long mask
);
1193 winUnmapWindowMultiWindow(WindowPtr pWindow
);
1196 winMapWindowMultiWindow(WindowPtr pWindow
);
1199 winReparentWindowMultiWindow(WindowPtr pWin
, WindowPtr pPriorParent
);
1202 winRestackWindowMultiWindow(WindowPtr pWin
, WindowPtr pOldNextSib
);
1205 winReorderWindowsMultiWindow(void);
1209 winResizeWindowMultiWindow(WindowPtr pWin
, int x
, int y
, unsigned int w
,
1210 unsigned int h
, WindowPtr pSib
);
1213 winMoveWindowMultiWindow(WindowPtr pWin
, int x
, int y
,
1214 WindowPtr pSib
, VTKind kind
);
1218 winCopyWindowMultiWindow(WindowPtr pWin
, DDXPointRec oldpt
,
1219 RegionPtr oldRegion
);
1222 winGetWindowID(WindowPtr pWin
);
1225 winAdjustXWindow(WindowPtr pWin
, HWND hwnd
);
1228 #ifdef XWIN_MULTIWINDOW
1230 * winmultiwindowwndproc.c
1234 winTopLevelWindowProc(HWND hwnd
, UINT message
, WPARAM wParam
, LPARAM lParam
);
1242 winInitNotifyIcon(winPrivScreenPtr pScreenPriv
);
1245 winDeleteNotifyIcon(winPrivScreenPtr pScreenPriv
);
1248 winHandleIconMessage(HWND hwnd
, UINT message
,
1249 WPARAM wParam
, LPARAM lParam
,
1250 winPrivScreenPtr pScreenPriv
);
1257 winWindowProc(HWND hWnd
, UINT message
, WPARAM wParam
, LPARAM lParam
);
1259 #ifdef XWIN_MULTIWINDOWEXTWM
1261 * winwin32rootless.c
1266 winMWExtWMCreateFrame(RootlessWindowPtr pFrame
, ScreenPtr pScreen
,
1267 int newX
, int newY
, RegionPtr pShape
);
1270 winMWExtWMDestroyFrame(RootlessFrameID wid
);
1274 winMWExtWMMoveFrame(RootlessFrameID wid
, ScreenPtr pScreen
, int newX
, int newY
);
1278 winMWExtWMResizeFrame(RootlessFrameID wid
, ScreenPtr pScreen
,
1279 int newX
, int newY
, unsigned int newW
, unsigned int newH
,
1280 unsigned int gravity
);
1283 winMWExtWMRestackFrame(RootlessFrameID wid
, RootlessFrameID nextWid
);
1286 winMWExtWMReshapeFrame(RootlessFrameID wid
, RegionPtr pShape
);
1289 winMWExtWMUnmapFrame(RootlessFrameID wid
);
1293 winMWExtWMStartDrawing(RootlessFrameID wid
, char **pixelData
, int *bytesPerRow
);
1296 winMWExtWMStopDrawing(RootlessFrameID wid
, Bool flush
);
1299 winMWExtWMUpdateRegion(RootlessFrameID wid
, RegionPtr pDamage
);
1303 winMWExtWMDamageRects(RootlessFrameID wid
, int count
, const BoxRec
* rects
,
1304 int shift_x
, int shift_y
);
1307 winMWExtWMRootlessSwitchWindow(RootlessWindowPtr pFrame
, WindowPtr oldWin
);
1311 winMWExtWMCopyBytes(unsigned int width
, unsigned int height
,
1312 const void *src
, unsigned int srcRowBytes
,
1313 void *dst
, unsigned int dstRowBytes
);
1317 winMWExtWMCopyWindow(RootlessFrameID wid
, int dstNrects
,
1318 const BoxRec
* dstRects
, int dx
, int dy
);
1321 #ifdef XWIN_MULTIWINDOWEXTWM
1323 * winwin32rootlesswindow.c
1327 winMWExtWMReorderWindows(ScreenPtr pScreen
);
1330 winMWExtWMMoveXWindow(WindowPtr pWin
, int x
, int y
);
1333 winMWExtWMResizeXWindow(WindowPtr pWin
, int w
, int h
);
1336 winMWExtWMMoveResizeXWindow(WindowPtr pWin
, int x
, int y
, int w
, int h
);
1339 winMWExtWMUpdateIcon(Window id
);
1343 winMWExtWMUpdateWindowDecoration(win32RootlessWindowPtr pRLWinPriv
,
1344 winScreenInfoPtr pScreenInfo
);
1346 wBOOL CALLBACK
winMWExtWMDecorateWindow(HWND hwnd
, LPARAM lParam
);
1349 winIsInternalWMRunning(winScreenInfoPtr pScreenInfo
);
1352 winMWExtWMRestackWindows(ScreenPtr pScreen
);
1355 #ifdef XWIN_MULTIWINDOWEXTWM
1357 * winwin32rootlesswndproc.c
1361 winMWExtWMWindowProc(HWND hwnd
, UINT message
, WPARAM wParam
, LPARAM lParam
);
1370 winWindowsWMSendEvent(int type
, unsigned int mask
, int which
, int arg
,
1371 Window window
, int x
, int y
, int w
, int h
);
1374 winWindowsWMExtensionInit(void);
1381 winInitCursor(ScreenPtr pScreen
);
1387 winInitializeScreens(int maxscreens
);
1393 winRandRInit(ScreenPtr pScreen
);
1396 winDoRandRScreenSetSize(ScreenPtr pScreen
,
1398 CARD16 height
, CARD32 mmWidth
, CARD32 mmHeight
);
1404 winCreateMsgWindowThread(void);
1407 * END DDX and DIX Function Prototypes
1410 #endif /* _WIN_H_ */