summaryrefslogtreecommitdiff
path: root/src/glibext
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2015-04-22 00:11:29 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2015-04-22 00:11:29 (GMT)
commit6cbb81bc46347ce969f5bf24a73f08abd009b82b (patch)
treecb2f8c46f5425a2348520bf78c501ef34902a14c /src/glibext
parentea40f74566cd813722f49ae740ca3df04e522bb2 (diff)
Allowed to refer to an external list for highlighted segments.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@515 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/glibext')
-rw-r--r--src/glibext/gcodebuffer.c15
-rw-r--r--src/glibext/gcodebuffer.h2
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 *);