diff options
author | Thomas White <taw@bitwiz.org.uk> | 2015-12-21 15:54:51 +0100 |
---|---|---|
committer | Thomas White <taw@bitwiz.org.uk> | 2015-12-21 15:54:51 +0100 |
commit | 79f3fdbb0b6e379c90eb3783d200e6d4249f4a3b (patch) | |
tree | 6039af892c014fa46334c23a0031659746b5bddd /src/wrap.h | |
parent | 3cbb8d0124e839136795ae8dcf475a5fbe86c093 (diff) |
Multiple segments in a box
Diffstat (limited to 'src/wrap.h')
-rw-r--r-- | src/wrap.h | 21 |
1 files changed, 19 insertions, 2 deletions
@@ -55,6 +55,22 @@ enum wrap_box_space }; +struct text_seg +{ + PangoGlyphString *glyphs; + PangoAnalysis analysis; + + /* Offset of this text segment into the wrap box */ + int offs_char; + int len_chars; + + /* Pango units */ + int width; + int height; + int ascent; +}; + + /* A wrap box is a run of content - could be text, an image or so one - that is * one logical unit as far as Colloquium is concerned. It might consist of * multiple units, for example, in Pango's mind. */ @@ -76,11 +92,11 @@ struct wrap_box double sp; /* Calculated space (Pango units) after box */ /* For type == WRAP_BOX_PANGO */ - PangoGlyphString *glyphs; PangoFont *font; double col[4]; /* rgba colour */ - PangoAnalysis analysis; int len_chars; + int n_segs; + struct text_seg *segs; /* For type == WRAP_BOX_IMAGE */ char *filename; @@ -124,5 +140,6 @@ extern void show_boxes(struct wrap_line *boxes); extern double total_height(struct frame *fr); extern int insert_box(struct wrap_line *l, int pos); +extern int which_segment(struct wrap_box *box, int pos, int *err); #endif /* WRAP_H */ |