OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_DISPLAY_CHROMEOS_X11_NATIVE_DISPLAY_DELEGATE_X11_H_ | 5 #ifndef UI_DISPLAY_CHROMEOS_X11_NATIVE_DISPLAY_DELEGATE_X11_H_ |
6 #define UI_DISPLAY_CHROMEOS_X11_NATIVE_DISPLAY_DELEGATE_X11_H_ | 6 #define UI_DISPLAY_CHROMEOS_X11_NATIVE_DISPLAY_DELEGATE_X11_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 23 matching lines...) Expand all Loading... |
34 typedef _XRROutputInfo XRROutputInfo; | 34 typedef _XRROutputInfo XRROutputInfo; |
35 struct _XRRScreenResources; | 35 struct _XRRScreenResources; |
36 typedef _XRRScreenResources XRRScreenResources; | 36 typedef _XRRScreenResources XRRScreenResources; |
37 struct _XRRCrtcGamma; | 37 struct _XRRCrtcGamma; |
38 typedef _XRRCrtcGamma XRRCrtcGamma; | 38 typedef _XRRCrtcGamma XRRCrtcGamma; |
39 | 39 |
40 namespace ui { | 40 namespace ui { |
41 | 41 |
42 class DisplayModeX11; | 42 class DisplayModeX11; |
43 class DisplaySnapshotX11; | 43 class DisplaySnapshotX11; |
| 44 class InputDeviceEventObserver; |
44 class NativeDisplayEventDispatcherX11; | 45 class NativeDisplayEventDispatcherX11; |
45 | 46 |
46 class DISPLAY_EXPORT NativeDisplayDelegateX11 : public NativeDisplayDelegate { | 47 class DISPLAY_EXPORT NativeDisplayDelegateX11 : public NativeDisplayDelegate { |
47 public: | 48 public: |
48 // Helper class that allows NativeDisplayEventDispatcherX11 and | 49 // Helper class that allows NativeDisplayEventDispatcherX11 and |
49 // NativeDisplayDelegateX11::PlatformEventObserverX11 to interact with this | 50 // NativeDisplayDelegateX11::PlatformEventObserverX11 to interact with this |
50 // class or with mocks in tests. | 51 // class or with mocks in tests. |
51 class HelperDelegate { | 52 class HelperDelegate { |
52 public: | 53 public: |
53 virtual ~HelperDelegate() {} | 54 virtual ~HelperDelegate() {} |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 GetAvailableColorCalibrationProfiles( | 90 GetAvailableColorCalibrationProfiles( |
90 const DisplaySnapshot& output) OVERRIDE; | 91 const DisplaySnapshot& output) OVERRIDE; |
91 virtual bool SetColorCalibrationProfile( | 92 virtual bool SetColorCalibrationProfile( |
92 const DisplaySnapshot& output, | 93 const DisplaySnapshot& output, |
93 ColorCalibrationProfile new_profile) OVERRIDE; | 94 ColorCalibrationProfile new_profile) OVERRIDE; |
94 virtual void AddObserver(NativeDisplayObserver* observer) OVERRIDE; | 95 virtual void AddObserver(NativeDisplayObserver* observer) OVERRIDE; |
95 virtual void RemoveObserver(NativeDisplayObserver* observer) OVERRIDE; | 96 virtual void RemoveObserver(NativeDisplayObserver* observer) OVERRIDE; |
96 | 97 |
97 private: | 98 private: |
98 class HelperDelegateX11; | 99 class HelperDelegateX11; |
99 class PlatformEventObserverX11; | |
100 | 100 |
101 // Parses all the modes made available by |screen_|. | 101 // Parses all the modes made available by |screen_|. |
102 void InitModes(); | 102 void InitModes(); |
103 | 103 |
104 // Helper method for GetOutputs() that returns an OutputSnapshot struct based | 104 // Helper method for GetOutputs() that returns an OutputSnapshot struct based |
105 // on the passed-in information. | 105 // on the passed-in information. |
106 DisplaySnapshotX11* InitDisplaySnapshot(RROutput id, | 106 DisplaySnapshotX11* InitDisplaySnapshot(RROutput id, |
107 XRROutputInfo* info, | 107 XRROutputInfo* info, |
108 RRCrtc* last_used_crtc, | 108 RRCrtc* last_used_crtc, |
109 int index); | 109 int index); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 // propagate them. | 143 // propagate them. |
144 ScopedVector<DisplaySnapshot> cached_outputs_; | 144 ScopedVector<DisplaySnapshot> cached_outputs_; |
145 | 145 |
146 scoped_ptr<HelperDelegate> helper_delegate_; | 146 scoped_ptr<HelperDelegate> helper_delegate_; |
147 | 147 |
148 // Processes X11 display events associated with the root window and notifies | 148 // Processes X11 display events associated with the root window and notifies |
149 // |observers_| when a display change has occurred. | 149 // |observers_| when a display change has occurred. |
150 scoped_ptr<NativeDisplayEventDispatcherX11> platform_event_dispatcher_; | 150 scoped_ptr<NativeDisplayEventDispatcherX11> platform_event_dispatcher_; |
151 | 151 |
152 // Processes X11 display events that have no X11 window associated with it. | 152 // Processes X11 display events that have no X11 window associated with it. |
153 scoped_ptr<PlatformEventObserverX11> platform_event_observer_; | 153 scoped_ptr<InputDeviceEventObserver> input_hotplug_observer_; |
154 | 154 |
155 // List of observers waiting for display configuration change events. | 155 // List of observers waiting for display configuration change events. |
156 ObserverList<NativeDisplayObserver> observers_; | 156 ObserverList<NativeDisplayObserver> observers_; |
157 | 157 |
158 // A background color used during boot time + multi displays. | 158 // A background color used during boot time + multi displays. |
159 uint32_t background_color_argb_; | 159 uint32_t background_color_argb_; |
160 | 160 |
161 DISALLOW_COPY_AND_ASSIGN(NativeDisplayDelegateX11); | 161 DISALLOW_COPY_AND_ASSIGN(NativeDisplayDelegateX11); |
162 }; | 162 }; |
163 | 163 |
164 } // namespace ui | 164 } // namespace ui |
165 | 165 |
166 #endif // UI_DISPLAY_CHROMEOS_X11_NATIVE_DISPLAY_DELEGATE_X11_H_ | 166 #endif // UI_DISPLAY_CHROMEOS_X11_NATIVE_DISPLAY_DELEGATE_X11_H_ |
OLD | NEW |