替换 NIM 为独立 TTUI 引擎并完善窗口交互

移除 NIM 源码及主题依赖,加入 Win32、Direct2D、DirectWrite UI 静态库。迁移主页面、添加任务及外观设置,完善虚拟列表、统一窗口透明度和首次显示初始化。增加 Windows 7 API 回退与回归测试,在 AGENTS.md 记录后续控件体系和布局系统计划。
This commit is contained in:
tongtong committed 2026-11-16 11:52:05 +08:00
1 parent 7c0ee5d964
commit db38ec5c03
408 files changed
+1575 -55735

No files matched your search

+11 -31
View File
@@ -1,12 +1,7 @@
#include "stdafx.h"
#include "main.h"
#include "stdafx.h"
#include "ttui/application.h"
#include "downloader_form.h"
enum ThreadId
{
kThreadUI
};
int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
_In_opt_ HINSTANCE hPrevInstance,
_In_ LPWSTR lpCmdLine,
@@ -27,30 +22,15 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
return 0;
}
MainThread thread;
thread.RunOnCurrentThreadWithLoop(nbase::MessageLoop::kUIMessageLoop);
DownloaderForm form;
int result=ttui::RunApplication([&] {
if (!form.Create(nullptr,DownloaderForm::kClassName.c_str(),L"TTDownloader",940,640,true)) {
MessageBoxW(nullptr,L"无法创建主窗口。",L"TTDownloader",MB_ICONERROR); return false;
}
form.CenterWindow(); form.ShowWindow(); return true;
});
::CloseHandle(instance_mutex);
return 0;
}
void MainThread::Init()
{
nbase::ThreadManager::RegisterThread(kThreadUI);
std::wstring module_dir = nbase::win32::GetCurrentModuleDirectory();
ui::GlobalManager::Startup(module_dir + L"resources\\", ui::CreateControlCallback(), false);
ui::GlobalManager::AddTextColor(L"tt_edit_bg", L"#D9FFFFFF");
DownloaderForm* form = new DownloaderForm();
form->Create(NULL, DownloaderForm::kClassName.c_str(), WS_OVERLAPPEDWINDOW & ~WS_MAXIMIZEBOX, 0);
form->CenterWindow();
form->ShowWindow();
}
void MainThread::Cleanup()
{
ui::GlobalManager::Shutdown();
SetThreadWasQuitProperly(true);
nbase::ThreadManager::UnregisterThread();
return result;
}