blob: b3ac015635543835bcc8ede0d45b858ce3ea45d3 [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>
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 Ossman4e7271e2011-05-24 12:47:12 +000029#include <FL/Fl_Choice.H>
Pierre Ossmand463b572011-05-16 12:04:43 +000030
Pierre Ossman0c41e1d2011-05-17 09:36:04 +000031typedef void (OptionsCallback)(void*);
32
Pierre Ossmand463b572011-05-16 12:04:43 +000033class OptionsDialog : public Fl_Window {
34protected:
35 OptionsDialog();
36 ~OptionsDialog();
37
38public:
39 static void showDialog(void);
40
Pierre Ossman0c41e1d2011-05-17 09:36:04 +000041 static void addCallback(OptionsCallback *cb, void *data = NULL);
42 static void removeCallback(OptionsCallback *cb);
43
Pierre Ossmand463b572011-05-16 12:04:43 +000044 void show(void);
45
46protected:
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);
Pierre Ossman1c2189b2012-07-05 09:23:03 +000053 void createScreenPage(int tx, int ty, int tw, int th);
Pierre Ossmand463b572011-05-16 12:04:43 +000054 void createMiscPage(int tx, int ty, int tw, int th);
55
56 static void handleAutoselect(Fl_Widget *widget, void *data);
57 static void handleCompression(Fl_Widget *widget, void *data);
58 static void handleJpeg(Fl_Widget *widget, void *data);
59
Pierre Ossmand463b572011-05-16 12:04:43 +000060 static void handleX509(Fl_Widget *widget, void *data);
61
Pierre Ossman9ff733a2012-07-05 11:01:23 +000062 static void handleDesktopSize(Fl_Widget *widget, void *data);
63
Pierre Ossmand463b572011-05-16 12:04:43 +000064 static void handleCancel(Fl_Widget *widget, void *data);
65 static void handleOK(Fl_Widget *widget, void *data);
66
67protected:
Pierre Ossman0c41e1d2011-05-17 09:36:04 +000068 static std::map<OptionsCallback*, void*> callbacks;
69
Pierre Ossmand463b572011-05-16 12:04:43 +000070 /* Compression */
71 Fl_Check_Button *autoselectCheckbox;
72
73 Fl_Group *encodingGroup;
74 Fl_Round_Button *tightButton;
75 Fl_Round_Button *zrleButton;
76 Fl_Round_Button *hextileButton;
77 Fl_Round_Button *rawButton;
78
79 Fl_Group *colorlevelGroup;
80 Fl_Round_Button *fullcolorCheckbox;
81 Fl_Round_Button *mediumcolorCheckbox;
82 Fl_Round_Button *lowcolorCheckbox;
83 Fl_Round_Button *verylowcolorCheckbox;
84
85 Fl_Check_Button *compressionCheckbox;
86 Fl_Check_Button *jpegCheckbox;
87 Fl_Int_Input *compressionInput;
88 Fl_Int_Input *jpegInput;
89
90 /* Security */
Pierre Ossmand463b572011-05-16 12:04:43 +000091 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 Ossman407a5c32011-05-26 14:48:29 +0000108 Fl_Check_Button *systemKeysCheckbox;
Pierre Ossman4e7271e2011-05-24 12:47:12 +0000109 Fl_Choice *menuKeyChoice;
Pierre Ossmand463b572011-05-16 12:04:43 +0000110
Pierre Ossman1c2189b2012-07-05 09:23:03 +0000111 /* Screen */
Pierre Ossman9ff733a2012-07-05 11:01:23 +0000112 Fl_Check_Button *desktopSizeCheckbox;
113 Fl_Int_Input *desktopWidthInput;
114 Fl_Int_Input *desktopHeightInput;
Pierre Ossman99197012012-07-05 11:06:18 +0000115 Fl_Check_Button *remoteResizeCheckbox;
Pierre Ossman1c2189b2012-07-05 09:23:03 +0000116 Fl_Check_Button *fullScreenCheckbox;
Pierre Ossmanaae38912012-07-13 11:22:55 +0000117 Fl_Check_Button *fullScreenAllMonitorsCheckbox;
Pierre Ossman1c2189b2012-07-05 09:23:03 +0000118
Pierre Ossmand463b572011-05-16 12:04:43 +0000119 /* Misc. */
120 Fl_Check_Button *sharedCheckbox;
Pierre Ossmand463b572011-05-16 12:04:43 +0000121 Fl_Check_Button *dotCursorCheckbox;
122};
123
124#endif