Skip to content

Commit

Permalink
Initial PoC for the Visual 2.0 (for now: VV)
Browse files Browse the repository at this point in the history
  • Loading branch information
radare committed Mar 5, 2015
1 parent 184eaef commit ef293e4
Show file tree
Hide file tree
Showing 5 changed files with 496 additions and 8 deletions.
15 changes: 12 additions & 3 deletions libr/cons/canvas.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ R_API int r_cons_canvas_gotoxy(RConsCanvas *c, int x, int y) {
if (!c) return 0;
x += c->sx;
y += c->sy;
if (x>c->w*2) return 0;
if (y>c->h*2) return 0;
if (x >= c->w) {
c->x = c->w;
ret = R_FALSE;
Expand Down Expand Up @@ -281,14 +283,21 @@ R_API void r_cons_canvas_box(RConsCanvas *c, int x, int y, int w, int h, const c
char corner = '=';

if (w < 0) return;
if (x > c->w*2) return;
if (y > c->h*2) return;

if (color)
c->attr = color;
row = malloc (w+1);
if (!row)
return;
row[0] = roundcorners?'.':corner;
memset (row+1, '-', w-2);
row[w-1] = roundcorners?'.':corner;
row[w] = 0;
if (w>2)
memset (row+1, '-', w-2);
if (w>1)
row[w-1] = roundcorners?'.':corner;
if (w>=0)
row[w] = 0;
if (G(x, y)) {
W(row);
}
Expand Down
2 changes: 1 addition & 1 deletion libr/core/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ DEPS+=r_reg r_search r_syscall r_diff r_socket r_fs r_magic
OBJS=core.o cmd.o file.o config.o visual.o io.o yank.o libs.o graph.o
OBJS+=hack.o vasm.o patch.o bin.o log.o syscmd.o rtr.o cmd_api.o
OBJS+=anal.o project.o gdiff.o asm.o vmenus.o disasm.o plugin.o
OBJS+=help.o task.o
OBJS+=help.o task.o panels.o

CFLAGS+=-DCORELIB
LDFLAGS+=${DL_LIBS}
Expand Down
6 changes: 3 additions & 3 deletions libr/core/graph.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

#include <r_core.h>
static const char *mousemodes[] = { "canvas-y", "canvas-x", "node-y", "node-x", NULL };
int mousemode = 0;
int small_nodes = 0;
int simple_mode = 1;
static int mousemode = 0;
static int small_nodes = 0;
static int simple_mode = 1;
static void reloadNodes(RCore *core) ;
#define OS_SIZE 128
struct {
Expand Down
Loading

0 comments on commit ef293e4

Please sign in to comment.