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.

ServerParams.h 2.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
  2. * Copyright 2014-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. //
  20. // ServerParams - structure describing the current state of the remote server
  21. //
  22. #ifndef __RFB_SERVERPARAMS_H__
  23. #define __RFB_SERVERPARAMS_H__
  24. #include <rfb/Cursor.h>
  25. #include <rfb/PixelFormat.h>
  26. #include <rfb/ScreenSet.h>
  27. namespace rfb {
  28. class ServerParams {
  29. public:
  30. ServerParams();
  31. ~ServerParams();
  32. int majorVersion;
  33. int minorVersion;
  34. void setVersion(int major, int minor) {
  35. majorVersion = major; minorVersion = minor;
  36. }
  37. bool isVersion(int major, int minor) const {
  38. return majorVersion == major && minorVersion == minor;
  39. }
  40. bool beforeVersion(int major, int minor) const {
  41. return (majorVersion < major ||
  42. (majorVersion == major && minorVersion < minor));
  43. }
  44. bool afterVersion(int major, int minor) const {
  45. return !beforeVersion(major,minor+1);
  46. }
  47. const int width() const { return width_; }
  48. const int height() const { return height_; }
  49. const ScreenSet& screenLayout() const { return screenLayout_; }
  50. void setDimensions(int width, int height);
  51. void setDimensions(int width, int height, const ScreenSet& layout);
  52. const PixelFormat& pf() const { return pf_; }
  53. void setPF(const PixelFormat& pf);
  54. const char* name() const { return name_; }
  55. void setName(const char* name);
  56. const Cursor& cursor() const { return *cursor_; }
  57. void setCursor(const Cursor& cursor);
  58. unsigned int ledState() { return ledState_; }
  59. void setLEDState(unsigned int state);
  60. rdr::U32 clipboardFlags() const { return clipFlags; }
  61. void setClipboardCaps(rdr::U32 flags, const rdr::U32* lengths);
  62. bool supportsQEMUKeyEvent;
  63. bool supportsSetDesktopSize;
  64. bool supportsFence;
  65. bool supportsContinuousUpdates;
  66. private:
  67. int width_;
  68. int height_;
  69. ScreenSet screenLayout_;
  70. PixelFormat pf_;
  71. char* name_;
  72. Cursor* cursor_;
  73. unsigned int ledState_;
  74. rdr::U32 clipFlags;
  75. rdr::U32 clipSizes[16];
  76. };
  77. }
  78. #endif