diff options
author | Oleg Sheikin <olg@tightvnc.com> | 2005-12-09 10:59:12 +0000 |
---|---|---|
committer | Oleg Sheikin <olg@tightvnc.com> | 2005-12-09 10:59:12 +0000 |
commit | 4b0304f47c8ef6c01574e46036156a7f9d6a81ac (patch) | |
tree | db7a1e8b9bb894982e80b41ee9c80b94e97c57ed /winvnc | |
parent | ff43bfd57b8d9d2a0abb6f1352384d20bf226447 (diff) | |
download | tigervnc-4b0304f47c8ef6c01574e46036156a7f9d6a81ac.tar.gz tigervnc-4b0304f47c8ef6c01574e46036156a7f9d6a81ac.zip |
The code which realizes functionality " Control of selected clients "
control group in Control Panel has been added.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@436 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'winvnc')
-rw-r--r-- | winvnc/ControlPanel.cxx | 56 | ||||
-rw-r--r-- | winvnc/ControlPanel.h | 4 | ||||
-rw-r--r-- | winvnc/STrayIcon.cxx | 3 | ||||
-rw-r--r-- | winvnc/VNCServerWin32.cxx | 7 | ||||
-rw-r--r-- | winvnc/VNCServerWin32.h | 4 |
5 files changed, 63 insertions, 11 deletions
diff --git a/winvnc/ControlPanel.cxx b/winvnc/ControlPanel.cxx index fb379d6c..1f693063 100644 --- a/winvnc/ControlPanel.cxx +++ b/winvnc/ControlPanel.cxx @@ -37,18 +37,9 @@ bool ControlPanel::onCommand(int cmd) case IDC_ADD_CLIENT: SendMessage(m_hSTIcon, WM_COMMAND, ID_CONNECT, 0); return false; - case IDC_KILL_SEL_CLIENT: - { - - return false; - } case IDC_KILL_ALL: { - COPYDATASTRUCT copyData; - copyData.dwData = 2; - copyData.lpData = 0; - copyData.cbData = 0; - SendMessage(m_hSTIcon, WM_COPYDATA, 0, (LPARAM)©Data); + SendCommand(2, -1); return false; } case IDC_DISABLE_CLIENTS: @@ -56,6 +47,27 @@ bool ControlPanel::onCommand(int cmd) return false; } + case IDC_KILL_SEL_CLIENT: + { + SendCommand(3, 3); + return false; + } + case IDC_VIEW_ONLY: + { + SendCommand(3, 1); + return false; + } + case IDC_FULL_CONTROL: + { + SendCommand(3, 0); + return false; + } + case IDC_STOP_UPDATE: + { + stop_updating = true; + EndDialog(handle, 0); + return false; + } } return false; @@ -92,6 +104,13 @@ BOOL ControlPanel::dialogProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) handle = hwnd; initDialog(); return TRUE; + case WM_DESTROY: + if (stop_updating) { + stop_updating = false; + SendCommand(3, 2); + } + initDialog(); + return TRUE; case WM_COMMAND: switch (LOWORD(wParam)) { case IDCANCEL: @@ -117,6 +136,23 @@ void ControlPanel::getSelConnInfo() } } +void ControlPanel::SendCommand(DWORD command, int data) +{ + COPYDATASTRUCT copyData; + copyData.dwData = command; + copyData.lpData = 0; + if (data != -1) { + getSelConnInfo(); + ListConnStatus.Copy(&ListSelConn); + for (ListConnStatus.iBegin(); !ListConnStatus.iEnd(); ListConnStatus.iNext()) + ListConnStatus.iSetStatus(data); + copyData.cbData = (DWORD)&ListConnStatus; + } else { + copyData.cbData = 0; + } + SendMessage(m_hSTIcon, WM_COPYDATA, 0, (LPARAM)©Data); +} + ControlPanel::~ControlPanel() { diff --git a/winvnc/ControlPanel.h b/winvnc/ControlPanel.h index f291b9e6..73b859f8 100644 --- a/winvnc/ControlPanel.h +++ b/winvnc/ControlPanel.h @@ -22,19 +22,23 @@ namespace winvnc { public: ControlPanel(HWND hSTIcon) : Dialog(GetModuleHandle(0)), ListViewControl(){ m_hSTIcon = hSTIcon; + stop_updating = false; }; virtual bool showDialog(); virtual void initDialog(); virtual bool onCommand(int cmd); void UpdateListView(rfb::ListConnInfo* LCInfo); HWND GetHandle() {return handle;}; + void SendCommand(DWORD command, int data); ~ControlPanel(); + rfb::ListConnInfo ListConnStatus; protected: virtual BOOL dialogProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); void getSelConnInfo(); HWND m_hSTIcon; rfb::ListConnInfo ListConn; rfb::ListConnInfo ListSelConn; + bool stop_updating; }; }; diff --git a/winvnc/STrayIcon.cxx b/winvnc/STrayIcon.cxx index 533c6a71..c5cc3b21 100644 --- a/winvnc/STrayIcon.cxx +++ b/winvnc/STrayIcon.cxx @@ -168,6 +168,9 @@ public: case 2: thread.server.disconnectClients("IPC disconnect"); break; + case 3: + thread.server.setClientsStatus((rfb::ListConnInfo *)command->cbData); + break; }; }; break; diff --git a/winvnc/VNCServerWin32.cxx b/winvnc/VNCServerWin32.cxx index 7e562708..30e9a72f 100644 --- a/winvnc/VNCServerWin32.cxx +++ b/winvnc/VNCServerWin32.cxx @@ -274,6 +274,10 @@ bool VNCServerWin32::getClientsInfo(rfb::ListConnInfo* LCInfo) { return queueCommand(GetClientsInfo, LCInfo, 0); } +bool VNCServerWin32::setClientsStatus(rfb::ListConnInfo* LCInfo) { + return queueCommand(SetClientsStatus, LCInfo, 0); +} + VNCServerST::queryResult VNCServerWin32::queryConnection(network::Socket* sock, const char* userName, char** reason) @@ -336,6 +340,9 @@ void VNCServerWin32::doCommand() { case GetClientsInfo: vncServer.getConnInfo((ListConnInfo*)commandData); break; + case SetClientsStatus: + vncServer.setConnStatus((ListConnInfo*)commandData); + break; default: vlog.error("unknown command %d queued", command); diff --git a/winvnc/VNCServerWin32.h b/winvnc/VNCServerWin32.h index f6c67235..0af5fd5a 100644 --- a/winvnc/VNCServerWin32.h +++ b/winvnc/VNCServerWin32.h @@ -69,13 +69,15 @@ namespace winvnc { bool getClientsInfo(rfb::ListConnInfo* LCInfo); + bool setClientsStatus(rfb::ListConnInfo* LCInfo); + // Where to read the configuration settings from static const TCHAR* RegConfigPath; protected: // Perform a particular internal function in the server thread - typedef enum {NoCommand, DisconnectClients, AddClient, QueryConnectionComplete, GetClientsInfo} Command; + typedef enum {NoCommand, DisconnectClients, AddClient, QueryConnectionComplete, SetClientsStatus, GetClientsInfo} Command; bool queueCommand(Command cmd, const void* data, int len); void doCommand(); Command command; |