OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef WAYLAND_MESSAGE_PUMP_H_ |
| 6 #define WAYLAND_MESSAGE_PUMP_H_ |
| 7 |
| 8 #include <glib.h> |
| 9 #include <stdint.h> |
| 10 |
| 11 class WaylandDisplay; |
| 12 |
| 13 class WaylandMessagePump { |
| 14 public: |
| 15 WaylandMessagePump(WaylandDisplay* display); |
| 16 virtual ~WaylandMessagePump(); |
| 17 |
| 18 protected: |
| 19 virtual int HandlePrepare(); |
| 20 virtual bool HandleCheck(); |
| 21 virtual void HandleDispatch(); |
| 22 private: |
| 23 struct WorkSource : public GSource { |
| 24 WaylandMessagePump* pump; |
| 25 }; |
| 26 |
| 27 static gboolean SourcePrepare(GSource* source, gint* timeout); |
| 28 static gboolean SourceCheck(GSource* source); |
| 29 static gboolean SourceDispatch(GSource* source, |
| 30 GSourceFunc callback, |
| 31 gpointer data); |
| 32 static int SourceUpdate(uint32_t mask, void* data); |
| 33 |
| 34 WaylandDisplay* display_; |
| 35 WorkSource* source_; |
| 36 GPollFD pfd_; |
| 37 uint32_t mask_; |
| 38 }; |
| 39 |
| 40 #endif |
OLD | NEW |