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 23 matching lines...) Expand all Loading... |
34 public: | 34 public: |
35 // Dispatches the event. If true is returned processing continues as | 35 // Dispatches the event. If true is returned processing continues as |
36 // normal. If false is returned, the nested loop exits immediately. | 36 // normal. If false is returned, the nested loop exits immediately. |
37 virtual bool Dispatch(GdkEvent* event) = 0; | 37 virtual bool Dispatch(GdkEvent* event) = 0; |
38 | 38 |
39 protected: | 39 protected: |
40 virtual ~MessagePumpDispatcher() {} | 40 virtual ~MessagePumpDispatcher() {} |
41 }; | 41 }; |
42 | 42 |
43 // This class implements a message-pump for dispatching GTK events. | 43 // This class implements a message-pump for dispatching GTK events. |
44 class BASE_API MessagePumpGtk : public MessagePumpGlib { | 44 class BASE_EXPORT MessagePumpGtk : public MessagePumpGlib { |
45 public: | 45 public: |
46 MessagePumpGtk(); | 46 MessagePumpGtk(); |
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(); |
(...skipping 14 matching lines...) Expand all Loading... |
69 static void EventDispatcher(GdkEvent* event, void* data); | 69 static void EventDispatcher(GdkEvent* event, void* data); |
70 | 70 |
71 DISALLOW_COPY_AND_ASSIGN(MessagePumpGtk); | 71 DISALLOW_COPY_AND_ASSIGN(MessagePumpGtk); |
72 }; | 72 }; |
73 | 73 |
74 typedef MessagePumpGtk MessagePumpForUI; | 74 typedef MessagePumpGtk MessagePumpForUI; |
75 | 75 |
76 } // namespace base | 76 } // namespace base |
77 | 77 |
78 #endif // BASE_MESSAGE_PUMP_GTK_H_ | 78 #endif // BASE_MESSAGE_PUMP_GTK_H_ |
OLD | NEW |