summaryrefslogtreecommitdiff
path: root/src/glibext/gcodebuffer.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2010-07-17 13:17:19 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2010-07-17 13:17:19 (GMT)
commitbd8c461d2dcdc14fd9b2969cc832c33792fd38cd (patch)
treeccc33b2a3422d8fcb076f80f5162163226c184d8 /src/glibext/gcodebuffer.c
parent7b2a41d975056cec78f89a6892619cccbfe389d7 (diff)
Restored the breakpoints in the GUI.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@173 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/glibext/gcodebuffer.c')
-rw-r--r--src/glibext/gcodebuffer.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/glibext/gcodebuffer.c b/src/glibext/gcodebuffer.c
index 75c2e94..3f9af35 100644
--- a/src/glibext/gcodebuffer.c
+++ b/src/glibext/gcodebuffer.c
@@ -483,3 +483,30 @@ void g_buffer_view_draw(const GBufferView *view, const GdkEventExpose *event, Gd
}
}
+
+
+/******************************************************************************
+* *
+* Paramètres : view = visualisation à consulter. *
+* y = ordonnée comprise dans la ligne recherchée. *
+* *
+* Description : Fournit la ligne présente à une ordonnée donnée. *
+* *
+* Retour : Ligne retrouvée ou NULL si aucune. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+GBufferLine *g_buffer_view_find_line_at(GBufferView *view, gint y)
+{
+ gint lheight; /* Hauteur d'une ligne */
+ size_t index; /* Indice attendu */
+
+ lheight = g_buffer_view_get_line_height(view);
+ index = y / lheight;
+
+ /* FIXME : à placer côté tampon ? */
+ return (index < view->buffer->used ? view->buffer->lines[index] : NULL);
+
+}