/* OpenIDA - Outil d'analyse de fichiers binaires * ranks.h - prototypes pour le calcul de l'ordonnée des différents classements * * Copyright (C) 2013 Cyrille Bagard * * This file is part of OpenIDA. * * OpenIDA is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * OpenIDA is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Foobar. If not, see . */ #ifndef _GTKEXT_GRAPH_RANKS_H #define _GTKEXT_GRAPH_RANKS_H #include #include /* Indice d'une hauteur au sein des rangs */ typedef size_t hspan_slot_t; /* Indice non initilisé */ #define UNINITIALIZED_HSPAN_SLOT (~((hspan_slot_t)0)) #define G_TYPE_GRAPH_RANKS g_graph_ranks_get_type() #define G_GRAPH_RANKS(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_graph_ranks_get_type(), GGraphRanks)) #define G_IS_GRAPH_RANKS(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_graph_ranks_get_type())) #define G_GRAPH_RANKS_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE((inst), g_graph_ranks_get_type(), GGraphRanksIface)) #define G_GRAPH_RANKS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_GRAPH_RANKS, GGraphRanksClass)) /* Calcul de l'ordonnée des différents classements (instance) */ typedef struct _GGraphRanks GGraphRanks; /* Calcul de l'ordonnée des différents classements (classe) */ typedef struct _GGraphRanksClass GGraphRanksClass; /* Indique le type définit par la GLib pour le calcul de l'ordonnée des classements. */ GType g_graph_ranks_get_type(void); /* Prépare de quoi se définir au mieux les ordonnées des noeuds. */ GGraphRanks *g_graph_ranks_new(unsigned int); /* Note une hauteur minimale requise pour un rang du classement. */ void g_graph_ranks_set_min_height(GGraphRanks *, unsigned int, gint); /* Fournit la hauteur requise pour l'affichage des rangs. */ gint g_graph_ranks_get_height(const GGraphRanks *); /* Supprime toutes les réservations faites pour les liens. */ void g_graph_ranks_reset_reservations(GGraphRanks *); /* Réserve une portion de hauteur pour un lien. */ hspan_slot_t g_graph_ranks_reserve_span(GGraphRanks *, unsigned int, gint, gint, bool); /* Calcule l'ordonnée finale de chaque rang du classement. */ void g_graph_ranks_compute_y_line(GGraphRanks *); /* Fournit la position verticale correspondant à un rang donné. */ gint g_graph_ranks_get_y_for_rank(const GGraphRanks *, unsigned int); /* Fournit la position verticale obtenue par réservation. */ gint g_graph_ranks_get_y_for_hspan_slot(const GGraphRanks *, unsigned int, hspan_slot_t, bool); #endif /* _GTKEXT_GRAPH_RANKS_H */