aboutsummaryrefslogtreecommitdiff
path: root/libstorycode/narrative.c
diff options
context:
space:
mode:
Diffstat (limited to 'libstorycode/narrative.c')
-rw-r--r--libstorycode/narrative.c34
1 files changed, 32 insertions, 2 deletions
diff --git a/libstorycode/narrative.c b/libstorycode/narrative.c
index f61e0f8..25c01c5 100644
--- a/libstorycode/narrative.c
+++ b/libstorycode/narrative.c
@@ -186,8 +186,15 @@ int narrative_get_unsaved(Narrative *n)
int narrative_item_is_text(Narrative *n, int item)
{
- if ( n->items[item].type == NARRATIVE_ITEM_SLIDE ) return 0;
- if ( n->items[item].type == NARRATIVE_ITEM_EOP ) return 0;
+ switch ( n->items[item].type ) {
+ case NARRATIVE_ITEM_SLIDE : return 0;
+ case NARRATIVE_ITEM_EOP : return 0;
+ case NARRATIVE_ITEM_TEXT : return 1;
+ case NARRATIVE_ITEM_BP : return 1;
+ case NARRATIVE_ITEM_PRESTITLE : return 1;
+ case NARRATIVE_ITEM_SEGSTART : return 1;
+ case NARRATIVE_ITEM_SEGEND : return 0;
+ }
return 1;
}
@@ -292,6 +299,20 @@ void narrative_add_bp(Narrative *n, struct text_run *runs, int n_runs)
}
+void narrative_add_segstart(Narrative *n, struct text_run *runs, int n_runs)
+{
+ add_text_item(n, runs, n_runs, NARRATIVE_ITEM_SEGSTART);
+}
+
+
+void narrative_add_segend(Narrative *n)
+{
+ struct narrative_item * item = add_item(n);
+ if ( item == NULL ) return;
+ item->type = NARRATIVE_ITEM_SEGEND;
+}
+
+
void narrative_add_slide(Narrative *n, Slide *slide)
{
struct narrative_item *item;
@@ -754,6 +775,15 @@ void narrative_debug(Narrative *n)
printf("(EOP marker)\n");
break;
+ case NARRATIVE_ITEM_SEGSTART :
+ printf("(start of segment):\n");
+ debug_runs(item);
+ break;
+
+ case NARRATIVE_ITEM_SEGEND :
+ printf("(end of segment)\n");
+ break;
+
case NARRATIVE_ITEM_SLIDE :
printf("Slide:\n");
describe_slide(item->slide);