diff options
author | Thomas White <taw@bitwiz.org.uk> | 2012-09-11 20:02:46 +0200 |
---|---|---|
committer | Thomas White <taw@bitwiz.org.uk> | 2012-09-11 20:02:46 +0200 |
commit | d52c17c36ada874e6a0702808577a603331af095 (patch) | |
tree | 5691301f8c49b5216fb525daceea93059495977b /src/stylesheet.c | |
parent | b254880cc2f1ebad293c9396e71e1158a5d86ee2 (diff) |
Put styles in submenus
Diffstat (limited to 'src/stylesheet.c')
-rw-r--r-- | src/stylesheet.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/stylesheet.c b/src/stylesheet.c index 8852b3e..0f49d26 100644 --- a/src/stylesheet.c +++ b/src/stylesheet.c @@ -347,3 +347,36 @@ struct style *style_next(StyleSheet *ss, StyleIterator *iter) return ss->styles[iter->n]; } + + +struct _templateiterator +{ + int n; +}; + +struct slide_template *template_first(StyleSheet *ss, TemplateIterator **piter) +{ + TemplateIterator *iter; + + if ( ss->n_templates == 0 ) return NULL; + + iter = calloc(1, sizeof(TemplateIterator)); + if ( iter == NULL ) return NULL; + + iter->n = 0; + *piter = iter; + + return ss->templates[0]; +} + + +struct slide_template *template_next(StyleSheet *ss, TemplateIterator *iter) +{ + iter->n++; + if ( iter->n == ss->n_templates ) { + free(iter); + return NULL; + } + + return ss->templates[iter->n]; +} |