Commit graph

106 commits

Author SHA1 Message Date
Riccardo Schirone
f6774e5938 core/graph: traverse nodes with based on (x,y) coordinates 2015-07-04 02:34:59 +02:00
Riccardo Schirone
fe794fcc16 core/graph: const-ify 2015-07-04 02:34:58 +02:00
Riccardo Schirone
937d87f893 core/graph: fix warnings 2015-07-04 02:34:58 +02:00
Riccardo Schirone
b3589b4a0c core/graph: move reversed edges, when possible, to make more space 2015-07-03 09:40:35 +02:00
Riccardo Schirone
5dad19fb06 core/graph: implement place_originals
core/graph: implement place_single
core/graph: implement combine_sequence
core/graph: implement collect_left/right_changes
2015-07-03 09:40:35 +02:00
Riccardo Schirone
b0aa2add3b core/graph: better implementation of dist_nodes
core/graph: add set_dist_nodes
2015-07-03 09:40:35 +02:00
Riccardo Schirone
d2c362344a core/graph: implement place_dummies
core/graph: compute vertical partitions and left classes
core/graph: implement place_left
core/graph: implement adjust_left_class
core/graph: implement methods called in place_virtuals for left/right
2015-07-03 09:40:35 +02:00
Riccardo Schirone
60107b1652 core/graph: refactoring creation of ascii_node and add is_reversed field
an ascii_node (ANode) is reversed when it's a dummy node and it's part
of a back edge that is reversed during the layout algorithm
2015-07-03 09:40:35 +02:00
Riccardo Schirone
57f8c7506f core/graph: count crossing also between layer i and layer i+1 2015-07-03 09:40:35 +02:00
Riccardo Schirone
e5bd85eb06 core/graph: make alternative movement speed configurable 2015-07-02 18:23:10 +02:00
Riccardo Schirone
647e957707 core/graph: add commands to toggle between different movement speeds 2015-07-02 18:23:09 +02:00
Riccardo Schirone
baeab6eeae core/graph: print some dots when cropping text because of zoom 2015-07-01 13:46:41 +02:00
Riccardo Schirone
687b255665 core/graph: use '0' to set zoom to the default value
In this way we have a key to center the screen in every mode we have
(graph, minigraph, etc.)
2015-07-01 13:46:41 +02:00
Riccardo Schirone
5036518c0a core/graph: allow to zoom out until the minigraph appears 2015-07-01 13:46:41 +02:00
Riccardo Schirone
3829b1a82b core/graph: set minimal dimensions for nodes 2015-07-01 13:46:41 +02:00
Riccardo Schirone
ceeaa36620 core/graph: fix out of nodes text when zoom < 100 2015-07-01 13:46:41 +02:00
Riccardo Schirone
0749329762 core/graph: fix out of screen nodes when zoom > 100 2015-07-01 13:46:41 +02:00
Riccardo Schirone
822c6704d1 core/graph: . should center the graph to the current node 2015-07-01 13:46:40 +02:00
Riccardo Schirone
8c0bb719c2 core/graph: code refactoring, make zoom a field of the AGraph structure 2015-07-01 13:46:40 +02:00
pancake
fbc1746ffa Add +/- keys for zoom in/out 2015-06-29 17:00:12 +02:00
pancake
47cbce50c4 Deprecate WASD keys in ascii graph to make azerty users happy 2015-06-28 02:24:46 +02:00
Riccardo Schirone
1b69ac97d5 core/graph: not remove nodes while traversing them 2015-06-17 23:20:28 +02:00
Riccardo Schirone
b5b548255e core/cmd_debug,core/graph: fix warning types with sdb_num_get 2015-06-17 23:20:28 +02:00
Riccardo Schirone
814bf3a49c core/graph: implement layering and ordering of nodes in each layer 2015-06-17 11:22:10 +02:00
Álvaro Felipe Melchor
53badd517d Fix COVs 2015-06-17 00:22:40 +02:00
Anton Kochkov
c871d8e155 Fix CID 1306716, 1306711 2015-06-15 21:15:57 +03:00
Anton Kochkov
966744b4c2 Fix CID 1306706 2015-06-15 20:44:37 +03:00
Riccardo Schirone
b279f282ba Refactoring ascii art graph
util/stack: extend stack api with r_stack_size
core/graph: use RStack instead of a custom implementation
util/graph: change implementation to use lists and extend api
core/cmd_debug: avoid free r_graph_get_nodes
core/graph: rename some functions and use typedefs for graph struct
core/graph: use RGraph for the ascii art graph
util/list: add const whenever possible
util/graph: add const on r_graph_get_nodes/neighbours
core/graph,core/cmd_debug: use const
core/graph: clean the code (add comments, use const, remove magic nums)

* use r_graph_node_iter for the current node
* reset graph when reloading nodes
* on callgraph edges printing, nth should be 0
* force seek of current node when reloading nodes
* use graph_foreach_node
* core/graph: remove get_current_node because useless
2015-06-14 00:46:11 +02:00
pancake
3013b98099 Add key.s/key.S config vars and fix aagraph glitch 2015-06-12 02:19:58 +02:00
Riccardo Schirone
33a550aa23 core/graph: fix undefined behaviour in event_resize callback
* fix bug in VV introduced by f802bdf3b1
* code refactoring
2015-06-11 12:46:36 +02:00
pancake
f802bdf3b1 Add afg command to print non-interactive ascii-art graph 2015-06-11 03:55:15 +02:00
pancake
03aa69b261 Implement reverse rap for system() 2015-06-09 01:45:39 +02:00
Riccardo Schirone
8cb35540c7 cons: use all the available space in the screen
* r_cons_get_size should return the number of rows, why is there a "-1"?
* the newline at the end of the canvas converted to string (in
  r_cons_canvas_to_string) make things shift up one line
* r_cons_canvas_write should consider "left" (which is the number of
  chars available from x until the right side of the screen) and not
  "left - 1". Moreover, since "slen" is at most the maximum number of
  characters that we can print in that row, there is no need to check
  if we can write those bytes
* r_cons_flush usually add a newline, but we shouldn't print it because
  otherwise everything will shift up by one line
2015-06-04 19:11:16 +02:00
Riccardo Schirone
225cc70e37 core/graph: do all update of the state in the graph_refresh function 2015-06-03 17:59:53 +02:00
Riccardo Schirone
ad59230ef9 core/graph: push also tab/TAB movements in the history
core/graph: rename + moving functions
2015-06-03 17:59:53 +02:00
Riccardo Schirone
e9facfe535 core/graph: clean graph_reload_nodes
leave the selection of the right thing to do to sub-functions.
reload_nodes choose which node to reload based on the status of g.
graph_set_layout choose which layout to apply based on the status of g.
2015-06-03 17:59:53 +02:00
Riccardo Schirone
e189a9ba49 core/graph: use a function to update the is_small_nodes flag
in this way we can always update the size of the nodes at the right
moment.
2015-06-03 17:59:52 +02:00
Riccardo Schirone
823c7f8b1b core/graph: extract function graph_print_nodes/edges 2015-06-03 17:59:52 +02:00
Riccardo Schirone
5505d59a81 core/graph: avoid realloc of edges at every step of the loop 2015-06-03 17:59:52 +02:00
Riccardo Schirone
91c4229660 core/graph: use n_edges/n_nodes instead of NULL terminating the list 2015-06-03 17:59:52 +02:00
Riccardo Schirone
cfa69ae7a8 core/graph: choose type of printing in graph_reload_nodes
extract graph_prev/next_node to move to the previous/next node in the
graph.
2015-06-03 17:59:52 +02:00
Riccardo Schirone
78471faf98 core/graph: code refactoring
core/graph: extrat struct graph

core/graph: replace updateSeek with graph_update_seek

core/graph: change names to some functions

core/graph: refactoring of graph_set_layout

core/graph: make ostack part of the struct graph
2015-06-03 17:59:52 +02:00
Riccardo Schirone
3315382895 core/graph: null check should be before dereferencing the pointer 2015-06-03 17:59:52 +02:00
jvoisin
7c096bb1f4 Fix various coverity issues 2015-06-01 21:10:37 +02:00
pancake
a793859d5b Fix some COVs 2015-06-01 11:20:53 +02:00
pancake
c27327cac5 Fix #2648 - save restore arg/var name and type 2015-05-31 23:46:32 +02:00
Riccardo Schirone
676453db6e Simplify canvas boundary check for node text 2015-05-31 23:11:03 +02:00
pancake
bb151c1607 Fix two out-of-canvas node location and missing box lines issues 2015-05-31 22:27:47 +02:00
Riccardo Schirone
da16e1424d core/graph: when printing the text inside a node, consider borders 2015-05-31 20:20:31 +02:00
Riccardo Schirone
17cc0e3c41 core/graph: support partial writing of node title 2015-05-31 20:20:31 +02:00