diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2017-12-26 23:52:44 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2017-12-26 23:52:44 (GMT) |
commit | 2c28d59fb3671c0fdd1987784076d4968c58b651 (patch) | |
tree | a301f6cd9c1fd9f92191fba7fe7b59a7e3a01b5a /src/analysis/loaded-int.h | |
parent | 67b4887317b7394d63b543aa48cb368406374103 (diff) |
Created the GLoadedContent interface to load all kinds of content.
Diffstat (limited to 'src/analysis/loaded-int.h')
-rw-r--r-- | src/analysis/loaded-int.h | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/src/analysis/loaded-int.h b/src/analysis/loaded-int.h new file mode 100644 index 0000000..a574d27 --- /dev/null +++ b/src/analysis/loaded-int.h @@ -0,0 +1,79 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * loaded-int.h - définitions internes propres aux contenus chargés + * + * Copyright (C) 2017 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide 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. + * + * Chrysalide 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/>. + */ + + +#ifndef _ANALYSIS_LOADED_INT_H +#define _ANALYSIS_LOADED_INT_H + + +#include "loaded.h" + + + +/* Fournit le désignation associée à l'élément chargé. */ +typedef const char * (* describe_loaded_fc) (const GLoadedContent *, bool); + +/* Détermine le nombre de vues disponibles pour un contenu. */ +typedef unsigned int (* count_loaded_views_fc) (const GLoadedContent *); + +/* Met en place la vue demandée pour un contenu chargé. */ +typedef GtkWidget * (* build_loaded_view_fc) (GLoadedContent *, unsigned int); + +/* Retrouve l'indice correspondant à la vue donnée d'un contenu. */ +typedef unsigned int (* get_loaded_view_index_fc) (GLoadedContent *, GtkWidget *); + +/* Fournit toutes les options d'affichage pour un contenu. */ +typedef bool * const (* get_all_loaded_options_fc) (const GLoadedContent *, unsigned int); + +/* Définit une option d'affichage pour un contenu. */ +typedef bool ( * set_loaded_option_fc) (GLoadedContent *, unsigned int, unsigned int, bool); + + +/* Accès à un contenu binaire quelconque (interface) */ +struct _GLoadedContentIface +{ + GTypeInterface base_iface; /* A laisser en premier */ + + /* Méthodes virtuelles */ + + describe_loaded_fc describe; /* Description de contenu */ + + count_loaded_views_fc count_views; /* Compteur de vues */ + build_loaded_view_fc build_view; /* Mise en place de vues */ + get_loaded_view_index_fc get_view_index;/* Récupération d'indice de vue*/ + + get_all_loaded_options_fc get_all_options; /* Obtention de liste brute*/ + set_loaded_option_fc set_option; /* Définition d'affichage */ + + /* Signaux */ + + void (* display_changed) (GLoadedContent *, unsigned int, unsigned int); + +}; + + +/* Redéfinition */ +typedef GLoadedContentIface GLoadedContentInterface; + + + +#endif /* _ANALYSIS_LOADED_INT_H */ |