serenity/DevTools/Inspector/RemoteObjectGraphModel.h
Andreas Kling 4f3234148a Inspector: Show remote object properties in a table view
This patch expands the object model of this program quite a bit.
We now have a RemoteProcess object that contains a list of remote root
RemoteObject objects.

The RemoteProcess vends a RemoteObjectGraphModel&, and indices in that
model have internal_data() pointing to a corresponding RemoteObject.
RemoteObjects in turn vend a RemoteObjectPropertyModel&, which is what
we use to show the object properties.

This is pretty cool :^)
2019-08-19 20:29:52 +02:00

35 lines
1 KiB
C++

#pragma once
#include <AK/JsonArray.h>
#include <AK/JsonObject.h>
#include <AK/NonnullOwnPtrVector.h>
#include <LibCore/CLocalSocket.h>
#include <LibGUI/GModel.h>
class RemoteProcess;
class RemoteObjectGraphModel final : public GModel {
public:
static NonnullRefPtr<RemoteObjectGraphModel> create(RemoteProcess& process)
{
return adopt(*new RemoteObjectGraphModel(process));
}
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 void update() override;
private:
explicit RemoteObjectGraphModel(RemoteProcess&);
RemoteProcess& m_process;
GIcon m_object_icon;
GIcon m_window_icon;
};