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_SCREEN_H_ |
| 6 #define UI_OZONE_PLATFORM_WAYLAND_WAYLAND_SCREEN_H_ |
| 7 |
| 8 #include <stdint.h> |
| 9 |
| 10 #include "base/callback.h" |
| 11 #include "base/macros.h" |
| 12 #include "ui/gfx/geometry/rect.h" |
| 13 #include "ui/ozone/platform/wayland/wayland_object.h" |
| 14 |
| 15 struct wl_output; |
| 16 struct wl_registry; |
| 17 |
| 18 namespace ui { |
| 19 |
| 20 // WaylandScreen objects keep track of the current outputs (screens/monitors) |
| 21 // that are available to the application. |
| 22 class WaylandScreen { |
| 23 public: |
| 24 WaylandScreen(wl_registry* registry, uint32_t name, wl_output*); |
| 25 ~WaylandScreen(); |
| 26 |
| 27 // Returns the active allocation of the screen. |
| 28 gfx::Rect Geometry() const { return rect_; } |
| 29 void SetOutputCompleteClosure(const base::Closure&); |
| 30 |
| 31 private: |
| 32 // Callback functions that allows the display to initialize the screen's |
| 33 // position and available modes. |
| 34 static void OutputHandleGeometry(void* data, |
| 35 wl_output* output, |
| 36 int32_t x, |
| 37 int32_t y, |
| 38 int32_t physical_width, |
| 39 int32_t physical_height, |
| 40 int32_t subpixel, |
| 41 const char* make, |
| 42 const char* model, |
| 43 int32_t output_transform); |
| 44 |
| 45 static void OutputHandleMode(void* data, |
| 46 wl_output* wl_output, |
| 47 uint32_t flags, |
| 48 int32_t width, |
| 49 int32_t height, |
| 50 int32_t refresh); |
| 51 |
| 52 wl::Object<wl_output> output_; |
| 53 base::Closure output_complete_closure_; |
| 54 |
| 55 int32_t name_; |
| 56 int32_t refresh_; |
| 57 gfx::Rect rect_; |
| 58 |
| 59 DISALLOW_COPY_AND_ASSIGN(WaylandScreen); |
| 60 }; |
| 61 |
| 62 } // namespace ui |
| 63 |
| 64 #endif // UI_OZONE_PLATFORM_WAYLAND_WAYLAND_SCREEN_H_ |
OLD | NEW |