Make dinput a properly separated dll.
[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 #define WH_NB_HOOKS (WH_MAXHOOK-WH_MINHOOK+1)
17
18 /* Per-queue data for the message queue
19  * Note that we currently only store the current values for
20  * Active, Capture and Focus windows currently.
21  * It might be necessary to store a pointer to the system message queue
22  * as well since windows 9x maintains per thread system message queues
23  */
24 typedef struct tagPERQUEUEDATA      
25 {
26   HWND    hWndFocus;              /* Focus window */
27   HWND    hWndActive;             /* Active window */
28   HWND    hWndCapture;            /* Capture window */
29   INT16     nCaptureHT;             /* Capture info (hit-test) */
30   ULONG     ulRefCount;             /* Reference count */
31   CRITICAL_SECTION cSection;        /* Critical section for thread safe access */
32 } PERQUEUEDATA;
33
34 struct received_message_info;
35
36 /* Message queue */
37 typedef struct tagMESSAGEQUEUE
38 {
39   HQUEUE16  self;                   /* Handle to self (was: reserved) */
40   TEB*      teb;                    /* Thread owning queue */
41   HANDLE    server_queue;           /* Handle to server-side queue */
42   struct received_message_info *receive_info; /* Info about message being currently received */
43
44   DWORD     magic;                  /* magic number should be QUEUE_MAGIC */
45   DWORD     lockCount;              /* reference counter */
46
47   DWORD     GetMessageTimeVal;      /* Value for GetMessageTime */
48   DWORD     GetMessagePosVal;       /* Value for GetMessagePos */
49   DWORD     GetMessageExtraInfoVal; /* Value for GetMessageExtraInfo */
50
51   HANDLE16  hCurHook;               /* Current hook */
52   HANDLE16  hooks[WH_NB_HOOKS];     /* Task hooks list */
53
54   PERQUEUEDATA *pQData;             /* pointer to (shared) PERQUEUEDATA structure */
55   
56 } MESSAGEQUEUE;
57
58
59 #define QUEUE_MAGIC        0xD46E80AF
60
61 /* Per queue data management methods */
62 HWND PERQDATA_GetFocusWnd( PERQUEUEDATA *pQData );
63 HWND PERQDATA_SetFocusWnd( PERQUEUEDATA *pQData, HWND hWndFocus );
64 HWND PERQDATA_GetActiveWnd( PERQUEUEDATA *pQData );
65 HWND PERQDATA_SetActiveWnd( PERQUEUEDATA *pQData, HWND hWndActive );
66 HWND PERQDATA_GetCaptureWnd( INT *hittest );
67 HWND PERQDATA_SetCaptureWnd( HWND hWndCapture, INT hittest );
68
69 /* Message queue management methods */
70 extern MESSAGEQUEUE *QUEUE_Current(void);
71 extern MESSAGEQUEUE *QUEUE_Lock( HQUEUE16 hQueue );
72 extern void QUEUE_Unlock( MESSAGEQUEUE *queue );
73 extern void QUEUE_DeleteMsgQueue(void);
74
75 #endif  /* __WINE_QUEUE_H */