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