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