And changed the other OSs to define uiprivSysMain/Quit().

This commit is contained in:
Pietro Gagliardi 2020-05-10 12:29:58 -04:00
parent 32512c7a5e
commit ecb5558d3d
3 changed files with 7 additions and 20 deletions

View File

@ -6,7 +6,7 @@ uiprivApplication *uiprivApp;
// TODO see if we can convert this to a string, or use a known type for status_t instead of assuming it's int(32_t)
// - https://www.haiku-os.org/docs/api/SupportDefs_8h.html#a0969fa9dac055f91eebe733902dd928a
// - https://review.haiku-os.org/c/haiku/+/2171/3/src/system/boot/platform/u-boot/start.cpp
- https://github.com/haiku/haiku/blob/master/src/system/libroot/posix/string/strerror.c
// - https://github.com/haiku/haiku/blob/master/src/system/libroot/posix/string/strerror.c
#define uiprivInitReturnStatus(err, msg, status) uiprivInitReturnErrorf(err, "%s: %ld", msg, status)
static thread_id mainThread;
@ -22,18 +22,13 @@ bool uiprivSysInit(void *options, uiInitError *err)
return true;
}
void uiMain(void)
void uiprivSysMain(void)
{
if (!uiprivCheckInitializedAndThread())
return;
uiprivApp->Run();
}
// TODO if this is called beofre uiMain(), uiprivApp will be deleted; either ban doing this outright or catch this scenario
void uiQuit(void)
void uiprivSysQuit(void)
{
if (!uiprivCheckInitializedAndThread())
return;
uiprivApp->Quit();
}

View File

@ -16,17 +16,13 @@ bool uiprivSysInit(void *options, uiInitError *err)
return true;
}
void uiMain(void)
void uiprivSysMain(void)
{
if (!uiprivCheckInitializedAndThread())
return;
gtk_main();
}
void uiQuit(void)
void uiprivSysQuit(void)
{
if (!uiprivCheckInitializedAndThread())
return;
gtk_main_quit();
}

View File

@ -94,13 +94,11 @@ bool uiprivSysInit(void *options, uiInitError *err)
return true;
}
void uiMain(void)
void uiprivSysMain(void)
{
MSG msg;
HRESULT hr;
if (!uiprivCheckInitializedAndThread())
return;
for (;;) {
hr = uiprivHrGetMessageW(&msg, NULL, 0, 0);
if (hr == S_FALSE) // WM_QUIT
@ -115,10 +113,8 @@ void uiMain(void)
}
}
void uiQuit(void)
void uiprivSysQuit(void)
{
if (!uiprivCheckInitializedAndThread())
return;
PostQuitMessage(0);
}