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

Side by Side 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: add comments and use std::unique_ptr 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 unified diff | Download patch
OLDNEW
(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_OUTPUT_H_
6 #define UI_OZONE_PLATFORM_WAYLAND_WAYLAND_OUTPUT_H_
7
8 #include <stdint.h>
9
10 #include "ui/gfx/geometry/rect.h"
11 #include "ui/ozone/platform/wayland/wayland_object.h"
12
13 namespace ui {
14
15 // WaylandOutput objects keep track of the current output of display
16 // that are available to the application.
17 class WaylandOutput {
18 public:
19 class Observer {
20 public:
21 // Will be called when wl_output is available.
22 virtual void OnOutputReadyForUse() = 0;
23 };
24
25 WaylandOutput(wl_output*);
26 ~WaylandOutput();
27
28 // Returns the resolution of the screen.
29 gfx::Rect Geometry() const { return rect_; }
30 void SetObserver(Observer* observer) { observer_ = observer; }
31 Observer* observer() { return observer_; }
32
33 private:
34 // Callback functions that allows the display to initialize the screen's
rjkroege 2016/09/25 14:44:31 in Chrome naming, Display == 1 physical monitor, S
joone 2016/09/27 08:25:20 Done.
35 // position and available modes.
36 static void OutputHandleGeometry(void* data,
37 wl_output* output,
38 int32_t x,
39 int32_t y,
40 int32_t physical_width,
41 int32_t physical_height,
42 int32_t subpixel,
43 const char* make,
44 const char* model,
45 int32_t output_transform);
46
47 static void OutputHandleMode(void* data,
48 wl_output* wl_output,
49 uint32_t flags,
50 int32_t width,
51 int32_t height,
52 int32_t refresh);
53
54 wl::Object<wl_output> output_;
55 gfx::Rect rect_;
56
57 Observer* observer_;
58
59 DISALLOW_COPY_AND_ASSIGN(WaylandOutput);
60 };
61
62 } // namespace ui
63
64 #endif // UI_OZONE_PLATFORM_WAYLAND_WAYLAND_SCREEN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698