aboutsummaryrefslogtreecommitdiff
path: root/src/sc_interp.c
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2016-11-18 10:56:50 +0100
committerThomas White <taw@bitwiz.org.uk>2016-11-18 10:56:50 +0100
commita7de2d4816b4ae4727d53f0650d67afbafb01225 (patch)
treea9fee919eeabfbdba7d3ef076ebe688404e8175f /src/sc_interp.c
parent03a3f56bebae2902b63c90223a096d01d3224163 (diff)
Use slide template for new slides
Diffstat (limited to 'src/sc_interp.c')
-rw-r--r--src/sc_interp.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/sc_interp.c b/src/sc_interp.c
index 2b9f294..86617de 100644
--- a/src/sc_interp.c
+++ b/src/sc_interp.c
@@ -606,6 +606,8 @@ SCInterpreter *sc_interp_new(PangoContext *pc, PangoLanguage *lang,
void sc_interp_destroy(SCInterpreter *scin)
{
+ /* FIXME: Free all templates and macros */
+
/* Empty the stack */
while ( scin->j > 0 ) {
sc_interp_restore(scin);
@@ -1326,19 +1328,20 @@ void find_stylesheet(struct presentation *p)
}
-struct style_id *list_styles(SCInterpreter *scin, int *np)
+struct template_id *sc_interp_get_templates(SCInterpreter *scin, int *np)
{
- struct style_id *list;
+ struct template_id *list;
int i;
- list = malloc(sizeof(struct style_id)*scin->state->n_macros);
+ list = malloc(sizeof(struct template_id)*scin->state->n_templates);
if ( list == NULL ) return NULL;
- for ( i=0; i<scin->state->n_macros; i++ ) {
- list[i].name = strdup(scin->state->macros[i].name);
- list[i].friendlyname = strdup(scin->state->macros[i].name);
+ for ( i=0; i<scin->state->n_templates; i++ ) {
+ list[i].name = strdup(scin->state->templates[i].name);
+ list[i].friendlyname = strdup(scin->state->templates[i].name);
+ list[i].scblock = sc_block_copy(scin->state->templates[i].bl);
}
- *np = scin->state->n_macros;
+ *np = scin->state->n_templates;
return list;
}