30#include <sptk5/gui/CPngImage.h>
31#include <sptk5/xdoc/Node.h>
98 CFrame(
const Buffer& imageData, uint32_t frameWidth, uint32_t cornerZone,
102 , m_frameWidth(frameWidth)
103 , m_cornerZone(cornerZone)
104 , m_drawMode(drawMode)
161 using CFrameMap = std::map<std::string, CFrame*>;
166 using CFltkFrameMap = std::map<Fl_Boxtype, CFrame*>;
177 CFltkFrameMap m_fltkFrames;
180 static const Strings frameTypeNames;
181 static const std::array<Fl_Boxtype, 4> frameTypes;
211 void load(
Tar& tar,
const xdoc::SNode& frameNode);
Frame information class.
Definition: CFrame.h:48
uint32_t m_cornerZone
Definition: CFrame.h:76
uint32_t cornerZone() const
Returns corner zone width to draw the frame corners without changes.
Definition: CFrame.h:137
uint32_t frameWidth() const
Returns frame width, to keep widgets inside the frame w/o overlaping.
Definition: CFrame.h:128
void drawResized(int x, int y, int w, int h, bool drawBackground)
Draws resized image.
Definition: CFrame.h:119
CPatternDrawMode m_drawMode
Definition: CFrame.h:81
CFrame(const Buffer &imageData, uint32_t frameWidth, uint32_t cornerZone, CPatternDrawMode drawMode=CPngImage::CPatternDrawMode::PDM_STRETCH, CFrameKind kind=CFrameKind::USER_EXTENDED)
Constructor.
Definition: CFrame.h:98
uint32_t m_frameWidth
Definition: CFrame.h:71
CFrameKind
An expected usage of the frame.
Definition: CFrame.h:55
CFrameKind m_kind
Definition: CFrame.h:86
CFrameKind kind() const
Returns an expected usage of the frame.
Definition: CFrame.h:146
Frame images collection.
Definition: CFrame.h:157
void load(Tar &tar, const xdoc::SNode &frameNode)
Loads the frames from the tar archive by the XML description.
void clear()
Clears the frame collection.
void registerFrame(std::string frameName, CFrame *frame, Fl_Boxtype frameType=FL_NO_BOX)
Registers a single frame image in the collection.
CFrames()=default
Constructor.
~CFrames()
Destructor.
Definition: CFrame.h:194
CFrame * find(std::string frameName) const
Returns a frame image, or NULL if not defined in the collection.
CFrame * find(Fl_Boxtype frameType) const
Returns a standard FLTK frame image, or NULL if not defined in the collection.
PNG image that is initialized from the memory buffer.
Definition: CPngImage.h:53
void drawResized(int x, int y, int w, int h, int cornerZone, CPatternDrawMode drawMode, bool drawBackground)
Draws resized image.
CPatternDrawMode
The way how the resized parts of image are drawn.
Definition: CPngImage.h:105