Skip to content

kwxLanguageUpdates - #2

Merged
Randalphwa merged 2 commits into
mainfrom
kwxLanguageUpdates
Nov 19, 2026
Merged

Randalphwa merged 2 commits into
mainfrom
kwxLanguageUpdates

Conversation

@Randalphwa

@Randalphwa Randalphwa commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

Summary

Regenerated bindings, widened wx API coverage, added Windows CI build.

Motivation

The bindings are generated from the kwxFFI headers and defs, so this branch carries the generator's full output. That output had drifted from kwxFFI: several FFI declarations no longer matched the exported C signatures (argument order on the choice helpers, constness on wxFgets), whole subsystems had no Lua wrappers at all (data view, doc/view, debug report, SVG), and the export lists were missing symbols that kwxgen now emits. Because the generated files are checked in, the diff is large and mostly mechanical; the intent is to make the bindings build cleanly from a fresh checkout and to stop hand-tracking which classes have idiomatic wrappers.

Changes

Binding generation and helpers

  • kwxgen.config.json now sets exports to true, which is what produced the accompanying .def/.exp/.map churn.
  • wx/kwxffi_helpers_gen.lua gains cstr_to_str (takes ownership and frees the returned buffer) and borrow_cstr (reads without freeing), separating the two cases that were previously conflated.
  • wx/kwxffi_idiomatic_gen.lua registers the newly generated modules, including kwxAccString, wxStringInputStream, wxXmlDocument, the debug report family, and the doc/view templates and frames.

New generated wrappers

  • Data view: wxdataviewmodel_gen, wxdataviewcolumn_gen, the store/model set (wxdataviewliststore_gen, wxdataviewtreestore_gen, wxdataviewindexlistmodel_gen, wxdataviewvirtuallistmodel_gen), the renderer set (wxdataviewrenderer_gen plus the text, bitmap, date, progress, spin, toggle, choice, and custom renderers), wxdataviewitemattr_gen, wxdataviewicontext_gen, wxdataviewcheckicontext_gen, and wxdataviewevent_gen. wxdataviewctrl_gen also picks up EnableDropTarget, GetSortingColumnCount, GetSortingColumnAt, and HitTestColumnPosition, and now derives from wxcontrol_gen.
  • Doc/view: wxdoctemplate_gen, kwxdoctemplate_gen, kwxdocauiparentframe_gen, kwxdocauichildframe_gen, and kwxframe_gen; wxdocmanager_gen and kwxdocument_gen gain the missing constructors and result setters.
  • Graphics: wxgraphicsgradientstops_gen, wxgraphicspeninfo_gen, wxsvggraphicscontext_gen, wxsvgattributes_gen.
  • Debug report: wxdebugreport_gen, wxdebugreportcompress_gen, wxdebugreportupload_gen, wxdebugreportpreviewstd_gen, and kwxdebugreportupload_gen.
  • Accessibility: kwxaccstring_gen and kwxmsaa_gen, plus the full WithData callback and result surface on wxaccessible_gen.
  • Miscellaneous: wxstringinputstream_gen, wxpasswordentrydialog_gen, wxdynamiclibrarydetails_gen, kwxdynamiclibrarylist_gen, wxitemattr_gen, wxrichtextplaintext_gen, wxrichtextparagraph_gen, wxmetafiledataobject_gen, wxurldataobject_gen, wxvirtualfiledataobject_gen, and the DC state changers (wxdcbrushchanger_gen, wxdcfontchanger_gen, wxdcpenchanger_gen, wxdctextbgcolourchanger_gen, wxdctextbgmodechanger_gen, wxdctextcolourchanger_gen).

Corrected declarations and ownership handling

  • wx/kwxffi_freefuncs_gen.lua and wx/kwxffi_freefuncs_idiomatic_gen.lua: wxFgets takes a mutable buffer and is no longer freed by the caller; wxGetSingleChoice, wxGetSingleChoiceData, and wxGetSelectedChoices are reordered to count followed by choices; wxGetDisplaySize now wraps an owned wxSize; kwxUtf8Buffer_Data returns a borrowed string. New entries: wxFputs, wxGetEnvValue, wxStrlen, wxGetSingleChoiceIndexArray, and the WithCursor drag helpers.
  • wx/kwxffi_classes_gen.lua follows the same signature corrections and gains wxBitmap_CreateFromXPMString, Cursor_CreateFromXPMString, the wxWindow SetSizeWH and FromDIPSize variants, and kwxAccString_SetValue.
  • wx/kwxlog_gen.lua wraps GetActiveTarget into wxlog_gen instead of returning a raw pointer, and wxvariant_gen adds the data view icon text constructors and getters.
  • The export lists (kwxffi_exports.def, .exp, .map) drop DropSource_DoDragDrop and add DropSource_CreateDefault, Cursor_CreateFromXPMString, exp_wxEVT_AUI_PANE_ACTIVATED and its _MINIMIZE sibling, plus the expanded art-ID and AUI button constants in kwxffi_constants_gen.lua.

Build and repository

  • .github/workflows/build.yml builds the interpreter and generated bindings on windows-2025-vs2026 using the MSYS2 clang64 toolchain and the ninja-clang preset, then invokes the port compile step when tests/quick_port exists.
  • build_quick_port.cmd byte-compiles the QuickPort entry point with the repository's own luajit.exe via loadfile, without launching the GUI.
  • .gitignore now ignores tests/, samples/, and kwxSamples/; the tracked samples/ and tests/ trees are removed in this branch.

Regenerate FFI declarations, exports and constants, adding data view,
doc/view, AUI, accessibility, debug report and wizard bindings along
with data-carrying callback setters.
Mark returned point, size and rect wrappers as owned so Delete frees
them instead of leaking.
Add clang64 CI workflow and a QuickPort compile-check script.
@Randalphwa
Randalphwa marked this pull request as ready for review November 19, 2026 16:08
@Randalphwa
Randalphwa merged commit c99c590 into main Nov 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant