Add facility to run callbacks on the window thread

This commit is contained in:
Henrik Rydgård
2024-04-06 12:14:29 +02:00
parent 616ee81f84
commit 9ec5efdcc5
6 changed files with 31 additions and 2 deletions
+6
View File
@@ -144,3 +144,9 @@ void System_ShowFileInFolder(const Path &path) {
void System_BrowseForFolder(RequesterToken token, std::string_view title, const Path &initialPath, RequestCallback callback, RequestFailedCallback failedCallback) {
g_requestManager.MakeSystemRequest(SystemRequestType::BROWSE_FOR_FOLDER, token, callback, failedCallback, title, initialPath.ToCString(), 0);
}
void System_RunCallbackInWndProc(void (*callback)(void *, void *), void *userdata) {
int64_t castPtr = (int64_t)callback;
int64_t castUserData = (int64_t)userdata;
g_requestManager.MakeSystemRequest(SystemRequestType::RUN_CALLBACK_IN_WNDPROC, NO_REQUESTER_TOKEN, nullptr, nullptr, "", "", castPtr, castUserData);
}