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

Unified Diff: ui/ozone/platform/wayland/wayland_output.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: [For landding] update comments Created 4 years, 3 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
« no previous file with comments | « ui/ozone/platform/wayland/wayland_object.cc ('k') | ui/ozone/platform/wayland/wayland_output.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/wayland/wayland_output.h
diff --git a/ui/ozone/platform/wayland/wayland_output.h b/ui/ozone/platform/wayland/wayland_output.h
new file mode 100644
index 0000000000000000000000000000000000000000..39e50829caffbe40977a11595cdc454f8938b026
--- /dev/null
+++ b/ui/ozone/platform/wayland/wayland_output.h
@@ -0,0 +1,64 @@
+// 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_OUTPUT_H_
+#define UI_OZONE_PLATFORM_WAYLAND_WAYLAND_OUTPUT_H_
+
+#include <stdint.h>
+
+#include "ui/gfx/geometry/rect.h"
+#include "ui/ozone/platform/wayland/wayland_object.h"
+
+namespace ui {
+
+// WaylandOutput objects keep track of the current output of display
+// that are available to the application.
+class WaylandOutput {
+ public:
+ class Observer {
+ public:
+ // Will be called when wl_output is available.
+ virtual void OnOutputReadyForUse() = 0;
+ };
+
+ WaylandOutput(wl_output*);
+ ~WaylandOutput();
+
+ // Returns the geometry of the output.
+ gfx::Rect Geometry() const { return rect_; }
+ void SetObserver(Observer* observer) { observer_ = observer; }
+ Observer* observer() { return observer_; }
+
+ private:
+ // Callback functions used for setting geometric properties of the output
+ // 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_;
+ gfx::Rect rect_;
+
+ Observer* observer_;
+
+ DISALLOW_COPY_AND_ASSIGN(WaylandOutput);
+};
+
+} // namespace ui
+
+#endif // UI_OZONE_PLATFORM_WAYLAND_WAYLAND_SCREEN_H_
« no previous file with comments | « ui/ozone/platform/wayland/wayland_object.cc ('k') | ui/ozone/platform/wayland/wayland_output.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698