summaryrefslogtreecommitdiffstats
path: root/winvnc
diff options
context:
space:
mode:
authorOleg Sheikin <olg@tightvnc.com>2005-11-22 18:04:10 +0000
committerOleg Sheikin <olg@tightvnc.com>2005-11-22 18:04:10 +0000
commit641f7e56e862e77955c0f8ab8bb1b5eaef4222cc (patch)
treed1e84173d6461ca42908bde007787607d0c8fdaa /winvnc
parent4905c8f8cd64627eaafcb1b7f3af403b89ba00ed (diff)
downloadtigervnc-641f7e56e862e77955c0f8ab8bb1b5eaef4222cc.tar.gz
tigervnc-641f7e56e862e77955c0f8ab8bb1b5eaef4222cc.zip
The description of structure ListConnInfo has been added in library rfb.
Also, codes which pass the information on connections for Control Panel have been added. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@410 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'winvnc')
-rw-r--r--winvnc/ControlPanel.cxx22
-rw-r--r--winvnc/ControlPanel.h13
-rw-r--r--winvnc/STrayIcon.cxx7
-rw-r--r--winvnc/VNCServerWin32.cxx6
-rw-r--r--winvnc/VNCServerWin32.h5
5 files changed, 39 insertions, 14 deletions
diff --git a/winvnc/ControlPanel.cxx b/winvnc/ControlPanel.cxx
index 60624ce6..134cc211 100644
--- a/winvnc/ControlPanel.cxx
+++ b/winvnc/ControlPanel.cxx
@@ -44,7 +44,11 @@ bool ControlPanel::onCommand(int cmd)
}
case IDC_KILL_ALL:
{
- m_server->disconnectClients();
+ COPYDATASTRUCT copyData;
+ copyData.dwData = 2;
+ copyData.lpData = 0;
+ copyData.cbData = 0;
+ SendMessage(m_hSTIcon, WM_COPYDATA, 0, (LPARAM)&copyData);
return false;
}
case IDC_DISABLE_CLIENTS:
@@ -57,9 +61,19 @@ bool ControlPanel::onCommand(int cmd)
}
-void ControlPanel::UpdateListView()
+void ControlPanel::UpdateListView(rfb::ListConnInfo* LCInfo)
{
-
+ DeleteAllLVItem(IDC_LIST_CONNECTIONS, handle);
+ if(LCInfo->Empty()) return;
+
+ char* ItemString[3];
+ int i = 0;
+
+ for (LCInfo->iBegin(); !LCInfo->iEnd(); LCInfo->iNext()) {
+ LCInfo->iGetCharInfo(ItemString);
+ InsertLVItem(IDC_LIST_CONNECTIONS, handle, i, ItemString, 3);
+ i++;
+ }
}
BOOL ControlPanel::dialogProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -82,7 +96,7 @@ BOOL ControlPanel::dialogProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
return FALSE;
}
-void ControlPanel::getSelectedConn(std::list<network::Socket*>* selsockets)
+void ControlPanel::getSelConnInfo(std::list<DWORD>* conn, std::list<int>* status)
{
}
diff --git a/winvnc/ControlPanel.h b/winvnc/ControlPanel.h
index 5f9bc240..51eb4213 100644
--- a/winvnc/ControlPanel.h
+++ b/winvnc/ControlPanel.h
@@ -10,33 +10,30 @@
#include <list>
-
-#include <winvnc/VNCServerWin32.h>
#include <winvnc/resource.h>
#include <rfb_win32/Dialog.h>
#include <rfb_win32/ListViewControl.h>
#include <rfb_win32/Win32Util.h>
+#include <rfb/ListConnInfo.h>
namespace winvnc {
class ControlPanel : rfb::win32::Dialog, rfb::win32::ListViewControl {
public:
- ControlPanel(VNCServerWin32 * server, HWND hSTIcon) : Dialog(GetModuleHandle(0)), ListViewControl(){
- m_server = server;
+ ControlPanel(HWND hSTIcon) : Dialog(GetModuleHandle(0)), ListViewControl(){
m_hSTIcon = hSTIcon;
};
virtual bool showDialog();
virtual void initDialog();
virtual bool onCommand(int cmd);
- void UpdateListView();
+ void UpdateListView(rfb::ListConnInfo* LCInfo);
HWND GetHandle() {return handle;};
~ControlPanel();
protected:
virtual BOOL dialogProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
- void getSelectedConn(std::list<network::Socket*>* selsockets);
- VNCServerWin32 * m_server;
- std::list<network::Socket*> sockets;
+ void getSelConnInfo(std::list<DWORD>* conn, std::list<int>* status);
HWND m_hSTIcon;
+ std::list<DWORD> Conn;
};
};
diff --git a/winvnc/STrayIcon.cxx b/winvnc/STrayIcon.cxx
index 448f08fb..a883caba 100644
--- a/winvnc/STrayIcon.cxx
+++ b/winvnc/STrayIcon.cxx
@@ -71,7 +71,7 @@ public:
SetTimer(getHandle(), 1, 3000, 0);
PostMessage(getHandle(), WM_TIMER, 1, 0);
PostMessage(getHandle(), WM_SET_TOOLTIP, 0, 0);
- CPanel = new ControlPanel(&thread.server, getHandle());
+ CPanel = new ControlPanel(getHandle());
}
virtual LRESULT processMessage(UINT msg, WPARAM wParam, LPARAM lParam) {
@@ -182,6 +182,10 @@ public:
return 0;
}
setIcon(thread.server.isServerInUse() ? thread.activeIcon : thread.inactiveIcon);
+
+ thread.server.getClientsInfo(&LCInfo);
+ CPanel->UpdateListView(&LCInfo);
+
return 0;
case WM_SET_TOOLTIP:
@@ -202,6 +206,7 @@ protected:
LaunchProcess vncConnect;
STrayIconThread& thread;
ControlPanel * CPanel;
+ rfb::ListConnInfo LCInfo;
};
diff --git a/winvnc/VNCServerWin32.cxx b/winvnc/VNCServerWin32.cxx
index a24df120..7e562708 100644
--- a/winvnc/VNCServerWin32.cxx
+++ b/winvnc/VNCServerWin32.cxx
@@ -270,6 +270,9 @@ bool VNCServerWin32::addNewClient(const char* client) {
return false;
}
+bool VNCServerWin32::getClientsInfo(rfb::ListConnInfo* LCInfo) {
+ return queueCommand(GetClientsInfo, LCInfo, 0);
+}
VNCServerST::queryResult VNCServerWin32::queryConnection(network::Socket* sock,
const char* userName,
@@ -330,6 +333,9 @@ void VNCServerWin32::doCommand() {
"Connection rejected by user");
queryConnectDialog = 0;
break;
+ case GetClientsInfo:
+ vncServer.getConnInfo((ListConnInfo*)commandData);
+ break;
default:
vlog.error("unknown command %d queued", command);
diff --git a/winvnc/VNCServerWin32.h b/winvnc/VNCServerWin32.h
index c824d542..f6c67235 100644
--- a/winvnc/VNCServerWin32.h
+++ b/winvnc/VNCServerWin32.h
@@ -28,6 +28,7 @@
#include <rfb_win32/TCharArray.h>
#include <winvnc/QueryConnectDialog.h>
#include <winvnc/JavaViewer.h>
+//#include <rfb/ListConnInfo.h>
namespace winvnc {
@@ -66,13 +67,15 @@ namespace winvnc {
const char* userName,
char** reason);
+ bool getClientsInfo(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} Command;
+ typedef enum {NoCommand, DisconnectClients, AddClient, QueryConnectionComplete, GetClientsInfo} Command;
bool queueCommand(Command cmd, const void* data, int len);
void doCommand();
Command command;