ladybird/Applications/FontEditor/GlyphEditorWidget.h
Robin Burchell 0dc9af5f7e Add clang-format file
Also run it across the whole tree to get everything using the One True Style.
We don't yet run this in an automated fashion as it's a little slow, but
there is a snippet to do so in makeall.sh.
2019-05-28 17:31:20 +02:00

30 lines
770 B
C++

#include <AK/Function.h>
#include <LibGUI/GFrame.h>
class GlyphEditorWidget final : public GFrame {
public:
GlyphEditorWidget(Font&, GWidget* parent);
virtual ~GlyphEditorWidget() override;
byte glyph() const { return m_glyph; }
void set_glyph(byte);
int preferred_width() const;
int preferred_height() const;
Font& font() { return *m_font; }
const Font& font() const { return *m_font; }
Function<void(byte)> on_glyph_altered;
private:
virtual void paint_event(GPaintEvent&) override;
virtual void mousedown_event(GMouseEvent&) override;
virtual void mousemove_event(GMouseEvent&) override;
void draw_at_mouse(const GMouseEvent&);
RetainPtr<Font> m_font;
byte m_glyph { 0 };
int m_scale { 10 };
};