42 lines
679 B
C
42 lines
679 B
C
|
/**
|
||
|
* @file App.h
|
||
|
* @author apio (cloudapio.eu)
|
||
|
* @brief UI application event loop.
|
||
|
*
|
||
|
* @copyright Copyright (c) 2023, the Luna authors.
|
||
|
*
|
||
|
*/
|
||
|
|
||
|
#pragma once
|
||
|
#include <os/LocalClient.h>
|
||
|
|
||
|
namespace ui
|
||
|
{
|
||
|
class App
|
||
|
{
|
||
|
public:
|
||
|
App();
|
||
|
~App();
|
||
|
|
||
|
Result<void> init(int, char**);
|
||
|
Result<int> run();
|
||
|
|
||
|
os::LocalClient& client()
|
||
|
{
|
||
|
return *m_client;
|
||
|
}
|
||
|
|
||
|
void set_should_close(bool b)
|
||
|
{
|
||
|
m_should_close = b;
|
||
|
}
|
||
|
|
||
|
static App& the();
|
||
|
|
||
|
private:
|
||
|
static App* s_app;
|
||
|
OwnedPtr<os::LocalClient> m_client;
|
||
|
bool m_should_close { false };
|
||
|
};
|
||
|
}
|