diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2015-06-14 22:55:24 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2015-06-14 22:55:24 (GMT) |
commit | c987ca944052019957d3f31d69c679ed5ad994f2 (patch) | |
tree | 44f9c7a7f94925814ebebce50388935c83b34e88 /src/glibext | |
parent | c1b22ec0aa497a212ef897f3f8fffedf07cd45a6 (diff) |
Been able to move the caret when scrolling to a given address.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@541 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/glibext')
-rw-r--r-- | src/glibext/gcodebuffer.c | 35 | ||||
-rw-r--r-- | src/glibext/gcodebuffer.h | 3 |
2 files changed, 38 insertions, 0 deletions
diff --git a/src/glibext/gcodebuffer.c b/src/glibext/gcodebuffer.c index 9b13875..a27b202 100644 --- a/src/glibext/gcodebuffer.c +++ b/src/glibext/gcodebuffer.c @@ -1313,6 +1313,41 @@ gint g_buffer_view_get_width(GBufferView *view, const bool *display) } +/****************************************************************************** +* * +* Paramètres : view = visualisation à consulter. * +* display = règles d'affichage des colonnes modulables. * +* * +* Description : Fournit la largeur requise pour dépasser les marges gauches. * +* * +* Retour : Dimension calculée. * +* * +* Remarques : - * +* * +******************************************************************************/ + +gint g_buffer_view_get_margin(GBufferView *view, const bool *display) +{ + gint result; /* Taille à retourner */ + BufferLineColumn i; /* Boucle de parcours */ + + if (!WIDTHS_CACHED(view)) + g_buffer_view_compute_required_widths(view, display); + + result = view->left_text; + + for (i = 0; i < BLC_DISPLAY; i++) + { + if (!display[i]) continue; + + result += view->max_widths[i] + COL_MARGIN; + + } + + return result; + +} + /****************************************************************************** * * diff --git a/src/glibext/gcodebuffer.h b/src/glibext/gcodebuffer.h index 52c74ed..5cde79c 100644 --- a/src/glibext/gcodebuffer.h +++ b/src/glibext/gcodebuffer.h @@ -128,6 +128,9 @@ gint g_buffer_view_get_line_height(GBufferView *); /* Fournit la largeur requise par une visualisation. */ gint g_buffer_view_get_width(GBufferView *, const bool *); +/* Fournit la largeur requise pour dépasser les marges gauches. */ +gint g_buffer_view_get_margin(GBufferView *, const bool *); + /* Fournit la hauteur requise par une visualisation. */ gint g_buffer_view_get_height(const GBufferView *); |