diff --git a/README.md b/README.md index cde52a3..b4ff93d 100644 --- a/README.md +++ b/README.md @@ -125,7 +125,7 @@ dvxWidget.h. ## DXE Module System All modules are DXE3 dynamic libraries loaded by dvx.exe at startup. -The loader scans `libs/` for `.lib` files and `widgets/` for `.wgt` +The loader recursively scans `libs/` for `.lib` files and `widgets/` for `.wgt` files, reads `.dep` files for dependencies, and loads in topological order. Widget modules that export `wgtRegister()` have it called after loading. diff --git a/core/dvxApp.c b/core/dvxApp.c index 0c9b0cd..7f33953 100644 --- a/core/dvxApp.c +++ b/core/dvxApp.c @@ -3636,6 +3636,23 @@ static void pollWidgets(AppContextT *ctx) { static void pollWidgetsWalk(AppContextT *ctx, WidgetT *w, WindowT *win) { if (w->wclass && (w->wclass->flags & WCLASS_NEEDS_POLL) && w->wclass->poll) { w->wclass->poll(w, win); + + // If the poll dirtied internal state and the widget supports + // quickRepaint, render the dirty rows directly into the window's + // content buffer and add the affected area to the global dirty list. + if (w->wclass->quickRepaint) { + int32_t dirtyY = 0; + int32_t dirtyH = 0; + + if (w->wclass->quickRepaint(w, &dirtyY, &dirtyH) > 0) { + int32_t scrollY = win->vScroll ? win->vScroll->value : 0; + int32_t rectX = win->x + win->contentX; + int32_t rectY = win->y + win->contentY + dirtyY - scrollY; + int32_t rectW = win->contentW; + win->contentDirty = true; + dirtyListAdd(&ctx->dirty, rectX, rectY, rectW, dirtyH); + } + } } for (WidgetT *child = w->firstChild; child; child = child->nextSibling) { diff --git a/loader/README.md b/loader/README.md index 6d7757f..d947862 100644 --- a/loader/README.md +++ b/loader/README.md @@ -22,7 +22,7 @@ dynamically loaded DXE3 module. ### Phase 1: Libraries (libs/*.lib) -Scans the `LIBS/` directory for `.lib` files. Each module may have a +Recursively scans the `LIBS/` directory for `.lib` files. Each module may have a `.dep` file (same base name, `.dep` extension) listing base names of modules that must load first. The loader resolves the dependency graph and loads in topological order. @@ -38,7 +38,7 @@ dvxshell.lib (deps: libtasks, libdvx, texthelp, listhelp) ### Phase 2: Widgets (widgets/*.wgt) -Scans the `WIDGETS/` directory for `.wgt` files. Widget modules may +Recursively scans the `WIDGETS/` directory for `.wgt` files. Widget modules may also have `.dep` files (e.g., `textinpt.dep` lists `texthelp`). Loaded in topological order, same as libs. diff --git a/widgets/README.md b/widgets/README.md index bac9071..44a5adb 100644 --- a/widgets/README.md +++ b/widgets/README.md @@ -1,7 +1,7 @@ # DVX Widget Modules Individual widget type implementations, each built as a separate `.wgt` -DXE module. The loader scans the `WIDGETS/` directory at startup and +DXE module. The loader recursively scans the `WIDGETS/` directory at startup and loads every `.wgt` file it finds. Each module exports `wgtRegister()`, which registers its widget class(es) and API struct with the core.