Skip to content

Add schema parser and register schema classes#363

Merged
corepunch merged 7 commits into
mainfrom
feature/better-data-objects
Jul 5, 2026
Merged

Add schema parser and register schema classes#363
corepunch merged 7 commits into
mainfrom
feature/better-data-objects

Conversation

@corepunch

Copy link
Copy Markdown
Owner

Introduce a schema-driven data model: add source/data/data_schema.c and data_schema.h implementing DS_ParseSchema/DS_ParseSchemaFromString, DS_FreeSchema, and lookup helpers; these register/unregister ClassDesc entries for schema-generated entity classes. Expose OBJ_UnregisterClass and PF_DATA_FIELD in include/orca.h and implement OBJ_UnregisterClass in core_main.c to remove class/property type slots. Update core docs (core.cgen) and remove legacy typed DataObject start handlers; simplify property lookup and stop propagating Name->property updates in Lua setters. Build config (premake5.lua) now includes source/data files. Update sample data (ApplicationData, Games, Tabs) to schema-backed XML and add corresponding Schema.xml files; package.lua now references the schema files. These changes enable compact schema-generated entity classes with inline typed properties and lifecycle management for dynamic schemas.

corepunch added 3 commits July 5, 2026 16:40
Introduce a schema-driven data model: add source/data/data_schema.c and data_schema.h implementing DS_ParseSchema/DS_ParseSchemaFromString, DS_FreeSchema, and lookup helpers; these register/unregister ClassDesc entries for schema-generated entity classes. Expose OBJ_UnregisterClass and PF_DATA_FIELD in include/orca.h and implement OBJ_UnregisterClass in core_main.c to remove class/property type slots. Update core docs (core.cgen) and remove legacy typed DataObject start handlers; simplify property lookup and stop propagating Name->property updates in Lua setters. Build config (premake5.lua) now includes source/data files. Update sample data (ApplicationData, Games, Tabs) to schema-backed XML and add corresponding Schema.xml files; package.lua now references the schema files. These changes enable compact schema-generated entity classes with inline typed properties and lifecycle management for dynamic schemas.
…eSlot

- Add 'data' to MODULES in Makefile (data_schema.c was never compiled)
- Pass NULL, NULL for node() schema/entity params in property loading
- Declare PROP_GetRawValueSlot via extern in fs_xml.c
- Remove duplicate XMLSTR macro from data_schema.c
@corepunch

Copy link
Copy Markdown
Owner Author

@copilot fix builds/tests (see failing checks)

Co-authored-by: corepunch <83646194+corepunch@users.noreply.github.com>

Copilot AI commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

@copilot fix builds/tests (see failing checks)

Fixed the failing checks in commit fcfd43e.

  • Resolved the WebGL compile failure in XmlDataSource_Start by avoiding the expression-style Con_Printf return path that broke Emscripten builds.
  • Restored DataContext name-path binding compatibility used by ListBox tests.
  • Updated the failing nested DataContext ListBox test fixture/path assertion to match the current DataObject model.

Validated locally with:

  • make unite
  • make test-listbox

corepunch added 2 commits July 5, 2026 20:48
- Add Name fallback in binding engine for any object via OBJ_GetName
- Send Object.Start to XmlDataSource children in FS_LoadBundle
- Add Data module to Makefile MODULES list
- Fix fs_xml.c node() calls with NULL schema/entity params
- Extern declare PROP_GetRawValueSlot in fs_xml.c
- Remove duplicate XMLSTR macro in data_schema.c
- Fix test_layout.lua Name/name case mismatch in XML searches
- Fix test_listbox.lua nested path test
- Add DataObject back to core.cgen with Value property
@corepunch

Copy link
Copy Markdown
Owner Author

@copilot Fix webgl build

Co-authored-by: corepunch <83646194+corepunch@users.noreply.github.com>

Copilot AI commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

@copilot Fix webgl build

Fixed in 7306d2e: updated Makefile.webgl to include the data module in WEBGL_MODULES, so WebGL builds now compile source/data/data_schema.c and resolve the missing DS_* symbols.

@corepunch corepunch merged commit 1a4e725 into main Jul 5, 2026
4 checks passed
@corepunch corepunch deleted the feature/better-data-objects branch July 5, 2026 19:20
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.

2 participants