2013-12-07 18:22:56 +01:00
|
|
|
/******************************************************************************
|
2023-05-19 02:37:26 +02:00
|
|
|
Copyright (C) 2023 by Lain Bailey <lain@obsproject.com>
|
2013-12-07 18:22:56 +01:00
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2013-12-16 08:06:13 +01:00
|
|
|
#include <util/c99defs.h>
|
|
|
|
|
2013-12-07 18:22:56 +01:00
|
|
|
#include <string>
|
2013-12-16 08:06:13 +01:00
|
|
|
#include <vector>
|
2013-12-07 18:22:56 +01:00
|
|
|
|
2016-08-22 01:11:32 +02:00
|
|
|
class QWidget;
|
2016-01-22 16:33:29 +01:00
|
|
|
|
2013-12-07 18:22:56 +01:00
|
|
|
/* Gets the path of obs-studio specific data files (such as locale) */
|
2013-12-29 12:40:53 +01:00
|
|
|
bool GetDataFilePath(const char *data, std::string &path);
|
2014-01-09 01:17:30 +01:00
|
|
|
|
2014-05-21 08:08:47 +02:00
|
|
|
std::string GetDefaultVideoSavePath();
|
2014-07-11 20:32:27 +02:00
|
|
|
|
|
|
|
std::vector<std::string> GetPreferredLocales();
|
2015-05-25 10:34:49 +02:00
|
|
|
|
2016-08-22 01:11:32 +02:00
|
|
|
bool IsAlwaysOnTop(QWidget *window);
|
|
|
|
void SetAlwaysOnTop(QWidget *window, bool enable);
|
2016-01-22 16:33:29 +01:00
|
|
|
|
2020-06-27 02:31:08 +02:00
|
|
|
bool SetDisplayAffinitySupported(void);
|
|
|
|
|
2022-04-23 18:05:21 +02:00
|
|
|
enum TaskbarOverlayStatus {
|
|
|
|
TaskbarOverlayStatusInactive,
|
|
|
|
TaskbarOverlayStatusActive,
|
|
|
|
TaskbarOverlayStatusPaused,
|
|
|
|
};
|
|
|
|
void TaskbarOverlayInit();
|
|
|
|
void TaskbarOverlaySetStatus(TaskbarOverlayStatus status);
|
|
|
|
|
2022-02-28 22:43:06 +01:00
|
|
|
#ifdef _WIN32
|
|
|
|
class RunOnceMutex;
|
|
|
|
RunOnceMutex
|
|
|
|
#else
|
|
|
|
void
|
|
|
|
#endif
|
|
|
|
CheckIfAlreadyRunning(bool &already_running);
|
|
|
|
|
2015-05-25 10:34:49 +02:00
|
|
|
#ifdef _WIN32
|
|
|
|
uint32_t GetWindowsVersion();
|
2020-06-27 02:31:08 +02:00
|
|
|
uint32_t GetWindowsBuild();
|
2016-07-01 19:27:27 +02:00
|
|
|
void SetProcessPriority(const char *priority);
|
2016-09-26 21:40:23 +02:00
|
|
|
void SetWin32DropStyle(QWidget *window);
|
2017-04-17 15:38:16 +02:00
|
|
|
bool DisableAudioDucking(bool disable);
|
2017-05-15 00:25:34 +02:00
|
|
|
|
|
|
|
struct RunOnceMutexData;
|
|
|
|
|
|
|
|
class RunOnceMutex {
|
|
|
|
RunOnceMutexData *data = nullptr;
|
2019-06-23 07:13:45 +02:00
|
|
|
|
2017-05-15 00:25:34 +02:00
|
|
|
public:
|
|
|
|
RunOnceMutex(RunOnceMutexData *data_) : data(data_) {}
|
|
|
|
RunOnceMutex(const RunOnceMutex &rom) = delete;
|
|
|
|
RunOnceMutex(RunOnceMutex &&rom);
|
|
|
|
~RunOnceMutex();
|
|
|
|
|
|
|
|
RunOnceMutex &operator=(const RunOnceMutex &rom) = delete;
|
|
|
|
RunOnceMutex &operator=(RunOnceMutex &&rom);
|
|
|
|
};
|
|
|
|
|
2022-11-25 10:32:28 +01:00
|
|
|
#if QT_VERSION < QT_VERSION_CHECK(6, 4, 0)
|
2020-03-19 04:37:56 +01:00
|
|
|
QString GetMonitorName(const QString &id);
|
2022-11-25 10:32:28 +01:00
|
|
|
#endif
|
2022-02-07 23:16:59 +01:00
|
|
|
bool IsRunningOnWine();
|
2015-05-25 10:34:49 +02:00
|
|
|
#endif
|
2016-01-26 02:09:59 +01:00
|
|
|
|
|
|
|
#ifdef __APPLE__
|
2022-07-14 19:22:21 +02:00
|
|
|
typedef enum {
|
|
|
|
kAudioDeviceAccess = 0,
|
|
|
|
kVideoDeviceAccess = 1,
|
|
|
|
kScreenCapture = 2,
|
|
|
|
kAccessibility = 3
|
|
|
|
} MacPermissionType;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
kPermissionNotDetermined = 0,
|
|
|
|
kPermissionRestricted = 1,
|
|
|
|
kPermissionDenied = 2,
|
|
|
|
kPermissionAuthorized = 3,
|
|
|
|
} MacPermissionStatus;
|
|
|
|
|
2016-01-26 02:09:59 +01:00
|
|
|
void EnableOSXVSync(bool enable);
|
2018-08-17 12:50:25 +02:00
|
|
|
void EnableOSXDockIcon(bool enable);
|
2022-03-16 23:11:58 +01:00
|
|
|
bool isInBundle();
|
2020-02-10 02:21:36 +01:00
|
|
|
void InstallNSApplicationSubclass();
|
2022-07-21 18:35:44 +02:00
|
|
|
void InstallNSThreadLocks();
|
2020-10-01 18:45:13 +02:00
|
|
|
void disableColorSpaceConversion(QWidget *window);
|
2023-01-31 17:28:21 +01:00
|
|
|
void SetMacOSDarkMode(bool dark);
|
2022-07-14 19:22:21 +02:00
|
|
|
|
|
|
|
MacPermissionStatus CheckPermissionWithPrompt(MacPermissionType type,
|
|
|
|
bool prompt_for_permission);
|
|
|
|
#define CheckPermission(x) CheckPermissionWithPrompt(x, false)
|
|
|
|
#define RequestPermission(x) CheckPermissionWithPrompt(x, true)
|
2022-07-25 19:53:57 +02:00
|
|
|
void OpenMacOSPrivacyPreferences(const char *tab);
|
2016-01-26 02:09:59 +01:00
|
|
|
#endif
|