Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

ConnParams.h 2.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
  2. *
  3. * This is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License as published by
  5. * the Free Software Foundation; either version 2 of the License, or
  6. * (at your option) any later version.
  7. *
  8. * This software is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this software; if not, write to the Free Software
  15. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  16. * USA.
  17. */
  18. //
  19. // ConnParams - structure containing the connection parameters.
  20. //
  21. #ifndef __RFB_CONNPARAMS_H__
  22. #define __RFB_CONNPARAMS_H__
  23. #include <rdr/types.h>
  24. #include <rfb/PixelFormat.h>
  25. #include <rfb/ScreenSet.h>
  26. namespace rdr { class InStream; }
  27. namespace rfb {
  28. class ConnParams {
  29. public:
  30. ConnParams();
  31. ~ConnParams();
  32. bool readVersion(rdr::InStream* is, bool* done);
  33. void writeVersion(rdr::OutStream* os);
  34. int majorVersion;
  35. int minorVersion;
  36. bool tightExtensionsEnabled;
  37. void setVersion(int major, int minor) {
  38. majorVersion = major; minorVersion = minor;
  39. }
  40. bool isVersion(int major, int minor) {
  41. return majorVersion == major && minorVersion == minor;
  42. }
  43. bool beforeVersion(int major, int minor) {
  44. return (majorVersion < major ||
  45. (majorVersion == major && minorVersion < minor));
  46. }
  47. bool afterVersion(int major, int minor) {
  48. return !beforeVersion(major,minor+1);
  49. }
  50. int width;
  51. int height;
  52. ScreenSet screenLayout;
  53. const PixelFormat& pf() { return pf_; }
  54. void setPF(const PixelFormat& pf);
  55. const char* name() { return name_; }
  56. void setName(const char* name);
  57. rdr::S32 currentEncoding() { return currentEncoding_; }
  58. int nEncodings() { return nEncodings_; }
  59. const rdr::S32* encodings() { return encodings_; }
  60. void setEncodings(int nEncodings, const rdr::S32* encodings);
  61. bool useCopyRect;
  62. bool supportsLocalCursor;
  63. bool supportsLocalXCursor;
  64. bool supportsDesktopResize;
  65. bool supportsExtendedDesktopSize;
  66. bool supportsDesktopRename;
  67. bool supportsLastRect;
  68. bool supportsSetDesktopSize;
  69. bool customCompressLevel;
  70. int compressLevel;
  71. bool noJpeg;
  72. int qualityLevel;
  73. private:
  74. PixelFormat pf_;
  75. char* name_;
  76. int nEncodings_;
  77. rdr::S32* encodings_;
  78. int currentEncoding_;
  79. char verStr[13];
  80. int verStrPos;
  81. };
  82. }
  83. #endif