Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(242)

Unified Diff: ui/events/platform/x11/x11_event_source_glib.h

Issue 1602173005: Add PlatformWindow/Event related code for Ozone X11. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Final fixes for comments + tests. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/events/platform/x11/x11_event_source.cc ('k') | ui/events/platform/x11/x11_event_source_glib.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/platform/x11/x11_event_source_glib.h
diff --git a/ui/events/platform/x11/x11_event_source_glib.h b/ui/events/platform/x11/x11_event_source_glib.h
new file mode 100644
index 0000000000000000000000000000000000000000..67a38b1b856e26650bb817b247c1ecc11387ff10
--- /dev/null
+++ b/ui/events/platform/x11/x11_event_source_glib.h
@@ -0,0 +1,53 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_EVENTS_PLATFORM_X11_X11_EVENT_SOURCE_GLIB_H_
+#define UI_EVENTS_PLATFORM_X11_X11_EVENT_SOURCE_GLIB_H_
+
+#include <stdint.h>
+
+#include "base/macros.h"
+#include "base/memory/scoped_ptr.h"
+#include "ui/events/events_export.h"
+#include "ui/events/platform/platform_event_source.h"
+#include "ui/events/platform/x11/x11_event_source.h"
+#include "ui/gfx/x/x11_types.h"
+
+typedef struct _GPollFD GPollFD;
+typedef struct _GSource GSource;
+
+namespace ui {
+
+// A PlatformEventSource implementation for X11. Dispatches XEvents and uses
+// Glib to be notified for incoming XEvents.
+class EVENTS_EXPORT X11EventSourceGlib : public X11EventSourceDelegate,
+ public PlatformEventSource {
+ public:
+ explicit X11EventSourceGlib(XDisplay* display);
+ ~X11EventSourceGlib() override;
+
+ // X11EventSourceDelegate:
+ void ProcessXEvent(XEvent* xevent) override;
+
+ private:
+ // PlatformEventSource:
+ void StopCurrentEventStream() override;
+ void OnDispatcherListChanged() override;
+
+ void InitXSource(int fd);
+
+ X11EventSource event_source_;
+
+ // The GLib event source for X events.
+ GSource* x_source_ = nullptr;
+
+ // The poll attached to |x_source_|.
+ scoped_ptr<GPollFD> x_poll_;
+
+ DISALLOW_COPY_AND_ASSIGN(X11EventSourceGlib);
+};
+
+} // namespace ui
+
+#endif // UI_EVENTS_PLATFORM_X11_X11_EVENT_SOURCE_GLIB_H_
« no previous file with comments | « ui/events/platform/x11/x11_event_source.cc ('k') | ui/events/platform/x11/x11_event_source_glib.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698