1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 01:07:35 +00:00

AK: Rename the common integer typedefs to make it obvious what they are.

These types can be picked up by including <AK/Types.h>:

* u8, u16, u32, u64 (unsigned)
* i8, i16, i32, i64 (signed)
This commit is contained in:
Andreas Kling 2019-07-03 21:17:35 +02:00
parent c4c4bbc5ba
commit 27f699ef0c
208 changed files with 1603 additions and 1621 deletions

View file

@ -91,12 +91,12 @@ FontEditorWidget::FontEditorWidget(const String& path, RefPtr<Font>&& edited_fon
demo_label_2->update();
};
m_glyph_editor_widget->on_glyph_altered = [this, update_demo](byte glyph) {
m_glyph_editor_widget->on_glyph_altered = [this, update_demo](u8 glyph) {
m_glyph_map_widget->update_glyph(glyph);
update_demo();
};
m_glyph_map_widget->on_glyph_selected = [this, info_label, width_spinbox](byte glyph) {
m_glyph_map_widget->on_glyph_selected = [this, info_label, width_spinbox](u8 glyph) {
m_glyph_editor_widget->set_glyph(glyph);
width_spinbox->set_value(m_edited_font->glyph_width(m_glyph_map_widget->selected_glyph()));
info_label->set_text(String::format("0x%b (%c)", glyph, glyph));

View file

@ -15,7 +15,7 @@ GlyphEditorWidget::~GlyphEditorWidget()
{
}
void GlyphEditorWidget::set_glyph(byte glyph)
void GlyphEditorWidget::set_glyph(u8 glyph)
{
if (m_glyph == glyph)
return;

View file

@ -6,8 +6,8 @@ public:
GlyphEditorWidget(Font&, GWidget* parent);
virtual ~GlyphEditorWidget() override;
byte glyph() const { return m_glyph; }
void set_glyph(byte);
u8 glyph() const { return m_glyph; }
void set_glyph(u8);
int preferred_width() const;
int preferred_height() const;
@ -15,7 +15,7 @@ public:
Font& font() { return *m_font; }
const Font& font() const { return *m_font; }
Function<void(byte)> on_glyph_altered;
Function<void(u8)> on_glyph_altered;
private:
virtual void paint_event(GPaintEvent&) override;
@ -25,6 +25,6 @@ private:
void draw_at_mouse(const GMouseEvent&);
RefPtr<Font> m_font;
byte m_glyph { 0 };
u8 m_glyph { 0 };
int m_scale { 10 };
};

View file

@ -25,7 +25,7 @@ int GlyphMapWidget::preferred_height() const
return rows() * (font().glyph_height() + m_vertical_spacing) + 2 + frame_thickness() * 2;
}
void GlyphMapWidget::set_selected_glyph(byte glyph)
void GlyphMapWidget::set_selected_glyph(u8 glyph)
{
if (m_selected_glyph == glyph)
return;
@ -35,7 +35,7 @@ void GlyphMapWidget::set_selected_glyph(byte glyph)
update();
}
Rect GlyphMapWidget::get_outer_rect(byte glyph) const
Rect GlyphMapWidget::get_outer_rect(u8 glyph) const
{
int row = glyph / columns();
int column = glyph % columns();
@ -48,7 +48,7 @@ Rect GlyphMapWidget::get_outer_rect(byte glyph) const
.translated(frame_thickness(), frame_thickness());
}
void GlyphMapWidget::update_glyph(byte glyph)
void GlyphMapWidget::update_glyph(u8 glyph)
{
update(get_outer_rect(glyph));
}
@ -63,7 +63,7 @@ void GlyphMapWidget::paint_event(GPaintEvent& event)
painter.set_font(font());
painter.fill_rect(frame_inner_rect(), Color::White);
byte glyph = 0;
u8 glyph = 0;
for (int row = 0; row < rows(); ++row) {
for (int column = 0; column < columns(); ++column, ++glyph) {

View file

@ -8,8 +8,8 @@ public:
GlyphMapWidget(Font&, GWidget* parent);
virtual ~GlyphMapWidget() override;
byte selected_glyph() const { return m_selected_glyph; }
void set_selected_glyph(byte);
u8 selected_glyph() const { return m_selected_glyph; }
void set_selected_glyph(u8);
int rows() const { return m_rows; }
int columns() const { return 256 / m_rows; }
@ -20,19 +20,19 @@ public:
Font& font() { return *m_font; }
const Font& font() const { return *m_font; }
void update_glyph(byte);
void update_glyph(u8);
Function<void(byte)> on_glyph_selected;
Function<void(u8)> on_glyph_selected;
private:
virtual void paint_event(GPaintEvent&) override;
virtual void mousedown_event(GMouseEvent&) override;
Rect get_outer_rect(byte glyph) const;
Rect get_outer_rect(u8 glyph) const;
RefPtr<Font> m_font;
int m_rows { 8 };
int m_horizontal_spacing { 2 };
int m_vertical_spacing { 2 };
byte m_selected_glyph { 0 };
u8 m_selected_glyph { 0 };
};