aboutsummaryrefslogtreecommitdiff
path: root/src/narrative_window.c
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2016-04-16 19:04:33 +0200
committerThomas White <taw@bitwiz.org.uk>2016-04-19 22:53:40 +0200
commit1f305d199195d5e27e0731917399dca7de3e75cd (patch)
treea8f1c5401367134ee9877327f63e9153c1416e4d /src/narrative_window.c
parent890e5ac7b89f5cccf120d966dc488f9ddd516a3d (diff)
WIP on slide adding
Diffstat (limited to 'src/narrative_window.c')
-rw-r--r--src/narrative_window.c36
1 files changed, 16 insertions, 20 deletions
diff --git a/src/narrative_window.c b/src/narrative_window.c
index 6e09d71..bfad8b2 100644
--- a/src/narrative_window.c
+++ b/src/narrative_window.c
@@ -139,41 +139,37 @@ static void exportpdf_sig(GSimpleAction *action, GVariant *parameter,
}
-static void open_slidesorter_sig(GSimpleAction *action, GVariant *parameter, gpointer vp)
+static void open_slidesorter_sig(GSimpleAction *action, GVariant *parameter,
+ gpointer vp)
{
}
-static void delete_frame_sig(GSimpleAction *action, GVariant *parameter, gpointer vp)
+static void delete_frame_sig(GSimpleAction *action, GVariant *parameter,
+ gpointer vp)
{
}
-static void add_slide_sig(GSimpleAction *action, GVariant *parameter, gpointer vp)
+static void add_slide_sig(GSimpleAction *action, GVariant *parameter,
+ gpointer vp)
{
int n_slides;
SCBlock *block;
SCBlock *nsblock;
NarrativeWindow *nw = vp;
- /* Link it into the SC structure */
+ /* Create the SCBlock for the new slide */
nsblock = sc_parse("\\slide{}");
- insert_scblock(nsblock, nw->sceditor);
-
- /* Iterate over blocks of presentation, counting \slides, until
- * we reach the block we just added */
- block = nw->p->scblocks;
- n_slides = 0;
- while ( block != NULL ) {
- const char *n = sc_block_name(block);
- if ( n == NULL ) goto next;
- if ( strcmp(n, "slide") == 0 ) {
- if ( block == nsblock ) break;
- n_slides++;
- }
-next:
- block = sc_block_next(block);
- }
+
+ /* Split the current paragraph */
+ split_paragraph_at_cursor(nw->sceditor);
+
+ /* Link the new SCBlock in */
+
+ /* Create a new paragraph for the slide */
+
+ sc_editor_redraw(nw->sceditor);
}