summaryrefslogtreecommitdiff
path: root/src/gtkext/graph/node.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gtkext/graph/node.h')
-rw-r--r--src/gtkext/graph/node.h56
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);