OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 BASE_MESSAGE_PUMP_GTK_H_ | 5 #ifndef BASE_MESSAGE_PUMP_GTK_H_ |
6 #define BASE_MESSAGE_PUMP_GTK_H_ | 6 #define BASE_MESSAGE_PUMP_GTK_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/message_pump_glib.h" | 9 #include "base/message_pump_glib.h" |
10 | 10 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 virtual ~MessagePumpGtk(); | 47 virtual ~MessagePumpGtk(); |
48 | 48 |
49 // Dispatch an available GdkEvent. Essentially this allows a subclass to do | 49 // Dispatch an available GdkEvent. Essentially this allows a subclass to do |
50 // some task before/after calling the default handler (EventDispatcher). | 50 // some task before/after calling the default handler (EventDispatcher). |
51 void DispatchEvents(GdkEvent* event); | 51 void DispatchEvents(GdkEvent* event); |
52 | 52 |
53 // Returns default X Display. | 53 // Returns default X Display. |
54 static Display* GetDefaultXDisplay(); | 54 static Display* GetDefaultXDisplay(); |
55 | 55 |
56 private: | 56 private: |
57 // Overridden from MessagePumpGlib | |
58 virtual bool RunOnce(GMainContext* context, bool block) OVERRIDE; | |
59 | |
60 // Invoked from EventDispatcher. Notifies all observers we're about to | 57 // Invoked from EventDispatcher. Notifies all observers we're about to |
61 // process an event. | 58 // process an event. |
62 void WillProcessEvent(GdkEvent* event); | 59 void WillProcessEvent(GdkEvent* event); |
63 | 60 |
64 // Invoked from EventDispatcher. Notifies all observers we processed an | 61 // Invoked from EventDispatcher. Notifies all observers we processed an |
65 // event. | 62 // event. |
66 void DidProcessEvent(GdkEvent* event); | 63 void DidProcessEvent(GdkEvent* event); |
67 | 64 |
68 // Callback prior to gdk dispatching an event. | 65 // Callback prior to gdk dispatching an event. |
69 static void EventDispatcher(GdkEvent* event, void* data); | 66 static void EventDispatcher(GdkEvent* event, void* data); |
70 | 67 |
71 DISALLOW_COPY_AND_ASSIGN(MessagePumpGtk); | 68 DISALLOW_COPY_AND_ASSIGN(MessagePumpGtk); |
72 }; | 69 }; |
73 | 70 |
74 typedef MessagePumpGtk MessagePumpForUI; | 71 typedef MessagePumpGtk MessagePumpForUI; |
75 | 72 |
76 } // namespace base | 73 } // namespace base |
77 | 74 |
78 #endif // BASE_MESSAGE_PUMP_GTK_H_ | 75 #endif // BASE_MESSAGE_PUMP_GTK_H_ |
OLD | NEW |