Feature: Add live thumbnail preview column to online host list
This commit is contained in:
@@ -264,6 +264,47 @@ public:
|
||||
void TickLoopTips();
|
||||
void SendLoopRequest(uint64_t clientID, LoopTipEntry& entry);
|
||||
afx_msg LRESULT OnLoopTipDestroyed(WPARAM wParam, LPARAM lParam);
|
||||
|
||||
// ===== 主机列表缩略图(在线列表第 0 列) =====
|
||||
// 设计文档:纯主控端 UI 偏好,不进 MasterSettings 协议包。持久化走 THIS_CFG
|
||||
// [thumbnail] 节。所有运行时状态仅 UI 线程访问。
|
||||
struct ThumbnailSettings {
|
||||
bool Enabled = true;
|
||||
int RefreshIntervalSec = 30; // 单台主机的刷新周期
|
||||
int ThumbWidth = 60; // 列表内显示宽度(高 = 9w/16)
|
||||
int NetReqWidth = 120; // 网络请求的源宽(HiDPI 余量,>= ThumbWidth)
|
||||
int JpegQuality = 60; // 1..100
|
||||
};
|
||||
ThumbnailSettings m_ThumbnailCfg;
|
||||
|
||||
struct ThumbCacheEntry {
|
||||
HBITMAP bmp = nullptr; // 预先缩到显示尺寸的 24bpp DIB,BitBlt 友好
|
||||
int w = 0;
|
||||
int h = 0;
|
||||
};
|
||||
std::map<uint64_t, ThumbCacheEntry> m_HostThumbnails; // 缩略图缓存
|
||||
std::map<uint64_t, DWORD> m_ThumbNextDueTick; // 下次到期 GetTickCount() 时间
|
||||
std::set<uint64_t> m_ThumbnailPending; // 在飞的 clientId 集合
|
||||
WORD m_ThumbnailReqId = 0; // 缩略图专用 reqId(与 m_PreviewReqId / m_LoopReqId 解耦)
|
||||
|
||||
// 行高占位 ImageList:CListCtrl 没有 SetRowHeight,标准做法是装一个 1×rowH 的
|
||||
// 空 ImageList 强行撑高行。关闭缩略图时换回 1×default(或 detach),让行高回缩。
|
||||
CImageList m_thumbRowHeightImgList;
|
||||
int m_thumbRowHeightApplied = 0; // 已应用的行高(避免重复创建)
|
||||
|
||||
// 一次性配置应用入口:加载/重新加载 m_ThumbnailCfg 后调用,处理:
|
||||
// - 启动/停止 TIMER_THUMBNAIL_REFRESH
|
||||
// - 列宽 / 行高 调整
|
||||
// - 尺寸变化时丢弃旧缓存 HBITMAP
|
||||
void ApplyThumbnailSettings();
|
||||
void LoadThumbnailSettingsFromCfg(); // 从 THIS_CFG 读到 m_ThumbnailCfg
|
||||
void SaveThumbnailSettingsToCfg() const; // m_ThumbnailCfg 落盘到 THIS_CFG
|
||||
void TickThumbnailRefresh(); // TIMER_THUMBNAIL_REFRESH 主循环
|
||||
void SendThumbnailRequest(class context* ctx);// 发一次缩略图请求
|
||||
void CacheThumbnail(uint64_t clientID, const BYTE* jpeg, size_t bytes);
|
||||
void ClearThumbnailCacheEntry(uint64_t clientID);
|
||||
void ClearAllThumbnailCache();
|
||||
void InvalidateHostRow(uint64_t clientID); // 仅重绘对应行
|
||||
// 记录 clientID(心跳更新)
|
||||
std::set<uint64_t> m_DirtyClients;
|
||||
// 待处理的上线/下线事件(批量更新减少闪烁)
|
||||
@@ -468,6 +509,8 @@ public:
|
||||
afx_msg void OnWhatIsThis();
|
||||
afx_msg void OnOnlineAuthorize();
|
||||
void OnListClick(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
// 单击:缩略图列(COL_THUMBNAIL)命中时弹出循环监视窗口;其余列保持默认行为
|
||||
afx_msg void OnListSingleClick(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
// 屏幕预览:依 ctx 最近 RTT + 屏幕分辨率挑参数;4K/超宽屏在 LAN 档自适应放大
|
||||
void ChooseScreenPreviewParams(context* ctx, WORD& maxWidth, BYTE& jpegQuality) const;
|
||||
// 发起预览请求;reqId 应与 m_PreviewReqId 同步
|
||||
@@ -524,6 +567,7 @@ public:
|
||||
afx_msg void OnParamEnableLog();
|
||||
afx_msg void OnParamPrivacyWallpaper();
|
||||
afx_msg void OnParamFileV2();
|
||||
afx_msg void OnParamThumbnailPreview();
|
||||
afx_msg void OnParamRunAsUser();
|
||||
void ProxyClientTcpPort(bool isStandard, bool autoRun=false);
|
||||
afx_msg void OnProxyPort();
|
||||
|
||||
Reference in New Issue
Block a user