1 #ifndef R_PANELS_H 2 #define R_PANELS_H 3 4 #ifdef __cplusplus 5 extern "C" { 6 #endif 7 8 typedef enum { 9 PANEL_LAYOUT_VERTICAL, 10 PANEL_LAYOUT_HORIZONTAL, 11 PANEL_LAYOUT_NONE 12 } RPanelLayout; 13 14 typedef enum { 15 PANEL_TYPE_DEFAULT = 0, 16 PANEL_TYPE_MENU = 1 17 } RPanelType; 18 19 typedef enum { 20 PANEL_EDGE_NONE = 0, 21 PANEL_EDGE_BOTTOM, 22 PANEL_EDGE_RIGHT 23 } RPanelEdge; 24 25 typedef void (*RPanelMenuUpdateCallback)(void *user, const char *parent); 26 typedef void (*RPanelDirectionCallback)(void *user, int direction); 27 typedef void (*RPanelRotateCallback)(void *user, bool rev); 28 typedef void (*RPanelPrintCallback)(void *user, void *p); 29 30 typedef struct r_panel_pos_t { 31 int x; 32 int y; 33 int w; 34 int h; 35 } RPanelPos; 36 37 typedef struct r_panel_model_t { 38 RPanelDirectionCallback directionCb; 39 RPanelRotateCallback rotateCb; 40 RPanelPrintCallback print_cb; 41 RPanelType type; 42 char *cmd; 43 char *title; 44 ut64 baseAddr; 45 ut64 addr; 46 bool cache; 47 char *cmdStrCache; 48 char *readOnly; 49 char *funcName; 50 char **filter; 51 int n_filter; 52 int rotate; 53 } RPanelModel; 54 55 typedef struct r_panel_view_t { 56 RPanelPos pos; 57 RPanelPos prevPos; 58 int sx; 59 int sy; 60 int curpos; 61 bool refresh; 62 int edge; 63 } RPanelView; 64 65 typedef struct r_panel_t { 66 RPanelModel *model; 67 RPanelView *view; 68 } RPanel; 69 70 typedef void (*RPanelAlmightyCallback)(void *user, RPanel *panel, const RPanelLayout dir, R_NULLABLE const char *title); 71 72 #ifdef __cplusplus 73 } 74 #endif 75 76 #endif // R_PANELS_H 77