2021-05-31 19:45:44 +03:00
|
|
|
[InstalledFiles::] Installed Files.
|
|
|
|
|
|
|
|
Filenames for a few unmanaged files included in a standard Inform installation.
|
|
|
|
|
|
|
|
@ Inform needs a whole pile of files to have been installed on the host computer
|
|
|
|
before it can run: everything from the Standard Rules to a PDF file explaining
|
|
|
|
what interactive fiction is. They're never written to, only read. They are
|
|
|
|
stored in subdirectories called |Miscellany| or |HTML| of the internal nest;
|
|
|
|
but they're just plain old files, and are not managed by Inbuild as "copies".
|
|
|
|
|
|
|
|
@e CBLORB_REPORT_MODEL_IRES from 1
|
|
|
|
@e DOCUMENTATION_SNIPPETS_IRES
|
|
|
|
@e INTRO_BOOKLET_IRES
|
|
|
|
@e INTRO_POSTCARD_IRES
|
|
|
|
@e LARGE_DEFAULT_COVER_ART_IRES
|
|
|
|
@e SMALL_DEFAULT_COVER_ART_IRES
|
|
|
|
@e DOCUMENTATION_XREFS_IRES
|
|
|
|
@e JAVASCRIPT_FOR_STANDARD_PAGES_IRES
|
|
|
|
@e JAVASCRIPT_FOR_EXTENSIONS_IRES
|
|
|
|
@e JAVASCRIPT_FOR_ONE_EXTENSION_IRES
|
2022-05-05 01:23:12 +03:00
|
|
|
@e CSS_SET_BY_PLATFORM_IRES
|
2021-05-31 19:45:44 +03:00
|
|
|
@e CSS_FOR_STANDARD_PAGES_IRES
|
2022-07-26 02:01:56 +03:00
|
|
|
@e RESOURCE_JSON_REQS_IRES
|
|
|
|
@e REGISTRY_JSON_REQS_IRES
|
2023-07-10 23:34:25 +03:00
|
|
|
@e INBUILD_JSON_REQS_IRES
|
2022-10-29 14:11:58 +03:00
|
|
|
@e UNICODE_DATA_IRES
|
2021-05-31 19:45:44 +03:00
|
|
|
|
|
|
|
=
|
|
|
|
filename *InstalledFiles::filename(int ires) {
|
|
|
|
pathname *internal = INSTALLED_FILES_HTML_CALLBACK();
|
|
|
|
pathname *misc = Pathnames::down(internal, I"Miscellany");
|
|
|
|
pathname *models = Pathnames::down(internal, I"HTML");
|
|
|
|
switch (ires) {
|
|
|
|
case DOCUMENTATION_SNIPPETS_IRES:
|
|
|
|
return Filenames::in(misc, I"definitions.html");
|
|
|
|
case INTRO_BOOKLET_IRES:
|
|
|
|
return Filenames::in(misc, I"IntroductionToIF.pdf");
|
|
|
|
case INTRO_POSTCARD_IRES:
|
|
|
|
return Filenames::in(misc, I"Postcard.pdf");
|
|
|
|
case LARGE_DEFAULT_COVER_ART_IRES:
|
2022-04-06 13:14:15 +03:00
|
|
|
return Filenames::in(misc, I"DefaultCover.jpg");
|
2021-05-31 19:45:44 +03:00
|
|
|
case SMALL_DEFAULT_COVER_ART_IRES:
|
|
|
|
return Filenames::in(misc, I"Small Cover.jpg");
|
2022-07-26 02:01:56 +03:00
|
|
|
case RESOURCE_JSON_REQS_IRES:
|
|
|
|
return Filenames::in(misc, I"resource.jsonr");
|
|
|
|
case REGISTRY_JSON_REQS_IRES:
|
|
|
|
return Filenames::in(misc, I"registry.jsonr");
|
2023-07-10 23:34:25 +03:00
|
|
|
case INBUILD_JSON_REQS_IRES:
|
|
|
|
return Filenames::in(misc, I"inbuild.jsonr");
|
2022-10-29 14:11:58 +03:00
|
|
|
case UNICODE_DATA_IRES:
|
|
|
|
return Filenames::in(misc, I"UnicodeData.txt");
|
2021-05-31 19:45:44 +03:00
|
|
|
|
|
|
|
case CBLORB_REPORT_MODEL_IRES:
|
2022-05-05 01:23:12 +03:00
|
|
|
return InstalledFiles::varied_by_platform(models, I"CblorbModel.html");
|
2021-05-31 19:45:44 +03:00
|
|
|
case DOCUMENTATION_XREFS_IRES:
|
2022-05-05 01:23:12 +03:00
|
|
|
return InstalledFiles::varied_by_platform(models, I"xrefs.txt");
|
2021-05-31 19:45:44 +03:00
|
|
|
case JAVASCRIPT_FOR_STANDARD_PAGES_IRES:
|
2022-05-05 01:23:12 +03:00
|
|
|
return InstalledFiles::varied_by_platform(models, I"main.js");
|
2021-05-31 19:45:44 +03:00
|
|
|
case JAVASCRIPT_FOR_EXTENSIONS_IRES:
|
2022-05-05 01:23:12 +03:00
|
|
|
return InstalledFiles::varied_by_platform(models, I"extensions.js");
|
2021-05-31 19:45:44 +03:00
|
|
|
case JAVASCRIPT_FOR_ONE_EXTENSION_IRES:
|
2022-05-05 01:23:12 +03:00
|
|
|
return InstalledFiles::varied_by_platform(models, I"extensionfile.js");
|
|
|
|
case CSS_SET_BY_PLATFORM_IRES:
|
|
|
|
return InstalledFiles::varied_by_platform(models, I"platform.css");
|
2021-05-31 19:45:44 +03:00
|
|
|
case CSS_FOR_STANDARD_PAGES_IRES:
|
2022-05-05 01:23:12 +03:00
|
|
|
return InstalledFiles::varied_by_platform(models, I"main.css");
|
2022-08-01 23:26:41 +03:00
|
|
|
}
|
2021-05-31 19:45:44 +03:00
|
|
|
internal_error("unknown installation resource file");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2022-05-05 01:23:12 +03:00
|
|
|
@ This enables each platform to provide its own CSS and Javascript definitions,
|
|
|
|
if they would prefer that:
|
|
|
|
|
|
|
|
=
|
|
|
|
filename *InstalledFiles::varied_by_platform(pathname *models, text_stream *leafname) {
|
|
|
|
TEMPORARY_TEXT(variation)
|
|
|
|
WRITE_TO(variation, "%s-%S", PLATFORM_STRING, leafname);
|
|
|
|
/* NB: PLATFORM_STRING is a C string, so that %s is correct */
|
2023-09-25 20:40:53 +03:00
|
|
|
filename *F = Filenames::in(models, variation);
|
2022-05-05 01:23:12 +03:00
|
|
|
if (TextFiles::exists(F) == FALSE) F = Filenames::in(models, leafname);
|
|
|
|
DISCARD_TEXT(variation)
|
|
|
|
return F;
|
|
|
|
}
|
|
|
|
|
2022-08-01 23:26:41 +03:00
|
|
|
@ Or even for a different platform than the one we're running on:
|
|
|
|
|
|
|
|
=
|
|
|
|
filename *InstalledFiles::filename_for_platform(int ires, text_stream *platform) {
|
|
|
|
if (Str::len(platform) == 0) return InstalledFiles::filename(ires);
|
|
|
|
pathname *internal = INSTALLED_FILES_HTML_CALLBACK();
|
|
|
|
pathname *models = Pathnames::down(internal, I"HTML");
|
|
|
|
switch (ires) {
|
|
|
|
case CBLORB_REPORT_MODEL_IRES:
|
|
|
|
return InstalledFiles::varied_by_named_platform(models,
|
|
|
|
I"CblorbModel.html", platform);
|
|
|
|
case DOCUMENTATION_XREFS_IRES:
|
|
|
|
return InstalledFiles::varied_by_named_platform(models,
|
|
|
|
I"xrefs.txt", platform);
|
|
|
|
case JAVASCRIPT_FOR_STANDARD_PAGES_IRES:
|
|
|
|
return InstalledFiles::varied_by_named_platform(models,
|
|
|
|
I"main.js", platform);
|
|
|
|
case JAVASCRIPT_FOR_EXTENSIONS_IRES:
|
|
|
|
return InstalledFiles::varied_by_named_platform(models,
|
|
|
|
I"extensions.js", platform);
|
|
|
|
case JAVASCRIPT_FOR_ONE_EXTENSION_IRES:
|
|
|
|
return InstalledFiles::varied_by_named_platform(models,
|
|
|
|
I"extensionfile.js", platform);
|
|
|
|
case CSS_SET_BY_PLATFORM_IRES:
|
|
|
|
return InstalledFiles::varied_by_named_platform(models,
|
|
|
|
I"platform.css", platform);
|
|
|
|
case CSS_FOR_STANDARD_PAGES_IRES:
|
|
|
|
return InstalledFiles::varied_by_named_platform(models,
|
|
|
|
I"main.css", platform);
|
|
|
|
}
|
|
|
|
return InstalledFiles::filename(ires);
|
|
|
|
}
|
|
|
|
|
|
|
|
filename *InstalledFiles::varied_by_named_platform(pathname *models, text_stream *leafname,
|
|
|
|
text_stream *platform) {
|
|
|
|
TEMPORARY_TEXT(variation)
|
|
|
|
WRITE_TO(variation, "%S-%S", platform, leafname);
|
2023-09-25 20:40:53 +03:00
|
|
|
filename *F = Filenames::in(models, variation);
|
2022-08-01 23:26:41 +03:00
|
|
|
if (TextFiles::exists(F) == FALSE) F = Filenames::in(models, leafname);
|
|
|
|
DISCARD_TEXT(variation)
|
|
|
|
return F;
|
|
|
|
}
|
|
|
|
|
2021-07-01 02:33:52 +03:00
|
|
|
@ This directory also holds the |Basic.indext| and |Standard.indext| index
|
|
|
|
structure files, but in principle we allow a wider range of these to exist, so:
|
2021-05-31 19:45:44 +03:00
|
|
|
|
2021-07-01 02:33:52 +03:00
|
|
|
=
|
|
|
|
filename *InstalledFiles::index_structure_file(text_stream *leaf) {
|
|
|
|
pathname *internal = INSTALLED_FILES_HTML_CALLBACK();
|
|
|
|
pathname *misc = Pathnames::down(internal, I"Miscellany");
|
|
|
|
return Filenames::in(misc, leaf);
|
|
|
|
}
|