/* OpenIDA - Outil d'analyse de fichiers binaires * gcodebuffer.h - prototypes pour l'affichage d'un fragment de code d'assemblage * * Copyright (C) 2010-2012 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 _GLIBEXT_GCODEBUFFER_H #define _GLIBEXT_GCODEBUFFER_H #include #include "gbufferline.h" /* -------------------------- TAMPON POUR CODE DESASSEMBLE -------------------------- */ #define G_TYPE_CODE_BUFFER (g_code_buffer_get_type()) #define G_CODE_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), G_TYPE_CODE_BUFFER, GCodeBuffer)) #define G_CODE_BUFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_CODE_BUFFER, GCodeBufferClass)) #define G_IS_CODE_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), G_TYPE_CODE_BUFFER)) #define G_IS_CODE_BUFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_CODE_BUFFER)) #define G_CODE_BUFFER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_CODE_BUFFER, GCodeBufferClass)) /* Tampon pour code désassemblé (instance) */ typedef struct _GCodeBuffer GCodeBuffer; /* Tampon pour code désassemblé (classe) */ typedef struct _GCodeBufferClass GCodeBufferClass; /* Détermine le type du composant de tampon pour code désassemblé. */ GType g_code_buffer_get_type(void); /* Crée un nouveau composant de tampon pour code désassemblé. */ GCodeBuffer *g_code_buffer_new(void); /* FIXME */ #define g_code_buffer_append_new_line_fixme(b) g_code_buffer_append_new_line(b, 0ull) /* Ajoute une nouvelle ligne à un tampon pour code désassemblé. */ GBufferLine *g_code_buffer_append_new_line(GCodeBuffer *, vmpa_t); /* Ajoute une nouvelle ligne à un tampon pour code désassemblé. */ GBufferLine *g_code_buffer_insert_at(GCodeBuffer *, vmpa_t, bool); /* Ajoute une nouvelle ligne à un tampon pour code désassemblé. */ GBufferLine *g_code_buffer_insert_after(GCodeBuffer *, GBufferLine *); /* Retrouve une ligne au sein d'un tampon avec une adresse. */ GBufferLine *g_code_buffer_find_line_by_addr(const GCodeBuffer *, vmpa_t); /* Augmente l'indentation des prochaines lignes. */ void g_code_buffer_inc_indentation(GCodeBuffer *); /* Diminue l'indentation des prochaines lignes. */ void g_code_buffer_dec_indentation(GCodeBuffer *); /* Traitement d'une ligne parcourue. */ typedef bool (* process_line_fc) (GCodeBuffer *, GBufferLine *, void *); /* Exporte dans un fichier le tampon de code désassemblé. */ void g_buffer_code_scan(GCodeBuffer *, vmpa_t, vmpa_t, const char *, process_line_fc, void *); /* ---------------------- VUE PARTICULIERE D'UN TAMPON DE CODE ---------------------- */ #define G_TYPE_BUFFER_VIEW (g_buffer_view_get_type()) #define G_BUFFER_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), G_TYPE_BUFFER_VIEW, GBufferView)) #define G_BUFFER_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_BUFFER_VIEW, GBufferViewClass)) #define G_IS_BUFFER_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), G_TYPE_BUFFER_VIEW)) #define G_IS_BUFFER_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_BUFFER_VIEW)) #define G_BUFFER_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_BUFFER_VIEW, GBufferViewClass)) /* Vue d'un tampon pour code désassemblé (instance) */ typedef struct _GBufferView GBufferView; /* Vue d'un tampon pour code désassemblé (classe) */ typedef struct _GBufferViewClass GBufferViewClass; /* Détermine le type de la vue d'un tampon pour code désassemblé. */ GType g_buffer_view_get_type(void); /* Crée une nouvelle vue d'un tampon pour code désassemblé. */ GBufferView *g_buffer_view_new(GCodeBuffer *); /* Restreint le champ d'application de l'affichage. */ void g_buffer_view_restrict(GBufferView *, vmpa_t, vmpa_t); /* Indique le champ d'application de l'affichage. */ void g_buffer_view_get_restrictions(GBufferView *, vmpa_t *, vmpa_t *); /* Fournit le tampon de code lié à un visualisateur donné. */ GCodeBuffer *g_buffer_view_get_buffer(const GBufferView *); /* Fournit la hauteur d'impression d'une ligne visualisée. */ gint g_buffer_view_get_line_height(GBufferView *); /* Fournit les dimensions requises par une visualisation. */ void g_buffer_view_get_size(GBufferView *, gint *, gint *, bool, bool); /* Supprime toute mise en évidence de segments. */ bool g_buffer_view_unhighlight_segments(GBufferView *); /* Surligne tous les segments similaires à celui sous la souris. */ void g_buffer_view_highlight_segments(GBufferView *, gint, gint); /* Définit à une procédure à appeler lors des dessins de ligne. */ void g_buffer_view_define_extra_drawing(GBufferView *, buffer_line_draw_fc, void *); /* Imprime la visualisation du tampon de code désassemblé. */ void g_buffer_view_draw(const GBufferView *, const GdkEventExpose *, GdkGC *, gint, gint, bool, bool); /* Fournit la ligne présente à une ordonnée donnée. */ GBufferLine *g_buffer_view_find_line_at(GBufferView *, gint); /* Indique la position d'affichage d'une adresse donnée. */ bool g_buffer_view_get_address_coordinates(GBufferView *, vmpa_t, gint *, gint *); #endif /* _GLIBEXT_GCODEBUFFER_H */