Sfoglia il codice sorgente

frontend: Add renamed UI utility classes and functions

PatTheMav 10 mesi fa
parent
commit
d846b0ba0a
46 ha cambiato i file con 163 aggiunte e 175 eliminazioni
  1. 14 20
      frontend/utility/AutoUpdateThread.cpp
  2. 0 1
      frontend/utility/AutoUpdateThread.hpp
  3. 4 2
      frontend/utility/GoLiveAPI_CensoredJson.cpp
  4. 1 0
      frontend/utility/GoLiveAPI_CensoredJson.hpp
  5. 9 8
      frontend/utility/GoLiveAPI_Network.cpp
  6. 3 2
      frontend/utility/GoLiveAPI_Network.hpp
  7. 4 5
      frontend/utility/GoLiveAPI_PostData.cpp
  8. 5 2
      frontend/utility/GoLiveAPI_PostData.hpp
  9. 3 2
      frontend/utility/MultitrackVideoError.cpp
  10. 1 0
      frontend/utility/MultitrackVideoError.hpp
  11. 11 32
      frontend/utility/MultitrackVideoOutput.cpp
  12. 3 3
      frontend/utility/MultitrackVideoOutput.hpp
  13. 3 2
      frontend/utility/OBSProxyStyle.cpp
  14. 0 0
      frontend/utility/OBSProxyStyle.hpp
  15. 8 3
      frontend/utility/RemoteTextThread.cpp
  16. 0 2
      frontend/utility/RemoteTextThread.hpp
  17. 4 2
      frontend/utility/ScreenshotObj.hpp
  18. 0 2
      frontend/utility/VCamConfig.hpp
  19. 9 12
      frontend/utility/YoutubeApiWrappers.cpp
  20. 2 1
      frontend/utility/YoutubeApiWrappers.hpp
  21. 5 10
      frontend/utility/audio-encoders.cpp
  22. 1 2
      frontend/utility/audio-encoders.hpp
  23. 0 0
      frontend/utility/crypto-helpers-mac.mm
  24. 2 2
      frontend/utility/crypto-helpers-mbedtls.cpp
  25. 1 1
      frontend/utility/crypto-helpers.hpp
  26. 5 1
      frontend/utility/display-helpers.hpp
  27. 2 0
      frontend/utility/item-widget-helpers.cpp
  28. 2 0
      frontend/utility/item-widget-helpers.hpp
  29. 0 0
      frontend/utility/models/branches.hpp
  30. 0 0
      frontend/utility/models/multitrack-video.hpp
  31. 0 0
      frontend/utility/models/whatsnew.hpp
  32. 1 0
      frontend/utility/obf.c
  33. 0 0
      frontend/utility/obf.h
  34. 6 11
      frontend/utility/platform-osx.mm
  35. 13 15
      frontend/utility/platform-windows.cpp
  36. 30 21
      frontend/utility/platform-x11.cpp
  37. 0 0
      frontend/utility/platform.hpp
  38. 0 0
      frontend/utility/system-info-macos.mm
  39. 0 0
      frontend/utility/system-info-posix.cpp
  40. 5 4
      frontend/utility/system-info-windows.cpp
  41. 0 0
      frontend/utility/system-info.hpp
  42. 4 2
      frontend/utility/undo_stack.cpp
  43. 2 4
      frontend/utility/undo_stack.hpp
  44. 0 0
      frontend/utility/update-helpers.cpp
  45. 0 1
      frontend/utility/update-helpers.hpp
  46. 0 0
      frontend/utility/win-dll-blocklist.c

+ 14 - 20
UI/update/win-update.cpp → frontend/utility/AutoUpdateThread.cpp

@@ -1,30 +1,19 @@
-#include "../win-update/updater/manifest.hpp"
-#include "update-helpers.hpp"
-#include "shared-update.hpp"
-#include "update-window.hpp"
-#include "remote-text.hpp"
-#include "win-update.hpp"
-#include "obs-app.hpp"
+#include "AutoUpdateThread.hpp"
+#include "ui_OBSUpdate.h"
 
 
-#include <qt-wrappers.hpp>
-#include <QMessageBox>
+#include <OBSApp.hpp>
+#include <dialogs/OBSUpdate.hpp>
+#include <updater/manifest.hpp>
+#include <utility/WhatsNewInfoThread.hpp>
+#include <utility/update-helpers.hpp>
 
 
-#include <string>
-#include <mutex>
+#include <qt-wrappers.hpp>
 
 
 #define WIN32_LEAN_AND_MEAN
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #include <windows.h>
 #include <shellapi.h>
 #include <shellapi.h>
 
 
-#include <util/windows/WinHandle.hpp>
-#include <util/util.hpp>
-
-#ifdef BROWSER_AVAILABLE
-#include <browser-panel.hpp>
-#endif
-
-using namespace std;
-using namespace updater;
+#include "moc_AutoUpdateThread.cpp"
 
 
 /* ------------------------------------------------------------------------ */
 /* ------------------------------------------------------------------------ */
 
 
@@ -50,6 +39,11 @@ using namespace updater;
 
 
 /* ------------------------------------------------------------------------ */
 /* ------------------------------------------------------------------------ */
 
 
+using namespace std;
+using namespace updater;
+
+extern char *GetConfigPathPtr(const char *name);
+
 static bool ParseUpdateManifest(const char *manifest_data, bool *updatesAvailable, string &notes, string &updateVer,
 static bool ParseUpdateManifest(const char *manifest_data, bool *updatesAvailable, string &notes, string &updateVer,
 				const string &branch)
 				const string &branch)
 try {
 try {

+ 0 - 1
UI/update/win-update.hpp → frontend/utility/AutoUpdateThread.hpp

@@ -1,7 +1,6 @@
 #pragma once
 #pragma once
 
 
 #include <QThread>
 #include <QThread>
-#include <QString>
 
 
 class AutoUpdateThread : public QThread {
 class AutoUpdateThread : public QThread {
 	Q_OBJECT
 	Q_OBJECT

+ 4 - 2
UI/goliveapi-censoredjson.cpp → frontend/utility/GoLiveAPI_CensoredJson.cpp

@@ -1,7 +1,9 @@
-#include "goliveapi-censoredjson.hpp"
-#include <unordered_map>
+#include "GoLiveAPI_CensoredJson.hpp"
+
 #include <nlohmann/json.hpp>
 #include <nlohmann/json.hpp>
 
 
+#include <unordered_map>
+
 void censorRecurse(obs_data_t *);
 void censorRecurse(obs_data_t *);
 void censorRecurseArray(obs_data_array_t *);
 void censorRecurseArray(obs_data_array_t *);
 
 

+ 1 - 0
UI/goliveapi-censoredjson.hpp → frontend/utility/GoLiveAPI_CensoredJson.hpp

@@ -1,6 +1,7 @@
 #pragma once
 #pragma once
 
 
 #include <obs.hpp>
 #include <obs.hpp>
+
 #include <QString>
 #include <QString>
 #include <nlohmann/json_fwd.hpp>
 #include <nlohmann/json_fwd.hpp>
 
 

+ 9 - 8
UI/goliveapi-network.cpp → frontend/utility/GoLiveAPI_Network.cpp

@@ -1,17 +1,18 @@
-#include "goliveapi-network.hpp"
-#include "goliveapi-censoredjson.hpp"
+#include "GoLiveAPI_Network.hpp"
+#include "GoLiveAPI_CensoredJson.hpp"
+
+#include <OBSApp.hpp>
+#include <utility/MultitrackVideoError.hpp>
+#include <utility/RemoteTextThread.hpp>
 
 
 #include <obs.hpp>
 #include <obs.hpp>
-#include <obs-app.hpp>
-#include <remote-text.hpp>
-#include "multitrack-video-error.hpp"
 
 
-#include <qstring.h>
-#include <string>
 #include <QMessageBox>
 #include <QMessageBox>
 #include <QThreadPool>
 #include <QThreadPool>
-
 #include <nlohmann/json.hpp>
 #include <nlohmann/json.hpp>
+#include <qstring.h>
+
+#include <string>
 
 
 using json = nlohmann::json;
 using json = nlohmann::json;
 
 

+ 3 - 2
UI/goliveapi-network.hpp → frontend/utility/GoLiveAPI_Network.hpp

@@ -1,9 +1,10 @@
 #pragma once
 #pragma once
 
 
+#include "models/multitrack-video.hpp"
+
 #include <obs.hpp>
 #include <obs.hpp>
-#include <QString>
 
 
-#include "models/multitrack-video.hpp"
+#include <QString>
 
 
 /** Returns either GO_LIVE_API_PRODUCTION_URL or a command line override. */
 /** Returns either GO_LIVE_API_PRODUCTION_URL or a command line override. */
 QString MultitrackVideoAutoConfigURL(obs_service_t *service);
 QString MultitrackVideoAutoConfigURL(obs_service_t *service);

+ 4 - 5
UI/goliveapi-postdata.cpp → frontend/utility/GoLiveAPI_PostData.cpp

@@ -1,10 +1,9 @@
-#include "goliveapi-postdata.hpp"
-
-#include <nlohmann/json.hpp>
+#include "GoLiveAPI_PostData.hpp"
+#include "models/multitrack-video.hpp"
 
 
-#include "system-info.hpp"
+#include <utility/system-info.hpp>
 
 
-#include "models/multitrack-video.hpp"
+#include <nlohmann/json.hpp>
 
 
 GoLiveApi::PostData constructGoLivePost(QString streamKey, const std::optional<uint64_t> &maximum_aggregate_bitrate,
 GoLiveApi::PostData constructGoLivePost(QString streamKey, const std::optional<uint64_t> &maximum_aggregate_bitrate,
 					const std::optional<uint32_t> &maximum_video_tracks, bool vod_track_enabled)
 					const std::optional<uint32_t> &maximum_video_tracks, bool vod_track_enabled)

+ 5 - 2
UI/goliveapi-postdata.hpp → frontend/utility/GoLiveAPI_PostData.hpp

@@ -1,9 +1,12 @@
 #pragma once
 #pragma once
 
 
+#include "models/multitrack-video.hpp"
+
 #include <obs.hpp>
 #include <obs.hpp>
-#include <optional>
+
 #include <QString>
 #include <QString>
-#include "models/multitrack-video.hpp"
+
+#include <optional>
 
 
 GoLiveApi::PostData constructGoLivePost(QString streamKey, const std::optional<uint64_t> &maximum_aggregate_bitrate,
 GoLiveApi::PostData constructGoLivePost(QString streamKey, const std::optional<uint64_t> &maximum_aggregate_bitrate,
 					const std::optional<uint32_t> &maximum_video_tracks, bool vod_track_enabled);
 					const std::optional<uint32_t> &maximum_video_tracks, bool vod_track_enabled);

+ 3 - 2
UI/multitrack-video-error.cpp → frontend/utility/MultitrackVideoError.cpp

@@ -1,8 +1,9 @@
-#include "multitrack-video-error.hpp"
+#include "MultitrackVideoError.hpp"
+
+#include <OBSApp.hpp>
 
 
 #include <QMessageBox>
 #include <QMessageBox>
 #include <QPushButton>
 #include <QPushButton>
-#include "obs-app.hpp"
 
 
 MultitrackVideoError MultitrackVideoError::critical(QString error)
 MultitrackVideoError MultitrackVideoError::critical(QString error)
 {
 {

+ 1 - 0
UI/multitrack-video-error.hpp → frontend/utility/MultitrackVideoError.hpp

@@ -1,4 +1,5 @@
 #pragma once
 #pragma once
+
 #include <QString>
 #include <QString>
 
 
 class QWidget;
 class QWidget;

+ 11 - 32
UI/multitrack-video-output.cpp → frontend/utility/MultitrackVideoOutput.cpp

@@ -1,42 +1,21 @@
-#include "multitrack-video-output.hpp"
+#include "MultitrackVideoError.hpp"
+#include "MultitrackVideoOutput.hpp"
+#include "models/multitrack-video.hpp"
+#include "GoLiveAPI_Network.hpp"
+#include "GoLiveAPI_PostData.hpp"
 
 
-#include <util/dstr.hpp>
-#include <util/platform.h>
-#include <util/profiler.hpp>
-#include <util/util.hpp>
-#include <obs-frontend-api.h>
-#include <obs-app.hpp>
-#include <obs.hpp>
-#include <remote-text.hpp>
-#include <window-basic-main.hpp>
-#include <bpm.h>
+#include <OBSApp.hpp>
 
 
-#include <algorithm>
-#include <cinttypes>
-#include <cmath>
-#include <numeric>
-#include <optional>
-#include <string>
-#include <vector>
+#include <bpm.h>
+#include <util/dstr.hpp>
 
 
-#include <QAbstractButton>
-#include <QMessageBox>
-#include <QObject>
 #include <QPushButton>
 #include <QPushButton>
-#include <QScopeGuard>
-#include <QString>
-#include <QThreadPool>
+#include <QMessageBox>
+#include <QThread>
 #include <QUrl>
 #include <QUrl>
 #include <QUrlQuery>
 #include <QUrlQuery>
-#include <QUuid>
-
-#include <nlohmann/json.hpp>
 
 
-#include "system-info.hpp"
-#include "goliveapi-postdata.hpp"
-#include "goliveapi-network.hpp"
-#include "multitrack-video-error.hpp"
-#include "models/multitrack-video.hpp"
+#include <cinttypes>
 
 
 Qt::ConnectionType BlockingConnectionTypeFor(QObject *object)
 Qt::ConnectionType BlockingConnectionTypeFor(QObject *object)
 {
 {

+ 3 - 3
UI/multitrack-video-output.hpp → frontend/utility/MultitrackVideoOutput.hpp

@@ -3,16 +3,16 @@
 #include <obs.hpp>
 #include <obs.hpp>
 #include <util/config-file.h>
 #include <util/config-file.h>
 
 
-#include <atomic>
+#include <memory>
 #include <mutex>
 #include <mutex>
 #include <optional>
 #include <optional>
+#include <string>
 #include <vector>
 #include <vector>
 
 
-#include <QObject>
-
 #define NOMINMAX
 #define NOMINMAX
 
 
 class QString;
 class QString;
+class QWidget;
 
 
 void StreamStopHandler(void *arg, calldata_t *data);
 void StreamStopHandler(void *arg, calldata_t *data);
 void StreamDeactivateHandler(void *arg, calldata_t *data);
 void StreamDeactivateHandler(void *arg, calldata_t *data);

+ 3 - 2
UI/obs-proxy-style.cpp → frontend/utility/OBSProxyStyle.cpp

@@ -1,5 +1,6 @@
-#include "obs-proxy-style.hpp"
-#include <QStyleOptionButton>
+#include "OBSProxyStyle.hpp"
+
+#include <QStyleOption>
 
 
 static inline uint qt_intensity(uint r, uint g, uint b)
 static inline uint qt_intensity(uint r, uint g, uint b)
 {
 {

+ 0 - 0
UI/obs-proxy-style.hpp → frontend/utility/OBSProxyStyle.hpp


+ 8 - 3
UI/remote-text.cpp → frontend/utility/RemoteTextThread.cpp

@@ -15,16 +15,21 @@
     along with this program.  If not, see <http://www.gnu.org/licenses/>.
     along with this program.  If not, see <http://www.gnu.org/licenses/>.
 ******************************************************************************/
 ******************************************************************************/
 
 
-#include <util/curl/curl-helper.h>
+#include "RemoteTextThread.hpp"
+
+#include <OBSApp.hpp>
+
 #include <qt-wrappers.hpp>
 #include <qt-wrappers.hpp>
-#include "obs-app.hpp"
-#include "moc_remote-text.cpp"
+#include <util/curl/curl-helper.h>
+
+#include "moc_RemoteTextThread.cpp"
 
 
 using namespace std;
 using namespace std;
 
 
 static auto curl_deleter = [](CURL *curl) {
 static auto curl_deleter = [](CURL *curl) {
 	curl_easy_cleanup(curl);
 	curl_easy_cleanup(curl);
 };
 };
+
 using Curl = unique_ptr<CURL, decltype(curl_deleter)>;
 using Curl = unique_ptr<CURL, decltype(curl_deleter)>;
 
 
 static size_t string_write(char *ptr, size_t size, size_t nmemb, string &str)
 static size_t string_write(char *ptr, size_t size, size_t nmemb, string &str)

+ 0 - 2
UI/remote-text.hpp → frontend/utility/RemoteTextThread.hpp

@@ -18,8 +18,6 @@
 #pragma once
 #pragma once
 
 
 #include <QThread>
 #include <QThread>
-#include <vector>
-#include <string>
 
 
 class RemoteTextThread : public QThread {
 class RemoteTextThread : public QThread {
 	Q_OBJECT
 	Q_OBJECT

+ 4 - 2
UI/screenshot-obj.hpp → frontend/utility/ScreenshotObj.hpp

@@ -17,10 +17,12 @@
 
 
 #pragma once
 #pragma once
 
 
+#include <obs.hpp>
+
+#include <QImage>
 #include <QObject>
 #include <QObject>
-#include <string>
+
 #include <thread>
 #include <thread>
-#include <obs.hpp>
 
 
 class ScreenshotObj : public QObject {
 class ScreenshotObj : public QObject {
 	Q_OBJECT
 	Q_OBJECT

+ 0 - 2
UI/window-basic-vcam.hpp → frontend/utility/VCamConfig.hpp

@@ -1,7 +1,5 @@
 #pragma once
 #pragma once
 
 
-#include <string>
-
 constexpr const char *VIRTUAL_CAM_ID = "virtualcam_output";
 constexpr const char *VIRTUAL_CAM_ID = "virtualcam_output";
 
 
 enum VCamOutputType {
 enum VCamOutputType {

+ 9 - 12
UI/youtube-api-wrappers.cpp → frontend/utility/YoutubeApiWrappers.cpp

@@ -1,19 +1,16 @@
-#include "moc_youtube-api-wrappers.cpp"
+#include "YoutubeApiWrappers.hpp"
 
 
-#include <QUrl>
-#include <QMimeDatabase>
-#include <QFile>
+#include <utility/RemoteTextThread.hpp>
+#include <utility/obf.h>
+#include <widgets/OBSBasic.hpp>
 
 
-#include <string>
-#include <iostream>
 #include <qt-wrappers.hpp>
 #include <qt-wrappers.hpp>
+#include <ui-config.h>
+
+#include <QFile>
+#include <QMimeDatabase>
 
 
-#include "auth-youtube.hpp"
-#include "obs-app.hpp"
-#include "window-basic-main.hpp"
-#include "remote-text.hpp"
-#include "ui-config.h"
-#include "obf.h"
+#include "moc_YoutubeApiWrappers.cpp"
 
 
 using namespace json11;
 using namespace json11;
 
 

+ 2 - 1
UI/youtube-api-wrappers.hpp → frontend/utility/YoutubeApiWrappers.hpp

@@ -1,8 +1,9 @@
 #pragma once
 #pragma once
 
 
-#include "auth-youtube.hpp"
+#include <oauth/YoutubeAuth.hpp>
 
 
 #include <json11.hpp>
 #include <json11.hpp>
+
 #include <QString>
 #include <QString>
 
 
 struct ChannelDescription {
 struct ChannelDescription {

+ 5 - 10
UI/audio-encoders.cpp → frontend/utility/audio-encoders.cpp

@@ -1,15 +1,10 @@
-#include <algorithm>
-#include <iomanip>
-#include <map>
-#include <memory>
+#include "audio-encoders.hpp"
+
+#include <OBSApp.hpp>
+#include <widgets/OBSMainWindow.hpp>
+
 #include <mutex>
 #include <mutex>
 #include <sstream>
 #include <sstream>
-#include <string>
-#include <vector>
-
-#include "audio-encoders.hpp"
-#include "obs-app.hpp"
-#include "window-main.hpp"
 
 
 using namespace std;
 using namespace std;
 
 

+ 1 - 2
UI/audio-encoders.hpp → frontend/utility/audio-encoders.hpp

@@ -1,8 +1,7 @@
 #pragma once
 #pragma once
 
 
-#include <obs.hpp>
-
 #include <map>
 #include <map>
+#include <string>
 #include <vector>
 #include <vector>
 
 
 const std::map<int, std::string> &GetSimpleAACEncoderBitrateMap();
 const std::map<int, std::string> &GetSimpleAACEncoderBitrateMap();

+ 0 - 0
UI/update/crypto-helpers-mac.mm → frontend/utility/crypto-helpers-mac.mm


+ 2 - 2
UI/update/crypto-helpers-mbedtls.cpp → frontend/utility/crypto-helpers-mbedtls.cpp

@@ -1,7 +1,7 @@
 #include "crypto-helpers.hpp"
 #include "crypto-helpers.hpp"
 
 
-#include "mbedtls/md.h"
-#include "mbedtls/pk.h"
+#include <mbedtls/md.h>
+#include <mbedtls/pk.h>
 
 
 bool VerifySignature(const uint8_t *pubKey, const size_t pubKeyLen, const uint8_t *buf, const size_t len,
 bool VerifySignature(const uint8_t *pubKey, const size_t pubKeyLen, const uint8_t *buf, const size_t len,
 		     const uint8_t *sig, const size_t sigLen)
 		     const uint8_t *sig, const size_t sigLen)

+ 1 - 1
UI/update/crypto-helpers.hpp → frontend/utility/crypto-helpers.hpp

@@ -1,7 +1,7 @@
 #pragma once
 #pragma once
 
 
-#include <stdlib.h>
 #include <cstdint>
 #include <cstdint>
+#include <stdlib.h>
 
 
 bool VerifySignature(const uint8_t *pubKey, const size_t pubKeyLen, const uint8_t *buf, const size_t len,
 bool VerifySignature(const uint8_t *pubKey, const size_t pubKeyLen, const uint8_t *buf, const size_t len,
 		     const uint8_t *sig, const size_t sigLen);
 		     const uint8_t *sig, const size_t sigLen);

+ 5 - 1
UI/display-helpers.hpp → frontend/utility/display-helpers.hpp

@@ -17,8 +17,12 @@
 
 
 #pragma once
 #pragma once
 
 
-#include <graphics/vec4.h>
 #include <graphics/matrix4.h>
 #include <graphics/matrix4.h>
+#include <graphics/vec4.h>
+#include <obs.hpp>
+
+#include <QSize>
+#include <QWidget>
 
 
 static inline void GetScaleAndCenterPos(int baseCX, int baseCY, int windowCX, int windowCY, int &x, int &y,
 static inline void GetScaleAndCenterPos(int baseCX, int baseCY, int windowCX, int windowCY, int &x, int &y,
 					float &scale)
 					float &scale)

+ 2 - 0
UI/item-widget-helpers.cpp → frontend/utility/item-widget-helpers.cpp

@@ -15,6 +15,8 @@
     along with this program.  If not, see <http://www.gnu.org/licenses/>.
     along with this program.  If not, see <http://www.gnu.org/licenses/>.
 ******************************************************************************/
 ******************************************************************************/
 
 
+#include "item-widget-helpers.hpp"
+
 #include <QListWidget>
 #include <QListWidget>
 
 
 QListWidgetItem *TakeListItem(QListWidget *widget, int row)
 QListWidgetItem *TakeListItem(QListWidget *widget, int row)

+ 2 - 0
UI/item-widget-helpers.hpp → frontend/utility/item-widget-helpers.hpp

@@ -22,6 +22,8 @@
  * such as references to sources/etc from getting stuck in the Qt event queue
  * such as references to sources/etc from getting stuck in the Qt event queue
  * with no way of controlling when they'll be released. */
  * with no way of controlling when they'll be released. */
 
 
+#include <QObject>
+
 class QListWidget;
 class QListWidget;
 class QListWidgetItem;
 class QListWidgetItem;
 
 

+ 0 - 0
UI/update/models/branches.hpp → frontend/utility/models/branches.hpp


+ 0 - 0
UI/models/multitrack-video.hpp → frontend/utility/models/multitrack-video.hpp


+ 0 - 0
UI/update/models/whatsnew.hpp → frontend/utility/models/whatsnew.hpp


+ 1 - 0
UI/obf.c → frontend/utility/obf.c

@@ -1,4 +1,5 @@
 #include "obf.h"
 #include "obf.h"
+
 #include <stdbool.h>
 #include <stdbool.h>
 
 
 #define LOWER_HALFBYTE(x) ((x) & 0xF)
 #define LOWER_HALFBYTE(x) ((x) & 0xF)

+ 0 - 0
UI/obf.h → frontend/utility/obf.h


+ 6 - 11
UI/platform-osx.mm → frontend/utility/platform-osx.mm

@@ -15,20 +15,15 @@
     along with this program.  If not, see <http://www.gnu.org/licenses/>.
     along with this program.  If not, see <http://www.gnu.org/licenses/>.
 ******************************************************************************/
 ******************************************************************************/
 
 
-#include <sstream>
-#include <dlfcn.h>
-#include <util/base.h>
-#include <util/threading.h>
-#include <obs-config.h>
-#include "platform.hpp"
-#include "obs-app.hpp"
+#import "platform.hpp"
 
 
-#include <unistd.h>
+#import <OBSApp.hpp>
+
+#import <util/threading.h>
 
 
-#import <AppKit/AppKit.h>
-#import <CoreFoundation/CoreFoundation.h>
 #import <AVFoundation/AVFoundation.h>
 #import <AVFoundation/AVFoundation.h>
-#import <ApplicationServices/ApplicationServices.h>
+#import <AppKit/AppKit.h>
+#import <dlfcn.h>
 
 
 using namespace std;
 using namespace std;
 
 

+ 13 - 15
UI/platform-windows.cpp → frontend/utility/platform-windows.cpp

@@ -15,30 +15,28 @@
     along with this program.  If not, see <http://www.gnu.org/licenses/>.
     along with this program.  If not, see <http://www.gnu.org/licenses/>.
 ******************************************************************************/
 ******************************************************************************/
 
 
-#include <algorithm>
-#include <sstream>
-#include "obs-config.h"
-#include "obs-app.hpp"
 #include "platform.hpp"
 #include "platform.hpp"
 
 
-#include <qt-wrappers.hpp>
+#include <OBSApp.hpp>
+
+#include <util/windows/ComPtr.hpp>
+#include <util/windows/WinHandle.hpp>
 #include <util/windows/win-version.h>
 #include <util/windows/win-version.h>
-#include <util/platform.h>
 
 
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#include <shellapi.h>
-#include <shlobj.h>
 #include <Dwmapi.h>
 #include <Dwmapi.h>
-#include <mmdeviceapi.h>
 #include <audiopolicy.h>
 #include <audiopolicy.h>
-
-#include <util/windows/WinHandle.hpp>
-#include <util/windows/HRError.hpp>
-#include <util/windows/ComPtr.hpp>
+#include <mmdeviceapi.h>
+#include <shellapi.h>
+#include <shlobj.h>
+#include <sstream>
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
 
 
 using namespace std;
 using namespace std;
 
 
+extern bool portable_mode;
+extern int GetConfigPath(char *path, size_t size, const char *name);
+
 static inline bool check_path(const char *data, const char *path, string &output)
 static inline bool check_path(const char *data, const char *path, string &output)
 {
 {
 	ostringstream str;
 	ostringstream str;

+ 30 - 21
UI/platform-x11.cpp → frontend/utility/platform-x11.cpp

@@ -16,44 +16,53 @@
     along with this program.  If not, see <http://www.gnu.org/licenses/>.
     along with this program.  If not, see <http://www.gnu.org/licenses/>.
 ******************************************************************************/
 ******************************************************************************/
 
 
+#include "platform.hpp"
+
+#include <OBSApp.hpp>
+
 #include <obs-config.h>
 #include <obs-config.h>
-#include "obs-app.hpp"
+#include <util/bmem.h>
+#include <util/platform.h>
 
 
-#include <QGuiApplication>
-#include <QScreen>
 #include <QDBusConnection>
 #include <QDBusConnection>
-#include <QDBusMessage>
 #include <QDBusReply>
 #include <QDBusReply>
 
 
-#include <unistd.h>
+#if defined(__FreeBSD__) || defined(__DragonFly__)
+#include <condition_variable>
+#include <mutex>
+#endif
 #include <sstream>
 #include <sstream>
-#include <locale.h>
-
-#include "platform.hpp"
+#include <string>
+#if defined(__FreeBSD__) || defined(__DragonFly__)
+#include <thread>
+#endif
+#include <vector>
 
 
+#if defined(__FreeBSD__) || defined(__DragonFly__)
+#include <fcntl.h>
+#include <libprocstat.h>
+#include <pthread_np.h>
+#endif
+#if defined(__FreeBSD__) || defined(__DragonFly__)
+#include <sys/param.h>
+#endif
 #ifdef __linux__
 #ifdef __linux__
 #include <sys/socket.h>
 #include <sys/socket.h>
-#include <string.h>
-#include <sys/types.h>
-#include <stdio.h>
-#include <sys/un.h>
 #endif
 #endif
 #if defined(__FreeBSD__) || defined(__DragonFly__)
 #if defined(__FreeBSD__) || defined(__DragonFly__)
-#include <sys/param.h>
-#include <fcntl.h>
 #include <sys/sysctl.h>
 #include <sys/sysctl.h>
+#endif
+#ifdef __linux__
+#include <sys/un.h>
+#endif
+#if defined(__FreeBSD__) || defined(__DragonFly__)
 #include <sys/user.h>
 #include <sys/user.h>
-#include <libprocstat.h>
-#include <pthread_np.h>
-
-#include <condition_variable>
-#include <mutex>
-#include <thread>
 #endif
 #endif
+#include <unistd.h>
 
 
+using std::ostringstream;
 using std::string;
 using std::string;
 using std::vector;
 using std::vector;
-using std::ostringstream;
 
 
 #ifdef __linux__
 #ifdef __linux__
 void CheckIfAlreadyRunning(bool &already_running)
 void CheckIfAlreadyRunning(bool &already_running)

+ 0 - 0
UI/platform.hpp → frontend/utility/platform.hpp


+ 0 - 0
UI/system-info-macos.mm → frontend/utility/system-info-macos.mm


+ 0 - 0
UI/system-info-posix.cpp → frontend/utility/system-info-posix.cpp


+ 5 - 4
UI/system-info-windows.cpp → frontend/utility/system-info-windows.cpp

@@ -1,15 +1,16 @@
 #include "system-info.hpp"
 #include "system-info.hpp"
 
 
-#include <dxgi.h>
-#include <cinttypes>
-#include <shlobj.h>
-
 #include <util/dstr.hpp>
 #include <util/dstr.hpp>
 #include <util/platform.h>
 #include <util/platform.h>
 #include <util/windows/ComPtr.hpp>
 #include <util/windows/ComPtr.hpp>
 #include <util/windows/win-registry.h>
 #include <util/windows/win-registry.h>
 #include <util/windows/win-version.h>
 #include <util/windows/win-version.h>
 
 
+#include <cinttypes>
+
+#include <dxgi.h>
+#include <shlobj.h>
+
 static std::optional<std::vector<GoLiveApi::Gpu>> system_gpu_data()
 static std::optional<std::vector<GoLiveApi::Gpu>> system_gpu_data()
 {
 {
 	ComPtr<IDXGIFactory1> factory;
 	ComPtr<IDXGIFactory1> factory;

+ 0 - 0
UI/system-info.hpp → frontend/utility/system-info.hpp


+ 4 - 2
UI/undo-stack-obs.cpp → frontend/utility/undo_stack.cpp

@@ -1,6 +1,8 @@
-#include "moc_undo-stack-obs.cpp"
+#include "undo_stack.hpp"
 
 
-#include <util/util.hpp>
+#include <OBSApp.hpp>
+
+#include "moc_undo_stack.cpp"
 
 
 #define MAX_STACK_SIZE 5000
 #define MAX_STACK_SIZE 5000
 
 

+ 2 - 4
UI/undo-stack-obs.hpp → frontend/utility/undo_stack.hpp

@@ -1,15 +1,13 @@
 #pragma once
 #pragma once
 
 
+#include "ui_OBSBasic.h"
+
 #include <QObject>
 #include <QObject>
 #include <QString>
 #include <QString>
 #include <QTimer>
 #include <QTimer>
 
 
 #include <deque>
 #include <deque>
-#include <functional>
 #include <string>
 #include <string>
-#include <memory>
-
-#include "ui_OBSBasic.h"
 
 
 class undo_stack : public QObject {
 class undo_stack : public QObject {
 	Q_OBJECT
 	Q_OBJECT

+ 0 - 0
UI/update/update-helpers.cpp → frontend/utility/update-helpers.cpp


+ 0 - 1
UI/update/update-helpers.hpp → frontend/utility/update-helpers.hpp

@@ -1,6 +1,5 @@
 #pragma once
 #pragma once
 
 
-#include <cstdint>
 #include <string>
 #include <string>
 
 
 std::string strprintf(const char *format, ...);
 std::string strprintf(const char *format, ...);

+ 0 - 0
UI/win-dll-blocklist.c → frontend/utility/win-dll-blocklist.c