2015-12-30 06:41:46 +00:00
|
|
|
#if defined(Hiro_Object)
|
2013-03-15 13:11:33 +00:00
|
|
|
|
2015-12-30 06:41:46 +00:00
|
|
|
namespace hiro {
|
2013-03-15 13:11:33 +00:00
|
|
|
|
2015-12-30 06:41:46 +00:00
|
|
|
struct pObject {
|
|
|
|
pObject(mObject& reference) : reference(reference) {}
|
2013-03-15 13:11:33 +00:00
|
|
|
virtual ~pObject() {}
|
2015-12-30 06:41:46 +00:00
|
|
|
auto self() const -> mObject& { return (mObject&)reference; }
|
|
|
|
auto state() const -> mObject::State& { return self().state; }
|
|
|
|
virtual auto construct() -> void;
|
|
|
|
virtual auto destruct() -> void;
|
|
|
|
|
|
|
|
virtual auto focused() const -> bool;
|
|
|
|
virtual auto remove() -> void;
|
|
|
|
virtual auto reset() -> void;
|
|
|
|
virtual auto setEnabled(bool enabled) -> void;
|
|
|
|
virtual auto setFocused() -> void;
|
|
|
|
virtual auto setFont(const Font& font) -> void;
|
|
|
|
virtual auto setVisible(bool visible) -> void;
|
2013-03-15 13:11:33 +00:00
|
|
|
|
2018-03-05 22:42:10 +00:00
|
|
|
auto locked() const -> bool { return locks != 0 || Application::state.quit; }
|
2015-12-30 06:41:46 +00:00
|
|
|
auto lock() -> void { ++locks; }
|
|
|
|
auto unlock() -> void { --locks; }
|
|
|
|
|
|
|
|
mObject& reference;
|
|
|
|
signed locks = 0;
|
2013-03-15 13:11:33 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
2015-12-30 06:41:46 +00:00
|
|
|
|
|
|
|
#endif
|