blob: f2de8d4dbb959a096120dc46bb03a1e2d1c99260 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
// Copyright 2018 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 <vector>
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "base/observer_list.h"
#include "ui/display/display_list.h"
#include "ui/ozone/platform/wayland/wayland_output.h"
#include "ui/ozone/public/ozone_platform.h"
#include "ui/ozone/public/platform_screen.h"
namespace ui {
// A PlatformScreen implementation for Wayland.
class WaylandScreen : public PlatformScreen {
public:
WaylandScreen();
~WaylandScreen() override;
void OnOutputAdded(uint32_t output_id, bool is_primary);
void OnOutputRemoved(uint32_t output_id);
void OnOutputMetricsChanged(uint32_t output_id,
const gfx::Rect& bounds,
float device_pixel_ratio,
bool is_primary);
base::WeakPtr<WaylandScreen> GetWeakPtr();
// display::Screen implementation.
const std::vector<display::Display>& GetAllDisplays() const override;
display::Display GetPrimaryDisplay() const override;
display::Display GetDisplayForAcceleratedWidget(
gfx::AcceleratedWidget widget) const override;
gfx::Point GetCursorScreenPoint() const override;
gfx::AcceleratedWidget GetAcceleratedWidgetAtScreenPoint(
const gfx::Point& point) const override;
display::Display GetDisplayNearestPoint(
const gfx::Point& point) const override;
display::Display GetDisplayMatching(
const gfx::Rect& match_rect) const override;
void AddObserver(display::DisplayObserver* observer) override;
void RemoveObserver(display::DisplayObserver* observer) override;
private:
display::DisplayList display_list_;
base::ObserverList<display::DisplayObserver> observers_;
base::WeakPtrFactory<WaylandScreen> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(WaylandScreen);
};
} // namespace ui
#endif // UI_OZONE_PLATFORM_WAYLAND_WAYLAND_SCREEN_H_
|