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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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. #include <stdio.h>
  20. #include <rfb/Exception.h>
  21. #include <rfb/LogWriter.h>
  22. #include <rfb/CMsgHandler.h>
  23. #include <rfb/screenTypes.h>
  24. static rfb::LogWriter vlog("CMsgHandler");
  25. using namespace rfb;
  26. CMsgHandler::CMsgHandler()
  27. {
  28. }
  29. CMsgHandler::~CMsgHandler()
  30. {
  31. }
  32. void CMsgHandler::setDesktopSize(int width, int height)
  33. {
  34. server.setDimensions(width, height);
  35. }
  36. void CMsgHandler::setExtendedDesktopSize(unsigned reason, unsigned result,
  37. int width, int height,
  38. const ScreenSet& layout)
  39. {
  40. server.supportsSetDesktopSize = true;
  41. if ((reason == reasonClient) && (result != resultSuccess))
  42. return;
  43. server.setDimensions(width, height, layout);
  44. }
  45. void CMsgHandler::setPixelFormat(const PixelFormat& pf)
  46. {
  47. server.setPF(pf);
  48. }
  49. void CMsgHandler::setName(const char* name)
  50. {
  51. server.setName(name);
  52. }
  53. void CMsgHandler::fence(rdr::U32 flags, unsigned len, const char data[])
  54. {
  55. server.supportsFence = true;
  56. }
  57. void CMsgHandler::endOfContinuousUpdates()
  58. {
  59. server.supportsContinuousUpdates = true;
  60. }
  61. void CMsgHandler::supportsQEMUKeyEvent()
  62. {
  63. server.supportsQEMUKeyEvent = true;
  64. }
  65. void CMsgHandler::serverInit(int width, int height,
  66. const PixelFormat& pf,
  67. const char* name)
  68. {
  69. server.setDimensions(width, height);
  70. server.setPF(pf);
  71. server.setName(name);
  72. }
  73. void CMsgHandler::framebufferUpdateStart()
  74. {
  75. }
  76. void CMsgHandler::framebufferUpdateEnd()
  77. {
  78. }
  79. void CMsgHandler::setLEDState(unsigned int state)
  80. {
  81. server.setLEDState(state);
  82. }
  83. void CMsgHandler::handleClipboardCaps(rdr::U32 flags, const rdr::U32* lengths)
  84. {
  85. server.setClipboardCaps(flags, lengths);
  86. }
  87. void CMsgHandler::handleClipboardRequest(rdr::U32 flags)
  88. {
  89. }
  90. void CMsgHandler::handleClipboardPeek(rdr::U32 flags)
  91. {
  92. }
  93. void CMsgHandler::handleClipboardNotify(rdr::U32 flags)
  94. {
  95. }
  96. void CMsgHandler::handleClipboardProvide(rdr::U32 flags,
  97. const size_t* lengths,
  98. const rdr::U8* const* data)
  99. {
  100. }