| 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 26 matching lines...) Expand all Loading... |
| 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_EXPORT MessagePumpGtk : public MessagePumpGlib { | 44 class BASE_EXPORT MessagePumpGtk : public MessagePumpGlib { |
| 45 public: | 45 public: |
| 46 MessagePumpGtk(); | 46 MessagePumpGtk(); |
| 47 virtual ~MessagePumpGtk(); | |
| 48 | 47 |
| 49 // Dispatch an available GdkEvent. Essentially this allows a subclass to do | 48 // Dispatch an available GdkEvent. Essentially this allows a subclass to do |
| 50 // some task before/after calling the default handler (EventDispatcher). | 49 // some task before/after calling the default handler (EventDispatcher). |
| 51 void DispatchEvents(GdkEvent* event); | 50 void DispatchEvents(GdkEvent* event); |
| 52 | 51 |
| 53 // Returns default X Display. | 52 // Returns default X Display. |
| 54 static Display* GetDefaultXDisplay(); | 53 static Display* GetDefaultXDisplay(); |
| 55 | 54 |
| 55 protected: |
| 56 virtual ~MessagePumpGtk(); |
| 57 |
| 56 private: | 58 private: |
| 57 // Invoked from EventDispatcher. Notifies all observers we're about to | 59 // Invoked from EventDispatcher. Notifies all observers we're about to |
| 58 // process an event. | 60 // process an event. |
| 59 void WillProcessEvent(GdkEvent* event); | 61 void WillProcessEvent(GdkEvent* event); |
| 60 | 62 |
| 61 // Invoked from EventDispatcher. Notifies all observers we processed an | 63 // Invoked from EventDispatcher. Notifies all observers we processed an |
| 62 // event. | 64 // event. |
| 63 void DidProcessEvent(GdkEvent* event); | 65 void DidProcessEvent(GdkEvent* event); |
| 64 | 66 |
| 65 // Callback prior to gdk dispatching an event. | 67 // Callback prior to gdk dispatching an event. |
| 66 static void EventDispatcher(GdkEvent* event, void* data); | 68 static void EventDispatcher(GdkEvent* event, void* data); |
| 67 | 69 |
| 68 DISALLOW_COPY_AND_ASSIGN(MessagePumpGtk); | 70 DISALLOW_COPY_AND_ASSIGN(MessagePumpGtk); |
| 69 }; | 71 }; |
| 70 | 72 |
| 71 typedef MessagePumpGtk MessagePumpForUI; | 73 typedef MessagePumpGtk MessagePumpForUI; |
| 72 | 74 |
| 73 } // namespace base | 75 } // namespace base |
| 74 | 76 |
| 75 #endif // BASE_MESSAGE_PUMP_GTK_H_ | 77 #endif // BASE_MESSAGE_PUMP_GTK_H_ |
| OLD | NEW |