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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /* Copyright (C) 2002-2003 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. void setVersion(int major, int minor) {
  36. majorVersion = major; minorVersion = minor;
  37. }
  38. bool isVersion(int major, int minor) {
  39. return majorVersion == major && minorVersion == minor;
  40. }
  41. bool beforeVersion(int major, int minor) {
  42. return (majorVersion < major ||
  43. (majorVersion == major && minorVersion < minor));
  44. }
  45. bool afterVersion(int major, int minor) {
  46. return !beforeVersion(major,minor+1);
  47. }
  48. int width;
  49. int height;
  50. const PixelFormat& pf() { return pf_; }
  51. void setPF(const PixelFormat& pf);
  52. const char* name() { return name_; }
  53. void setName(const char* name);
  54. rdr::U32 currentEncoding() { return currentEncoding_; }
  55. int nEncodings() { return nEncodings_; }
  56. const rdr::U32* encodings() { return encodings_; }
  57. void setEncodings(int nEncodings, const rdr::U32* encodings);
  58. bool useCopyRect;
  59. bool supportsLocalCursor;
  60. bool supportsDesktopResize;
  61. private:
  62. PixelFormat pf_;
  63. char* name_;
  64. int nEncodings_;
  65. rdr::U32* encodings_;
  66. int currentEncoding_;
  67. char verStr[13];
  68. int verStrPos;
  69. };
  70. }
  71. #endif