2013-08-09 08:01:20 +08:00
|
|
|
// Aseprite UI Library
|
2016-03-09 22:00:17 +08:00
|
|
|
// Copyright (C) 2001-2016 David Capello
|
2012-08-06 12:17:29 +08:00
|
|
|
//
|
2014-03-30 07:08:05 +08:00
|
|
|
// This file is released under the terms of the MIT license.
|
|
|
|
// Read LICENSE.txt for more information.
|
2012-08-06 12:17:29 +08:00
|
|
|
|
|
|
|
#ifndef UI_OVERLAY_H_INCLUDED
|
|
|
|
#define UI_OVERLAY_H_INCLUDED
|
2014-03-30 06:40:17 +08:00
|
|
|
#pragma once
|
2012-08-06 12:17:29 +08:00
|
|
|
|
|
|
|
#include "gfx/fwd.h"
|
|
|
|
#include "gfx/point.h"
|
|
|
|
#include "ui/base.h"
|
|
|
|
|
|
|
|
namespace she {
|
|
|
|
class Surface;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace ui {
|
|
|
|
|
|
|
|
class Overlay {
|
|
|
|
public:
|
|
|
|
typedef int ZOrder;
|
|
|
|
|
2012-08-11 10:14:54 +08:00
|
|
|
static const ZOrder NormalZOrder = 0;
|
|
|
|
static const ZOrder MouseZOrder = 5000;
|
|
|
|
|
2012-08-06 12:17:29 +08:00
|
|
|
Overlay(she::Surface* overlaySurface, const gfx::Point& pos, ZOrder zorder = 0);
|
|
|
|
~Overlay();
|
|
|
|
|
2012-08-11 10:14:54 +08:00
|
|
|
she::Surface* setSurface(she::Surface* newSurface);
|
|
|
|
|
Refactor several "getNoun()" getters to "noun()"
This is a work-in-progress to create a consistent API and finally
separate the whole Aseprite base/gfx/ui libs into a reusable C++ library.
Classes:
app::IFileItem, app::AppMenuItem, app::skin::SkinPart,
gfx::Rect, gfx::Border, she::FileDialog,
ui::IButtonIcon, ui::Graphics, ui::Overlay, ui::Widget,
ui::ScrollableViewDelegate, and UI events
2015-12-05 01:39:04 +08:00
|
|
|
const gfx::Point& position() const { return m_pos; }
|
|
|
|
gfx::Rect bounds() const;
|
2012-08-06 12:17:29 +08:00
|
|
|
|
2016-03-09 22:00:17 +08:00
|
|
|
void captureOverlappedArea(she::Surface* screen);
|
|
|
|
void restoreOverlappedArea(she::Surface* screen);
|
2012-08-06 12:17:29 +08:00
|
|
|
|
2016-03-09 22:00:17 +08:00
|
|
|
void drawOverlay(she::Surface* screen);
|
2012-08-06 12:17:29 +08:00
|
|
|
void moveOverlay(const gfx::Point& newPos);
|
|
|
|
|
|
|
|
bool operator<(const Overlay& other) const {
|
|
|
|
return m_zorder < other.m_zorder;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
she::Surface* m_surface;
|
|
|
|
she::Surface* m_overlap;
|
|
|
|
gfx::Point m_pos;
|
|
|
|
ZOrder m_zorder;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace ui
|
|
|
|
|
|
|
|
#endif
|