aboutsummaryrefslogtreecommitdiff
path: root/src/wrap.c
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2015-11-26 09:55:46 +0100
committerThomas White <taw@bitwiz.org.uk>2015-11-26 09:55:46 +0100
commit3cbb8d0124e839136795ae8dcf475a5fbe86c093 (patch)
treeb3ddeed8d286b0b986338e29850c040a23ca1216 /src/wrap.c
parent81100c4e659c6b11f2e36f48a171325ddff76676 (diff)
WIP
Diffstat (limited to 'src/wrap.c')
-rw-r--r--src/wrap.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/wrap.c b/src/wrap.c
index 5d5847a..f06babc 100644
--- a/src/wrap.c
+++ b/src/wrap.c
@@ -1038,3 +1038,24 @@ double total_height(struct frame *fr)
return pango_units_to_double(tot);
}
+
+
+/* Insert a new box, which will be at position 'pos' */
+int insert_box(struct wrap_line *l, int pos)
+{
+ int i;
+
+ if ( l->n_boxes == l->max_boxes ) {
+ l->max_boxes += 32;
+ if ( alloc_boxes(l) ) return 1;
+ }
+
+ /* Shuffle the boxes along */
+ for ( i=l->n_boxes; i>pos+1; i-- ) {
+ l->boxes[i] = l->boxes[i-1];
+ }
+
+ l->n_boxes++;
+
+ return 0;
+}