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.

ConnParams.h 2.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. namespace rdr { class InStream; }
  26. namespace rfb {
  27. class ConnParams {
  28. public:
  29. ConnParams();
  30. ~ConnParams();
  31. bool readVersion(rdr::InStream* is, bool* done);
  32. void writeVersion(rdr::OutStream* os);
  33. int majorVersion;
  34. int minorVersion;
  35. bool tightExtensionsEnabled;
  36. void setVersion(int major, int minor) {
  37. majorVersion = major; minorVersion = minor;
  38. }
  39. bool isVersion(int major, int minor) {
  40. return majorVersion == major && minorVersion == minor;
  41. }
  42. bool beforeVersion(int major, int minor) {
  43. return (majorVersion < major ||
  44. (majorVersion == major && minorVersion < minor));
  45. }
  46. bool afterVersion(int major, int minor) {
  47. return !beforeVersion(major,minor+1);
  48. }
  49. int width;
  50. int height;
  51. const PixelFormat& pf() { return pf_; }
  52. void setPF(const PixelFormat& pf);
  53. const char* name() { return name_; }
  54. void setName(const char* name);
  55. rdr::U32 currentEncoding() { return currentEncoding_; }
  56. int nEncodings() { return nEncodings_; }
  57. const rdr::U32* encodings() { return encodings_; }
  58. void setEncodings(int nEncodings, const rdr::U32* encodings);
  59. bool useCopyRect;
  60. bool supportsLocalCursor;
  61. bool supportsLocalXCursor;
  62. bool supportsDesktopResize;
  63. bool supportsDesktopRename;
  64. bool supportsLastRect;
  65. bool customCompressLevel;
  66. int compressLevel;
  67. bool noJpeg;
  68. int qualityLevel;
  69. private:
  70. PixelFormat pf_;
  71. char* name_;
  72. int nEncodings_;
  73. rdr::U32* encodings_;
  74. int currentEncoding_;
  75. char verStr[13];
  76. int verStrPos;
  77. };
  78. }
  79. #endif