2014-11-24 20:55:03 +00:00
|
|
|
#ifndef HEADER_Action
|
|
|
|
#define HEADER_Action
|
|
|
|
/*
|
|
|
|
htop - Action.h
|
2015-03-21 19:52:54 +00:00
|
|
|
(C) 2015 Hisham H. Muhammad
|
2020-10-05 07:51:32 +00:00
|
|
|
Released under the GNU GPLv2, see the COPYING file
|
2014-11-24 20:55:03 +00:00
|
|
|
in the source distribution for its full text.
|
|
|
|
*/
|
|
|
|
|
2020-10-03 19:20:43 +00:00
|
|
|
#include "config.h" // IWYU pragma: keep
|
|
|
|
|
2020-09-19 11:55:23 +00:00
|
|
|
#include <stdbool.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
2015-01-22 01:27:31 +00:00
|
|
|
#include "Header.h"
|
2020-09-19 11:55:23 +00:00
|
|
|
#include "Object.h"
|
2015-01-22 01:27:31 +00:00
|
|
|
#include "Panel.h"
|
2020-09-19 11:55:23 +00:00
|
|
|
#include "Process.h"
|
2020-09-13 02:32:31 +00:00
|
|
|
#include "ProcessList.h"
|
|
|
|
#include "Settings.h"
|
|
|
|
#include "UsersTable.h"
|
2014-11-24 20:55:03 +00:00
|
|
|
|
2021-02-05 13:12:49 +00:00
|
|
|
|
2014-11-24 20:55:03 +00:00
|
|
|
typedef enum {
|
2021-08-21 18:25:17 +00:00
|
|
|
HTOP_OK = 0x00,
|
|
|
|
HTOP_REFRESH = 0x01,
|
|
|
|
HTOP_RECALCULATE = 0x02 | HTOP_REFRESH,
|
|
|
|
HTOP_SAVE_SETTINGS = 0x04,
|
|
|
|
HTOP_KEEP_FOLLOWING = 0x08,
|
|
|
|
HTOP_QUIT = 0x10,
|
|
|
|
HTOP_REDRAW_BAR = 0x20,
|
|
|
|
HTOP_UPDATE_PANELHDR = 0x40 | HTOP_REFRESH,
|
2021-08-21 18:48:45 +00:00
|
|
|
HTOP_RESIZE = 0x80 | HTOP_REFRESH | HTOP_REDRAW_BAR | HTOP_UPDATE_PANELHDR,
|
2014-11-24 20:55:03 +00:00
|
|
|
} Htop_Reaction;
|
|
|
|
|
2021-08-24 15:27:43 +00:00
|
|
|
struct MainPanel_; // IWYU pragma: keep
|
2021-02-05 13:12:49 +00:00
|
|
|
|
2014-11-24 20:55:03 +00:00
|
|
|
typedef struct State_ {
|
|
|
|
Settings* settings;
|
|
|
|
UsersTable* ut;
|
2015-01-22 01:27:31 +00:00
|
|
|
ProcessList* pl;
|
2021-02-05 13:12:49 +00:00
|
|
|
struct MainPanel_* mainPanel;
|
2015-01-22 01:27:31 +00:00
|
|
|
Header* header;
|
2020-10-05 13:14:54 +00:00
|
|
|
bool pauseProcessUpdate;
|
2020-11-23 15:23:18 +00:00
|
|
|
bool hideProcessSelection;
|
2014-11-24 20:55:03 +00:00
|
|
|
} State;
|
|
|
|
|
2020-12-28 22:26:14 +00:00
|
|
|
static inline bool State_hideFunctionBar(const State* st) {
|
|
|
|
return st->settings->hideFunctionBar == 2 || (st->settings->hideFunctionBar == 1 && st->hideProcessSelection);
|
|
|
|
}
|
|
|
|
|
2020-09-08 12:28:34 +00:00
|
|
|
typedef Htop_Reaction (*Htop_Action)(State* st);
|
|
|
|
|
2020-09-02 07:38:44 +00:00
|
|
|
Object* Action_pickFromVector(State* st, Panel* list, int x, bool followProcess);
|
2015-01-22 01:27:31 +00:00
|
|
|
|
2020-09-02 07:38:44 +00:00
|
|
|
bool Action_setUserOnly(const char* userName, uid_t* userId);
|
2015-01-22 01:27:31 +00:00
|
|
|
|
2020-09-02 07:38:44 +00:00
|
|
|
Htop_Reaction Action_setSortKey(Settings* settings, ProcessField sortKey);
|
2015-03-25 02:12:43 +00:00
|
|
|
|
2020-09-02 07:38:44 +00:00
|
|
|
Htop_Reaction Action_follow(State* st);
|
2016-05-05 13:30:06 +00:00
|
|
|
|
2020-09-02 07:38:44 +00:00
|
|
|
void Action_setBindings(Htop_Action* keys);
|
2015-01-22 01:27:31 +00:00
|
|
|
|
2014-11-24 20:55:03 +00:00
|
|
|
#endif
|