diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-01-10 05:41:49 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-01-10 05:41:49 +0100 |
commit | e180e2553ab70b0f5cac252ecb28b41c1c4bae81 (patch) | |
tree | c3a706684698da14e6218a40b3b84007793ec2a3 | |
parent | 305aa25aaea63a1516094992d48f800a58a7715b (diff) | |
download | serenity-e180e2553ab70b0f5cac252ecb28b41c1c4bae81.zip |
Rename CBitmap to CharacterBitmap.
-rw-r--r-- | Widgets/CBitmap.cpp | 17 | ||||
-rw-r--r-- | Widgets/CharacterBitmap.cpp | 17 | ||||
-rw-r--r-- | Widgets/CharacterBitmap.h (renamed from Widgets/CBitmap.h) | 8 | ||||
-rw-r--r-- | Widgets/CheckBox.cpp | 4 | ||||
-rw-r--r-- | Widgets/Font.cpp | 4 | ||||
-rw-r--r-- | Widgets/Font.h | 6 | ||||
-rw-r--r-- | Widgets/Makefile | 2 | ||||
-rw-r--r-- | Widgets/Painter.cpp | 2 | ||||
-rw-r--r-- | Widgets/Painter.h | 4 | ||||
-rw-r--r-- | Widgets/TextBox.cpp | 2 |
10 files changed, 33 insertions, 33 deletions
diff --git a/Widgets/CBitmap.cpp b/Widgets/CBitmap.cpp deleted file mode 100644 index ee17e7bf05..0000000000 --- a/Widgets/CBitmap.cpp +++ /dev/null @@ -1,17 +0,0 @@ -#include "CBitmap.h" - -CBitmap::CBitmap(const char* asciiData, unsigned width, unsigned height) - : m_bits(asciiData) - , m_size(width, height) -{ -} - -CBitmap::~CBitmap() -{ -} - -RetainPtr<CBitmap> CBitmap::createFromASCII(const char* asciiData, unsigned width, unsigned height) -{ - return adopt(*new CBitmap(asciiData, width, height)); -} - diff --git a/Widgets/CharacterBitmap.cpp b/Widgets/CharacterBitmap.cpp new file mode 100644 index 0000000000..4ea7a14467 --- /dev/null +++ b/Widgets/CharacterBitmap.cpp @@ -0,0 +1,17 @@ +#include "CharacterBitmap.h" + +CharacterBitmap::CharacterBitmap(const char* asciiData, unsigned width, unsigned height) + : m_bits(asciiData) + , m_size(width, height) +{ +} + +CharacterBitmap::~CharacterBitmap() +{ +} + +RetainPtr<CharacterBitmap> CharacterBitmap::createFromASCII(const char* asciiData, unsigned width, unsigned height) +{ + return adopt(*new CharacterBitmap(asciiData, width, height)); +} + diff --git a/Widgets/CBitmap.h b/Widgets/CharacterBitmap.h index bb378fb2e5..8c9f9e3d3e 100644 --- a/Widgets/CBitmap.h +++ b/Widgets/CharacterBitmap.h @@ -4,10 +4,10 @@ #include <AK/Retainable.h> #include <AK/RetainPtr.h> -class CBitmap : public Retainable<CBitmap> { +class CharacterBitmap : public Retainable<CharacterBitmap> { public: - static RetainPtr<CBitmap> createFromASCII(const char* asciiData, unsigned width, unsigned height); - ~CBitmap(); + static RetainPtr<CharacterBitmap> createFromASCII(const char* asciiData, unsigned width, unsigned height); + ~CharacterBitmap(); const char* bits() const { return m_bits; } @@ -16,7 +16,7 @@ public: unsigned height() const { return m_size.height(); } private: - CBitmap(const char* b, unsigned w, unsigned h); + CharacterBitmap(const char* b, unsigned w, unsigned h); const char* m_bits { nullptr }; Size m_size; diff --git a/Widgets/CheckBox.cpp b/Widgets/CheckBox.cpp index 6fb7f766e1..99849ea435 100644 --- a/Widgets/CheckBox.cpp +++ b/Widgets/CheckBox.cpp @@ -1,6 +1,6 @@ #include "CheckBox.h" #include "Painter.h" -#include "CBitmap.h" +#include "CharacterBitmap.h" #include <cstdio> CheckBox::CheckBox(Widget* parent) @@ -76,7 +76,7 @@ static const char* checkedBitmap = { void CheckBox::paintEvent(PaintEvent&) { Painter painter(*this); - auto bitmap = CBitmap::createFromASCII(isChecked() ? checkedBitmap : uncheckedBitmap, 11, 11); + auto bitmap = CharacterBitmap::createFromASCII(isChecked() ? checkedBitmap : uncheckedBitmap, 11, 11); auto textRect = rect(); textRect.setLeft(bitmap->width() + 4); diff --git a/Widgets/Font.cpp b/Widgets/Font.cpp index 61bb7aa1f0..1eb9999131 100644 --- a/Widgets/Font.cpp +++ b/Widgets/Font.cpp @@ -22,13 +22,13 @@ Font::~Font() { } -const CBitmap* Font::glyphBitmap(byte ch) const +const CharacterBitmap* Font::glyphBitmap(byte ch) const { if (!m_bitmaps[ch]) { if (ch < m_firstGlyph || ch > m_lastGlyph) return nullptr; const char* data = m_glyphs[(unsigned)ch - m_firstGlyph]; - m_bitmaps[ch] = CBitmap::createFromASCII(data, m_glyphWidth, m_glyphHeight); + m_bitmaps[ch] = CharacterBitmap::createFromASCII(data, m_glyphWidth, m_glyphHeight); } ASSERT(ch >= m_firstGlyph && ch <= m_lastGlyph); return m_bitmaps[ch].ptr(); diff --git a/Widgets/Font.h b/Widgets/Font.h index 6d62ccf979..b41d371bcf 100644 --- a/Widgets/Font.h +++ b/Widgets/Font.h @@ -1,6 +1,6 @@ #pragma once -#include "CBitmap.h" +#include "CharacterBitmap.h" #include <AK/Retainable.h> #include <AK/RetainPtr.h> #include <AK/Types.h> @@ -11,7 +11,7 @@ public: ~Font(); - const CBitmap* glyphBitmap(byte) const; + const CharacterBitmap* glyphBitmap(byte) const; byte glyphWidth() const { return m_glyphWidth; } byte glyphHeight() const { return m_glyphHeight; } @@ -20,7 +20,7 @@ private: Font(const char* const* glyphs, byte glyphWidth, byte glyphHeight, byte firstGlyph, byte lastGlyph); const char* const* m_glyphs { nullptr }; - mutable RetainPtr<CBitmap> m_bitmaps[256]; + mutable RetainPtr<CharacterBitmap> m_bitmaps[256]; byte m_glyphWidth { 0 }; byte m_glyphHeight { 0 }; diff --git a/Widgets/Makefile b/Widgets/Makefile index 70285e464a..2b380f7d90 100644 --- a/Widgets/Makefile +++ b/Widgets/Makefile @@ -22,7 +22,7 @@ VFS_OBJS = \ Font.o \ Window.o \ ClockWidget.o \ - CBitmap.o \ + CharacterBitmap.o \ CheckBox.o \ ListBox.o \ TextBox.o \ diff --git a/Widgets/Painter.cpp b/Widgets/Painter.cpp index 6a26703ffe..9f6ba92992 100644 --- a/Widgets/Painter.cpp +++ b/Widgets/Painter.cpp @@ -75,7 +75,7 @@ void Painter::xorRect(const Rect& rect, Color color) } } -void Painter::drawBitmap(const Point& p, const CBitmap& bitmap, Color color) +void Painter::drawBitmap(const Point& p, const CharacterBitmap& bitmap, Color color) { Point point = p; point.moveBy(m_translation); diff --git a/Widgets/Painter.h b/Widgets/Painter.h index a4816abe22..b95efccab3 100644 --- a/Widgets/Painter.h +++ b/Widgets/Painter.h @@ -6,7 +6,7 @@ #include "Size.h" #include <AK/AKString.h> -class CBitmap; +class CharacterBitmap; class GraphicsBitmap; class Font; class Widget; @@ -20,7 +20,7 @@ public: void fillRect(const Rect&, Color); void drawRect(const Rect&, Color); void drawText(const Rect&, const String&, TextAlignment = TextAlignment::TopLeft, Color = Color()); - void drawBitmap(const Point&, const CBitmap&, Color = Color()); + void drawBitmap(const Point&, const CharacterBitmap&, Color = Color()); void drawPixel(const Point&, Color); void drawLine(const Point& p1, const Point& p2, Color); diff --git a/Widgets/TextBox.cpp b/Widgets/TextBox.cpp index 46f24702c5..b5e143a595 100644 --- a/Widgets/TextBox.cpp +++ b/Widgets/TextBox.cpp @@ -1,7 +1,7 @@ #include "TextBox.h" #include "Painter.h" #include "Font.h" -#include "CBitmap.h" +#include "CharacterBitmap.h" #include <AK/StdLibExtras.h> TextBox::TextBox(Widget* parent) |