diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2010-10-24 12:58:53 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2010-10-24 12:58:53 (GMT) |
commit | 6ab5a66388182e6cb9a49b8d6e54a9348de4f264 (patch) | |
tree | 5dfdd4d9125423226cd44cc6e6c18502f362fbd2 /src/gtkext/gtksourceview.c | |
parent | 7e53295ae7e67c8473aca2974e519aa0a593788e (diff) |
Introduced new views for rendering source code.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@184 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/gtkext/gtksourceview.c')
-rw-r--r-- | src/gtkext/gtksourceview.c | 147 |
1 files changed, 147 insertions, 0 deletions
diff --git a/src/gtkext/gtksourceview.c b/src/gtkext/gtksourceview.c new file mode 100644 index 0000000..14f7f95 --- /dev/null +++ b/src/gtkext/gtksourceview.c @@ -0,0 +1,147 @@ + +/* OpenIDA - Outil d'analyse de fichiers binaires + * gtksourceview.c - affichage de code source + * + * Copyright (C) 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 "gtksourceview.h" + + +#include "gtkviewpanel-int.h" + + + +/* -------------------------- INTERACTION DIRECTE AVEC GTK -------------------------- */ + + +/* Composant d'affichage de code source (instance) */ +struct _GtkSourceView +{ + GtkViewPanel parent; /* A laisser en premier */ + +}; + +/* Composant d'affichage de code source (classe) */ +struct _GtkSourceViewClass +{ + GtkViewPanelClass parent; /* A laisser en premier */ + +}; + + +/* Procède à l'initialisation de l'afficheur de code source. */ +static void gtk_source_view_class_init(GtkSourceViewClass *); + +/* Procède à l'initialisation de l'afficheur de code source. */ +static void gtk_source_view_init(GtkSourceView *); + +/* Prend acte de l'association d'un binaire chargé. */ +static void gtk_source_view_attach_binary(GtkSourceView *, GOpenidaBinary *); + + +/* ---------------------------------------------------------------------------------- */ +/* INTERACTION DIRECTE AVEC GTK */ +/* ---------------------------------------------------------------------------------- */ + + +/* Détermine le type du composant d'affichage de code source. */ +G_DEFINE_TYPE(GtkSourceView, gtk_source_view, GTK_TYPE_VIEW_PANEL) + + +/****************************************************************************** +* * +* Paramètres : class = classe GTK à initialiser. * +* * +* Description : Procède à l'initialisation de l'afficheur de code source. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +static void gtk_source_view_class_init(GtkSourceViewClass *class) +{ + +} + + +/****************************************************************************** +* * +* Paramètres : view = composant GTK à initialiser. * +* * +* Description : Procède à l'initialisation de l'afficheur de code source. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +static void gtk_source_view_init(GtkSourceView *view) +{ + GtkViewPanel *panel; /* Instance parente */ + + panel = GTK_VIEW_PANEL(view); + + panel->attach = (attach_binary_fc)gtk_source_view_attach_binary; + +} + +/****************************************************************************** +* * +* Paramètres : - * +* * +* Description : Crée un nouveau composant pour l'affichage de code source. * +* * +* Retour : Composant GTK créé. * +* * +* Remarques : - * +* * +******************************************************************************/ + +GtkWidget *gtk_source_view_new(void) +{ + GtkSourceView *result; + + result = gtk_type_new(GTK_TYPE_SOURCE_VIEW); + + return GTK_WIDGET(result); + +} + + +/****************************************************************************** +* * +* Paramètres : view = composant GTK à mettre à jour. * +* binary = binaire associé à intégrer. * +* * +* Description : Prend acte de l'association d'un binaire chargé. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +static void gtk_source_view_attach_binary(GtkSourceView *view, GOpenidaBinary *binary) +{ + +} |