2013-08-09 00:01:20 +00:00
|
|
|
// Aseprite UI Library
|
2013-01-27 15:13:13 +00:00
|
|
|
// Copyright (C) 2001-2013 David Capello
|
2012-08-06 04:17:29 +00:00
|
|
|
//
|
2013-08-09 00:01:20 +00:00
|
|
|
// This source file is distributed under MIT license,
|
|
|
|
// please read LICENSE.txt for more information.
|
2012-08-06 04:17:29 +00:00
|
|
|
|
|
|
|
#ifndef UI_OVERLAY_MANAGER_H_INCLUDED
|
|
|
|
#define UI_OVERLAY_MANAGER_H_INCLUDED
|
2014-03-29 22:40:17 +00:00
|
|
|
#pragma once
|
2012-08-06 04:17:29 +00:00
|
|
|
|
|
|
|
#include "ui/base.h"
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
namespace she { class Surface; }
|
|
|
|
|
|
|
|
namespace ui {
|
|
|
|
|
|
|
|
class Overlay;
|
|
|
|
|
|
|
|
class OverlayManager {
|
|
|
|
friend class GuiSystem; // So it can call destroyInstance() from ~GuiSystem
|
|
|
|
static OverlayManager* m_singleton;
|
|
|
|
|
|
|
|
OverlayManager();
|
|
|
|
~OverlayManager();
|
|
|
|
|
|
|
|
public:
|
|
|
|
static OverlayManager* instance();
|
|
|
|
|
|
|
|
void addOverlay(Overlay* overlay);
|
|
|
|
void removeOverlay(Overlay* overlay);
|
|
|
|
|
|
|
|
void captureOverlappedAreas();
|
|
|
|
void restoreOverlappedAreas();
|
|
|
|
void drawOverlays();
|
|
|
|
|
|
|
|
private:
|
|
|
|
static void destroyInstance();
|
|
|
|
|
|
|
|
typedef std::vector<Overlay*> OverlayList;
|
|
|
|
typedef OverlayList::iterator iterator;
|
|
|
|
|
|
|
|
iterator begin() { return m_overlays.begin(); }
|
|
|
|
iterator end() { return m_overlays.end(); }
|
|
|
|
|
|
|
|
OverlayList m_overlays;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace ui
|
|
|
|
|
|
|
|
#endif
|