| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef UI_DISPLAY_CHROMEOS_NATIVE_DISPLAY_DELEGATE_H_ |
| 6 #define UI_DISPLAY_CHROMEOS_NATIVE_DISPLAY_DELEGATE_H_ |
| 7 |
| 8 #include "ui/display/display_constants.h" |
| 9 #include "ui/display/display_export.h" |
| 10 |
| 11 namespace gfx { |
| 12 class Point; |
| 13 class Size; |
| 14 } |
| 15 |
| 16 namespace ui { |
| 17 class DisplayMode; |
| 18 class DisplaySnapshot; |
| 19 |
| 20 class NativeDisplayObserver; |
| 21 |
| 22 // Interface for classes that perform display configuration actions on behalf |
| 23 // of OutputConfigurator. |
| 24 class DISPLAY_EXPORT NativeDisplayDelegate { |
| 25 public: |
| 26 virtual ~NativeDisplayDelegate() {} |
| 27 |
| 28 virtual void Initialize() = 0; |
| 29 |
| 30 // Grabs and refreshes any display server related resources. Must be balanced |
| 31 // by a call to UngrabServer(). |
| 32 virtual void GrabServer() = 0; |
| 33 |
| 34 // Released the display server and any resources allocated by GrabServer(). |
| 35 virtual void UngrabServer() = 0; |
| 36 |
| 37 // Flushes all pending requests and waits for replies. |
| 38 virtual void SyncWithServer() = 0; |
| 39 |
| 40 // Sets the window's background color to |color_argb|. |
| 41 virtual void SetBackgroundColor(uint32 color_argb) = 0; |
| 42 |
| 43 // Enables DPMS and forces it to the "on" state. |
| 44 virtual void ForceDPMSOn() = 0; |
| 45 |
| 46 // Returns information about the current outputs. This method may block for |
| 47 // 60 milliseconds or more. |
| 48 // NativeDisplayDelegate maintains ownership of the ui::DisplaySnapshot |
| 49 // pointers. |
| 50 virtual std::vector<ui::DisplaySnapshot*> GetOutputs() = 0; |
| 51 |
| 52 // Adds |mode| to |output|. |mode| must be a valid display mode pointer. |
| 53 virtual void AddMode(const ui::DisplaySnapshot& output, |
| 54 const ui::DisplayMode* mode) = 0; |
| 55 |
| 56 // Configures the display represented by |output| to use |mode| and positions |
| 57 // the display to |origin| in the framebuffer. |mode| can be NULL, which |
| 58 // represents disabling the display. Returns true on success. |
| 59 virtual bool Configure(const ui::DisplaySnapshot& output, |
| 60 const ui::DisplayMode* mode, |
| 61 const gfx::Point& origin) = 0; |
| 62 |
| 63 // Called to set the frame buffer (underlying XRR "screen") size. |
| 64 virtual void CreateFrameBuffer(const gfx::Size& size) = 0; |
| 65 |
| 66 // Gets HDCP state of output. |
| 67 virtual bool GetHDCPState(const ui::DisplaySnapshot& output, |
| 68 ui::HDCPState* state) = 0; |
| 69 |
| 70 // Sets HDCP state of output. |
| 71 virtual bool SetHDCPState(const ui::DisplaySnapshot& output, |
| 72 ui::HDCPState state) = 0; |
| 73 |
| 74 virtual void AddObserver(NativeDisplayObserver* observer) = 0; |
| 75 |
| 76 virtual void RemoveObserver(NativeDisplayObserver* observer) = 0; |
| 77 }; |
| 78 |
| 79 } // namespace ui |
| 80 |
| 81 #endif // UI_DISPLAY_CHROMEOS_NATIVE_DISPLAY_DELEGATE_H_ |
| OLD | NEW |