Index: ui/ozone/platform/wayland/wayland_screen.h |
diff --git a/ui/ozone/platform/wayland/wayland_screen.h b/ui/ozone/platform/wayland/wayland_screen.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..6869ef953878d7fea82ce67161e981944c32f98c |
--- /dev/null |
+++ b/ui/ozone/platform/wayland/wayland_screen.h |
@@ -0,0 +1,65 @@ |
+// 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_OZONE_PLATFORM_WAYLAND_WAYLAND_SCREEN_H_ |
+#define UI_OZONE_PLATFORM_WAYLAND_WAYLAND_SCREEN_H_ |
+ |
+#include <stdint.h> |
+ |
+#include "base/callback.h" |
+#include "base/macros.h" |
+#include "ui/gfx/geometry/rect.h" |
+#include "ui/ozone/platform/wayland/wayland_object.h" |
+ |
+struct wl_output; |
rjkroege
2016/06/14 23:29:49
It would be nice if we didn't have to expose Wayla
joone
2016/06/20 22:22:42
They are already forward-declared in wayland_obje
|
+struct wl_registry; |
+ |
+namespace ui { |
+ |
+// WaylandScreen objects keep track of the current outputs (screens/monitors) |
rjkroege
2016/06/14 23:29:49
In chrome terminology, a Display corresponds to a
Michael Forney
2016/06/14 23:44:54
I think this class corresponds to a wl_output whic
joone
2016/06/20 22:22:42
Thanks for suggestions. The name of the classes wi
Michael Forney
2016/07/07 21:18:01
Would you consider moving the rename of WaylandDis
joone
2016/07/12 19:22:41
I've created a separate CL:
https://codereview.chr
|
+// that are available to the application. |
+class WaylandScreen { |
+ public: |
+ WaylandScreen(wl_registry* registry, uint32_t name, wl_output*); |
+ ~WaylandScreen(); |
+ |
+ // Returns the active allocation of the screen. |
rjkroege
2016/06/14 23:29:49
These are are in DIP coordinates or DDP? Please in
joone
2016/06/20 22:22:42
This is the resolution of the screen.
|
+ gfx::Rect Geometry() const { return rect_; } |
+ |
+ void OutputReadyForUse(); |
+ void WaitforOutputAvailable(); |
+ |
+ private: |
+ // Callback functions that allows the display to initialize the screen's |
+ // position and available modes. |
+ static void OutputHandleGeometry(void* data, |
+ wl_output* output, |
+ int32_t x, |
+ int32_t y, |
+ int32_t physical_width, |
+ int32_t physical_height, |
+ int32_t subpixel, |
+ const char* make, |
+ const char* model, |
+ int32_t output_transform); |
+ |
+ static void OutputHandleMode(void* data, |
+ wl_output* wl_output, |
+ uint32_t flags, |
+ int32_t width, |
+ int32_t height, |
+ int32_t refresh); |
+ |
+ wl::Object<wl_output> output_; |
+ base::Closure output_complete_closure_; |
+ |
+ int32_t name_; |
+ gfx::Rect rect_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(WaylandScreen); |
+}; |
+ |
+} // namespace ui |
+ |
+#endif // UI_OZONE_PLATFORM_WAYLAND_WAYLAND_SCREEN_H_ |