2006-03-04 18:16:49 +00:00
|
|
|
#ifndef HEADER_Header
|
|
|
|
#define HEADER_Header
|
|
|
|
/*
|
2006-06-06 20:28:42 +00:00
|
|
|
htop - Header.h
|
2011-05-26 16:35:07 +00:00
|
|
|
(C) 2004-2011 Hisham H. Muhammad
|
2020-10-05 07:51:32 +00:00
|
|
|
Released under the GNU GPLv2, see the COPYING file
|
2006-03-04 18:16:49 +00:00
|
|
|
in the source distribution for its full text.
|
|
|
|
*/
|
|
|
|
|
2006-04-10 20:40:38 +00:00
|
|
|
#include "Meter.h"
|
2015-01-23 05:08:21 +00:00
|
|
|
#include "Settings.h"
|
2015-01-22 01:27:31 +00:00
|
|
|
#include "Vector.h"
|
2006-03-04 18:16:49 +00:00
|
|
|
|
|
|
|
typedef struct Header_ {
|
2015-01-22 01:27:31 +00:00
|
|
|
Vector** columns;
|
2015-01-23 05:08:21 +00:00
|
|
|
Settings* settings;
|
2015-01-22 01:27:31 +00:00
|
|
|
struct ProcessList_* pl;
|
|
|
|
int nrColumns;
|
2015-01-23 05:08:21 +00:00
|
|
|
int pad;
|
|
|
|
int height;
|
2006-03-04 18:16:49 +00:00
|
|
|
} Header;
|
|
|
|
|
2016-05-07 06:57:51 +00:00
|
|
|
#define Header_forEachColumn(this_, i_) for (int (i_)=0; (i_) < (this_)->nrColumns; ++(i_))
|
2015-01-22 01:27:31 +00:00
|
|
|
|
2020-09-02 07:38:44 +00:00
|
|
|
Header* Header_new(struct ProcessList_* pl, Settings* settings, int nrColumns);
|
2006-03-04 18:16:49 +00:00
|
|
|
|
2020-09-02 07:38:44 +00:00
|
|
|
void Header_delete(Header* this);
|
2006-03-04 18:16:49 +00:00
|
|
|
|
2020-09-02 07:38:44 +00:00
|
|
|
void Header_populateFromSettings(Header* this);
|
2015-01-23 05:08:21 +00:00
|
|
|
|
2020-09-02 07:38:44 +00:00
|
|
|
void Header_writeBackToSettings(const Header* this);
|
2015-03-17 02:01:21 +00:00
|
|
|
|
2020-09-02 07:38:44 +00:00
|
|
|
MeterModeId Header_addMeterByName(Header* this, char* name, int column);
|
2006-03-04 18:16:49 +00:00
|
|
|
|
2020-09-02 07:38:44 +00:00
|
|
|
void Header_setMode(Header* this, int i, MeterModeId mode, int column);
|
2006-03-04 18:16:49 +00:00
|
|
|
|
2020-10-05 11:19:50 +00:00
|
|
|
Meter* Header_addMeterByClass(Header* this, const MeterClass* type, int param, int column);
|
2006-03-04 18:16:49 +00:00
|
|
|
|
2020-09-02 07:38:44 +00:00
|
|
|
int Header_size(Header* this, int column);
|
2006-03-04 18:16:49 +00:00
|
|
|
|
2020-09-02 07:38:44 +00:00
|
|
|
char* Header_readMeterName(Header* this, int i, int column);
|
2006-03-04 18:16:49 +00:00
|
|
|
|
2020-09-02 07:38:44 +00:00
|
|
|
MeterModeId Header_readMeterMode(Header* this, int i, int column);
|
2006-03-04 18:16:49 +00:00
|
|
|
|
2020-09-02 07:38:44 +00:00
|
|
|
void Header_reinit(Header* this);
|
2011-03-22 20:37:08 +00:00
|
|
|
|
2020-09-02 07:38:44 +00:00
|
|
|
void Header_draw(const Header* this);
|
2006-03-04 18:16:49 +00:00
|
|
|
|
2020-09-02 07:38:44 +00:00
|
|
|
int Header_calculateHeight(Header* this);
|
2006-03-04 18:16:49 +00:00
|
|
|
|
|
|
|
#endif
|