2 * X events handling functions
4 * Copyright 1993 Alexandre Julliard
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 /***********************************************************************
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 /***********************************************************************
33 * Initialize network IO.
37 return EVENT_GetDriver()->pInit();
40 /***********************************************************************
43 void EVENT_AddIO(int fd, unsigned io_type)
45 EVENT_GetDriver()->pAddIO(fd, io_type);
48 /***********************************************************************
51 void EVENT_DeleteIO(int fd, unsigned io_type)
53 EVENT_GetDriver()->pDeleteIO(fd, io_type);
56 /***********************************************************************
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 /***********************************************************************
71 * Synchronize with the X server. Should not be used too often.
73 void EVENT_Synchronize(void)
75 EVENT_GetDriver()->pSynchronize();
78 /**********************************************************************
81 BOOL EVENT_CheckFocus(void)
83 return EVENT_GetDriver()->pCheckFocus();
86 /***********************************************************************
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
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 /***********************************************************************
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();