From d2d1cee6c1ba37cead7576f1e6bd721d54f7f210 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Mon, 19 Oct 2015 20:16:46 +0100 Subject: Add total_height() --- src/wrap.c | 15 +++++++++++++++ src/wrap.h | 1 + 2 files changed, 16 insertions(+) diff --git a/src/wrap.c b/src/wrap.c index a71434e..5d5847a 100644 --- a/src/wrap.c +++ b/src/wrap.c @@ -1023,3 +1023,18 @@ int wrap_contents(struct frame *fr) return 0; } + + +double total_height(struct frame *fr) +{ + int i; + double tot = 0.0; + + if ( fr == NULL ) return 0.0; + + for ( i=0; in_lines; i++ ) { + tot += fr->lines[i].height; + } + + return pango_units_to_double(tot); +} diff --git a/src/wrap.h b/src/wrap.h index d95c9e2..a6503e1 100644 --- a/src/wrap.h +++ b/src/wrap.h @@ -121,5 +121,6 @@ extern void initialise_line(struct wrap_line *l); extern void wrap_line_free(struct wrap_line *l); extern void show_boxes(struct wrap_line *boxes); +extern double total_height(struct frame *fr); #endif /* WRAP_H */ -- cgit v1.2.3