mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 21:47:46 +00:00
LibGUI: Put all classes in the GUI namespace and remove the leading G
This took me a moment. Welcome to the new world of GUI::Widget! :^)
This commit is contained in:
parent
2d39da5405
commit
c5bd9d4ed1
337 changed files with 5400 additions and 4816 deletions
|
@ -44,7 +44,7 @@ RemoteObjectGraphModel::~RemoteObjectGraphModel()
|
|||
{
|
||||
}
|
||||
|
||||
GModelIndex RemoteObjectGraphModel::index(int row, int column, const GModelIndex& parent) const
|
||||
GUI::ModelIndex RemoteObjectGraphModel::index(int row, int column, const GUI::ModelIndex& parent) const
|
||||
{
|
||||
if (!parent.is_valid()) {
|
||||
if (m_process.roots().is_empty())
|
||||
|
@ -55,7 +55,7 @@ GModelIndex RemoteObjectGraphModel::index(int row, int column, const GModelIndex
|
|||
return create_index(row, column, &remote_parent.children.at(row));
|
||||
}
|
||||
|
||||
GModelIndex RemoteObjectGraphModel::parent_index(const GModelIndex& index) const
|
||||
GUI::ModelIndex RemoteObjectGraphModel::parent_index(const GUI::ModelIndex& index) const
|
||||
{
|
||||
if (!index.is_valid())
|
||||
return {};
|
||||
|
@ -82,7 +82,7 @@ GModelIndex RemoteObjectGraphModel::parent_index(const GModelIndex& index) const
|
|||
return {};
|
||||
}
|
||||
|
||||
int RemoteObjectGraphModel::row_count(const GModelIndex& index) const
|
||||
int RemoteObjectGraphModel::row_count(const GUI::ModelIndex& index) const
|
||||
{
|
||||
if (!index.is_valid())
|
||||
return m_process.roots().size();
|
||||
|
@ -90,12 +90,12 @@ int RemoteObjectGraphModel::row_count(const GModelIndex& index) const
|
|||
return remote_object.children.size();
|
||||
}
|
||||
|
||||
int RemoteObjectGraphModel::column_count(const GModelIndex&) const
|
||||
int RemoteObjectGraphModel::column_count(const GUI::ModelIndex&) const
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
GVariant RemoteObjectGraphModel::data(const GModelIndex& index, Role role) const
|
||||
GUI::Variant RemoteObjectGraphModel::data(const GUI::ModelIndex& index, Role role) const
|
||||
{
|
||||
auto* remote_object = static_cast<RemoteObject*>(index.internal_data());
|
||||
if (role == Role::Icon) {
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
|
||||
class RemoteProcess;
|
||||
|
||||
class RemoteObjectGraphModel final : public GModel {
|
||||
class RemoteObjectGraphModel final : public GUI::Model {
|
||||
public:
|
||||
static NonnullRefPtr<RemoteObjectGraphModel> create(RemoteProcess& process)
|
||||
{
|
||||
|
@ -43,11 +43,11 @@ public:
|
|||
|
||||
virtual ~RemoteObjectGraphModel() override;
|
||||
|
||||
virtual int row_count(const GModelIndex& = GModelIndex()) const override;
|
||||
virtual int column_count(const GModelIndex& = GModelIndex()) const override;
|
||||
virtual GVariant data(const GModelIndex&, Role = Role::Display) const override;
|
||||
virtual GModelIndex index(int row, int column, const GModelIndex& parent = GModelIndex()) const override;
|
||||
virtual GModelIndex parent_index(const GModelIndex&) const override;
|
||||
virtual int row_count(const GUI::ModelIndex& = GUI::ModelIndex()) const override;
|
||||
virtual int column_count(const GUI::ModelIndex& = GUI::ModelIndex()) const override;
|
||||
virtual GUI::Variant data(const GUI::ModelIndex&, Role = Role::Display) const override;
|
||||
virtual GUI::ModelIndex index(int row, int column, const GUI::ModelIndex& parent = GUI::ModelIndex()) const override;
|
||||
virtual GUI::ModelIndex parent_index(const GUI::ModelIndex&) const override;
|
||||
virtual void update() override;
|
||||
|
||||
private:
|
||||
|
|
|
@ -32,7 +32,7 @@ RemoteObjectPropertyModel::RemoteObjectPropertyModel(RemoteObject& object)
|
|||
{
|
||||
}
|
||||
|
||||
int RemoteObjectPropertyModel::row_count(const GModelIndex&) const
|
||||
int RemoteObjectPropertyModel::row_count(const GUI::ModelIndex&) const
|
||||
{
|
||||
return m_properties.size();
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ String RemoteObjectPropertyModel::column_name(int column) const
|
|||
ASSERT_NOT_REACHED();
|
||||
}
|
||||
|
||||
GVariant RemoteObjectPropertyModel::data(const GModelIndex& index, Role role) const
|
||||
GUI::Variant RemoteObjectPropertyModel::data(const GUI::ModelIndex& index, Role role) const
|
||||
{
|
||||
auto& property = m_properties[index.row()];
|
||||
if (role == Role::Display) {
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
|
||||
class RemoteObject;
|
||||
|
||||
class RemoteObjectPropertyModel final : public GModel {
|
||||
class RemoteObjectPropertyModel final : public GUI::Model {
|
||||
public:
|
||||
virtual ~RemoteObjectPropertyModel() override {}
|
||||
static NonnullRefPtr<RemoteObjectPropertyModel> create(RemoteObject& object)
|
||||
|
@ -45,10 +45,10 @@ public:
|
|||
__Count,
|
||||
};
|
||||
|
||||
virtual int row_count(const GModelIndex& = GModelIndex()) const override;
|
||||
virtual int column_count(const GModelIndex& = GModelIndex()) const override { return Column::__Count; }
|
||||
virtual int row_count(const GUI::ModelIndex& = GUI::ModelIndex()) const override;
|
||||
virtual int column_count(const GUI::ModelIndex& = GUI::ModelIndex()) const override { return Column::__Count; }
|
||||
virtual String column_name(int) const override;
|
||||
virtual GVariant data(const GModelIndex&, Role = Role::Display) const override;
|
||||
virtual GUI::Variant data(const GUI::ModelIndex&, Role = Role::Display) const override;
|
||||
virtual void update() override;
|
||||
|
||||
private:
|
||||
|
|
|
@ -52,18 +52,18 @@ int main(int argc, char** argv)
|
|||
if (!ok)
|
||||
print_usage_and_exit();
|
||||
|
||||
GApplication app(argc, argv);
|
||||
GUI::Application app(argc, argv);
|
||||
|
||||
auto window = GWindow::construct();
|
||||
auto window = GUI::Window::construct();
|
||||
window->set_title("Inspector");
|
||||
window->set_rect(150, 150, 300, 500);
|
||||
|
||||
auto widget = GWidget::construct();
|
||||
auto widget = GUI::Widget::construct();
|
||||
window->set_main_widget(widget);
|
||||
widget->set_fill_with_background_color(true);
|
||||
widget->set_layout(make<GVBoxLayout>());
|
||||
widget->set_layout(make<GUI::VBoxLayout>());
|
||||
|
||||
auto splitter = GSplitter::construct(Orientation::Horizontal, widget);
|
||||
auto splitter = GUI::Splitter::construct(Orientation::Horizontal, widget);
|
||||
|
||||
RemoteProcess remote_process(pid);
|
||||
|
||||
|
@ -72,11 +72,11 @@ int main(int argc, char** argv)
|
|||
window->set_title(String::format("Inspector: %s (%d)", remote_process.process_name().characters(), remote_process.pid()));
|
||||
};
|
||||
|
||||
auto tree_view = GTreeView::construct(splitter);
|
||||
auto tree_view = GUI::TreeView::construct(splitter);
|
||||
tree_view->set_model(remote_process.object_graph_model());
|
||||
tree_view->set_activates_on_selection(true);
|
||||
|
||||
auto properties_table_view = GTableView::construct(splitter);
|
||||
auto properties_table_view = GUI::TableView::construct(splitter);
|
||||
properties_table_view->set_size_columns_to_fit_content(true);
|
||||
|
||||
tree_view->on_activation = [&](auto& index) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue