Move RzPanel types from RzCons to RzCore (#3576)
This commit is contained in:
parent
89551db165
commit
7d64d8b2bf
3 changed files with 76 additions and 76 deletions
|
|
@ -266,6 +266,75 @@ typedef struct rz_core_visual_tab_t {
|
|||
// TODO: cursor and such
|
||||
} RzCoreVisualTab;
|
||||
|
||||
typedef int (*RzPanelsMenuCallback)(void *user);
|
||||
typedef struct rz_panels_menu_item {
|
||||
int n_sub, selectedIndex;
|
||||
char *name;
|
||||
struct rz_panels_menu_item **sub;
|
||||
RzPanelsMenuCallback cb;
|
||||
RzPanel *p;
|
||||
} RzPanelsMenuItem;
|
||||
|
||||
typedef struct rz_panels_menu_t {
|
||||
RzPanelsMenuItem *root;
|
||||
RzPanelsMenuItem **history;
|
||||
int depth;
|
||||
int n_refresh;
|
||||
RzPanel **refreshPanels;
|
||||
} RzPanelsMenu;
|
||||
|
||||
typedef enum {
|
||||
PANEL_MODE_DEFAULT,
|
||||
PANEL_MODE_MENU,
|
||||
PANEL_MODE_ZOOM,
|
||||
PANEL_MODE_WINDOW,
|
||||
PANEL_MODE_HELP
|
||||
} RzPanelsMode;
|
||||
|
||||
typedef enum {
|
||||
PANEL_LAYOUT_DEFAULT_STATIC = 0,
|
||||
PANEL_LAYOUT_DEFAULT_DYNAMIC = 1
|
||||
} RzPanelsLayout;
|
||||
|
||||
typedef struct rz_panels_t {
|
||||
RzConsCanvas *can;
|
||||
RzPanel **panel;
|
||||
int n_panels;
|
||||
int columnWidth;
|
||||
int curnode;
|
||||
int mouse_orig_x;
|
||||
int mouse_orig_y;
|
||||
bool autoUpdate;
|
||||
bool mouse_on_edge_x;
|
||||
bool mouse_on_edge_y;
|
||||
RzPanelsMenu *panels_menu;
|
||||
Sdb *db;
|
||||
Sdb *rotate_db;
|
||||
Sdb *almighty_db;
|
||||
HtPP *mht;
|
||||
RzPanelsMode mode;
|
||||
RzPanelsMode prevMode;
|
||||
RzPanelsLayout layout;
|
||||
char *name;
|
||||
bool first_run;
|
||||
} RzPanels;
|
||||
|
||||
typedef enum {
|
||||
DEFAULT,
|
||||
ROTATE,
|
||||
DEL,
|
||||
QUIT,
|
||||
} RzPanelsRootState;
|
||||
|
||||
typedef struct rz_panels_root_t {
|
||||
int n_panels;
|
||||
int cur_panels;
|
||||
Sdb *pdc_caches;
|
||||
Sdb *cur_pdc_cache;
|
||||
RzPanels **panels;
|
||||
RzPanelsRootState root_state;
|
||||
} RzPanelsRoot;
|
||||
|
||||
typedef struct rz_core_visual_t {
|
||||
RzList /*<RzCoreVisualTab *>*/ *tabs;
|
||||
int tab;
|
||||
|
|
|
|||
|
|
@ -53,6 +53,13 @@ typedef enum {
|
|||
DOWN
|
||||
} Direction;
|
||||
|
||||
typedef struct {
|
||||
RzStrBuf *data;
|
||||
RzPanelPos pos;
|
||||
int idx;
|
||||
int offset;
|
||||
} RModal;
|
||||
|
||||
static const char *panels_dynamic[] = {
|
||||
"Disassembly", "Stack", "Registers",
|
||||
NULL
|
||||
|
|
|
|||
|
|
@ -1223,82 +1223,6 @@ RZ_API RZ_OWN char *rz_cons_prompt(RZ_NONNULL const char *str, RZ_NULLABLE const
|
|||
|
||||
#endif
|
||||
|
||||
typedef int (*RzPanelsMenuCallback)(void *user);
|
||||
typedef struct rz_panels_menu_item {
|
||||
int n_sub, selectedIndex;
|
||||
char *name;
|
||||
struct rz_panels_menu_item **sub;
|
||||
RzPanelsMenuCallback cb;
|
||||
RzPanel *p;
|
||||
} RzPanelsMenuItem;
|
||||
|
||||
typedef struct rz_panels_menu_t {
|
||||
RzPanelsMenuItem *root;
|
||||
RzPanelsMenuItem **history;
|
||||
int depth;
|
||||
int n_refresh;
|
||||
RzPanel **refreshPanels;
|
||||
} RzPanelsMenu;
|
||||
|
||||
typedef enum {
|
||||
PANEL_MODE_DEFAULT,
|
||||
PANEL_MODE_MENU,
|
||||
PANEL_MODE_ZOOM,
|
||||
PANEL_MODE_WINDOW,
|
||||
PANEL_MODE_HELP
|
||||
} RzPanelsMode;
|
||||
|
||||
typedef enum {
|
||||
PANEL_LAYOUT_DEFAULT_STATIC = 0,
|
||||
PANEL_LAYOUT_DEFAULT_DYNAMIC = 1
|
||||
} RzPanelsLayout;
|
||||
|
||||
typedef struct {
|
||||
RzStrBuf *data;
|
||||
RzPanelPos pos;
|
||||
int idx;
|
||||
int offset;
|
||||
} RModal;
|
||||
|
||||
typedef struct rz_panels_t {
|
||||
RzConsCanvas *can;
|
||||
RzPanel **panel;
|
||||
int n_panels;
|
||||
int columnWidth;
|
||||
int curnode;
|
||||
int mouse_orig_x;
|
||||
int mouse_orig_y;
|
||||
bool autoUpdate;
|
||||
bool mouse_on_edge_x;
|
||||
bool mouse_on_edge_y;
|
||||
RzPanelsMenu *panels_menu;
|
||||
Sdb *db;
|
||||
Sdb *rotate_db;
|
||||
Sdb *almighty_db;
|
||||
HtPP *mht;
|
||||
RzPanelsMode mode;
|
||||
RzPanelsMode prevMode;
|
||||
RzPanelsLayout layout;
|
||||
char *name;
|
||||
bool first_run;
|
||||
} RzPanels;
|
||||
|
||||
typedef enum {
|
||||
DEFAULT,
|
||||
ROTATE,
|
||||
DEL,
|
||||
QUIT,
|
||||
} RzPanelsRootState;
|
||||
|
||||
typedef struct rz_panels_root_t {
|
||||
int n_panels;
|
||||
int cur_panels;
|
||||
Sdb *pdc_caches;
|
||||
Sdb *cur_pdc_cache;
|
||||
RzPanels **panels;
|
||||
RzPanelsRootState root_state;
|
||||
} RzPanelsRoot;
|
||||
|
||||
#ifdef __sun
|
||||
static inline void cfmakeraw(struct termios *tm) {
|
||||
tm->c_cflag &= ~(CSIZE | PARENB);
|
||||
|
|
|
|||
Loading…
Reference in a new issue