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.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
  2. * Copyright 2009-2014 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, rdr::U32 len);
  47. protected:
  48. void startMsg(int type);
  49. void endMsg();
  50. ServerParams* server;
  51. rdr::OutStream* os;
  52. };
  53. }
  54. #endif