summaryrefslogtreecommitdiff
path: root/src/glibext
diff options
context:
space:
mode:
Diffstat (limited to 'src/glibext')
-rw-r--r--src/glibext/gbinportion.c4
-rw-r--r--src/glibext/gbuffercache.c5
-rw-r--r--src/glibext/gbuffercache.h2
-rw-r--r--src/glibext/gbufferline.c13
-rw-r--r--src/glibext/gbufferline.h6
-rw-r--r--src/glibext/gbufferview.c5
-rw-r--r--src/glibext/gbufferview.h2
-rw-r--r--src/glibext/generators/rborder.c4
8 files changed, 20 insertions, 21 deletions
diff --git a/src/glibext/gbinportion.c b/src/glibext/gbinportion.c
index 2ffe253..8247910 100644
--- a/src/glibext/gbinportion.c
+++ b/src/glibext/gbinportion.c
@@ -1138,9 +1138,9 @@ static void g_binary_portion_print(GBinPortion *portion, GBufferLine *line, size
if (portion->text[repeat] != NULL)
{
- g_buffer_line_start_merge_at(line, BLC_ASSEMBLY_HEAD);
+ g_buffer_line_start_merge_at(line, BLC_ASSEMBLY_LABEL);
- g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, SL(portion->text[repeat]), RTT_COMMENT, NULL);
+ g_buffer_line_append_text(line, BLC_ASSEMBLY_LABEL, SL(portion->text[repeat]), RTT_COMMENT, NULL);
}
diff --git a/src/glibext/gbuffercache.c b/src/glibext/gbuffercache.c
index 866d696..e4ddf06 100644
--- a/src/glibext/gbuffercache.c
+++ b/src/glibext/gbuffercache.c
@@ -1466,6 +1466,7 @@ 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. *
* *
@@ -1477,7 +1478,7 @@ 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 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 line_width_summary *offsets, const gint *selected, const segcnt_list *list)
{
GBufferCacheClass *class; /* Classe des tampons */
gint y; /* Point de départ en ordonnée */
@@ -1515,7 +1516,7 @@ void g_buffer_cache_draw(const GBufferCache *cache, cairo_t *cr, size_t first, s
line = get_cache_info_line(info, i, cache->content);
- g_buffer_line_draw(line, cr, &summary, class->text_pos, y, options, list);
+ g_buffer_line_draw(line, cr, &summary, class->text_pos, y, options, offsets, list);
g_object_unref(G_OBJECT(line));
diff --git a/src/glibext/gbuffercache.h b/src/glibext/gbuffercache.h
index 077c5f9..8059357 100644
--- a/src/glibext/gbuffercache.h
+++ b/src/glibext/gbuffercache.h
@@ -106,7 +106,7 @@ GBufferLine *g_buffer_cache_find_line_by_index(const GBufferCache *, size_t);
void g_buffer_cache_collect_widths(GBufferCache *, size_t, line_width_summary *);
/* Imprime une partie choisie du tampon contenant des lignes. */
-void g_buffer_cache_draw(const GBufferCache *, cairo_t *, size_t, size_t, const cairo_rectangle_int_t *, const GDisplayOptions *, const gint *, const segcnt_list *);
+void g_buffer_cache_draw(const GBufferCache *, cairo_t *, size_t, size_t, const cairo_rectangle_int_t *, const GDisplayOptions *, const line_width_summary *, const gint *, const segcnt_list *);
/* Indique l'indice correspondant à une adresse donnée. */
size_t _g_buffer_cache_find_index_by_cursor(const GBufferCache *, const GLineCursor *, bool, size_t, size_t);
diff --git a/src/glibext/gbufferline.c b/src/glibext/gbufferline.c
index 39ef0ce..af27426 100644
--- a/src/glibext/gbufferline.c
+++ b/src/glibext/gbufferline.c
@@ -959,13 +959,6 @@ void g_buffer_line_collect_widths(GBufferLine *line, line_width_summary *summary
{
width = get_column_width(&line->columns[i]);
-
- /*
- if (i == BLC_ASSEMBLY_HEAD)
- assert(width > 0);
- */
-
-
if (i < line->merge_start)
summary->max_widths[i] = MAX(summary->max_widths[i], width);
@@ -1484,6 +1477,7 @@ bool g_buffer_line_find_near_coord(const GBufferLine *line, col_coord_t *coord,
* x_init = abscisse du point d'impression de départ. *
* y = ordonnée du point d'impression. *
* options = règles d'affichage des colonnes modulables. *
+* offsets = décalages supplémentaires à appliquer. *
* list = liste de contenus à mettre en évidence. *
* *
* Description : Imprime la ligne de texte représentée. *
@@ -1494,7 +1488,7 @@ bool g_buffer_line_find_near_coord(const GBufferLine *line, col_coord_t *coord,
* *
******************************************************************************/
-void g_buffer_line_draw(GBufferLine *line, cairo_t *cairo, const line_width_summary *summary, gint x_init, gint y, const GDisplayOptions *options, const segcnt_list *list)
+void g_buffer_line_draw(GBufferLine *line, cairo_t *cairo, const line_width_summary *summary, gint x_init, gint y, const GDisplayOptions *options, const line_width_summary *offsets, const segcnt_list *list)
{
GBufferLineClass *class; /* Stockage de briques de base */
bool has_src_surface; /* Note une présence définie */
@@ -1543,6 +1537,9 @@ void g_buffer_line_draw(GBufferLine *line, cairo_t *cairo, const line_width_summ
{
max_width = g_buffer_line_compute_max_width(line, i, summary);
+ if (max_width == 0)
+ max_width = offsets->max_widths[i];
+
if (max_width > 0)
x += max_width + COL_MARGIN;
diff --git a/src/glibext/gbufferline.h b/src/glibext/gbufferline.h
index 21b3ec9..3fb21fc 100644
--- a/src/glibext/gbufferline.h
+++ b/src/glibext/gbufferline.h
@@ -44,7 +44,6 @@
#define G_BUFFER_LINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_BUFFER_LINE, GBufferLineClass))
-
/* Représentation de fragments de texte en ligne (instance) */
typedef struct _GBufferLine GBufferLine;
@@ -58,6 +57,7 @@ typedef enum _BufferLineColumn
BLC_PHYSICAL, /* Position physique */
BLC_VIRTUAL, /* Adresse virtuelle */
BLC_BINARY, /* Contenu sous forme binaire */
+ BLC_ASSEMBLY_LABEL, /* Etiquette dans les données */
BLC_ASSEMBLY_HEAD, /* Instruction pour assembleur */
BLC_ASSEMBLY, /* Code pour assembleur */
BLC_COMMENTS, /* Commentaires éventuels */
@@ -74,7 +74,7 @@ typedef enum _BufferLineColumn
#define BLC_FIRST BLC_PHYSICAL
/* Première colonne toujours affichée */
-#define BLC_DISPLAY BLC_ASSEMBLY_HEAD
+#define BLC_DISPLAY BLC_ASSEMBLY_LABEL
/* Confort pour l'insertion de texte */
@@ -211,7 +211,7 @@ GObject *g_buffer_line_get_creator_at(const GBufferLine *, const line_width_summ
bool g_buffer_line_find_near_coord(const GBufferLine *, col_coord_t *, const line_width_summary *, const GDisplayOptions *, GdkScrollDirection, gint *);
/* Imprime la ligne de texte représentée. */
-void g_buffer_line_draw(GBufferLine *, cairo_t *, const line_width_summary *, gint, gint, const GDisplayOptions *, const segcnt_list *);
+void g_buffer_line_draw(GBufferLine *, cairo_t *, const line_width_summary *, gint, gint, const GDisplayOptions *, const line_width_summary *, const segcnt_list *);
diff --git a/src/glibext/gbufferview.c b/src/glibext/gbufferview.c
index f3b0147..79a475e 100644
--- a/src/glibext/gbufferview.c
+++ b/src/glibext/gbufferview.c
@@ -1083,6 +1083,7 @@ bool g_buffer_view_highlight_segments(GBufferView *view, gint x, gint y, const G
* virt_y = ordonnée réelle du point 0 à l'écran. *
* 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. *
* *
* Description : Imprime la visualisation du tampon de lignes quelconques. *
@@ -1093,7 +1094,7 @@ bool g_buffer_view_highlight_segments(GBufferView *view, gint x, gint y, const G
* *
******************************************************************************/
-void g_buffer_view_draw(const GBufferView *view, cairo_t *cr, gint virt_y, const cairo_rectangle_int_t *area, const GDisplayOptions *options, gint *selected)
+void g_buffer_view_draw(const GBufferView *view, cairo_t *cr, gint virt_y, const cairo_rectangle_int_t *area, const GDisplayOptions *options, const line_width_summary *offsets, gint *selected)
{
gint line_height; /* Hauteur d'une ligne */
gint cr_y; /* Ordonnée pour le dessin */
@@ -1128,7 +1129,7 @@ void g_buffer_view_draw(const GBufferView *view, cairo_t *cr, gint virt_y, const
if (selected != NULL)
*selected -= cr_y;
- g_buffer_cache_draw(view->cache, cr, first, last, area, options, selected, view->highlighted);
+ g_buffer_cache_draw(view->cache, cr, first, last, area, options, offsets, selected, view->highlighted);
}
diff --git a/src/glibext/gbufferview.h b/src/glibext/gbufferview.h
index 04e4bbb..2a678f6 100644
--- a/src/glibext/gbufferview.h
+++ b/src/glibext/gbufferview.h
@@ -98,7 +98,7 @@ bool g_buffer_view_unhighlight_segments(GBufferView *);
bool g_buffer_view_highlight_segments(GBufferView *, gint, gint, const GDisplayOptions *);
/* Imprime la visualisation du tampon de lignes quelconques. */
-void g_buffer_view_draw(const GBufferView *, cairo_t *, gint, const cairo_rectangle_int_t *, const GDisplayOptions *, gint *);
+void g_buffer_view_draw(const GBufferView *, cairo_t *, gint, const cairo_rectangle_int_t *, const GDisplayOptions *, const line_width_summary *, gint *);
diff --git a/src/glibext/generators/rborder.c b/src/glibext/generators/rborder.c
index 62c374d..640fa2d 100644
--- a/src/glibext/generators/rborder.c
+++ b/src/glibext/generators/rborder.c
@@ -364,8 +364,8 @@ static void g_border_generator_print(GBorderGenerator *generator, GBufferLine *l
text = strdup(generator->start ? ROUTINE_INTRO_MSG : ROUTINE_OUTRO_MSG);
g_coding_language_encapsulate_comment(generator->lang, &text);
- g_buffer_line_start_merge_at(line, BLC_ASSEMBLY_HEAD);
- g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, SL(text), RTT_COMMENT, NULL);
+ g_buffer_line_start_merge_at(line, BLC_ASSEMBLY_LABEL);
+ g_buffer_line_append_text(line, BLC_ASSEMBLY_LABEL, SL(text), RTT_COMMENT, NULL);
free(text);