aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2015-10-19 20:16:46 +0100
committerThomas White <taw@bitwiz.org.uk>2015-10-19 20:16:46 +0100
commitd2d1cee6c1ba37cead7576f1e6bd721d54f7f210 (patch)
tree7e3ce9efdb17dd3c6c5feba5234ef8966cdd3661
parent054ad480afb29ca166979337b266c9c64a666e6a (diff)
Add total_height()
-rw-r--r--src/wrap.c15
-rw-r--r--src/wrap.h1
2 files changed, 16 insertions, 0 deletions
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; i<fr->n_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 */