port: UserInterface.cpp entry unit — ApplicationSetErrorString/StringTable_Initialize verbatim, Main ADAPTED to PythonBoot, Win32 entry N_A

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shenlei
2026-09-30 15:08:00 +09:00
co-authored by Claude Opus 5.5
parent fd4d9a39df
commit b497fce393
7 changed files with 96 additions and 18 deletions
@@ -5,13 +5,28 @@
"contracts": [],
"functions": {
"ApplicationSetErrorString": {
"status": "TODO"
"status": "PORTED",
"impl": [
"src/platform/UserInterface/UserInterface.cpp:ApplicationSetErrorString"
],
"test": [
"tests/port/port_app_loop_test.cpp (port.app_loop: ApplicationSetErrorString fills gs_szErrorString; ApplicationStringTable_GetStringz(IDS_APP_NAME))"
]
},
"CheckPythonLibraryFilenames": {
"status": "TODO"
"status": "N_A",
"note": "Win32 install check of lib\\\\*.pyc next to the exe. The embedded CPython 2.7 stdlib is installed by PythonHost::InstallStdLib, whose failure fails PythonBoot::Start."
},
"ApplicationStringTable_Initialize": {
"status": "TODO"
"status": "PORTED",
"impl": [
"src/platform/UserInterface/UserInterface.cpp:ApplicationStringTable_Initialize",
"src/platform/ScriptLib/PythonBoot.cpp:PythonBoot::Start"
],
"test": [
"tests/port/port_app_loop_test.cpp (port.app_loop: ApplicationSetErrorString fills gs_szErrorString; ApplicationStringTable_GetStringz(IDS_APP_NAME))"
],
"note": "verbatim; PythonBoot::Start calls it before locale.cfg as WinMain does, with a NULL module handle (LoadString is the English STRINGTABLE switch)."
},
"ApplicationStringTable_GetString": {
"status": "ADAPTED",
@@ -46,43 +61,65 @@
"test": "project/python_host_test.gd (godot --headless --path project --script python_host_test.gd) and the same check through MT_TEST_MODE=python in project/client_main.gd -> system.py stops at ImportError: No module named app, the same point as ctest port.python_launcher"
},
"Main": {
"status": "TODO"
"status": "ADAPTED",
"impl": [
"src/platform/ScriptLib/PythonBoot.cpp:PythonBoot::Start",
"src/platform/ScriptLib/PythonBoot.cpp:PythonBoot::RunMainScript",
"src/platform/UserInterface/UserInterface.cpp:PackSingletons"
],
"note": "40250: Main seeds rand, opens the log, creates CLZO/CEterPackManager, PackInitialize(\"pack\"), locale, CPythonApplication, CPythonLauncher + exception sender, RunMainScript, then tears down. Port: the host owns the frame loop, so PythonBoot::Start does the setup (launcher, exception sender, singletons, CPythonApplication::Create pieces), PackSingletons/PackInitialize run from the host pack bootstrap, and RunMainScript runs system.py on a script fiber that parks in app.Loop(). Invariant: the same singletons exist and system.py runs with __COMMAND_LINE__ before the first frame.",
"test": [
"tests/port/port_app_loop_test.cpp (port.app_loop: Start + RunMainScript reach app.Loop)",
"tests/port/port_login_flow_test.cpp"
]
},
"CreateMetin2GameMutex": {
"status": "TODO"
"status": "N_A",
"note": "Win32 named mutex; no caller in 40250."
},
"DestroyMetin2GameMutex": {
"status": "TODO"
"status": "N_A",
"note": "Win32 named mutex; no caller in 40250."
},
"__ErrorPythonLibraryIsNotExist": {
"status": "TODO"
"status": "N_A",
"note": "message box for CheckPythonLibraryFilenames (N_A); PythonBoot::Start returns the InstallStdLib error instead."
},
"__IsTimeStampOption": {
"status": "TODO"
"status": "N_A",
"note": "WinMain launcher option (/timestamp -> build-stamp message box); the host has no Win32 command line."
},
"__PrintTimeStamp": {
"status": "TODO"
"status": "N_A",
"note": "WinMain /timestamp message box with _MSC_VER build stamp; no gameplay semantics."
},
"__IsLocaleOption": {
"status": "TODO"
"status": "N_A",
"note": "WinMain --locale writes locale.txt and quits (launcher diagnostics); the host has no Win32 command line."
},
"__IsLocaleVersion": {
"status": "TODO"
"status": "N_A",
"note": "WinMain --perforce-revision writes <exe>.version and quits (patcher diagnostics)."
},
"__IsOpenIDAuthKeyOption": {
"status": "TODO"
"status": "N_A",
"note": "USE_OPENID is not defined in the 40250 build; compiled out."
},
"__IsOpenIDTestOption": {
"status": "TODO"
"status": "N_A",
"note": "USE_OPENID is not defined in the 40250 build; compiled out."
},
"WinMain": {
"status": "TODO"
"status": "N_A",
"note": "Win32 entry: hackshield/XTrap/GameGuard/CheckLatestFiles/WebBrowser/COM and launcher options. The platform entry is the host (src/host, android) calling PythonBoot::Start (ApplicationStringTable_Initialize, locale.cfg + SetDefaultCodePage) then PythonBoot::RunMainScript."
},
"GrannyError": {
"status": "TODO"
"status": "N_A",
"note": "never installed: 40250 Setup sets the Granny log callback Function to nullptr."
},
"Setup": {
"status": "TODO"
"status": "N_A",
"note": "timeBeginPeriod (Win32 timer resolution) and a null Granny log callback, which is the GrannyRuntime default."
}
}
}