#pragma once #include #include #include #include #include class ProcessTableModel final : public GTableModel { public: ProcessTableModel(); virtual ~ProcessTableModel() override; virtual int row_count() const override; virtual int column_count() const override; virtual String column_name(int column) const override; virtual ColumnMetadata column_metadata(int column) const override; virtual GVariant data(const GModelIndex&) const override; virtual void update() override; pid_t selected_pid() const; private: struct ProcessState { pid_t pid; unsigned nsched; String name; String state; String user; String priority; size_t linear; size_t physical; float cpu_percent; }; struct Process { ProcessState current_state; ProcessState previous_state; }; HashMap m_usernames; HashMap> m_processes; Vector m_pids; RetainPtr m_generic_process_icon; RetainPtr m_high_priority_icon; RetainPtr m_low_priority_icon; RetainPtr m_normal_priority_icon; };