And changed the other OSs to define uiprivSysMain/Quit().
This commit is contained in:
parent
32512c7a5e
commit
ecb5558d3d
|
@ -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)
|
// 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://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://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)
|
#define uiprivInitReturnStatus(err, msg, status) uiprivInitReturnErrorf(err, "%s: %ld", msg, status)
|
||||||
|
|
||||||
static thread_id mainThread;
|
static thread_id mainThread;
|
||||||
|
@ -22,18 +22,13 @@ bool uiprivSysInit(void *options, uiInitError *err)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void uiMain(void)
|
void uiprivSysMain(void)
|
||||||
{
|
{
|
||||||
if (!uiprivCheckInitializedAndThread())
|
|
||||||
return;
|
|
||||||
uiprivApp->Run();
|
uiprivApp->Run();
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO if this is called beofre uiMain(), uiprivApp will be deleted; either ban doing this outright or catch this scenario
|
void uiprivSysQuit(void)
|
||||||
void uiQuit(void)
|
|
||||||
{
|
{
|
||||||
if (!uiprivCheckInitializedAndThread())
|
|
||||||
return;
|
|
||||||
uiprivApp->Quit();
|
uiprivApp->Quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,17 +16,13 @@ bool uiprivSysInit(void *options, uiInitError *err)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void uiMain(void)
|
void uiprivSysMain(void)
|
||||||
{
|
{
|
||||||
if (!uiprivCheckInitializedAndThread())
|
|
||||||
return;
|
|
||||||
gtk_main();
|
gtk_main();
|
||||||
}
|
}
|
||||||
|
|
||||||
void uiQuit(void)
|
void uiprivSysQuit(void)
|
||||||
{
|
{
|
||||||
if (!uiprivCheckInitializedAndThread())
|
|
||||||
return;
|
|
||||||
gtk_main_quit();
|
gtk_main_quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -94,13 +94,11 @@ bool uiprivSysInit(void *options, uiInitError *err)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void uiMain(void)
|
void uiprivSysMain(void)
|
||||||
{
|
{
|
||||||
MSG msg;
|
MSG msg;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
if (!uiprivCheckInitializedAndThread())
|
|
||||||
return;
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
hr = uiprivHrGetMessageW(&msg, NULL, 0, 0);
|
hr = uiprivHrGetMessageW(&msg, NULL, 0, 0);
|
||||||
if (hr == S_FALSE) // WM_QUIT
|
if (hr == S_FALSE) // WM_QUIT
|
||||||
|
@ -115,10 +113,8 @@ void uiMain(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void uiQuit(void)
|
void uiprivSysQuit(void)
|
||||||
{
|
{
|
||||||
if (!uiprivCheckInitializedAndThread())
|
|
||||||
return;
|
|
||||||
PostQuitMessage(0);
|
PostQuitMessage(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue