Skip to content

UXWin32Driver

UXWin32Driver is the Win32 realization of UXViewDriver. The neutral toolkit runs on it unchanged.

#use <UXKit> // or #import "UXWin32Driver.xc"

UXGemDriver has the AES’s OBJECT[] array, and objc_draw/objc_find do the tree work for it. Win32 has no equivalent, so this driver keeps its own flat node array with parent and sibling links and walks it for painting (through WM_PAINT into the neutral draw seam) and for hit-testing.

UXAppKitDriver, UXGtkDriver and UXWebDriver keep the same shadow tree. It is the neutral form of the GEM-specific structure.

The neutral protocol passes windows as i32 handles, and an HWND is pointer-width. The driver keeps a small table indexed by the handle, and the protocol never sees a pointer.

This lets one interface serve a 16-bit AES object index, a 64-bit HWND, an NSWindow pointer and a DOM node id without any of them reaching the neutral layer.

The realized widgets are the platform’s own, reading directly from the neutral model:

neutralnative class
UXTableViewSysListView32
UXOutlineViewSysTreeView32
UXSlidermsctls_trackbar32
UXPopUpButtoncombobox, CBS_DROPDOWNLIST
UXSteppermsctls_updown32
UXProgressBarmsctls_progress32
UXSegmentedControlToolbarWindow32 check-group
UXToolbarToolbarWindow32 button row

Windows has no segmented control, so the closest equivalent is a toolbar check-group: a row of connected buttons with one or many latched. This is a mapping decision, not a drawing one, and it is why the neutral model describes behaviour and not appearance.

Implemented: menus, field editors, scrolling, tables and outlines, the toolbar and the common dialogs.

Not implemented: windowSetSubtitle, windowSetInfo, windowSetIcon, windowSetModified. These return a constant because Win32 has no window-chrome equivalent: there is no subtitle line and no edited dot in the title bar.

On UXAppKitDriver the same methods are different: NSWindow does have subtitle and documentEdited, and the methods are not yet implemented. In a driver, a method returning a constant can mean either; the comments say which.

A large set of run_win32_* gates exercises the Win32 backend: menus, focus, scrolling, radio groups, text layout and the kitchen sink. They run under Wine locally, and on a real Windows machine when the behaviour is something Wine does not reproduce accurately.

Wine catches logic errors, and the real machine catches cases where Wine is more forgiving than Windows.