diff options
Diffstat (limited to 'src/glibext')
-rw-r--r-- | src/glibext/gcodebuffer.c | 15 | ||||
-rw-r--r-- | src/glibext/gcodebuffer.h | 2 |
2 files changed, 12 insertions, 5 deletions
diff --git a/src/glibext/gcodebuffer.c b/src/glibext/gcodebuffer.c index a7e522c..8633461 100644 --- a/src/glibext/gcodebuffer.c +++ b/src/glibext/gcodebuffer.c @@ -156,6 +156,7 @@ struct _GBufferView BufferLineColumn last_merge; /* Colonne de fusion extrême */ segcnt_list *highlighted; /* Segments mis en évidence */ + bool external; /* Note l'origine de la liste */ }; @@ -917,8 +918,6 @@ static void g_buffer_view_init(GBufferView *buffer) g_buffer_view_reset_required_height(buffer); g_buffer_view_reset_required_widths(buffer); - buffer->highlighted = init_segment_content_list(); - } @@ -955,7 +954,8 @@ static void g_buffer_view_dispose(GBufferView *view) static void g_buffer_view_finalize(GBufferView *view) { - exit_segment_content_list(view->highlighted); + if (!view->external) + exit_segment_content_list(view->highlighted); G_OBJECT_CLASS(g_buffer_view_parent_class)->finalize(G_OBJECT(view)); @@ -975,7 +975,7 @@ static void g_buffer_view_finalize(GBufferView *view) * * ******************************************************************************/ -GBufferView *g_buffer_view_new(GCodeBuffer *buffer) +GBufferView *g_buffer_view_new(GCodeBuffer *buffer, segcnt_list *highlighted) { GBufferView *result; /* Composant à retourner */ @@ -987,6 +987,13 @@ GBufferView *g_buffer_view_new(GCodeBuffer *buffer) g_buffer_view_restrict(result, NULL, NULL); + if (highlighted != NULL) + result->highlighted = highlighted; + else + result->highlighted = init_segment_content_list(); + + result->external = (highlighted != NULL); + return result; } diff --git a/src/glibext/gcodebuffer.h b/src/glibext/gcodebuffer.h index 846da64..a248df3 100644 --- a/src/glibext/gcodebuffer.h +++ b/src/glibext/gcodebuffer.h @@ -108,7 +108,7 @@ typedef struct _GBufferViewClass GBufferViewClass; GType g_buffer_view_get_type(void); /* Crée une nouvelle vue d'un tampon pour code désassemblé. */ -GBufferView *g_buffer_view_new(GCodeBuffer *); +GBufferView *g_buffer_view_new(GCodeBuffer *, segcnt_list *); /* Restreint le champ d'application de l'affichage. */ void g_buffer_view_restrict(GBufferView *, const vmpa2t *, const vmpa2t *); |