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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. // 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 readExtendedClipboard(rdr::S32 len);
  46. void readFence();
  47. void readEndOfContinuousUpdates();
  48. void readFramebufferUpdate();
  49. void readRect(const Rect& r, int encoding);
  50. void readSetXCursor(int width, int height, const Point& hotspot);
  51. void readSetCursor(int width, int height, const Point& hotspot);
  52. void readSetCursorWithAlpha(int width, int height, const Point& hotspot);
  53. void readSetVMwareCursor(int width, int height, const Point& hotspot);
  54. void readSetDesktopName(int x, int y, int w, int h);
  55. void readExtendedDesktopSize(int x, int y, int w, int h);
  56. void readLEDState();
  57. void readVMwareLEDState();
  58. CMsgHandler* handler;
  59. rdr::InStream* is;
  60. int nUpdateRectsLeft;
  61. static const int maxCursorSize = 256;
  62. };
  63. }
  64. #endif