IncSet.h 1.2 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/* Do not edit this file. It was automatically generated. */

#ifndef HEADER_IncSet
#define HEADER_IncSet
/*
htop - IncSet.h
(C) 2005-2012 Hisham H. Muhammad
Released under the GNU GPL, see the COPYING file
in the source distribution for its full text.
*/


#include "FunctionBar.h"
#include "Panel.h"
#include <stdbool.h>

#define INCMODE_MAX 40

typedef enum {
   INC_SEARCH = 0,
   INC_FILTER = 1
} IncType;

#define IncSet_filter(inc_) (inc_->filtering ? inc_->modes[INC_FILTER].buffer : NULL)

typedef struct IncMode_ {
Hisham Muhammad's avatar
Hisham Muhammad committed
27
   char buffer[INCMODE_MAX+1];
28
29
30
31
32
33
34
35
36
37
   int index;
   FunctionBar* bar;
   bool isFilter;
} IncMode;

typedef struct IncSet_ {
   IncMode modes[2];
   IncMode* active;
   FunctionBar* defaultBar;
   bool filtering;
Hisham's avatar
Hisham committed
38
   bool found;
39
40
41
42
43
44
45
46
47
48
49
50
51
} IncSet;

typedef const char* (*IncMode_GetPanelValue)(Panel*, int);


IncSet* IncSet_new(FunctionBar* bar);

void IncSet_delete(IncSet* this);

bool IncSet_handleKey(IncSet* this, int ch, Panel* panel, IncMode_GetPanelValue getPanelValue, Vector* lines);

const char* IncSet_getListItemValue(Panel* panel, int i);

52
void IncSet_activate(IncSet* this, IncType type, Panel* panel);
53
54
55

void IncSet_drawBar(IncSet* this);

56
57
int IncSet_synthesizeEvent(IncSet* this, int x);

58
#endif