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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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 <string>
  25. #include <rfb/Cursor.h>
  26. #include <rfb/PixelFormat.h>
  27. #include <rfb/ScreenSet.h>
  28. namespace rfb {
  29. class ServerParams {
  30. public:
  31. ServerParams();
  32. ~ServerParams();
  33. int majorVersion;
  34. int minorVersion;
  35. void setVersion(int major, int minor) {
  36. majorVersion = major; minorVersion = minor;
  37. }
  38. bool isVersion(int major, int minor) const {
  39. return majorVersion == major && minorVersion == minor;
  40. }
  41. bool beforeVersion(int major, int minor) const {
  42. return (majorVersion < major ||
  43. (majorVersion == major && minorVersion < minor));
  44. }
  45. bool afterVersion(int major, int minor) const {
  46. return !beforeVersion(major,minor+1);
  47. }
  48. int width() const { return width_; }
  49. int height() const { return height_; }
  50. const ScreenSet& screenLayout() const { return screenLayout_; }
  51. void setDimensions(int width, int height);
  52. void setDimensions(int width, int height, const ScreenSet& layout);
  53. const PixelFormat& pf() const { return pf_; }
  54. void setPF(const PixelFormat& pf);
  55. const char* name() const { return name_.c_str(); }
  56. void setName(const char* name);
  57. const Cursor& cursor() const { return *cursor_; }
  58. void setCursor(const Cursor& cursor);
  59. unsigned int ledState() { return ledState_; }
  60. void setLEDState(unsigned int state);
  61. uint32_t clipboardFlags() const { return clipFlags; }
  62. uint32_t clipboardSize(unsigned int format) const;
  63. void setClipboardCaps(uint32_t flags, const uint32_t* lengths);
  64. bool supportsQEMUKeyEvent;
  65. bool supportsSetDesktopSize;
  66. bool supportsFence;
  67. bool supportsContinuousUpdates;
  68. private:
  69. int width_;
  70. int height_;
  71. ScreenSet screenLayout_;
  72. PixelFormat pf_;
  73. std::string name_;
  74. Cursor* cursor_;
  75. unsigned int ledState_;
  76. uint32_t clipFlags;
  77. uint32_t clipSizes[16];
  78. };
  79. }
  80. #endif