Add wxFullScreenEvent for macOS

Send a wxFullScreenEvent when the user enters or exits full screen on
macOS. EnableFullScreenView() has to be used to enable the native
full screen API.

Closes https://github.com/wxWidgets/wxWidgets/pull/2284
This commit is contained in:
Tobias Taschner
2021-03-18 22:12:14 +01:00
committed by Vadim Zeitlin
parent a495b1fd23
commit 0ff1bdec09
6 changed files with 106 additions and 10 deletions

View File

@@ -681,6 +681,7 @@ class WXDLLIMPEXP_FWD_CORE wxWindowDestroyEvent;
class WXDLLIMPEXP_FWD_CORE wxShowEvent;
class WXDLLIMPEXP_FWD_CORE wxIconizeEvent;
class WXDLLIMPEXP_FWD_CORE wxMaximizeEvent;
class WXDLLIMPEXP_FWD_CORE wxFullScreenEvent;
class WXDLLIMPEXP_FWD_CORE wxMouseCaptureChangedEvent;
class WXDLLIMPEXP_FWD_CORE wxMouseCaptureLostEvent;
class WXDLLIMPEXP_FWD_CORE wxPaintEvent;
@@ -832,6 +833,7 @@ wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_DESTROY, wxWindowDestroyEvent);
wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SHOW, wxShowEvent);
wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_ICONIZE, wxIconizeEvent);
wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_MAXIMIZE, wxMaximizeEvent);
wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_FULLSCREEN, wxFullScreenEvent);
wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_MOUSE_CAPTURE_CHANGED, wxMouseCaptureChangedEvent);
wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_MOUSE_CAPTURE_LOST, wxMouseCaptureLostEvent);
wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_PAINT, wxPaintEvent);
@@ -2725,6 +2727,30 @@ private:
wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxMaximizeEvent);
};
/*
wxEVT_FULLSCREEN
*/
class WXDLLIMPEXP_CORE wxFullScreenEvent : public wxEvent
{
public:
wxFullScreenEvent(int winid = 0, bool fullscreen = true)
: wxEvent(winid, wxEVT_FULLSCREEN)
{ m_fullscreen = fullscreen; }
wxFullScreenEvent(const wxFullScreenEvent& event)
: wxEvent(event)
{ m_fullscreen = event.m_fullscreen; }
bool IsFullScreen() const { return m_fullscreen; }
virtual wxEvent *Clone() const wxOVERRIDE { return new wxFullScreenEvent(*this); }
protected:
bool m_fullscreen;
private:
wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxFullScreenEvent);
};
// Joystick event class
/*
wxEVT_JOY_BUTTON_DOWN,