Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

CConn.h 3.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. /* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
  2. *
  3. * This is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License as published by
  5. * the Free Software Foundation; either version 2 of the License, or
  6. * (at your option) any later version.
  7. *
  8. * This software is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this software; if not, write to the Free Software
  15. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  16. * USA.
  17. */
  18. //
  19. // CConn represents a client connection to a VNC server.
  20. //
  21. #ifndef __CCONN_H__
  22. #define __CCONN_H__
  23. #include <rfb/CConnection.h>
  24. #include <rfb/Exception.h>
  25. #include <rfb/UserPasswdGetter.h>
  26. #include <rdr/FdInStream.h>
  27. #include <list>
  28. #include "TXWindow.h"
  29. #include "AboutDialog.h"
  30. #include "InfoDialog.h"
  31. #include "TXMenu.h"
  32. #include "OptionsDialog.h"
  33. class TXWindow;
  34. class TXViewport;
  35. class DesktopWindow;
  36. namespace network { class Socket; }
  37. class CConn : public rfb::CConnection, public rfb::UserPasswdGetter,
  38. public TXDeleteWindowCallback,
  39. public rdr::FdInStreamBlockCallback,
  40. public TXMenuCallback , public OptionsDialogCallback,
  41. public TXEventHandler
  42. {
  43. public:
  44. CConn(Display* dpy_, int argc_, char** argv_, network::Socket* sock_,
  45. char* vncServerName, bool reverse=false);
  46. ~CConn();
  47. // TXDeleteWindowCallback methods
  48. void deleteWindow(TXWindow* w);
  49. // FdInStreamBlockCallback methods
  50. void blockCallback();
  51. // UserPasswdGetter methods
  52. virtual void getUserPasswd(char** user, char** password);
  53. // TXMenuCallback methods
  54. void menuSelect(long id, TXMenu* m);
  55. // OptionsDialogCallback methods
  56. virtual void setOptions();
  57. virtual void getOptions();
  58. // TXEventHandler callback method
  59. virtual void handleEvent(TXWindow* w, XEvent* ev);
  60. // CConnection callback methods
  61. rfb::CSecurity* getCSecurity(int secType);
  62. void serverInit();
  63. void setDesktopSize(int w, int h);
  64. void setColourMapEntries(int firstColour, int nColours, rdr::U16* rgbs);
  65. void bell();
  66. void serverCutText(const char* str, int len);
  67. void framebufferUpdateEnd();
  68. void beginRect(const rfb::Rect& r, unsigned int encoding);
  69. void endRect(const rfb::Rect& r, unsigned int encoding);
  70. void fillRect(const rfb::Rect& r, rfb::Pixel p);
  71. void imageRect(const rfb::Rect& r, void* p);
  72. void copyRect(const rfb::Rect& r, int sx, int sy);
  73. void setCursor(int width, int height, const rfb::Point& hotspot,
  74. void* data, void* mask);
  75. private:
  76. void recreateViewport();
  77. void reconfigureViewport();
  78. void initMenu();
  79. void showMenu(int x, int y);
  80. void autoSelectFormatAndEncoding();
  81. void checkEncodings();
  82. void requestNewUpdate();
  83. Display* dpy;
  84. int argc;
  85. char** argv;
  86. char* serverHost;
  87. int serverPort;
  88. network::Socket* sock;
  89. rfb::PixelFormat serverPF;
  90. TXViewport* viewport;
  91. DesktopWindow* desktop;
  92. TXEventHandler* desktopEventHandler;
  93. rfb::PixelFormat fullColourPF;
  94. std::list<rfb::Rect> debugRects;
  95. unsigned int currentEncoding, lastServerEncoding;
  96. bool fullColour;
  97. bool autoSelect;
  98. bool shared;
  99. bool formatChange;
  100. bool encodingChange;
  101. bool sameMachine;
  102. bool fullScreen;
  103. bool ctrlDown;
  104. bool altDown;
  105. KeySym menuKeysym;
  106. TXMenu menu;
  107. TXEventHandler* menuEventHandler;
  108. OptionsDialog options;
  109. AboutDialog about;
  110. InfoDialog info;
  111. bool reverseConnection;
  112. };
  113. #endif