More code moved to the X11 driver (bitmap and palette and misc).
[wine] / windows / event.c
1 /*
2  * X events handling functions
3  * 
4  * Copyright 1993 Alexandre Julliard
5  * 
6  */
7
8 #include "message.h"
9
10 /**********************************************************************/
11
12 EVENT_DRIVER *EVENT_Driver = NULL;
13
14 /***********************************************************************
15  *              EVENT_Init
16  *
17  * Initialize network IO.
18  */
19 BOOL EVENT_Init(void)
20 {
21   return EVENT_Driver->pInit();
22 }
23
24 /***********************************************************************
25  *              EVENT_AddIO 
26  */
27 void EVENT_AddIO(int fd, unsigned io_type)
28 {
29   EVENT_Driver->pAddIO(fd, io_type);
30 }
31
32 /***********************************************************************
33  *              EVENT_DeleteIO 
34  */
35 void EVENT_DeleteIO(int fd, unsigned io_type)
36 {
37   EVENT_Driver->pDeleteIO(fd, io_type);
38 }
39
40 /***********************************************************************
41  *              EVENT_WaitNetEvent
42  *
43  * Wait for a network event, optionally sleeping until one arrives.
44  * Return TRUE if an event is pending, FALSE on timeout or error
45  * (for instance lost connection with the server).
46  */
47 BOOL EVENT_WaitNetEvent(BOOL sleep, BOOL peek)
48 {
49   return EVENT_Driver->pWaitNetEvent(sleep, peek);
50 }
51
52 /***********************************************************************
53  *              EVENT_Synchronize
54  *
55  * Synchronize with the X server. Should not be used too often.
56  */
57 void EVENT_Synchronize(void)
58 {
59   EVENT_Driver->pSynchronize();
60 }
61
62 /**********************************************************************
63  *              EVENT_CheckFocus
64  */
65 BOOL EVENT_CheckFocus(void)
66 {
67   return EVENT_Driver->pCheckFocus();
68 }
69
70 /***********************************************************************
71  *              EVENT_QueryPointer
72  */
73 BOOL EVENT_QueryPointer(DWORD *posX, DWORD *posY, DWORD *state)
74 {
75   return EVENT_Driver->pQueryPointer(posX, posY, state);
76 }
77
78
79 /***********************************************************************
80  *              EVENT_DummyMotionNotify
81  *
82  * Generate a dummy MotionNotify event. Used to force a WM_SETCURSOR message.
83  */
84 void EVENT_DummyMotionNotify(void)
85 {
86   EVENT_Driver->pDummyMotionNotify();
87 }
88
89 /**********************************************************************
90  *              EVENT_Pending
91  */
92 BOOL EVENT_Pending()
93 {
94   return EVENT_Driver->pPending();
95 }
96
97 /***********************************************************************
98  *              IsUserIdle      (USER.333)
99  *
100  * Check if we have pending X events.
101  */
102 BOOL16 WINAPI IsUserIdle16(void)
103 {
104   return EVENT_Driver->pIsUserIdle();
105 }
106
107 /***********************************************************************
108  *              EVENT_WakeUp
109  *
110  * Wake up the scheduler (EVENT_WaitNetEvent). Use by 32 bit thread
111  * when thew want signaled an event to a 16 bit task. This function
112  * will become obsolete when an Asynchronous thread will be implemented
113  */
114 void EVENT_WakeUp(void)
115 {
116   EVENT_Driver->pWakeUp();
117 }