diff options
Diffstat (limited to 'src/gtkext/graph/node.h')
-rw-r--r-- | src/gtkext/graph/node.h | 38 |
1 files changed, 35 insertions, 3 deletions
diff --git a/src/gtkext/graph/node.h b/src/gtkext/graph/node.h index fa2fa27..3346b00 100644 --- a/src/gtkext/graph/node.h +++ b/src/gtkext/graph/node.h @@ -59,6 +59,29 @@ typedef struct _GGraphNode GGraphNode; typedef struct _GGraphNodeClass GGraphNodeClass; +/* Indications sur l'abscisse idéale à adopter */ +typedef union _pending_position +{ + gint direct_x; /* Position strictement vert. */ + gint left_margin; /* Limite à ne pas dépasser #1 */ + gint right_margin; /* Limite à ne pas dépasser #2 */ + GGraphNode *left_node; /* Noeud de référence à droite */ + GGraphNode *right_node; /* Noeud de référence à gauche */ + +} pending_position; + +/* Définition présente dans les indications */ +typedef enum _PendingPositionFlags +{ + PPF_NONE, /* Aucune -> centrage */ + PPF_DIRECT_X, /* Position strictement vert. */ + PPF_LEFT_MARGIN, /* Limite à ne pas dépasser #1 */ + PPF_RIGHT_MARGIN, /* Limite à ne pas dépasser #2 */ + PPF_LEFT_NODE, /* Noeud de référence à droite */ + PPF_RIGHT_NODE /* Noeud de référence à gauche */ + +} PendingPositionFlags; + /* Détail sur une visite */ typedef enum _GNodeVisitState { @@ -86,11 +109,20 @@ unsigned int g_graph_node_get_rank(const GGraphNode *); /* Réinitialise la position d'un noeud de graphique. */ void g_graph_node_reset_position(GGraphNode *); +/* Définit les abscisses relatives du contenu d'un noeud. */ +void g_graph_node_prepare_x_line(GGraphNode *node, GGraphNode *nodes); + +/* Applique une position finale au noeud. */ +void g_graph_node_apply_position(GGraphNode *); + /* Altère la position du noeud d'encapsulation. */ -void g_graph_node_set_position(GGraphNode *, gint *, gint *); +void g_graph_node_set_x_position(GGraphNode *, gint); /* Prépare la position du noeud pour l'alignement des liens. */ -void g_graph_node_set_pending_position(GGraphNode *, gint *, gint *); +void g_graph_node_set_pending_position(GGraphNode *, PendingPositionFlags, pending_position, GGraphNode *); + +/* Indique la position du noeud pour l'alignement des liens. */ +void g_graph_node_get_pending_position(GGraphNode *, PendingPositionFlags *, pending_position *); /* Fournit la position du noeud d'encapsulation. */ void g_graph_node_get_position(const GGraphNode *, gint *, gint *); @@ -99,7 +131,7 @@ void g_graph_node_get_position(const GGraphNode *, gint *, gint *); ({ \ gint _x; \ g_graph_node_get_position(node, &_x, NULL); \ - _x != UNINITIALIZED_NODE_POS/* || node->pending_x != 0*/; \ + _x != UNINITIALIZED_NODE_POS; \ }) /* Espace constitué, entièrement ou non. */ |