11 #include "guilib/DispResource.h" 12 #include "threads/CriticalSection.h" 13 #include "threads/SystemClock.h" 14 #include "windowing/WinSystem.h" 24 WINDOW_STATE_FULLSCREEN = 1,
25 WINDOW_STATE_FULLSCREEN_WINDOW,
26 WINDOW_STATE_WINDOWED,
27 WINDOW_STATE_BORDERLESS
30 static const char* window_state_names[] =
34 "windowed fullscreen",
40 enum WINDOW_FULLSCREEN_STATE
42 WINDOW_FULLSCREEN_STATE_FULLSCREEN = WINDOW_STATE_FULLSCREEN,
43 WINDOW_FULLSCREEN_STATE_FULLSCREEN_WINDOW = WINDOW_STATE_FULLSCREEN_WINDOW
47 enum WINDOW_WINDOW_STATE
49 WINDOW_WINDOW_STATE_WINDOWED = WINDOW_STATE_WINDOWED,
50 WINDOW_WINDOW_STATE_BORDERLESS = WINDOW_STATE_BORDERLESS
70 bool InitWindowSystem()
override;
71 bool DestroyWindowSystem()
override;
72 bool ResizeWindow(
int newWidth,
int newHeight,
int newLeft,
int newTop)
override;
73 void FinishWindowResize(
int newWidth,
int newHeight)
override;
75 void UpdateResolutions()
override;
76 void NotifyAppFocusChange(
bool bGaining)
override;
77 void ShowOSMouse(
bool show)
override;
78 bool HasInertialGestures()
override {
return true; }
79 bool Minimize()
override;
80 bool Restore()
override;
82 bool Show(
bool raise =
true)
override;
83 std::string GetClipboardText()
override;
84 bool UseLimitedColor()
override;
85 bool HasSystemSdrPeakLuminance()
override;
90 bool WindowedMode()
const {
return m_state != WINDOW_STATE_FULLSCREEN; }
91 bool SetFullScreen(
bool fullScreen,
RESOLUTION_INFO& res,
bool blankOtherDisplays)
override;
94 bool IsAlteringWindow()
const {
return m_IsAlteringWindow; }
95 void SetAlteringWindow(
bool altering) { m_IsAlteringWindow = altering; }
96 bool IsTogglingHDR()
const {
return false; }
97 void SetTogglingHDR(
bool toggling) {}
98 virtual bool DPIChanged(WORD dpi, RECT windowRect)
const;
99 bool IsMinimized()
const {
return m_bMinimized; }
100 void SetMinimized(
bool minimized) { m_bMinimized = minimized; }
101 float GetGuiSdrPeakLuminance()
const;
102 void CacheSystemSdrPeakLuminance();
104 bool CanDoWindowed()
override;
107 bool MessagePump()
override;
110 bool CreateNewWindow(
const std::string& name,
bool fullScreen,
RESOLUTION_INFO& res)
override = 0;
111 virtual void UpdateStates(
bool fullScreen);
112 WINDOW_STATE GetState(
bool fullScreen)
const;
113 virtual void SetDeviceFullScreen(
bool fullScreen,
RESOLUTION_INFO& res) = 0;
114 virtual void ReleaseBackBuffer() = 0;
115 virtual void CreateBackBuffer() = 0;
116 virtual void ResizeDeviceBuffers() = 0;
117 virtual bool IsStereoEnabled() = 0;
118 virtual void AdjustWindow();
123 bool ChangeResolution(
const RESOLUTION_INFO& res,
bool forceChange =
false);
125 void RestoreDesktopResolution();
126 void GetConnectedDisplays(std::vector<MONITOR_DETAILS>& outputs);
134 void OnDisplayLost();
135 void OnDisplayReset();
136 void OnDisplayBack();
137 void ResolutionChanged();
139 std::vector<MONITOR_DETAILS> m_displays;
140 bool m_ValidWindowedPosition;
141 bool m_IsAlteringWindow;
143 CCriticalSection m_resourceSection;
144 std::vector<IDispResource*> m_resources;
145 bool m_delayDispReset;
148 WINDOW_STATE m_state;
149 WINDOW_FULLSCREEN_STATE m_fullscreenState;
150 WINDOW_WINDOW_STATE m_windowState;
153 bool m_bFirstResChange =
true;
155 winrt::Windows::UI::Core::CoreWindow m_coreWindow =
nullptr;
157 bool m_validSystemSdrPeakLuminance{
false};
158 float m_systemSdrPeakLuminance{.0f};
Definition: WinSystemWin10.h:53
Definition: WinSystem.h:49
Definition: SystemClock.h:31
Definition: DispResource.h:14
Provide info of a resolution.
Definition: Resolution.h:66
Definition: VideoReferenceClock.h:19
Definition: WinSystemWin10.h:63