summaryrefslogtreecommitdiff
path: root/ui/ui.h
blob: a2c0e57a46ab949468f4dca0e6a26306ecc4342f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
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