Files
Upsilon/escher/src/window.cpp
Romain Goyet a83b02a3c2 Escher: Get rid of storeSubviewAtIndex
Change-Id: I0e428081caae3ead5b6e6dc16878e5188a3627c1
2016-06-20 10:33:35 +02:00

43 lines
726 B
C++

#include <escher/window.h>
extern "C" {
#include <assert.h>
}
Window::Window() :
m_contentView(nullptr)
{
}
void Window::redraw() {
View::redraw(bounds());
}
void Window::setContentView(View * contentView) {
m_contentView = contentView;
};
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() {
if (m_contentView != nullptr) {
m_contentView->setFrame(this->bounds());
}
}
#if ESCHER_VIEW_LOGGING
const char * Window::className() const {
return "Window";
}
#endif