OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_EVENTS_PLATFORM_X11_X11_EVENT_SOURCE_H_ | 5 #ifndef UI_EVENTS_PLATFORM_X11_X11_EVENT_SOURCE_H_ |
6 #define UI_EVENTS_PLATFORM_X11_X11_EVENT_SOURCE_H_ | 6 #define UI_EVENTS_PLATFORM_X11_X11_EVENT_SOURCE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
44 ~X11EventSource(); | 44 ~X11EventSource(); |
45 | 45 |
46 static bool HasInstance(); | 46 static bool HasInstance(); |
47 | 47 |
48 static X11EventSource* GetInstance(); | 48 static X11EventSource* GetInstance(); |
49 | 49 |
50 // Called when there is a new XEvent available. Processes all (if any) | 50 // Called when there is a new XEvent available. Processes all (if any) |
51 // available X events. | 51 // available X events. |
52 void DispatchXEvents(); | 52 void DispatchXEvents(); |
53 | 53 |
54 // Dispatches a given event immediately. This is to faciliate sequential | |
sadrul
2016/08/17 01:03:10
*facilitate
dtapuska
2016/08/17 18:06:35
Done.
| |
55 // interaction between the gtk event loop (used for IME) and the | |
56 // main X11 event loop. | |
57 void DispatchXEventNow(XEvent* event); | |
58 | |
54 // Blocks on the X11 event queue until we receive notification from the | 59 // Blocks on the X11 event queue until we receive notification from the |
55 // xserver that |w| has been mapped; StructureNotifyMask events on |w| are | 60 // xserver that |w| has been mapped; StructureNotifyMask events on |w| are |
56 // pulled out from the queue and dispatched out of order. | 61 // pulled out from the queue and dispatched out of order. |
57 // | 62 // |
58 // For those that know X11, this is really a wrapper around XWindowEvent | 63 // For those that know X11, this is really a wrapper around XWindowEvent |
59 // which still makes sure the preempted event is dispatched instead of | 64 // which still makes sure the preempted event is dispatched instead of |
60 // dropped on the floor. This method exists because mapping a window is | 65 // dropped on the floor. This method exists because mapping a window is |
61 // asynchronous (and we receive an XEvent when mapped), while there are also | 66 // asynchronous (and we receive an XEvent when mapped), while there are also |
62 // functions which require a mapped window. | 67 // functions which require a mapped window. |
63 void BlockUntilWindowMapped(XID window); | 68 void BlockUntilWindowMapped(XID window); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
108 bool continue_stream_ = true; | 113 bool continue_stream_ = true; |
109 | 114 |
110 std::unique_ptr<X11HotplugEventHandler> hotplug_event_handler_; | 115 std::unique_ptr<X11HotplugEventHandler> hotplug_event_handler_; |
111 | 116 |
112 DISALLOW_COPY_AND_ASSIGN(X11EventSource); | 117 DISALLOW_COPY_AND_ASSIGN(X11EventSource); |
113 }; | 118 }; |
114 | 119 |
115 } // namespace ui | 120 } // namespace ui |
116 | 121 |
117 #endif // UI_EVENTS_PLATFORM_X11_X11_EVENT_SOURCE_H_ | 122 #endif // UI_EVENTS_PLATFORM_X11_X11_EVENT_SOURCE_H_ |
OLD | NEW |