Fixed merge order of help files.

This commit is contained in:
Scott Duensing 2026-04-09 19:03:01 -05:00
parent fe68899020
commit 3c886a97f6
44 changed files with 228 additions and 50 deletions

View file

@ -48,7 +48,8 @@ deploy-helpsrc:
HLPC = bin/host/dvxhlpc
SYSTEM_DHS = core/arch.dhs core/apiref.dhs \
SYSTEM_DHS = core/sysdoc.dhs \
core/arch.dhs core/apiref.dhs \
tasks/libtasks.dhs shell/dvxshell.dhs sql/dvxsql.dhs \
texthelp/texthelp.dhs listhelp/listhelp.dhs \
taskmgr/taskmgr.dhs serial/serial.dhs \

View file

@ -1,6 +1,7 @@
.section Libraries
.topic lib.basrt
.title BASIC Runtime Library
.toc 1 BASIC Runtime Library
.toc 0 BASIC Runtime Library
.index BASIC Runtime
.index BasVmT
.index BasValueT

View file

@ -1,3 +1,4 @@
.section Architecture
.topic api.overview
.title DVX GUI API Reference
.toc 0 DVX GUI API Reference

View file

@ -1,3 +1,4 @@
.section Architecture
.topic arch.overview
.title DVX Architecture Overview
.toc 0 System Overview

8
core/sysdoc.dhs Normal file
View file

@ -0,0 +1,8 @@
.topic sys.overview
.title DVX System Overview
.toc 0 System Overview
.default
.h1 DVX System Overview
DVX (DOS Visual eXecutive) is a graphical user interface environment for DOS, designed for 486-class hardware and above. This help file covers the system architecture, core API, libraries, and widget toolkit.

View file

@ -2,7 +2,7 @@
<html>
<head>
<meta charset="utf-8">
<title>DVX Architecture Overview</title>
<title>DVX System Overview</title>
<style>
body { font-family: sans-serif; margin: 0; padding: 0; display: flex; }
nav { width: 250px; min-width: 250px; background: #f0f0f0; padding: 16px;
@ -29,6 +29,9 @@ img { max-width: 100%; }
<nav>
<h3>Contents</h3>
<ul>
<li><a href="#sys.overview">System Overview</a></li>
<li><strong>Architecture</strong>
<ul>
<li><a href="#arch.overview">System Overview</a>
<ul>
<li><a href="#arch.layers">Five-Layer Architecture</a></li>
@ -53,9 +56,13 @@ img { max-width: 100%; }
<li><a href="#api.wm">dvxWm.h -- Layer 4: Window Manager</a></li>
<li><a href="#api.app">dvxApp.h -- Layer 5: Application API</a></li>
<li><a href="#api.widget">dvxWidget.h -- Widget System</a></li>
<li><a href="#libtasks">libtasks -- Cooperative Task Switching</a></li>
</ul>
</li>
</ul>
</li>
<li><strong>Libraries</strong>
<ul>
<li><a href="#libtasks">libtasks -- Cooperative Task Switching</a></li>
<li><a href="#shell.overview">DVX Shell Library</a>
<ul>
<li><a href="#shell.types">Types and Constants</a></li>
@ -64,7 +71,10 @@ img { max-width: 100%; }
<li><a href="#shell.config">Configuration API</a></li>
<li><a href="#shell.desktop">Desktop Callbacks</a></li>
<li><a href="#shell.info">System Information</a></li>
<li><a href="#sql.overview">dvxSql -- SQL Database Interface</a></li>
</ul>
</li>
<li><a href="#sql.overview">dvxSql -- SQL Database Interface</a>
<ul>
<li><a href="#sql.db">Database Operations</a></li>
<li><a href="#sql.cursor">Cursor Operations</a></li>
<li><a href="#sql.utility">Utility Functions</a></li>
@ -82,20 +92,29 @@ img { max-width: 100%; }
<li><a href="#lib.texthelp.mouseclick">widgetTextEditMouseClick</a></li>
<li><a href="#lib.texthelp.onkey">widgetTextEditOnKey</a></li>
<li><a href="#lib.texthelp.paintline">widgetTextEditPaintLine</a></li>
</ul>
</li>
<li><a href="#lib.listhelp">List Helper Library</a></li>
<li><a href="#lib.taskmgr">Task Manager</a></li>
<li><a href="#lib.serial">Serial Stack</a></li>
<li><a href="#lib.serial">Serial Stack</a>
<ul>
<li><a href="#lib.serial.rs232">RS-232 UART Driver</a></li>
<li><a href="#lib.serial.packet">Packet Transport</a></li>
<li><a href="#lib.serial.security">Security (DH + XTEA)</a></li>
<li><a href="#lib.serial.seclink">Secure Link</a></li>
<li><a href="#lib.basrt">BASIC Runtime Library</a></li>
</ul>
</li>
<li><a href="#lib.basrt">BASIC Runtime Library</a>
<ul>
<li><a href="#lib.basrt.values">Value System</a></li>
<li><a href="#lib.basrt.vm">Virtual Machine</a></li>
</ul>
</li>
<li><a href="#widget.base">Widget System</a>
</ul>
</li>
<li><strong>Widgets</strong>
<ul>
<li><a href="#widget.base">Widget System</a></li>
<li><a href="#widget.ansiterm">AnsiTerm</a></li>
<li><a href="#widget.box">Layout Containers</a></li>
<li><a href="#widget.box">Box (VBox / HBox / Frame)</a></li>
@ -742,6 +761,11 @@ img { max-width: 100%; }
</ul>
</nav>
<main>
<div class="topic" id="sys.overview">
<h1>DVX System Overview</h1>
<h2>DVX System Overview</h2>
<p>DVX (DOS Visual eXecutive) is a graphical user interface environment for DOS, designed for 486-class hardware and above. This help file covers the system architecture, core API, libraries, and widget toolkit.</p>
</div>
<div class="topic" id="arch.overview">
<h1>DVX Architecture Overview</h1>
<h2>DVX Architecture Overview</h2>

View file

@ -1,6 +1,7 @@
.section Libraries
.topic lib.listhelp
.title List Helper Library
.toc 1 List Helper Library
.toc 0 List Helper Library
.index listhelp
.index widgetDrawDropdownArrow
.index widgetMaxItemLen

View file

@ -1,6 +1,7 @@
.section Libraries
.topic lib.serial
.title Serial Stack
.toc 1 Serial Stack
.toc 0 Serial Stack
.index Serial
.index RS-232
.index HDLC

View file

@ -1,3 +1,4 @@
.section Libraries
.topic shell.overview
.title DVX Shell Library
.toc 0 DVX Shell Library

View file

@ -1,6 +1,7 @@
.section Libraries
.topic sql.overview
.title dvxSql -- SQL Database Interface
.toc 1 dvxSql -- SQL Database Interface
.toc 0 dvxSql -- SQL Database Interface
.default
.index dvxSql
.index SQL

View file

@ -1,6 +1,7 @@
.section Libraries
.topic lib.taskmgr
.title Task Manager
.toc 1 Task Manager
.toc 0 Task Manager
.index Task Manager
.index shellTaskMgrOpen
.index shellTaskMgrRefresh

View file

@ -1,6 +1,7 @@
.section Libraries
.topic libtasks
.title libtasks -- Cooperative Task Switching
.toc 1 libtasks -- Cooperative Task Switching
.toc 0 libtasks -- Cooperative Task Switching
.index libtasks
.index Task Switching
.index Cooperative Multitasking

View file

@ -1,3 +1,4 @@
.section Libraries
.topic lib.texthelp
.title Text Help Library
.toc 0 Text Help Library

View file

@ -39,6 +39,7 @@
#define MAX_LINE_LEN 1024
#define MAX_TRIGRAMS 65536
#define MAX_INCLUDE_DEPTH 16
#define MAX_SECTIONS 64
#define INITIAL_STRTAB_SIZE 65536
#define INITIAL_BUF_SIZE 65536
@ -56,6 +57,7 @@ typedef struct {
typedef struct {
char id[128];
char title[256];
char section[64]; // section group (e.g., "Libraries") or empty for root
RecordT *records;
int32_t recordCount;
int32_t recordCap;
@ -64,6 +66,7 @@ typedef struct {
typedef struct {
char title[256];
char section[64]; // section group this entry belongs to
int32_t topicIdx;
int32_t depth;
} TocEntryT;
@ -133,8 +136,9 @@ static int32_t errorCount = 0;
static bool quietMode = false;
// Parse state
static const char *currentFile = NULL;
static int32_t currentLine = 0;
static const char *currentFile = NULL;
static int32_t currentLine = 0;
static char currentSection[64] = {0};
// ---------------------------------------------------------------------------
// Prototypes
@ -161,6 +165,7 @@ static void parseDirective(const char *line, TopicT **curTopic, bool *inL
static void parseFile(const char *path, TopicT **curTopic, bool *inList, bool *inTable, bool *inCode, bool *inNote, uint8_t *noteFlags, char *para, int32_t *paraLen, int32_t includeDepth);
static void pass1Parse(int32_t fileCount, char **files);
static void pass2Wrap(void);
static void regroupTocBySections(void);
static void pass3StringTable(void);
static void pass4SearchIndex(void);
static int pass5Serialize(const char *outputPath);
@ -256,6 +261,7 @@ static TopicT *addTopic(const char *id) {
TopicT *t = &topics[topicCount++];
memset(t, 0, sizeof(*t));
snprintf(t->id, sizeof(t->id), "%s", id);
snprintf(t->section, sizeof(t->section), "%s", currentSection);
t->recordCap = 32;
t->records = malloc(sizeof(RecordT) * t->recordCap);
if (!t->records) {
@ -307,6 +313,7 @@ static void addTocEntry(const char *title, int32_t topicIdx, int32_t depth) {
TocEntryT *e = &tocEntries[tocCount++];
snprintf(e->title, sizeof(e->title), "%s", title);
e->title[sizeof(e->title) - 1] = '\0';
snprintf(e->section, sizeof(e->section), "%s", currentSection);
e->topicIdx = topicIdx;
e->depth = depth;
}
@ -464,6 +471,17 @@ static void parseDirective(const char *line, TopicT **curTopic, bool *inList, bo
return;
}
// Handle .section -- sets section group for subsequent topics/TOC entries
if (strcmp(directive, "section") == 0) {
if (*rest) {
snprintf(currentSection, sizeof(currentSection), "%s", rest);
currentSection[sizeof(currentSection) - 1] = '\0';
} else {
currentSection[0] = '\0';
}
return;
}
if (!*curTopic) {
emitError("directive .%s outside of a topic", directive);
return;
@ -631,6 +649,8 @@ static void parseFile(const char *path, TopicT **curTopic, bool *inList, bool *i
// Save and set parse state
const char *savedFile = currentFile;
int32_t savedLine = currentLine;
char savedSection[64];
memcpy(savedSection, currentSection, sizeof(savedSection));
currentFile = path;
currentLine = 0;
@ -723,6 +743,87 @@ static void parseFile(const char *path, TopicT **curTopic, bool *inList, bool *i
// Restore parse state
currentFile = savedFile;
currentLine = savedLine;
memcpy(currentSection, savedSection, sizeof(currentSection));
}
// ---------------------------------------------------------------------------
// regroupTocBySections -- reorder TOC entries by .section directives
//
// Entries with no section stay at the front in their original order.
// Each unique section (in order of first appearance) gets a depth-0
// header entry inserted, and all entries in that section are placed
// underneath with their depths bumped by 1.
// ---------------------------------------------------------------------------
static void regroupTocBySections(void) {
// Collect unique section names in order of first appearance
char sectionNames[MAX_SECTIONS][64];
int32_t sectionCount = 0;
for (int32_t i = 0; i < tocCount; i++) {
if (tocEntries[i].section[0] == '\0') {
continue;
}
bool found = false;
for (int32_t s = 0; s < sectionCount; s++) {
if (strcmp(sectionNames[s], tocEntries[i].section) == 0) {
found = true;
break;
}
}
if (!found) {
if (sectionCount >= MAX_SECTIONS) {
emitWarning("too many sections (max %d)", MAX_SECTIONS);
break;
}
snprintf(sectionNames[sectionCount], sizeof(sectionNames[0]), "%s", tocEntries[i].section);
sectionCount++;
}
}
if (sectionCount == 0) {
return;
}
TocEntryT *newToc = malloc(sizeof(TocEntryT) * MAX_TOC_ENTRIES);
if (!newToc) {
fprintf(stderr, "fatal: out of memory\n");
exit(1);
}
int32_t newCount = 0;
// Unsectioned entries first (original order, unchanged depths)
for (int32_t i = 0; i < tocCount; i++) {
if (tocEntries[i].section[0] == '\0') {
newToc[newCount++] = tocEntries[i];
}
}
// Each section: header entry + grouped entries with depth+1
for (int32_t s = 0; s < sectionCount; s++) {
// Insert section header (no topic)
TocEntryT *hdr = &newToc[newCount++];
snprintf(hdr->title, sizeof(hdr->title), "%s", sectionNames[s]);
hdr->section[0] = '\0';
hdr->topicIdx = -1;
hdr->depth = 0;
// All entries belonging to this section
for (int32_t i = 0; i < tocCount; i++) {
if (strcmp(tocEntries[i].section, sectionNames[s]) == 0) {
newToc[newCount] = tocEntries[i];
newToc[newCount].depth += 1;
newCount++;
}
}
}
memcpy(tocEntries, newToc, sizeof(TocEntryT) * newCount);
tocCount = newCount;
free(newToc);
hlpcInfo(" regrouped TOC: %d sections, %d entries\n", sectionCount, tocCount);
}
@ -741,6 +842,7 @@ static void pass1Parse(int32_t fileCount, char **files) {
int32_t paraLen = 0;
for (int32_t i = 0; i < fileCount; i++) {
currentSection[0] = '\0';
parseFile(files[i], &curTopic, &inList, &inTable, &inCode, &inNote, &noteFlags, para, &paraLen, 0);
}
@ -761,6 +863,9 @@ static void pass1Parse(int32_t fileCount, char **files) {
flushParagraph(curTopic, para, paraLen, type, flags);
}
// Regroup TOC entries by section
regroupTocBySections();
hlpcInfo(" %d topic(s), %d TOC entries, %d index entries, %d image(s)\n",
topicCount, tocCount, indexCount, imageCount);
}

View file

@ -1,6 +1,7 @@
.section Widgets
.topic widget.ansiterm
.title AnsiTerm
.toc 1 AnsiTerm
.toc 0 AnsiTerm
.index AnsiTerm
.index wgtAnsiTerm
.index Terminal

View file

@ -1,7 +1,8 @@
.section Widgets
.topic widget.box
.title Box (VBox / HBox / Frame)
.toc 1 Layout Containers
.toc 1 Box (VBox / HBox / Frame)
.toc 0 Layout Containers
.toc 0 Box (VBox / HBox / Frame)
.index VBox
.index HBox
.index Frame

View file

@ -1,6 +1,7 @@
.section Widgets
.topic widget.button
.title Button
.toc 1 Button
.toc 0 Button
.index Button
.index wgtButton

View file

@ -1,6 +1,7 @@
.section Widgets
.topic widget.canvas
.title Canvas
.toc 1 Canvas
.toc 0 Canvas
.index Canvas
.index wgtCanvas
.index wgtCanvasClear

View file

@ -1,6 +1,7 @@
.section Widgets
.topic widget.checkbox
.title Checkbox
.toc 1 Checkbox
.toc 0 Checkbox
.index Checkbox
.index wgtCheckbox
.index wgtCheckboxIsChecked

View file

@ -1,6 +1,7 @@
.section Widgets
.topic widget.combobox
.title ComboBox
.toc 1 ComboBox
.toc 0 ComboBox
.index ComboBox
.index wgtComboBox
.index wgtComboBoxSetItems

View file

@ -1,7 +1,8 @@
.section Widgets
.topic widget.datactrl
.title DataCtrl
.toc 1 Data Widgets
.toc 1 DataCtrl
.toc 0 Data Widgets
.toc 0 DataCtrl
.index DataCtrl
.index wgtDataCtrl
.index Database Binding

View file

@ -1,6 +1,7 @@
.section Widgets
.topic widget.dbgrid
.title DbGrid
.toc 1 DbGrid
.toc 0 DbGrid
.index DbGrid
.index wgtDbGrid
.index wgtDbGridSetDataWidget

View file

@ -1,6 +1,7 @@
.section Widgets
.topic widget.dropdown
.title Dropdown
.toc 1 Dropdown
.toc 0 Dropdown
.index Dropdown
.index wgtDropdown
.index wgtDropdownSetItems

View file

@ -1,7 +1,8 @@
.section Widgets
.topic widget.image
.title Image
.toc 1 Display Widgets
.toc 1 Image
.toc 0 Display Widgets
.toc 0 Image
.index Image
.index wgtImage
.index wgtImageFromFile

View file

@ -1,6 +1,7 @@
.section Widgets
.topic widget.imagebutton
.title ImageButton
.toc 1 ImageButton
.toc 0 ImageButton
.index ImageButton
.index wgtImageButton
.index wgtImageButtonFromFile

View file

@ -1,6 +1,7 @@
.section Widgets
.topic widget.label
.title Label
.toc 1 Label
.toc 0 Label
.index Label
.index wgtLabel
.index wgtLabelSetAlign

View file

@ -1,6 +1,7 @@
.section Widgets
.topic widget.listbox
.title ListBox
.toc 1 ListBox
.toc 0 ListBox
.index ListBox
.index wgtListBox
.index wgtListBoxSetItems

View file

@ -1,6 +1,7 @@
.section Widgets
.topic widget.listview
.title ListView
.toc 1 ListView
.toc 0 ListView
.index ListView
.index wgtListView
.index wgtListViewSetColumns

View file

@ -1,6 +1,7 @@
.section Widgets
.topic widget.progressbar
.title ProgressBar
.toc 1 ProgressBar
.toc 0 ProgressBar
.index ProgressBar
.index wgtProgressBar
.index wgtProgressBarV

View file

@ -1,6 +1,7 @@
.section Widgets
.topic widget.radio
.title Radio Button
.toc 1 Radio Button
.toc 0 Radio Button
.index Radio
.index RadioGroup
.index wgtRadio

View file

@ -1,6 +1,7 @@
.section Widgets
.topic widget.scrollpane
.title ScrollPane
.toc 1 ScrollPane
.toc 0 ScrollPane
.index ScrollPane
.index wgtScrollPane
.index wgtScrollPaneScrollToChild

View file

@ -1,6 +1,7 @@
.section Widgets
.topic widget.separator
.title Separator
.toc 1 Separator
.toc 0 Separator
.index Separator
.index wgtHSeparator
.index wgtVSeparator

View file

@ -1,6 +1,7 @@
.section Widgets
.topic widget.slider
.title Slider
.toc 1 Slider
.toc 0 Slider
.index Slider
.index wgtSlider
.index wgtSliderSetValue

View file

@ -1,6 +1,7 @@
.section Widgets
.topic widget.spacer
.title Spacer
.toc 1 Spacer
.toc 0 Spacer
.index Spacer
.index wgtSpacer

View file

@ -1,6 +1,7 @@
.section Widgets
.topic widget.spinner
.title Spinner
.toc 1 Spinner
.toc 0 Spinner
.index Spinner
.index wgtSpinner
.index wgtSpinnerSetValue

View file

@ -1,6 +1,7 @@
.section Widgets
.topic widget.splitter
.title Splitter
.toc 1 Splitter
.toc 0 Splitter
.index Splitter
.index wgtSplitter
.index wgtSplitterSetPos

View file

@ -1,6 +1,7 @@
.section Widgets
.topic widget.statusbar
.title StatusBar
.toc 1 StatusBar
.toc 0 StatusBar
.index StatusBar
.index wgtStatusBar

View file

@ -1,6 +1,7 @@
.section Widgets
.topic widget.tabcontrol
.title TabControl
.toc 1 TabControl
.toc 0 TabControl
.index TabControl
.index TabPage
.index wgtTabControl

View file

@ -1,7 +1,8 @@
.section Widgets
.topic widget.textinput
.title TextInput / TextArea
.toc 1 Input Widgets
.toc 1 TextInput / TextArea
.toc 0 Input Widgets
.toc 0 TextInput / TextArea
.index TextInput
.index TextArea
.index wgtTextInput

View file

@ -1,7 +1,8 @@
.section Widgets
.topic widget.timer
.title Timer
.toc 1 Non-Visual Widgets
.toc 1 Timer
.toc 0 Non-Visual Widgets
.toc 0 Timer
.index Timer
.index wgtTimer
.index wgtTimerStart

View file

@ -1,7 +1,8 @@
.section Widgets
.topic widget.toolbar
.title Toolbar
.toc 1 Container Widgets
.toc 1 Toolbar
.toc 0 Container Widgets
.toc 0 Toolbar
.index Toolbar
.index wgtToolbar

View file

@ -1,6 +1,7 @@
.section Widgets
.topic widget.treeview
.title TreeView
.toc 1 TreeView
.toc 0 TreeView
.index TreeView
.index TreeItem
.index wgtTreeView

View file

@ -1,3 +1,4 @@
.section Widgets
.topic widget.base
.title Base WidgetT (Common Properties, Events, and Operations)
.toc 0 Widget System

View file

@ -1,6 +1,7 @@
.section Widgets
.topic widget.wrapbox
.title WrapBox
.toc 1 WrapBox
.toc 0 WrapBox
.index WrapBox
.index wgtWrapBox