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 3.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. /* Copyright 2011 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. #include <FL/Fl_Group.H>
  23. #include <FL/Fl_Check_Button.H>
  24. #include <FL/Fl_Round_Button.H>
  25. #include <FL/Fl_Int_Input.H>
  26. #include <FL/Fl_Choice.H>
  27. typedef void (OptionsCallback)(void*);
  28. class OptionsDialog : public Fl_Window {
  29. protected:
  30. OptionsDialog();
  31. ~OptionsDialog();
  32. public:
  33. static void showDialog(void);
  34. static void addCallback(OptionsCallback *cb, void *data = NULL);
  35. static void removeCallback(OptionsCallback *cb);
  36. void show(void);
  37. protected:
  38. void loadOptions(void);
  39. void storeOptions(void);
  40. void createCompressionPage(int tx, int ty, int tw, int th);
  41. void createSecurityPage(int tx, int ty, int tw, int th);
  42. void createInputPage(int tx, int ty, int tw, int th);
  43. void createScreenPage(int tx, int ty, int tw, int th);
  44. void createMiscPage(int tx, int ty, int tw, int th);
  45. static void handleAutoselect(Fl_Widget *widget, void *data);
  46. static void handleCompression(Fl_Widget *widget, void *data);
  47. static void handleJpeg(Fl_Widget *widget, void *data);
  48. static void handleX509(Fl_Widget *widget, void *data);
  49. static void handleDesktopSize(Fl_Widget *widget, void *data);
  50. static void handleCancel(Fl_Widget *widget, void *data);
  51. static void handleOK(Fl_Widget *widget, void *data);
  52. protected:
  53. static std::map<OptionsCallback*, void*> callbacks;
  54. /* Compression */
  55. Fl_Check_Button *autoselectCheckbox;
  56. Fl_Group *encodingGroup;
  57. Fl_Round_Button *tightButton;
  58. Fl_Round_Button *zrleButton;
  59. Fl_Round_Button *hextileButton;
  60. Fl_Round_Button *rawButton;
  61. Fl_Group *colorlevelGroup;
  62. Fl_Round_Button *fullcolorCheckbox;
  63. Fl_Round_Button *mediumcolorCheckbox;
  64. Fl_Round_Button *lowcolorCheckbox;
  65. Fl_Round_Button *verylowcolorCheckbox;
  66. Fl_Check_Button *compressionCheckbox;
  67. Fl_Check_Button *jpegCheckbox;
  68. Fl_Int_Input *compressionInput;
  69. Fl_Int_Input *jpegInput;
  70. /* Security */
  71. Fl_Group *encryptionGroup;
  72. Fl_Check_Button *encNoneCheckbox;
  73. Fl_Check_Button *encTLSCheckbox;
  74. Fl_Check_Button *encX509Checkbox;
  75. Fl_Input *caInput;
  76. Fl_Input *crlInput;
  77. Fl_Group *authenticationGroup;
  78. Fl_Check_Button *authNoneCheckbox;
  79. Fl_Check_Button *authVncCheckbox;
  80. Fl_Check_Button *authPlainCheckbox;
  81. /* Input */
  82. Fl_Check_Button *viewOnlyCheckbox;
  83. Fl_Check_Button *acceptClipboardCheckbox;
  84. Fl_Check_Button *sendClipboardCheckbox;
  85. Fl_Check_Button *sendPrimaryCheckbox;
  86. Fl_Check_Button *systemKeysCheckbox;
  87. Fl_Choice *menuKeyChoice;
  88. /* Screen */
  89. Fl_Check_Button *desktopSizeCheckbox;
  90. Fl_Int_Input *desktopWidthInput;
  91. Fl_Int_Input *desktopHeightInput;
  92. Fl_Check_Button *remoteResizeCheckbox;
  93. Fl_Check_Button *fullScreenCheckbox;
  94. Fl_Check_Button *fullScreenAllMonitorsCheckbox;
  95. /* Misc. */
  96. Fl_Check_Button *sharedCheckbox;
  97. Fl_Check_Button *dotCursorCheckbox;
  98. };
  99. #endif