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.

OptionsDialog.h 4.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. /* Copyright 2011-2021 Pierre Ossman <ossman@cendio.se> for Cendio AB
  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. #ifndef __OPTIONSDIALOG_H__
  19. #define __OPTIONSDIALOG_H__
  20. #include <map>
  21. #include <FL/Fl_Window.H>
  22. class Fl_Widget;
  23. class Fl_Group;
  24. class Fl_Check_Button;
  25. class Fl_Round_Button;
  26. class Fl_Input;
  27. class Fl_Int_Input;
  28. class Fl_Choice;
  29. class MonitorArrangement;
  30. typedef void (OptionsCallback)(void*);
  31. class OptionsDialog : public Fl_Window {
  32. protected:
  33. OptionsDialog();
  34. ~OptionsDialog();
  35. public:
  36. static void showDialog(void);
  37. static void addCallback(OptionsCallback *cb, void *data = NULL);
  38. static void removeCallback(OptionsCallback *cb);
  39. void show(void);
  40. protected:
  41. void loadOptions(void);
  42. void storeOptions(void);
  43. void createCompressionPage(int tx, int ty, int tw, int th);
  44. void createSecurityPage(int tx, int ty, int tw, int th);
  45. void createInputPage(int tx, int ty, int tw, int th);
  46. void createDisplayPage(int tx, int ty, int tw, int th);
  47. void createMiscPage(int tx, int ty, int tw, int th);
  48. static void handleAutoselect(Fl_Widget *widget, void *data);
  49. static void handleCompression(Fl_Widget *widget, void *data);
  50. static void handleJpeg(Fl_Widget *widget, void *data);
  51. static void handleX509(Fl_Widget *widget, void *data);
  52. static void handleRSAAES(Fl_Widget *widget, void *data);
  53. static void handleClipboard(Fl_Widget *widget, void *data);
  54. static void handleFullScreenMode(Fl_Widget *widget, void *data);
  55. static void handleCancel(Fl_Widget *widget, void *data);
  56. static void handleOK(Fl_Widget *widget, void *data);
  57. protected:
  58. static std::map<OptionsCallback*, void*> callbacks;
  59. /* Compression */
  60. Fl_Check_Button *autoselectCheckbox;
  61. Fl_Group *encodingGroup;
  62. Fl_Round_Button *tightButton;
  63. Fl_Round_Button *zrleButton;
  64. Fl_Round_Button *hextileButton;
  65. #ifdef HAVE_H264
  66. Fl_Round_Button *h264Button;
  67. #endif
  68. Fl_Round_Button *rawButton;
  69. Fl_Group *colorlevelGroup;
  70. Fl_Round_Button *fullcolorCheckbox;
  71. Fl_Round_Button *mediumcolorCheckbox;
  72. Fl_Round_Button *lowcolorCheckbox;
  73. Fl_Round_Button *verylowcolorCheckbox;
  74. Fl_Check_Button *compressionCheckbox;
  75. Fl_Check_Button *jpegCheckbox;
  76. Fl_Int_Input *compressionInput;
  77. Fl_Int_Input *jpegInput;
  78. /* Security */
  79. Fl_Group *encryptionGroup;
  80. Fl_Check_Button *encNoneCheckbox;
  81. Fl_Check_Button *encTLSCheckbox;
  82. Fl_Check_Button *encX509Checkbox;
  83. Fl_Check_Button *encRSAAESCheckbox;
  84. Fl_Input *caInput;
  85. Fl_Input *crlInput;
  86. Fl_Group *authenticationGroup;
  87. Fl_Check_Button *authNoneCheckbox;
  88. Fl_Check_Button *authVncCheckbox;
  89. Fl_Check_Button *authPlainCheckbox;
  90. /* Input */
  91. Fl_Check_Button *viewOnlyCheckbox;
  92. Fl_Group *mouseGroup;
  93. Fl_Check_Button *emulateMBCheckbox;
  94. Fl_Check_Button *dotCursorCheckbox;
  95. Fl_Group *keyboardGroup;
  96. Fl_Check_Button *systemKeysCheckbox;
  97. Fl_Choice *menuKeyChoice;
  98. Fl_Group *clipboardGroup;
  99. Fl_Check_Button *acceptClipboardCheckbox;
  100. #if !defined(WIN32) && !defined(__APPLE__)
  101. Fl_Check_Button *setPrimaryCheckbox;
  102. #endif
  103. Fl_Check_Button *sendClipboardCheckbox;
  104. #if !defined(WIN32) && !defined(__APPLE__)
  105. Fl_Check_Button *sendPrimaryCheckbox;
  106. #endif
  107. /* Display */
  108. Fl_Group *displayModeGroup;
  109. Fl_Round_Button *windowedButton;
  110. Fl_Round_Button *currentMonitorButton;
  111. Fl_Round_Button *allMonitorsButton;
  112. Fl_Round_Button *selectedMonitorsButton;
  113. MonitorArrangement *monitorArrangement;
  114. /* Misc. */
  115. Fl_Check_Button *sharedCheckbox;
  116. Fl_Check_Button *reconnectCheckbox;
  117. private:
  118. static int fltk_event_handler(int event);
  119. static void handleScreenConfigTimeout(void *data);
  120. };
  121. #endif