summaryrefslogtreecommitdiff
path: root/Applications/FontEditor
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-02-06 11:56:38 +0100
committerAndreas Kling <kling@serenityos.org>2020-02-06 11:56:38 +0100
commit11580babbfb1b8ae0acab2400f11d905c35642f5 (patch)
tree3b26fcd4bf7afe9ff92203468ba7cd95e192d55f /Applications/FontEditor
parent939a605334a71dd8b7af91cdcbe9047281f7b5b9 (diff)
downloadserenity-11580babbfb1b8ae0acab2400f11d905c35642f5.zip
LibDraw: Put all classes in the Gfx namespace
I started adding things to a Draw namespace, but it somehow felt really wrong seeing Draw::Rect and Draw::Bitmap, etc. So instead, let's rename the library to LibGfx. :^)
Diffstat (limited to 'Applications/FontEditor')
-rw-r--r--Applications/FontEditor/FontEditor.cpp4
-rw-r--r--Applications/FontEditor/FontEditor.h4
-rw-r--r--Applications/FontEditor/GlyphEditorWidget.cpp6
-rw-r--r--Applications/FontEditor/GlyphEditorWidget.h8
-rw-r--r--Applications/FontEditor/GlyphMapWidget.cpp6
-rw-r--r--Applications/FontEditor/GlyphMapWidget.h8
-rw-r--r--Applications/FontEditor/main.cpp10
7 files changed, 23 insertions, 23 deletions
diff --git a/Applications/FontEditor/FontEditor.cpp b/Applications/FontEditor/FontEditor.cpp
index 815ab629d5..dece1538ad 100644
--- a/Applications/FontEditor/FontEditor.cpp
+++ b/Applications/FontEditor/FontEditor.cpp
@@ -38,7 +38,7 @@
#include <LibGUI/GTextBox.h>
#include <stdlib.h>
-FontEditorWidget::FontEditorWidget(const String& path, RefPtr<Font>&& edited_font, GUI::Widget* parent)
+FontEditorWidget::FontEditorWidget(const String& path, RefPtr<Gfx::Font>&& edited_font, GUI::Widget* parent)
: GUI::Widget(parent)
, m_edited_font(move(edited_font))
{
@@ -85,7 +85,7 @@ FontEditorWidget::FontEditorWidget(const String& path, RefPtr<Font>&& edited_fon
exit(0);
};
- m_ui->info_label->set_text_alignment(TextAlignment::CenterLeft);
+ m_ui->info_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
m_ui->demo_label_1->set_font(m_edited_font);
m_ui->demo_label_1->set_text("quick fox jumps nightly above wizard.");
diff --git a/Applications/FontEditor/FontEditor.h b/Applications/FontEditor/FontEditor.h
index 163ad3efd8..82f609c313 100644
--- a/Applications/FontEditor/FontEditor.h
+++ b/Applications/FontEditor/FontEditor.h
@@ -40,8 +40,8 @@ public:
virtual ~FontEditorWidget() override;
private:
- FontEditorWidget(const String& path, RefPtr<Font>&&, GUI::Widget* parent = nullptr);
- RefPtr<Font> m_edited_font;
+ FontEditorWidget(const String& path, RefPtr<Gfx::Font>&&, GUI::Widget* parent = nullptr);
+ RefPtr<Gfx::Font> m_edited_font;
GlyphMapWidget* m_glyph_map_widget { nullptr };
GlyphEditorWidget* m_glyph_editor_widget { nullptr };
diff --git a/Applications/FontEditor/GlyphEditorWidget.cpp b/Applications/FontEditor/GlyphEditorWidget.cpp
index 44ac553de9..5bb1341423 100644
--- a/Applications/FontEditor/GlyphEditorWidget.cpp
+++ b/Applications/FontEditor/GlyphEditorWidget.cpp
@@ -27,13 +27,13 @@
#include "GlyphEditorWidget.h"
#include <LibGUI/GPainter.h>
-GlyphEditorWidget::GlyphEditorWidget(Font& mutable_font, GUI::Widget* parent)
+GlyphEditorWidget::GlyphEditorWidget(Gfx::Font& mutable_font, GUI::Widget* parent)
: GUI::Frame(parent)
, m_font(mutable_font)
{
set_frame_thickness(2);
- set_frame_shadow(FrameShadow::Sunken);
- set_frame_shape(FrameShape::Container);
+ set_frame_shadow(Gfx::FrameShadow::Sunken);
+ set_frame_shape(Gfx::FrameShape::Container);
set_relative_rect({ 0, 0, preferred_width(), preferred_height() });
}
diff --git a/Applications/FontEditor/GlyphEditorWidget.h b/Applications/FontEditor/GlyphEditorWidget.h
index a54258aabd..caf4c79447 100644
--- a/Applications/FontEditor/GlyphEditorWidget.h
+++ b/Applications/FontEditor/GlyphEditorWidget.h
@@ -38,20 +38,20 @@ public:
int preferred_width() const;
int preferred_height() const;
- Font& font() { return *m_font; }
- const Font& font() const { return *m_font; }
+ Gfx::Font& font() { return *m_font; }
+ const Gfx::Font& font() const { return *m_font; }
Function<void(u8)> on_glyph_altered;
private:
- GlyphEditorWidget(Font&, GUI::Widget* parent);
+ GlyphEditorWidget(Gfx::Font&, GUI::Widget* parent);
virtual void paint_event(GUI::PaintEvent&) override;
virtual void mousedown_event(GUI::MouseEvent&) override;
virtual void mousemove_event(GUI::MouseEvent&) override;
void draw_at_mouse(const GUI::MouseEvent&);
- RefPtr<Font> m_font;
+ RefPtr<Gfx::Font> m_font;
u8 m_glyph { 0 };
int m_scale { 10 };
};
diff --git a/Applications/FontEditor/GlyphMapWidget.cpp b/Applications/FontEditor/GlyphMapWidget.cpp
index 95ac188514..f79b78f4ae 100644
--- a/Applications/FontEditor/GlyphMapWidget.cpp
+++ b/Applications/FontEditor/GlyphMapWidget.cpp
@@ -28,13 +28,13 @@
#include <LibDraw/Palette.h>
#include <LibGUI/GPainter.h>
-GlyphMapWidget::GlyphMapWidget(Font& mutable_font, GUI::Widget* parent)
+GlyphMapWidget::GlyphMapWidget(Gfx::Font& mutable_font, GUI::Widget* parent)
: GUI::Frame(parent)
, m_font(mutable_font)
{
set_frame_thickness(2);
- set_frame_shape(FrameShape::Container);
- set_frame_shadow(FrameShadow::Sunken);
+ set_frame_shape(Gfx::FrameShape::Container);
+ set_frame_shadow(Gfx::FrameShadow::Sunken);
set_relative_rect({ 0, 0, preferred_width(), preferred_height() });
}
diff --git a/Applications/FontEditor/GlyphMapWidget.h b/Applications/FontEditor/GlyphMapWidget.h
index 0ad9884e34..5cee940a9c 100644
--- a/Applications/FontEditor/GlyphMapWidget.h
+++ b/Applications/FontEditor/GlyphMapWidget.h
@@ -43,21 +43,21 @@ public:
int preferred_width() const;
int preferred_height() const;
- Font& font() { return *m_font; }
- const Font& font() const { return *m_font; }
+ Gfx::Font& font() { return *m_font; }
+ const Gfx::Font& font() const { return *m_font; }
void update_glyph(u8);
Function<void(u8)> on_glyph_selected;
private:
- GlyphMapWidget(Font&, GUI::Widget* parent);
+ GlyphMapWidget(Gfx::Font&, GUI::Widget* parent);
virtual void paint_event(GUI::PaintEvent&) override;
virtual void mousedown_event(GUI::MouseEvent&) override;
Rect get_outer_rect(u8 glyph) const;
- RefPtr<Font> m_font;
+ RefPtr<Gfx::Font> m_font;
int m_rows { 8 };
int m_horizontal_spacing { 2 };
int m_vertical_spacing { 2 };
diff --git a/Applications/FontEditor/main.cpp b/Applications/FontEditor/main.cpp
index 94819dd3cb..a6fb097455 100644
--- a/Applications/FontEditor/main.cpp
+++ b/Applications/FontEditor/main.cpp
@@ -47,12 +47,12 @@ int main(int argc, char** argv)
return 1;
}
- RefPtr<Font> edited_font;
+ RefPtr<Gfx::Font> edited_font;
String path;
if (argc == 2) {
path = argv[1];
- edited_font = Font::load_from_file(path);
+ edited_font = Gfx::Font::load_from_file(path);
if (!edited_font) {
fprintf(stderr, "Couldn't load font: %s\n", path.characters());
return 1;
@@ -62,7 +62,7 @@ int main(int argc, char** argv)
if (edited_font)
edited_font = edited_font->clone();
else
- edited_font = Font::default_font().clone();
+ edited_font = Gfx::Font::default_font().clone();
auto window = GUI::Window::construct();
window->set_title("Font Editor");
@@ -71,7 +71,7 @@ int main(int argc, char** argv)
auto font_editor = FontEditorWidget::construct(path, move(edited_font));
window->set_main_widget(font_editor);
window->show();
- window->set_icon(load_png("/res/icons/16x16/app-font-editor.png"));
+ window->set_icon(Gfx::load_png("/res/icons/16x16/app-font-editor.png"));
auto menubar = make<GUI::MenuBar>();
@@ -84,7 +84,7 @@ int main(int argc, char** argv)
auto help_menu = GUI::Menu::construct("Help");
help_menu->add_action(GUI::Action::create("About", [&](const GUI::Action&) {
- GUI::AboutDialog::show("Font Editor", load_png("/res/icons/FontEditor.png"), window);
+ GUI::AboutDialog::show("Font Editor", Gfx::load_png("/res/icons/FontEditor.png"), window);
}));
menubar->add_menu(move(help_menu));