// SPDX-FileCopyrightText: 2019-2023 Connor McLaughlin // SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0) #include #include #include #include class Error; #ifdef __OBJC__ #import #import namespace CocoaTools { NSString* StringViewToNSString(const std::string_view& str); /// Converts NSError to a human-readable string. std::string NSErrorToString(NSError* error); } #endif namespace CocoaTools { /// 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); /// Moves a file from one location to another, using NSFileManager. bool MoveFile(const char* source, const char* destination, Error* error); /// Get the bundle path to the actual application without any translocation fun std::optional GetNonTranslocatedBundlePath(); /// Launch the given application once this one quits bool DelayedLaunch(std::string_view file, std::span args = {}); } // namespace CocoaTools