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

LibCore: Put all classes in the Core namespace and remove the leading C

I've been wanting to do this for a long time. It's time we start being
consistent about how this stuff works.

The new convention is:

- "LibFoo" is a userspace library that provides the "Foo" namespace.

That's it :^) This was pretty tedious to convert and I didn't even
start on LibGUI yet. But it's coming up next.
This commit is contained in:
Andreas Kling 2020-02-02 12:34:39 +01:00
parent b7e3810b5c
commit 2d39da5405
265 changed files with 1380 additions and 1167 deletions

View file

@ -127,7 +127,7 @@ Field::Field(GLabel& flag_label, GLabel& time_label, GButton& face_button, GWidg
, m_on_size_changed(move(on_size_changed))
{
srand(time(nullptr));
m_timer = CTimer::construct();
m_timer = Core::Timer::construct();
m_timer->on_timeout = [this] {
++m_time_elapsed;
m_time_label.set_text(String::format("%u.%u", m_time_elapsed / 10, m_time_elapsed % 10));
@ -153,7 +153,7 @@ Field::Field(GLabel& flag_label, GLabel& time_label, GButton& face_button, GWidg
set_face(Face::Default);
{
auto config = CConfigFile::get_for_app("Minesweeper");
auto config = Core::ConfigFile::get_for_app("Minesweeper");
bool single_chording = config->read_num_entry("Minesweeper", "SingleChording", false);
int mine_count = config->read_num_entry("Game", "MineCount", 10);
int rows = config->read_num_entry("Game", "Rows", 9);
@ -497,7 +497,7 @@ void Field::set_field_size(int rows, int columns, int mine_count)
if (m_rows == rows && m_columns == columns && m_mine_count == mine_count)
return;
{
auto config = CConfigFile::get_for_app("Minesweeper");
auto config = Core::ConfigFile::get_for_app("Minesweeper");
config->write_num_entry("Game", "MineCount", mine_count);
config->write_num_entry("Game", "Rows", rows);
config->write_num_entry("Game", "Columns", columns);
@ -511,7 +511,7 @@ void Field::set_field_size(int rows, int columns, int mine_count)
}
void Field::set_single_chording(bool enabled) {
auto config = CConfigFile::get_for_app("Minesweeper");
auto config = Core::ConfigFile::get_for_app("Minesweeper");
m_single_chording = enabled;
config->write_bool_entry("Minesweeper", "SingleChording", m_single_chording);
}

View file

@ -121,7 +121,7 @@ private:
GButton& m_face_button;
GLabel& m_flag_label;
GLabel& m_time_label;
RefPtr<CTimer> m_timer;
RefPtr<Core::Timer> m_timer;
int m_time_elapsed { 0 };
int m_flags_left { 0 };
Face m_face { Face::Default };

View file

@ -102,7 +102,7 @@ Rect SnakeGame::high_score_rect() const
return { 2, height() - font().glyph_height() - 2, high_score_width, font().glyph_height() };
}
void SnakeGame::timer_event(CTimerEvent&)
void SnakeGame::timer_event(Core::TimerEvent&)
{
Vector<Coordinate> dirty_cells;

View file

@ -41,7 +41,7 @@ private:
explicit SnakeGame(GWidget* parent = nullptr);
virtual void paint_event(GPaintEvent&) override;
virtual void keydown_event(GKeyEvent&) override;
virtual void timer_event(CTimerEvent&) override;
virtual void timer_event(Core::TimerEvent&) override;
struct Coordinate {
int row { 0 };