2013-12-07 17:22:56 +00:00
|
|
|
/******************************************************************************
|
2023-05-19 00:37:26 +00:00
|
|
|
Copyright (C) 2023 by Lain Bailey <lain@obsproject.com>
|
2013-12-07 17:22:56 +00: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 07:06:13 +00:00
|
|
|
#include <util/c99defs.h>
|
|
|
|
|
2013-12-07 17:22:56 +00:00
|
|
|
#include <string>
|
2013-12-16 07:06:13 +00:00
|
|
|
#include <vector>
|
2013-12-07 17:22:56 +00:00
|
|
|
|
2016-08-21 23:11:32 +00:00
|
|
|
class QWidget;
|
2016-01-22 15:33:29 +00:00
|
|
|
|
2013-12-07 17:22:56 +00:00
|
|
|
/* Gets the path of obs-studio specific data files (such as locale) */
|
2013-12-29 11:40:53 +00:00
|
|
|
bool GetDataFilePath(const char *data, std::string &path);
|
2014-01-09 00:17:30 +00:00
|
|
|
|
2014-05-21 06:08:47 +00:00
|
|
|
std::string GetDefaultVideoSavePath();
|
2014-07-11 18:32:27 +00:00
|
|
|
|
|
|
|
std::vector<std::string> GetPreferredLocales();
|
2015-05-25 08:34:49 +00:00
|
|
|
|
2016-08-21 23:11:32 +00:00
|
|
|
bool IsAlwaysOnTop(QWidget *window);
|
|
|
|
void SetAlwaysOnTop(QWidget *window, bool enable);
|
2016-01-22 15:33:29 +00:00
|
|
|
|
2020-06-27 00:31:08 +00:00
|
|
|
bool SetDisplayAffinitySupported(void);
|
|
|
|
|
2023-09-28 02:43:42 +00:00
|
|
|
bool HighContrastEnabled();
|
|
|
|
|
2022-04-23 16:05:21 +00:00
|
|
|
enum TaskbarOverlayStatus {
|
|
|
|
TaskbarOverlayStatusInactive,
|
|
|
|
TaskbarOverlayStatusActive,
|
|
|
|
TaskbarOverlayStatusPaused,
|
|
|
|
};
|
|
|
|
void TaskbarOverlayInit();
|
|
|
|
void TaskbarOverlaySetStatus(TaskbarOverlayStatus status);
|
|
|
|
|
2022-02-28 21:43:06 +00:00
|
|
|
#ifdef _WIN32
|
|
|
|
class RunOnceMutex;
|
|
|
|
RunOnceMutex
|
|
|
|
#else
|
|
|
|
void
|
|
|
|
#endif
|
|
|
|
CheckIfAlreadyRunning(bool &already_running);
|
|
|
|
|
2015-05-25 08:34:49 +00:00
|
|
|
#ifdef _WIN32
|
|
|
|
uint32_t GetWindowsVersion();
|
2020-06-27 00:31:08 +00:00
|
|
|
uint32_t GetWindowsBuild();
|
2016-07-01 17:27:27 +00:00
|
|
|
void SetProcessPriority(const char *priority);
|
2016-09-26 19:40:23 +00:00
|
|
|
void SetWin32DropStyle(QWidget *window);
|
2017-04-17 13:38:16 +00:00
|
|
|
bool DisableAudioDucking(bool disable);
|
2017-05-14 22:25:34 +00:00
|
|
|
|
|
|
|
struct RunOnceMutexData;
|
|
|
|
|
|
|
|
class RunOnceMutex {
|
|
|
|
RunOnceMutexData *data = nullptr;
|
2019-06-23 05:13:45 +00:00
|
|
|
|
2017-05-14 22:25:34 +00: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 09:32:28 +00:00
|
|
|
#if QT_VERSION < QT_VERSION_CHECK(6, 4, 0)
|
2020-03-19 03:37:56 +00:00
|
|
|
QString GetMonitorName(const QString &id);
|
2022-11-25 09:32:28 +00:00
|
|
|
#endif
|
2022-02-07 22:16:59 +00:00
|
|
|
bool IsRunningOnWine();
|
2015-05-25 08:34:49 +00:00
|
|
|
#endif
|
2016-01-26 01:09:59 +00:00
|
|
|
|
|
|
|
#ifdef __APPLE__
|
2022-07-14 17:22:21 +00: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 01:09:59 +00:00
|
|
|
void EnableOSXVSync(bool enable);
|
2018-08-17 10:50:25 +00:00
|
|
|
void EnableOSXDockIcon(bool enable);
|
2022-03-16 22:11:58 +00:00
|
|
|
bool isInBundle();
|
2020-02-10 01:21:36 +00:00
|
|
|
void InstallNSApplicationSubclass();
|
2022-07-21 16:35:44 +00:00
|
|
|
void InstallNSThreadLocks();
|
2020-10-01 16:45:13 +00:00
|
|
|
void disableColorSpaceConversion(QWidget *window);
|
2023-01-31 16:28:21 +00:00
|
|
|
void SetMacOSDarkMode(bool dark);
|
2022-07-14 17:22:21 +00:00
|
|
|
|
|
|
|
MacPermissionStatus CheckPermissionWithPrompt(MacPermissionType type,
|
|
|
|
bool prompt_for_permission);
|
|
|
|
#define CheckPermission(x) CheckPermissionWithPrompt(x, false)
|
|
|
|
#define RequestPermission(x) CheckPermissionWithPrompt(x, true)
|
2022-07-25 17:53:57 +00:00
|
|
|
void OpenMacOSPrivacyPreferences(const char *tab);
|
2016-01-26 01:09:59 +00:00
|
|
|
#endif
|