2020-01-18 05:38:21 -03:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
2022-02-15 17:28:01 -03:00
|
|
|
* Copyright (c) 2022, the SerenityOS developers.
|
2020-01-18 05:38:21 -03:00
|
|
|
*
|
2021-04-22 05:24:48 -03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-01-18 05:38:21 -03:00
|
|
|
*/
|
|
|
|
|
|
2019-08-18 05:19:13 -03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <AK/JsonArray.h>
|
2019-08-19 15:29:52 -03:00
|
|
|
#include <AK/JsonObject.h>
|
2019-08-18 05:19:13 -03:00
|
|
|
#include <AK/NonnullOwnPtrVector.h>
|
2020-02-06 16:33:02 -03:00
|
|
|
#include <LibGUI/Model.h>
|
2019-08-18 05:19:13 -03:00
|
|
|
|
2020-09-25 16:03:29 -03:00
|
|
|
namespace Inspector {
|
|
|
|
|
|
2019-08-19 15:29:52 -03:00
|
|
|
class RemoteProcess;
|
|
|
|
|
|
2020-02-02 11:07:41 -03:00
|
|
|
class RemoteObjectGraphModel final : public GUI::Model {
|
2019-08-18 05:19:13 -03:00
|
|
|
public:
|
2019-08-19 15:29:52 -03:00
|
|
|
static NonnullRefPtr<RemoteObjectGraphModel> create(RemoteProcess& process)
|
2019-08-18 05:19:13 -03:00
|
|
|
{
|
2021-04-23 11:46:57 -03:00
|
|
|
return adopt_ref(*new RemoteObjectGraphModel(process));
|
2019-08-18 05:19:13 -03:00
|
|
|
}
|
|
|
|
|
|
2022-02-15 17:28:01 -03:00
|
|
|
virtual ~RemoteObjectGraphModel() override = default;
|
2019-08-18 05:19:13 -03:00
|
|
|
|
2020-02-02 11:07:41 -03:00
|
|
|
virtual int row_count(const GUI::ModelIndex& = GUI::ModelIndex()) const override;
|
|
|
|
|
virtual int column_count(const GUI::ModelIndex& = GUI::ModelIndex()) const override;
|
2020-08-16 11:00:07 -03:00
|
|
|
virtual GUI::Variant data(const GUI::ModelIndex&, GUI::ModelRole) const override;
|
2020-02-02 11:07:41 -03:00
|
|
|
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;
|
2019-08-18 05:19:13 -03:00
|
|
|
|
|
|
|
|
private:
|
2019-08-19 15:29:52 -03:00
|
|
|
explicit RemoteObjectGraphModel(RemoteProcess&);
|
|
|
|
|
|
|
|
|
|
RemoteProcess& m_process;
|
|
|
|
|
|
2020-03-06 20:02:21 -03:00
|
|
|
GUI::Icon m_object_icon;
|
|
|
|
|
GUI::Icon m_window_icon;
|
|
|
|
|
GUI::Icon m_layout_icon;
|
|
|
|
|
GUI::Icon m_timer_icon;
|
2019-08-18 05:19:13 -03:00
|
|
|
};
|
2020-09-25 16:03:29 -03:00
|
|
|
|
|
|
|
|
}
|