OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef UI_OZONE_PLATFORM_WAYLAND_WAYLAND_WINDOW_H_ |
| 6 #define UI_OZONE_PLATFORM_WAYLAND_WAYLAND_WINDOW_H_ |
| 7 |
| 8 #include "ui/gfx/geometry/rect.h" |
| 9 #include "ui/gfx/native_widget_types.h" |
| 10 #include "ui/ozone/platform/wayland/wayland_object.h" |
| 11 #include "ui/platform_window/platform_window.h" |
| 12 |
| 13 namespace ui { |
| 14 |
| 15 class WaylandDisplay; |
| 16 |
| 17 class WaylandWindow : public PlatformWindow { |
| 18 public: |
| 19 WaylandWindow(PlatformWindowDelegate* delegate, |
| 20 WaylandDisplay* display, |
| 21 const gfx::Rect& bounds); |
| 22 ~WaylandWindow() override; |
| 23 |
| 24 bool Initialize(); |
| 25 |
| 26 wl_surface* GetSurface(); |
| 27 gfx::AcceleratedWidget GetWidget(); |
| 28 |
| 29 // Apply the bounds specified in the most recent configure event. This should |
| 30 // be called after processing all pending events in the wayland connection. |
| 31 void ApplyPendingBounds(); |
| 32 |
| 33 // PlatformWindow |
| 34 void Show() override; |
| 35 void Hide() override; |
| 36 void Close() override; |
| 37 void SetBounds(const gfx::Rect& bounds) override; |
| 38 gfx::Rect GetBounds() override; |
| 39 void SetTitle(const base::string16& title) override; |
| 40 void SetCapture() override; |
| 41 void ReleaseCapture() override; |
| 42 void ToggleFullscreen() override; |
| 43 void Maximize() override; |
| 44 void Minimize() override; |
| 45 void Restore() override; |
| 46 void SetCursor(PlatformCursor cursor) override; |
| 47 void MoveCursorTo(const gfx::Point& location) override; |
| 48 void ConfineCursorToBounds(const gfx::Rect& bounds) override; |
| 49 PlatformImeController* GetPlatformImeController() override; |
| 50 |
| 51 // xdg_surface_listener |
| 52 static void Configure(void* data, |
| 53 xdg_surface* obj, |
| 54 int32_t width, |
| 55 int32_t height, |
| 56 wl_array* states, |
| 57 uint32_t serial); |
| 58 static void Close(void* data, xdg_surface* obj); |
| 59 |
| 60 private: |
| 61 PlatformWindowDelegate* delegate_; |
| 62 WaylandDisplay* display_; |
| 63 |
| 64 wl::Object<wl_surface> surface_; |
| 65 wl::Object<xdg_surface> xdg_surface_; |
| 66 |
| 67 gfx::Rect bounds_; |
| 68 gfx::Rect pending_bounds_; |
| 69 uint32_t pending_configure_serial_; |
| 70 |
| 71 DISALLOW_COPY_AND_ASSIGN(WaylandWindow); |
| 72 }; |
| 73 |
| 74 } // namespace ui |
| 75 |
| 76 #endif // UI_OZONE_PLATFORM_WAYLAND_WAYLAND_WINDOW_H_ |
OLD | NEW |