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.java 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
  2. * Copyright 2009-2011 Pierre Ossman for Cendio AB
  3. * Copyright (C) 2011 D. R. Commander. All Rights Reserved.
  4. * Copyright (C) 2011-2019 Brian P. Hinz
  5. *
  6. * This is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This software is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this software; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
  19. * USA.
  20. */
  21. //
  22. // CMsgHandler
  23. //
  24. package com.tigervnc.rfb;
  25. abstract public class CMsgHandler {
  26. static LogWriter vlog = new LogWriter("CMsgHandler");
  27. public CMsgHandler() {
  28. server = new ServerParams();
  29. }
  30. public void setDesktopSize(int width, int height)
  31. {
  32. server.setDimensions(width, height);
  33. }
  34. public void setExtendedDesktopSize(int reason, int result,
  35. int width, int height,
  36. ScreenSet layout)
  37. {
  38. server.supportsSetDesktopSize = true;
  39. if ((reason == screenTypes.reasonClient) && (result != screenTypes.resultSuccess))
  40. return;
  41. server.setDimensions(width, height, layout);
  42. }
  43. abstract public void setCursor(int width, int height, Point hotspot,
  44. byte[] data);
  45. public void setPixelFormat(PixelFormat pf)
  46. {
  47. server.setPF(pf);
  48. }
  49. public void setName(String name)
  50. {
  51. server.setName(name);
  52. }
  53. public void fence(int flags, int len, byte[] data)
  54. {
  55. server.supportsFence = true;
  56. }
  57. public void endOfContinuousUpdates()
  58. {
  59. server.supportsContinuousUpdates = true;
  60. }
  61. abstract public void clientRedirect(int port, String host,
  62. String x509subject);
  63. public void serverInit(int width, int height,
  64. PixelFormat pf, String name)
  65. {
  66. server.setDimensions(width, height);
  67. server.setPF(pf);
  68. server.setName(name);
  69. }
  70. abstract public void readAndDecodeRect(Rect r, int encoding,
  71. ModifiablePixelBuffer pb);
  72. public void framebufferUpdateStart() {};
  73. public void framebufferUpdateEnd() {};
  74. abstract public void dataRect(Rect r, int encoding);
  75. abstract public void setColourMapEntries(int firstColour, int nColours,
  76. int[] rgbs);
  77. abstract public void bell();
  78. abstract public void serverCutText(String str, int len);
  79. public ServerParams server;
  80. }