mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-05 10:42:51 +00:00
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.
46 lines
1.1 KiB
C++
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;
|
|
};
|
|
|
|
}
|