CLIENT_WaitReply: don't clear last error on success; fixed callers
[wine/multimedia.git] / windows / event.c
blob636cb113ec1a2e0405525084a84df66ac43615f5
1 /*
2 * X events handling functions
3 *
4 * Copyright 1993 Alexandre Julliard
5 *
6 */
8 #include "config.h"
10 #include "message.h"
12 #ifndef X_DISPLAY_MISSING
13 extern EVENT_DRIVER X11DRV_EVENT_Driver;
14 #else /* X_DISPLAY_MISSING */
15 extern EVENT_DRIVER TTYDRV_EVENT_Driver;
16 #endif /* X_DISPLAY_MISSING */
18 /***********************************************************************
19 * EVENT_GetDriver
21 EVENT_DRIVER *EVENT_GetDriver(void)
23 #ifndef X_DISPLAY_MISSING
24 return &X11DRV_EVENT_Driver;
25 #else /* X_DISPLAY_MISSING */
26 return &TTYDRV_EVENT_Driver;
27 #endif /* X_DISPLAY_MISSING */
30 /***********************************************************************
31 * EVENT_Init
33 * Initialize network IO.
35 BOOL EVENT_Init(void)
37 return EVENT_GetDriver()->pInit();
40 /***********************************************************************
41 * EVENT_AddIO
43 void EVENT_AddIO(int fd, unsigned io_type)
45 EVENT_GetDriver()->pAddIO(fd, io_type);
48 /***********************************************************************
49 * EVENT_DeleteIO
51 void EVENT_DeleteIO(int fd, unsigned io_type)
53 EVENT_GetDriver()->pDeleteIO(fd, io_type);
56 /***********************************************************************
57 * EVENT_WaitNetEvent
59 * Wait for a network event, optionally sleeping until one arrives.
60 * Return TRUE if an event is pending, FALSE on timeout or error
61 * (for instance lost connection with the server).
63 BOOL EVENT_WaitNetEvent(BOOL sleep, BOOL peek)
65 return EVENT_GetDriver()->pWaitNetEvent(sleep, peek);
68 /***********************************************************************
69 * EVENT_Synchronize
71 * Synchronize with the X server. Should not be used too often.
73 void EVENT_Synchronize(void)
75 EVENT_GetDriver()->pSynchronize();
78 /**********************************************************************
79 * EVENT_CheckFocus
81 BOOL EVENT_CheckFocus(void)
83 return EVENT_GetDriver()->pCheckFocus();
86 /***********************************************************************
87 * EVENT_QueryPointer
89 BOOL EVENT_QueryPointer(DWORD *posX, DWORD *posY, DWORD *state)
91 return EVENT_GetDriver()->pQueryPointer(posX, posY, state);
95 /***********************************************************************
96 * EVENT_DummyMotionNotify
98 * Generate a dummy MotionNotify event. Used to force a WM_SETCURSOR message.
100 void EVENT_DummyMotionNotify(void)
102 EVENT_GetDriver()->pDummyMotionNotify();
105 /**********************************************************************
106 * X11DRV_EVENT_Pending
108 BOOL EVENT_Pending()
110 return EVENT_GetDriver()->pPending();
113 /***********************************************************************
114 * IsUserIdle (USER.333)
116 * Check if we have pending X events.
118 BOOL16 WINAPI IsUserIdle16(void)
120 return EVENT_GetDriver()->pIsUserIdle();
123 /***********************************************************************
124 * EVENT_WakeUp
126 * Wake up the scheduler (EVENT_WaitNetEvent). Use by 32 bit thread
127 * when thew want signaled an event to a 16 bit task. This function
128 * will become obsolete when an Asynchronous thread will be implemented
130 void EVENT_WakeUp(void)
132 EVENT_GetDriver()->pWakeUp();