diff --git a/README.md b/README.md
index 030b371e4..6743bb4d4 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# Inform 7
-v10.1.0-alpha.1+6S28 'Krypton' (1 June 2021)
+v10.1.0-alpha.1+6S29 'Krypton' (2 June 2021)
## About Inform 7
diff --git a/build.txt b/build.txt
index 721254e4c..623cc558e 100644
--- a/build.txt
+++ b/build.txt
@@ -1,3 +1,3 @@
Prerelease: alpha.1
-Build Date: 1 June 2021
-Build Number: 6S28
+Build Date: 2 June 2021
+Build Number: 6S29
diff --git a/docs/assertions-module/3-dbtr.html b/docs/assertions-module/3-dbtr.html
index c15c06379..efb929e64 100644
--- a/docs/assertions-module/3-dbtr.html
+++ b/docs/assertions-module/3-dbtr.html
@@ -265,7 +265,7 @@ whatever was named in column 1: see below.
Actually issue PM_TableDefiningTheImpossible problem 6.1.1 ;
return ;
}
- if ( t ) Tables::use_to_define ( t , defining_objects , V -> next );
+ if ( t ) Tables::use_to_define ( t , defining_objects , V -> next );
This code is used in §4.1 .
To manage and compile tables, which are two-dimensional arrays with associative look-up facilities provided at run-time.
-
+
-void Tables::create_table ( parse_node * PN ) {
+void Tables::create_table ( parse_node * PN ) {
wording W = Node::get_text ( PN );
int connection = TABLE_IS_NEW ;
@@ -983,7 +983,7 @@ columns and in the same order.
-parse_node * Tables::empty_cell_node ( void ) {
+parse_node * Tables::empty_cell_node ( void ) {
return Diagrams::new_PROPER_NOUN ( EMPTY_WORDING );
}
@@ -996,7 +996,7 @@ things to be defined. So we exempt it from the checking below.
-void Tables::stock_table ( table * t , int phase ) {
+void Tables::stock_table ( table * t , int phase ) {
LOGIF ( TABLES , "Stocking $B (%d cols): phase %d\n" , t , t -> no_columns , phase );
table_being_examined = t ;
int i = 0 ;
@@ -1192,7 +1192,7 @@ people — it needs to be "yourself" instead, since "player" is a variable.
-void Tables::stock_table_cell ( table * t , parse_node * cell , int row_count , int col_count ) {
+void Tables::stock_table_cell ( table * t , parse_node * cell , int row_count , int col_count ) {
current_sentence = cell ;
int topic_exception = FALSE ;
table_cell_node = cell ;
@@ -1363,7 +1363,7 @@ at a time:
-void Tables::amend_table ( table * main_table , table * amendments ) {
+void Tables::amend_table ( table * main_table , table * amendments ) {
LOGIF ( TABLES , "Amending table $B according to $B\n" , main_table , amendments );
parse_node * leftmost_amend_cell = NULL ;
int amend_row = 1 , amendment_problem_opened = FALSE ;
@@ -1580,7 +1580,7 @@ original:
-void Tables::splice_table_row ( table * table_to , table * table_from , int row_to , int row_from ) {
+void Tables::splice_table_row ( table * table_to , table * table_from , int row_to , int row_from ) {
int i ;
for ( i =0; i <table_to-> no_columns ; i ++) {
parse_node * cell_to , * cell_from ;
@@ -1597,148 +1597,11 @@ original:
}
}
-
-void Tables::index ( OUTPUT_STREAM ) {
- HTML_OPEN ( "p" );
- int m = Tables::index_tables_in ( OUT , NULL , 0 );
- HTML_CLOSE ( "p" );
- HTML_OPEN ( "p" );
- Index::extra_link ( OUT , 2 );
- if ( m > 0 ) WRITE ( "Show tables inside extensions too" );
- else WRITE ( "Show tables inside extensions (there are none in the main text)" );
- HTML_CLOSE ( "p" );
- Index::extra_div_open ( OUT , 2 , 1 , "e0e0e0" );
- inform_extension * E ; int efc = 0 ;
- LOOP_OVER ( E , inform_extension ) Tables::index_tables_in ( OUT , E , efc ++);
- Index::extra_div_close ( OUT , "e0e0e0" );
-}
-
-
-
-
-int Tables::index_tables_in ( OUTPUT_STREAM , inform_extension * E , int efc ) {
- int tc = 0 ; table * t ;
- LOOP_OVER ( t , table ) if ( Tables::table_within ( t , E )) tc ++;
- if ( tc > 0 ) {
- if ( E ) {
- HTML_OPEN ( "p" );
- WRITE ( "<i>%S</i>" , E -> as_copy -> edition -> work -> title );
- HTML_CLOSE ( "p" );
- }
- HTML::begin_plain_html_table ( OUT );
- LOOP_OVER ( t , table )
- if ( Tables::table_within ( t , E ))
- Index this table 27.1 ;
- HTML::end_html_table ( OUT );
- }
- return tc ;
-}
-
-
-
-
-
-
- HTML::first_html_column_spaced ( OUT , 0 );
- WRITE ( "<b>%+W</b>" , Node::get_text ( t -> headline_fragment ));
- table_contribution * tc ; int ntc = 0 ;
- for ( tc = t -> table_created_at ; tc ; tc = tc -> next ) {
- if ( ntc ++ > 0 ) WRITE ( " +" );
- Index::link ( OUT , Wordings::first_wn ( Node::get_text ( tc -> source_table )));
- }
- HTML::next_html_column_spaced ( OUT , 0 );
- int rc = Tables::get_no_rows ( t );
- WRITE ( "<i>" );
- HTML_OPEN_WITH ( "span" , "class=\"smaller\"" );
- if ( t -> first_column_by_definition ) {
- WRITE ( "%d definition%s" , rc ,
- ( rc == 1 )? "" : "s" );
- } else {
- WRITE ( "%d column%s x %d row%s" ,
- t -> no_columns , ( t -> no_columns == 1 )? "" : "s" ,
- rc , ( rc == 1 )? "" : "s" );
- }
- if ( t -> blank_rows > 0 ) {
- WRITE ( " (%d blank" , t -> blank_rows );
- if ( Wordings::nonempty ( t -> blank_rows_for_each_text ))
- WRITE ( ", one for each %+W" , t -> blank_rows_for_each_text );
- WRITE ( ")" );
- }
- HTML_CLOSE ( "span" );
- WRITE ( "</i>" );
- HTML::end_html_row ( OUT );
- int col ;
- for ( col = 0 ; col < t -> no_columns ; col ++) {
- HTML::first_html_column ( OUT , 0 );
- WRITE ( " col %d: " , col +1);
- wording CW = Nouns::nominative_singular ( t -> columns [ col ]. column_identity -> name );
- if (( t -> first_column_by_definition ) && ( col == 0 )) {
- parse_node * PN = t -> where_used_to_define ;
- WRITE ( "%+W" , Node::get_text ( PN ));
- Index::link ( OUT , Wordings::first_wn ( Node::get_text ( PN )));
- } else {
- if ( t -> first_column_by_definition ) WRITE ( "<i>sets</i> " );
- WRITE ( "%+W " , CW );
- TEMPORARY_TEXT ( TEMP )
- WRITE_TO ( TEMP , "%+W" , CW );
- if ( t -> first_column_by_definition == FALSE ) WRITE_TO ( TEMP , " entry" );
- PasteButtons::paste_text ( OUT , TEMP );
- DISCARD_TEXT ( TEMP )
- }
- HTML::next_html_column ( OUT , 0 );
- if (( t -> first_column_by_definition ) && ( col == 0 )) {
- parse_node * cell ;
- int row ;
- for ( row = 1 , cell = t -> columns [0]. entries -> down ; cell ; cell = cell -> next , row ++) {
- if ( row > 1 ) WRITE ( ", " );
- WRITE ( "%+W" , Node::get_text ( cell ));
- Index::link ( OUT , Wordings::first_wn ( Node::get_text ( cell )));
- }
- } else if ( t -> first_column_by_definition ) {
- Kinds::Textual::write ( OUT ,
- Tables::Columns::get_kind (
- t -> columns [ col ]. column_identity ));
- WRITE ( " property" );
- } else {
- WRITE ( "of " );
- Kinds::Textual::write_plural ( OUT ,
- Tables::Columns::get_kind (
- t -> columns [ col ]. column_identity ));
- }
- HTML::end_html_row ( OUT );
- }
-
- This code is used in §27 .
-
-
-
-int Tables::table_within ( table * t , inform_extension * E ) {
- if ( t -> amendment_of ) return FALSE ;
- heading * at_heading =
- Headings::of_wording ( Node::get_text ( t -> table_created_at -> source_table ));
- inform_extension * at_E = Headings::get_extension_containing ( at_heading );
- if ( E == at_E ) return TRUE ;
- return FALSE ;
-}
-
-
-
-
-void Tables::use_to_define ( table * t , int defining_objects , parse_node * where ) {
+void Tables::use_to_define ( table * t , int defining_objects , parse_node * where ) {
if ( t == NULL ) internal_error ( "no table" );
if ( defining_objects == FALSE ) {
t -> contains_property_values_at_run_time = TRUE ;
diff --git a/docs/assertions-module/7-tc.html b/docs/assertions-module/7-tc.html
index 9caaabb12..e238b1be7 100644
--- a/docs/assertions-module/7-tc.html
+++ b/docs/assertions-module/7-tc.html
@@ -178,7 +178,7 @@ of entry in the column \(C\).
-kind * Tables::Columns::get_kind ( table_column * tc ) {
+kind * Tables::Columns::get_kind ( table_column * tc ) {
return tc -> kind_stored_in_column ;
}
diff --git a/docs/codegen-module/6-ce.html b/docs/codegen-module/6-ce.html
index f64771256..e8ba98296 100644
--- a/docs/codegen-module/6-ce.html
+++ b/docs/codegen-module/6-ce.html
@@ -78,7 +78,7 @@ simplified form of the iFiction record, without the XML overhead.
-void CardElement::Library_Card ( OUTPUT_STREAM ) {
+void CardElement::render ( OUTPUT_STREAM ) {
inter_tree * I = Index::get_tree ();
inter_package * pack = Inter::Packages::by_url ( I , I "/main/completion/bibliographic" );
diff --git a/docs/codegen-module/6-ifs.html b/docs/codegen-module/6-ifs.html
index c40caa759..9d28706b1 100644
--- a/docs/codegen-module/6-ifs.html
+++ b/docs/codegen-module/6-ifs.html
@@ -824,10 +824,44 @@ to show, hide and colour things:
void Index::index_actual_element ( OUTPUT_STREAM , text_stream * elt ) {
if ( Str::eq_wide_string ( elt , L "Cd" )) {
- CardElement::Library_Card ( OUT );
+ CardElement::render ( OUT );
return ;
}
# ifdef CORE_MODULE
+ if ( Str::eq_wide_string ( elt , L "Tb" )) {
+ IXTables::render ( OUT );
+ return ;
+ }
+ if ( Str::eq_wide_string ( elt , L "In" )) {
+ IXInnards::render ( OUT , Supervisor::current_vm ());
+ return ;
+ }
+ if ( Str::eq_wide_string ( elt , L "Rl" )) {
+ IXRelations::render ( OUT );
+ return ;
+ }
+ if ( Str::eq_wide_string ( elt , L "Ev" )) {
+ IXEvents::render ( OUT );
+ return ;
+ }
+ if ( Str::eq_wide_string ( elt , L "RS" )) {
+ IXRulesForScenes::render ( OUT );
+ return ;
+ }
+ if ( Str::eq_wide_string ( elt , L "Pl" )) {
+ IXScenes::render ( OUT );
+ return ;
+ }
+ if ( Str::eq_wide_string ( elt , L "Bh" )) {
+ IXBehaviour::render ( OUT );
+ return ;
+ }
+ if ( Str::eq_wide_string ( elt , L "Fi" )) {
+ IXFigures::render ( OUT );
+ return ;
+ }
+
+
if ( Str::eq_wide_string ( elt , L "C" )) {
IndexHeadings::index ( OUT );
IndexExtensions::index ( OUT );
@@ -840,20 +874,6 @@ to show, hide and colour things:
Equations::index ( OUT );
return ;
}
- if ( Str::eq_wide_string ( elt , L "Fi" )) {
- IXFigures::index_all ( OUT );
- IXSounds::index_all ( OUT );
- IXExternalFiles::index_all ( OUT );
- return ;
- }
- if ( Str::eq_wide_string ( elt , L "Tb" )) {
- Tables::index ( OUT );
- return ;
- }
- if ( Str::eq_wide_string ( elt , L "In" )) {
- IXActivities::innards ( OUT , Supervisor::current_vm ());
- return ;
- }
if ( Str::eq_wide_string ( elt , L "Ph" )) {
Phrases::Index::index_page_Phrasebook ( OUT );
@@ -863,10 +883,6 @@ to show, hide and colour things:
IndexLexicon::index ( OUT );
return ;
}
- if ( Str::eq_wide_string ( elt , L "Rl" )) {
- IXRelations::index_table ( OUT );
- return ;
- }
if ( Str::eq_wide_string ( elt , L "Vb" )) {
IndexLexicon::index_verbs ( OUT );
return ;
@@ -891,22 +907,6 @@ to show, hide and colour things:
return ;
}
- if ( Str::eq_wide_string ( elt , L "Pl" )) {
- # ifdef IF_MODULE
- IXScenes::index ( OUT );
- # endif
- return ;
- }
- if ( Str::eq_wide_string ( elt , L "Ev" )) {
- IXRules::index_timed_rules ( OUT );
- return ;
- }
- if ( Str::eq_wide_string ( elt , L "RS" )) {
- # ifdef IF_MODULE
- IXScenes::index_rules ( OUT );
- # endif
- return ;
- }
if ( Str::eq_wide_string ( elt , L "St" )) {
IXRules::Rules_page ( OUT , 1 );
@@ -918,33 +918,19 @@ to show, hide and colour things:
}
if ( Str::eq_wide_string ( elt , L "A1" )) {
- # ifdef IF_MODULE
CommandsIndex::page ( OUT );
- # endif
- return ;
- }
- if ( Str::eq_wide_string ( elt , L "Bh" )) {
- # ifdef IF_MODULE
- IXActions::index_named_patterns ( OUT );
- # endif
return ;
}
if ( Str::eq_wide_string ( elt , L "Cm" )) {
- # ifdef IF_MODULE
CommandsIndex::commands ( OUT );
- # endif
return ;
}
if ( Str::eq_wide_string ( elt , L "To" )) {
- # ifdef IF_MODULE
CommandsIndex::tokens ( OUT );
- # endif
return ;
}
if ( Str::eq_wide_string ( elt , L "A2" )) {
- # ifdef IF_MODULE
CommandsIndex::alphabetical ( OUT );
- # endif
return ;
}
# endif
diff --git a/docs/index-module/1-im.html b/docs/index-module/1-im.html
index b48fd8529..cc6c59f2d 100644
--- a/docs/index-module/1-im.html
+++ b/docs/index-module/1-im.html
@@ -95,7 +95,7 @@ which use this module:
}
+
diff --git a/docs/index-module/2-act.html b/docs/index-module/2-act.html
index 1166b99df..e1081b7a0 100644
--- a/docs/index-module/2-act.html
+++ b/docs/index-module/2-act.html
@@ -72,8 +72,6 @@ function togglePopup(material_id) {
To index activities.
-
-
@@ -88,7 +86,7 @@ function togglePopup(material_id) {
struct activity_crossref * next ;
} activity_crossref ;
-The structure activity_indexing_data is private to this section. The structure activity_crossref is accessed in 2/ins, 2/rls, 3/scn, 4/em and here.
+The structure activity_indexing_data is private to this section. The structure activity_crossref is accessed in 2/ins, 2/rls, 2/te, 3/pe, 4/em and here.
@@ -133,11 +131,11 @@ function togglePopup(material_id) {
void IXActivities::index_details ( OUTPUT_STREAM , activity * av ) {
int ignore_me = 0 ;
IXRules::index_rulebook ( OUT , av -> before_rules , "before" ,
- IXRules::no_rule_context (), & ignore_me );
+ IXRules::no_rule_context (), & ignore_me );
IXRules::index_rulebook ( OUT , av -> for_rules , "for" ,
- IXRules::no_rule_context (), & ignore_me );
+ IXRules::no_rule_context (), & ignore_me );
IXRules::index_rulebook ( OUT , av -> after_rules , "after" ,
- IXRules::no_rule_context (), & ignore_me );
+ IXRules::no_rule_context (), & ignore_me );
IXActivities::index_cross_references ( OUT , av );
}
@@ -165,73 +163,8 @@ function togglePopup(material_id) {
}
}
-
-
-
-void IXActivities::innards ( OUTPUT_STREAM , target_vm * VM ) {
- IXActivities::index_VM ( OUT , VM );
- NewUseOptions::index ( OUT );
- HTML_OPEN ( "p" );
- Index::extra_link ( OUT , 3 );
- WRITE ( "See some technicalities for Inform maintainers only" );
- HTML_CLOSE ( "p" );
- Index::extra_div_open ( OUT , 3 , 2 , "e0e0e0" );
- IXActivities::show_configuration ( OUT );
- Add some paste buttons for the debugging log 3.1 ;
- Index::extra_div_close ( OUT , "e0e0e0" );
-}
-
-
-
-
-
-
- HTML_OPEN ( "p" );
- WRITE ( "Debugging log:" );
- HTML_CLOSE ( "p" );
- HTML_OPEN ( "p" );
- for ( int i =0; i < NO_DEFINED_DA_VALUES ; i ++) {
- debugging_aspect * da = &( the_debugging_aspects [ i ]);
- if ( Str::len ( da -> unhyphenated_name ) > 0 ) {
- TEMPORARY_TEXT ( is )
- WRITE_TO ( is , "Include %S in the debugging log." , da -> unhyphenated_name );
- PasteButtons::paste_text ( OUT , is );
- WRITE ( " %S" , is );
- DISCARD_TEXT ( is )
- HTML_TAG ( "br" );
- }
- }
- HTML_CLOSE ( "p" );
-
-
-
-
-
-void IXActivities::index_VM ( OUTPUT_STREAM , target_vm * VM ) {
- if ( VM == NULL ) internal_error ( "target VM not set yet" );
- Index::anchor ( OUT , I "STORYFILE" );
- HTML_OPEN ( "p" ); WRITE ( "Story file format: " );
- ExtensionIndex::plot_icon ( OUT , VM );
- TargetVMs::write ( OUT , VM );
- HTML_CLOSE ( "p" );
-}
-
-
-
-
-void IXActivities::show_configuration ( OUTPUT_STREAM ) {
- HTML_OPEN ( "p" );
- Index::anchor ( OUT , I "CONFIG" );
- WRITE ( "Inform language definition:\n" );
- PluginManager::list_plugins ( OUT , "Included" , TRUE );
- PluginManager::list_plugins ( OUT , "Excluded" , FALSE );
- HTML_CLOSE ( "p" );
-}
-
+
diff --git a/docs/index-module/2-adj.html b/docs/index-module/2-adj.html
index 1bb1749a4..82b06294c 100644
--- a/docs/index-module/2-adj.html
+++ b/docs/index-module/2-adj.html
@@ -104,7 +104,7 @@ prefaced "(of a rulebook)", "(of an activity)", and so on.
+
diff --git a/docs/index-module/2-be.html b/docs/index-module/2-be.html
new file mode 100644
index 000000000..629863e33
--- /dev/null
+++ b/docs/index-module/2-be.html
@@ -0,0 +1,104 @@
+
+
+
+ Behaviour Element
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Compiler Webs Inbuild Modules Inform7 Modules Inter Modules Services
+
+
+
+
+To index relations.
+
+
+
+
+void IXBehaviour::render ( OUTPUT_STREAM ) {
+ named_action_pattern * nap ;
+ int num_naps = NUMBER_CREATED ( named_action_pattern );
+
+ if ( num_naps == 0 ) {
+ HTML_OPEN ( "p" );
+ WRITE ( "No names for kinds of action have yet been defined." );
+ HTML_CLOSE ( "p" );
+ }
+
+ LOOP_OVER ( nap , named_action_pattern ) {
+ HTML_OPEN ( "p" ); WRITE ( "<b>%+W</b>" , Nouns::nominative_singular ( nap -> as_noun ));
+ Index::link ( OUT , Wordings::first_wn ( nap -> text_of_declaration ));
+ HTML_TAG ( "br" );
+ WRITE ( " <i>defined as any of the following acts:</i>\n" );
+ named_action_pattern_entry * nape ;
+ LOOP_OVER_LINKED_LIST ( nape , named_action_pattern_entry , nap -> patterns ) {
+ action_pattern * ap = nape -> behaviour ;
+ HTML_TAG ( "br" );
+ WRITE ( " %+W" , ap -> text_of_pattern );
+ Index::link ( OUT , Wordings::first_wn ( ap -> text_of_pattern ));
+ }
+ HTML_CLOSE ( "p" );
+ }
+}
+
+
+
+
+
+
+
+
diff --git a/docs/index-module/2-ee.html b/docs/index-module/2-ee.html
new file mode 100644
index 000000000..f99bc25dd
--- /dev/null
+++ b/docs/index-module/2-ee.html
@@ -0,0 +1,140 @@
+
+
+
+ Events Element
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Compiler Webs Inbuild Modules Inform7 Modules Inter Modules Services
+
+
+
+
+To index relations.
+
+
+
+
+void IXEvents::render ( OUTPUT_STREAM ) {
+ int when_count = 0 , tt_count = 0 ;
+ Index events with no specific time 1.1 ;
+ Index timetabled events 1.2 ;
+ if (( when_count == 0 ) && ( tt_count == 0 )) {
+ HTML_OPEN ( "p" ); WRITE ( "<i>None.</i>" ); HTML_CLOSE ( "p" );
+ }
+}
+
+
+
+
+ id_body * idb ;
+ LOOP_OVER ( idb , id_body ) {
+ int t = TimedRules::get_timing_of_event ( idb -> head_of_defn );
+ if ( t == NO_FIXED_TIME ) {
+ if ( when_count == 0 ) {
+ HTML_OPEN ( "p" );
+ WRITE ( "<i>Events with no specific time</i>" );
+ HTML_CLOSE ( "p" );
+ }
+ when_count ++;
+ HTML_OPEN_WITH ( "p" , "class=\"tightin2\"" );
+ ImperativeDefinitions::index_preamble ( OUT , idb -> head_of_defn );
+ if (( ImperativeDefinitions::body_at ( idb )) &&
+ ( Wordings::nonempty ( Node::get_text ( ImperativeDefinitions::body_at ( idb )))))
+ Index::link ( OUT , Wordings::first_wn ( Node::get_text ( ImperativeDefinitions::body_at ( idb ))));
+ WRITE ( " (where triggered: " );
+ linked_list * L = TimedRules::get_uses_as_event ( idb -> head_of_defn );
+ parse_node * p ;
+ LOOP_OVER_LINKED_LIST ( p , parse_node , L )
+ Index::link ( OUT , Wordings::first_wn ( Node::get_text ( p )));
+ WRITE ( ")" );
+ HTML_CLOSE ( "p" );
+ }
+ }
+
+
+
+
+
+ id_body * idb ;
+ LOOP_OVER ( idb , id_body ) {
+ int t = TimedRules::get_timing_of_event ( idb -> head_of_defn );
+ if ( t >= 0 ) {
+ if ( tt_count == 0 ) {
+ HTML_OPEN ( "p" );
+ WRITE ( "<i>Timetable</i>" );
+ HTML_CLOSE ( "p" );
+ }
+ tt_count ++;
+ HTML_OPEN_WITH ( "p" , "class=\"in2\"" );
+ ImperativeDefinitions::index_preamble ( OUT , idb -> head_of_defn );
+ if (( ImperativeDefinitions::body_at ( idb )) &&
+ ( Wordings::nonempty ( Node::get_text ( ImperativeDefinitions::body_at ( idb )))))
+ Index::link ( OUT , Wordings::first_wn ( Node::get_text ( ImperativeDefinitions::body_at ( idb ))));
+ HTML_CLOSE ( "p" );
+ }
+ }
+
+
+
+
+
+
+
+
+
diff --git a/docs/index-module/2-ie.html b/docs/index-module/2-ie.html
index 22ac7a8e6..702750bc5 100644
--- a/docs/index-module/2-ie.html
+++ b/docs/index-module/2-ie.html
@@ -379,7 +379,7 @@ dictionary.
}
+
diff --git a/docs/index-module/2-ie2.html b/docs/index-module/2-ie2.html
new file mode 100644
index 000000000..1572c37d6
--- /dev/null
+++ b/docs/index-module/2-ie2.html
@@ -0,0 +1,149 @@
+
+
+
+ Innards Element
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Compiler Webs Inbuild Modules Inform7 Modules Inter Modules Services
+
+
+
+
+To index tables.
+
+
+
+
+
+
+void IXInnards::render ( OUTPUT_STREAM , target_vm * VM ) {
+ IXInnards::index_VM ( OUT , VM );
+ NewUseOptions::index ( OUT );
+ HTML_OPEN ( "p" );
+ Index::extra_link ( OUT , 3 );
+ WRITE ( "See some technicalities for Inform maintainers only" );
+ HTML_CLOSE ( "p" );
+ Index::extra_div_open ( OUT , 3 , 2 , "e0e0e0" );
+ IXInnards::show_configuration ( OUT );
+ Add some paste buttons for the debugging log 1.1 ;
+ Index::extra_div_close ( OUT , "e0e0e0" );
+}
+
+
+
+
+
+
+ HTML_OPEN ( "p" );
+ WRITE ( "Debugging log:" );
+ HTML_CLOSE ( "p" );
+ HTML_OPEN ( "p" );
+ for ( int i =0; i < NO_DEFINED_DA_VALUES ; i ++) {
+ debugging_aspect * da = &( the_debugging_aspects [ i ]);
+ if ( Str::len ( da -> unhyphenated_name ) > 0 ) {
+ TEMPORARY_TEXT ( is )
+ WRITE_TO ( is , "Include %S in the debugging log." , da -> unhyphenated_name );
+ PasteButtons::paste_text ( OUT , is );
+ WRITE ( " %S" , is );
+ DISCARD_TEXT ( is )
+ HTML_TAG ( "br" );
+ }
+ }
+ HTML_CLOSE ( "p" );
+
+
+
+
+
+void IXInnards::index_VM ( OUTPUT_STREAM , target_vm * VM ) {
+ if ( VM == NULL ) internal_error ( "target VM not set yet" );
+ Index::anchor ( OUT , I "STORYFILE" );
+ HTML_OPEN ( "p" ); WRITE ( "Story file format: " );
+ ExtensionIndex::plot_icon ( OUT , VM );
+ TargetVMs::write ( OUT , VM );
+ HTML_CLOSE ( "p" );
+}
+
+
+
+
+void IXInnards::show_configuration ( OUTPUT_STREAM ) {
+ HTML_OPEN ( "p" );
+ Index::anchor ( OUT , I "CONFIG" );
+ WRITE ( "Inform language definition:\n" );
+ PluginManager::list_plugins ( OUT , "Included" , TRUE );
+ PluginManager::list_plugins ( OUT , "Excluded" , FALSE );
+ HTML_CLOSE ( "p" );
+}
+
+
+
+
+
+
+
+
diff --git a/docs/index-module/2-ih.html b/docs/index-module/2-ih.html
index 6c61f65b5..953208bde 100644
--- a/docs/index-module/2-ih.html
+++ b/docs/index-module/2-ih.html
@@ -179,7 +179,7 @@ surreptitiously check that it is correctly formed at the same time.
}
}
-The structure contents_entry is accessed in 2/ins, 2/rls, 2/act, 3/scn, 4/em and here.
+The structure contents_entry is accessed in 2/ins, 2/rls, 2/act, 2/te, 3/pe, 4/em and here.
@@ -360,7 +360,7 @@ but should this arise then the best recourse is to ignore the heading.
+
diff --git a/docs/index-module/2-inf.html b/docs/index-module/2-inf.html
index 3c9ff49f9..b1e133351 100644
--- a/docs/index-module/2-inf.html
+++ b/docs/index-module/2-inf.html
@@ -194,7 +194,7 @@ state of being boolean, and the given certainty levels:
}
+
diff --git a/docs/index-module/2-ins.html b/docs/index-module/2-ins.html
index b0e3c618d..a78f6458c 100644
--- a/docs/index-module/2-ins.html
+++ b/docs/index-module/2-ins.html
@@ -89,7 +89,7 @@ function togglePopup(material_id) {
struct instance_usage * next ;
} instance_usage ;
-The structure instance_index_data is private to this section. The structure instance_usage is accessed in 2/rls, 2/act, 3/scn, 4/em and here.
+The structure instance_index_data is private to this section. The structure instance_usage is accessed in 2/rls, 2/act, 2/te, 3/pe, 4/em and here.
@@ -203,7 +203,7 @@ constant value.
}
+
diff --git a/docs/index-module/2-ipw.html b/docs/index-module/2-ipw.html
index e2aae6468..0066ba33a 100644
--- a/docs/index-module/2-ipw.html
+++ b/docs/index-module/2-ipw.html
@@ -509,7 +509,7 @@ table of Kinds.
}
+
diff --git a/docs/index-module/2-ki.html b/docs/index-module/2-ki.html
index 42f54bd14..33f807465 100644
--- a/docs/index-module/2-ki.html
+++ b/docs/index-module/2-ki.html
@@ -571,7 +571,7 @@ as "0 kg", "0 hectares", or whatever is appropriate.
+
diff --git a/docs/index-module/2-li.html b/docs/index-module/2-li.html
index 0061a4c09..ada2f74ce 100644
--- a/docs/index-module/2-li.html
+++ b/docs/index-module/2-li.html
@@ -684,7 +684,7 @@ be able to print out a table of just those verbs created in that extension.
if ( vu -> where_vu_created )
Index::link ( OUT , Wordings::first_wn ( Node::get_text ( vu -> where_vu_created )));
binary_predicate * bp = VerbMeanings::get_regular_meaning_of_form ( Verbs::base_form ( VerbUsages::get_verb ( vu )));
- if ( bp ) IXRelations::index_for_verbs ( OUT , bp );
+ if ( bp ) IndexLexicon::show_relation ( OUT , bp );
return ;
}
preposition * prep ;
@@ -693,13 +693,26 @@ be able to print out a table of just those verbs created in that extension.
if ( prep -> where_prep_created )
Index::link ( OUT , Wordings::first_wn ( Node::get_text ( prep -> where_prep_created )));
binary_predicate * bp = VerbMeanings::get_regular_meaning_of_form ( Verbs::find_form ( copular_verb , prep , NULL ));
- if ( bp ) IXRelations::index_for_verbs ( OUT , bp );
+ if ( bp ) IndexLexicon::show_relation ( OUT , bp );
return ;
}
}
+
+void IndexLexicon::show_relation ( OUTPUT_STREAM , binary_predicate * bp ) {
+ WRITE ( " ... <i>" );
+ if ( bp == NULL ) WRITE ( "(a meaning internal to Inform)" );
+ else {
+ if ( bp -> right_way_round == FALSE ) {
+ bp = bp -> reversal ;
+ WRITE ( "reversed " );
+ }
+ WordAssemblages::index ( OUT , &( bp -> relation_name ));
+ }
+ WRITE ( "</i>" );
+}
+
diff --git a/docs/index-module/2-pi.html b/docs/index-module/2-pi.html
index 826a1bb44..4de1897f0 100644
--- a/docs/index-module/2-pi.html
+++ b/docs/index-module/2-pi.html
@@ -501,7 +501,7 @@ so we won't list them here.
}
+
diff --git a/docs/index-module/2-prp.html b/docs/index-module/2-prp.html
index ad60125e1..ed0887245 100644
--- a/docs/index-module/2-prp.html
+++ b/docs/index-module/2-prp.html
@@ -143,7 +143,7 @@ function togglePopup(material_id) {
}
+
diff --git a/docs/index-module/2-rlt.html b/docs/index-module/2-re.html
similarity index 75%
rename from docs/index-module/2-rlt.html
rename to docs/index-module/2-re.html
index b56504f2b..7f99e0e92 100644
--- a/docs/index-module/2-rlt.html
+++ b/docs/index-module/2-re.html
@@ -1,7 +1,7 @@
- Relations
+ Relations Element
@@ -12,14 +12,6 @@
-
-
-
@@ -67,16 +59,16 @@ function togglePopup(material_id) {
-
+
+
To index relations.
-void IXRelations::index_table ( OUTPUT_STREAM ) {
+void IXRelations::render ( OUTPUT_STREAM ) {
binary_predicate * bp ;
HTML_OPEN ( "p" );
HTML::begin_plain_html_table ( OUT );
@@ -105,25 +97,8 @@ function togglePopup(material_id) {
HTML_CLOSE ( "p" );
}
-
-
-
-void IXRelations::index_for_verbs ( OUTPUT_STREAM , binary_predicate * bp ) {
- WRITE ( " ... <i>" );
- if ( bp == NULL ) WRITE ( "(a meaning internal to Inform)" );
- else {
- if ( bp -> right_way_round == FALSE ) {
- bp = bp -> reversal ;
- WRITE ( "reversed " );
- }
- WordAssemblages::index ( OUT , &( bp -> relation_name ));
- }
- WRITE ( "</i>" );
-}
-
+
diff --git a/docs/index-module/2-rfse.html b/docs/index-module/2-rfse.html
new file mode 100644
index 000000000..736f3f22e
--- /dev/null
+++ b/docs/index-module/2-rfse.html
@@ -0,0 +1,91 @@
+
+
+
+ Rules for Scenes Element
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Compiler Webs Inbuild Modules Inform7 Modules Inter Modules Services
+
+
+
+
+The RS element.
+
+
+
+
+void IXRulesForScenes::render ( OUTPUT_STREAM ) {
+ HTML_OPEN ( "p" ); WRITE ( "<b>The scene-changing machinery</b>" ); HTML_CLOSE ( "p" );
+ IXRules::index_rules_box ( OUT , "Scene changing" , EMPTY_WORDING , NULL ,
+ Rulebooks::std ( SCENE_CHANGING_RB ), NULL , NULL , 1 , FALSE );
+ HTML_OPEN ( "p" );
+ Index::anchor ( OUT , I "SRULES" );
+ WRITE ( "<b>General rules applying to scene changes</b>" );
+ HTML_CLOSE ( "p" );
+ IXRules::index_rules_box ( OUT , "When a scene begins" , EMPTY_WORDING , NULL ,
+ Rulebooks::std ( WHEN_SCENE_BEGINS_RB ), NULL , NULL , 1 , FALSE );
+ IXRules::index_rules_box ( OUT , "When a scene ends" , EMPTY_WORDING , NULL ,
+ Rulebooks::std ( WHEN_SCENE_ENDS_RB ), NULL , NULL , 1 , FALSE );
+}
+
+
+
+
+
+
+
+
diff --git a/docs/index-module/2-rls.html b/docs/index-module/2-rls.html
index d592cf5dd..21ea333a7 100644
--- a/docs/index-module/2-rls.html
+++ b/docs/index-module/2-rls.html
@@ -72,7 +72,7 @@ function togglePopup(material_id) {
To index rules and rulebooks.
-
+
@@ -172,7 +172,7 @@ function togglePopup(material_id) {
if ( R -> responses [ l ]. message ) {
if ( c == 0 ) Index::extra_div_open_nested ( OUT , 1000000 + R -> allocation_id , 2 );
else HTML_TAG ( "br" );
- IXRules::index_response ( OUT , R , l , R -> responses [ l ]. message );
+ IXRules::index_response ( OUT , R , l , R -> responses [ l ]. message );
c ++;
}
if ( c > 0 ) Index::extra_div_close_nested ( OUT );
@@ -564,14 +564,8 @@ popular rulebooks, showing their contents in logical order.
return nb ;
}
-void IXRules::index_scene ( OUTPUT_STREAM ) {
- HTML_OPEN ( "p" ); WRITE ( "<b>The scene-changing machinery</b>" ); HTML_CLOSE ( "p" );
- IXRules::index_rules_box ( OUT , "Scene changing" , EMPTY_WORDING , NULL ,
- Rulebooks::std ( SCENE_CHANGING_RB ), NULL , NULL , 1 , FALSE );
-}
-
int unique_xtra_no = 0 ;
-void IXRules::index_rules_box ( OUTPUT_STREAM , char * name , wording W , text_stream * doc_link ,
+void IXRules::index_rules_box ( OUTPUT_STREAM , char * name , wording W , text_stream * doc_link ,
rulebook * rb , activity * av , char * text , int indent , int hide_behind_plus ) {
int xtra_no = 0 ;
if ( rb ) xtra_no = rb -> allocation_id ;
@@ -653,7 +647,7 @@ popular rulebooks, showing their contents in logical order.
if ( rb ) {
int ignore_me = 0 ;
IXRules::index_rulebook ( OUT , rb , "" ,
- IXRules::no_rule_context (), & ignore_me );
+ IXRules::no_rule_context (), & ignore_me );
}
if ( av ) IXActivities::index_details ( OUT , av );
}
@@ -689,7 +683,7 @@ popular rulebooks, showing their contents in logical order.
-int IXRules::index_rulebook ( OUTPUT_STREAM , rulebook * rb , char * billing , rule_context rc , int * resp_count ) {
+int IXRules::index_rulebook ( OUTPUT_STREAM , rulebook * rb , char * billing , rule_context rc , int * resp_count ) {
int suppress_outcome = FALSE , t ;
if ( rb == NULL ) return 0 ;
if ( billing == NULL ) internal_error ( "No billing for rb index" );
@@ -706,14 +700,14 @@ popular rulebooks, showing their contents in logical order.
}
# ifdef IF_MODULE
-void IXRules::index_action_rules ( OUTPUT_STREAM , action_name * an , rulebook * rb ,
+void IXRules::index_action_rules ( OUTPUT_STREAM , action_name * an , rulebook * rb ,
int code , char * desc , int * resp_count ) {
int t = 0 ;
IXRules::list_suppress_indexed_links ();
if ( code >= 0 ) t += IXRules::index_rulebook ( OUT , Rulebooks::std ( code ), desc ,
- IXRules::action_context ( an ), resp_count );
+ IXRules::action_context ( an ), resp_count );
if ( rb ) t += IXRules::index_rulebook ( OUT , rb , desc ,
- IXRules::no_rule_context (), resp_count );
+ IXRules::no_rule_context (), resp_count );
IXRules::list_resume_indexed_links ();
if ( t > 0 ) HTML_TAG ( "br" );
}
@@ -756,7 +750,7 @@ have affected it in this way:
return t ;
}
-void IXRules::rb_index_placements ( OUTPUT_STREAM , rulebook * rb ) {
+void IXRules::rb_index_placements ( OUTPUT_STREAM , rulebook * rb ) {
placement_affecting * npl = rb -> indexing_data . placement_list ;
while ( npl ) {
WRITE ( " " );
@@ -769,7 +763,7 @@ have affected it in this way:
}
}
-void IXRules::index_outcomes ( OUTPUT_STREAM , outcomes * outs , int suppress_outcome ) {
+void IXRules::index_outcomes ( OUTPUT_STREAM , outcomes * outs , int suppress_outcome ) {
if ( suppress_outcome == FALSE ) {
rulebook_outcome * ro ;
LOOP_OVER_LINKED_LIST ( ro , rulebook_outcome , outs -> named_outcomes ) {
@@ -802,74 +796,8 @@ have affected it in this way:
}
}
-The structure rulebook_indexing_data is private to this section. The structure placement_affecting is accessed in 2/ins, 2/act, 3/scn, 4/em and here.
-
-
-
-void IXRules::index_timed_rules ( OUTPUT_STREAM ) {
- int when_count = 0 , tt_count = 0 ;
- Index events with no specific time 10.1 ;
- Index timetabled events 10.2 ;
- if (( when_count == 0 ) && ( tt_count == 0 )) {
- HTML_OPEN ( "p" ); WRITE ( "<i>None.</i>" ); HTML_CLOSE ( "p" );
- }
-}
-
-
-
-
- id_body * idb ;
- LOOP_OVER ( idb , id_body ) {
- int t = TimedRules::get_timing_of_event ( idb -> head_of_defn );
- if ( t == NO_FIXED_TIME ) {
- if ( when_count == 0 ) {
- HTML_OPEN ( "p" );
- WRITE ( "<i>Events with no specific time</i>" );
- HTML_CLOSE ( "p" );
- }
- when_count ++;
- HTML_OPEN_WITH ( "p" , "class=\"tightin2\"" );
- ImperativeDefinitions::index_preamble ( OUT , idb -> head_of_defn );
- if (( ImperativeDefinitions::body_at ( idb )) &&
- ( Wordings::nonempty ( Node::get_text ( ImperativeDefinitions::body_at ( idb )))))
- Index::link ( OUT , Wordings::first_wn ( Node::get_text ( ImperativeDefinitions::body_at ( idb ))));
- WRITE ( " (where triggered: " );
- linked_list * L = TimedRules::get_uses_as_event ( idb -> head_of_defn );
- parse_node * p ;
- LOOP_OVER_LINKED_LIST ( p , parse_node , L )
- Index::link ( OUT , Wordings::first_wn ( Node::get_text ( p )));
- WRITE ( ")" );
- HTML_CLOSE ( "p" );
- }
- }
-
-This code is used in §10 .
-
-
-
- id_body * idb ;
- LOOP_OVER ( idb , id_body ) {
- int t = TimedRules::get_timing_of_event ( idb -> head_of_defn );
- if ( t >= 0 ) {
- if ( tt_count == 0 ) {
- HTML_OPEN ( "p" );
- WRITE ( "<i>Timetable</i>" );
- HTML_CLOSE ( "p" );
- }
- tt_count ++;
- HTML_OPEN_WITH ( "p" , "class=\"in2\"" );
- ImperativeDefinitions::index_preamble ( OUT , idb -> head_of_defn );
- if (( ImperativeDefinitions::body_at ( idb )) &&
- ( Wordings::nonempty ( Node::get_text ( ImperativeDefinitions::body_at ( idb )))))
- Index::link ( OUT , Wordings::first_wn ( Node::get_text ( ImperativeDefinitions::body_at ( idb ))));
- HTML_CLOSE ( "p" );
- }
- }
-
-This code is used in §10 .
-The structure rulebook_indexing_data is private to this section. The structure placement_affecting is accessed in 2/ins, 2/act, 2/te, 3/pe, 4/em and here.
+
@@ -879,20 +807,20 @@ being the relevant scene or action for a rule.
struct scene * scene_context ;
} rule_context ;
-rule_context IXRules::action_context ( action_name * an ) {
+rule_context IXRules::action_context ( action_name * an ) {
rule_context rc ;
rc . action_context = an ;
rc . scene_context = NULL ;
return rc ;
}
-rule_context IXRules::scene_context ( scene * s ) {
+rule_context IXRules::scene_context ( scene * s ) {
rule_context rc ;
rc . action_context = NULL ;
rc . scene_context = s ;
return rc ;
}
-rule_context IXRules::no_rule_context ( void ) {
+rule_context IXRules::no_rule_context ( void ) {
rule_context rc ;
rc . action_context = NULL ;
rc . scene_context = NULL ;
@@ -907,12 +835,12 @@ being the relevant scene or action for a rule.
}
The structure rule_context is private to this section.
-
-void IXRules::index_response ( OUTPUT_STREAM , rule * R , int marker , response_message * resp ) {
+void IXRules::index_response ( OUTPUT_STREAM , rule * R , int marker , response_message * resp ) {
WRITE ( " " );
HTML_OPEN_WITH ( "span" ,
"style=\"color: #ffffff; "
@@ -936,7 +864,7 @@ text to assert a change:
}
+
diff --git a/docs/index-module/2-te.html b/docs/index-module/2-te.html
new file mode 100644
index 000000000..3cb5e198c
--- /dev/null
+++ b/docs/index-module/2-te.html
@@ -0,0 +1,221 @@
+
+
+
+ Tables Element
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Compiler Webs Inbuild Modules Inform7 Modules Inter Modules Services
+
+
+
+
+To index tables.
+
+
+
+
+
+
+void IXTables::render ( OUTPUT_STREAM ) {
+ HTML_OPEN ( "p" );
+ int m = IXTables::index_tables_in ( OUT , NULL , 0 );
+ HTML_CLOSE ( "p" );
+ HTML_OPEN ( "p" );
+ Index::extra_link ( OUT , 2 );
+ if ( m > 0 ) WRITE ( "Show tables inside extensions too" );
+ else WRITE ( "Show tables inside extensions (there are none in the main text)" );
+ HTML_CLOSE ( "p" );
+ Index::extra_div_open ( OUT , 2 , 1 , "e0e0e0" );
+ inform_extension * E ; int efc = 0 ;
+ LOOP_OVER ( E , inform_extension ) IXTables::index_tables_in ( OUT , E , efc ++);
+ Index::extra_div_close ( OUT , "e0e0e0" );
+}
+
+
+
+
+int IXTables::index_tables_in ( OUTPUT_STREAM , inform_extension * E , int efc ) {
+ int tc = 0 ; table * t ;
+ LOOP_OVER ( t , table ) if ( IXTables::table_within ( t , E )) tc ++;
+ if ( tc > 0 ) {
+ if ( E ) {
+ HTML_OPEN ( "p" );
+ WRITE ( "<i>%S</i>" , E -> as_copy -> edition -> work -> title );
+ HTML_CLOSE ( "p" );
+ }
+ HTML::begin_plain_html_table ( OUT );
+ LOOP_OVER ( t , table )
+ if ( IXTables::table_within ( t , E ))
+ Index this table 2.1 ;
+ HTML::end_html_table ( OUT );
+ }
+ return tc ;
+}
+
+
+
+
+
+
+ HTML::first_html_column_spaced ( OUT , 0 );
+ WRITE ( "<b>%+W</b>" , Node::get_text ( t -> headline_fragment ));
+ table_contribution * tc ; int ntc = 0 ;
+ for ( tc = t -> table_created_at ; tc ; tc = tc -> next ) {
+ if ( ntc ++ > 0 ) WRITE ( " +" );
+ Index::link ( OUT , Wordings::first_wn ( Node::get_text ( tc -> source_table )));
+ }
+ HTML::next_html_column_spaced ( OUT , 0 );
+ int rc = Tables::get_no_rows ( t );
+ WRITE ( "<i>" );
+ HTML_OPEN_WITH ( "span" , "class=\"smaller\"" );
+ if ( t -> first_column_by_definition ) {
+ WRITE ( "%d definition%s" , rc ,
+ ( rc == 1 )? "" : "s" );
+ } else {
+ WRITE ( "%d column%s x %d row%s" ,
+ t -> no_columns , ( t -> no_columns == 1 )? "" : "s" ,
+ rc , ( rc == 1 )? "" : "s" );
+ }
+ if ( t -> blank_rows > 0 ) {
+ WRITE ( " (%d blank" , t -> blank_rows );
+ if ( Wordings::nonempty ( t -> blank_rows_for_each_text ))
+ WRITE ( ", one for each %+W" , t -> blank_rows_for_each_text );
+ WRITE ( ")" );
+ }
+ HTML_CLOSE ( "span" );
+ WRITE ( "</i>" );
+ HTML::end_html_row ( OUT );
+ int col ;
+ for ( col = 0 ; col < t -> no_columns ; col ++) {
+ HTML::first_html_column ( OUT , 0 );
+ WRITE ( " col %d: " , col +1);
+ wording CW = Nouns::nominative_singular ( t -> columns [ col ]. column_identity -> name );
+ if (( t -> first_column_by_definition ) && ( col == 0 )) {
+ parse_node * PN = t -> where_used_to_define ;
+ WRITE ( "%+W" , Node::get_text ( PN ));
+ Index::link ( OUT , Wordings::first_wn ( Node::get_text ( PN )));
+ } else {
+ if ( t -> first_column_by_definition ) WRITE ( "<i>sets</i> " );
+ WRITE ( "%+W " , CW );
+ TEMPORARY_TEXT ( TEMP )
+ WRITE_TO ( TEMP , "%+W" , CW );
+ if ( t -> first_column_by_definition == FALSE ) WRITE_TO ( TEMP , " entry" );
+ PasteButtons::paste_text ( OUT , TEMP );
+ DISCARD_TEXT ( TEMP )
+ }
+ HTML::next_html_column ( OUT , 0 );
+ if (( t -> first_column_by_definition ) && ( col == 0 )) {
+ parse_node * cell ;
+ int row ;
+ for ( row = 1 , cell = t -> columns [0]. entries -> down ; cell ; cell = cell -> next , row ++) {
+ if ( row > 1 ) WRITE ( ", " );
+ WRITE ( "%+W" , Node::get_text ( cell ));
+ Index::link ( OUT , Wordings::first_wn ( Node::get_text ( cell )));
+ }
+ } else if ( t -> first_column_by_definition ) {
+ Kinds::Textual::write ( OUT ,
+ Tables::Columns::get_kind (
+ t -> columns [ col ]. column_identity ));
+ WRITE ( " property" );
+ } else {
+ WRITE ( "of " );
+ Kinds::Textual::write_plural ( OUT ,
+ Tables::Columns::get_kind (
+ t -> columns [ col ]. column_identity ));
+ }
+ HTML::end_html_row ( OUT );
+ }
+
+
+
+
+
+int IXTables::table_within ( table * t , inform_extension * E ) {
+ if ( t -> amendment_of ) return FALSE ;
+ heading * at_heading =
+ Headings::of_wording ( Node::get_text ( t -> table_created_at -> source_table ));
+ inform_extension * at_E = Headings::get_extension_containing ( at_heading );
+ if ( E == at_E ) return TRUE ;
+ return FALSE ;
+}
+
+
+
+
+
+
+
+
diff --git a/docs/index-module/2-vrb.html b/docs/index-module/2-vrb.html
index edaa217ce..014010396 100644
--- a/docs/index-module/2-vrb.html
+++ b/docs/index-module/2-vrb.html
@@ -162,7 +162,7 @@ the following:
}
+
diff --git a/docs/index-module/3-act.html b/docs/index-module/3-act.html
index 09f1422a8..cbc15d6ec 100644
--- a/docs/index-module/3-act.html
+++ b/docs/index-module/3-act.html
@@ -240,32 +240,6 @@ function togglePopup(material_id) {
WRITE ( " " );
}
-void IXActions::index_named_patterns ( OUTPUT_STREAM ) {
- named_action_pattern * nap ;
- int num_naps = NUMBER_CREATED ( named_action_pattern );
-
- if ( num_naps == 0 ) {
- HTML_OPEN ( "p" );
- WRITE ( "No names for kinds of action have yet been defined." );
- HTML_CLOSE ( "p" );
- }
-
- LOOP_OVER ( nap , named_action_pattern ) {
- HTML_OPEN ( "p" ); WRITE ( "<b>%+W</b>" , Nouns::nominative_singular ( nap -> as_noun ));
- Index::link ( OUT , Wordings::first_wn ( nap -> text_of_declaration ));
- HTML_TAG ( "br" );
- WRITE ( " <i>defined as any of the following acts:</i>\n" );
- named_action_pattern_entry * nape ;
- LOOP_OVER_LINKED_LIST ( nape , named_action_pattern_entry , nap -> patterns ) {
- action_pattern * ap = nape -> behaviour ;
- HTML_TAG ( "br" );
- WRITE ( " %+W" , ap -> text_of_pattern );
- Index::link ( OUT , Wordings::first_wn ( ap -> text_of_pattern ));
- }
- HTML_CLOSE ( "p" );
- }
-}
-
void IXActions::index_named_patterns_for_extension ( OUTPUT_STREAM , source_file * sf , inform_extension * E ) {
named_action_pattern * nap ;
int kc = 0 ;
@@ -278,7 +252,7 @@ function togglePopup(material_id) {
The structure action_indexing_data is accessed in 3/ci and here.
+
diff --git a/docs/index-module/3-bck.html b/docs/index-module/3-bck.html
index 918bc0979..afac4ad12 100644
--- a/docs/index-module/3-bck.html
+++ b/docs/index-module/3-bck.html
@@ -119,7 +119,7 @@ adds backdrop contents to a room called -
To index relations.
@@ -148,6 +148,31 @@
Phrasebook Index -
To compile most of the HTML page for the Phrasebook index.
+
+
+ Tables Element -
+ To index tables.
+
+
+
+ Innards Element -
+ To index tables.
+
+
+
+ Events Element -
+ To index relations.
+
+
+
+ Rules for Scenes Element -
+ The RS element.
+
+
+
+ Behaviour Element -
+ To index relations.
+
@@ -155,20 +180,10 @@
Chapter 3: Indexing for Plugins
-
- Figures -
+
+ Figures Element -
To produce the index of figures.
-
-
- Sound Effects -
- To produce the index of sound effects.
-
-
-
- External Files -
- To produce the index of external files.
-
Spatial -
@@ -195,8 +210,8 @@
Indexing the player's initial position.
-
- Scenes -
+
+ Plot Element -
Parallel to the World index of space is the Scenes index of time, and in this section we render it as HTML.
diff --git a/inform7/Figures/timings-diagnostics.txt b/inform7/Figures/timings-diagnostics.txt
index 3508424f4..b78de7ff0 100644
--- a/inform7/Figures/timings-diagnostics.txt
+++ b/inform7/Figures/timings-diagnostics.txt
@@ -1,24 +1,25 @@
100.0% in inform7 run
- 53.7% in compilation to Inter
- 39.3% in //Sequence::undertake_queued_tasks//
- 4.4% in //MajorNodes::pre_pass//
- 3.2% in //MajorNodes::pass_1//
- 1.6% in //ImperativeDefinitions::assess_all//
+ 53.6% in compilation to Inter
+ 39.5% in //Sequence::undertake_queued_tasks//
+ 4.1% in //MajorNodes::pre_pass//
+ 3.1% in //MajorNodes::pass_1//
+ 1.7% in //ImperativeDefinitions::assess_all//
0.5% in //ImperativeDefinitions::compile_first_block//
0.5% in //MajorNodes::pass_2//
0.5% in //RTKindConstructors::compile//
0.5% in //World::stage_V//
0.3% in //Sequence::undertake_queued_tasks//
+ 0.1% in //InferenceSubjects::emit_all//
0.1% in //RTKindConstructors::compile_permissions//
0.1% in //Task::make_built_in_kind_constructors//
0.1% in //World::stages_II_and_III//
- 2.1% not specifically accounted for
+ 1.9% not specifically accounted for
43.9% in running Inter pipeline
- 11.2% in step preparation
- 11.0% in inter step 7/14: consolidate-text
- 9.6% in inter step 2/14: link
- 7.8% in inter step 14/14: generate inform6 -> auto.inf
- 0.7% in inter step 10/14: make-identifiers-unique
+ 11.1% in inter step 7/14: consolidate-text
+ 10.9% in step preparation
+ 9.5% in inter step 2/14: link
+ 7.4% in inter step 14/14: generate inform6 -> auto.inf
+ 0.8% in inter step 10/14: make-identifiers-unique
0.3% in inter step 11/14: reconcile-verbs
0.3% in inter step 13/14: eliminate-redundant-operations
0.1% in inter step 12/14: eliminate-redundant-labels
@@ -27,6 +28,6 @@
0.1% in inter step 6/14: assimilate
0.1% in inter step 8/14: resolve-external-symbols
0.1% in inter step 9/14: inspect-plugs
- 1.8% not specifically accounted for
- 1.9% in supervisor
+ 2.1% not specifically accounted for
+ 2.0% in supervisor
0.4% not specifically accounted for
diff --git a/inform7/assertions-module/Chapter 7/Tables.w b/inform7/assertions-module/Chapter 7/Tables.w
index 8a31e3f25..71377784f 100644
--- a/inform7/assertions-module/Chapter 7/Tables.w
+++ b/inform7/assertions-module/Chapter 7/Tables.w
@@ -1288,136 +1288,6 @@ void Tables::splice_table_row(table *table_to, table *table_from, int row_to, in
}
}
-@h Indexing.
-Tables inside extensions are often used just for the storage needed to manage
-back-of-house algorithms, so to speak, and they aren't intended for the end
-user to poke around with; that's certainly true of the tables in the Standard
-Rules, which of course are always present. So these are hidden by default.
-
-=
-void Tables::index(OUTPUT_STREAM) {
- HTML_OPEN("p");
- int m = Tables::index_tables_in(OUT, NULL, 0);
- HTML_CLOSE("p");
- HTML_OPEN("p");
- Index::extra_link(OUT, 2);
- if (m > 0) WRITE("Show tables inside extensions too");
- else WRITE("Show tables inside extensions (there are none in the main text)");
- HTML_CLOSE("p");
- Index::extra_div_open(OUT, 2, 1, "e0e0e0");
- inform_extension *E; int efc = 0;
- LOOP_OVER(E, inform_extension) Tables::index_tables_in(OUT, E, efc++);
- Index::extra_div_close(OUT, "e0e0e0");
-}
-
-@ This tabulates tables within a given extension, returning the number listed,
-and does nothing at all if that number is 0.
-
-=
-int Tables::index_tables_in(OUTPUT_STREAM, inform_extension *E, int efc) {
- int tc = 0; table *t;
- LOOP_OVER(t, table) if (Tables::table_within(t, E)) tc++;
- if (tc > 0) {
- if (E) {
- HTML_OPEN("p");
- WRITE("%S ", E->as_copy->edition->work->title);
- HTML_CLOSE("p");
- }
- HTML::begin_plain_html_table(OUT);
- LOOP_OVER(t, table)
- if (Tables::table_within(t, E))
- @;
- HTML::end_html_table(OUT);
- }
- return tc;
-}
-
-@ The following probably ought to use a multiplication sign rather than a
-Helvetica-style lower case "x", but life is full of compromises.
-
-@ =
- HTML::first_html_column_spaced(OUT, 0);
- WRITE("%+W ", Node::get_text(t->headline_fragment));
- table_contribution *tc; int ntc = 0;
- for (tc = t->table_created_at; tc; tc = tc->next) {
- if (ntc++ > 0) WRITE(" +");
- Index::link(OUT, Wordings::first_wn(Node::get_text(tc->source_table)));
- }
- HTML::next_html_column_spaced(OUT, 0);
- int rc = Tables::get_no_rows(t);
- WRITE("");
- HTML_OPEN_WITH("span", "class=\"smaller\"");
- if (t->first_column_by_definition) {
- WRITE("%d definition%s", rc,
- (rc == 1)?"":"s");
- } else {
- WRITE("%d column%s x %d row%s",
- t->no_columns, (t->no_columns == 1)?"":"s",
- rc, (rc == 1)?"":"s");
- }
- if (t->blank_rows > 0) {
- WRITE(" (%d blank", t->blank_rows);
- if (Wordings::nonempty(t->blank_rows_for_each_text))
- WRITE(", one for each %+W", t->blank_rows_for_each_text);
- WRITE(")");
- }
- HTML_CLOSE("span");
- WRITE(" ");
- HTML::end_html_row(OUT);
- int col;
- for (col = 0; col < t->no_columns; col++) {
- HTML::first_html_column(OUT, 0);
- WRITE(" col %d: ", col+1);
- wording CW = Nouns::nominative_singular(t->columns[col].column_identity->name);
- if ((t->first_column_by_definition) && (col == 0)) {
- parse_node *PN = t->where_used_to_define;
- WRITE("%+W", Node::get_text(PN));
- Index::link(OUT, Wordings::first_wn(Node::get_text(PN)));
- } else {
- if (t->first_column_by_definition) WRITE("sets ");
- WRITE("%+W ", CW);
- TEMPORARY_TEXT(TEMP)
- WRITE_TO(TEMP, "%+W", CW);
- if (t->first_column_by_definition == FALSE) WRITE_TO(TEMP, " entry");
- PasteButtons::paste_text(OUT, TEMP);
- DISCARD_TEXT(TEMP)
- }
- HTML::next_html_column(OUT, 0);
- if ((t->first_column_by_definition) && (col == 0)) {
- parse_node *cell;
- int row;
- for (row = 1, cell = t->columns[0].entries->down; cell; cell = cell->next, row++) {
- if (row > 1) WRITE(", ");
- WRITE("%+W", Node::get_text(cell));
- Index::link(OUT, Wordings::first_wn(Node::get_text(cell)));
- }
- } else if (t->first_column_by_definition) {
- Kinds::Textual::write(OUT,
- Tables::Columns::get_kind(
- t->columns[col].column_identity));
- WRITE(" property");
- } else {
- WRITE("of ");
- Kinds::Textual::write_plural(OUT,
- Tables::Columns::get_kind(
- t->columns[col].column_identity));
- }
- HTML::end_html_row(OUT);
- }
-
-@ The following laboriously tests whether a table is defined within a
-given extension:
-
-=
-int Tables::table_within(table *t, inform_extension *E) {
- if (t->amendment_of) return FALSE;
- heading *at_heading =
- Headings::of_wording(Node::get_text(t->table_created_at->source_table));
- inform_extension *at_E = Headings::get_extension_containing(at_heading);
- if (E == at_E) return TRUE;
- return FALSE;
-}
-
@ This is called when a table is being asked to define objects (or kinds).
=
diff --git a/inform7/index-module/Chapter 2/Activities.w b/inform7/index-module/Chapter 2/Activities.w
index 723492ac4..5f2ac3f8f 100644
--- a/inform7/index-module/Chapter 2/Activities.w
+++ b/inform7/index-module/Chapter 2/Activities.w
@@ -90,58 +90,3 @@ void IXActivities::index_cross_references(OUTPUT_STREAM, activity *av) {
}
}
-@h Describing the current VM.
-
-=
-void IXActivities::innards(OUTPUT_STREAM, target_vm *VM) {
- IXActivities::index_VM(OUT, VM);
- NewUseOptions::index(OUT);
- HTML_OPEN("p");
- Index::extra_link(OUT, 3);
- WRITE("See some technicalities for Inform maintainers only");
- HTML_CLOSE("p");
- Index::extra_div_open(OUT, 3, 2, "e0e0e0");
- IXActivities::show_configuration(OUT);
- @;
- Index::extra_div_close(OUT, "e0e0e0");
-}
-
-@ The index provides some hidden paste icons for these:
-
-@ =
- HTML_OPEN("p");
- WRITE("Debugging log:");
- HTML_CLOSE("p");
- HTML_OPEN("p");
- for (int i=0; iunhyphenated_name) > 0) {
- TEMPORARY_TEXT(is)
- WRITE_TO(is, "Include %S in the debugging log.", da->unhyphenated_name);
- PasteButtons::paste_text(OUT, is);
- WRITE(" %S", is);
- DISCARD_TEXT(is)
- HTML_TAG("br");
- }
- }
- HTML_CLOSE("p");
-
-@ =
-void IXActivities::index_VM(OUTPUT_STREAM, target_vm *VM) {
- if (VM == NULL) internal_error("target VM not set yet");
- Index::anchor(OUT, I"STORYFILE");
- HTML_OPEN("p"); WRITE("Story file format: ");
- ExtensionIndex::plot_icon(OUT, VM);
- TargetVMs::write(OUT, VM);
- HTML_CLOSE("p");
-}
-
-@ =
-void IXActivities::show_configuration(OUTPUT_STREAM) {
- HTML_OPEN("p");
- Index::anchor(OUT, I"CONFIG");
- WRITE("Inform language definition:\n");
- PluginManager::list_plugins(OUT, "Included", TRUE);
- PluginManager::list_plugins(OUT, "Excluded", FALSE);
- HTML_CLOSE("p");
-}
diff --git a/inform7/index-module/Chapter 2/Behaviour Element.w b/inform7/index-module/Chapter 2/Behaviour Element.w
new file mode 100644
index 000000000..35b0c68c2
--- /dev/null
+++ b/inform7/index-module/Chapter 2/Behaviour Element.w
@@ -0,0 +1,33 @@
+[IXBehaviour::] Behaviour Element.
+
+To index relations.
+
+@ A brief table of relations appears on the Phrasebook Index page.
+
+=
+void IXBehaviour::render(OUTPUT_STREAM) {
+ named_action_pattern *nap;
+ int num_naps = NUMBER_CREATED(named_action_pattern);
+
+ if (num_naps == 0) {
+ HTML_OPEN("p");
+ WRITE("No names for kinds of action have yet been defined.");
+ HTML_CLOSE("p");
+ }
+
+ LOOP_OVER(nap, named_action_pattern) {
+ HTML_OPEN("p"); WRITE("%+W ", Nouns::nominative_singular(nap->as_noun));
+ Index::link(OUT, Wordings::first_wn(nap->text_of_declaration));
+ HTML_TAG("br");
+ WRITE(" defined as any of the following acts: \n");
+ named_action_pattern_entry *nape;
+ LOOP_OVER_LINKED_LIST(nape, named_action_pattern_entry, nap->patterns) {
+ action_pattern *ap = nape->behaviour;
+ HTML_TAG("br");
+ WRITE(" %+W", ap->text_of_pattern);
+ Index::link(OUT, Wordings::first_wn(ap->text_of_pattern));
+ }
+ HTML_CLOSE("p");
+ }
+}
+
diff --git a/inform7/index-module/Chapter 2/Events Element.w b/inform7/index-module/Chapter 2/Events Element.w
new file mode 100644
index 000000000..e6191e49b
--- /dev/null
+++ b/inform7/index-module/Chapter 2/Events Element.w
@@ -0,0 +1,62 @@
+[IXEvents::] Events Element.
+
+To index relations.
+
+@
+
+=
+void IXEvents::render(OUTPUT_STREAM) {
+ int when_count = 0, tt_count = 0;
+ @;
+ @;
+ if ((when_count == 0) && (tt_count == 0)) {
+ HTML_OPEN("p"); WRITE("None. "); HTML_CLOSE("p");
+ }
+}
+
+@ =
+ id_body *idb;
+ LOOP_OVER(idb, id_body) {
+ int t = TimedRules::get_timing_of_event(idb->head_of_defn);
+ if (t == NO_FIXED_TIME) {
+ if (when_count == 0) {
+ HTML_OPEN("p");
+ WRITE("Events with no specific time ");
+ HTML_CLOSE("p");
+ }
+ when_count++;
+ HTML_OPEN_WITH("p", "class=\"tightin2\"");
+ ImperativeDefinitions::index_preamble(OUT, idb->head_of_defn);
+ if ((ImperativeDefinitions::body_at(idb)) &&
+ (Wordings::nonempty(Node::get_text(ImperativeDefinitions::body_at(idb)))))
+ Index::link(OUT, Wordings::first_wn(Node::get_text(ImperativeDefinitions::body_at(idb))));
+ WRITE(" (where triggered: ");
+ linked_list *L = TimedRules::get_uses_as_event(idb->head_of_defn);
+ parse_node *p;
+ LOOP_OVER_LINKED_LIST(p, parse_node, L)
+ Index::link(OUT, Wordings::first_wn(Node::get_text(p)));
+ WRITE(")");
+ HTML_CLOSE("p");
+ }
+ }
+
+@ =
+ id_body *idb;
+ LOOP_OVER(idb, id_body) {
+ int t = TimedRules::get_timing_of_event(idb->head_of_defn);
+ if (t >= 0) { /* i.e., an actual time of day in minutes since midnight */
+ if (tt_count == 0) {
+ HTML_OPEN("p");
+ WRITE("Timetable ");
+ HTML_CLOSE("p");
+ }
+ tt_count++;
+ HTML_OPEN_WITH("p", "class=\"in2\"");
+ ImperativeDefinitions::index_preamble(OUT, idb->head_of_defn);
+ if ((ImperativeDefinitions::body_at(idb)) &&
+ (Wordings::nonempty(Node::get_text(ImperativeDefinitions::body_at(idb)))))
+ Index::link(OUT, Wordings::first_wn(Node::get_text(ImperativeDefinitions::body_at(idb))));
+ HTML_CLOSE("p");
+ }
+ }
+
diff --git a/inform7/index-module/Chapter 2/Innards Element.w b/inform7/index-module/Chapter 2/Innards Element.w
new file mode 100644
index 000000000..a8226e141
--- /dev/null
+++ b/inform7/index-module/Chapter 2/Innards Element.w
@@ -0,0 +1,59 @@
+[IXInnards::] Innards Element.
+
+To index tables.
+
+@h Describing the current VM.
+
+=
+void IXInnards::render(OUTPUT_STREAM, target_vm *VM) {
+ IXInnards::index_VM(OUT, VM);
+ NewUseOptions::index(OUT);
+ HTML_OPEN("p");
+ Index::extra_link(OUT, 3);
+ WRITE("See some technicalities for Inform maintainers only");
+ HTML_CLOSE("p");
+ Index::extra_div_open(OUT, 3, 2, "e0e0e0");
+ IXInnards::show_configuration(OUT);
+ @;
+ Index::extra_div_close(OUT, "e0e0e0");
+}
+
+@ The index provides some hidden paste icons for these:
+
+@ =
+ HTML_OPEN("p");
+ WRITE("Debugging log:");
+ HTML_CLOSE("p");
+ HTML_OPEN("p");
+ for (int i=0; iunhyphenated_name) > 0) {
+ TEMPORARY_TEXT(is)
+ WRITE_TO(is, "Include %S in the debugging log.", da->unhyphenated_name);
+ PasteButtons::paste_text(OUT, is);
+ WRITE(" %S", is);
+ DISCARD_TEXT(is)
+ HTML_TAG("br");
+ }
+ }
+ HTML_CLOSE("p");
+
+@ =
+void IXInnards::index_VM(OUTPUT_STREAM, target_vm *VM) {
+ if (VM == NULL) internal_error("target VM not set yet");
+ Index::anchor(OUT, I"STORYFILE");
+ HTML_OPEN("p"); WRITE("Story file format: ");
+ ExtensionIndex::plot_icon(OUT, VM);
+ TargetVMs::write(OUT, VM);
+ HTML_CLOSE("p");
+}
+
+@ =
+void IXInnards::show_configuration(OUTPUT_STREAM) {
+ HTML_OPEN("p");
+ Index::anchor(OUT, I"CONFIG");
+ WRITE("Inform language definition:\n");
+ PluginManager::list_plugins(OUT, "Included", TRUE);
+ PluginManager::list_plugins(OUT, "Excluded", FALSE);
+ HTML_CLOSE("p");
+}
diff --git a/inform7/index-module/Chapter 2/Lexicon Index.w b/inform7/index-module/Chapter 2/Lexicon Index.w
index 728394b54..c07528aa4 100644
--- a/inform7/index-module/Chapter 2/Lexicon Index.w
+++ b/inform7/index-module/Chapter 2/Lexicon Index.w
@@ -523,7 +523,7 @@ void IndexLexicon::tabulate_meanings(OUTPUT_STREAM, index_lexicon_entry *lex) {
if (vu->where_vu_created)
Index::link(OUT, Wordings::first_wn(Node::get_text(vu->where_vu_created)));
binary_predicate *bp = VerbMeanings::get_regular_meaning_of_form(Verbs::base_form(VerbUsages::get_verb(vu)));
- if (bp) IXRelations::index_for_verbs(OUT, bp);
+ if (bp) IndexLexicon::show_relation(OUT, bp);
return;
}
preposition *prep;
@@ -532,7 +532,20 @@ void IndexLexicon::tabulate_meanings(OUTPUT_STREAM, index_lexicon_entry *lex) {
if (prep->where_prep_created)
Index::link(OUT, Wordings::first_wn(Node::get_text(prep->where_prep_created)));
binary_predicate *bp = VerbMeanings::get_regular_meaning_of_form(Verbs::find_form(copular_verb, prep, NULL));
- if (bp) IXRelations::index_for_verbs(OUT, bp);
+ if (bp) IndexLexicon::show_relation(OUT, bp);
return;
}
}
+
+void IndexLexicon::show_relation(OUTPUT_STREAM, binary_predicate *bp) {
+ WRITE(" ... ");
+ if (bp == NULL) WRITE("(a meaning internal to Inform)");
+ else {
+ if (bp->right_way_round == FALSE) {
+ bp = bp->reversal;
+ WRITE("reversed ");
+ }
+ WordAssemblages::index(OUT, &(bp->relation_name));
+ }
+ WRITE(" ");
+}
diff --git a/inform7/index-module/Chapter 2/Relations.w b/inform7/index-module/Chapter 2/Relations Element.w
similarity index 72%
rename from inform7/index-module/Chapter 2/Relations.w
rename to inform7/index-module/Chapter 2/Relations Element.w
index 14afec47d..6aceb529c 100644
--- a/inform7/index-module/Chapter 2/Relations.w
+++ b/inform7/index-module/Chapter 2/Relations Element.w
@@ -1,11 +1,11 @@
-[IXRelations::] Relations.
+[IXRelations::] Relations Element.
To index relations.
@ A brief table of relations appears on the Phrasebook Index page.
=
-void IXRelations::index_table(OUTPUT_STREAM) {
+void IXRelations::render(OUTPUT_STREAM) {
binary_predicate *bp;
HTML_OPEN("p");
HTML::begin_plain_html_table(OUT);
@@ -33,19 +33,3 @@ void IXRelations::index_table(OUTPUT_STREAM) {
HTML::end_html_table(OUT);
HTML_CLOSE("p");
}
-
-@ And a briefer note still for the table of verbs.
-
-=
-void IXRelations::index_for_verbs(OUTPUT_STREAM, binary_predicate *bp) {
- WRITE(" ... ");
- if (bp == NULL) WRITE("(a meaning internal to Inform)");
- else {
- if (bp->right_way_round == FALSE) {
- bp = bp->reversal;
- WRITE("reversed ");
- }
- WordAssemblages::index(OUT, &(bp->relation_name));
- }
- WRITE(" ");
-}
diff --git a/inform7/index-module/Chapter 2/Rules for Scenes Element.w b/inform7/index-module/Chapter 2/Rules for Scenes Element.w
new file mode 100644
index 000000000..75dcefb4a
--- /dev/null
+++ b/inform7/index-module/Chapter 2/Rules for Scenes Element.w
@@ -0,0 +1,20 @@
+[IXRulesForScenes::] Rules for Scenes Element.
+
+The RS element.
+
+@
+
+=
+void IXRulesForScenes::render(OUTPUT_STREAM) {
+ HTML_OPEN("p"); WRITE("The scene-changing machinery "); HTML_CLOSE("p");
+ IXRules::index_rules_box(OUT, "Scene changing", EMPTY_WORDING, NULL,
+ Rulebooks::std(SCENE_CHANGING_RB), NULL, NULL, 1, FALSE);
+ HTML_OPEN("p");
+ Index::anchor(OUT, I"SRULES");
+ WRITE("General rules applying to scene changes ");
+ HTML_CLOSE("p");
+ IXRules::index_rules_box(OUT, "When a scene begins", EMPTY_WORDING, NULL,
+ Rulebooks::std(WHEN_SCENE_BEGINS_RB), NULL, NULL, 1, FALSE);
+ IXRules::index_rules_box(OUT, "When a scene ends", EMPTY_WORDING, NULL,
+ Rulebooks::std(WHEN_SCENE_ENDS_RB), NULL, NULL, 1, FALSE);
+}
diff --git a/inform7/index-module/Chapter 2/Rules.w b/inform7/index-module/Chapter 2/Rules.w
index 140a9066c..a767f048e 100644
--- a/inform7/index-module/Chapter 2/Rules.w
+++ b/inform7/index-module/Chapter 2/Rules.w
@@ -411,12 +411,6 @@ int IXRules::noteworthy_rulebooks(inform_extension *E) {
return nb;
}
-void IXRules::index_scene(OUTPUT_STREAM) {
- HTML_OPEN("p"); WRITE("The scene-changing machinery "); HTML_CLOSE("p");
- IXRules::index_rules_box(OUT, "Scene changing", EMPTY_WORDING, NULL,
- Rulebooks::std(SCENE_CHANGING_RB), NULL, NULL, 1, FALSE);
-}
-
int unique_xtra_no = 0;
void IXRules::index_rules_box(OUTPUT_STREAM, char *name, wording W, text_stream *doc_link,
rulebook *rb, activity *av, char *text, int indent, int hide_behind_plus) {
@@ -643,64 +637,6 @@ void IXRules::index_outcomes(OUTPUT_STREAM, outcomes *outs, int suppress_outcome
}
}
-@
-
-=
-void IXRules::index_timed_rules(OUTPUT_STREAM) {
- int when_count = 0, tt_count = 0;
- @;
- @;
- if ((when_count == 0) && (tt_count == 0)) {
- HTML_OPEN("p"); WRITE("None. "); HTML_CLOSE("p");
- }
-}
-
-@ =
- id_body *idb;
- LOOP_OVER(idb, id_body) {
- int t = TimedRules::get_timing_of_event(idb->head_of_defn);
- if (t == NO_FIXED_TIME) {
- if (when_count == 0) {
- HTML_OPEN("p");
- WRITE("Events with no specific time ");
- HTML_CLOSE("p");
- }
- when_count++;
- HTML_OPEN_WITH("p", "class=\"tightin2\"");
- ImperativeDefinitions::index_preamble(OUT, idb->head_of_defn);
- if ((ImperativeDefinitions::body_at(idb)) &&
- (Wordings::nonempty(Node::get_text(ImperativeDefinitions::body_at(idb)))))
- Index::link(OUT, Wordings::first_wn(Node::get_text(ImperativeDefinitions::body_at(idb))));
- WRITE(" (where triggered: ");
- linked_list *L = TimedRules::get_uses_as_event(idb->head_of_defn);
- parse_node *p;
- LOOP_OVER_LINKED_LIST(p, parse_node, L)
- Index::link(OUT, Wordings::first_wn(Node::get_text(p)));
- WRITE(")");
- HTML_CLOSE("p");
- }
- }
-
-@ =
- id_body *idb;
- LOOP_OVER(idb, id_body) {
- int t = TimedRules::get_timing_of_event(idb->head_of_defn);
- if (t >= 0) { /* i.e., an actual time of day in minutes since midnight */
- if (tt_count == 0) {
- HTML_OPEN("p");
- WRITE("Timetable ");
- HTML_CLOSE("p");
- }
- tt_count++;
- HTML_OPEN_WITH("p", "class=\"in2\"");
- ImperativeDefinitions::index_preamble(OUT, idb->head_of_defn);
- if ((ImperativeDefinitions::body_at(idb)) &&
- (Wordings::nonempty(Node::get_text(ImperativeDefinitions::body_at(idb)))))
- Index::link(OUT, Wordings::first_wn(Node::get_text(ImperativeDefinitions::body_at(idb))));
- HTML_CLOSE("p");
- }
- }
-
@h Rule contexts.
These are mainly (only?) used in indexing, as a way to represent the idea of
being the relevant scene or action for a rule.
diff --git a/inform7/index-module/Chapter 2/Tables Element.w b/inform7/index-module/Chapter 2/Tables Element.w
new file mode 100644
index 000000000..9908d8983
--- /dev/null
+++ b/inform7/index-module/Chapter 2/Tables Element.w
@@ -0,0 +1,133 @@
+[IXTables::] Tables Element.
+
+To index tables.
+
+@h Indexing.
+Tables inside extensions are often used just for the storage needed to manage
+back-of-house algorithms, so to speak, and they aren't intended for the end
+user to poke around with; that's certainly true of the tables in the Standard
+Rules, which of course are always present. So these are hidden by default.
+
+=
+void IXTables::render(OUTPUT_STREAM) {
+ HTML_OPEN("p");
+ int m = IXTables::index_tables_in(OUT, NULL, 0);
+ HTML_CLOSE("p");
+ HTML_OPEN("p");
+ Index::extra_link(OUT, 2);
+ if (m > 0) WRITE("Show tables inside extensions too");
+ else WRITE("Show tables inside extensions (there are none in the main text)");
+ HTML_CLOSE("p");
+ Index::extra_div_open(OUT, 2, 1, "e0e0e0");
+ inform_extension *E; int efc = 0;
+ LOOP_OVER(E, inform_extension) IXTables::index_tables_in(OUT, E, efc++);
+ Index::extra_div_close(OUT, "e0e0e0");
+}
+
+@ This tabulates tables within a given extension, returning the number listed,
+and does nothing at all if that number is 0.
+
+=
+int IXTables::index_tables_in(OUTPUT_STREAM, inform_extension *E, int efc) {
+ int tc = 0; table *t;
+ LOOP_OVER(t, table) if (IXTables::table_within(t, E)) tc++;
+ if (tc > 0) {
+ if (E) {
+ HTML_OPEN("p");
+ WRITE("%S ", E->as_copy->edition->work->title);
+ HTML_CLOSE("p");
+ }
+ HTML::begin_plain_html_table(OUT);
+ LOOP_OVER(t, table)
+ if (IXTables::table_within(t, E))
+ @;
+ HTML::end_html_table(OUT);
+ }
+ return tc;
+}
+
+@ The following probably ought to use a multiplication sign rather than a
+Helvetica-style lower case "x", but life is full of compromises.
+
+@ =
+ HTML::first_html_column_spaced(OUT, 0);
+ WRITE("%+W ", Node::get_text(t->headline_fragment));
+ table_contribution *tc; int ntc = 0;
+ for (tc = t->table_created_at; tc; tc = tc->next) {
+ if (ntc++ > 0) WRITE(" +");
+ Index::link(OUT, Wordings::first_wn(Node::get_text(tc->source_table)));
+ }
+ HTML::next_html_column_spaced(OUT, 0);
+ int rc = Tables::get_no_rows(t);
+ WRITE("");
+ HTML_OPEN_WITH("span", "class=\"smaller\"");
+ if (t->first_column_by_definition) {
+ WRITE("%d definition%s", rc,
+ (rc == 1)?"":"s");
+ } else {
+ WRITE("%d column%s x %d row%s",
+ t->no_columns, (t->no_columns == 1)?"":"s",
+ rc, (rc == 1)?"":"s");
+ }
+ if (t->blank_rows > 0) {
+ WRITE(" (%d blank", t->blank_rows);
+ if (Wordings::nonempty(t->blank_rows_for_each_text))
+ WRITE(", one for each %+W", t->blank_rows_for_each_text);
+ WRITE(")");
+ }
+ HTML_CLOSE("span");
+ WRITE(" ");
+ HTML::end_html_row(OUT);
+ int col;
+ for (col = 0; col < t->no_columns; col++) {
+ HTML::first_html_column(OUT, 0);
+ WRITE(" col %d: ", col+1);
+ wording CW = Nouns::nominative_singular(t->columns[col].column_identity->name);
+ if ((t->first_column_by_definition) && (col == 0)) {
+ parse_node *PN = t->where_used_to_define;
+ WRITE("%+W", Node::get_text(PN));
+ Index::link(OUT, Wordings::first_wn(Node::get_text(PN)));
+ } else {
+ if (t->first_column_by_definition) WRITE("sets ");
+ WRITE("%+W ", CW);
+ TEMPORARY_TEXT(TEMP)
+ WRITE_TO(TEMP, "%+W", CW);
+ if (t->first_column_by_definition == FALSE) WRITE_TO(TEMP, " entry");
+ PasteButtons::paste_text(OUT, TEMP);
+ DISCARD_TEXT(TEMP)
+ }
+ HTML::next_html_column(OUT, 0);
+ if ((t->first_column_by_definition) && (col == 0)) {
+ parse_node *cell;
+ int row;
+ for (row = 1, cell = t->columns[0].entries->down; cell; cell = cell->next, row++) {
+ if (row > 1) WRITE(", ");
+ WRITE("%+W", Node::get_text(cell));
+ Index::link(OUT, Wordings::first_wn(Node::get_text(cell)));
+ }
+ } else if (t->first_column_by_definition) {
+ Kinds::Textual::write(OUT,
+ Tables::Columns::get_kind(
+ t->columns[col].column_identity));
+ WRITE(" property");
+ } else {
+ WRITE("of ");
+ Kinds::Textual::write_plural(OUT,
+ Tables::Columns::get_kind(
+ t->columns[col].column_identity));
+ }
+ HTML::end_html_row(OUT);
+ }
+
+@ The following laboriously tests whether a table is defined within a
+given extension:
+
+=
+int IXTables::table_within(table *t, inform_extension *E) {
+ if (t->amendment_of) return FALSE;
+ heading *at_heading =
+ Headings::of_wording(Node::get_text(t->table_created_at->source_table));
+ inform_extension *at_E = Headings::get_extension_containing(at_heading);
+ if (E == at_E) return TRUE;
+ return FALSE;
+}
diff --git a/inform7/index-module/Chapter 3/Actions.w b/inform7/index-module/Chapter 3/Actions.w
index d4d1a38aa..1b5af8bb7 100644
--- a/inform7/index-module/Chapter 3/Actions.w
+++ b/inform7/index-module/Chapter 3/Actions.w
@@ -170,32 +170,6 @@ void IXActions::act_index_something(OUTPUT_STREAM, action_name *an, int argc) {
WRITE(" ");
}
-void IXActions::index_named_patterns(OUTPUT_STREAM) {
- named_action_pattern *nap;
- int num_naps = NUMBER_CREATED(named_action_pattern);
-
- if (num_naps == 0) {
- HTML_OPEN("p");
- WRITE("No names for kinds of action have yet been defined.");
- HTML_CLOSE("p");
- }
-
- LOOP_OVER(nap, named_action_pattern) {
- HTML_OPEN("p"); WRITE("%+W ", Nouns::nominative_singular(nap->as_noun));
- Index::link(OUT, Wordings::first_wn(nap->text_of_declaration));
- HTML_TAG("br");
- WRITE(" defined as any of the following acts: \n");
- named_action_pattern_entry *nape;
- LOOP_OVER_LINKED_LIST(nape, named_action_pattern_entry, nap->patterns) {
- action_pattern *ap = nape->behaviour;
- HTML_TAG("br");
- WRITE(" %+W", ap->text_of_pattern);
- Index::link(OUT, Wordings::first_wn(ap->text_of_pattern));
- }
- HTML_CLOSE("p");
- }
-}
-
void IXActions::index_named_patterns_for_extension(OUTPUT_STREAM, source_file *sf, inform_extension *E) {
named_action_pattern *nap;
int kc = 0;
diff --git a/inform7/index-module/Chapter 3/External Files.w b/inform7/index-module/Chapter 3/External Files.w
deleted file mode 100644
index 7f51d9438..000000000
--- a/inform7/index-module/Chapter 3/External Files.w
+++ /dev/null
@@ -1,48 +0,0 @@
-[IXExternalFiles::] External Files.
-
-To produce the index of external files.
-
-@ This is more or less perfunctory, but still of some use, if only as a list.
-
-=
-void IXExternalFiles::index_all(OUTPUT_STREAM) {
- if (PluginManager::active(files_plugin) == FALSE) return;
- files_data *exf;
- if (NUMBER_CREATED(files_data) == 0) {
- HTML_OPEN("p");
- WRITE("This project doesn't read or write external files.");
- HTML_CLOSE("p");
- return;
- }
- HTML_OPEN("p");
- WRITE("List of External Files ");
- HTML_CLOSE("p");
- HTML::begin_html_table(OUT, "#ffffff", TRUE, 0, 0, 0, 0, 0);
- LOOP_OVER(exf, files_data) {
- HTML::first_html_column(OUT, THUMBNAIL_WIDTH+10);
- if (exf->file_is_binary) {
- HTML_TAG_WITH("img", "border=\"0\" src=\"inform:/doc_images/exf_binary.png\"");
- } else {
- HTML_TAG_WITH("img", "border=\"0\" src=\"inform:/doc_images/exf_text.png\"");
- }
- WRITE(" ");
- HTML::next_html_column(OUT, 0);
- WRITE("%+W", exf->name);
- Index::link(OUT, Wordings::first_wn(exf->name));
- HTML_TAG("br");
- WRITE("Filename: %s %N- owned by ",
- (exf->file_is_binary)?"- binary ":"",
- exf->unextended_filename);
- switch (exf->file_ownership) {
- case OWNED_BY_THIS_PROJECT: WRITE("this project"); break;
- case OWNED_BY_ANOTHER_PROJECT: WRITE("another project"); break;
- case OWNED_BY_SPECIFIC_PROJECT:
- WRITE("project with IFID number %S ",
- exf->IFID_of_owner);
- break;
- }
- HTML::end_html_row(OUT);
- }
- HTML::end_html_table(OUT);
- HTML_OPEN("p");
-}
diff --git a/inform7/index-module/Chapter 3/Figures Element.w b/inform7/index-module/Chapter 3/Figures Element.w
new file mode 100644
index 000000000..018e51edf
--- /dev/null
+++ b/inform7/index-module/Chapter 3/Figures Element.w
@@ -0,0 +1,264 @@
+[IXFigures::] Figures Element.
+
+To produce the index of figures.
+
+@
+
+=
+void IXFigures::render(OUTPUT_STREAM) {
+ IXFigures::index_all(OUT);
+ IXFigures::index_sounds(OUT);
+ IXFigures::index_files(OUT);
+}
+
+@ The index is presented with thumbnails of a given pixel width, which
+the HTML renderer automatically scales to fit. Height is adjusted so as
+to match this width, preserving the aspect ratio.
+
+@d THUMBNAIL_WIDTH 80
+
+=
+void IXFigures::index_all(OUTPUT_STREAM) {
+ if (PluginManager::active(figures_plugin) == FALSE) return;
+ figures_data *bf; FILE *FIGURE_FILE;
+ int MAX_INDEXED_FIGURES = global_compilation_settings.index_figure_thumbnails;
+ int rv;
+ if (NUMBER_CREATED(figures_data) < 2) { /* cover art always creates 1 */
+ HTML_OPEN("p"); WRITE("There are no figures, or illustrations, in this project.");
+ HTML_CLOSE("p"); return;
+ }
+ HTML_OPEN("p"); WRITE("List of Figures "); HTML_CLOSE("p");
+
+ HTML::begin_html_table(OUT, "#ffffff", TRUE, 0, 0, 0, 0, 0);
+ int count_of_displayed_figures = 0;
+ LOOP_OVER(bf, figures_data) {
+ if (bf->figure_number > 1) {
+ TEMPORARY_TEXT(line2)
+ unsigned int width = 0, height = 0;
+ rv = 0;
+ FIGURE_FILE = Filenames::fopen(bf->filename_of_image_file, "rb");
+ if (FIGURE_FILE) {
+ char *real_format = "JPEG";
+ rv = ImageFiles::get_JPEG_dimensions(FIGURE_FILE, &width, &height);
+ fclose(FIGURE_FILE);
+ if (rv == 0) {
+ FIGURE_FILE = Filenames::fopen(bf->filename_of_image_file, "rb");
+ if (FIGURE_FILE) {
+ real_format = "PNG";
+ rv = ImageFiles::get_PNG_dimensions(FIGURE_FILE, &width, &height);
+ fclose(FIGURE_FILE);
+ }
+ }
+ if (rv == 0) {
+ WRITE_TO(line2, "Unknown image format ");
+ HTML_TAG("br");
+ } else {
+ WRITE_TO(line2, "%s format: %d (width) by %d (height) pixels",
+ real_format, width, height);
+ HTML_TAG("br");
+ }
+ } else {
+ WRITE_TO(line2, "Missing from the Figures folder ");
+ HTML_TAG("br");
+ }
+ HTML::first_html_column(OUT, THUMBNAIL_WIDTH+10);
+ if (rv == 0) {
+ HTML_TAG_WITH("img", "border=\"0\" src=\"inform:/doc_images/image_problem.png\"");
+ WRITE(" ");
+ } else if (count_of_displayed_figures++ < MAX_INDEXED_FIGURES) {
+ HTML_TAG_WITH("img", "border=\"1\" src=\"file://%f\" width=\"%d\" height=\"%d\"",
+ bf->filename_of_image_file, THUMBNAIL_WIDTH, THUMBNAIL_WIDTH*height/width);
+ WRITE(" ");
+ } else {
+ HTML_OPEN_WITH("div", "style=\"width:%dpx; height:%dpx; border:1px solid; background-color:#6495ed;\"",
+ THUMBNAIL_WIDTH, THUMBNAIL_WIDTH*height/width);
+ WRITE(" ");
+ HTML_CLOSE("div");
+ }
+
+ HTML::next_html_column(OUT, 0);
+ WRITE("%+W", bf->name);
+ Index::link(OUT, Wordings::first_wn(bf->name));
+
+ TEMPORARY_TEXT(rel)
+ Filenames::to_text_relative(rel, bf->filename_of_image_file,
+ Projects::materials_path(Task::project()));
+ HTML_TAG("br");
+ WRITE("%SFilename: \"%S\" - resource number %d", line2, rel, bf->figure_number);
+ DISCARD_TEXT(rel)
+ HTML::end_html_row(OUT);
+ DISCARD_TEXT(line2)
+ }
+ }
+ HTML::end_html_table(OUT);
+ HTML_OPEN("p");
+ if (count_of_displayed_figures > MAX_INDEXED_FIGURES) {
+ WRITE("(Only the first %d thumbnails have been shown here, "
+ "to avoid Inform taking up too much memory. If you'd like to "
+ "see more, set 'Use index figure thumbnails of at least %d.', or "
+ "whatever number you want to wait for.)",
+ MAX_INDEXED_FIGURES, 10*MAX_INDEXED_FIGURES);
+ HTML_CLOSE("p");
+ }
+}
+
+@h Sounds Index.
+
+=
+void IXFigures::index_sounds(OUTPUT_STREAM) {
+ if (PluginManager::active(sounds_plugin) == FALSE) return;
+ sounds_data *bs; FILE *SOUND_FILE;
+ TEMPORARY_TEXT(line2)
+ int rv;
+ if (NUMBER_CREATED(sounds_data) == 0) {
+ HTML_OPEN("p");
+ WRITE("There are no sound effects in this project.");
+ HTML_CLOSE("p");
+ return;
+ }
+ HTML_OPEN("p"); WRITE("List of Sounds "); HTML_CLOSE("p");
+ WRITE("\n");
+ HTML::begin_html_table(OUT, "#ffffff", TRUE, 0, 0, 0, 0, 0);
+ LOOP_OVER(bs, sounds_data) {
+ unsigned int duration, pBitsPerSecond, pChannels, pSampleRate, fsize,
+ midi_version = 0, no_tracks = 0;
+ int preview = TRUE, waveform_style = TRUE;
+ rv = 0;
+ SOUND_FILE = Filenames::fopen(bs->filename_of_sound_file, "rb");
+ if (SOUND_FILE) {
+ char *real_format = "AIFF";
+ rv = SoundFiles::get_AIFF_duration(SOUND_FILE, &duration, &pBitsPerSecond,
+ &pChannels, &pSampleRate);
+ fseek(SOUND_FILE, 0, SEEK_END);
+ fsize = (unsigned int) (ftell(SOUND_FILE));
+ fclose(SOUND_FILE);
+ if (rv == 0) {
+ SOUND_FILE = Filenames::fopen(bs->filename_of_sound_file, "rb");
+ if (SOUND_FILE) {
+ real_format = "Ogg Vorbis";
+ preview = FALSE;
+ rv = SoundFiles::get_OggVorbis_duration(SOUND_FILE, &duration,
+ &pBitsPerSecond, &pChannels, &pSampleRate);
+ fclose(SOUND_FILE);
+ }
+ }
+ if (rv == 0) {
+ SOUND_FILE = Filenames::fopen(bs->filename_of_sound_file, "rb");
+ if (SOUND_FILE) {
+ waveform_style = FALSE;
+ real_format = "MIDI";
+ preview = TRUE;
+ rv = SoundFiles::get_MIDI_information(SOUND_FILE,
+ &midi_version, &no_tracks);
+ fclose(SOUND_FILE);
+ }
+ }
+ if (rv == 0) {
+ WRITE_TO(line2, "Unknown sound format ");
+ HTML_TAG("br");
+ } else {
+ if (waveform_style == FALSE) {
+ WRITE_TO(line2, "Type %d %s file with %d track%s",
+ midi_version, real_format, no_tracks,
+ (no_tracks == 1)?"":"s");
+ HTML_TAG("br");
+ WRITE("Warning: not officially supported in glulx yet ");
+ HTML_TAG("br");
+ } else {
+ int min = (duration/6000), sec = (duration%6000)/100,
+ centisec = (duration%100);
+ WRITE_TO(line2, "%d.%01dKB %s file: duration ",
+ fsize/1024, (fsize%1024)/102, real_format);
+ if (min > 0)
+ WRITE_TO(line2, "%d minutes ", min);
+ if ((sec > 0) || (centisec > 0)) {
+ if (centisec == 0)
+ WRITE_TO(line2, "%d seconds", sec);
+ else
+ WRITE_TO(line2, "%d.%02d seconds", sec, centisec);
+ } else WRITE_TO(line2, "exactly");
+ HTML_TAG("br");
+ WRITE_TO(line2, "Sampled as %d.%01dkHz %s (%d.%01d kilobits/sec)",
+ pSampleRate/1000, (pSampleRate%1000)/100,
+ (pChannels==1)?"Mono":"Stereo",
+ pBitsPerSecond/1000, (pSampleRate%1000)/100);
+ HTML_TAG("br");
+ }
+ }
+ } else {
+ WRITE_TO(line2, "Missing from the Sounds folder ");
+ HTML_TAG("br");
+ }
+ HTML::first_html_column(OUT, THUMBNAIL_WIDTH+10);
+ if (rv == 0) {
+ HTML_TAG_WITH("img", "border=\"0\" src=\"inform:/doc_images/image_problem.png\"");
+ } else if (preview) {
+ HTML_OPEN_WITH("embed",
+ "src=\"file://%f\" width=\"%d\" height=\"64\" "
+ "autostart=\"false\" volume=\"50%%\" mastersound",
+ bs->filename_of_sound_file, THUMBNAIL_WIDTH);
+ HTML_CLOSE("embed");
+ } else {
+ HTML_TAG_WITH("img", "border=\"0\" src=\"inform:/doc_images/sound_okay.png\"");
+ }
+ WRITE(" ");
+ HTML::next_html_column(OUT, 0);
+ WRITE("%+W", bs->name);
+ Index::link(OUT, Wordings::first_wn(bs->name));
+ TEMPORARY_TEXT(rel)
+ Filenames::to_text_relative(rel, bs->filename_of_sound_file,
+ Projects::materials_path(Task::project()));
+ HTML_TAG("br");
+ WRITE("%SFilename: \"%S\" - resource number %d", line2, rel, bs->sound_number);
+ DISCARD_TEXT(rel)
+ HTML::end_html_row(OUT);
+ }
+ HTML::end_html_table(OUT);
+ HTML_OPEN("p");
+ DISCARD_TEXT(line2)
+}
+
+@ This is more or less perfunctory, but still of some use, if only as a list.
+
+=
+void IXFigures::index_files(OUTPUT_STREAM) {
+ if (PluginManager::active(files_plugin) == FALSE) return;
+ files_data *exf;
+ if (NUMBER_CREATED(files_data) == 0) {
+ HTML_OPEN("p");
+ WRITE("This project doesn't read or write external files.");
+ HTML_CLOSE("p");
+ return;
+ }
+ HTML_OPEN("p");
+ WRITE("List of External Files ");
+ HTML_CLOSE("p");
+ HTML::begin_html_table(OUT, "#ffffff", TRUE, 0, 0, 0, 0, 0);
+ LOOP_OVER(exf, files_data) {
+ HTML::first_html_column(OUT, THUMBNAIL_WIDTH+10);
+ if (exf->file_is_binary) {
+ HTML_TAG_WITH("img", "border=\"0\" src=\"inform:/doc_images/exf_binary.png\"");
+ } else {
+ HTML_TAG_WITH("img", "border=\"0\" src=\"inform:/doc_images/exf_text.png\"");
+ }
+ WRITE(" ");
+ HTML::next_html_column(OUT, 0);
+ WRITE("%+W", exf->name);
+ Index::link(OUT, Wordings::first_wn(exf->name));
+ HTML_TAG("br");
+ WRITE("Filename: %s %N- owned by ",
+ (exf->file_is_binary)?"- binary ":"",
+ exf->unextended_filename);
+ switch (exf->file_ownership) {
+ case OWNED_BY_THIS_PROJECT: WRITE("this project"); break;
+ case OWNED_BY_ANOTHER_PROJECT: WRITE("another project"); break;
+ case OWNED_BY_SPECIFIC_PROJECT:
+ WRITE("project with IFID number %S ",
+ exf->IFID_of_owner);
+ break;
+ }
+ HTML::end_html_row(OUT);
+ }
+ HTML::end_html_table(OUT);
+ HTML_OPEN("p");
+}
diff --git a/inform7/index-module/Chapter 3/Figures.w b/inform7/index-module/Chapter 3/Figures.w
deleted file mode 100644
index 13c385232..000000000
--- a/inform7/index-module/Chapter 3/Figures.w
+++ /dev/null
@@ -1,94 +0,0 @@
-[IXFigures::] Figures.
-
-To produce the index of figures.
-
-@ The index is presented with thumbnails of a given pixel width, which
-the HTML renderer automatically scales to fit. Height is adjusted so as
-to match this width, preserving the aspect ratio.
-
-@d THUMBNAIL_WIDTH 80
-
-=
-void IXFigures::index_all(OUTPUT_STREAM) {
- if (PluginManager::active(figures_plugin) == FALSE) return;
- figures_data *bf; FILE *FIGURE_FILE;
- int MAX_INDEXED_FIGURES = global_compilation_settings.index_figure_thumbnails;
- int rv;
- if (NUMBER_CREATED(figures_data) < 2) { /* cover art always creates 1 */
- HTML_OPEN("p"); WRITE("There are no figures, or illustrations, in this project.");
- HTML_CLOSE("p"); return;
- }
- HTML_OPEN("p"); WRITE("List of Figures "); HTML_CLOSE("p");
-
- HTML::begin_html_table(OUT, "#ffffff", TRUE, 0, 0, 0, 0, 0);
- int count_of_displayed_figures = 0;
- LOOP_OVER(bf, figures_data) {
- if (bf->figure_number > 1) {
- TEMPORARY_TEXT(line2)
- unsigned int width = 0, height = 0;
- rv = 0;
- FIGURE_FILE = Filenames::fopen(bf->filename_of_image_file, "rb");
- if (FIGURE_FILE) {
- char *real_format = "JPEG";
- rv = ImageFiles::get_JPEG_dimensions(FIGURE_FILE, &width, &height);
- fclose(FIGURE_FILE);
- if (rv == 0) {
- FIGURE_FILE = Filenames::fopen(bf->filename_of_image_file, "rb");
- if (FIGURE_FILE) {
- real_format = "PNG";
- rv = ImageFiles::get_PNG_dimensions(FIGURE_FILE, &width, &height);
- fclose(FIGURE_FILE);
- }
- }
- if (rv == 0) {
- WRITE_TO(line2, "Unknown image format ");
- HTML_TAG("br");
- } else {
- WRITE_TO(line2, "%s format: %d (width) by %d (height) pixels",
- real_format, width, height);
- HTML_TAG("br");
- }
- } else {
- WRITE_TO(line2, "Missing from the Figures folder ");
- HTML_TAG("br");
- }
- HTML::first_html_column(OUT, THUMBNAIL_WIDTH+10);
- if (rv == 0) {
- HTML_TAG_WITH("img", "border=\"0\" src=\"inform:/doc_images/image_problem.png\"");
- WRITE(" ");
- } else if (count_of_displayed_figures++ < MAX_INDEXED_FIGURES) {
- HTML_TAG_WITH("img", "border=\"1\" src=\"file://%f\" width=\"%d\" height=\"%d\"",
- bf->filename_of_image_file, THUMBNAIL_WIDTH, THUMBNAIL_WIDTH*height/width);
- WRITE(" ");
- } else {
- HTML_OPEN_WITH("div", "style=\"width:%dpx; height:%dpx; border:1px solid; background-color:#6495ed;\"",
- THUMBNAIL_WIDTH, THUMBNAIL_WIDTH*height/width);
- WRITE(" ");
- HTML_CLOSE("div");
- }
-
- HTML::next_html_column(OUT, 0);
- WRITE("%+W", bf->name);
- Index::link(OUT, Wordings::first_wn(bf->name));
-
- TEMPORARY_TEXT(rel)
- Filenames::to_text_relative(rel, bf->filename_of_image_file,
- Projects::materials_path(Task::project()));
- HTML_TAG("br");
- WRITE("%SFilename: \"%S\" - resource number %d", line2, rel, bf->figure_number);
- DISCARD_TEXT(rel)
- HTML::end_html_row(OUT);
- DISCARD_TEXT(line2)
- }
- }
- HTML::end_html_table(OUT);
- HTML_OPEN("p");
- if (count_of_displayed_figures > MAX_INDEXED_FIGURES) {
- WRITE("(Only the first %d thumbnails have been shown here, "
- "to avoid Inform taking up too much memory. If you'd like to "
- "see more, set 'Use index figure thumbnails of at least %d.', or "
- "whatever number you want to wait for.)",
- MAX_INDEXED_FIGURES, 10*MAX_INDEXED_FIGURES);
- HTML_CLOSE("p");
- }
-}
diff --git a/inform7/index-module/Chapter 3/Scenes.w b/inform7/index-module/Chapter 3/Plot Element.w
similarity index 94%
rename from inform7/index-module/Chapter 3/Scenes.w
rename to inform7/index-module/Chapter 3/Plot Element.w
index 614a76fe0..331de229c 100644
--- a/inform7/index-module/Chapter 3/Scenes.w
+++ b/inform7/index-module/Chapter 3/Plot Element.w
@@ -1,4 +1,4 @@
-[IXScenes::] Scenes.
+[IXScenes::] Plot Element.
Parallel to the World index of space is the Scenes index of time,
and in this section we render it as HTML.
@@ -11,7 +11,7 @@ with a notation which takes a little bit of on-screen explanation, but
seems natural enough to learn in practice.
=
-void IXScenes::index(OUTPUT_STREAM) {
+void IXScenes::render(OUTPUT_STREAM) {
int nr = NUMBER_CREATED(scene);
scene **sorted = Memory::calloc(nr, sizeof(scene *), INDEX_SORTING_MREASON);
@;
@@ -23,11 +23,6 @@ void IXScenes::index(OUTPUT_STREAM) {
Memory::I7_array_free(sorted, INDEX_SORTING_MREASON, nr, sizeof(scene *));
}
-void IXScenes::index_rules(OUTPUT_STREAM) {
- IXRules::index_scene(OUT); /* rules in generic scene-ending rulebooks */
- @;
-}
-
@ As usual, we sort with the C library's |qsort|.
@ =
@@ -81,15 +76,6 @@ about and created but never made use of.)
"or subsequent time because the scene can begin in more than one way.");
HTML_CLOSE("p");
-@ =
- HTML_OPEN("p");
- Index::anchor(OUT, I"SRULES");
- WRITE("General rules applying to scene changes ");
- HTML_CLOSE("p");
- IXRules::index_rules_box(OUT, "When a scene begins", EMPTY_WORDING, NULL,
- Rulebooks::std(WHEN_SCENE_BEGINS_RB), NULL, NULL, 1, FALSE);
- IXRules::index_rules_box(OUT, "When a scene ends", EMPTY_WORDING, NULL,
- Rulebooks::std(WHEN_SCENE_ENDS_RB), NULL, NULL, 1, FALSE);
@ =
Index::anchor(OUT, I"SDETAILS");
diff --git a/inform7/index-module/Chapter 3/Sound Effects.w b/inform7/index-module/Chapter 3/Sound Effects.w
deleted file mode 100644
index bf9c5250a..000000000
--- a/inform7/index-module/Chapter 3/Sound Effects.w
+++ /dev/null
@@ -1,119 +0,0 @@
-[IXSounds::] Sound Effects.
-
-To produce the index of sound effects.
-
-@h Sounds Index.
-
-=
-void IXSounds::index_all(OUTPUT_STREAM) {
- if (PluginManager::active(sounds_plugin) == FALSE) return;
- sounds_data *bs; FILE *SOUND_FILE;
- TEMPORARY_TEXT(line2)
- int rv;
- if (NUMBER_CREATED(sounds_data) == 0) {
- HTML_OPEN("p");
- WRITE("There are no sound effects in this project.");
- HTML_CLOSE("p");
- return;
- }
- HTML_OPEN("p"); WRITE("List of Sounds "); HTML_CLOSE("p");
- WRITE("\n");
- HTML::begin_html_table(OUT, "#ffffff", TRUE, 0, 0, 0, 0, 0);
- LOOP_OVER(bs, sounds_data) {
- unsigned int duration, pBitsPerSecond, pChannels, pSampleRate, fsize,
- midi_version = 0, no_tracks = 0;
- int preview = TRUE, waveform_style = TRUE;
- rv = 0;
- SOUND_FILE = Filenames::fopen(bs->filename_of_sound_file, "rb");
- if (SOUND_FILE) {
- char *real_format = "AIFF";
- rv = SoundFiles::get_AIFF_duration(SOUND_FILE, &duration, &pBitsPerSecond,
- &pChannels, &pSampleRate);
- fseek(SOUND_FILE, 0, SEEK_END);
- fsize = (unsigned int) (ftell(SOUND_FILE));
- fclose(SOUND_FILE);
- if (rv == 0) {
- SOUND_FILE = Filenames::fopen(bs->filename_of_sound_file, "rb");
- if (SOUND_FILE) {
- real_format = "Ogg Vorbis";
- preview = FALSE;
- rv = SoundFiles::get_OggVorbis_duration(SOUND_FILE, &duration,
- &pBitsPerSecond, &pChannels, &pSampleRate);
- fclose(SOUND_FILE);
- }
- }
- if (rv == 0) {
- SOUND_FILE = Filenames::fopen(bs->filename_of_sound_file, "rb");
- if (SOUND_FILE) {
- waveform_style = FALSE;
- real_format = "MIDI";
- preview = TRUE;
- rv = SoundFiles::get_MIDI_information(SOUND_FILE,
- &midi_version, &no_tracks);
- fclose(SOUND_FILE);
- }
- }
- if (rv == 0) {
- WRITE_TO(line2, "Unknown sound format ");
- HTML_TAG("br");
- } else {
- if (waveform_style == FALSE) {
- WRITE_TO(line2, "Type %d %s file with %d track%s",
- midi_version, real_format, no_tracks,
- (no_tracks == 1)?"":"s");
- HTML_TAG("br");
- WRITE("Warning: not officially supported in glulx yet ");
- HTML_TAG("br");
- } else {
- int min = (duration/6000), sec = (duration%6000)/100,
- centisec = (duration%100);
- WRITE_TO(line2, "%d.%01dKB %s file: duration ",
- fsize/1024, (fsize%1024)/102, real_format);
- if (min > 0)
- WRITE_TO(line2, "%d minutes ", min);
- if ((sec > 0) || (centisec > 0)) {
- if (centisec == 0)
- WRITE_TO(line2, "%d seconds", sec);
- else
- WRITE_TO(line2, "%d.%02d seconds", sec, centisec);
- } else WRITE_TO(line2, "exactly");
- HTML_TAG("br");
- WRITE_TO(line2, "Sampled as %d.%01dkHz %s (%d.%01d kilobits/sec)",
- pSampleRate/1000, (pSampleRate%1000)/100,
- (pChannels==1)?"Mono":"Stereo",
- pBitsPerSecond/1000, (pSampleRate%1000)/100);
- HTML_TAG("br");
- }
- }
- } else {
- WRITE_TO(line2, "Missing from the Sounds folder ");
- HTML_TAG("br");
- }
- HTML::first_html_column(OUT, THUMBNAIL_WIDTH+10);
- if (rv == 0) {
- HTML_TAG_WITH("img", "border=\"0\" src=\"inform:/doc_images/image_problem.png\"");
- } else if (preview) {
- HTML_OPEN_WITH("embed",
- "src=\"file://%f\" width=\"%d\" height=\"64\" "
- "autostart=\"false\" volume=\"50%%\" mastersound",
- bs->filename_of_sound_file, THUMBNAIL_WIDTH);
- HTML_CLOSE("embed");
- } else {
- HTML_TAG_WITH("img", "border=\"0\" src=\"inform:/doc_images/sound_okay.png\"");
- }
- WRITE(" ");
- HTML::next_html_column(OUT, 0);
- WRITE("%+W", bs->name);
- Index::link(OUT, Wordings::first_wn(bs->name));
- TEMPORARY_TEXT(rel)
- Filenames::to_text_relative(rel, bs->filename_of_sound_file,
- Projects::materials_path(Task::project()));
- HTML_TAG("br");
- WRITE("%SFilename: \"%S\" - resource number %d", line2, rel, bs->sound_number);
- DISCARD_TEXT(rel)
- HTML::end_html_row(OUT);
- }
- HTML::end_html_table(OUT);
- HTML_OPEN("p");
- DISCARD_TEXT(line2)
-}
diff --git a/inform7/index-module/Contents.w b/inform7/index-module/Contents.w
index 6d3be115a..1a0fbd8a2 100644
--- a/inform7/index-module/Contents.w
+++ b/inform7/index-module/Contents.w
@@ -18,22 +18,25 @@ Chapter 2: Indexing
Adjectives
Variables
Properties
- Relations
+ Relations Element
Inferences
Rules
Activities
Phrasebook Index
+ Tables Element
+ Innards Element
+ Events Element
+ Rules for Scenes Element
+ Behaviour Element
Chapter 3: Indexing for Plugins
- Figures
- Sound Effects
- External Files
+ Figures Element
Spatial
The Player
Backdrops
Regions
The Map
- Scenes
+ Plot Element
Actions
Commands Index
diff --git a/inter/codegen-module/Chapter 6/Card Element.w b/inter/codegen-module/Chapter 6/Card Element.w
index 0ba51d805..4817a2029 100644
--- a/inter/codegen-module/Chapter 6/Card Element.w
+++ b/inter/codegen-module/Chapter 6/Card Element.w
@@ -7,7 +7,7 @@ natural way to present bibliographic data to the user. In effect, it's a
simplified form of the iFiction record, without the XML overhead.
=
-void CardElement::Library_Card(OUTPUT_STREAM) {
+void CardElement::render(OUTPUT_STREAM) {
inter_tree *I = Index::get_tree();
inter_package *pack = Inter::Packages::by_url(I, I"/main/completion/bibliographic");
diff --git a/inter/codegen-module/Chapter 6/Index File Services.w b/inter/codegen-module/Chapter 6/Index File Services.w
index 66322c424..a0f49f3f1 100644
--- a/inter/codegen-module/Chapter 6/Index File Services.w
+++ b/inter/codegen-module/Chapter 6/Index File Services.w
@@ -651,10 +651,44 @@ void Index::test_card(OUTPUT_STREAM, wording W) {
void Index::index_actual_element(OUTPUT_STREAM, text_stream *elt) {
if (Str::eq_wide_string(elt, L"Cd")) {
- CardElement::Library_Card(OUT);
+ CardElement::render(OUT);
return;
}
#ifdef CORE_MODULE
+ if (Str::eq_wide_string(elt, L"Tb")) {
+ IXTables::render(OUT);
+ return;
+ }
+ if (Str::eq_wide_string(elt, L"In")) {
+ IXInnards::render(OUT, Supervisor::current_vm());
+ return;
+ }
+ if (Str::eq_wide_string(elt, L"Rl")) {
+ IXRelations::render(OUT);
+ return;
+ }
+ if (Str::eq_wide_string(elt, L"Ev")) {
+ IXEvents::render(OUT);
+ return;
+ }
+ if (Str::eq_wide_string(elt, L"RS")) {
+ IXRulesForScenes::render(OUT);
+ return;
+ }
+ if (Str::eq_wide_string(elt, L"Pl")) {
+ IXScenes::render(OUT);
+ return;
+ }
+ if (Str::eq_wide_string(elt, L"Bh")) {
+ IXBehaviour::render(OUT);
+ return;
+ }
+ if (Str::eq_wide_string(elt, L"Fi")) {
+ IXFigures::render(OUT);
+ return;
+ }
+
+
if (Str::eq_wide_string(elt, L"C")) {
IndexHeadings::index(OUT);
IndexExtensions::index(OUT);
@@ -667,20 +701,6 @@ void Index::index_actual_element(OUTPUT_STREAM, text_stream *elt) {
Equations::index(OUT);
return;
}
- if (Str::eq_wide_string(elt, L"Fi")) {
- IXFigures::index_all(OUT);
- IXSounds::index_all(OUT);
- IXExternalFiles::index_all(OUT);
- return;
- }
- if (Str::eq_wide_string(elt, L"Tb")) {
- Tables::index(OUT);
- return;
- }
- if (Str::eq_wide_string(elt, L"In")) {
- IXActivities::innards(OUT, Supervisor::current_vm());
- return;
- }
if (Str::eq_wide_string(elt, L"Ph")) {
Phrases::Index::index_page_Phrasebook(OUT);
@@ -690,10 +710,6 @@ void Index::index_actual_element(OUTPUT_STREAM, text_stream *elt) {
IndexLexicon::index(OUT);
return;
}
- if (Str::eq_wide_string(elt, L"Rl")) {
- IXRelations::index_table(OUT);
- return;
- }
if (Str::eq_wide_string(elt, L"Vb")) {
IndexLexicon::index_verbs(OUT);
return;
@@ -718,22 +734,6 @@ void Index::index_actual_element(OUTPUT_STREAM, text_stream *elt) {
return;
}
- if (Str::eq_wide_string(elt, L"Pl")) {
- #ifdef IF_MODULE
- IXScenes::index(OUT);
- #endif
- return;
- }
- if (Str::eq_wide_string(elt, L"Ev")) {
- IXRules::index_timed_rules(OUT); /* rules which happen at set times of day */
- return;
- }
- if (Str::eq_wide_string(elt, L"RS")) {
- #ifdef IF_MODULE
- IXScenes::index_rules(OUT);
- #endif
- return;
- }
if (Str::eq_wide_string(elt, L"St")) {
IXRules::Rules_page(OUT, 1);
@@ -745,33 +745,19 @@ void Index::index_actual_element(OUTPUT_STREAM, text_stream *elt) {
}
if (Str::eq_wide_string(elt, L"A1")) {
- #ifdef IF_MODULE
CommandsIndex::page(OUT);
- #endif
- return;
- }
- if (Str::eq_wide_string(elt, L"Bh")) {
- #ifdef IF_MODULE
- IXActions::index_named_patterns(OUT);
- #endif
return;
}
if (Str::eq_wide_string(elt, L"Cm")) {
- #ifdef IF_MODULE
CommandsIndex::commands(OUT);
- #endif
return;
}
if (Str::eq_wide_string(elt, L"To")) {
- #ifdef IF_MODULE
CommandsIndex::tokens(OUT);
- #endif
return;
}
if (Str::eq_wide_string(elt, L"A2")) {
- #ifdef IF_MODULE
CommandsIndex::alphabetical(OUT);
- #endif
return;
}
#endif