2013-08-09 00:01:20 +00:00
|
|
|
// Aseprite UI Library
|
2015-09-01 13:18:47 +00:00
|
|
|
// Copyright (C) 2001-2013, 2015 David Capello
|
2012-08-06 04:17:29 +00:00
|
|
|
//
|
2014-03-29 23:08:05 +00:00
|
|
|
// This file is released under the terms of the MIT license.
|
|
|
|
// 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 {
|
2015-09-01 13:18:47 +00:00
|
|
|
friend class UISystem; // So it can call destroyInstance() from ~UISystem
|
2012-08-06 04:17:29 +00:00
|
|
|
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
|