diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2012-11-05 19:45:08 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2012-11-05 19:45:08 (GMT) |
commit | c35d5d4ce62b812ec0aa4a5ebbacb84cd0901d53 (patch) | |
tree | ca0262ce4f0a24bdfbc1b9a4ffa1bbb202d47820 /src/analysis/line_prologue.c | |
parent | f5df6496fa50927d3d274c939a888afde652b7ad (diff) |
Removed the old interface for rendering lines.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@278 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/analysis/line_prologue.c')
-rw-r--r-- | src/analysis/line_prologue.c | 202 |
1 files changed, 0 insertions, 202 deletions
diff --git a/src/analysis/line_prologue.c b/src/analysis/line_prologue.c deleted file mode 100644 index 508ddfc..0000000 --- a/src/analysis/line_prologue.c +++ /dev/null @@ -1,202 +0,0 @@ - -/* OpenIDA - Outil d'analyse de fichiers binaires - * line_prologue.c - représentation des lignes d'en-tête de désassemblage - * - * Copyright (C) 2009-2010 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 <http://www.gnu.org/licenses/>. - */ - - -#include "line_prologue.h" - - -#include <malloc.h> -#include <string.h> - - -#include "line-int.h" - - - -/* Ligne de représentation de descriptions initiales (instance) */ -struct _GPrologueLine -{ - GRenderingLine parent; /* Instance parente */ - - char *comment; /* Texte à afficher */ - -}; - - -/* Ligne de représentation de descriptions initiales (classe) */ -struct _GPrologueLineClass -{ - GRenderingLineClass parent; /* Classe parente */ - -}; - - -/* Initialise la classe des lignes de descriptions initiales. */ -static void g_prologue_line_class_init(GPrologueLineClass *); - -/* Initialise la classe des lignes de descriptions initiales. */ -static void g_prologue_line_init(GPrologueLine *); - -/* Ajoute du texte simple à un fichier ouvert en écriture. */ -static void g_prologue_line_add_text(GPrologueLine *, GRenderingOptions *, MainRendering, FILE *); - -/* Ajoute à un tampon GLib le contenu de l'instance spécifiée. */ -static void g_prologue_line_to_buffer(GPrologueLine *, GBufferLine *, GRenderingOptions *); - - -/* Indique le type définit par la GLib pour la ligne. */ -G_DEFINE_TYPE(GPrologueLine, g_prologue_line, G_TYPE_RENDERING_LINE); - - - -/****************************************************************************** -* * -* Paramètres : klass = classe à initialiser. * -* * -* Description : Initialise la classe des lignes de descriptions initiales. * -* * -* Retour : - * -* * -* Remarques : - * -* * -******************************************************************************/ - -static void g_prologue_line_class_init(GPrologueLineClass *klass) -{ - -} - - -/****************************************************************************** -* * -* Paramètres : line = instance à initialiser. * -* * -* Description : Initialise la classe des lignes de descriptions initiales. * -* * -* Retour : - * -* * -* Remarques : - * -* * -******************************************************************************/ - -static void g_prologue_line_init(GPrologueLine *line) -{ - GContentExporter *exporter_parent; /* Instance parente #1 */ - GRenderingLine *line_parent; /* Instance parente #2 */ - - exporter_parent = G_CONTENT_EXPORTER(line); - - exporter_parent->add_text = (add_text_fc)g_prologue_line_add_text; - exporter_parent->export_buffer = (export_buffer_fc)g_prologue_line_to_buffer; - - line_parent = G_RENDERING_LINE(line); - - line_parent->type = RLT_PROLOGUE; - -} - - -/****************************************************************************** -* * -* Paramètres : line = ligne de représentation à actualiser. * -* options = options de rendu. * -* rendering = support effectif final des lignes de code. * -* stream = flux ouvert en écriture. * -* * -* Description : Ajoute du texte simple à un fichier ouvert en écriture. * -* * -* Retour : - * -* * -* Remarques : - * -* * -******************************************************************************/ - -static void g_prologue_line_add_text(GPrologueLine *line, GRenderingOptions *options, MainRendering rendering, FILE *stream) -{ - GContentExporter *exporter; /* Autre vision de la ligne */ - size_t len; /* Taille de l'élément inséré */ - - exporter = G_CONTENT_EXPORTER(line); - - len = strlen(line->comment); - - g_content_exporter_insert_text(exporter, stream, "; ", 2, RTT_COMMENT); - g_content_exporter_insert_text(exporter, stream, line->comment, len, RTT_COMMENT); - -} - - -/****************************************************************************** -* * -* Paramètres : line = ligne de représentation à représenter. * -* buffer = espace où placer ledit contenu. * -* options = options de rendu. * -* * -* Description : Ajoute à un tampon GLib le contenu de l'instance spécifiée. * -* * -* Retour : - * -* * -* Remarques : - * -* * -******************************************************************************/ - -static void g_prologue_line_to_buffer(GPrologueLine *line, GBufferLine *buffer, GRenderingOptions *options) -{ - GContentExporter *exporter; /* Autre vision de la ligne */ - size_t len; /* Taille de l'élément inséré */ - - exporter = G_CONTENT_EXPORTER(line); - - g_buffer_line_start_merge_at(buffer, BLC_ADDRESS); - - len = strlen(line->comment); - - g_content_exporter_insert_into_buffer(exporter, buffer, BLC_COMMENTS, "; ", 2, RTT_COMMENT); - g_content_exporter_insert_into_buffer(exporter, buffer, BLC_COMMENTS, - line->comment, len, RTT_COMMENT); - -} - - -/****************************************************************************** -* * -* Paramètres : comment = texte à afficher au final. * -* * -* Description : Crée une des lignes de descriptions initiales. * -* * -* Retour : Adresse de la structure mise en place. * -* * -* Remarques : - * -* * -******************************************************************************/ - -GRenderingLine *g_prologue_line_new(const char *comment) -{ - GPrologueLine *result; /* Structure à retourner */ - - result = g_object_new(G_TYPE_PROLOGUE_LINE, NULL); - - result->comment = strdup(comment); - - return G_RENDERING_LINE(result); - -} |