| Hisham Muhammad | 2a73405 | 2012-11-10 00:31:37 +0000 | [diff] [blame] | 1 | /* Do not edit this file. It was automatically generated. */ |
| 2 | |
| 3 | #ifndef HEADER_IncSet |
| 4 | #define HEADER_IncSet |
| 5 | /* |
| 6 | htop - IncSet.h |
| 7 | (C) 2005-2012 Hisham H. Muhammad |
| 8 | Released under the GNU GPL, see the COPYING file |
| 9 | in the source distribution for its full text. |
| 10 | */ |
| 11 | |
| 12 | |
| 13 | #include "FunctionBar.h" |
| 14 | #include "Panel.h" |
| 15 | #include <stdbool.h> |
| 16 | |
| 17 | #define INCMODE_MAX 40 |
| 18 | |
| 19 | typedef enum { |
| 20 | INC_SEARCH = 0, |
| 21 | INC_FILTER = 1 |
| 22 | } IncType; |
| 23 | |
| 24 | #define IncSet_filter(inc_) (inc_->filtering ? inc_->modes[INC_FILTER].buffer : NULL) |
| 25 | |
| 26 | typedef struct IncMode_ { |
| Hisham Muhammad | d5b3b6d | 2014-04-24 19:50:03 -0300 | [diff] [blame] | 27 | char buffer[INCMODE_MAX+1]; |
| Hisham Muhammad | 2a73405 | 2012-11-10 00:31:37 +0000 | [diff] [blame] | 28 | int index; |
| 29 | FunctionBar* bar; |
| 30 | bool isFilter; |
| 31 | } IncMode; |
| 32 | |
| 33 | typedef struct IncSet_ { |
| 34 | IncMode modes[2]; |
| 35 | IncMode* active; |
| Hisham Muhammad | 2a73405 | 2012-11-10 00:31:37 +0000 | [diff] [blame] | 36 | FunctionBar* defaultBar; |
| 37 | bool filtering; |
| Hisham | 572546f | 2016-05-05 10:30:06 -0300 | [diff] [blame^] | 38 | bool found; |
| Hisham Muhammad | 2a73405 | 2012-11-10 00:31:37 +0000 | [diff] [blame] | 39 | } IncSet; |
| 40 | |
| 41 | typedef const char* (*IncMode_GetPanelValue)(Panel*, int); |
| 42 | |
| 43 | |
| 44 | IncSet* IncSet_new(FunctionBar* bar); |
| 45 | |
| 46 | void IncSet_delete(IncSet* this); |
| 47 | |
| 48 | bool IncSet_handleKey(IncSet* this, int ch, Panel* panel, IncMode_GetPanelValue getPanelValue, Vector* lines); |
| 49 | |
| 50 | const char* IncSet_getListItemValue(Panel* panel, int i); |
| 51 | |
| Hisham Muhammad | ade7993 | 2015-03-23 17:04:53 -0300 | [diff] [blame] | 52 | void IncSet_activate(IncSet* this, IncType type, Panel* panel); |
| Hisham Muhammad | 2a73405 | 2012-11-10 00:31:37 +0000 | [diff] [blame] | 53 | |
| 54 | void IncSet_drawBar(IncSet* this); |
| 55 | |
| Hisham Muhammad | ade7993 | 2015-03-23 17:04:53 -0300 | [diff] [blame] | 56 | int IncSet_synthesizeEvent(IncSet* this, int x); |
| 57 | |
| Hisham Muhammad | 2a73405 | 2012-11-10 00:31:37 +0000 | [diff] [blame] | 58 | #endif |