Move frontend-common to util/core

This commit is contained in:
Stenzek
2023-08-13 16:28:28 +10:00
parent 5b980dafa5
commit bb60170d9a
144 changed files with 2506 additions and 3180 deletions

20
src/util/platform_misc.h Normal file
View File

@ -0,0 +1,20 @@
// SPDX-FileCopyrightText: 2019-2022 Connor McLaughlin <stenzek@gmail.com>
// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
#include "common/window_info.h"
namespace FrontendCommon {
void SuspendScreensaver();
void ResumeScreensaver();
/// Abstracts platform-specific code for asynchronously playing a sound.
/// On Windows, this will use PlaySound(). On Linux, it will shell out to aplay. On MacOS, it uses NSSound.
bool PlaySoundAsync(const char* path);
#ifdef __APPLE__
/// Add a handler to be run when macOS changes between dark and light themes
void AddThemeChangeHandler(void* ctx, void(handler)(void* ctx));
/// Remove a handler previously added using AddThemeChangeHandler with the given context
void RemoveThemeChangeHandler(void* ctx);
#endif
} // namespace FrontendCommon