Sha256: 06c85d665dc47b84540f2751e7e688d4c86db650dc59b1b12d3974604e463f7e
Contents?: true
Size: 1.26 KB
Versions: 3
Compression:
Stored size: 1.26 KB
Contents
// -*- objc -*- #include "reflex/application.h" #include <assert.h> #import <Cocoa/Cocoa.h> #include <reflex/exception.h> #include "applicationdata.h" #import "cocoaapplication.h" namespace Reflex { static Application* instance = NULL; Application* app () { return instance; } Application::Application () { if (instance) reflex_error("multiple application instance."); instance = this; if (NSApp) [NSApp bind: this]; } Application::~Application () { instance = NULL; } bool Application::run () { if (!*this) return false; [self->cocoa run]; return true; } bool Application::quit () { if (!*this) return false; [self->cocoa terminate: nil]; return true; } bool Application::preference () { return *this; } bool Application::about () { if (!*this) return false; [self->cocoa orderFrontStandardAboutPanel: nil]; return true; } 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 NULL; return self->name.c_str(); } Application::operator bool () const { return self && *self; } bool Application::operator ! () const { return !operator bool(); } }// Reflex
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
reflexion-0.1.6 | src/cocoa/application.mm |
reflexion-0.1.5 | src/cocoa/application.mm |
reflexion-0.1.4 | src/cocoa/application.mm |