forked from aseprite/aseprite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
overlay_manager.h
53 lines (37 loc) · 1.17 KB
/
overlay_manager.h
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
// Aseprite UI Library
// Copyright (C) 2018-2020 Igara Studio S.A.
// Copyright (C) 2001-2015 David Capello
//
// This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information.
#ifndef UI_OVERLAY_MANAGER_H_INCLUDED
#define UI_OVERLAY_MANAGER_H_INCLUDED
#pragma once
#include "base/ref.h"
#include "gfx/rect.h"
#include "ui/base.h"
#include "ui/overlay.h"
#include <vector>
namespace os { class Surface; }
namespace ui {
class OverlayManager {
friend class UISystem; // So it can call destroyInstance() from ~UISystem
static OverlayManager* m_singleton;
OverlayManager();
~OverlayManager();
public:
static OverlayManager* instance();
void addOverlay(const OverlayRef& overlay);
void removeOverlay(const OverlayRef& overlay);
void drawOverlays();
void restoreOverlappedAreas(const gfx::Rect& bounds);
private:
static void destroyInstance();
typedef std::vector<OverlayRef> OverlayList;
typedef OverlayList::iterator iterator;
iterator begin() { return m_overlays.begin(); }
iterator end() { return m_overlays.end(); }
OverlayList m_overlays;
};
} // namespace ui
#endif