diff options
author | Thomas White <taw@physics.org> | 2019-10-02 18:41:13 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2019-10-05 17:03:43 +0200 |
commit | 8e7ee1c1c1e4aedd0b2720ce9bb1cc199bcd8678 (patch) | |
tree | 1175488ffae15320028ec9a1d030509470c66412 /libstorycode/gtk | |
parent | 0667ba5a597f5b94c68f414909453648eab2835c (diff) |
Get slide out of parser context
Diffstat (limited to 'libstorycode/gtk')
-rw-r--r-- | libstorycode/gtk/gtkslideview.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libstorycode/gtk/gtkslideview.c b/libstorycode/gtk/gtkslideview.c index 339723f..6cf0ec5 100644 --- a/libstorycode/gtk/gtkslideview.c +++ b/libstorycode/gtk/gtkslideview.c @@ -827,19 +827,23 @@ static SlideItem *create_image(GtkSlideView *e, const char *filename, double cx, double cy, double w, double h) { struct frame_geom geom; + SlideItem *item; char *fn = strdup(filename); if ( fn == NULL ) return NULL; geom.x.len = cx; geom.x.unit = LENGTH_UNIT; geom.y.len = cy; geom.y.unit = LENGTH_UNIT; geom.w.len = w; geom.w.unit = LENGTH_UNIT; geom.h.len = h; geom.h.unit = LENGTH_UNIT; - return slide_add_image(e->slide, fn, geom); + item = slide_item_image(fn, geom); + slide_add_item(e->slide, item); + return item; } static SlideItem *create_frame(GtkSlideView *e, double cx, double cy, double w, double h) { + SlideItem *item; struct frame_geom geom; struct text_run *runs; int nruns = 1; @@ -865,7 +869,9 @@ static SlideItem *create_frame(GtkSlideView *e, double cx, double cy, geom.y.len = cy; geom.y.unit = LENGTH_UNIT; geom.w.len = w; geom.w.unit = LENGTH_UNIT; geom.h.len = h; geom.h.unit = LENGTH_UNIT; - return slide_add_text(e->slide, &runs, &nruns, 1, geom, ALIGN_INHERIT); + item = slide_item_text(&runs, &nruns, 1, geom, ALIGN_INHERIT); + slide_add_item(e->slide, item); + return item; } |