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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
  2. * Copyright 2014-2018 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. bool supportsQEMUKeyEvent;
  61. bool supportsSetDesktopSize;
  62. bool supportsFence;
  63. bool supportsContinuousUpdates;
  64. private:
  65. int width_;
  66. int height_;
  67. ScreenSet screenLayout_;
  68. PixelFormat pf_;
  69. char* name_;
  70. Cursor* cursor_;
  71. unsigned int ledState_;
  72. };
  73. }
  74. #endif