Make GetCursorPos call XQueryPointer.
[wine] / include / queue.h
1 /*
2  * Message queues definitions
3  *
4  * Copyright 1993 Alexandre Julliard
5  */
6
7 #ifndef __WINE_QUEUE_H
8 #define __WINE_QUEUE_H
9
10 #include "windef.h"
11 #include "winbase.h"
12 #include "wingdi.h"
13 #include "winuser.h"
14 #include "thread.h"
15
16
17   /* Message as stored in the queue (contains the extraInfo field) */
18 typedef struct tagQMSG
19 {
20     int   kind;   /* message kind (sent,posted,hardware) */
21     int   type;
22     MSG   msg;
23     DWORD extraInfo;  /* Only in 3.1 */
24 } QMSG;
25
26 #define QMSG_WIN16    0
27 #define QMSG_WIN32A   1
28 #define QMSG_WIN32W   2
29 #define QMSG_HARDWARE 3
30
31
32 /* Per-queue data for the message queue
33  * Note that we currently only store the current values for
34  * Active, Capture and Focus windows currently.
35  * It might be necessary to store a pointer to the system message queue
36  * as well since windows 9x maintains per thread system message queues
37  */
38 typedef struct tagPERQUEUEDATA      
39 {
40   HWND    hWndFocus;              /* Focus window */
41   HWND    hWndActive;             /* Active window */
42   HWND    hWndCapture;            /* Capture window */
43   INT16     nCaptureHT;             /* Capture info (hit-test) */
44   ULONG     ulRefCount;             /* Reference count */
45   CRITICAL_SECTION cSection;        /* Critical section for thread safe access */
46 } PERQUEUEDATA;
47
48 /* Message queue */
49 typedef struct tagMESSAGEQUEUE
50 {
51   HQUEUE16  self;                   /* Handle to self (was: reserved) */
52   TEB*      teb;                    /* Thread owning queue */
53   HANDLE    server_queue;           /* Handle to server-side queue */
54
55   DWORD     magic;                  /* magic number should be QUEUE_MAGIC */
56   DWORD     lockCount;              /* reference counter */
57
58   DWORD     GetMessageTimeVal;      /* Value for GetMessageTime */
59   DWORD     GetMessagePosVal;       /* Value for GetMessagePos */
60   DWORD     GetMessageExtraInfoVal; /* Value for GetMessageExtraInfo */
61
62   HANDLE16  hCurHook;               /* Current hook */
63   HANDLE16  hooks[WH_NB_HOOKS];     /* Task hooks list */
64
65   PERQUEUEDATA *pQData;             /* pointer to (shared) PERQUEUEDATA structure */
66   
67 } MESSAGEQUEUE;
68
69
70 #define QUEUE_MAGIC        0xD46E80AF
71
72 /* Per queue data management methods */
73 HWND PERQDATA_GetFocusWnd( PERQUEUEDATA *pQData );
74 HWND PERQDATA_SetFocusWnd( PERQUEUEDATA *pQData, HWND hWndFocus );
75 HWND PERQDATA_GetActiveWnd( PERQUEUEDATA *pQData );
76 HWND PERQDATA_SetActiveWnd( PERQUEUEDATA *pQData, HWND hWndActive );
77 HWND PERQDATA_GetCaptureWnd( INT *hittest );
78 HWND PERQDATA_SetCaptureWnd( HWND hWndCapture, INT hittest );
79
80 /* Message queue management methods */
81 extern MESSAGEQUEUE *QUEUE_Lock( HQUEUE16 hQueue );
82 extern void QUEUE_Unlock( MESSAGEQUEUE *queue );
83 extern BOOL QUEUE_IsExitingQueue( HQUEUE16 hQueue );
84 extern void QUEUE_SetExitingQueue( HQUEUE16 hQueue );
85 extern int QUEUE_WaitBits( WORD bits, DWORD timeout );
86 extern BOOL QUEUE_DeleteMsgQueue( HQUEUE16 hQueue );
87 extern HTASK16 QUEUE_GetQueueTask( HQUEUE16 hQueue );
88 extern BOOL QUEUE_FindMsg( HWND hwnd, UINT first, UINT last, BOOL remove, QMSG *msg );
89 extern void QUEUE_CleanupWindow( HWND hwnd );
90
91 extern HQUEUE16 WINAPI InitThreadInput16( WORD unknown, WORD flags );
92
93 #endif  /* __WINE_QUEUE_H */