您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. /* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
  2. * Copyright 2009-2011 Pierre Ossman <ossman@cendio.se> for Cendio AB
  3. *
  4. * This is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This software is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this software; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  17. * USA.
  18. */
  19. #ifndef __CCONN_H__
  20. #define __CCONN_H__
  21. #include <rfb/CConnection.h>
  22. #include <network/Socket.h>
  23. #include "DesktopWindow.h"
  24. class CConn : public rfb::CConnection,
  25. public rdr::FdInStreamBlockCallback
  26. {
  27. public:
  28. CConn(const char* vncServerName);
  29. ~CConn();
  30. void refreshFramebuffer();
  31. const char *connectionInfo();
  32. // FdInStreamBlockCallback methods
  33. void blockCallback();
  34. // Callback when socket is ready (or broken)
  35. static void socketEvent(int fd, void *data);
  36. // CConnection callback methods
  37. void serverInit();
  38. void setDesktopSize(int w, int h);
  39. void setExtendedDesktopSize(int reason, int result, int w, int h,
  40. const rfb::ScreenSet& layout);
  41. void setName(const char* name);
  42. void setColourMapEntries(int firstColour, int nColours, rdr::U16* rgbs);
  43. void bell();
  44. void serverCutText(const char* str, rdr::U32 len);
  45. void framebufferUpdateStart();
  46. void framebufferUpdateEnd();
  47. void beginRect(const rfb::Rect& r, int encoding);
  48. void endRect(const rfb::Rect& r, int encoding);
  49. void fillRect(const rfb::Rect& r, rfb::Pixel p);
  50. void imageRect(const rfb::Rect& r, void* p);
  51. void copyRect(const rfb::Rect& r, int sx, int sy);
  52. rdr::U8* getRawPixelsRW(const rfb::Rect& r, int* stride);
  53. void releaseRawPixels(const rfb::Rect& r);
  54. const rfb::PixelFormat &getPreferredPF() { return fullColourPF; }
  55. void setCursor(int width, int height, const rfb::Point& hotspot,
  56. void* data, void* mask);
  57. private:
  58. void resizeFramebuffer();
  59. void autoSelectFormatAndEncoding();
  60. void checkEncodings();
  61. void requestNewUpdate();
  62. static void handleOptions(void *data);
  63. private:
  64. char* serverHost;
  65. int serverPort;
  66. network::Socket* sock;
  67. DesktopWindow *desktop;
  68. rfb::PixelFormat serverPF;
  69. rfb::PixelFormat fullColourPF;
  70. int currentEncoding, lastServerEncoding;
  71. bool formatChange;
  72. bool encodingChange;
  73. bool firstUpdate;
  74. bool pendingUpdate;
  75. bool forceNonincremental;
  76. };
  77. #endif