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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. cp.width = width;
  33. cp.height = height;
  34. }
  35. void CMsgHandler::setExtendedDesktopSize(unsigned reason, unsigned result,
  36. int width, int height,
  37. const ScreenSet& layout)
  38. {
  39. cp.supportsSetDesktopSize = true;
  40. if ((reason == reasonClient) && (result != resultSuccess))
  41. return;
  42. if (!layout.validate(width, height))
  43. fprintf(stderr, "Server sent us an invalid screen layout\n");
  44. cp.width = width;
  45. cp.height = height;
  46. cp.screenLayout = layout;
  47. }
  48. void CMsgHandler::setPixelFormat(const PixelFormat& pf)
  49. {
  50. cp.setPF(pf);
  51. }
  52. void CMsgHandler::setName(const char* name)
  53. {
  54. cp.setName(name);
  55. }
  56. void CMsgHandler::fence(rdr::U32 flags, unsigned len, const char data[])
  57. {
  58. cp.supportsFence = true;
  59. }
  60. void CMsgHandler::endOfContinuousUpdates()
  61. {
  62. cp.supportsContinuousUpdates = true;
  63. }
  64. void CMsgHandler::supportsQEMUKeyEvent()
  65. {
  66. cp.supportsQEMUKeyEvent = true;
  67. }
  68. void CMsgHandler::framebufferUpdateStart()
  69. {
  70. }
  71. void CMsgHandler::framebufferUpdateEnd()
  72. {
  73. }
  74. void CMsgHandler::setLEDState(unsigned int state)
  75. {
  76. cp.setLEDState(state);
  77. }