Pierre Ossman | d463b57 | 2011-05-16 12:04:43 +0000 | [diff] [blame] | 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 | |
| 19 | #ifndef __OPTIONSDIALOG_H__ |
| 20 | #define __OPTIONSDIALOG_H__ |
| 21 | |
Pierre Ossman | 0c41e1d | 2011-05-17 09:36:04 +0000 | [diff] [blame] | 22 | #include <map> |
| 23 | |
Pierre Ossman | d463b57 | 2011-05-16 12:04:43 +0000 | [diff] [blame] | 24 | #include <FL/Fl_Window.H> |
Pierre Ossman | 769963f | 2014-01-20 14:43:52 +0100 | [diff] [blame^] | 25 | |
| 26 | class Fl_Widget; |
| 27 | class Fl_Group; |
| 28 | class Fl_Check_Button; |
| 29 | class Fl_Round_Button; |
| 30 | class Fl_Input; |
| 31 | class Fl_Int_Input; |
| 32 | class Fl_Choice; |
Pierre Ossman | d463b57 | 2011-05-16 12:04:43 +0000 | [diff] [blame] | 33 | |
Pierre Ossman | 0c41e1d | 2011-05-17 09:36:04 +0000 | [diff] [blame] | 34 | typedef void (OptionsCallback)(void*); |
| 35 | |
Pierre Ossman | d463b57 | 2011-05-16 12:04:43 +0000 | [diff] [blame] | 36 | class OptionsDialog : public Fl_Window { |
| 37 | protected: |
| 38 | OptionsDialog(); |
| 39 | ~OptionsDialog(); |
| 40 | |
| 41 | public: |
| 42 | static void showDialog(void); |
| 43 | |
Pierre Ossman | 0c41e1d | 2011-05-17 09:36:04 +0000 | [diff] [blame] | 44 | static void addCallback(OptionsCallback *cb, void *data = NULL); |
| 45 | static void removeCallback(OptionsCallback *cb); |
| 46 | |
Pierre Ossman | d463b57 | 2011-05-16 12:04:43 +0000 | [diff] [blame] | 47 | void show(void); |
| 48 | |
| 49 | protected: |
| 50 | void loadOptions(void); |
| 51 | void storeOptions(void); |
| 52 | |
| 53 | void createCompressionPage(int tx, int ty, int tw, int th); |
| 54 | void createSecurityPage(int tx, int ty, int tw, int th); |
| 55 | void createInputPage(int tx, int ty, int tw, int th); |
Pierre Ossman | 1c2189b | 2012-07-05 09:23:03 +0000 | [diff] [blame] | 56 | void createScreenPage(int tx, int ty, int tw, int th); |
Pierre Ossman | d463b57 | 2011-05-16 12:04:43 +0000 | [diff] [blame] | 57 | void createMiscPage(int tx, int ty, int tw, int th); |
| 58 | |
| 59 | static void handleAutoselect(Fl_Widget *widget, void *data); |
| 60 | static void handleCompression(Fl_Widget *widget, void *data); |
| 61 | static void handleJpeg(Fl_Widget *widget, void *data); |
| 62 | |
Pierre Ossman | d463b57 | 2011-05-16 12:04:43 +0000 | [diff] [blame] | 63 | static void handleX509(Fl_Widget *widget, void *data); |
| 64 | |
Pierre Ossman | 9ff733a | 2012-07-05 11:01:23 +0000 | [diff] [blame] | 65 | static void handleDesktopSize(Fl_Widget *widget, void *data); |
| 66 | |
Pierre Ossman | d463b57 | 2011-05-16 12:04:43 +0000 | [diff] [blame] | 67 | static void handleCancel(Fl_Widget *widget, void *data); |
| 68 | static void handleOK(Fl_Widget *widget, void *data); |
| 69 | |
| 70 | protected: |
Pierre Ossman | 0c41e1d | 2011-05-17 09:36:04 +0000 | [diff] [blame] | 71 | static std::map<OptionsCallback*, void*> callbacks; |
| 72 | |
Pierre Ossman | d463b57 | 2011-05-16 12:04:43 +0000 | [diff] [blame] | 73 | /* Compression */ |
| 74 | Fl_Check_Button *autoselectCheckbox; |
| 75 | |
| 76 | Fl_Group *encodingGroup; |
| 77 | Fl_Round_Button *tightButton; |
| 78 | Fl_Round_Button *zrleButton; |
| 79 | Fl_Round_Button *hextileButton; |
| 80 | Fl_Round_Button *rawButton; |
| 81 | |
| 82 | Fl_Group *colorlevelGroup; |
| 83 | Fl_Round_Button *fullcolorCheckbox; |
| 84 | Fl_Round_Button *mediumcolorCheckbox; |
| 85 | Fl_Round_Button *lowcolorCheckbox; |
| 86 | Fl_Round_Button *verylowcolorCheckbox; |
| 87 | |
| 88 | Fl_Check_Button *compressionCheckbox; |
| 89 | Fl_Check_Button *jpegCheckbox; |
| 90 | Fl_Int_Input *compressionInput; |
| 91 | Fl_Int_Input *jpegInput; |
| 92 | |
| 93 | /* Security */ |
Pierre Ossman | d463b57 | 2011-05-16 12:04:43 +0000 | [diff] [blame] | 94 | Fl_Group *encryptionGroup; |
| 95 | Fl_Check_Button *encNoneCheckbox; |
| 96 | Fl_Check_Button *encTLSCheckbox; |
| 97 | Fl_Check_Button *encX509Checkbox; |
| 98 | Fl_Input *caInput; |
| 99 | Fl_Input *crlInput; |
| 100 | |
| 101 | Fl_Group *authenticationGroup; |
| 102 | Fl_Check_Button *authNoneCheckbox; |
| 103 | Fl_Check_Button *authVncCheckbox; |
| 104 | Fl_Check_Button *authPlainCheckbox; |
| 105 | |
| 106 | /* Input */ |
| 107 | Fl_Check_Button *viewOnlyCheckbox; |
| 108 | Fl_Check_Button *acceptClipboardCheckbox; |
| 109 | Fl_Check_Button *sendClipboardCheckbox; |
| 110 | Fl_Check_Button *sendPrimaryCheckbox; |
Pierre Ossman | 407a5c3 | 2011-05-26 14:48:29 +0000 | [diff] [blame] | 111 | Fl_Check_Button *systemKeysCheckbox; |
Pierre Ossman | 4e7271e | 2011-05-24 12:47:12 +0000 | [diff] [blame] | 112 | Fl_Choice *menuKeyChoice; |
Pierre Ossman | d463b57 | 2011-05-16 12:04:43 +0000 | [diff] [blame] | 113 | |
Pierre Ossman | 1c2189b | 2012-07-05 09:23:03 +0000 | [diff] [blame] | 114 | /* Screen */ |
Pierre Ossman | 9ff733a | 2012-07-05 11:01:23 +0000 | [diff] [blame] | 115 | Fl_Check_Button *desktopSizeCheckbox; |
| 116 | Fl_Int_Input *desktopWidthInput; |
| 117 | Fl_Int_Input *desktopHeightInput; |
Pierre Ossman | 9919701 | 2012-07-05 11:06:18 +0000 | [diff] [blame] | 118 | Fl_Check_Button *remoteResizeCheckbox; |
Pierre Ossman | 1c2189b | 2012-07-05 09:23:03 +0000 | [diff] [blame] | 119 | Fl_Check_Button *fullScreenCheckbox; |
Pierre Ossman | aae3891 | 2012-07-13 11:22:55 +0000 | [diff] [blame] | 120 | Fl_Check_Button *fullScreenAllMonitorsCheckbox; |
Pierre Ossman | 1c2189b | 2012-07-05 09:23:03 +0000 | [diff] [blame] | 121 | |
Pierre Ossman | d463b57 | 2011-05-16 12:04:43 +0000 | [diff] [blame] | 122 | /* Misc. */ |
| 123 | Fl_Check_Button *sharedCheckbox; |
Pierre Ossman | d463b57 | 2011-05-16 12:04:43 +0000 | [diff] [blame] | 124 | Fl_Check_Button *dotCursorCheckbox; |
| 125 | }; |
| 126 | |
| 127 | #endif |