Refactoring Panels: Use Sdb, cleanup callbacks and submenus (#11519)

This commit is contained in:
Vanellope 2018-09-14 18:50:50 +09:00 committed by radare
parent bd5de316be
commit c36181df55
2 changed files with 688 additions and 498 deletions

File diff suppressed because it is too large Load Diff

View File

@ -999,6 +999,23 @@ R_API void r_agraph_foreach_edge(RAGraph *g, RAEdgeCallback cb, void *user);
R_API void r_agraph_set_curnode(RAGraph *g, RANode *node);
#endif
typedef int (*RPanelsMenuCallback)(void *user);
typedef struct r_panels_menu_item {
int n_sub, selectedIndex, selfIndex;
const char *name;
struct r_panels_menu_item **sub;
RPanelsMenuCallback cb;
RPanel *p;
} RPanelsMenuItem;
typedef struct r_panels_menu_t {
RPanelsMenuItem *root;
RPanelsMenuItem **history;
int depth;
int n_refresh;
RPanel **refreshPanels;
} RPanelsMenu;
typedef struct r_panels_t {
RConsCanvas *can;
RPanel *panel;
@ -1006,16 +1023,11 @@ typedef struct r_panels_t {
int columnWidth;
int layout;
int menu_pos;
int callgraph;
int curnode;
bool isResizing;
bool isZoom;
const char ***menuStack;
int *menuIndexStack;
int menuStackDepth;
const char **currentMenu;
int currentMenuIndex;
RPanel *menuPanel;
RPanelsMenu *panelsMenu;
Sdb *db;
} RPanels;
#ifdef __cplusplus