aboutsummaryrefslogtreecommitdiff
path: root/libstorycode/slide.c
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.me.uk>2019-03-17 17:46:42 +0100
committerThomas White <taw@bitwiz.me.uk>2019-03-18 08:15:48 +0100
commit59284281f6440dab5e8d0be4b67aac2970d05652 (patch)
tree3badea7c706c08b4bb13ae8a76fd14091c593217 /libstorycode/slide.c
parent0e1f2f49f4d3b02901c8ba291a8ffb2605418db4 (diff)
Initial slide clicky stuff
Diffstat (limited to 'libstorycode/slide.c')
-rw-r--r--libstorycode/slide.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/libstorycode/slide.c b/libstorycode/slide.c
index eaf5f4e..f24e713 100644
--- a/libstorycode/slide.c
+++ b/libstorycode/slide.c
@@ -55,10 +55,16 @@ void slide_free(Slide *s)
static struct slide_item *add_item(Slide *s)
{
struct slide_item *new_items;
+ struct slide_item *item;
+
new_items = realloc(s->items, (s->n_items+1)*sizeof(struct slide_item));
if ( new_items == NULL ) return NULL;
s->items = new_items;
- return &s->items[s->n_items++];
+ item = &s->items[s->n_items++];
+
+ item->layouts = NULL;
+
+ return item;
}
@@ -72,6 +78,7 @@ int slide_add_image(Slide *s, char *filename, struct frame_geom geom)
item->type = SLIDE_ITEM_IMAGE;
item->geom = geom;
item->filename = filename;
+ item->resizable = 1;
return 0;
}
@@ -103,6 +110,12 @@ int add_text_item(Slide *s, char **text, int n_text, struct frame_geom geom,
item->geom = geom;
item->align = alignment;
+ if ( slide_item == SLIDE_ITEM_TEXT ) {
+ item->resizable = 1;
+ } else {
+ item->resizable = 0;
+ }
+
return 0;
}