Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(263)

Unified Diff: ui/ozone/platform/wayland/wayland_screen.h

Issue 2042503002: ozone/platform/wayland: Add support for wl_output_interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Applied review comments Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..f52bcdf11c5822d851c14c554d07790f5bf519de
--- /dev/null
+++ b/ui/ozone/platform/wayland/wayland_screen.h
@@ -0,0 +1,61 @@
+// 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/macros.h"
+#include "ui/gfx/geometry/rect.h"
+#include "ui/ozone/platform/wayland/wayland_object.h"
+
+struct wl_output;
+struct wl_registry;
+
+namespace ui {
+
+// WaylandScreen objects keep track of the current outputs (screens/monitors)
+// that are available to the application.
+class WaylandScreen {
+ public:
+ WaylandScreen(wl_registry* registry, uint32_t name);
+ ~WaylandScreen();
+
+ // Returns the active allocation of the screen.
+ gfx::Rect Geometry() const { return rect_; }
+
+ 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_;
+
+ int32_t name_;
+ int32_t refresh_;
+ gfx::Rect rect_;
+
+ DISALLOW_COPY_AND_ASSIGN(WaylandScreen);
+};
+
+} // namespace ui
+
+#endif // UI_OZONE_PLATFORM_WAYLAND_WAYLAND_SCREEN_H_

Powered by Google App Engine
This is Rietveld 408576698