mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
45 lines
846 B
C++
45 lines
846 B
C++
#include <escher/window.h>
|
|
#include <ion.h>
|
|
extern "C" {
|
|
#include <assert.h>
|
|
}
|
|
|
|
void Window::redraw(bool force) {
|
|
if (force) {
|
|
markRectAsDirty(bounds());
|
|
}
|
|
Ion::Display::waitForVBlank();
|
|
View::redraw(bounds());
|
|
}
|
|
|
|
void Window::setContentView(View * contentView) {
|
|
m_contentView = contentView;
|
|
markRectAsDirty(bounds());
|
|
layoutSubviews();
|
|
}
|
|
|
|
const Window * Window::window() const {
|
|
return this;
|
|
}
|
|
|
|
int Window::numberOfSubviews() const {
|
|
return (m_contentView == nullptr ? 0 : 1);
|
|
}
|
|
|
|
View * Window::subviewAtIndex(int index) {
|
|
assert(m_contentView != nullptr && index == 0);
|
|
return m_contentView;
|
|
}
|
|
|
|
void Window::layoutSubviews(bool force) {
|
|
if (m_contentView != nullptr) {
|
|
m_contentView->setFrame(bounds(), force);
|
|
}
|
|
}
|
|
|
|
#if ESCHER_VIEW_LOGGING
|
|
const char * Window::className() const {
|
|
return "Window";
|
|
}
|
|
#endif
|