diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2013-03-19 21:13:51 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2013-03-19 21:13:51 (GMT) |
commit | cf97db0ea4d1ea983db38df85984034b49fa4f77 (patch) | |
tree | b6d69945b24ec8da93f0bef7ccf4dfdbe1d920a2 /src/gtkext/graph/node.h | |
parent | e7a85861ba8bcd00ceb7bf9e47f4eadccd48ce3f (diff) |
Defined the first steps towards new graph renderings.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@345 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/gtkext/graph/node.h')
-rw-r--r-- | src/gtkext/graph/node.h | 56 |
1 files changed, 54 insertions, 2 deletions
diff --git a/src/gtkext/graph/node.h b/src/gtkext/graph/node.h index 57d0932..ffe0a0d 100644 --- a/src/gtkext/graph/node.h +++ b/src/gtkext/graph/node.h @@ -25,14 +25,21 @@ #define _GRAPH_NODE_H +#include "params.h" +#include "ranks.h" +#include "../gtkbufferview.h" #include "../gtkgraphview.h" -#include "../../arch/archbase.h" +#include "../../arch/instruction.h" +#include "../../analysis/block.h" /* Indentation pour l'édition des commandes */ #define DOT_IDENT " " +/* Taille maximale des noms de noeud ("_%p") */ +#define NODE_NAME_LEN (3 + sizeof(GtkWidget *) * 2 + 1) + /* -------------------------- GESTION DES NOEUDS A L'UNITE -------------------------- */ @@ -52,17 +59,50 @@ typedef struct _GGraphNode GGraphNode; typedef struct _GGraphNodeClass GGraphNodeClass; +/* Rappel à chaque noeud visité */ +typedef bool (* graph_node_visitor_cb) (GGraphNode *, void *); + + /* Indique le type définit par la GLib pour le noeud. */ GType g_graph_node_get_type(void); /* Constitue un intermédiaire entre un noeud dot et du code. */ GGraphNode *g_graph_node_new(GtkWidget *); + + +/* Fournit le rang du noeud dans le graphique. */ +unsigned int g_graph_node_get_rank(const GGraphNode *); + +/* Altère la position du noeud d'encapsulation. */ +void g_graph_node_set_position(GGraphNode *, gint *, gint *); + +/* Fournit la position du noeud d'encapsulation. */ +void g_graph_node_get_position(const GGraphNode *, gint *, gint *); + +#define g_graph_node_has_x_position(node) \ + ({ \ + gint _x; \ + g_graph_node_get_position(node, &_x, NULL); \ + _x != UNINITIALIZED_NODE_POS; \ + }) + +/* Espace constitué, entièrement ou non. */ +GtkAllocation g_graph_node_get_allocation(const GGraphNode *); + +/* Parcourt tous les noeuds graphiques dans un ordre donné. */ +bool g_graph_node_visit_flow_nodes(GGraphNode *, graph_node_visitor_cb, void *); + + + +/* Inscrit le noeud au rang donné. */ +char *g_graph_node_append_name_to_rank(const GGraphNode *, char *); + /* Déclare l'intermédiaire en tant que noeud pour dot. */ char *g_graph_node_register_for_dot(const GGraphNode *, char *, unsigned int); /* Place le morceau de code de l'intermédiaire à l'écran. */ -void g_graph_node_place(GGraphNode *, GtkGraphView *, gint , gint); +void g_graph_node_place_old(GGraphNode *, GtkGraphView *, gint , gint); /* Etablit une jonction ferme avec un noeud. */ void g_graph_node_connect(const GGraphNode *, gint, gint, GdkPoint **, size_t *); @@ -72,6 +112,18 @@ void g_graph_node_connect(const GGraphNode *, gint, gint, GdkPoint **, size_t *) /* ----------------------- MANIPULATION D'ENSEMBLES DE NOEUDS ----------------------- */ +/* Recherche une vue donnée dans une série de vues. */ +GtkBufferView *find_graph_view_by_start_address(GtkBufferView **, size_t, vmpa_t); + +/* Réalise une conversion de blocs en noeuds. */ +GGraphNode *convert_blocks_into_nodes(GInstrBlock *, GtkBufferView **, size_t); + +/* Recherche le noeud contenant une instruction donnée. */ +GGraphNode *find_node_for_instruction(GGraphNode *, GArchInstruction *); + + + + /* Recherche un noeud donné dans une série de noeuds. */ GGraphNode *find_graph_node_by_start_address(GGraphNode **, size_t, vmpa_t); |