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.

CMsgReader.h 2.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. // CMsgReader - class for reading RFB messages on the server side
  21. // (i.e. messages from client to server).
  22. //
  23. #ifndef __RFB_CMSGREADER_H__
  24. #define __RFB_CMSGREADER_H__
  25. #include <rdr/types.h>
  26. #include <rfb/Rect.h>
  27. #include <rfb/encodings.h>
  28. namespace rdr { class InStream; }
  29. namespace rfb {
  30. class CMsgHandler;
  31. struct Rect;
  32. class CMsgReader {
  33. public:
  34. CMsgReader(CMsgHandler* handler, rdr::InStream* is);
  35. virtual ~CMsgReader();
  36. void readServerInit();
  37. // readMsg() reads a message, calling the handler as appropriate.
  38. void readMsg();
  39. rdr::InStream* getInStream() { return is; }
  40. int imageBufIdealSize;
  41. protected:
  42. void readSetColourMapEntries();
  43. void readBell();
  44. void readServerCutText();
  45. void readFence();
  46. void readEndOfContinuousUpdates();
  47. void readFramebufferUpdate();
  48. void readRect(const Rect& r, int encoding);
  49. void readSetXCursor(int width, int height, const Point& hotspot);
  50. void readSetCursor(int width, int height, const Point& hotspot);
  51. void readSetCursorWithAlpha(int width, int height, const Point& hotspot);
  52. void readSetVMwareCursor(int width, int height, const Point& hotspot);
  53. void readSetDesktopName(int x, int y, int w, int h);
  54. void readExtendedDesktopSize(int x, int y, int w, int h);
  55. void readLEDState();
  56. void readVMwareLEDState();
  57. CMsgHandler* handler;
  58. rdr::InStream* is;
  59. int nUpdateRectsLeft;
  60. static const int maxCursorSize = 256;
  61. };
  62. }
  63. #endif