25#ifndef TGUI_PICTURE_HPP
26#define TGUI_PICTURE_HPP
28#include <TGUI/Widgets/ClickableWidget.hpp>
29#include <TGUI/Renderers/PictureRenderer.hpp>
33TGUI_MODULE_EXPORT
namespace tgui
42 using Ptr = std::shared_ptr<Picture>;
43 using ConstPtr = std::shared_ptr<const Picture>;
45 static constexpr const char StaticWidgetType[] =
"Picture";
54 Picture(
const char* typeName = StaticWidgetType,
bool initRenderer =
true);
98 TGUI_NODISCARD
const PictureRenderer* getSharedRenderer()
const override;
115 using Widget::setSize;
124 TGUI_DEPRECATED(
"Use setIgnoreMouseEvents instead") void ignoreMouseEvents(
bool ignore = true);
131 TGUI_DEPRECATED("Use getIgnoreMouseEvents instead") TGUI_NODISCARD
bool isIgnoringMouseEvents() const;
139 TGUI_NODISCARD
bool canGainFocus() const override;
146 TGUI_NODISCARD
bool isMouseOnWidget(
Vector2f pos) const override;
151 void leftMouseReleased(
Vector2f pos) override;
193 TGUI_NODISCARD std::unique_ptr<DataIO::Node>
save(SavingRenderersMap& renderers)
const override;
198 void load(
const std::unique_ptr<DataIO::Node>& node,
const LoadingRenderersMap& renderers)
override;
203 bool updateTime(
Duration elapsedTime)
override;
215 bool m_ignoringMouseEvents =
false;
218 bool m_possibleDoubleClick =
false;
Base class for render targets.
Definition BackendRenderTarget.hpp:46
Wrapper for durations.
Definition Duration.hpp:55
Class to store the position or size of a widget.
Definition Layout.hpp:323
Definition PictureRenderer.hpp:35
Picture widget.
Definition Picture.hpp:39
std::shared_ptr< Picture > Ptr
Shared widget pointer.
Definition Picture.hpp:42
PictureRenderer * getRenderer() override
Returns the renderer, which gives access to functions that determine how the widget is displayed.
std::shared_ptr< const Picture > ConstPtr
Shared constant widget pointer.
Definition Picture.hpp:43
void rendererChanged(const String &property) override
Function called when one of the properties of the renderer is changed.
static Picture::Ptr copy(const Picture::ConstPtr &picture)
Makes a copy of another picture.
Widget::Ptr clone() const override
Makes a copy of the widget if you don't know its exact type.
PictureRenderer * getSharedRenderer() override
Returns the renderer, which gives access to functions that determine how the widget is displayed.
void setSize(const Layout2d &size) override
Changes the size of the picture.
static Picture::Ptr create(const Texture &texture, bool transparentTexture=false)
Creates a new picture widget.
void load(const std::unique_ptr< DataIO::Node > &node, const LoadingRenderersMap &renderers) override
Loads the widget from a tree of nodes.
static Picture::Ptr create()
Creates a new empty picture widget.
std::unique_ptr< DataIO::Node > save(SavingRenderersMap &renderers) const override
Saves the widget as a tree node in order to save it to a file.
Signal to which the user can subscribe to get callbacks from.
Definition Signal.hpp:61
Wrapper class to store strings.
Definition String.hpp:96
Texture wrapper that internally reuses resources when multiple Texture objects are loaded from the sa...
Definition Texture.hpp:57
Namespace that contains all TGUI functions and classes.
Definition AbsoluteOrRelativeValue.hpp:38
States used for drawing.
Definition RenderStates.hpp:38