Core
Core Infrastructure
The core layer is the runtime substrate under the GUI stack. It adds typed containers,
streams, events, DBind metadata, resource packs, strings, and higher-level filesystem helpers on top of the
lower-level osbs services.
Relevant Source Files
What The Core Layer Includes
coreall.h shows the intended scope clearly. It aggregates arrays, hash tables, buffers, clocks, dates,
DBind, events, heap helpers, filesystem helpers, key buffers, resource packs, regular expressions, sets, streams,
strings, and text filters, then pulls in osbsall.h.
So although the GUI pages get most of the attention, a substantial part of NAppGUI is actually a reusable C runtime/library layer.
Startup and Shutdown
core_start() is reference-counted. On the first user it starts osbs, the heap subsystem,
the stream subsystem, and the DBind registry, then registers built-in DBind types such as integers, reals, String,
and the ArrPt/ArrSt container families.
core_finish() unwinds that stack in reverse order when the last user exits. This pattern is repeated in the higher layers
like draw2d and ogl3d.
Events and Listener Model
The event API is strongly typed by convention. A Listener stores an object pointer and an event handler,
while listener_event(...) and related helpers carry a numeric event type plus sender/params/result pointers and type names.
This same event system is reused everywhere: GUI clicks, window close requests, draw callbacks, theme changes, idle work, and DBind object-change notifications all share the same listener/event machinery.
DBind and Runtime Type Metadata
DBind is part of core, not GUI. That is why serialization, comparison, default values, member ranges, and typed container handling can work independently of the widget layer. The GUI pages build on this runtime metadata, but the registry itself is a generic subsystem.
In practice, DBind is one of the most distinctive parts of the project because it gives plain C structs a reflection-like metadata layer.
Resources, Files, and Streams
Resource packs, filesystem helpers, and streams all live in the core layer. ResPack resolves text and binary payloads,
hfile adds high-level directory/file convenience functions, and Stream provides a unified read/write/tokenization surface
for memory, files, and sockets.
That is why higher layers such as gui, encode, and inet can share the same I/O conventions instead of each inventing their own.