Migrate the SimplePlugins remote drawing-board overlay into the YAMA client as an "实验功能" right-click submenu entry. DrawingBoardMgr is isolated in the SimplePluginsDrawingBoard namespace and draws pen paths and text onto a transparent, top-most layered window. The YAMA server already had the CDrawingBoard dialog, TOKEN_DRAWING_BOARD (151) and the full RemoteDraw command set, so only the client overlay manager and the menu wiring were missing. Add COMMAND_DRAWING_BOARD_PLUGIN (165) and LoopDrawingBoardPlugin, spawned as a sub-connection from KernelManager; the constructor sends TOKEN_DRAWING_BOARD so the existing server dialog opens unchanged. Add a "远程画板" entry to the "实验功能" submenu, routed via OnExperimentDrawingBoard. Co-Authored-By: deepseek-v4-pro
37 lines
1.1 KiB
C++
37 lines
1.1 KiB
C++
#pragma once
|
|
#include "Manager.h"
|
|
#include <vector>
|
|
#include <string>
|
|
#include "common/locker.h"
|
|
|
|
namespace SimplePluginsDrawingBoard {
|
|
|
|
class DrawingBoardMgr : public CManager
|
|
{
|
|
public:
|
|
DrawingBoardMgr(IOCPClient* ClientObject, int n, void* user = nullptr);
|
|
~DrawingBoardMgr();
|
|
|
|
virtual VOID OnReceive(PBYTE szBuffer, ULONG ulLength);
|
|
|
|
void ParseRemoteText(PBYTE data, ULONG length);
|
|
|
|
private:
|
|
BYTE m_fAlpha; // 透明度: 0-全透明, 255-不透明
|
|
BOOL m_bTopMost; // 顶层
|
|
BOOL m_bIsWorking; // 线程状态
|
|
HWND m_hWnd; // 窗口
|
|
std::vector<std::vector<POINT>> m_Paths; // 历史路径集合,每条路径是一组点
|
|
std::vector<POINT> m_CurrentPath; // 当前正在绘制的路径点集合
|
|
std::vector<std::pair<POINT, std::string>> m_Texts;
|
|
HFONT m_Font;
|
|
COLORREF m_textColor;
|
|
HPEN m_DrawPen;
|
|
CLocker m_locker;
|
|
static DWORD WINAPI DrawingThreadProc(LPVOID lpParam);
|
|
void RunWindowThread();
|
|
static LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
|
|
};
|
|
|
|
} // namespace SimplePluginsDrawingBoard
|