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.cxx 2.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
  2. * Copyright 2009-2011 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. #include <stdio.h>
  20. #include <rfb/Exception.h>
  21. #include <rfb/CMsgHandler.h>
  22. #include <rfb/screenTypes.h>
  23. using namespace rfb;
  24. CMsgHandler::CMsgHandler()
  25. {
  26. }
  27. CMsgHandler::~CMsgHandler()
  28. {
  29. }
  30. void CMsgHandler::setDesktopSize(int width, int height)
  31. {
  32. server.setDimensions(width, height);
  33. }
  34. void CMsgHandler::setExtendedDesktopSize(unsigned reason, unsigned result,
  35. int width, int height,
  36. const ScreenSet& layout)
  37. {
  38. server.supportsSetDesktopSize = true;
  39. if ((reason == reasonClient) && (result != resultSuccess))
  40. return;
  41. server.setDimensions(width, height, layout);
  42. }
  43. void CMsgHandler::setPixelFormat(const PixelFormat& pf)
  44. {
  45. server.setPF(pf);
  46. }
  47. void CMsgHandler::setName(const char* name)
  48. {
  49. server.setName(name);
  50. }
  51. void CMsgHandler::fence(rdr::U32 flags, unsigned len, const char data[])
  52. {
  53. server.supportsFence = true;
  54. }
  55. void CMsgHandler::endOfContinuousUpdates()
  56. {
  57. server.supportsContinuousUpdates = true;
  58. }
  59. void CMsgHandler::supportsQEMUKeyEvent()
  60. {
  61. server.supportsQEMUKeyEvent = true;
  62. }
  63. void CMsgHandler::serverInit(int width, int height,
  64. const PixelFormat& pf,
  65. const char* name)
  66. {
  67. server.setDimensions(width, height);
  68. server.setPF(pf);
  69. server.setName(name);
  70. }
  71. void CMsgHandler::framebufferUpdateStart()
  72. {
  73. }
  74. void CMsgHandler::framebufferUpdateEnd()
  75. {
  76. }
  77. void CMsgHandler::setLEDState(unsigned int state)
  78. {
  79. server.setLEDState(state);
  80. }