/* OpenIDA - Outil d'analyse de fichiers binaires * virtual.h - prototypes pour l'encapsulation graphique des blocs virtuels * * 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_NODES_VIRTUAL_H #define _GTKEXT_GRAPH_NODES_VIRTUAL_H #include "../node.h" #include "../../../analysis/blocks/virtual.h" /* Indice d'une hauteur au sein des rangs */ typedef size_t vspan_slot_t; /* Indice non initilisé */ #define UNINITIALIZED_VSPAN_SLOT (~((vspan_slot_t)0)) #define G_TYPE_VIRTUAL_NODE g_virtual_node_get_type() #define G_VIRTUAL_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_virtual_node_get_type(), GVirtualNode)) #define G_IS_VIRTUAL_NODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_virtual_node_get_type())) #define G_VIRTUAL_NODE_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE((inst), g_virtual_node_get_type(), GVirtualNodeIface)) #define G_VIRTUAL_NODE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_VIRTUAL_NODE, GVirtualNodeClass)) /* Encapsulation graphique d'un bloc virtuel (instance) */ typedef struct _GVirtualNode GVirtualNode; /* Encapsulation graphique d'un bloc virtuel (classe) */ typedef struct _GVirtualNodeClass GVirtualNodeClass; /* Indique le type définit par la GLib pour l'encapsulation d'un bloc virtuel. */ GType g_virtual_node_get_type(void); /* Encapsule graphiquement un bloc virtuel. */ GGraphNode *g_virtual_node_new(GVirtualBlock *); /* Ajoute un noeud au groupe courant. */ void g_virtual_node_add_child(GVirtualNode *, GGraphNode *); /* Compte le nombre de noeuds contenus dans le groupe courant. */ size_t g_virtual_node_count_children(const GVirtualNode *); /* Renvoie un des noeuds contenus dans le groupe courant. */ GGraphNode *g_virtual_node_get_child(const GVirtualNode *, size_t); /* Réserve une portion de largeur pour un lien. */ vspan_slot_t g_virtual_node_reserve_span(GVirtualNode *, unsigned int, unsigned int, bool); /* Fournit la position horizontale obtenue par réservation. */ gint g_virtual_node_get_x_for_vspan_slot(const GVirtualNode *, vspan_slot_t, bool); #endif /* _GTKEXT_GRAPH_NODES_VIRTUAL_H */