summaryrefslogtreecommitdiff
path: root/src/glibext/buffercache.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2020-07-26 18:52:15 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2020-07-26 18:52:15 (GMT)
commita6c46fc296db67321db3d4bb586346998de90422 (patch)
tree042cd0fd89fd1f1c8943b3aefd2b50585f461f58 /src/glibext/buffercache.c
parent19516ffcca14abb082c5109125b7249bdc7fc199 (diff)
Reduced the quantity of arguments used to deal with lines.
Diffstat (limited to 'src/glibext/buffercache.c')
-rw-r--r--src/glibext/buffercache.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/src/glibext/buffercache.c b/src/glibext/buffercache.c
index 16d96dc..bfc2360 100644
--- a/src/glibext/buffercache.c
+++ b/src/glibext/buffercache.c
@@ -537,7 +537,7 @@ static void g_buffer_cache_init(GBufferCache *cache)
cache->count = 0;
cache->used = 0;
- cache->tracker = g_width_tracker_new(cache);
+ cache->tracker = NULL;
}
@@ -620,7 +620,8 @@ static void g_buffer_cache_finalize(GBufferCache *cache)
/******************************************************************************
* *
-* Paramètres : content = éventuel contenu binaire brut à référencer. *
+* Paramètres : content = éventuel contenu binaire brut à référencer. *
+* col_count = quantité maximale de colonnes à considérer. *
* *
* Description : Crée un nouveau composant de tampon pour code désassemblé. *
* *
@@ -630,7 +631,7 @@ static void g_buffer_cache_finalize(GBufferCache *cache)
* *
******************************************************************************/
-GBufferCache *g_buffer_cache_new(GBinContent *content)
+GBufferCache *g_buffer_cache_new(GBinContent *content, size_t col_count)
{
GBufferCache *result; /* Composant à retourner */
@@ -642,6 +643,8 @@ GBufferCache *g_buffer_cache_new(GBinContent *content)
g_object_ref(G_OBJECT(content));
}
+ result->tracker = g_width_tracker_new(result, col_count);
+
return result;
}
@@ -786,9 +789,6 @@ GWidthTracker *g_buffer_cache_get_width_tracker(const GBufferCache *cache)
}
-
-
-
/******************************************************************************
* *
* Paramètres : cache = instance GLib à consulter. *
@@ -1439,7 +1439,6 @@ void g_buffer_cache_collect_widths(GBufferCache *cache, size_t index, line_width
* last = dernière ligne à dessiner. *
* area = position et surface à traiter. *
* options = règles d'affichage des colonnes modulables. *
-* offsets = décalages supplémentaires à appliquer. *
* selected = ordonnée d'une ligne sélectionnée ou NULL. *
* list = liste de contenus à mettre en évidence. *
* *
@@ -1451,14 +1450,13 @@ void g_buffer_cache_collect_widths(GBufferCache *cache, size_t index, line_width
* *
******************************************************************************/
-void g_buffer_cache_draw(const GBufferCache *cache, cairo_t *cr, size_t first, size_t last, const cairo_rectangle_int_t *area, const GDisplayOptions *options, const line_width_summary *offsets, const gint *selected, const segcnt_list *list)
+void g_buffer_cache_draw(const GBufferCache *cache, cairo_t *cr, size_t first, size_t last, const cairo_rectangle_int_t *area, const GDisplayOptions *options, const gint *selected, const segcnt_list *list)
{
GBufferCacheClass *class; /* Classe des tampons */
gint y; /* Point de départ en ordonnée */
bool wait_selection; /* Sélection déjà passée ? */
size_t i; /* Boucle de parcours */
cache_info *info; /* Accès direct à une ligne */
- line_width_summary summary; /* Résumé concis des largeurs */
GBufferLine *line; /* Ligne à venir dessiner */
class = G_BUFFER_CACHE_GET_CLASS(cache);
@@ -1484,12 +1482,9 @@ void g_buffer_cache_draw(const GBufferCache *cache, cairo_t *cr, size_t first, s
info = &cache->lines[i];
- if (i == first || (g_buffer_cache_get_line_flags(cache, i) & BLF_WIDTH_MANAGER))
- g_width_tracker_get_local_width_summary(cache->tracker, i, &summary);
-
line = get_cache_info_line(info, i, cache->content);
- g_buffer_line_draw(line, cr, &summary, class->text_pos, y, options, offsets, list);
+ g_buffer_line_draw(line, i, cr, class->text_pos, y, cache->tracker, options, list);
g_object_unref(G_OBJECT(line));