aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/wrap.c19
-rw-r--r--src/wrap.h1
2 files changed, 20 insertions, 0 deletions
diff --git a/src/wrap.c b/src/wrap.c
index cfbc2ce..ec3d483 100644
--- a/src/wrap.c
+++ b/src/wrap.c
@@ -1067,6 +1067,25 @@ static struct wrap_line *split_paragraph(struct wrap_line *boxes, int *n)
}
+void show_boxes(struct wrap_line *boxes)
+{
+ int i;
+
+ if ( boxes == NULL ) {
+ printf("Empty line.\n");
+ return;
+ }
+
+ for ( i=0; i<boxes->n_boxes; i++ ) {
+ printf("%3i", i);
+ printf(" '%s'", boxes->boxes[i].text);
+ printf(" t=%i s=%i %i %5.2f\n",
+ boxes->boxes[i].type, boxes->boxes[i].space,
+ boxes->boxes[i].width, boxes->boxes[i].sp);
+ }
+}
+
+
/* Wrap the StoryCode inside "fr->sc" so that it fits within width "fr->w",
* and generate fr->lines */
int wrap_contents(struct frame *fr, PangoContext *pc)
diff --git a/src/wrap.h b/src/wrap.h
index a8f9593..603d2e6 100644
--- a/src/wrap.h
+++ b/src/wrap.h
@@ -104,5 +104,6 @@ extern void get_cursor_pos(struct frame *fr, size_t pos,
extern void wrap_line_free(struct wrap_line *l);
+extern void show_boxes(struct wrap_line *boxes);
#endif /* WRAP_H */