Sha256: 77a653e5cbbd5de5af44ba6d383d53fcd4bc962a9d9554a20e2152fcce82d0f3
Contents?: true
Size: 1.26 KB
Versions: 53
Compression:
Stored size: 1.26 KB
Contents
#include "reflex/application.h" #include <windows.h> #include "reflex/exception.h" namespace Reflex { static Application* instance = NULL; Application* app () { return instance; } struct Application::Data { String name; operator bool () const { return true; } };// Application::Data Application::Application () { if (instance) reflex_error("multiple application instance."); instance = this; } Application::~Application () { instance = NULL; } bool Application::run () { if (!*this) return false; MSG msg; while (GetMessage(&msg, NULL, 0, 0)) { TranslateMessage(&msg); DispatchMessage(&msg); } return msg.wParam == 0; } bool Application::quit () { if (!*this) return false; PostQuitMessage(0); return true; } bool Application::preference () { return *this; } bool Application::about () { return *this; } bool Application::set_name (const char* name) { if (!*this || !name) return false; self->name = name; return true; } const char* Application::name () const { if (!*this) return ""; return self->name.c_str(); } Application::operator bool () const { return self && *self; } bool Application::operator ! () const { return !operator bool(); } }// Reflex
Version data entries
53 entries across 53 versions & 1 rubygems