You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SMsgWriterV3.h 2.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
  2. * Copyright 2009 Pierre Ossman 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 __RFB_SMSGWRITERV3_H__
  20. #define __RFB_SMSGWRITERV3_H__
  21. #include <list>
  22. #include <utility>
  23. #include <rfb/SMsgWriter.h>
  24. namespace rdr { class MemOutStream; }
  25. namespace rfb {
  26. class SMsgWriterV3 : public SMsgWriter {
  27. public:
  28. SMsgWriterV3(ConnParams* cp, rdr::OutStream* os);
  29. virtual ~SMsgWriterV3();
  30. virtual void writeServerInit();
  31. virtual void startMsg(int type);
  32. virtual void endMsg();
  33. virtual bool writeSetDesktopSize();
  34. virtual bool writeExtendedDesktopSize();
  35. virtual bool writeExtendedDesktopSize(rdr::U16 reason, rdr::U16 result,
  36. int fb_width, int fb_height,
  37. const ScreenSet& layout);
  38. virtual bool writeSetDesktopName();
  39. virtual void cursorChange(WriteSetCursorCallback* cb);
  40. virtual void writeSetCursor(int width, int height, const Point& hotspot,
  41. void* data, void* mask);
  42. virtual void writeSetXCursor(int width, int height, int hotspotX,
  43. int hotspotY, void* data, void* mask);
  44. virtual bool needFakeUpdate();
  45. virtual bool needNoDataUpdate();
  46. virtual void writeNoDataUpdate();
  47. virtual void writeFramebufferUpdateStart(int nRects);
  48. virtual void writeFramebufferUpdateStart();
  49. virtual void writeFramebufferUpdateEnd();
  50. virtual void startRect(const Rect& r, int encoding);
  51. virtual void endRect();
  52. protected:
  53. virtual void writePseudoRects();
  54. virtual void writeNoDataRects();
  55. private:
  56. rdr::MemOutStream* updateOS;
  57. rdr::OutStream* realOS;
  58. int nRectsInUpdate;
  59. int nRectsInHeader;
  60. WriteSetCursorCallback* wsccb;
  61. bool needSetDesktopSize;
  62. bool needExtendedDesktopSize;
  63. bool needSetDesktopName;
  64. bool needLastRect;
  65. typedef struct {
  66. rdr::U16 reason, result;
  67. int fb_width, fb_height;
  68. ScreenSet layout;
  69. } ExtendedDesktopSizeMsg;
  70. std::list<ExtendedDesktopSizeMsg> extendedDesktopSizeMsgs;
  71. };
  72. }
  73. #endif