| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 UI_PLATFORM_WINDOW_X11_X11_WINDOW_OZONE_H_ | 5 #ifndef UI_PLATFORM_WINDOW_X11_X11_WINDOW_OZONE_H_ |
| 6 #define UI_PLATFORM_WINDOW_X11_X11_WINDOW_OZONE_H_ | 6 #define UI_PLATFORM_WINDOW_X11_X11_WINDOW_OZONE_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "ui/events/platform/platform_event_dispatcher.h" | 9 #include "ui/events/platform/platform_event_dispatcher.h" |
| 10 #include "ui/events/platform/x11/x11_event_source_libevent.h" | 10 #include "ui/events/platform/x11/x11_event_source_libevent.h" |
| 11 #include "ui/platform_window/x11/x11_window_base.h" | 11 #include "ui/platform_window/x11/x11_window_base.h" |
| 12 #include "ui/platform_window/x11/x11_window_export.h" | 12 #include "ui/platform_window/x11/x11_window_export.h" |
| 13 | 13 |
| 14 namespace ui { | 14 namespace ui { |
| 15 | 15 |
| 16 class X11WindowManagerOzone; | 16 class X11WindowManagerOzone; |
| 17 | 17 |
| 18 // PlatformWindow implementation for X11 Ozone. PlatformEvents are ui::Events. | 18 // PlatformWindow implementation for X11 Ozone. PlatformEvents are ui::Events. |
| 19 class X11_WINDOW_EXPORT X11WindowOzone : public X11WindowBase, | 19 class X11_WINDOW_EXPORT X11WindowOzone : public X11WindowBase, |
| 20 public PlatformEventDispatcher, | 20 public PlatformEventDispatcher, |
| 21 public XEventDispatcher { | 21 public XEventDispatcher { |
| 22 public: | 22 public: |
| 23 X11WindowOzone(X11EventSourceLibevent* event_source, | 23 X11WindowOzone(X11EventSourceLibevent* event_source, |
| 24 X11WindowManagerOzone* window_manager, | 24 X11WindowManagerOzone* window_manager, |
| 25 PlatformWindowDelegate* delegate); | 25 PlatformWindowDelegate* delegate, |
| 26 const gfx::Rect& bounds); |
| 26 ~X11WindowOzone() override; | 27 ~X11WindowOzone() override; |
| 27 | 28 |
| 28 // PlatformWindow: | 29 // PlatformWindow: |
| 29 void SetCapture() override; | 30 void SetCapture() override; |
| 30 void ReleaseCapture() override; | 31 void ReleaseCapture() override; |
| 31 void SetCursor(PlatformCursor cursor) override; | 32 void SetCursor(PlatformCursor cursor) override; |
| 32 | 33 |
| 33 // XEventDispatcher: | 34 // XEventDispatcher: |
| 34 bool DispatchXEvent(XEvent* event) override; | 35 bool DispatchXEvent(XEvent* event) override; |
| 35 | 36 |
| 36 private: | 37 private: |
| 37 // PlatformEventDispatcher: | 38 // PlatformEventDispatcher: |
| 38 bool CanDispatchEvent(const PlatformEvent& event) override; | 39 bool CanDispatchEvent(const PlatformEvent& event) override; |
| 39 uint32_t DispatchEvent(const PlatformEvent& event) override; | 40 uint32_t DispatchEvent(const PlatformEvent& event) override; |
| 40 | 41 |
| 41 X11EventSourceLibevent* event_source_; | 42 X11EventSourceLibevent* event_source_; |
| 42 X11WindowManagerOzone* window_manager_; | 43 X11WindowManagerOzone* window_manager_; |
| 43 | 44 |
| 44 DISALLOW_COPY_AND_ASSIGN(X11WindowOzone); | 45 DISALLOW_COPY_AND_ASSIGN(X11WindowOzone); |
| 45 }; | 46 }; |
| 46 | 47 |
| 47 } // namespace ui | 48 } // namespace ui |
| 48 | 49 |
| 49 #endif // UI_PLATFORM_WINDOW_X11_X11_WINDOW_OZONE_H_ | 50 #endif // UI_PLATFORM_WINDOW_X11_X11_WINDOW_OZONE_H_ |
| OLD | NEW |