summaryrefslogtreecommitdiff
path: root/src/gtkext/graph/node.h
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2013-08-17 21:54:56 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2013-08-17 21:54:56 (GMT)
commite53684bebd74d0a8ade79082c618ebb21bdea361 (patch)
tree1a9e772134f2fea48ec06c78de1d2ceaef6b69ad /src/gtkext/graph/node.h
parenta7d77562cd63f6cf0856b4cc19e245072af86f69 (diff)
Replaced some parts of the graph computing for better results.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@356 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/gtkext/graph/node.h')
-rw-r--r--src/gtkext/graph/node.h38
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. */