aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfuzzard <fuzzard@kodi.tv>2021-09-20 18:19:26 +1000
committerfuzzard <fuzzard@kodi.tv>2021-09-20 19:30:28 +1000
commit70f9573b3ed0e3edd3fe1a16e95c71c62dd4520e (patch)
tree95afeb6f1e580fc6d9328710e13f82ec0ebe6e1d
parent438fff19fa3fb77c4433a05c009e5c6c6ead1dda (diff)
[osx][windowing] relocate SDL specific code to an SDL folder
relocates SDL implementations to a specific SDL folder
-rw-r--r--cmake/treedata/osx/subdirs.txt1
-rw-r--r--xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererVTBGL.cpp4
-rw-r--r--xbmc/platform/darwin/osx/CocoaInterface.mm4
-rw-r--r--xbmc/settings/DisplaySettings.cpp4
-rw-r--r--xbmc/windowing/osx/CMakeLists.txt9
-rw-r--r--xbmc/windowing/osx/SDL/CMakeLists.txt10
-rw-r--r--xbmc/windowing/osx/SDL/WinEventsSDL.cpp (renamed from xbmc/windowing/osx/WinEventsSDL.cpp)4
-rw-r--r--xbmc/windowing/osx/SDL/WinEventsSDL.h (renamed from xbmc/windowing/osx/WinEventsSDL.h)4
-rw-r--r--xbmc/windowing/osx/SDL/WinSystemOSXSDL.h (renamed from xbmc/windowing/osx/WinSystemOSX.h)0
-rw-r--r--xbmc/windowing/osx/SDL/WinSystemOSXSDL.mm (renamed from xbmc/windowing/osx/WinSystemOSX.mm)8
-rw-r--r--xbmc/windowing/osx/WinEventsOSX.h4
-rw-r--r--xbmc/windowing/osx/WinSystemOSXGL.h4
12 files changed, 34 insertions, 22 deletions
diff --git a/cmake/treedata/osx/subdirs.txt b/cmake/treedata/osx/subdirs.txt
index fea7db61a4..a13635d390 100644
--- a/cmake/treedata/osx/subdirs.txt
+++ b/cmake/treedata/osx/subdirs.txt
@@ -14,3 +14,4 @@ xbmc/platform/posix/filesystem platform/posix/filesystem
xbmc/platform/posix/network platform/posix/network
xbmc/platform/posix/utils platform/posix/utils
xbmc/windowing/osx windowing/osx
+xbmc/windowing/osx/SDL windowing/osx/SDL
diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererVTBGL.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererVTBGL.cpp
index d567c4e7f0..5802e61838 100644
--- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererVTBGL.cpp
+++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererVTBGL.cpp
@@ -14,7 +14,9 @@
#include "cores/VideoPlayer/DVDCodecs/Video/VTB.h"
#include "utils/log.h"
#include "windowing/WinSystem.h"
-#include "windowing/osx/WinSystemOSX.h"
+#if defined(HAS_SDL)
+#include "windowing/osx/SDL/WinSystemOSXSDL.h"
+#endif
#include "platform/darwin/osx/CocoaInterface.h"
diff --git a/xbmc/platform/darwin/osx/CocoaInterface.mm b/xbmc/platform/darwin/osx/CocoaInterface.mm
index bae2dfdeda..0da58c48b5 100644
--- a/xbmc/platform/darwin/osx/CocoaInterface.mm
+++ b/xbmc/platform/darwin/osx/CocoaInterface.mm
@@ -11,7 +11,9 @@
#import "DllPaths_generated.h"
#include "ServiceBroker.h"
#include "utils/log.h"
-#include "windowing/osx/WinSystemOSX.h"
+#if defined(HAS_SDL)
+#include "windowing/osx/SDL/WinSystemOSXSDL.h"
+#endif
#import <AudioToolbox/AudioToolbox.h>
#import <AudioUnit/AudioUnit.h>
diff --git a/xbmc/settings/DisplaySettings.cpp b/xbmc/settings/DisplaySettings.cpp
index 4c490caccf..47c80dae32 100644
--- a/xbmc/settings/DisplaySettings.cpp
+++ b/xbmc/settings/DisplaySettings.cpp
@@ -42,7 +42,9 @@
#include "windowing/X11/WinSystemX11.h"
#elif defined(TARGET_DARWIN_OSX)
#define WIN_SYSTEM_CLASS CWinSystemOSX
-#include "windowing/osx/WinSystemOSX.h"
+#if defined(HAS_SDL)
+#include "windowing/osx/SDL/WinSystemOSXSDL.h"
+#endif
#elif defined(TARGET_ANDROID)
#elif defined(TARGET_DARWIN_IOS)
#define WIN_SYSTEM_CLASS CWinSystemIOS
diff --git a/xbmc/windowing/osx/CMakeLists.txt b/xbmc/windowing/osx/CMakeLists.txt
index 1cbf3dd95d..d90a5063aa 100644
--- a/xbmc/windowing/osx/CMakeLists.txt
+++ b/xbmc/windowing/osx/CMakeLists.txt
@@ -1,19 +1,10 @@
set(SOURCES CocoaDPMSSupport.cpp
OSScreenSaverOSX.cpp
- WinEventsOSX.mm
- WinSystemOSX.mm
VideoSyncOsx.mm)
set(HEADERS CocoaDPMSSupport.h
OSScreenSaverOSX.h
- WinEventsOSX.h
- WinSystemOSX.h
VideoSyncOsx.h)
-if(SDL_FOUND)
- list(APPEND SOURCES WinEventsSDL.cpp)
- list(APPEND HEADERS WinEventsSDL.h)
-endif()
-
if(OPENGL_FOUND)
list(APPEND SOURCES WinSystemOSXGL.mm)
list(APPEND HEADERS WinSystemOSXGL.h)
diff --git a/xbmc/windowing/osx/SDL/CMakeLists.txt b/xbmc/windowing/osx/SDL/CMakeLists.txt
new file mode 100644
index 0000000000..33e25d8432
--- /dev/null
+++ b/xbmc/windowing/osx/SDL/CMakeLists.txt
@@ -0,0 +1,10 @@
+if(SDL_FOUND)
+ set(SOURCES WinEventsSDL.cpp
+ WinSystemOSXSDL.mm)
+ set(HEADERS WinEventsSDL.h
+ WinSystemOSXSDL.h)
+endif()
+
+if(SOURCES)
+ core_add_library(windowing_osx_SDL)
+endif()
diff --git a/xbmc/windowing/osx/WinEventsSDL.cpp b/xbmc/windowing/osx/SDL/WinEventsSDL.cpp
index 0c83e7fdc5..1141e23e54 100644
--- a/xbmc/windowing/osx/WinEventsSDL.cpp
+++ b/xbmc/windowing/osx/SDL/WinEventsSDL.cpp
@@ -25,7 +25,7 @@
using namespace KODI::MESSAGING;
-bool CWinEventsSDL::MessagePump()
+bool CWinEventsOSX::MessagePump()
{
SDL_Event event;
bool ret = false;
@@ -191,7 +191,7 @@ bool CWinEventsSDL::MessagePump()
return ret;
}
-bool CWinEventsSDL::ProcessOSXShortcuts(SDL_Event& event)
+bool CWinEventsOSX::ProcessOSXShortcuts(SDL_Event& event)
{
static bool shift = false, cmd = false;
diff --git a/xbmc/windowing/osx/WinEventsSDL.h b/xbmc/windowing/osx/SDL/WinEventsSDL.h
index 6fd35863be..06e6325b50 100644
--- a/xbmc/windowing/osx/WinEventsSDL.h
+++ b/xbmc/windowing/osx/SDL/WinEventsSDL.h
@@ -12,9 +12,11 @@
#include <SDL/SDL_events.h>
-class CWinEventsSDL : public IWinEvents
+class CWinEventsOSX : public IWinEvents
{
public:
+ CWinEventsOSX() = default;
+ ~CWinEventsOSX() override = default;
bool MessagePump() override;
private:
diff --git a/xbmc/windowing/osx/WinSystemOSX.h b/xbmc/windowing/osx/SDL/WinSystemOSXSDL.h
index 4622c7d9f5..4622c7d9f5 100644
--- a/xbmc/windowing/osx/WinSystemOSX.h
+++ b/xbmc/windowing/osx/SDL/WinSystemOSXSDL.h
diff --git a/xbmc/windowing/osx/WinSystemOSX.mm b/xbmc/windowing/osx/SDL/WinSystemOSXSDL.mm
index 866da1427c..c304ac9a9b 100644
--- a/xbmc/windowing/osx/WinSystemOSX.mm
+++ b/xbmc/windowing/osx/SDL/WinSystemOSXSDL.mm
@@ -6,14 +6,11 @@
* See LICENSES/README.md for more information.
*/
-#include "WinSystemOSX.h"
+#include "WinSystemOSXSDL.h"
#include "AppInboundProtocol.h"
#include "CompileInfo.h"
-#include "OSScreenSaverOSX.h"
#include "ServiceBroker.h"
-#include "VideoSyncOsx.h"
-#include "WinEventsOSX.h"
#include "cores/AudioEngine/AESinkFactory.h"
#include "cores/AudioEngine/Sinks/AESinkDARWINOSX.h"
#include "cores/RetroPlayer/process/osx/RPProcessInfoOSX.h"
@@ -37,6 +34,9 @@
#include "utils/SystemInfo.h"
#include "utils/log.h"
#include "windowing/osx/CocoaDPMSSupport.h"
+#include "windowing/osx/OSScreenSaverOSX.h"
+#include "windowing/osx/SDL/WinEventsSDL.h"
+#include "windowing/osx/VideoSyncOsx.h"
#include "platform/darwin/DarwinUtils.h"
#include "platform/darwin/DictionaryUtils.h"
diff --git a/xbmc/windowing/osx/WinEventsOSX.h b/xbmc/windowing/osx/WinEventsOSX.h
index 0a95bf7254..f9f38c3ced 100644
--- a/xbmc/windowing/osx/WinEventsOSX.h
+++ b/xbmc/windowing/osx/WinEventsOSX.h
@@ -8,9 +8,9 @@
#pragma once
-#include "windowing/osx/WinEventsSDL.h"
+#include "windowing/WinEvents.h"
-class CWinEventsOSX : public CWinEventsSDL
+class CWinEventsOSX : public IWinEvents
{
public:
CWinEventsOSX() = default;
diff --git a/xbmc/windowing/osx/WinSystemOSXGL.h b/xbmc/windowing/osx/WinSystemOSXGL.h
index e40fe1abde..9b5ee5fdca 100644
--- a/xbmc/windowing/osx/WinSystemOSXGL.h
+++ b/xbmc/windowing/osx/WinSystemOSXGL.h
@@ -8,7 +8,9 @@
#pragma once
-#include "WinSystemOSX.h"
+#if defined(HAS_SDL)
+#include "windowing/osx/SDL/WinSystemOSXSDL.h"
+#endif
#include "rendering/gl/RenderSystemGL.h"
class CWinSystemOSXGL : public CWinSystemOSX, public CRenderSystemGL