diff options
author | chai <chaifix@163.com> | 2018-08-07 21:53:55 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-08-07 21:53:55 +0800 |
commit | 926584873cd9a83458ac482c02902f4eedb1e9d3 (patch) | |
tree | 2ed019c5b8e6f391ae7a0268a200b51b7ffe293e /ui/ui.h |
Diffstat (limited to 'ui/ui.h')
-rw-r--r-- | ui/ui.h | 56 |
1 files changed, 56 insertions, 0 deletions
@@ -0,0 +1,56 @@ +// ui - Basic User Interface library to do experiments -*- C++ -*- +// Copyright (C) 2010, 2012 David Capello +// +// Distributed under the terms of the New BSD License, +// see LICENSE.md for more details. + +#ifndef UI_UI_HEADER_FILE_INCLUDED +#define UI_UI_HEADER_FILE_INCLUDED + +#if WIN32 + #include "ui/win32.h" +#endif + +namespace ui { + + ////////////////////////////////////////////////////////////////////// + // window class + + class window { + public: + window(int width, int height) { + m_impl = new window_impl(width, height); + } + + ~window() { + delete m_impl; + } + + size_t width() { + return m_impl->width(); + } + + size_t height() { + return m_impl->height(); + } + + void waitkey() { + m_impl->waitkey(); + } + + window& operator<<(const std::string& text) { + m_impl->write(text); + return *this; + } + + private: + window_impl* m_impl; + + // Non-copyable + window(const window&); + window& operator=(const window&); + }; + +} // namespace ui + +#endif // UI_UI_HEADER_FILE_INCLUDED |