about summary refs log tree commit diff stats
path: root/src/area_popup.h
blob: 50e10e873abe11b1feb3a022c98d271d66ad1b35 (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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef AREA_POPUP_H_03FAC988
#define AREA_POPUP_H_03FAC988

#include <wx/wxprec.h>

#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif

#include <vector>

class AreaPopup : public wxScrolledCanvas {
 public:
  AreaPopup(wxWindow* parent, int area_id);

  void ResetIndicators();
  void UpdateIndicators();

 private:
  enum IndicatorType {
    kLOCATION,
    kPAINTING,
  };

  struct IndicatorInfo {
    // For locations, the id is an index into the map area's locations list.
    // For paintings, it is a real painting id.
    int id;
    IndicatorType type;
    int y;

    IndicatorInfo(int id, IndicatorType type, int y)
        : id(id), type(type), y(y) {}
  };

  void OnPaint(wxPaintEvent& event);
  void OnDPIChanged(wxDPIChangedEvent& event);

  void LoadIcons();

  int area_id_;

  const wxBitmap* unchecked_eye_;
  const wxBitmap* checked_eye_;
  const wxBitmap* unchecked_owl_;
  const wxBitmap* checked_owl_;

  int full_width_ = 0;
  int full_height_ = 0;
  wxSize header_extent_;

  std::vector<IndicatorInfo> indicators_;

  wxBitmap rendered_;
};

#endif /* end of include guard: AREA_POPUP_H_03FAC988 */