summaryrefslogtreecommitdiff
path: root/applications/goldman/source/window.hpp
blob: 380e25b2863831d342c9afc2afdb1c05d123064a (plain) (blame)
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
#pragma once

#include <daguerre/image.hpp>

struct window {

  static constexpr int decorations_extra_width  =  4;
  static constexpr int decorations_extra_height = 18;
  static constexpr int title_height = 16;

  daguerre::image<daguerre::hilbert_color> contents_with_decorations;
  daguerre::image<daguerre::hilbert_color> contents;

  int x;
  int y;

  bool is_shown;

  std::string title;

  void set_size(int width, int height);
  void draw_decorations(bool top);

  inline window(int center_x, int center_y)
  : x(center_x - decorations_extra_width / 2),
    y(center_y - decorations_extra_height / 2),
    is_shown(false) {
    set_size(0, 0);
    draw_decorations(false);
  }

};