blob: 6984c72f7c39f630f39719a0004152eb4983a813 [file] [log] [blame]
Pierre Ossmand463b572011-05-16 12:04:43 +00001/* 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 Ossman0c41e1d2011-05-17 09:36:04 +000022#include <map>
23
Pierre Ossmand463b572011-05-16 12:04:43 +000024#include <FL/Fl_Window.H>
Pierre Ossman769963f2014-01-20 14:43:52 +010025
26class Fl_Widget;
27class Fl_Group;
28class Fl_Check_Button;
29class Fl_Round_Button;
30class Fl_Input;
31class Fl_Int_Input;
32class Fl_Choice;
Pierre Ossmand463b572011-05-16 12:04:43 +000033
Pierre Ossman0c41e1d2011-05-17 09:36:04 +000034typedef void (OptionsCallback)(void*);
35
Pierre Ossmand463b572011-05-16 12:04:43 +000036class OptionsDialog : public Fl_Window {
37protected:
38 OptionsDialog();
39 ~OptionsDialog();
40
41public:
42 static void showDialog(void);
43
Pierre Ossman0c41e1d2011-05-17 09:36:04 +000044 static void addCallback(OptionsCallback *cb, void *data = NULL);
45 static void removeCallback(OptionsCallback *cb);
46
Pierre Ossmand463b572011-05-16 12:04:43 +000047 void show(void);
48
49protected:
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 Ossman1c2189b2012-07-05 09:23:03 +000056 void createScreenPage(int tx, int ty, int tw, int th);
Pierre Ossmand463b572011-05-16 12:04:43 +000057 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 Ossmand463b572011-05-16 12:04:43 +000063 static void handleX509(Fl_Widget *widget, void *data);
64
Pierre Ossman9ff733a2012-07-05 11:01:23 +000065 static void handleDesktopSize(Fl_Widget *widget, void *data);
66
Pierre Ossmand463b572011-05-16 12:04:43 +000067 static void handleCancel(Fl_Widget *widget, void *data);
68 static void handleOK(Fl_Widget *widget, void *data);
69
70protected:
Pierre Ossman0c41e1d2011-05-17 09:36:04 +000071 static std::map<OptionsCallback*, void*> callbacks;
72
Pierre Ossmand463b572011-05-16 12:04:43 +000073 /* 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 Ossmand463b572011-05-16 12:04:43 +000094 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;
Pierre Ossmanf862c2e2016-03-29 14:15:38 +0200109#if !defined(WIN32) && !defined(__APPLE__)
110 Fl_Check_Button *setPrimaryCheckbox;
111#endif
Pierre Ossmand463b572011-05-16 12:04:43 +0000112 Fl_Check_Button *sendClipboardCheckbox;
Pierre Ossmanf7fef922015-12-10 21:24:08 +0100113#if !defined(WIN32) && !defined(__APPLE__)
Pierre Ossmand463b572011-05-16 12:04:43 +0000114 Fl_Check_Button *sendPrimaryCheckbox;
Pierre Ossmanf7fef922015-12-10 21:24:08 +0100115#endif
Pierre Ossman407a5c32011-05-26 14:48:29 +0000116 Fl_Check_Button *systemKeysCheckbox;
Pierre Ossman4e7271e2011-05-24 12:47:12 +0000117 Fl_Choice *menuKeyChoice;
Pierre Ossmand463b572011-05-16 12:04:43 +0000118
Pierre Ossman1c2189b2012-07-05 09:23:03 +0000119 /* Screen */
Pierre Ossman9ff733a2012-07-05 11:01:23 +0000120 Fl_Check_Button *desktopSizeCheckbox;
121 Fl_Int_Input *desktopWidthInput;
122 Fl_Int_Input *desktopHeightInput;
Pierre Ossman99197012012-07-05 11:06:18 +0000123 Fl_Check_Button *remoteResizeCheckbox;
Pierre Ossman1c2189b2012-07-05 09:23:03 +0000124 Fl_Check_Button *fullScreenCheckbox;
Pierre Ossmanaae38912012-07-13 11:22:55 +0000125 Fl_Check_Button *fullScreenAllMonitorsCheckbox;
Pierre Ossman1c2189b2012-07-05 09:23:03 +0000126
Pierre Ossmand463b572011-05-16 12:04:43 +0000127 /* Misc. */
128 Fl_Check_Button *sharedCheckbox;
Pierre Ossmand463b572011-05-16 12:04:43 +0000129 Fl_Check_Button *dotCursorCheckbox;
130};
131
132#endif