diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2014-11-19 23:17:52 -0200 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2014-11-19 23:17:52 -0200 |
commit | 9faf4938b8195a0fb5d62cf1702f9f5c07523031 (patch) | |
tree | 84732ab7ef1bf66d55feefaf97216ccfc9bf2fad /htop.h | |
parent | 300af4b829c6552d7efdfcde43220cf318b5a265 (diff) |
Refactored key handlers.
Made the logic more modular, hopefully easier to follow,
and removed repeated code.
Plus, some optimization in RichString code.
Diffstat (limited to 'htop.h')
-rw-r--r-- | htop.h | 29 |
1 files changed, 27 insertions, 2 deletions
@@ -11,11 +11,36 @@ in the source distribution for its full text. //#link m -#define COPYRIGHT "(C) 2004-2012 Hisham Muhammad" +#define COPYRIGHT "(C) 2004-2014 Hisham Muhammad" + + +typedef enum { + HTOP_OK = 0x00, + HTOP_REFRESH = 0x01, + HTOP_RECALCULATE = 0x03, // implies HTOP_REFRESH + HTOP_SAVE_SETTINGS = 0x04, + HTOP_KEEP_FOLLOWING = 0x08, + HTOP_QUIT = 0x10, + HTOP_REDRAW_BAR = 0x20, + HTOP_UPDATE_PANELHDR = 0x41, // implies HTOP_REFRESH +} Htop_Reaction; + +typedef Htop_Reaction (*Htop_Action)(); + +typedef struct State_ { + IncSet* inc; + Settings* settings; + UsersTable* ut; +} State; typedef bool(*ForeachProcessFn)(Process*, size_t); -void sortBy(Panel* panel, ProcessList* pl, Settings* settings, int headerHeight, FunctionBar* defaultBar, Header* header); + +// ---------------------------------------- + +void setBindings(Htop_Action* keys); + +// ---------------------------------------- int main(int argc, char** argv); |