bsnes/hiro/core/sizable.cpp

31 lines
596 B
C++

#if defined(Hiro_Sizable)
auto mSizable::allocate() -> pObject* {
return new pSizable(*this);
}
auto mSizable::doSize() const -> void {
if(state.onSize) return state.onSize();
}
auto mSizable::geometry() const -> Geometry {
return state.geometry;
}
auto mSizable::minimumSize() const -> Size {
return signal(minimumSize);
}
auto mSizable::onSize(const function<void ()>& callback) -> type& {
state.onSize = callback;
return *this;
}
auto mSizable::setGeometry(Geometry geometry) -> type& {
state.geometry = geometry;
signal(setGeometry, geometry);
return *this;
}
#endif