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

Side by Side Diff: ui/views/widget/desktop_aura/desktop_screen_x11.h

Issue 1915363002: Rename gfx::Display/Screen to display::Display/Screen in views/wm (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more cleanups Created 4 years, 7 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
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_SCREEN_X11_H_ 5 #ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_SCREEN_X11_H_
6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_SCREEN_X11_H_ 6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_SCREEN_X11_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
11 11
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/timer/timer.h" 13 #include "base/timer/timer.h"
14 #include "ui/display/screen.h"
14 #include "ui/events/platform/platform_event_dispatcher.h" 15 #include "ui/events/platform/platform_event_dispatcher.h"
15 #include "ui/gfx/display_change_notifier.h" 16 #include "ui/gfx/display_change_notifier.h"
16 #include "ui/gfx/screen.h"
17 #include "ui/gfx/x/x11_atom_cache.h" 17 #include "ui/gfx/x/x11_atom_cache.h"
18 #include "ui/views/views_export.h" 18 #include "ui/views/views_export.h"
19 19
20 namespace gfx {
21 class Display;
22 }
23
24 typedef unsigned long XID; 20 typedef unsigned long XID;
25 typedef XID Window; 21 typedef XID Window;
26 typedef struct _XDisplay Display; 22 typedef struct _XDisplay Display;
27 23
28 namespace views { 24 namespace views {
29 class DesktopScreenX11Test; 25 class DesktopScreenX11Test;
30 26
31 namespace test { 27 namespace test {
32 class DesktopScreenX11TestApi; 28 class DesktopScreenX11TestApi;
33 } 29 }
34 30
35 // Our singleton screen implementation that talks to xrandr. 31 // Our singleton screen implementation that talks to xrandr.
36 class VIEWS_EXPORT DesktopScreenX11 : public gfx::Screen, 32 class VIEWS_EXPORT DesktopScreenX11 : public display::Screen,
37 public ui::PlatformEventDispatcher { 33 public ui::PlatformEventDispatcher {
38 public: 34 public:
39 DesktopScreenX11(); 35 DesktopScreenX11();
40 36
41 ~DesktopScreenX11() override; 37 ~DesktopScreenX11() override;
42 38
43 // Overridden from gfx::Screen: 39 // Overridden from display::Screen:
44 gfx::Point GetCursorScreenPoint() override; 40 gfx::Point GetCursorScreenPoint() override;
45 gfx::NativeWindow GetWindowUnderCursor() override; 41 gfx::NativeWindow GetWindowUnderCursor() override;
46 gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) override; 42 gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) override;
47 int GetNumDisplays() const override; 43 int GetNumDisplays() const override;
48 std::vector<gfx::Display> GetAllDisplays() const override; 44 std::vector<display::Display> GetAllDisplays() const override;
49 gfx::Display GetDisplayNearestWindow(gfx::NativeView window) const override; 45 display::Display GetDisplayNearestWindow(
50 gfx::Display GetDisplayNearestPoint(const gfx::Point& point) const override; 46 gfx::NativeView window) const override;
51 gfx::Display GetDisplayMatching(const gfx::Rect& match_rect) const override; 47 display::Display GetDisplayNearestPoint(
52 gfx::Display GetPrimaryDisplay() const override; 48 const gfx::Point& point) const override;
53 void AddObserver(gfx::DisplayObserver* observer) override; 49 display::Display GetDisplayMatching(
54 void RemoveObserver(gfx::DisplayObserver* observer) override; 50 const gfx::Rect& match_rect) const override;
51 display::Display GetPrimaryDisplay() const override;
52 void AddObserver(display::DisplayObserver* observer) override;
53 void RemoveObserver(display::DisplayObserver* observer) override;
55 54
56 // ui::PlatformEventDispatcher: 55 // ui::PlatformEventDispatcher:
57 bool CanDispatchEvent(const ui::PlatformEvent& event) override; 56 bool CanDispatchEvent(const ui::PlatformEvent& event) override;
58 uint32_t DispatchEvent(const ui::PlatformEvent& event) override; 57 uint32_t DispatchEvent(const ui::PlatformEvent& event) override;
59 58
60 static void UpdateDeviceScaleFactorForTest(); 59 static void UpdateDeviceScaleFactorForTest();
61 60
62 private: 61 private:
63 friend class DesktopScreenX11Test; 62 friend class DesktopScreenX11Test;
64 friend class test::DesktopScreenX11TestApi; 63 friend class test::DesktopScreenX11TestApi;
65 64
66 // Constructor used in tests. 65 // Constructor used in tests.
67 DesktopScreenX11(const std::vector<gfx::Display>& test_displays); 66 DesktopScreenX11(const std::vector<display::Display>& test_displays);
68 67
69 // Builds a list of displays from the current screen information offered by 68 // Builds a list of displays from the current screen information offered by
70 // the X server. 69 // the X server.
71 std::vector<gfx::Display> BuildDisplaysFromXRandRInfo(); 70 std::vector<display::Display> BuildDisplaysFromXRandRInfo();
72 71
73 // We delay updating the display so we can coalesce events. 72 // We delay updating the display so we can coalesce events.
74 void ConfigureTimerFired(); 73 void ConfigureTimerFired();
75 74
76 // Updates |displays_| and sets FontRenderParams's scale factor. 75 // Updates |displays_| and sets FontRenderParams's scale factor.
77 void SetDisplaysInternal(const std::vector<gfx::Display>& displays); 76 void SetDisplaysInternal(const std::vector<display::Display>& displays);
78 77
79 Display* xdisplay_; 78 Display* xdisplay_;
80 ::Window x_root_window_; 79 ::Window x_root_window_;
81 80
82 // Whether the x server supports the XRandR extension. 81 // Whether the x server supports the XRandR extension.
83 bool has_xrandr_; 82 bool has_xrandr_;
84 83
85 // The base of the event numbers used to represent XRandr events used in 84 // The base of the event numbers used to represent XRandr events used in
86 // decoding events regarding output add/remove. 85 // decoding events regarding output add/remove.
87 int xrandr_event_base_; 86 int xrandr_event_base_;
88 87
89 // The display objects we present to chrome. 88 // The display objects we present to chrome.
90 std::vector<gfx::Display> displays_; 89 std::vector<display::Display> displays_;
91 90
92 // The timer to delay configuring outputs. See also the comments in 91 // The timer to delay configuring outputs. See also the comments in
93 // Dispatch(). 92 // Dispatch().
94 std::unique_ptr<base::OneShotTimer> configure_timer_; 93 std::unique_ptr<base::OneShotTimer> configure_timer_;
95 94
96 gfx::DisplayChangeNotifier change_notifier_; 95 gfx::DisplayChangeNotifier change_notifier_;
97 96
98 ui::X11AtomCache atom_cache_; 97 ui::X11AtomCache atom_cache_;
99 98
100 DISALLOW_COPY_AND_ASSIGN(DesktopScreenX11); 99 DISALLOW_COPY_AND_ASSIGN(DesktopScreenX11);
101 }; 100 };
102 101
103 } // namespace views 102 } // namespace views
104 103
105 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_SCREEN_X11_H_ 104 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_SCREEN_X11_H_
OLDNEW
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_screen_win.cc ('k') | ui/views/widget/desktop_aura/desktop_screen_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698