main now has a Haiku backend (#175). This branch takes it in place of
its own backend (haiku_be.cpp and its CI job are removed), and keeps
only these changes on top of it:
- RTLD_NOLOAD and ESOCKTNOSUPPORT are optional, so that the library
also builds with the headers of Haiku R1/beta5 (the sysroot of
D-Modem's haiku_sysroot.py, which the D-Modem GUI uses).
- COMn is the nth serial port in /dev/ports.
- A click on a disabled window (the owner of a modal dialog) brings
the dialog to the front and does not go to the window.
- docs/haiku.md tells these items.
Tested with the D-Modem GUI on Haiku R1/beta6 in QEMU.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRTJUdomcnCN8okhJSr
Signed-off-by: Neo-Desktop <321592+Neo-Desktop@users.noreply.github.com>
The portable layer and the library now build for x86_64-unknown-haiku
with the system's clang and a sysroot of Haiku's packages
(SYSROOT=..., STDLIB=). The Interface Kit shows the windows.
- haiku.h, haiku_be.cpp and backend_haiku.cpp: the backend, in two
halves, as for Cocoa. The BApplication and each BWindow have their
own threads; they queue the input for the program's thread. A click
on a disabled window brings its modal dialog to the front.
- GetModuleFileName uses get_next_image_info (no /proc on Haiku), and
the command line comes from __libc_argv.
- COMn is the nth device in /dev/ports. Haiku's fonts and
~/config/settings/libmfc are used.
- Guards for the errno values, SIOCATMARK, RTLD_NOLOAD and the CS5 to
CS8 values that Haiku does not have or defines differently.
- The shared libraries link libbe, libnetwork and libbsd.
- docs/haiku.md, and the cross-haiku CI job, which builds the
libraries.
Tested with the D-Modem GUI on Haiku R1/beta6 in QEMU: menus, dialogs,
modal dialogs, the keyboard, moving windows and the serial ports.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRTJUdomcnCN8okhJSr
Signed-off-by: Neo-Desktop <321592+Neo-Desktop@users.noreply.github.com>
The portable layer and the library now build for x86_64-unknown-haiku
and i586-pc-haiku with clang and a sysroot from clang-retro/unix-sdk.
The Haiku backend has two halves, as the Cocoa one has:
backend_haiku_be.cpp uses BApplication, BWindow, BView and BBitmap,
and backend_haiku.cpp connects them to the window manager of the
layer. The windows have no app_server border; the layer draws the
frame. Menus and tooltips float and do not take the focus. Keys,
modifiers, the mouse wheel, the cursor and the clipboard are mapped.
Other Haiku changes:
- the program path and argv come from the kernel and __libc_argv,
as Haiku has no /proc;
- the fonts come from the Haiku font folders (Noto Sans for the UI);
- the registry file is polled, as there is no inotify or kqueue;
- CSIZE, SIOCATMARK, ETOOMANYREFS, malloc.h and the tolower macro;
- CAsyncSocket::GetSockName and GetPeerName fail for an address that
is not IPv4, as on Windows (Haiku's sockaddr_in can hold an IPv6
address).
samples/showcase is a small SDI program with dialogs and common
controls. tests/run-haiku-tests.sh builds the tests and runs them in
Haiku in QEMU (unix-sdk's haiku-vm.py), and takes screenshots of the
sample. CI runs them in the nightly image for x86_64 and builds them
for i586. docs/haiku.md describes the port.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRUCocRdmh1id7SXNMg
Signed-off-by: Neo-Desktop <321592+Neo-Desktop@users.noreply.github.com>
winhelp_file.cpp uses std::abs, but it includes only <stdlib.h>. With
the libc++ of the macosx10.4 sysroot, <stdlib.h> does not declare
std::abs, so the build for Mac OS X 10.4 stopped with "no member named
'abs' in namespace 'std'".
Add a CI job that builds the libraries for i386 and PowerPC Mac OS X
10.4 against the nightly macosx10.4 sysroot, so that CI finds a missing
include of this type.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRTLwxzpeGPkbLpNqXL
Signed-off-by: Neo-Desktop <321592+Neo-Desktop@users.noreply.github.com>
- Fill pattern brushes a row at a time: a division for each pixel was
most of the time of each key on a 68000, which divides in software.
- An edit control draws again only the lines that a change touches,
not all of the control.
- SetScrollInfo draws only the scroll bar whose thumb looks different.
- The Mac event loop takes all the events that wait, so that keys typed
fast are not lost from the small Event Manager queue.
In the 68k simulator, one key in MultiPad went from about 17 million
instructions to about 0.3 million.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRTDFNgD4oK9xbDsEGn
Signed-off-by: Neo-Desktop <321592+Neo-Desktop@users.noreply.github.com>
* MessageBox: keep a tall box and its buttons on the screen
A message box with more lines than the screen can hold was taller than
the screen. On Mac OS 9 at 800x600, its OK button was below the screen.
Now the box is never taller than the work area. When its text does not
fit, the text is in a read-only edit control with a scroll bar. The box
is centered on its owner, but kept inside the work area. wintest
checks this.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRTDFNgD4oK9xbDsEGn
* wintest: check the tall message box on the portable layer only
The message box of Windows does not scroll, and the test sets the
environment with setenv, which MinGW does not have.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRTDFNgD4oK9xbDsEGn
---------
Co-authored-by: Claude <noreply@anthropic.com>
WinHelp now shows .hlp files in the layer's own viewer instead of
looking for a document of the same name.
- winhelp_file.cpp reads WinHelp 3.0, 3.1 and 4.0 files: the internal
file system, |SYSTEM, |TOPIC (LZ77), |Phrases and Hall compression,
|CONTEXT, |CTXOMAP, [MAP] numbers, |FONT, keywords, pictures (DDB,
DIB, metafile, SHG hotspots) and .cnt contents files.
- winhelp_view.cpp shows topics with the scrolling and non-scrolling
regions, tables, tabs, hotspots, popups, the button bar, help macros
and the Help Topics dialog box (Contents, Index, Find).
- WinHelpA/W send every HELP_* command to the viewer. A file that is
not a help file, or WINPORT_HELP, still opens the document.
- hlptest checks the viewer with a Halibut help file and two files
from tests/winhelp/mkhlp.py (WinHelp 3.1 and 4.0).
- docs/winhelp.md tells what the viewer does and its limits.
Claude-Session: https://claude.ai/code/session_01B82eRSpPwP3yMpFkLSDiNn
Co-authored-by: Claude <noreply@anthropic.com>
The TrueType fonts of System 7 have only a Mac Roman cmap subtable
(platform 1, encoding 0) and no OS/2 table. stb_truetype accepted only
Unicode subtables, so stbtt_InitFont failed for each of these fonts.
On System 7.6.1, GetOutlineTextMetrics gave 0 and 3D Text drew nothing.
stb_truetype now uses the Mac Roman subtable when the font has no
Unicode subtable. For such a font, the layer changes each Unicode
character to its Mac Roman code before it finds the glyph.
Claude-Session: https://claude.ai/code/session_01B82eRTDFNgD4oK9xbDsEGn
Co-authored-by: Claude <noreply@anthropic.com>
Build the OLE control sources for 16-bit Windows: COleControl,
COlePropertyPage, the stock property pages, CWnd::CreateControl and
COleControlSite. Add the OLE control interfaces, IIDs and CLSIDs to the
Win16 headers. Add src/win16olepro.cpp with the OLEPRO32 functions that
16-bit Windows does not have: the stock font and picture objects, the
property frame and OleTranslateColor.
Parse and write 16-bit dialog templates in the control container and
the property pages. Use OLESTR and CStringOle for OLE strings, and
64-bit arithmetic for the HIMETRIC conversions.
16-bit Windows has no OLE DB, so data binding causes a
CNotSupportedException. Add tests/win16ctl.cpp and the docs.
Claude-Session: https://claude.ai/code/session_01B82eRV6wfb9PKGryxuRrjF
Co-authored-by: Claude <noreply@anthropic.com>
afxext.h declared CEditView::InitializeReplace, but src did not define
it. It now prepares a replace with the find text, direction and case
of the last find or replace. If the selection is not the find text, it
selects the next occurrence. It gives FALSE, after OnTextNotFound, if
the find text is empty or not in the text.
OnReplaceSel uses it, as in MFC: with no match selected, Replace finds
the next occurrence and replaces it. sditest checks Replace and
Replace All.
Claude-Session: https://claude.ai/code/session_01B82eRTDFNgD4oK9xbDsEGn
Co-authored-by: Claude <noreply@anthropic.com>
The Exit item now has the key equivalent Command-Q. A keyDown event
with the Command key goes to MenuKey first. If MenuKey finds an item,
the layer chooses it. Other Command keys go to the program as before.
Claude-Session: https://claude.ai/code/session_01B82eRTDFNgD4oK9xbDsEGn
Co-authored-by: Claude <noreply@anthropic.com>
* port: finish the classic look of the controls
- Scroll bars: the trough is the checker of the face and highlight
colors, as DefWindowProc gives it for WM_CTLCOLORSCROLLBAR. A scroll
bar control asks its parent for the brush. Disabled arrows are
embossed, and a scroll bar control made with WS_DISABLED draws as
disabled from the start.
- List boxes: a scroll bar that SetScrollInfo hid shows again when the
items no longer fit. Before, a list box made empty lost WS_VSCROLL
and never got its bar back.
- Trackbars: without TBS_BOTH, the thumb has a point toward the ticks.
A thumb that is dragged or disabled has the checker face.
- Tabs: the two outer corners of each tab are cut.
wintest checks the trough, the list box's bar and the thumb's point.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRV6wfb9PKGryxuRrjF
* urlmon.h: define __WINPORT_EXTERN_C for the 16-bit build
The 16-bit build takes the OLE headers of the win16-sdk, which do not
include the windef.h of the portable layer. Since urlmon.h became C
compatible, afxole.h did not compile for i8086-pc-win16. The library and
the 16-bit tests build again.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRV6wfb9PKGryxuRrjF
* win16: show the tooltips of the toolbar
16-bit Windows has no tooltip control, so a toolbar with CBRS_TOOLTIPS
showed no tooltip. The 16-bit toolbar window now shows them itself:
when the mouse stays on a button for half a second, it sends
TTN_NEEDTEXTA to its owner and shows the text below the mouse in a
small window. A timer finds when the mouse leaves the button. win16bar
checks the tip of a button.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRV6wfb9PKGryxuRrjF
* win16: the Insert Object, Paste Special, Links and Server Busy dialogs
16-bit OLE 2 has no OLE dialog DLL. The dialogs are now templates in
memory in src/win16oleui.cpp, with the same rules as the dialogs of the
portable layer. Change Icon, Convert, Change Source and Object
Properties still fail. tests/win16oledoc.cpp runs each dialog with a
hook that closes it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRV6wfb9PKGryxuRrjF
* win16: the progress bar, trackbar, up-down and tab control windows
16-bit Windows has no comctl32.dll. src/win16ctl.cpp registers four
window classes that do the messages of the common controls in ANSI,
with the 16-bit packing of WM_HSCROLL and WM_VSCROLL, and draws them in
the 3D style of the system colors. CProgressCtrl, CSliderCtrl,
CSpinButtonCtrl and CTabCtrl now make their windows. tests/win16cmn.cpp
checks each control and its notifications.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRV6wfb9PKGryxuRrjF
* win16: image lists, and the afxcmn.h class members
src/win16imgl.cpp gives the ImageList_ functions with 16-bit GDI: the
images side by side in one screen bitmap, the masks in one monochrome
bitmap, the draw styles, the overlays, the icons and the drag image.
cmnctls.cpp is now in the 16-bit library, so CImageList and the other
classes of afxcmn.h link. win16ctl.h has what the control windows share.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRV6wfb9PKGryxuRrjF
* Win16: add the header control and the list view
The library draws the header control (AfxHeader16, also SysHeader32) and
the list view (AfxListView16, also SysListView32) on 16-bit Windows. The
list view has the four views, virtual lists, callbacks, label editing,
check boxes, custom draw, sorting and find. The win16cmn test checks a
report view. The Win16 code is built and linked; Wine cannot run it in
this container.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRV6wfb9PKGryxuRrjF
* Win16: add the tree view
The library draws the tree view (AfxTreeView16, also SysTreeView32) on
16-bit Windows: lines, buttons, check boxes, image lists, callbacks,
label editing, custom draw, sorting, the drop highlight, the insert
mark, drag notifications and the incremental search. The win16cmn test
checks the links, the expansion, the selection and the sort of a tree.
The Win16 code is built and linked; Wine cannot run it in this
container.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRV6wfb9PKGryxuRrjF
* Win16: add the tooltip control
The library draws the tooltip (AfxToolTip16, also tooltips_class32) on
16-bit Windows: window and rectangle tools, TTM_RELAYEVENT and
TTF_SUBCLASS, the text callback, string resources, TTN_SHOW and
TTN_POP, tracking tips, titles, delay times, colors, margins and word
wrap. AFX_WNDCOMMCTL_BAR_REG registers it, as ICC_BAR_CLASSES does. The
win16cmn test checks the tools, the text, a hit test, the show and the
pop. The Win16 code is built and linked; Wine cannot run it in this
container.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRV6wfb9PKGryxuRrjF
* Win16: add the hot key, IP address, pager and link controls
The library draws the hot key control, the IP address control, the
pager and the link control (SysLink) on 16-bit Windows, with their
messages and notifications. The win16cmn test checks each of them. The
Win16 code is built and linked; Wine cannot run it in this container.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRV6wfb9PKGryxuRrjF
* Win16: add the extended combo box
The library draws the extended combo box (AfxComboBoxEx16, also
ComboBoxEx32) on 16-bit Windows with an owner-drawn combo box: indents,
images, callbacks and the CBEN_ notifications. The 16-bit CB_ messages
have the numbers of the CBEM_ messages, so afxwin16u.h moves the CBEM_
messages above them. The win16cmn test checks the items, the data and
the notifications. The Win16 code is built and linked; Wine cannot run
it in this container.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRV6wfb9PKGryxuRrjF
* Win16: draw the month calendar and the date and time picker
src/win16date.cpp registers AfxMonthCal16 and AfxDateTime16 (and the
comctl32 names). The calendar does the MCM_ messages, several months,
the selection, the range, today, week numbers and day states. The
picker reads the WIN.INI [intl] formats, does custom formats with
callback fields, the keys, the up-down button, the drop-down calendar,
DTS_SHOWNONE and DTS_APPCANPARSE, and sends the DTN_ notifications.
afxwin16u.h moves the MCHT_ flags into 16 bits. win16cmn tests both
controls. The code is built and linked, but not run.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRV6wfb9PKGryxuRrjF
* Win16: draw the rebar, and build CReBar
src/win16rebar.cpp registers AfxReBar16 (and ReBarWindow32). It does
the RB_ messages: bands in rows, grippers, images, text, background
bitmaps, chevrons, drags between rows and along a row, the smallest and
largest width of a band, and CCS_VERT. It sends the RBN_ notifications
and gives the notifications of the child windows to its parent.
rebar.cpp (CReBar) is now in the Win16 library. win16cmn tests the
rebar and a CReBar. The code is built and linked, but not run.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRV6wfb9PKGryxuRrjF
* Win16: draw the animation control
src/win16anim.cpp registers AfxAnimate16 (and SysAnimate32). It plays
the first video stream of an AVI clip from an AVI resource or a file,
with uncompressed or BI_RLE8 frames. It reads each frame when it shows
it, so a clip can be larger than a segment. A timer plays the clip, and
the parent gets ACN_START and ACN_STOP. ACS_CENTER, ACS_AUTOPLAY and
ACS_TRANSPARENT work.
Now the library draws all the common controls on Win16. win16cmn writes
a small RLE8 clip and checks its frames. The code is built and linked,
but not run.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRV6wfb9PKGryxuRrjF
---------
Co-authored-by: Claude <noreply@anthropic.com>
SetCursor told the backend about a new cursor only when the cursor
changed. The current cursor starts as NULL, so the first SetCursor(NULL)
from a program did nothing, and the system pointer stayed on the screen.
The screen savers call SetCursor(NULL) to hide the pointer.
The layer now keeps the cursor that the backend shows. At the start this
is the system pointer, which is not NULL. SetCursor and ShowCursor give
the backend a new cursor only when it is different from that cursor.
Claude-Session: https://claude.ai/code/session_01B82eRTDFNgD4oK9xbDsEGn
Co-authored-by: Claude <noreply@anthropic.com>
On the classic Mac OS the program's screen is now the whole Mac screen,
and the work area is the screen below the menu bar, as on Windows with
the taskbar. While a visible window covers the whole screen (a screen
saver), the backend hides the menu bar and the Control Strip. It shows
them again when no window covers the screen, on a suspend event, and at
exit.
A program that the Finder opens gets the name of its file as its
command line, not its path: MULTIPAD skips its name up to the first
space and tried to open "Desktop Folder/MultiPad".
Claude-Session: https://claude.ai/code/session_01B82eRTDFNgD4oK9xbDsEGn
Co-authored-by: Claude <noreply@anthropic.com>
* Read the pointer's position from the classic Mac OS in GetCursorPos
GetCursorPos gave the position of the last mouse input. Before the
first one, that was not where the pointer was. A screen saver reads the
position when it starts and quits when it changes, so it quit when the
first mouse input came. Backends can now read the pointer (ReadCursor);
the classic Mac OS backend asks the Event Manager.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRTDFNgD4oK9xbDsEGn
* Read the TrueType fonts of the classic Mac OS Fonts folder
The layer had only its built-in bitmap font on the classic Mac OS, so
GetOutlineTextMetrics and wglUseFontOutlines failed and the SDK's 3D Text
screen saver drew nothing. FontDirs now gives the Fonts folder of the
System Folder (FindFolder), and suitcases are read through
/..namedfork/rsrc, as on Mac OS X (clang-retro/mac-sdk#30).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRTDFNgD4oK9xbDsEGn
---------
Co-authored-by: Claude <noreply@anthropic.com>
* Mac OS X 10.4 and 10.5 on PowerPC, OpenGL through wgl, and the Win32 SDK samples
The portable layer and the library build for PowerPC Mac OS X 10.4 and
10.5 with the Cocoa backend:
- port/compat/macosx and compat_macosx.cpp add the C library functions
that 10.4 does not have. backend_cocoa.mm uses only the Cocoa API of
10.4 with the 10.4 SDK. Without audio queues there is no sound device.
- font.cpp reads .dfont files and font suitcases.
- resource_order.cpp puts the numbers of compiled resources in the byte
order of a big-endian processor, so menus, dialogs, strings, icons and
bitmaps load on PowerPC and 68k.
- PeekMessage lets the backend take input and show what was drawn, so
animation loops update the screen.
OpenGL: opengl.cpp gives the wgl functions over CGL (pixel formats,
contexts, SwapBuffers, wglUseFontBitmaps and wglUseFontOutlines), and
libglaux.a gives the aux functions of the Windows SDK. GDI gains
GetGlyphOutline and GetOutlineTextMetrics, and more of the Win32 API that
old programs use (OpenFile, display settings, priority classes, IMM stubs,
windowsx.h, io.h and others), with C-compatible headers.
tools/build-sdk-samples.py builds MULTIPAD and the OpenGL screen savers
from a Win32 SDK of your own. See docs/macosx-10.4.md and
docs/sdk-samples.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRSSz5czpTdGQpDYmAk
* Show OpenGL animations on Tiger, and fixes for the SDK samples
- GetMessage and PeekMessage let the backend take input and show the
windows at most every 10 ms, so loops that always find a message
(paint, timers) or only peek update the screen.
- SwapBuffers and glFlush copy the picture straight into the DC's
surface. glFlush copies it at most every 20 ms. PutPixels works out
the source columns once.
- build-sdk-samples.py makes the release build (NDEBUG) and gives rand
the range of Visual C++ (0x7FFF). HOST_CXX names a compiler for the
host for res2cpp.py.
- malloc.h uses the classic Mac OS C library's own header.
- winbase.h and winuser.h declare two structures before C uses them in
a prototype.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRSSz5czpTdGQpDYmAk
* Fix the pixel-format count type for newer macOS SDKs
CGLChoosePixelFormat writes a long in the 10.4 SDK and a GLint in later
SDKs. Take the type from the function signature.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRSSz5czpTdGQpDYmAk
* Link the macOS tests with OpenGL, and test the CGL pixel format
libwinport now uses CGL on Mac OS X, so the tests link OpenGL.framework,
and wintest expects a pixel format there.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRSSz5czpTdGQpDYmAk
---------
Co-authored-by: Claude <noreply@anthropic.com>
16-bit Windows has no comctl32.dll, so CToolBar and CStatusBar had no
window. src/win16bar.cpp registers two window classes that do the
toolbar and status bar messages that the MFC classes send, and draws
them in the 3D style of the system colors.
- The classes have their own names (AfxToolbar16, AfxStatusBar16).
Wine can also have the 32-bit comctl32 classes, which do not read
the 16-bit structures.
- A UINT has 16 bits on Win16. The TBBS_ button styles now put the
state in the high byte, as in MFC 2.5, and SBPS_DISABLED and
SBPS_STRETCH fit in 16 bits.
- tests/win16bar.cpp tests the layout, clicks, idle updates, the
message pane, docking, floating and ShowControlBar in Wine.
Claude-Session: https://claude.ai/code/session_01B82eRRTV4u8c9f3gQUmqvq
Co-authored-by: Claude <noreply@anthropic.com>
The Win16 library now has CWinApp, CWnd, the frames (SDI, MDI, mini
frames and splitters), CDialog with DDX, the common dialogs, the
controls, the GDI classes and document/view with printing.
- afxwin16u.h gives the Win32 USER, GDI and KERNEL declarations that
the window classes use; src/win16u.cpp does them with the nearest
16-bit calls, or fails as Win32 fails. include/win16 sends the OLE
headers to the OLE 2 headers of the SDK; the common control types
come from port/include, last on the include path.
- The ON_WM_ macros, OnCommand, the reflection and the MDI code read
the 16-bit packing of WM_COMMAND, WM_ACTIVATE, the scroll, menu,
list box and MDI messages, and WM_CTLCOLOR. GET_WM_COMMAND_* are in
afxwin.h for each target.
- CAfxDlgTemplate writes the 16-bit dialog template. The File New type
dialog keeps the chosen template in its state, not in the dialog
result, which has no room for a far pointer on Win16.
- Registered message entries keep a DWORD_PTR, which holds a far
pointer. The handle maps use a word key on Win16.
- The registry functions use the HKEY_CLASSES_ROOT tree of shell.dll;
profiles go to the INI file. Events, mutexes and semaphores are task
objects. The OLE virtuals are stubs (src/win16ole.cpp).
- tests/run-win16-tests.sh (make check) runs core, memtest and three
window tests (frame and dialog, SDI, MDI) at -O0, -Os and -O2 in
Wine: 15 of 15 pass.
Claude-Session: https://claude.ai/code/session_01B82eRRTV4u8c9f3gQUmqvq
Co-authored-by: Claude <noreply@anthropic.com>