Reorganizing things preparing for next testing release. SDK added!

This commit is contained in:
Scott Duensing 2026-04-09 01:27:40 -05:00
parent c43c586f2f
commit 5ece172ad0
137 changed files with 9409 additions and 446 deletions

View file

@ -3,9 +3,9 @@
# Builds the full DVX stack: core library, task switcher,
# bootstrap loader, text help library, widgets, shell, and apps.
.PHONY: all clean core tasks loader texthelp listhelp widgets shell taskmgr serial sql apps tools deploy-helpsrc compile-help
.PHONY: all clean core tasks loader texthelp listhelp widgets shell taskmgr serial sql apps tools deploy-helpsrc compile-help deploy-sdk
all: core tasks loader texthelp listhelp tools widgets shell taskmgr serial sql apps deploy-helpsrc compile-help
all: core tasks loader texthelp listhelp tools widgets shell taskmgr serial sql apps deploy-helpsrc compile-help deploy-sdk
core:
$(MAKE) -C core
@ -46,23 +46,68 @@ apps: core tasks shell tools
deploy-helpsrc:
$(MAKE) -C tools deploy-helpsrc
HLPC = bin/dvxhlpc
HLPC = bin/host/dvxhlpc
SYSTEM_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 \
apps/dvxbasic/basrt.dhs \
widgets/wgtsys.dhs
BASIC_DHS = apps/dvxbasic/ideguide.dhs apps/dvxbasic/langref.dhs \
apps/dvxbasic/ctrlover.dhs apps/dvxbasic/form.dhs
compile-help:
$(HLPC) -o bin/apps/kpunch/dvxhelp/dvxhelp.hlp apps/dvxhelp/help.dhs
@mkdir -p docs
$(HLPC) -o bin/apps/kpunch/dvxhelp/dvxhelp.hlp \
--html docs/dvx_help_viewer.html \
apps/dvxhelp/help.dhs
$(HLPC) -o bin/apps/kpunch/progman/dvxhelp.hlp \
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 \
apps/dvxbasic/basrt.dhs \
widgets/wgtsys.dhs \
--html docs/dvx_system_reference.html \
$(SYSTEM_DHS) \
$$(find widgets -name "*.dhs" ! -path "widgets/wgtsys.dhs" | sort)
$(HLPC) -o bin/apps/kpunch/dvxbasic/dvxbasic.hlp \
apps/dvxbasic/ideguide.dhs apps/dvxbasic/langref.dhs \
apps/dvxbasic/ctrlover.dhs apps/dvxbasic/form.dhs \
--html docs/dvx_basic_reference.html \
$(BASIC_DHS) \
$$(find widgets -name "*.bhs" | sort)
SDKDIR = bin/sdk
deploy-sdk:
@echo "Building SDK..."
@mkdir -p $(SDKDIR)/include/core $(SDKDIR)/include/shell $(SDKDIR)/include/tasks $(SDKDIR)/include/sql
@mkdir -p $(SDKDIR)/samples/hello $(SDKDIR)/samples/widget
@# Core headers
@for f in core/dvxApp.h core/dvxTypes.h core/dvxWgt.h core/dvxWgtP.h \
core/dvxWm.h core/dvxDraw.h core/dvxVideo.h core/dvxComp.h \
core/dvxPrefs.h core/dvxDlg.h core/dvxRes.h core/dvxFont.h \
core/dvxCur.h core/dvxPal.h core/dvxPlat.h; do \
[ -f "$$f" ] || continue; \
cp "$$f" $(SDKDIR)/include/core/; \
done
@# Shell header
@cp shell/shellApp.h $(SDKDIR)/include/shell/ 2>/dev/null || true
@# Tasks header
@for f in tasks/taskSwch.h tasks/taskswitch.h; do \
[ -f "$$f" ] && cp "$$f" $(SDKDIR)/include/tasks/ && break; \
done
@# SQL header
@cp sql/dvxSql.h $(SDKDIR)/include/sql/ 2>/dev/null || true
@# Widget headers — one per widget
@for d in widgets/*/; do \
for h in "$$d"*.h; do \
[ -f "$$h" ] || continue; \
base=$$(basename "$$h"); \
wgt=$$(basename "$$d"); \
mkdir -p $(SDKDIR)/include/widget/"$$wgt"; \
cp "$$h" $(SDKDIR)/include/widget/"$$wgt"/; \
done; \
done
@# Samples and readme
@cp -r sdk/samples $(SDKDIR)/
@cp sdk/readme.txt $(SDKDIR)/README.TXT
clean:
$(MAKE) -C core clean
$(MAKE) -C tasks clean
@ -77,5 +122,6 @@ clean:
$(MAKE) -C apps clean
$(MAKE) -C tools clean
-rmdir obj 2>/dev/null
-rm -rf bin/config bin/widgets bin/libs
-rmdir bin/apps/cpanel bin/apps/imgview bin/apps/progman bin/apps/notepad bin/apps/clock bin/apps/dvxdemo bin/apps bin 2>/dev/null
-rm -rf bin/config bin/widgets bin/libs bin/sdk
-rm -f docs/*.html
-rmdir bin/apps/kpunch/cpanel bin/apps/kpunch/imgview bin/apps/kpunch/progman bin/apps/kpunch/notepad bin/apps/kpunch/clock bin/apps/kpunch/dvxdemo bin/apps/kpunch bin/apps bin 2>/dev/null

View file

@ -8,7 +8,7 @@ CFLAGS = -O2 -Wall -Wextra -Werror -Wno-type-limits -Wno-sign-compare -Wn
OBJDIR = ../obj/apps
BINDIR = ../bin/apps
DVXRES = ../bin/dvxres
DVXRES = ../bin/host/dvxres
# App definitions: each is a subdir with a single .c file
APPS = progman notepad clock dvxdemo cpanel imgview dvxhelp
@ -104,12 +104,12 @@ $(BINDIR)/kpunch/dvxhelp:
mkdir -p $(BINDIR)/kpunch/dvxhelp
# Dependencies
$(OBJDIR)/imgview.o: imgview/imgview.c ../core/dvxApp.h ../core/dvxDialog.h ../core/dvxWidget.h ../core/dvxWm.h ../core/dvxVideo.h ../shell/shellApp.h
$(OBJDIR)/cpanel.o: cpanel/cpanel.c ../core/dvxApp.h ../core/dvxDialog.h ../core/dvxPrefs.h ../core/dvxWidget.h ../core/dvxWm.h ../core/platform/dvxPlatform.h ../shell/shellApp.h
$(OBJDIR)/progman.o: progman/progman.c ../core/dvxApp.h ../core/dvxDialog.h ../core/dvxWidget.h ../core/dvxWm.h ../shell/shellApp.h ../shell/shellInfo.h
$(OBJDIR)/notepad.o: notepad/notepad.c ../core/dvxApp.h ../core/dvxDialog.h ../core/dvxWidget.h ../core/dvxWm.h ../shell/shellApp.h
$(OBJDIR)/clock.o: clock/clock.c ../core/dvxApp.h ../core/dvxWidget.h ../core/dvxDraw.h ../core/dvxVideo.h ../shell/shellApp.h ../tasks/taskswitch.h
$(OBJDIR)/dvxdemo.o: dvxdemo/dvxdemo.c ../core/dvxApp.h ../core/dvxDialog.h ../core/dvxWidget.h ../core/dvxWm.h ../core/dvxVideo.h ../shell/shellApp.h
$(OBJDIR)/imgview.o: imgview/imgview.c ../core/dvxApp.h ../core/dvxDlg.h ../core/dvxWgt.h ../core/dvxWm.h ../core/dvxVideo.h ../shell/shellApp.h
$(OBJDIR)/cpanel.o: cpanel/cpanel.c ../core/dvxApp.h ../core/dvxDlg.h ../core/dvxPrefs.h ../core/dvxWgt.h ../core/dvxWm.h ../core/platform/dvxPlat.h ../shell/shellApp.h
$(OBJDIR)/progman.o: progman/progman.c ../core/dvxApp.h ../core/dvxDlg.h ../core/dvxWgt.h ../core/dvxWm.h ../shell/shellApp.h ../shell/shellInf.h
$(OBJDIR)/notepad.o: notepad/notepad.c ../core/dvxApp.h ../core/dvxDlg.h ../core/dvxWgt.h ../core/dvxWm.h ../shell/shellApp.h
$(OBJDIR)/clock.o: clock/clock.c ../core/dvxApp.h ../core/dvxWgt.h ../core/dvxDraw.h ../core/dvxVideo.h ../shell/shellApp.h ../tasks/taskSwch.h
$(OBJDIR)/dvxdemo.o: dvxdemo/dvxdemo.c ../core/dvxApp.h ../core/dvxDlg.h ../core/dvxWgt.h ../core/dvxWm.h ../core/dvxVideo.h ../shell/shellApp.h
clean:
rm -f $(OBJDIR)/cpanel.o $(OBJDIR)/imgview.o $(OBJDIR)/progman.o $(OBJDIR)/notepad.o $(OBJDIR)/clock.o $(OBJDIR)/dvxdemo.o

View file

@ -19,11 +19,11 @@
// would starve the shell and all other apps.
#include "dvxApp.h"
#include "dvxWidget.h"
#include "dvxWgt.h"
#include "dvxDraw.h"
#include "dvxVideo.h"
#include "shellApp.h"
#include "taskswitch.h"
#include "taskSwch.h"
#include <stdint.h>
#include <stdbool.h>

View file

@ -10,20 +10,20 @@
// state captured when the control panel was opened.
#include "dvxApp.h"
#include "dvxDialog.h"
#include "dvxDlg.h"
#include "dvxPrefs.h"
#include "dvxWidget.h"
#include "widgetBox.h"
#include "widgetButton.h"
#include "widgetCanvas.h"
#include "widgetDropdown.h"
#include "widgetLabel.h"
#include "widgetListBox.h"
#include "widgetSlider.h"
#include "widgetSpacer.h"
#include "widgetTabControl.h"
#include "dvxWgt.h"
#include "box/box.h"
#include "button/button.h"
#include "canvas/canvas.h"
#include "dropdown/dropdown.h"
#include "label/label.h"
#include "listBox/listBox.h"
#include "slider/slider.h"
#include "spacer/spacer.h"
#include "tabControl/tabCtrl.h"
#include "dvxWm.h"
#include "dvxPlatform.h"
#include "dvxPlat.h"
#include "shellApp.h"
#include "stb_ds_wrap.h"

View file

@ -17,7 +17,7 @@ CFLAGS = -O2 -Wall -Wextra -Werror -Wno-type-limits -Wno-sign-compare -Wn
OBJDIR = ../../obj/dvxbasic
LIBSDIR = ../../bin/libs
APPDIR = ../../bin/apps/kpunch/dvxbasic
DVXRES = ../../bin/dvxres
DVXRES = ../../bin/host/dvxres
SAMPLES = samples/hello.bas samples/formtest.bas samples/clickme.bas samples/clickme.frm samples/input.bas
# Runtime library objects (VM + values)

View file

@ -7,11 +7,11 @@
#include "formrt.h"
#include "../compiler/codegen.h"
#include "../compiler/opcodes.h"
#include "dvxDialog.h"
#include "dvxDlg.h"
#include "dvxWm.h"
#include "widgetBox.h"
#include "widgetDataCtrl.h"
#include "widgetDbGrid.h"
#include "box/box.h"
#include "dataCtrl/dataCtrl.h"
#include "dbGrid/dbGrid.h"
#include "thirdparty/stb_ds_wrap.h"
#include <ctype.h>

View file

@ -13,7 +13,7 @@
#include "../runtime/vm.h"
#include "../runtime/values.h"
#include "dvxApp.h"
#include "dvxWidget.h"
#include "dvxWgt.h"
// ============================================================
// Forward declarations

View file

@ -8,8 +8,8 @@
#define IDE_DESIGNER_H
#include "dvxApp.h"
#include "dvxWidget.h"
#include "widgetCanvas.h"
#include "dvxWgt.h"
#include "canvas/canvas.h"
#include "stb_ds_wrap.h"

View file

@ -8,27 +8,27 @@
// work on real hardware inside the DVX windowing system.
#include "dvxApp.h"
#include "dvxCursor.h"
#include "dvxPlatform.h"
#include "dvxDialog.h"
#include "dvxCur.h"
#include "dvxPlat.h"
#include "dvxDlg.h"
#include "dvxPrefs.h"
#include "dvxWidget.h"
#include "dvxWidgetPlugin.h"
#include "dvxWgt.h"
#include "dvxWgtP.h"
#include "dvxWm.h"
#include "shellApp.h"
#include "widgetBox.h"
#include "widgetCheckbox.h"
#include "widgetImageButton.h"
#include "widgetLabel.h"
#include "widgetRadio.h"
#include "widgetTextInput.h"
#include "widgetDropdown.h"
#include "widgetButton.h"
#include "widgetSplitter.h"
#include "widgetStatusBar.h"
#include "widgetListView.h"
#include "widgetSeparator.h"
#include "widgetToolbar.h"
#include "box/box.h"
#include "checkbox/checkbox.h"
#include "imageButton/imgBtn.h"
#include "label/label.h"
#include "radio/radio.h"
#include "textInput/textInpt.h"
#include "dropdown/dropdown.h"
#include "button/button.h"
#include "splitter/splitter.h"
#include "statusBar/statBar.h"
#include "listView/listView.h"
#include "separator/separatr.h"
#include "toolbar/toolbar.h"
#include "ideDesigner.h"
#include "ideProject.h"

View file

@ -5,14 +5,14 @@
// when the user clicks OK.
#include "ideMenuEditor.h"
#include "dvxDialog.h"
#include "dvxDlg.h"
#include "dvxWm.h"
#include "widgetBox.h"
#include "widgetButton.h"
#include "widgetCheckbox.h"
#include "widgetLabel.h"
#include "widgetListBox.h"
#include "widgetTextInput.h"
#include "box/box.h"
#include "button/button.h"
#include "checkbox/checkbox.h"
#include "label/label.h"
#include "listBox/listBox.h"
#include "textInput/textInpt.h"
#include <stdio.h>
#include <stdlib.h>

View file

@ -23,16 +23,16 @@
#include "ideProject.h"
#include "dvxApp.h"
#include "dvxDialog.h"
#include "dvxDlg.h"
#include "dvxPrefs.h"
#include "dvxWm.h"
#include "widgetBox.h"
#include "widgetButton.h"
#include "widgetDropdown.h"
#include "widgetImage.h"
#include "widgetLabel.h"
#include "widgetTextInput.h"
#include "widgetTreeView.h"
#include "box/box.h"
#include "button/button.h"
#include "dropdown/dropdown.h"
#include "image/image.h"
#include "label/label.h"
#include "textInput/textInpt.h"
#include "treeView/treeView.h"
#include "thirdparty/stb_ds_wrap.h"

View file

@ -6,12 +6,12 @@
// property value to edit it via an InputBox dialog.
#include "ideProperties.h"
#include "dvxDialog.h"
#include "dvxDlg.h"
#include "dvxWm.h"
#include "widgetBox.h"
#include "widgetListView.h"
#include "widgetSplitter.h"
#include "widgetTreeView.h"
#include "box/box.h"
#include "listView/listView.h"
#include "splitter/splitter.h"
#include "treeView/treeView.h"
#include <dlfcn.h>
#include <stdio.h>

View file

@ -6,11 +6,11 @@
#include "ideToolbox.h"
#include "dvxApp.h"
#include "dvxResource.h"
#include "dvxRes.h"
#include "dvxWm.h"
#include "widgetBox.h"
#include "widgetButton.h"
#include "widgetImageButton.h"
#include "box/box.h"
#include "button/button.h"
#include "imageButton/imgBtn.h"
#include <stdio.h>
#include <stdlib.h>

View file

@ -16,7 +16,7 @@
#include "values.h"
#include "dvxTypes.h"
#include "dvxPlatform.h"
#include "dvxPlat.h"
#include <stdint.h>
#include <stdbool.h>

View file

@ -15,33 +15,33 @@
// The app has no persistent state -- it's purely a showcase.
#include "dvxApp.h"
#include "dvxDialog.h"
#include "dvxWidget.h"
#include "widgetAnsiTerm.h"
#include "widgetBox.h"
#include "widgetButton.h"
#include "widgetCanvas.h"
#include "widgetCheckbox.h"
#include "widgetComboBox.h"
#include "widgetDropdown.h"
#include "widgetImage.h"
#include "widgetImageButton.h"
#include "widgetLabel.h"
#include "widgetListBox.h"
#include "widgetListView.h"
#include "widgetProgressBar.h"
#include "widgetRadio.h"
#include "widgetScrollPane.h"
#include "widgetSeparator.h"
#include "widgetSlider.h"
#include "widgetSpacer.h"
#include "widgetSpinner.h"
#include "widgetSplitter.h"
#include "widgetStatusBar.h"
#include "widgetTabControl.h"
#include "widgetTextInput.h"
#include "widgetToolbar.h"
#include "widgetTreeView.h"
#include "dvxDlg.h"
#include "dvxWgt.h"
#include "ansiTerm/ansiTerm.h"
#include "box/box.h"
#include "button/button.h"
#include "canvas/canvas.h"
#include "checkbox/checkbox.h"
#include "comboBox/comboBox.h"
#include "dropdown/dropdown.h"
#include "image/image.h"
#include "imageButton/imgBtn.h"
#include "label/label.h"
#include "listBox/listBox.h"
#include "listView/listView.h"
#include "progressBar/progress.h"
#include "radio/radio.h"
#include "scrollPane/scrlPane.h"
#include "separator/separatr.h"
#include "slider/slider.h"
#include "spacer/spacer.h"
#include "spinner/spinner.h"
#include "splitter/splitter.h"
#include "statusBar/statBar.h"
#include "tabControl/tabCtrl.h"
#include "textInput/textInpt.h"
#include "toolbar/toolbar.h"
#include "treeView/treeView.h"
#include "dvxWm.h"
#include "shellApp.h"

View file

@ -12,21 +12,21 @@
#include "hlpformat.h"
#include "dvxApp.h"
#include "dvxDialog.h"
#include "dvxWidget.h"
#include "dvxWidgetPlugin.h"
#include "dvxDlg.h"
#include "dvxWgt.h"
#include "dvxWgtP.h"
#include "dvxWm.h"
#include "dvxDraw.h"
#include "dvxVideo.h"
#include "dvxPlatform.h"
#include "dvxPlat.h"
#include "shellApp.h"
#include "widgetBox.h"
#include "widgetButton.h"
#include "widgetSplitter.h"
#include "widgetTreeView.h"
#include "widgetScrollPane.h"
#include "widgetToolbar.h"
#include "widgetImage.h"
#include "box/box.h"
#include "button/button.h"
#include "splitter/splitter.h"
#include "treeView/treeView.h"
#include "scrollPane/scrlPane.h"
#include "toolbar/toolbar.h"
#include "image/image.h"
#include <stdint.h>
#include <stdbool.h>

View file

@ -5,8 +5,8 @@
// Open files via the File menu or by launching with Run in the Task Manager.
#include "dvxApp.h"
#include "dvxDialog.h"
#include "dvxWidget.h"
#include "dvxDlg.h"
#include "dvxWgt.h"
#include "dvxWm.h"
#include "shellApp.h"
#include "stb_image_wrap.h"

View file

@ -11,11 +11,11 @@
// up menus and file I/O around it.
#include "dvxApp.h"
#include "dvxDialog.h"
#include "dvxWidget.h"
#include "widgetTextInput.h"
#include "dvxDlg.h"
#include "dvxWgt.h"
#include "textInput/textInpt.h"
#include "dvxWm.h"
#include "dvxPlatform.h"
#include "dvxPlat.h"
#include "shellApp.h"
#include <stdint.h>

View file

@ -19,22 +19,22 @@
// list current without polling.
#include "dvxApp.h"
#include "dvxDialog.h"
#include "dvxDlg.h"
#include "dvxPrefs.h"
#include "dvxWidget.h"
#include "widgetBox.h"
#include "widgetButton.h"
#include "widgetLabel.h"
#include "widgetStatusBar.h"
#include "widgetTextInput.h"
#include "dvxWgt.h"
#include "box/box.h"
#include "button/button.h"
#include "label/label.h"
#include "statusBar/statBar.h"
#include "textInput/textInpt.h"
#include "dvxWm.h"
#include "dvxPlatform.h"
#include "dvxPlat.h"
#include "shellApp.h"
#include "shellInfo.h"
#include "dvxResource.h"
#include "widgetImageButton.h"
#include "widgetScrollPane.h"
#include "widgetWrapBox.h"
#include "shellInf.h"
#include "dvxRes.h"
#include "imageButton/imgBtn.h"
#include "scrollPane/scrlPane.h"
#include "wrapBox/wrapBox.h"
#include <stdint.h>
#include <stdbool.h>

View file

@ -55,18 +55,18 @@ $(TARGETDIR):
mkdir -p $(TARGETDIR)
# Dependencies
CORE_HDRS = dvxTypes.h dvxApp.h dvxDraw.h dvxWm.h dvxVideo.h dvxWidget.h platform/dvxPlatform.h
$(OBJDIR)/dvxVideo.o: dvxVideo.c dvxVideo.h platform/dvxPlatform.h dvxTypes.h dvxPalette.h
$(OBJDIR)/dvxDraw.o: dvxDraw.c dvxDraw.h platform/dvxPlatform.h dvxTypes.h
$(OBJDIR)/dvxComp.o: dvxComp.c dvxComp.h platform/dvxPlatform.h dvxTypes.h
$(OBJDIR)/dvxWm.o: dvxWm.c dvxWm.h dvxTypes.h dvxDraw.h dvxComp.h dvxVideo.h dvxWidget.h platform/dvxPlatform.h thirdparty/stb_image.h
CORE_HDRS = dvxTypes.h dvxApp.h dvxDraw.h dvxWm.h dvxVideo.h dvxWgt.h platform/dvxPlat.h
$(OBJDIR)/dvxVideo.o: dvxVideo.c dvxVideo.h platform/dvxPlat.h dvxTypes.h dvxPal.h
$(OBJDIR)/dvxDraw.o: dvxDraw.c dvxDraw.h platform/dvxPlat.h dvxTypes.h
$(OBJDIR)/dvxComp.o: dvxComp.c dvxComp.h platform/dvxPlat.h dvxTypes.h
$(OBJDIR)/dvxWm.o: dvxWm.c dvxWm.h dvxTypes.h dvxDraw.h dvxComp.h dvxVideo.h dvxWgt.h platform/dvxPlat.h thirdparty/stb_image.h
$(OBJDIR)/dvxImage.o: dvxImage.c thirdparty/stb_image.h
$(OBJDIR)/dvxImageWrite.o: dvxImageWrite.c thirdparty/stb_image_write.h
$(OBJDIR)/dvxApp.o: dvxApp.c dvxApp.h platform/dvxPlatform.h dvxTypes.h dvxVideo.h dvxDraw.h dvxComp.h dvxWm.h dvxFont.h dvxCursor.h
$(OBJDIR)/dvxDialog.o: dvxDialog.c dvxDialog.h platform/dvxPlatform.h dvxApp.h dvxWidget.h dvxWidgetPlugin.h dvxTypes.h dvxDraw.h
$(OBJDIR)/dvxApp.o: dvxApp.c dvxApp.h platform/dvxPlat.h dvxTypes.h dvxVideo.h dvxDraw.h dvxComp.h dvxWm.h dvxFont.h dvxCur.h
$(OBJDIR)/dvxDialog.o: dvxDialog.c dvxDlg.h platform/dvxPlat.h dvxApp.h dvxWgt.h dvxWgtP.h dvxTypes.h dvxDraw.h
$(OBJDIR)/dvxPrefs.o: dvxPrefs.c dvxPrefs.h
WIDGET_DEPS = dvxWidgetPlugin.h dvxWidget.h dvxTypes.h dvxApp.h dvxDraw.h dvxWm.h dvxVideo.h platform/dvxPlatform.h
WIDGET_DEPS = dvxWgtP.h dvxWgt.h dvxTypes.h dvxApp.h dvxDraw.h dvxWm.h dvxVideo.h platform/dvxPlat.h
$(OBJDIR)/widgetClass.o: widgetClass.c $(WIDGET_DEPS)
$(OBJDIR)/widgetCore.o: widgetCore.c $(WIDGET_DEPS)
$(OBJDIR)/widgetScrollbar.o: widgetScrollbar.c $(WIDGET_DEPS)

View file

@ -30,15 +30,15 @@
// order of magnitude slower than system RAM writes on period hardware.
#include "dvxApp.h"
#include "dvxDialog.h"
#include "dvxWidget.h"
#include "dvxWidgetPlugin.h"
#include "../widgets/widgetTimer.h"
#include "dvxDlg.h"
#include "dvxWgt.h"
#include "dvxWgtP.h"
#include "../widgets/timer/timer.h"
#include "dvxFont.h"
#include "dvxCursor.h"
#include "dvxCur.h"
#include "dvxPlatform.h"
#include "dvxResource.h"
#include "dvxPlat.h"
#include "dvxRes.h"
#include "thirdparty/stb_ds_wrap.h"
#include <string.h>

View file

@ -13,9 +13,9 @@
#ifndef DVX_APP_H
#define DVX_APP_H
#include "dvxCursor.h"
#include "dvxCur.h"
#include "dvxTypes.h"
#include "dvxPlatform.h"
#include "dvxPlat.h"
#include "dvxVideo.h"
#include "dvxDraw.h"
#include "dvxComp.h"

View file

@ -18,7 +18,7 @@
// exactly once per pixel per frame.
#include "dvxComp.h"
#include "dvxPlatform.h"
#include "dvxPlat.h"
#include <stdlib.h>
#include <string.h>

View file

@ -1,4 +1,4 @@
// dvxCursor.h -- Embedded mouse cursor bitmaps for DVX GUI
// dvxCur.h -- Embedded mouse cursor bitmaps for DVX GUI
//
// All cursor shapes are compiled in as static const data -- no external
// cursor files to load. This is intentional: the cursors are needed
@ -14,8 +14,8 @@
// The cursor table (dvxCursors[]) at the bottom provides all five shapes
// in an array indexed by CURSOR_xxx constants, with hotspot coordinates
// set appropriately (arrow hot spot at tip, resize cursors at center).
#ifndef DVX_CURSOR_H
#define DVX_CURSOR_H
#ifndef DVX_CUR_H
#define DVX_CUR_H
#include "dvxTypes.h"
@ -417,4 +417,4 @@ static const CursorT dvxCursors[CURSOR_COUNT] = {
// the multi-cursor support.
static const CursorT dvxCursor = { 16, 16, 0, 0, cursorArrowAnd, cursorArrowXor };
#endif // DVX_CURSOR_H
#endif // DVX_CUR_H

View file

@ -20,18 +20,18 @@
// keeps the state accessible to callback functions without threading
// context pointers through every widget callback.
#include "dvxDialog.h"
#include "dvxPlatform.h"
#include "dvxWidget.h"
#include "dvxWidgetPlugin.h"
#include "../widgets/widgetBox.h"
#include "../widgets/widgetButton.h"
#include "../widgets/widgetDropdown.h"
#include "../widgets/widgetLabel.h"
#include "../widgets/widgetListBox.h"
#include "../widgets/widgetSpacer.h"
#include "../widgets/widgetSpinner.h"
#include "../widgets/widgetTextInput.h"
#include "dvxDlg.h"
#include "dvxPlat.h"
#include "dvxWgt.h"
#include "dvxWgtP.h"
#include "../widgets/box/box.h"
#include "../widgets/button/button.h"
#include "../widgets/dropdown/dropdown.h"
#include "../widgets/label/label.h"
#include "../widgets/listBox/listBox.h"
#include "../widgets/spacer/spacer.h"
#include "../widgets/spinner/spinner.h"
#include "../widgets/textInput/textInpt.h"
#include <ctype.h>
#include <dirent.h>

View file

@ -1,4 +1,4 @@
// dvxDialog.h -- Modal dialogs for DVX GUI
// dvxDlg.h -- Modal dialogs for DVX GUI
//
// Provides pre-built modal dialog boxes (message box, file dialog) that
// block the caller and run their own event loop via dvxUpdate() until the
@ -8,8 +8,8 @@
// The flag encoding uses separate bit fields for button configuration
// (low nibble) and icon type (high nibble) so they can be OR'd together
// in a single int32_t argument, matching the Win16 MessageBox() convention.
#ifndef DVX_DIALOG_H
#define DVX_DIALOG_H
#ifndef DVX_DLG_H
#define DVX_DLG_H
#include "dvxApp.h"
@ -114,4 +114,4 @@ int32_t dvxPromptSave(AppContextT *ctx, const char *title);
bool dvxChoiceDialog(AppContextT *ctx, const char *title, const char *prompt, const char **items, int32_t itemCount, int32_t defaultIdx, int32_t *outIdx);
#endif // DVX_DIALOG_H
#endif // DVX_DLG_H

View file

@ -50,8 +50,8 @@
// unlikely, helping the branch predictor on Pentium and later.
#include "dvxDraw.h"
#include "dvxPalette.h"
#include "dvxPlatform.h"
#include "dvxPal.h"
#include "dvxPlat.h"
#include <stdlib.h>
#include <string.h>

View file

@ -1,4 +1,4 @@
// dvx_palette.h -- 8-bit mode palette definition for DVX GUI
// dvxPal.h -- 8-bit mode palette definition for DVX GUI
//
// Defines the 256-color palette used in 8-bit (VGA Mode 13h / VESA 8bpp)
// video modes. The palette layout follows the same strategy as the X11
@ -15,8 +15,8 @@
//
// This partition gives good general-purpose color reproduction while
// guaranteeing the UI has pixel-perfect colors for its chrome elements.
#ifndef DVX_PALETTE_H
#define DVX_PALETTE_H
#ifndef DVX_PAL_H
#define DVX_PAL_H
#include <stdint.h>
@ -156,4 +156,4 @@ static inline uint8_t dvxNearestPalEntry(const uint8_t *pal, uint8_t r, uint8_t
return bestIdx;
}
#endif // DVX_PALETTE_H
#endif // DVX_PAL_H

View file

@ -1,4 +1,4 @@
// dvxResource.h -- DVX resource format and runtime API
// dvxRes.h -- DVX resource format and runtime API
//
// Resources are appended to DXE3 files (.app, .wgt, .lib) after the
// normal DXE content. dlopen never reads past the DXE header-specified
@ -13,12 +13,12 @@
// Reading starts from the end: seek to EOF - sizeof(footer), verify
// the magic, then seek to the directory and read entries.
#ifndef DVX_RESOURCE_H
#define DVX_RESOURCE_H
#ifndef DVX_RES_H
#define DVX_RES_H
#include <stdint.h>
#include "dvxPlatform.h"
#include "dvxPlat.h"
// Resource type IDs
#define DVX_RES_ICON 1 // image data (BMP icon: 16x16, 32x32, etc.)
@ -72,4 +72,4 @@ const DvxResDirEntryT *dvxResFind(DvxResHandleT *h, const char *name);
// Close the handle and free all associated memory.
void dvxResClose(DvxResHandleT *h);
#endif // DVX_RESOURCE_H
#endif // DVX_RES_H

View file

@ -3,7 +3,7 @@
// Reads the resource block appended to DXE3 files. The resource
// block is located by reading the footer at the end of the file.
#include "dvxResource.h"
#include "dvxRes.h"
#include <stdio.h>
#include <stdlib.h>

View file

@ -42,8 +42,8 @@
// shuffling.
#include "dvxVideo.h"
#include "dvxPlatform.h"
#include "dvxPalette.h"
#include "dvxPlat.h"
#include "dvxPal.h"
#include <stdlib.h>
#include <string.h>

View file

@ -1,4 +1,4 @@
// dvxWidget.h -- Widget system for DVX GUI
// dvxWgt.h -- Widget system for DVX GUI
//
// A retained-mode widget toolkit layered on top of the DVX window manager.
// Widgets form a tree (parent-child via firstChild/lastChild/nextSibling
@ -27,8 +27,8 @@
// this halves the pointer overhead per widget and insertion/removal is
// still O(n) in the worst case, which is acceptable given typical tree
// depths of 5-10 nodes.
#ifndef DVX_WIDGET_H
#define DVX_WIDGET_H
#ifndef DVX_WGT_H
#define DVX_WGT_H
#include "dvxTypes.h"
@ -646,4 +646,4 @@ void wgtIfaceSetPath(const char *name, const char *path);
// Used to construct suffixed resource names (e.g. "name-2", "icon16-2").
int32_t wgtIfaceGetPathIndex(const char *name);
#endif // DVX_WIDGET_H
#endif // DVX_WGT_H

View file

@ -1,4 +1,4 @@
// dvxWidgetPlugin.h -- Plugin API for DVX widget DXE modules
// dvxWgtP.h -- Plugin API for DVX widget DXE modules
//
// Included by widget .c files to access core infrastructure.
// Provides: widget allocation, tree ops, class table, shared
@ -9,10 +9,10 @@
// internal functions (paint, onMouse, onKey, calcMinSize, etc.)
// are private to its own .c file and referenced only through
// the WidgetClassT vtable.
#ifndef DVX_WIDGET_PLUGIN_H
#define DVX_WIDGET_PLUGIN_H
#ifndef DVX_WGT_P_H
#define DVX_WGT_P_H
#include "dvxWidget.h"
#include "dvxWgt.h"
#include "dvxApp.h"
#include "dvxDraw.h"
#include "dvxWm.h"
@ -191,4 +191,4 @@ void widgetPaintOverlays(WidgetT *root, DisplayT *d, const BlitOpsT *ops, const
// listhelp/listHelp.h -- dropdown arrow, popup list, keyboard nav
// Widget DXEs that use these include the headers directly.
#endif // DVX_WIDGET_PLUGIN_H
#endif // DVX_WGT_P_H

View file

@ -33,8 +33,8 @@
#include "dvxVideo.h"
#include "dvxDraw.h"
#include "dvxComp.h"
#include "dvxWidget.h"
#include "dvxPlatform.h"
#include "dvxWgt.h"
#include "dvxPlat.h"
#include "thirdparty/stb_image_wrap.h"
#include <stdlib.h>

View file

@ -1,4 +1,4 @@
// dvxPlatform.h -- Platform abstraction layer for DVX GUI
// dvxPlat.h -- Platform abstraction layer for DVX GUI
//
// All OS-specific and CPU-specific code is isolated behind this
// interface. To port DVX to a new platform, implement a new
@ -17,8 +17,8 @@
// own internal state. They must not reference AppContextT or any layer
// above dvxTypes.h. This ensures the platform layer can be compiled and
// tested independently.
#ifndef DVX_PLATFORM_H
#define DVX_PLATFORM_H
#ifndef DVX_PLAT_H
#define DVX_PLAT_H
#include "dvxTypes.h"
@ -345,4 +345,4 @@ typedef struct {
// no-op (RTLD_GLOBAL or equivalent handles symbol resolution).
void platformRegisterSymOverrides(const PlatformSymOverrideT *entries);
#endif // DVX_PLATFORM_H
#endif // DVX_PLAT_H

View file

@ -26,8 +26,8 @@
// a compatible driver. Polling via function 03h avoids the complexity
// of installing a real-mode callback for mouse events.
#include "dvxPlatform.h"
#include "dvxPalette.h"
#include "dvxPlat.h"
#include "dvxPal.h"
#include <ctype.h>
#include <dir.h>

View file

@ -11,7 +11,7 @@
// wgtRegister(). App/core code calls wgtGetApi("name") to get
// the API pointer, then casts and calls through it.
#include "dvxWidgetPlugin.h"
#include "dvxWgtP.h"
#include "stb_ds_wrap.h"
#include <string.h>

View file

@ -18,8 +18,8 @@
// created and destroyed at runtime (dialog dynamics, tree item insertion),
// which doesn't map cleanly to an arena pattern.
#include "dvxWidgetPlugin.h"
#include "dvxPlatform.h"
#include "dvxWgtP.h"
#include "dvxPlat.h"
#include "stb_ds_wrap.h"
#include <time.h>

View file

@ -18,8 +18,8 @@
// still adjusts the value, because sDragSlider captures the event
// before hit testing runs.
#include "dvxWidgetPlugin.h"
#include "platform/dvxPlatform.h"
#include "dvxWgtP.h"
#include "platform/dvxPlat.h"
// Widget whose popup was just closed by click-outside -- prevents
// immediate re-open on the same click. Without this, clicking the

View file

@ -27,7 +27,7 @@
// unit types into a single int32_t without needing a separate struct.
// The wgtResolveSize() function decodes the tag and converts to pixels.
#include "dvxWidgetPlugin.h"
#include "dvxWgtP.h"
// ============================================================

View file

@ -11,9 +11,9 @@
// because they share the same invalidation infrastructure (wgtInvalidate
// and wgtInvalidatePaint).
#include "dvxWidgetPlugin.h"
#include "dvxPlatform.h"
#include "../widgets/widgetBox.h"
#include "dvxWgtP.h"
#include "dvxPlat.h"
#include "../widgets/box/box.h"
// ============================================================

View file

@ -21,7 +21,7 @@
// If the container is too small, the scrollbar is simply not drawn
// rather than rendering a corrupted mess.
#include "dvxWidgetPlugin.h"
#include "dvxWgtP.h"
// ============================================================

File diff suppressed because it is too large Load diff

175
docs/dvx_help_viewer.html Normal file
View file

@ -0,0 +1,175 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>DVX Help Viewer</title>
<style>
body { font-family: sans-serif; margin: 0; padding: 0; display: flex; }
nav { width: 250px; min-width: 250px; background: #f0f0f0; padding: 16px;
border-right: 1px solid #ccc; height: 100vh; overflow-y: auto;
position: sticky; top: 0; box-sizing: border-box; }
nav ul { list-style: none; padding-left: 16px; margin: 4px 0; }
nav > ul { padding-left: 0; }
nav a { text-decoration: none; color: #0066cc; }
nav a:hover { text-decoration: underline; }
main { flex: 1; padding: 24px 32px; max-width: 800px; }
h1 { border-bottom: 2px solid #333; padding-bottom: 4px; }
h2 { border-bottom: 1px solid #999; padding-bottom: 2px; margin-top: 32px; }
h3 { margin-top: 24px; }
pre { background: #f8f8f8; border: 1px solid #ddd; padding: 8px;
overflow-x: auto; font-size: 14px; }
blockquote { background: #fffde7; border-left: 4px solid #ffc107;
padding: 8px 12px; margin: 12px 0; }
hr { border: none; border-top: 1px solid #ccc; margin: 24px 0; }
img { max-width: 100%; }
.topic { margin-bottom: 48px; }
</style>
</head>
<body>
<nav>
<h3>Contents</h3>
<ul>
<li><a href="#help.overview">DVX Help Viewer</a></li>
<li><a href="#help.format">Help Source Format</a></li>
<li><a href="#help.compiler">Help Compiler</a></li>
<li><a href="#help.integration">Application Integration</a></li>
</ul>
<h3>Index</h3>
<ul>
<li><a href="#help.overview">DVX Help</a></li>
<li><a href="#help.overview">Help Viewer</a></li>
<li><a href="#help.format">.dhs</a></li>
<li><a href="#help.format">Source Format</a></li>
<li><a href="#help.format">Directives</a></li>
<li><a href="#help.compiler">dvxhlpc</a></li>
<li><a href="#help.compiler">Compiler</a></li>
<li><a href="#help.integration">F1</a></li>
<li><a href="#help.integration">Context Help</a></li>
<li><a href="#help.integration">helpFile</a></li>
<li><a href="#help.integration">helpTopic</a></li>
<li><a href="#help.integration">shellLoadAppWithArgs</a></li>
</ul>
</nav>
<main>
<div class="topic" id="help.overview">
<h1>DVX Help Viewer</h1>
<h2>DVX Help Viewer</h2>
<p>The DVX Help Viewer displays .hlp help files compiled from .dhs source documents. It provides a tree-based table of contents, scrollable content with word-wrapped text, clickable hyperlinks, full-text search, and a keyword index.</p>
<h3>Opening Help</h3>
<p>Press F1 from any DVX application to open context-sensitive help. Applications can register their own help file and topic so F1 opens the relevant page.</p>
<p>You can also launch the help viewer from an application's Help menu, or by clicking the DVX Help icon in the Program Manager.</p>
<h3>Navigation</h3>
<ul>
<li>Click a topic in the tree on the left to display it</li>
<li>Click underlined links in the content to jump to other topics</li>
<li>Use the Back and Forward buttons (or Navigate menu) to retrace your steps</li>
<li>Use Navigate &gt; Index to browse an alphabetical keyword list</li>
</ul>
<p>Use Navigate &gt; Search to find topics by keyword</p>
<h3>Keyboard Shortcuts</h3>
<pre> Alt+Left Back
Alt+Right Forward
Ctrl+F Search
Escape Close viewer</pre>
</div>
<div class="topic" id="help.format">
<h1>Help Source Format (.dhs)</h1>
<h2>Help Source Format (.dhs)</h2>
<p>Help files are authored as plain text .dhs source files using a simple line-oriented directive format. Lines beginning with a period at column 0 are directives. All other lines are body text, which is automatically word-wrapped by the viewer at display time.</p>
<h3>Topic Directives</h3>
<pre> .topic &lt;id&gt; Start a new topic with a unique string ID
.title &lt;text&gt; Set the topic's display title
.toc &lt;depth&gt; &lt;text&gt; Add a table of contents entry (0=root, 1=child, etc.)
.default Mark this topic as the one shown when the file opens</pre>
<h3>Content Directives</h3>
<pre> .h1 &lt;text&gt; Level 1 heading (colored bar)
.h2 &lt;text&gt; Level 2 heading (underlined)
.h3 &lt;text&gt; Level 3 heading (plain)
.hr Horizontal rule
.link &lt;id&gt; &lt;text&gt; Hyperlink to another topic
.image &lt;file.bmp&gt; Inline image (BMP format)</pre>
<h3>Block Directives</h3>
<pre> .list Start a bulleted list
.item &lt;text&gt; List item (must be inside .list)
.endlist End the bulleted list
.table Start a preformatted table block
.endtable End table block
.code Start a preformatted code block
.endcode End code block
.note [info|tip|warning] Start a callout box
.endnote End callout box</pre>
<h3>Index Directives</h3>
<pre> .index &lt;keyword&gt; Add a keyword to the index pointing to this topic</pre>
<h3>Example</h3>
<pre><code>.topic intro
.title Welcome
.toc 0 Welcome
.default
.index Welcome
.h1 Welcome
This is a paragraph of body text. It will be
automatically word-wrapped by the viewer.
.list
.item First item
.item Second item
.endlist
.link other.topic See also: Other Topic
.note info
This is an informational note.
.endnote
.note tip
This is a helpful tip.
.endnote
.note warning
This is a warning message.
.endnote</code></pre>
<h3>Callout Boxes</h3>
<p>Three types of callout boxes are available, each with a distinct colored accent bar:</p>
<blockquote><strong>Note:</strong> Use info notes for general supplementary information.</blockquote>
<blockquote><strong>Tip:</strong> Use tip notes for helpful suggestions and best practices.</blockquote>
<blockquote><strong>Warning:</strong> Use warning notes for important cautions the reader should be aware of.</blockquote>
</div>
<div class="topic" id="help.compiler">
<h1>Help Compiler (dvxhlpc)</h1>
<h2>Help Compiler (dvxhlpc)</h2>
<p>The dvxhlpc tool runs on the host (Linux) and compiles .dhs source files into binary .hlp files for the viewer, and optionally into self-contained HTML.</p>
<h3>Usage</h3>
<pre><code>dvxhlpc -o output.hlp [-i imagedir] [--html out.html] input.dhs [...]</code></pre>
<h3>Options</h3>
<pre> -o output.hlp Output binary help file (required)
-i imagedir Directory to find .image files (default: current dir)
--html out.html Also emit a self-contained HTML file</pre>
<p>Multiple input files are merged into a single help file. This allows per-widget or per-feature documentation fragments to be combined automatically.</p>
<h3>Build Integration</h3>
<p>The standard build pattern globs all fragments:</p>
<pre><code>dvxhlpc -o dvxhelp.hlp docs/src/overview.dhs widgets/*/*.dhs</code></pre>
<p>New widgets or features just drop a .dhs file in their source directory and it appears in the help on the next build.</p>
<h3>HTML Output</h3>
<p>The --html flag produces a single self-contained HTML file with a sidebar table of contents, styled headings, lists, code blocks, notes, and embedded images (base64 data URIs). This is useful for viewing documentation on the host machine without running the DOS help viewer.</p>
</div>
<div class="topic" id="help.integration">
<h1>Application Integration</h1>
<h2>Application Integration</h2>
<p>Any DVX application can provide context-sensitive help via the F1 key.</p>
<h3>Setting Up Help</h3>
<p>In your appMain, set the help file path on the app context:</p>
<pre><code>snprintf(ctx-&gt;helpFile, sizeof(ctx-&gt;helpFile),
&quot;%s%cMYAPP.HLP&quot;, ctx-&gt;appDir, DVX_PATH_SEP);</code></pre>
<h3>Context-Sensitive Topics</h3>
<p>Update helpTopic as the user navigates your application:</p>
<pre><code>snprintf(ctx-&gt;helpTopic, sizeof(ctx-&gt;helpTopic), &quot;settings.video&quot;);</code></pre>
<p>When the user presses F1, the shell launches the help viewer with your help file opened to the specified topic.</p>
<h3>Launching Help from Menus</h3>
<p>To add a Help menu item that opens your help file:</p>
<pre><code>shellLoadAppWithArgs(ctx, viewerPath, helpFilePath);</code></pre>
</div>
</main>
</body>
</html>

File diff suppressed because it is too large Load diff

View file

@ -40,7 +40,7 @@ $(TARGETDIR):
mkdir -p $(TARGETDIR)
# Dependencies
$(OBJDIR)/listHelp.o: listHelp.c listHelp.h ../core/dvxWidgetPlugin.h ../core/dvxWidget.h ../core/dvxTypes.h ../core/dvxApp.h ../core/dvxDraw.h ../core/dvxWm.h ../core/dvxVideo.h
$(OBJDIR)/listHelp.o: listHelp.c listHelp.h ../core/dvxWgtP.h ../core/dvxWgt.h ../core/dvxTypes.h ../core/dvxApp.h ../core/dvxDraw.h ../core/dvxWm.h ../core/dvxVideo.h
clean:
rm -rf $(OBJS) $(TARGET) $(TARGETDIR)/listhelp.dep $(TARGETDIR)

View file

@ -7,7 +7,7 @@
#ifndef LIST_HELP_H
#define LIST_HELP_H
#include "../core/dvxWidgetPlugin.h"
#include "../core/dvxWgtP.h"
#define DROPDOWN_BTN_WIDTH 16
#define DROPDOWN_MAX_VISIBLE 8

View file

@ -50,8 +50,8 @@ $(BINDIR):
mkdir -p $(BINDIR)
# Dependencies
$(OBJDIR)/loaderMain.o: loaderMain.c ../core/platform/dvxPlatform.h ../core/dvxTypes.h
$(POBJDIR)/dvxPlatformDos.o: ../core/platform/dvxPlatformDos.c ../core/platform/dvxPlatform.h ../core/dvxTypes.h ../core/dvxPalette.h
$(OBJDIR)/loaderMain.o: loaderMain.c ../core/platform/dvxPlat.h ../core/dvxTypes.h
$(POBJDIR)/dvxPlatformDos.o: ../core/platform/dvxPlatformDos.c ../core/platform/dvxPlat.h ../core/dvxTypes.h ../core/dvxPal.h
$(POBJDIR)/dvxPrefs.o: ../core/dvxPrefs.c ../core/dvxPrefs.h
clean:

View file

@ -10,7 +10,7 @@
// order. After loading, any module that exports wgtRegister() has
// it called. Finally, the loader finds and calls shellMain().
#include "dvxPlatform.h"
#include "dvxPlat.h"
#include "dvxPrefs.h"
#include <ctype.h>

75
sdk/readme.txt Normal file
View file

@ -0,0 +1,75 @@
DVX SDK
=======
This SDK contains everything needed to develop applications and
widgets for the DVX GUI system.
Directory Structure
-------------------
include/
core/ DVX core headers (types, drawing, windows, widgets)
shell/ Shell/app loading API
tasks/ Cooperative task switching API
sql/ SQLite database wrapper API
widget/ Per-widget public API headers
samples/
hello/ Minimal "Hello World" application
widget/ Minimal custom widget
Requirements
------------
- DJGPP cross-compiler (i586-pc-msdosdjgpp-gcc)
- dxe3gen (included with DJGPP)
- DVX resource compiler (SYSTEM/DVXRES.EXE on the target,
or bin/dvxres on the host)
- DVX help compiler (SYSTEM/DVXHLPC.EXE on the target,
or bin/dvxhlpc on the host)
Building an Application
-----------------------
1. Write your app with appDescriptor and appMain exports
2. Compile: gcc -c -o myapp.o myapp.c -Isdk/include/core ...
3. Link: dxe3gen -o myapp.app -E _appDescriptor -E _appMain -U myapp.o
4. Optionally create a .res file and build resources with dvxres
See samples/hello/ for a complete example.
Building a Widget
-----------------
1. Write your widget with wgtRegister export
2. Compile: gcc -c -o mywgt.o mywgt.c -Isdk/include/core
3. Link: dxe3gen -o mywgt.wgt -E _wgtRegister -U mywgt.o
See samples/widget/ for a complete example.
Deployment
----------
Applications: APPS/<vendor>/<appname>/<appname>.APP
Widgets: WIDGETS/<vendor>/<wgtname>/<wgtname>.WGT
Libraries: LIBS/<vendor>/<libname>/<libname>.LIB
Each component can include:
- .DHS file for C API documentation (compiled into system help)
- .BHS file for BASIC documentation (compiled into BASIC help)
- .DEP file listing load-before dependencies
- .HCF file defining help compilation rules
- .RES file for embedded resources (icons, text, binary data)
Help is recompiled automatically at startup when module counts
change.
DXE3 Symbol Resolution
----------------------
DXE modules resolve symbols at load time via dlopen/dlsym.
All DVX core functions, widget APIs, and C runtime functions
are available automatically. You do not need import libraries.
The loader ensures libraries are loaded before widgets, and
widgets before applications, respecting .dep dependencies.

83
sdk/samples/hello/hello.c Normal file
View file

@ -0,0 +1,83 @@
// hello.c -- Minimal DVX application
//
// Demonstrates:
// - App descriptor and entry point
// - Window creation with widgets
// - Resource loading (reading embedded strings from .res)
// - Message box display
//
// Build: see makefile
// Deploy: copy hello.app to APPS/<vendor>/HELLO/ on the target.
#include "dvxApp.h"
#include "dvxWgt.h"
#include "dvxWm.h"
#include "dvxRes.h"
#include "shellApp.h"
#include "button/button.h"
#include "label/label.h"
#include "box/box.h"
#include <stdio.h>
// App descriptor — exported to the shell
AppDescriptorT appDescriptor = {
.name = "Hello",
.hasMainLoop = false,
.multiInstance = false,
.stackSize = 0,
.priority = 0
};
static AppContextT *sAc = NULL;
static DxeAppContextT *sCtx = NULL;
static WindowT *sWin = NULL;
static void onClose(WindowT *win) {
dvxDestroyWindow(sAc, win);
sWin = NULL;
}
static void onButtonClick(WidgetT *w) {
(void)w;
// Read the custom "greeting" resource from our .app file
uint32_t size = 0;
void *data = dvxResRead(dvxResOpen(sCtx->appPath), "greeting", &size);
if (data) {
dvxMessageBox(sAc, "Hello", (const char *)data, MB_OK | MB_ICONINFO);
free(data);
} else {
dvxMessageBox(sAc, "Hello", "Hello from DVX!", MB_OK | MB_ICONINFO);
}
}
int32_t appMain(DxeAppContextT *ctx) {
sCtx = ctx;
sAc = ctx->shellCtx;
sWin = dvxCreateWindow(sAc, "Hello World", 100, 80, 240, 120, true);
if (!sWin) {
return -1;
}
sWin->onClose = onClose;
WidgetT *root = wgtInitWindow(sAc, sWin);
if (root) {
wgtLabel(root, "Welcome to DVX!");
WidgetT *btn = wgtButton(root, "Click Me");
if (btn) {
btn->onClick = onButtonClick;
}
}
return 0;
}

View file

@ -0,0 +1,22 @@
# hello.res -- Resource manifest for Hello World app
#
# Resource types:
# icon BMP image (32x32 app icon, toolbar buttons, etc.)
# text Null-terminated string (metadata, labels, etc.)
# binary Raw binary data (app-specific data files)
#
# Format: name type data
# - icon: name icon path/to/file.bmp
# - text: name text "string value"
# - binary: name binary path/to/file.dat
# App icon (32x32 BMP displayed in Program Manager)
icon32 icon icon32.bmp
# App metadata (displayed in Program Manager and About dialogs)
name text "Hello World"
author text "Sample Developer"
description text "DVX SDK sample application"
# Custom text resource (accessible via dvxResRead at runtime)
greeting text "Welcome to DVX development!"

BIN
sdk/samples/hello/icon32.bmp (Stored with Git LFS) Normal file

Binary file not shown.

View file

@ -0,0 +1,28 @@
# Hello World app — sample DVX application Makefile
#
# Adjust DJGPP_PREFIX, SDK_DIR, and DVXRES for your environment.
DJGPP_PREFIX = $(HOME)/djgpp/djgpp
CC = $(DJGPP_PREFIX)/bin/i586-pc-msdosdjgpp-gcc
DXE3GEN = PATH=$(DJGPP_PREFIX)/bin:$(PATH) DJDIR=$(DJGPP_PREFIX)/i586-pc-msdosdjgpp $(DJGPP_PREFIX)/i586-pc-msdosdjgpp/bin/dxe3gen
SDK_DIR = ../..
DVXRES = dvxres
CFLAGS = -O2 -Wall -Wextra -Werror -march=i486 -mtune=i586 \
-I$(SDK_DIR)/include/core \
-I$(SDK_DIR)/include/shell \
-I$(SDK_DIR)/include/widget
.PHONY: all clean
all: hello.app
hello.app: hello.o hello.res icon32.bmp
$(DXE3GEN) -o $@ -E _appDescriptor -E _appMain -U hello.o
$(DVXRES) build $@ hello.res
hello.o: hello.c
$(CC) $(CFLAGS) -c -o $@ $<
clean:
rm -f hello.o hello.app

View file

@ -0,0 +1,23 @@
# Sample library — DVX library Makefile
#
# Adjust DJGPP_PREFIX for your environment.
DJGPP_PREFIX = $(HOME)/djgpp/djgpp
CC = $(DJGPP_PREFIX)/bin/i586-pc-msdosdjgpp-gcc
DXE3GEN = PATH=$(DJGPP_PREFIX)/bin:$(PATH) DJDIR=$(DJGPP_PREFIX)/i586-pc-msdosdjgpp $(DJGPP_PREFIX)/i586-pc-msdosdjgpp/bin/dxe3gen
CFLAGS = -O2 -Wall -Wextra -Werror -march=i486 -mtune=i586
.PHONY: all clean
all: mylib.lib
mylib.lib: mylib.o
$(DXE3GEN) -o mylib.dxe -E _myLibAdd -E _myLibMul -E _myLibVersion -U $<
mv mylib.dxe $@
mylib.o: mylib.c mylib.h
$(CC) $(CFLAGS) -c -o $@ $<
clean:
rm -f mylib.o mylib.lib

View file

@ -0,0 +1,27 @@
// mylib.c -- Sample DVX library implementation
//
// Build:
// i586-pc-msdosdjgpp-gcc -O2 -Wall -c -o mylib.o mylib.c
// dxe3gen -o mylib.lib -E _myLibAdd -E _myLibMul -E _myLibVersion -U mylib.o
//
// Deploy: copy mylib.lib to LIBS/<vendor>/MYLIB/ on the target.
// Add a mylib.dep file if this library depends on others.
//
// Any DXE loaded after this one can call myLibAdd(), myLibMul(),
// and myLibVersion() directly — DXE3 resolves symbols at load time.
#include "mylib.h"
int32_t myLibAdd(int32_t a, int32_t b) {
return a + b;
}
int32_t myLibMul(int32_t a, int32_t b) {
return a * b;
}
const char *myLibVersion(void) {
return "MyLib 1.0";
}

View file

@ -0,0 +1,21 @@
// mylib.h -- Sample DVX library public header
//
// A library exports functions via DXE3 symbol sharing.
// Any module loaded after this library can call its functions
// directly — no import library or dlsym needed.
#ifndef MYLIB_H
#define MYLIB_H
#include <stdint.h>
// Add two integers
int32_t myLibAdd(int32_t a, int32_t b);
// Multiply two integers
int32_t myLibMul(int32_t a, int32_t b);
// Return the library version string
const char *myLibVersion(void);
#endif // MYLIB_H

BIN
sdk/samples/widget/icon24.bmp (Stored with Git LFS) Normal file

Binary file not shown.

View file

@ -0,0 +1,27 @@
# Sample widget — DVX widget Makefile
#
# Adjust DJGPP_PREFIX, SDK_DIR, and DVXRES for your environment.
DJGPP_PREFIX = $(HOME)/djgpp/djgpp
CC = $(DJGPP_PREFIX)/bin/i586-pc-msdosdjgpp-gcc
DXE3GEN = PATH=$(DJGPP_PREFIX)/bin:$(PATH) DJDIR=$(DJGPP_PREFIX)/i586-pc-msdosdjgpp $(DJGPP_PREFIX)/i586-pc-msdosdjgpp/bin/dxe3gen
SDK_DIR = ../..
DVXRES = dvxres
CFLAGS = -O2 -Wall -Wextra -Werror -march=i486 -mtune=i586 \
-I$(SDK_DIR)/include/core
.PHONY: all clean
all: mywgt.wgt
mywgt.wgt: mywgt.o mywgt.res icon24.bmp
$(DXE3GEN) -o mywgt.dxe -E _wgtRegister -U mywgt.o
mv mywgt.dxe $@
$(DVXRES) build $@ mywgt.res
mywgt.o: mywgt.c
$(CC) $(CFLAGS) -c -o $@ $<
clean:
rm -f mywgt.o mywgt.wgt

239
sdk/samples/widget/mywgt.c Normal file
View file

@ -0,0 +1,239 @@
// mywgt.c -- Sample DVX widget with full BASIC interface
//
// A simple widget that draws a colored rectangle with centered text.
// Demonstrates:
// - Widget class registration (calcMinSize, paint, destroy)
// - Public C API (create function + API struct)
// - BASIC interface (properties, methods, events, WgtIfaceT)
//
// Build:
// i586-pc-msdosdjgpp-gcc -O2 -Wall -I../../include/core -c -o mywgt.o mywgt.c
// dxe3gen -o mywgt.wgt -E _wgtRegister -U mywgt.o
//
// Deploy: copy mywgt.wgt to WIDGETS/<vendor>/MYWGT/ on the target.
// Optionally include MYWGT.DHS (C API docs) and MYWGT.BHS (BASIC docs).
#define DVX_WIDGET_IMPL
#include "dvxWgt.h"
#include "dvxWgtP.h"
#include "dvxDraw.h"
#include "dvxVideo.h"
#include <stdlib.h>
#include <string.h>
// ============================================================
// Widget data
// ============================================================
typedef struct {
char *text;
int32_t style; // 0=flat, 1=raised, 2=sunken
bool bold;
} MyWidgetDataT;
static int32_t sTypeId = -1;
// ============================================================
// Style enum names (for BASIC property panel dropdown)
// ============================================================
static const char *sStyleNames[] = { "Flat", "Raised", "Sunken", NULL };
// ============================================================
// Widget methods (vtable handlers)
// ============================================================
static void myCalcMinSize(WidgetT *w, const BitmapFontT *font) {
w->calcMinW = font->charWidth * 10;
w->calcMinH = font->charHeight + 8;
}
static void myPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors) {
MyWidgetDataT *data = (MyWidgetDataT *)w->data;
uint32_t bg = colors->buttonFace;
uint32_t fg = colors->contentFg;
// Fill background
rectFill(d, ops, w->x, w->y, w->w, w->h, bg);
// Draw border based on style
if (data && data->style == 1) {
BevelStyleT bevel = BEVEL_RAISED(colors, 2);
drawBevel(d, ops, w->x, w->y, w->w, w->h, &bevel);
} else if (data && data->style == 2) {
BevelStyleT bevel = BEVEL_SUNKEN(colors, bg, 2);
drawBevel(d, ops, w->x, w->y, w->w, w->h, &bevel);
}
// Draw text centered
if (data && data->text) {
int32_t textW = textWidth(font, data->text);
int32_t tx = w->x + (w->w - textW) / 2;
int32_t ty = w->y + (w->h - font->charHeight) / 2;
drawText(d, ops, font, tx, ty, data->text, fg, bg, true);
}
}
static void myDestroy(WidgetT *w) {
MyWidgetDataT *data = (MyWidgetDataT *)w->data;
if (data) {
free(data->text);
free(data);
w->data = NULL;
}
}
// ============================================================
// Widget class definition
// ============================================================
static const WidgetClassT sClass = {
.version = WGT_CLASS_VERSION,
.flags = WCLASS_FOCUSABLE,
.handlers = {
[WGT_METHOD_PAINT] = (void *)myPaint,
[WGT_METHOD_CALC_MIN_SIZE] = (void *)myCalcMinSize,
[WGT_METHOD_DESTROY] = (void *)myDestroy,
}
};
// ============================================================
// C API — called by apps via wgtGetApi("mywgt")
// ============================================================
static WidgetT *myWidgetCreate(WidgetT *parent, const char *text) {
WidgetT *w = widgetAlloc(parent, sTypeId);
if (w) {
MyWidgetDataT *data = (MyWidgetDataT *)calloc(1, sizeof(MyWidgetDataT));
if (data) {
data->text = text ? strdup(text) : NULL;
data->style = 0;
data->bold = false;
}
w->data = data;
}
return w;
}
static void myWidgetSetStyle(WidgetT *w, int32_t style) {
MyWidgetDataT *data = (MyWidgetDataT *)w->data;
if (data) {
data->style = style;
wgtInvalidatePaint(w);
}
}
static int32_t myWidgetGetStyle(const WidgetT *w) {
MyWidgetDataT *data = (MyWidgetDataT *)w->data;
return data ? data->style : 0;
}
static void myWidgetSetBold(WidgetT *w, bool bold) {
MyWidgetDataT *data = (MyWidgetDataT *)w->data;
if (data) {
data->bold = bold;
wgtInvalidatePaint(w);
}
}
static bool myWidgetGetBold(const WidgetT *w) {
MyWidgetDataT *data = (MyWidgetDataT *)w->data;
return data ? data->bold : false;
}
static void myWidgetClear(WidgetT *w) {
MyWidgetDataT *data = (MyWidgetDataT *)w->data;
if (data) {
free(data->text);
data->text = NULL;
wgtInvalidatePaint(w);
}
}
static const struct {
WidgetT *(*create)(WidgetT *parent, const char *text);
void (*setStyle)(WidgetT *w, int32_t style);
int32_t (*getStyle)(const WidgetT *w);
void (*setBold)(WidgetT *w, bool bold);
bool (*getBold)(const WidgetT *w);
void (*clear)(WidgetT *w);
} sApi = {
.create = myWidgetCreate,
.setStyle = myWidgetSetStyle,
.getStyle = myWidgetGetStyle,
.setBold = myWidgetSetBold,
.getBold = myWidgetGetBold,
.clear = myWidgetClear,
};
// ============================================================
// BASIC interface — describes properties, methods, and events
// for the form runtime and IDE property panel
// ============================================================
// Properties accessible from BASIC (e.g., MyWidget1.Style = 2)
static const WgtPropDescT sProps[] = {
// String property: Caption (read/write via SET_TEXT/GET_TEXT)
// Common properties like Caption, Left, Top, Width, Height are
// handled automatically by the form runtime. Only list type-specific
// properties here.
// Enum property: Style (Flat=0, Raised=1, Sunken=2)
{ "Style", WGT_IFACE_ENUM, (void *)myWidgetGetStyle, (void *)myWidgetSetStyle, sStyleNames },
// Boolean property: Bold
{ "Bold", WGT_IFACE_BOOL, (void *)myWidgetGetBold, (void *)myWidgetSetBold, NULL },
};
// Methods callable from BASIC (e.g., MyWidget1.Clear)
static const WgtMethodDescT sMethods[] = {
{ "Clear", WGT_SIG_VOID, (void *)myWidgetClear },
};
// Events beyond the common set (Click, DblClick, Change, GotFocus, LostFocus).
// Only list EXTRA events here — common events are wired automatically.
static const WgtEventDescT sEvents[] = {
{ "StyleChange" },
};
static const WgtIfaceT sIface = {
.basName = "MyWidget", // VB-style control name (used in .frm files)
.props = sProps,
.propCount = sizeof(sProps) / sizeof(sProps[0]),
.methods = sMethods,
.methodCount = sizeof(sMethods) / sizeof(sMethods[0]),
.events = sEvents,
.eventCount = sizeof(sEvents) / sizeof(sEvents[0]),
.createSig = WGT_CREATE_PARENT_TEXT, // create(parent, text)
.createArgs = {0}, // no default numeric args
.isContainer = false, // cannot hold child widgets
.defaultEvent = "Click", // double-click in IDE opens this event
.namePrefix = "MyWidget", // auto-names: MyWidget1, MyWidget2, ...
};
// ============================================================
// Registration — called by the loader at startup
// ============================================================
void wgtRegister(void) {
sTypeId = wgtRegisterClass(&sClass);
wgtRegisterApi("mywgt", &sApi);
wgtRegisterIface("mywgt", &sIface);
}

View file

@ -0,0 +1,15 @@
# mywgt.res -- Resource manifest for sample widget
#
# Widgets can embed resources just like apps.
# The icon24 resource is used by the IDE toolbox to
# display the widget's icon when designing forms.
# Widget toolbox icon (24x24 BMP for the form designer toolbox)
icon24 icon icon24.bmp
# Widget display name (shown in the IDE toolbox and properties panel)
name text "My Widget"
# Author and description (for documentation and about dialogs)
author text "Sample Developer"
description text "A sample custom widget for DVX"

View file

@ -63,10 +63,10 @@ $(WPAPERDIR)/%.jpg: ../config/wpaper/%.jpg | $(WPAPERDIR)
cp $< $@
# Dependencies
SHELL_DEPS = shellApp.h ../core/dvxWidget.h ../core/dvxApp.h ../core/dvxTypes.h ../core/platform/dvxPlatform.h
SHELL_DEPS = shellApp.h ../core/dvxWgt.h ../core/dvxApp.h ../core/dvxTypes.h ../core/platform/dvxPlat.h
$(OBJDIR)/shellMain.o: shellMain.c $(SHELL_DEPS)
$(OBJDIR)/shellApp.o: shellApp.c $(SHELL_DEPS)
$(OBJDIR)/shellInfo.o: shellInfo.c shellInfo.h $(SHELL_DEPS)
$(OBJDIR)/shellInfo.o: shellInfo.c shellInf.h $(SHELL_DEPS)
clean:
rm -rf $(OBJS) $(TARGET) $(TARGETDIR)/dvxshell.dep $(TARGETDIR)

View file

@ -4,8 +4,8 @@
// ctx->currentAppId, and clean teardown of both callback-only and main-loop apps.
#include "shellApp.h"
#include "dvxDialog.h"
#include "dvxPlatform.h"
#include "dvxDlg.h"
#include "dvxPlat.h"
#include "stb_ds_wrap.h"
#include <dlfcn.h>

View file

@ -23,8 +23,8 @@
#define SHELL_APP_H
#include "dvxApp.h"
#include "dvxWidget.h"
#include "taskswitch.h"
#include "dvxWgt.h"
#include "taskSwch.h"
#include <stdint.h>
#include <stdbool.h>

View file

@ -5,9 +5,9 @@
// to DVX.LOG. The result pointer is cached so subsequent calls
// to shellGetSystemInfo() return instantly without re-probing.
#include "shellInfo.h"
#include "shellInf.h"
#include "shellApp.h"
#include "dvxPlatform.h"
#include "dvxPlat.h"
#include <string.h>
#include "dvxMem.h"

View file

@ -27,13 +27,13 @@
// doesn't take down the whole system.
#include "shellApp.h"
#include "shellInfo.h"
#include "dvxDialog.h"
#include "shellInf.h"
#include "dvxDlg.h"
#include "dvxDraw.h"
#include "dvxVideo.h"
#include "dvxComp.h"
#include "dvxPrefs.h"
#include "dvxPlatform.h"
#include "dvxPlat.h"
#include "stb_ds_wrap.h"
#include <stdarg.h>

View file

@ -39,7 +39,7 @@ $(TARGETDIR):
mkdir -p $(TARGETDIR)
# Dependencies
$(OBJDIR)/shellTaskMgr.o: shellTaskMgr.c shellTaskMgr.h ../shell/shellApp.h ../core/dvxWidget.h ../core/dvxApp.h
$(OBJDIR)/shellTaskMgr.o: shellTaskMgr.c shellTaskMgr.h ../shell/shellApp.h ../core/dvxWgt.h ../core/dvxApp.h
clean:
rm -rf $(OBJS) $(TARGET) $(TARGETDIR)/taskmgr.dep $(TARGETDIR)

View file

@ -6,14 +6,14 @@
#include "shellTaskMgr.h"
#include "../shell/shellApp.h"
#include "dvxDialog.h"
#include "dvxWidget.h"
#include "widgetBox.h"
#include "widgetButton.h"
#include "widgetLabel.h"
#include "widgetListView.h"
#include "dvxDlg.h"
#include "dvxWgt.h"
#include "box/box.h"
#include "button/button.h"
#include "label/label.h"
#include "listView/listView.h"
#include "dvxWm.h"
#include "dvxPlatform.h"
#include "dvxPlat.h"
#include "stb_ds_wrap.h"
#include <stdio.h>

View file

@ -36,7 +36,7 @@ $(TARGETDIR):
mkdir -p $(TARGETDIR)
# Dependencies
$(OBJDIR)/taskswitch.o: taskswitch.c taskswitch.h ../core/thirdparty/stb_ds.h
$(OBJDIR)/taskswitch.o: taskswitch.c taskSwch.h ../core/thirdparty/stb_ds.h
clean:
rm -rf $(OBJS) $(TARGET) $(TARGETDIR)

View file

@ -1,4 +1,4 @@
// taskswitch.h -- Cooperative task switching library for DJGPP
// taskSwch.h -- Cooperative task switching library for DJGPP
//
// Cooperative (non-preemptive) multitasking for DOS protected mode (DJGPP/DPMI).
//
@ -21,8 +21,8 @@
// turns per round while a priority-0 task gets 1, but the low-priority
// task is guaranteed to run eventually -- no starvation is possible.
#ifndef TASKSWITCH_H
#define TASKSWITCH_H
#ifndef TASKSWCH_H
#define TASKSWCH_H
#include <stdint.h>
#include <stdbool.h>
@ -130,4 +130,4 @@ void tsRecoverToMain(void);
// Get the number of non-terminated tasks.
uint32_t tsActiveCount(void);
#endif // TASKSWITCH_H
#endif // TASKSWCH_H

View file

@ -23,7 +23,7 @@
#include "../core/thirdparty/stb_ds_wrap.h"
#include "taskswitch.h"
#include "taskSwch.h"
#include <stdlib.h>
#include <string.h>

View file

@ -37,7 +37,7 @@ $(BINDIR):
mkdir -p $(BINDIR)
# Dependencies
$(OBJDIR)/termdemo.o: termdemo.c ../dvx/dvxApp.h ../dvx/dvxWidget.h ../seclink/secLink.h ../security/security.h
$(OBJDIR)/termdemo.o: termdemo.c ../dvx/dvxApp.h ../dvx/dvxWgt.h ../seclink/secLink.h ../security/security.h
clean:
rm -rf $(OBJDIR) $(TARGET)

View file

@ -24,7 +24,7 @@
// baud_rate -- baud rate (default 115200)
#include "dvxApp.h"
#include "dvxWidget.h"
#include "dvxWgt.h"
#include "secLink.h"
#include "security.h"
#include <stdio.h>

View file

@ -40,7 +40,7 @@ $(TARGETDIR):
mkdir -p $(TARGETDIR)
# Dependencies
$(OBJDIR)/textHelp.o: textHelp.c textHelp.h ../core/dvxWidgetPlugin.h ../core/dvxWidget.h ../core/dvxTypes.h ../core/dvxApp.h ../core/dvxDraw.h ../core/dvxWm.h ../core/dvxVideo.h
$(OBJDIR)/textHelp.o: textHelp.c textHelp.h ../core/dvxWgtP.h ../core/dvxWgt.h ../core/dvxTypes.h ../core/dvxApp.h ../core/dvxDraw.h ../core/dvxWm.h ../core/dvxVideo.h
clean:
rm -rf $(OBJS) $(TARGET) $(TARGETDIR)/texthelp.dep $(TARGETDIR)

View file

@ -8,7 +8,7 @@
#ifndef TEXT_HELP_H
#define TEXT_HELP_H
#include "../core/dvxWidgetPlugin.h"
#include "../core/dvxWgtP.h"
#define TEXT_INPUT_PAD 3

View file

@ -12,33 +12,37 @@ CWSDSTUB = $(DJGPP_PREFIX)/i586-pc-msdosdjgpp/bin/CWSDSTUB.EXE
DOSCFLAGS = -O2 -Wall -Wextra -Werror -Wno-format-truncation -march=i486 -mtune=i586 -I../core -I../core/platform
BINDIR = ../bin
HOSTDIR = ../bin/host
CONFIGDIR = ../bin/config
SYSTEMDIR = ../bin/system
.PHONY: all clean deploy-helpsrc
all: $(BINDIR)/dvxres $(BINDIR)/mkicon $(BINDIR)/mktbicon $(BINDIR)/mkwgticon $(BINDIR)/bmp2raw $(BINDIR)/dvxhlpc $(SYSTEMDIR)/SPLASH.RAW $(SYSTEMDIR)/DVXHLPC.EXE $(SYSTEMDIR)/DVXRES.EXE
all: $(HOSTDIR)/dvxres $(HOSTDIR)/mkicon $(HOSTDIR)/mktbicon $(HOSTDIR)/mkwgticon $(HOSTDIR)/bmp2raw $(HOSTDIR)/dvxhlpc $(SYSTEMDIR)/SPLASH.RAW $(SYSTEMDIR)/DVXHLPC.EXE $(SYSTEMDIR)/DVXRES.EXE
$(BINDIR)/dvxres: dvxres.c ../core/dvxResource.c ../core/dvxResource.h | $(BINDIR)
$(HOSTDIR)/dvxres: dvxres.c ../core/dvxResource.c ../core/dvxRes.h | $(HOSTDIR)
$(CC) $(CFLAGS) -o $@ dvxres.c ../core/dvxResource.c
$(BINDIR)/mkicon: mkicon.c | $(BINDIR)
$(HOSTDIR)/mkicon: mkicon.c | $(HOSTDIR)
$(CC) $(CFLAGS) -o $@ mkicon.c -lm
$(BINDIR)/mktbicon: mktbicon.c | $(BINDIR)
$(HOSTDIR)/mktbicon: mktbicon.c | $(HOSTDIR)
$(CC) $(CFLAGS) -o $@ mktbicon.c
$(BINDIR)/mkwgticon: mkwgticon.c | $(BINDIR)
$(HOSTDIR)/mkwgticon: mkwgticon.c | $(HOSTDIR)
$(CC) $(CFLAGS) -o $@ mkwgticon.c
$(BINDIR)/bmp2raw: bmp2raw.c | $(BINDIR)
$(HOSTDIR)/bmp2raw: bmp2raw.c | $(HOSTDIR)
$(CC) $(CFLAGS) -o $@ bmp2raw.c
$(BINDIR)/dvxhlpc: dvxhlpc.c ../apps/dvxhelp/hlpformat.h | $(BINDIR)
$(HOSTDIR)/dvxhlpc: dvxhlpc.c ../apps/dvxhelp/hlpformat.h | $(HOSTDIR)
$(CC) $(CFLAGS) -o $@ dvxhlpc.c
$(SYSTEMDIR)/SPLASH.RAW: $(BINDIR)/bmp2raw ../assets/splash.bmp | $(SYSTEMDIR)
$(BINDIR)/bmp2raw ../assets/splash.bmp $@
$(HOSTDIR):
mkdir -p $(HOSTDIR)
$(SYSTEMDIR)/SPLASH.RAW: $(HOSTDIR)/bmp2raw ../assets/splash.bmp | $(SYSTEMDIR)
$(HOSTDIR)/bmp2raw ../assets/splash.bmp $@
$(BINDIR):
mkdir -p $(BINDIR)
@ -52,7 +56,7 @@ $(SYSTEMDIR)/DVXHLPC.EXE: dvxhlpc.c ../apps/dvxhelp/hlpformat.h | $(SYSTEMDIR)
cat $(CWSDSTUB) $(SYSTEMDIR)/dvxhlpc > $@
rm -f $(SYSTEMDIR)/dvxhlpc $(SYSTEMDIR)/dvxhlpc.exe
$(SYSTEMDIR)/DVXRES.EXE: dvxres.c ../core/dvxResource.c ../core/dvxResource.h | $(SYSTEMDIR)
$(SYSTEMDIR)/DVXRES.EXE: dvxres.c ../core/dvxResource.c ../core/dvxRes.h | $(SYSTEMDIR)
$(DOSCC) $(DOSCFLAGS) -o $(SYSTEMDIR)/dvxres.exe dvxres.c ../core/dvxResource.c
$(EXE2COFF) $(SYSTEMDIR)/dvxres.exe
cat $(CWSDSTUB) $(SYSTEMDIR)/dvxres > $@
@ -119,5 +123,5 @@ deploy-helpsrc:
done
clean:
rm -f $(BINDIR)/dvxres
rm -rf $(HOSTDIR)
rm -rf $(SYSTEMDIR)

View file

@ -16,7 +16,7 @@
// [resource directory]
// [footer with magic + directory offset + count]
#include "../core/dvxResource.h"
#include "../core/dvxRes.h"
#include <ctype.h>
#include <stdbool.h>

View file

@ -7,7 +7,7 @@ DJGPP_PREFIX = $(HOME)/djgpp/djgpp
CC = $(DJGPP_PREFIX)/bin/i586-pc-msdosdjgpp-gcc
DXE3GEN = PATH=$(DJGPP_PREFIX)/bin:$(PATH) DJDIR=$(DJGPP_PREFIX)/i586-pc-msdosdjgpp $(DJGPP_PREFIX)/i586-pc-msdosdjgpp/bin/dxe3gen
CFLAGS = -O2 -Wall -Wextra -Werror -Wno-type-limits -Wno-sign-compare -Wno-format-truncation -march=i486 -mtune=i586 -I../core -I../core/platform -I../tasks -I../core/thirdparty
DVXRES = ../bin/dvxres
DVXRES = ../bin/host/dvxres
OBJDIR = ../obj/widgets
WGTDIR = ../bin/widgets/kpunch
@ -68,7 +68,7 @@ endef
$(foreach d,$(DEPFILES),$(eval $(call DEP_RULE,$(d))))
# Compile: source is in subdirectory
WIDGET_DEPS_H = ../core/dvxWidgetPlugin.h ../core/dvxWidget.h ../core/dvxTypes.h ../core/dvxApp.h ../core/dvxDraw.h ../core/dvxWm.h ../core/dvxVideo.h ../core/platform/dvxPlatform.h
WIDGET_DEPS_H = ../core/dvxWgtP.h ../core/dvxWgt.h ../core/dvxTypes.h ../core/dvxApp.h ../core/dvxDraw.h ../core/dvxWm.h ../core/dvxVideo.h ../core/platform/dvxPlat.h
define WIDGET_RULES
$(OBJDIR)/$(word 3,$(subst :, ,$1)).o: $(word 2,$(subst :, ,$1))/$(word 3,$(subst :, ,$1)).c $$(WIDGET_DEPS_H) | $(OBJDIR)

View file

@ -1,8 +1,8 @@
// widgetAnsiTerm.h -- ANSI terminal widget API
#ifndef WIDGET_ANSITERM_H
#define WIDGET_ANSITERM_H
// ansiTerm.h -- ANSI terminal widget API
#ifndef ANSITERM_H
#define ANSITERM_H
#include "../core/dvxWidget.h"
#include "../../core/dvxWgt.h"
typedef struct {
WidgetT *(*create)(WidgetT *parent, int32_t cols, int32_t rows);
@ -28,4 +28,4 @@ static inline const AnsiTermApiT *dvxAnsiTermApi(void) {
#define wgtAnsiTermPoll(w) dvxAnsiTermApi()->poll(w)
#define wgtAnsiTermRepaint(w, outY, outH) dvxAnsiTermApi()->repaint(w, outY, outH)
#endif // WIDGET_ANSITERM_H
#endif // ANSITERM_H

View file

@ -36,7 +36,7 @@
// the terminal to work with raw serial ports, the secLink encrypted channel,
// or any other byte-oriented transport.
#include "dvxWidgetPlugin.h"
#include "dvxWgtP.h"
#include "../texthelp/textHelp.h"
static int32_t sTypeId = -1;

View file

@ -1,8 +1,8 @@
// widgetBox.h -- Box container widget API (VBox, HBox, Frame)
#ifndef WIDGET_BOX_H
#define WIDGET_BOX_H
// box.h -- Box container widget API (VBox, HBox, Frame)
#ifndef BOX_H
#define BOX_H
#include "../core/dvxWidget.h"
#include "../../core/dvxWgt.h"
typedef struct {
WidgetT *(*vBox)(WidgetT *parent);
@ -20,4 +20,4 @@ static inline const BoxApiT *dvxBoxApi(void) {
#define wgtHBox(parent) dvxBoxApi()->hBox(parent)
#define wgtFrame(parent, title) dvxBoxApi()->frame(parent, title)
#endif // WIDGET_BOX_H
#endif // BOX_H

View file

@ -19,7 +19,7 @@
// "break" the border behind the title -- this is the classic Win3.1/Motif
// group box appearance.
#include "dvxWidgetPlugin.h"
#include "dvxWgtP.h"
static int32_t sVBoxTypeId = -1;
static int32_t sHBoxTypeId = -1;

View file

@ -1,8 +1,8 @@
// widgetButton.h -- Button widget API
#ifndef WIDGET_BUTTON_H
#define WIDGET_BUTTON_H
// button.h -- Button widget API
#ifndef BUTTON_H
#define BUTTON_H
#include "../core/dvxWidget.h"
#include "../../core/dvxWgt.h"
typedef struct {
WidgetT *(*create)(WidgetT *parent, const char *text);
@ -16,4 +16,4 @@ static inline const ButtonApiT *dvxButtonApi(void) {
#define wgtButton(parent, text) dvxButtonApi()->create(parent, text)
#endif // WIDGET_BUTTON_H
#endif // BUTTON_H

View file

@ -20,7 +20,7 @@
// Text supports accelerator keys via '&' prefix (e.g., "&OK" underlines 'O'
// and Alt+O activates the button).
#include "dvxWidgetPlugin.h"
#include "dvxWgtP.h"
#define BUTTON_PAD_H 8
#define BUTTON_PAD_V 4

View file

@ -1,8 +1,8 @@
// widgetCanvas.h -- Canvas widget API
#ifndef WIDGET_CANVAS_H
#define WIDGET_CANVAS_H
// canvas.h -- Canvas widget API
#ifndef CANVAS_H
#define CANVAS_H
#include "../core/dvxWidget.h"
#include "../../core/dvxWgt.h"
typedef struct {
WidgetT *(*create)(WidgetT *parent, int32_t w, int32_t h);
@ -42,4 +42,4 @@ static inline const CanvasApiT *dvxCanvasApi(void) {
#define wgtCanvasGetPixel(w, x, y) dvxCanvasApi()->getPixel(w, x, y)
#define wgtCanvasDrawText(w, x, y, text) dvxCanvasApi()->drawText(w, x, y, text)
#endif // WIDGET_CANVAS_H
#endif // CANVAS_H

View file

@ -22,7 +22,7 @@
// top-left of the canvas content, not the widget. Mouse events translate
// widget-space coordinates to canvas-space by subtracting the border offset.
#include "dvxWidgetPlugin.h"
#include "dvxWgtP.h"
static int32_t sTypeId = -1;

View file

@ -1,8 +1,8 @@
// widgetCheckbox.h -- Checkbox widget API
#ifndef WIDGET_CHECKBOX_H
#define WIDGET_CHECKBOX_H
// checkbox.h -- Checkbox widget API
#ifndef CHECKBOX_H
#define CHECKBOX_H
#include "../core/dvxWidget.h"
#include "../../core/dvxWgt.h"
typedef struct {
WidgetT *(*create)(WidgetT *parent, const char *text);
@ -20,4 +20,4 @@ static inline const CheckboxApiT *dvxCheckboxApi(void) {
#define wgtCheckboxIsChecked(w) dvxCheckboxApi()->isChecked(w)
#define wgtCheckboxSetChecked(w, checked) dvxCheckboxApi()->setChecked(w, checked)
#endif // WIDGET_CHECKBOX_H
#endif // CHECKBOX_H

View file

@ -13,7 +13,7 @@
// Focus is shown via a dotted rectangle around the label text (not the box),
// matching the Win3.1 convention where the focus indicator wraps the label.
#include "dvxWidgetPlugin.h"
#include "dvxWgtP.h"
#define CHECKBOX_BOX_SIZE 12
#define CHECKBOX_GAP 4

View file

@ -1,8 +1,8 @@
// widgetComboBox.h -- ComboBox widget API
#ifndef WIDGET_COMBOBOX_H
#define WIDGET_COMBOBOX_H
// comboBox.h -- ComboBox widget API
#ifndef COMBOBOX_H
#define COMBOBOX_H
#include "../core/dvxWidget.h"
#include "../../core/dvxWgt.h"
typedef struct {
WidgetT *(*create)(WidgetT *parent, int32_t maxLen);
@ -22,4 +22,4 @@ static inline const ComboBoxApiT *dvxComboBoxApi(void) {
#define wgtComboBoxGetSelected(w) dvxComboBoxApi()->getSelected(w)
#define wgtComboBoxSetSelected(w, idx) dvxComboBoxApi()->setSelected(w, idx)
#endif // WIDGET_COMBOBOX_H
#endif // COMBOBOX_H

View file

@ -21,7 +21,7 @@
// double-click (word select), and triple-click (select all). Drag-select
// is tracked via the sDragWidget global.
#include "dvxWidgetPlugin.h"
#include "dvxWgtP.h"
#include "../texthelp/textHelp.h"
#include "../listhelp/listHelp.h"

View file

@ -1,9 +1,9 @@
// widgetDataCtrl.h -- VB3-style Data control for database binding
// dataCtrl.h -- VB3-style Data control for database binding
#ifndef WIDGET_DATACTRL_H
#define WIDGET_DATACTRL_H
#ifndef DATACTRL_H
#define DATACTRL_H
#include "dvxWidget.h"
#include "dvxWgt.h"
typedef struct {
WidgetT *(*create)(WidgetT *parent);
@ -49,4 +49,4 @@ static inline const DataCtrlApiT *dvxDataCtrlApi(void) {
#define wgtDataCtrlGetCellText(w, r, c) dvxDataCtrlApi()->getCellText(w, r, c)
#define wgtDataCtrlSetCurrentRow(w, row) dvxDataCtrlApi()->setCurrentRow(w, row)
#endif // WIDGET_DATACTRL_H
#endif // DATACTRL_H

View file

@ -10,7 +10,7 @@
// Depends on the dvxsql library DXE (via datactrl.dep) so all
// dvxSql* functions are resolved at load time.
#include "dvxWidgetPlugin.h"
#include "dvxWgtP.h"
#include "../../sql/dvxSql.h"
#include "thirdparty/stb_ds_wrap.h"

View file

@ -1,9 +1,9 @@
// widgetDbGrid.h -- Database grid widget API
// dbGrid.h -- Database grid widget API
#ifndef WIDGET_DBGRID_H
#define WIDGET_DBGRID_H
#ifndef DBGRID_H
#define DBGRID_H
#include "dvxWidget.h"
#include "dvxWgt.h"
typedef struct {
WidgetT *(*create)(WidgetT *parent);
@ -27,4 +27,4 @@ static inline const DbGridApiT *dvxDbGridApi(void) {
#define wgtDbGridSetColumnWidth(w, field, width) dvxDbGridApi()->setColumnWidth(w, field, width)
#define wgtDbGridGetSelectedRow(w) dvxDbGridApi()->getSelectedRow(w)
#endif // WIDGET_DBGRID_H
#endif // DBGRID_H

View file

@ -14,8 +14,8 @@
//
// Depends on the datactrl widget DXE for the DataCtrlApiT.
#include "dvxWidgetPlugin.h"
#include "../widgetDataCtrl.h"
#include "dvxWgtP.h"
#include "../dataCtrl/dataCtrl.h"
#include <stdio.h>
#include <stdlib.h>

View file

@ -1,8 +1,8 @@
// widgetDropdown.h -- Dropdown widget API
#ifndef WIDGET_DROPDOWN_H
#define WIDGET_DROPDOWN_H
// dropdown.h -- Dropdown widget API
#ifndef DROPDOWN_H
#define DROPDOWN_H
#include "../core/dvxWidget.h"
#include "../../core/dvxWgt.h"
typedef struct {
WidgetT *(*create)(WidgetT *parent);
@ -22,4 +22,4 @@ static inline const DropdownApiT *dvxDropdownApi(void) {
#define wgtDropdownGetSelected(w) dvxDropdownApi()->getSelected(w)
#define wgtDropdownSetSelected(w, idx) dvxDropdownApi()->setSelected(w, idx)
#endif // WIDGET_DROPDOWN_H
#endif // DROPDOWN_H

View file

@ -19,7 +19,7 @@
// Popup overlay painting and hit testing are shared with ComboBox via
// widgetDropdownPopupRect and widgetPaintPopupList in widgetCore.c.
#include "dvxWidgetPlugin.h"
#include "dvxWgtP.h"
#include "../texthelp/textHelp.h"
#include "../listhelp/listHelp.h"

View file

@ -1,8 +1,8 @@
// widgetImage.h -- Image widget API
#ifndef WIDGET_IMAGE_H
#define WIDGET_IMAGE_H
// image.h -- Image widget API
#ifndef IMAGE_H
#define IMAGE_H
#include "../core/dvxWidget.h"
#include "../../core/dvxWgt.h"
typedef struct {
WidgetT *(*create)(WidgetT *parent, uint8_t *data, int32_t w, int32_t h, int32_t pitch);
@ -22,4 +22,4 @@ static inline const ImageApiT *dvxImageApi(void) {
#define wgtImageSetData(w, data, imgW, imgH, pitch) dvxImageApi()->setData(w, data, imgW, imgH, pitch)
#define wgtImageLoadFile(w, path) dvxImageApi()->loadFile(w, path)
#endif // WIDGET_IMAGE_H
#endif // IMAGE_H

View file

@ -17,7 +17,7 @@
// No border or bevel is drawn -- the image fills its widget bounds with
// centering if the widget is larger than the image.
#include "dvxWidgetPlugin.h"
#include "dvxWgtP.h"
static int32_t sTypeId = -1;

View file

@ -1,8 +1,8 @@
// widgetImageButton.h -- ImageButton widget API
#ifndef WIDGET_IMAGEBUTTON_H
#define WIDGET_IMAGEBUTTON_H
// imgBtn.h -- ImageButton widget API
#ifndef IMGBTN_H
#define IMGBTN_H
#include "../core/dvxWidget.h"
#include "../../core/dvxWgt.h"
typedef struct {
WidgetT *(*create)(WidgetT *parent, uint8_t *data, int32_t w, int32_t h, int32_t pitch);
@ -22,4 +22,4 @@ static inline const ImageButtonApiT *dvxImageButtonApi(void) {
#define wgtImageButtonSetData(w, data, imgW, imgH, pitch) dvxImageButtonApi()->setData(w, data, imgW, imgH, pitch)
#define wgtImageButtonLoadFile(w, path) dvxImageButtonApi()->loadFile(w, path)
#endif // WIDGET_IMAGEBUTTON_H
#endif // IMGBTN_H

Some files were not shown because too many files have changed in this diff Show more