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.

CMsgWriter.h 2.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
  2. * Copyright 2009-2019 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. //
  20. // CMsgWriter - class for writing RFB messages on the server side.
  21. //
  22. #ifndef __RFB_CMSGWRITER_H__
  23. #define __RFB_CMSGWRITER_H__
  24. #include <list>
  25. #include <rdr/types.h>
  26. namespace rdr { class OutStream; }
  27. namespace rfb {
  28. class PixelFormat;
  29. class ServerParams;
  30. struct ScreenSet;
  31. struct Point;
  32. struct Rect;
  33. class CMsgWriter {
  34. public:
  35. CMsgWriter(ServerParams* server, rdr::OutStream* os);
  36. virtual ~CMsgWriter();
  37. void writeClientInit(bool shared);
  38. void writeSetPixelFormat(const PixelFormat& pf);
  39. void writeSetEncodings(const std::list<rdr::U32> encodings);
  40. void writeSetDesktopSize(int width, int height, const ScreenSet& layout);
  41. void writeFramebufferUpdateRequest(const Rect& r,bool incremental);
  42. void writeEnableContinuousUpdates(bool enable, int x, int y, int w, int h);
  43. void writeFence(rdr::U32 flags, unsigned len, const char data[]);
  44. void writeKeyEvent(rdr::U32 keysym, rdr::U32 keycode, bool down);
  45. void writePointerEvent(const Point& pos, int buttonMask);
  46. void writeClientCutText(const char* str);
  47. void writeClipboardCaps(rdr::U32 caps, const rdr::U32* lengths);
  48. void writeClipboardRequest(rdr::U32 flags);
  49. void writeClipboardPeek(rdr::U32 flags);
  50. void writeClipboardNotify(rdr::U32 flags);
  51. void writeClipboardProvide(rdr::U32 flags, const size_t* lengths,
  52. const rdr::U8* const* data);
  53. protected:
  54. void startMsg(int type);
  55. void endMsg();
  56. ServerParams* server;
  57. rdr::OutStream* os;
  58. };
  59. }
  60. #endif