📄 vncserver.h
字号:
// Whether or not to allow connections from the local machine
virtual void SetLoopbackOk(BOOL ok) {m_loopback_allowed = ok;};
virtual BOOL LoopbackOk() {return m_loopback_allowed;};
// Whether or not to shutdown or logoff when the last client leaves
virtual void SetLockSettings(int ok) {m_lock_on_exit = ok;};
virtual int LockSettings() {return m_lock_on_exit;};
// Timeout for automatic disconnection of idle connections
virtual void SetAutoIdleDisconnectTimeout(const UINT timeout) {m_idle_timeout = timeout;};
virtual UINT AutoIdleDisconnectTimeout() {return m_idle_timeout;};
// Removal of desktop wallpaper, etc
virtual void EnableRemoveWallpaper(const BOOL enable) {m_remove_wallpaper = enable;};
virtual BOOL RemoveWallpaperEnabled() {return m_remove_wallpaper;};
// sf@2002 - v1.1.x - Server Default Scale
virtual UINT GetDefaultScale();
virtual BOOL SetDefaultScale(int nScale);
virtual int FileTransferEnabled();
virtual BOOL EnableFileTransfer(int fEnable);
virtual BOOL BlankMonitorEnabled() {return m_fBlankMonitorEnabled;};
virtual void BlankMonitorEnabled(BOOL fEnable) {m_fBlankMonitorEnabled = fEnable;};
virtual BOOL MonitorIsBlanked() { return m_fMonitorIsBlanked; }
virtual void SetMonitorIsBlanked(BOOL value) { m_fMonitorIsBlanked = value; }
virtual BOOL InputIsDisabled() { return m_fInputIsDisabled; }
virtual void SetInputIsDisabled(BOOL value) { m_fInputIsDisabled = value; }
virtual BOOL MSLogonRequired();
virtual BOOL RequireMSLogon(BOOL fEnable);
virtual BOOL GetNewMSLogon();
virtual BOOL SetNewMSLogon(BOOL fEnable);
// sf@2002 - Cursor handling
virtual void EnableXRichCursor(BOOL fEnable);
virtual BOOL IsXRichCursorEnabled() {return m_fXRichCursor;};
// sf@2002
virtual void DisableCacheForAllClients();
virtual bool IsThereASlowClient();
virtual bool IsThereAUltraEncodingClient();
// sf@2002 - Turbo Mode
virtual void TurboMode(BOOL fEnabled) { m_TurboMode = fEnabled; };
virtual BOOL TurboMode() { return m_TurboMode; };
// sf@2002 - Turbo Mode
virtual void AcceptDialogOpen(BOOL fEnabled) { m_AcceptDialog = fEnabled; };
virtual BOOL AcceptDialogOpen() { return m_AcceptDialog; };
// sf@2003 - AutoReconnect
virtual BOOL AutoReconnect(){return m_fAutoReconnect;};
virtual UINT AutoReconnectPort(){return m_AutoReconnectPort;};
virtual char* AutoReconnectAdr(){return m_szAutoReconnectAdr;}
virtual void AutoReconnect(BOOL fEnabled){m_fAutoReconnect = fEnabled;};
virtual void AutoReconnectPort(UINT nPort){m_AutoReconnectPort = nPort;};
virtual void AutoReconnectAdr(char* szAdr){strncpy(m_szAutoReconnectAdr, szAdr, sizeof(m_szAutoReconnectAdr));}
// sf@2005 - FTUserImpersonation
virtual BOOL FTUserImpersonation(){return m_fFTUserImpersonation;};
virtual void FTUserImpersonation(BOOL fEnabled){m_fFTUserImpersonation = fEnabled;};
virtual BOOL BlackAlphaBlending(){return m_fBlackAlphaBlending;};
virtual void BlackAlphaBlending(BOOL fEnabled){m_fBlackAlphaBlending = fEnabled;};
virtual void Clear_Update_Tracker();
virtual void UpdateCursorShape();
// TR@2004
virtual bool Shutdown() { return m_shutdown; }
virtual void SetShutdown(bool s) { m_shutdown = s; }
virtual int AutostartSetting();// { return m_autostartsetting; }
virtual BOOL SetAutostartSetting(int autostartmode);
bool IsClient(vncClient* pClient);
// Staudenmeyer@2005
int GetDisplayQuality() {return m_displayQuality;}
void SetDisplayQuality(int quality) {m_displayQuality=quality;}
void SetSessionDialogShown(bool shown) {m_sessionDialogShown=shown;}
bool GetSessionDialogShown() {return m_sessionDialogShown;}
void SetHwndSessionDialog(HWND sdialog) { m_hSessionDialog=sdialog; }
HWND GetHwndSessionDialog() { return m_hSessionDialog; }
UpdateHandling GetUpdateHandling() {return m_updateHandling;}
void SetUpdateHandling(UpdateHandling handling) {m_updateHandling=handling;}
//char* GetSupportText() {return m_SupportText;}
//bool KeepDialogOpen() {return m_keepDialogOpen;}
//void SetKeepDialogOpen(bool close) {m_keepDialogOpen=close;}
IncomingConnections GetIncomingConnections() {return m_incomingConnections;}
void SetIncomingConnections(IncomingConnections incomingConnections) {m_incomingConnections=incomingConnections;}
bool UseDynGate() {return m_useDynGate;}
void SetUseDynGate(bool useDynGate);
//// Staudenmeyer
bool GetServerMode() {return m_serverMode;}
void SetServerMode(bool serverMode);
bool Logging() {return m_logging;}
void SetLogging(bool logging);
bool ConnectionLogging() {return m_connectionLogging;}
void SetConnectionLogging(bool value) {m_connectionLogging=value;}
bool DesktopLocked() { return m_DesktopLocked; }
void SetDesktopLocked(bool val) { m_DesktopLocked = val; }
std::string SessionPassword() {return m_sessionPassword;}
protected:
void RemoveService();
void RemoveAutostart();
bool InstallAutostart();
void InstallService();
public:
bool IsInstallAutostartAllowed();
protected:
// The vncServer UpdateTracker class
// Behaves like a standard UpdateTracker, but propagates update
// information to active clients' trackers
class ServerUpdateTracker : public rfb::UpdateTracker {
public:
ServerUpdateTracker() : m_server(0) {};
virtual void init(vncServer *server) {m_server=server;};
virtual void add_changed(const rfb::Region2D ®ion);
virtual void add_cached(const rfb::Region2D ®ion);
virtual void add_copied(const rfb::Region2D &dest, const rfb::Point &delta);
protected:
vncServer *m_server;
};
friend class ServerUpdateTracker;
ServerUpdateTracker m_update_tracker;
bool m_useDynGate;
////// Staudenmeyer
//void DeleteOldService();
//bool GetInAutostartFolder();
//bool GetRunAsService();
// maybe move to vncService: ???
static SC_HANDLE GetSCManager();
/////
// Internal stuffs
protected:
// Connection servers
vncSockConnect *m_socketConn;
#ifndef ROVNC_QS
vncHTTPConnect *m_httpConn;
#else
void *m_httpConn;
#endif
BOOL m_enableHttpConn;
// The desktop handler
vncDesktop *m_desktop;
// General preferences
// UINT m_port;
// UINT m_port_http; // TightVNC 1.2.7
BOOL m_autoportselect;
char m_password[MAXPWLEN];
BOOL m_passwd_required;
BOOL m_loopback_allowed;
BOOL m_loopbackOnly;
char *m_auth_hosts;
BOOL m_enable_remote_inputs;
BOOL m_disable_local_inputs;
int m_lock_on_exit;
int m_connect_pri;
UINT m_querysetting;
UINT m_queryaccept;
UINT m_querytimeout;
UINT m_idle_timeout;
char version[128];
BOOL m_remove_wallpaper;
BOOL m_disableTrayIcon;
BOOL m_AllowEditClients;
// Polling preferences
BOOL m_poll_fullscreen;
BOOL m_poll_foreground;
BOOL m_poll_undercursor;
BOOL m_poll_oneventonly;
BOOL m_poll_consoleonly;
BOOL m_driver;
BOOL m_hook;
//BOOL m_virtual;
BOOL sethook;
// Name of this desktop
char *m_name;
// Blacklist structures
struct BlacklistEntry {
BlacklistEntry *_next;
char *_machineName;
LARGE_INTEGER _lastRefTime;
UINT _failureCount;
BOOL _blocked;
};
BlacklistEntry *m_blacklist;
// The client lists - list of clients being authorised and ones
// already authorised
vncClientList m_unauthClients;
vncClientList m_authClients;
vncClient *m_clientmap[MAX_CLIENTS];
vncClientId m_nextid;
// Lock to protect the client list from concurrency - lock when reading/updating client list
// omni_mutex m_clientsLock;
// Lock to protect the desktop object from concurrency - lock when updating client list
omni_mutex m_desktopLock;
// Signal set when a client removes itself
omni_condition *m_clientquitsig;
// Set of windows to send notifications to
vncNotifyList m_notifyList;
// Modif sf@2002 - Single Window
BOOL m_SingleWindow;
#define MAX_SW_NAMELEN 255
char m_szWindowName[MAX_SW_NAMELEN]; // to keep the window name
// Modif sf@2002
BOOL m_TurboMode;
// Modif sf@2002 - v1.1.x
// BOOL m_fQueuingEnabled;
int m_fFileTransferEnabled;
BOOL m_fBlankMonitorEnabled;
int m_nDefaultScale;
BOOL m_fMSLogonRequired;
BOOL m_fNewMSLogon;
// sf@2002 - Cursor handling
BOOL m_fXRichCursor;
// TR@2003 - is there an open AcceptConnection dialog?
BOOL m_AcceptDialog;
// sf@2003 - AutoReconnect
BOOL m_fAutoReconnect;
UINT m_AutoReconnectPort;
char m_szAutoReconnectAdr[64];
// sf@2005 - FTUserImpersonation
BOOL m_fFTUserImpersonation;
// sf@2005
BOOL m_fBlackAlphaBlending;
//Staudenmeyer@2005
HKEY m_registryKey;
bool m_installInquired;
//bool m_keepDialogOpen;
HINSTANCE hWtsLib;
//TR@2004
bool m_shutdown; // program termination requested
//int m_autostartsetting;
// Staudenmeyer@2005
int m_displayQuality;
UpdateHandling m_updateHandling;
IncomingConnections m_incomingConnections;
bool m_sessionDialogShown;
HWND m_hSessionDialog; // handle to session dialog window
bool m_serverMode;
bool m_logging;
bool m_connectionLogging;
bool m_DesktopLocked;
std::string m_sessionPassword;
std::string GenerateSessionPassword();
#define MAXIDENTITYLEN 50
protected:
char m_identity[MAXIDENTITYLEN+1];
public:
char *GetIdentity()
{
return m_identity;
}
void SetIdentity(char *newid);
BOOL m_fMonitorIsBlanked;
BOOL m_fInputIsDisabled;
void SendTVCommandToClients(CARD16 msgid, string value);
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -