ladybird/Userland/Applications/SystemMonitor/MemoryStatsWidget.h
kleines Filmröllchen a7d9d416d5 SystemMonitor: Register a graph_widget pseudo-property in MemoryStatsW
The property graph_widget on MemoryStatsWidget is a-pseudo property that
specifies the name of the graph widget which should be attached to the
MemoryStatsWidget. When the property is set, the widget looks up the
graph with that name in its parent, therefore automatically linking to
the correct widget given that it's a sibling or descendant of a sibling.
2022-04-03 12:21:05 +02:00

46 lines
1.1 KiB
C++

/*
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
* Copyright (c) 2022, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibGUI/Widget.h>
namespace SystemMonitor {
class GraphWidget;
class MemoryStatsWidget final : public GUI::Widget {
C_OBJECT(MemoryStatsWidget)
public:
static MemoryStatsWidget* the();
virtual ~MemoryStatsWidget() override = default;
void set_graph_widget(GraphWidget& graph);
void set_graph_widget_via_name(String name);
String graph_widget_name();
void refresh();
private:
MemoryStatsWidget(GraphWidget* graph);
MemoryStatsWidget();
GraphWidget* m_graph;
// Is null if we have a valid graph
String m_graph_widget_name {};
RefPtr<GUI::Label> m_user_physical_pages_label;
RefPtr<GUI::Label> m_user_physical_pages_committed_label;
RefPtr<GUI::Label> m_supervisor_physical_pages_label;
RefPtr<GUI::Label> m_kmalloc_space_label;
RefPtr<GUI::Label> m_kmalloc_count_label;
RefPtr<GUI::Label> m_kfree_count_label;
RefPtr<GUI::Label> m_kmalloc_difference_label;
};
}