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.

CMsgHandler.h 2.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. //
  20. // CMsgHandler - class to handle incoming messages on the client side.
  21. //
  22. #ifndef __RFB_CMSGHANDLER_H__
  23. #define __RFB_CMSGHANDLER_H__
  24. #include <rdr/types.h>
  25. #include <rfb/Pixel.h>
  26. #include <rfb/ConnParams.h>
  27. #include <rfb/Rect.h>
  28. #include <rfb/ScreenSet.h>
  29. namespace rdr { class InStream; }
  30. namespace rfb {
  31. class CMsgHandler {
  32. public:
  33. CMsgHandler();
  34. virtual ~CMsgHandler();
  35. // The following methods are called as corresponding messages are read. A
  36. // derived class should override these methods as desired. Note that for
  37. // the setDesktopSize(), setExtendedDesktopSize(), setPixelFormat() and
  38. // setName() methods, a derived class should call on to CMsgHandler's
  39. // methods to set the members of cp appropriately.
  40. virtual void setDesktopSize(int w, int h);
  41. virtual void setExtendedDesktopSize(int reason, int result,
  42. int w, int h,
  43. const ScreenSet& layout);
  44. virtual void setCursor(int width, int height, const Point& hotspot,
  45. void* data, void* mask);
  46. virtual void setPixelFormat(const PixelFormat& pf);
  47. virtual void setName(const char* name);
  48. virtual void serverInit();
  49. virtual void framebufferUpdateStart();
  50. virtual void framebufferUpdateEnd();
  51. virtual void beginRect(const Rect& r, unsigned int encoding);
  52. virtual void endRect(const Rect& r, unsigned int encoding);
  53. virtual void setColourMapEntries(int firstColour, int nColours,
  54. rdr::U16* rgbs);
  55. virtual void bell();
  56. virtual void serverCutText(const char* str, rdr::U32 len);
  57. virtual void fillRect(const Rect& r, Pixel pix);
  58. virtual void imageRect(const Rect& r, void* pixels);
  59. virtual void copyRect(const Rect& r, int srcX, int srcY);
  60. virtual bool processFTMsg(int type);
  61. ConnParams cp;
  62. };
  63. }
  64. #endif