Authors: Adrian Thurston <adriant@corel.ca>, Zygo Blaxell <zblaxell@corel.ca>
[wine/multimedia.git] / windows / event.c
blob5e683b070501dfd4eafc03e2e9d146805a40e89d
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 BOOL32 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 BOOL32 EVENT_WaitNetEvent(BOOL32 sleep, BOOL32 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 BOOL32 EVENT_CheckFocus(void)
83 return EVENT_GetDriver()->pCheckFocus();
86 /***********************************************************************
87 * EVENT_QueryPointer
89 BOOL32 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 BOOL32 EVENT_Pending()
110 return EVENT_GetDriver()->pPending();
113 /***********************************************************************
114 * IsUserIdle (USER.333)
116 * Check if we have pending X events.
118 BOOL16 WINAPI IsUserIdle(void)
120 return EVENT_GetDriver()->pIsUserIdle();