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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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) = 0;
  46. virtual void setPixelFormat(const PixelFormat& pf);
  47. virtual void setName(const char* name);
  48. virtual void serverInit() = 0;
  49. virtual void framebufferUpdateStart() = 0;
  50. virtual void framebufferUpdateEnd() = 0;
  51. virtual void beginRect(const Rect& r, int encoding) = 0;
  52. virtual void endRect(const Rect& r, int encoding) = 0;
  53. virtual void setColourMapEntries(int firstColour, int nColours,
  54. rdr::U16* rgbs) = 0;
  55. virtual void bell() = 0;
  56. virtual void serverCutText(const char* str, rdr::U32 len) = 0;
  57. virtual void fillRect(const Rect& r, Pixel pix) = 0;
  58. virtual void imageRect(const Rect& r, void* pixels) = 0;
  59. virtual void copyRect(const Rect& r, int srcX, int srcY) = 0;
  60. ConnParams cp;
  61. };
  62. }
  63. #endif