mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:17:36 +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:
parent
b7e3810b5c
commit
2d39da5405
265 changed files with 1380 additions and 1167 deletions
|
@ -67,7 +67,7 @@ const EditorWrapper& Editor::wrapper() const
|
|||
return static_cast<const EditorWrapper&>(*parent());
|
||||
}
|
||||
|
||||
void Editor::focusin_event(CEvent& event)
|
||||
void Editor::focusin_event(Core::Event& event)
|
||||
{
|
||||
wrapper().set_editor_has_focus({}, true);
|
||||
if (on_focus)
|
||||
|
@ -75,7 +75,7 @@ void Editor::focusin_event(CEvent& event)
|
|||
GTextEditor::focusin_event(event);
|
||||
}
|
||||
|
||||
void Editor::focusout_event(CEvent& event)
|
||||
void Editor::focusout_event(Core::Event& event)
|
||||
{
|
||||
wrapper().set_editor_has_focus({}, false);
|
||||
GTextEditor::focusout_event(event);
|
||||
|
@ -103,7 +103,7 @@ static HashMap<String, String>& man_paths()
|
|||
static HashMap<String, String> paths;
|
||||
if (paths.is_empty()) {
|
||||
// FIXME: This should also search man3, possibly other places..
|
||||
CDirIterator it("/usr/share/man/man2", CDirIterator::Flags::SkipDots);
|
||||
Core::DirIterator it("/usr/share/man/man2", Core::DirIterator::Flags::SkipDots);
|
||||
while (it.has_next()) {
|
||||
auto path = String::format("/usr/share/man/man2/%s", it.next_path().characters());
|
||||
auto title = FileSystemPath(path).title();
|
||||
|
@ -132,8 +132,8 @@ void Editor::show_documentation_tooltip_if_available(const String& hovered_token
|
|||
#ifdef EDITOR_DEBUG
|
||||
dbg() << "opening " << it->value;
|
||||
#endif
|
||||
auto file = CFile::construct(it->value);
|
||||
if (!file->open(CFile::ReadOnly)) {
|
||||
auto file = Core::File::construct(it->value);
|
||||
if (!file->open(Core::File::ReadOnly)) {
|
||||
dbg() << "failed to open " << it->value << " " << file->error_string();
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -44,8 +44,8 @@ public:
|
|||
void notify_did_rehighlight();
|
||||
|
||||
private:
|
||||
virtual void focusin_event(CEvent&) override;
|
||||
virtual void focusout_event(CEvent&) override;
|
||||
virtual void focusin_event(Core::Event&) override;
|
||||
virtual void focusout_event(Core::Event&) override;
|
||||
virtual void paint_event(GPaintEvent&) override;
|
||||
virtual void mousemove_event(GMouseEvent&) override;
|
||||
virtual void cursor_did_change() override;
|
||||
|
|
|
@ -52,7 +52,7 @@ private:
|
|||
};
|
||||
|
||||
template<>
|
||||
inline bool is<EditorWrapper>(const CObject& object)
|
||||
inline bool Core::is<EditorWrapper>(const Core::Object& object)
|
||||
{
|
||||
return !strcmp(object.class_name(), "EditorWrapper");
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ ProcessStateWidget::ProcessStateWidget(GWidget* parent)
|
|||
memory_label_label->set_font(Font::default_bold_font());
|
||||
m_memory_label = GLabel::construct("", this);
|
||||
|
||||
m_timer = CTimer::construct(500, [this] {
|
||||
m_timer = Core::Timer::construct(500, [this] {
|
||||
refresh();
|
||||
});
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ void ProcessStateWidget::refresh()
|
|||
{
|
||||
pid_t pid = tcgetpgrp(m_tty_fd);
|
||||
|
||||
auto processes = CProcessStatisticsReader::get_all();
|
||||
auto processes = Core::ProcessStatisticsReader::get_all();
|
||||
auto child_process_data = processes.get(pid);
|
||||
|
||||
if (!child_process_data.has_value())
|
||||
|
|
|
@ -28,7 +28,10 @@
|
|||
|
||||
#include <LibGUI/GWidget.h>
|
||||
|
||||
class CTimer;
|
||||
namespace Core {
|
||||
class Timer;
|
||||
}
|
||||
|
||||
class GLabel;
|
||||
|
||||
class ProcessStateWidget final : public GWidget {
|
||||
|
@ -48,7 +51,7 @@ private:
|
|||
RefPtr<GLabel> m_cpu_label;
|
||||
RefPtr<GLabel> m_memory_label;
|
||||
|
||||
RefPtr<CTimer> m_timer;
|
||||
RefPtr<Core::Timer> m_timer;
|
||||
|
||||
int m_tty_fd { -1 };
|
||||
};
|
||||
|
|
|
@ -190,8 +190,8 @@ Project::~Project()
|
|||
|
||||
OwnPtr<Project> Project::load_from_file(const String& path)
|
||||
{
|
||||
auto file = CFile::construct(path);
|
||||
if (!file->open(CFile::ReadOnly))
|
||||
auto file = Core::File::construct(path);
|
||||
if (!file->open(Core::File::ReadOnly))
|
||||
return nullptr;
|
||||
|
||||
Vector<String> files;
|
||||
|
@ -225,12 +225,12 @@ bool Project::remove_file(const String& filename)
|
|||
|
||||
bool Project::save()
|
||||
{
|
||||
auto project_file = CFile::construct(m_path);
|
||||
if (!project_file->open(CFile::WriteOnly))
|
||||
auto project_file = Core::File::construct(m_path);
|
||||
if (!project_file->open(Core::File::WriteOnly))
|
||||
return false;
|
||||
|
||||
for (auto& file : m_files) {
|
||||
// FIXME: Check for error here. CIODevice::printf() needs some work on error reporting.
|
||||
// FIXME: Check for error here. IODevice::printf() needs some work on error reporting.
|
||||
project_file->printf("%s\n", file.name().characters());
|
||||
}
|
||||
|
||||
|
|
|
@ -32,8 +32,8 @@ const GTextDocument& ProjectFile::document() const
|
|||
{
|
||||
if (!m_document) {
|
||||
m_document = GTextDocument::create(nullptr);
|
||||
auto file = CFile::construct(m_name);
|
||||
if (!file->open(CFile::ReadOnly)) {
|
||||
auto file = Core::File::construct(m_name);
|
||||
if (!file->open(Core::File::ReadOnly)) {
|
||||
ASSERT_NOT_REACHED();
|
||||
}
|
||||
m_document->set_text(file->read_all());
|
||||
|
|
|
@ -163,7 +163,7 @@ TerminalWrapper::TerminalWrapper(GWidget* parent)
|
|||
{
|
||||
set_layout(make<GVBoxLayout>());
|
||||
|
||||
RefPtr<CConfigFile> config = CConfigFile::get_for_app("Terminal");
|
||||
RefPtr<Core::ConfigFile> config = Core::ConfigFile::get_for_app("Terminal");
|
||||
m_terminal_widget = TerminalWidget::construct(-1, false, config);
|
||||
add_child(*m_terminal_widget);
|
||||
|
||||
|
|
|
@ -180,8 +180,8 @@ int main(int argc, char** argv)
|
|||
if (input_box->exec() == GInputBox::ExecCancel)
|
||||
return;
|
||||
auto filename = input_box->text_value();
|
||||
auto file = CFile::construct(filename);
|
||||
if (!file->open((CIODevice::OpenMode)(CIODevice::WriteOnly | CIODevice::MustBeNew))) {
|
||||
auto file = Core::File::construct(filename);
|
||||
if (!file->open((Core::IODevice::OpenMode)(Core::IODevice::WriteOnly | Core::IODevice::MustBeNew))) {
|
||||
GMessageBox::show(String::format("Failed to create '%s'", filename.characters()), "Error", GMessageBox::Type::Error, GMessageBox::InputType::OK, g_window);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue