summaryrefslogtreecommitdiff
path: root/src/glibext/gbuffercache-int.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/glibext/gbuffercache-int.h')
-rw-r--r--src/glibext/gbuffercache-int.h96
1 files changed, 96 insertions, 0 deletions
diff --git a/src/glibext/gbuffercache-int.h b/src/glibext/gbuffercache-int.h
new file mode 100644
index 0000000..6886fb0
--- /dev/null
+++ b/src/glibext/gbuffercache-int.h
@@ -0,0 +1,96 @@
+
+/* Chrysalide - Outil d'analyse de fichiers binaires
+ * gbuffercache-int.h - définitions internes d'affichage à la demande d'un ensemble de lignes
+ *
+ * Copyright (C) 2020 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 Chrysalide. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#ifndef _GLIBEXT_GBUFFERCACHE_INT_H
+#define _GLIBEXT_GBUFFERCACHE_INT_H
+
+
+#include "gbuffercache.h"
+
+
+
+/* --------------------- FONCTIONS AUXILIAIRES DE MANIPULATIONS --------------------- */
+
+
+/* Informations rattachées à la génération d'une ligne */
+typedef struct _generator_link
+{
+ GLineGenerator *instance; /* Fournisseur de contenu */
+ size_t repeat; /* Compteur de successions */
+
+} generator_link;
+
+/* Suivi interne de l'état d'une ligne */
+typedef struct _cache_info
+{
+ union
+ {
+ generator_link generator; /* Générateur unique */
+ generator_link *generators; /* Liste de générateurs */
+ };
+ size_t count; /* Taille de cette liste */
+
+ GBufferLine *line; /* Ligne en place ou NULL */
+
+ BufferLineFlags extra_flags; /* Propriétés supplémentaires */
+
+} cache_info;
+
+
+
+/* -------------------------- TAMPON POUR CODE DESASSEMBLE -------------------------- */
+
+
+/* Tampon pour gestion de lignes optimisée (instance) */
+struct _GBufferCache
+{
+ GObject parent; /* A laisser en premier */
+
+ GBinContent *content; /* Contenu binaire global */
+
+ cache_info *lines; /* Liste des lignes intégrées */
+ size_t count; /* Quantité en cache */
+ size_t used; /* Quantité utilisée */
+
+ GWidthTracker *tracker; /* Suivi des largeurs */
+
+};
+
+/* Tampon pour gestion de lignes optimisée (classe) */
+struct _GBufferCacheClass
+{
+ GObjectClass parent; /* A laisser en premier */
+
+ gint line_height; /* Hauteur maximale des lignes */
+ gint left_margin; /* Marge gauche + espace */
+ gint text_pos; /* Début d'impression du code */
+
+ /* Signaux */
+
+ void (* size_changed) (GBufferCache *, bool, size_t, size_t);
+
+};
+
+
+
+#endif /* _GLIBEXT_GBUFFERCACHE_INT_H */