Skip to content

ReAction: self-contained class headers, link library helpers - #1851

Merged
Kalamatee merged 2 commits into
aros-development-team:masterfrom
terminills:reaction-1-base
Oct 28, 2026
Merged

Kalamatee merged 2 commits into
aros-development-team:masterfrom
terminills:reaction-1-base

Conversation

@terminills

Copy link
Copy Markdown
Contributor

First of four stacked ReAction pull requests (the classes Nick started; we are finishing them towards AmigaOS ReAction parity). Each later one contains this one's commits.

  • class headers include intuition/classes.h and declare the varargs forms
  • libreaction.a: the label helpers (ChooserLabels, ClickTabs, RadioButtons, BrowserNodes and their Free functions), LBAddNode/LBEditNode/LBRemNode, and varargs stubs for the class functions; clib/reaction_lib_protos.h
  • debug output switched off in the classes and the library
  • the link library depends on the class headers it includes (a fresh tree could compile it first and miss proto/chooser.h)

Built from a fresh tree on this branch for pc-x86_64 and pc-i386. The ClassAct example sources build against it.

@Kalamatee

Copy link
Copy Markdown
Member

Mergeable after one fix.

  • The new LBAddNode, LBEditNode and LBRemNode helpers send LBM_ADDNODE, LBM_EDITNODE and LBM_REMNODE, and listbrowser.gadget implements none of them. The calls fall through to rootclass, so the helpers always return NULL or 0 while the new header advertises them. Implement the three methods or drop the helpers for now.
  • The varargs stubs duplicate the macros genmodule already generates. They are only reached with NO_INLINE_STDARG, which is a fair parity case, but the comment should say so.
  • The varargs label builders silently stop at 63 labels. The AmigaOS versions have no limit.

@terminills

Copy link
Copy Markdown
Contributor Author

Updated:

  • cc6462b implements LBM_ADDNODE, LBM_REMNODE and LBM_EDITNODE in listbrowser.gadget (45.3). ADDNODE inserts after lba_Node (NULL at the head, ~0 at the tail) with one entry per ColumnInfo column; after each method the gadget recounts, keeps the selection on the same node at its new index (or clears it when that node was removed) and redraws when it has a GadgetInfo.
  • ec47aec: the varargs label builders add each string as they read it, with no limit, and reaction_varargs.c now says the stubs are for NO_INLINE_STDARG builds.

Tested on x86_64 with a listbrowser in a window: LBAddNode at the tail and head, LBEditNode reading back, LBRemNode of the head and of the selected node, and ChooserLabels() with 70 strings, all as expected. The test also exposed that DoGadgetMethodA() cast its IPTR result to ULONG, so LBAddNode() returned truncated node pointers on 64-bit; that fix is separate in #1891, and the helpers need it.

The LBAddNode(), LBEditNode() and LBRemNode() helpers of the link
library send these methods, but the class did not implement them, so
the calls fell through to rootclass and returned 0.

LBM_ADDNODE allocates a node with one entry per column of the
gadget's ColumnInfo and inserts it after lba_Node: NULL puts it at the
head, ~0 at the tail. LBM_REMNODE removes and frees the node and
LBM_EDITNODE applies the attributes to it. After each the gadget
recounts the list, finds the selected node's new index (or clears the
selection when it was removed), keeps the scroll position in range and
redraws when it has a GadgetInfo.

Checked on x86_64 with a listbrowser in a window: three LBAddNode()
calls (two at the tail, one at the head), LBEditNode() reading back
the new text, LBRemNode() of the head keeping the selection on the same
node at its new index, LBRemNode() of the selected node clearing it.
The node pointers survive only
with DoGadgetMethodA() returning the full IPTR.
The varargs forms of ChooserLabels(), ClickTabs(), RadioButtons() and
BrowserNodes() collected their strings in a 64-entry array and silently
stopped at 63 labels. They now add each string to the list as they read
it, with no limit, as on AmigaOS.

The varargs stubs of the class functions duplicate the proto macros;
their file now says they are for programs built with NO_INLINE_STDARG.

Checked on x86_64: ChooserLabels() with 70 strings returns 70 labels.
@Kalamatee
Kalamatee merged commit 2ad5d5f into aros-development-team:master Oct 28, 2026
3 of 4 checks 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.

2 participants