Remmina - The GTK+ Remote Desktop Client  v1.4.33
Remmina is a remote desktop client written in GTK+, aiming to be useful for system administrators and travellers, who need to work with lots of remote computers in front of either large monitors or tiny netbooks. Remmina supports multiple network protocols in an integrated and consistent user interface. Currently RDP, VNC, NX, XDMCP and SSH are supported.
remmina_pref.h
Go to the documentation of this file.
1 /*
2  * Remmina - The GTK+ Remote Desktop Client
3  * Copyright (C) 2009-2011 Vic Lee
4  * Copyright (C) 2014-2015 Antenore Gatta, Fabio Castelli, Giovanni Panozzo
5  * Copyright (C) 2016-2022 Antenore Gatta, Giovanni Panozzo
6  * Copyright (C) 2022-2023 Antenore Gatta, Giovanni Panozzo, Hiroyuki Tanaka
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor,
21  * Boston, MA 02110-1301, USA.
22  *
23  * In addition, as a special exception, the copyright holders give
24  * permission to link the code of portions of this program with the
25  * OpenSSL library under certain conditions as described in each
26  * individual source file, and distribute linked combinations
27  * including the two.
28  * You must obey the GNU General Public License in all respects
29  * for all of the code used other than OpenSSL. * If you modify
30  * file(s) with this exception, you may extend this exception to your
31  * version of the file(s), but you are not obligated to do so. * If you
32  * do not wish to do so, delete this exception statement from your
33  * version. * If you delete this exception statement from all source
34  * files in the program, then also delete it here.
35  *
36  */
37 
38 #pragma once
39 #include <gtk/gtk.h>
40 #include "remmina_sodium.h"
41 
42 #ifdef HAVE_LIBGCRYPT
43 #include <gcrypt.h>
44 #endif
45 
46 
47 /*
48  * Remmina Preference Loader
49  */
50 
51 G_BEGIN_DECLS
52 
53 enum {
56 };
57 
58 enum {
61 };
62 
63 enum {
69 };
70 
71 enum {
74 };
75 
76 enum {
81 };
82 
83 enum {
88 };
89 
90 /* Remember to add the id 0, 4 and 5 in the remmina pref editor */
91 enum {
92  RM_ENC_MODE_SECRET = 0, /* Using libsecret */
93  RM_ENC_MODE_SODIUM_INTERACTIVE = 1, /* Using libsodium */
94  RM_ENC_MODE_SODIUM_MODERATE = 2, /* Using libsodium */
95  RM_ENC_MODE_SODIUM_SENSITIVE = 3, /* Using libsodium */
96  RM_ENC_MODE_GCRYPT = 4, /* Using GCrypt */
97  RM_ENC_MODE_NONE = 5 /* No encryption */
98 };
99 
100 enum {
102  FLOATING_TOOLBAR_VISIBILITY_INVISIBLE = 1, //"Invisible" corresponds to the "Hidden" option in the drop-down
104 };
105 
106 typedef struct _RemminaColorPref {
107  /* Color palette for VTE terminal */
108  gchar * background;
109  gchar * cursor;
111  gchar * highlight;
113  gchar * colorBD;
114  gchar * foreground;
115  gchar * color0;
116  gchar * color1;
117  gchar * color2;
118  gchar * color3;
119  gchar * color4;
120  gchar * color5;
121  gchar * color6;
122  gchar * color7;
123  gchar * color8;
124  gchar * color9;
125  gchar * color10;
126  gchar * color11;
127  gchar * color12;
128  gchar * color13;
129  gchar * color14;
130  gchar * color15;
132 
133 typedef struct _RemminaPref {
134  /* In RemminaPrefDialog options tab */
135  const gchar * datadir_path;
136  const gchar * remmina_file_name;
137  const gchar * screenshot_path;
139  const gchar * screenshot_name;
140  gboolean save_view_mode;
145  gchar * resolutions;
146  gchar * keystrokes;
147  gboolean confirm_close;
148  /* In RemminaPrefDialog appearance tab */
149  gboolean dark_theme;
152  gboolean always_show_tab;
155  gboolean hide_searchbar;
157  gint tab_mode;
159  const gchar * grab_color;
161  /* In RemminaPrefDialog applet tab */
165  /* In RemminaPrefDialog SSH Option tab */
167  gboolean ssh_parseconfig;
173  /* In RemminaPrefDialog keyboard tab */
174  guint hostkey;
189  /* In RemminaPrefDialog security tab */
191  const gchar * unlock_password;
192  const gchar * unlock_repassword;
194  gboolean lock_connect;
195  gboolean lock_edit;
197  gint enc_mode;
198  gboolean audit;
199  gboolean trust_all;
200  /* In RemminaPrefDialog terminal tab */
201  gchar * vte_font;
204  gint vte_lines;
211  /* In View menu */
212  gboolean hide_toolbar;
215  /* In tray icon */
217  /* Auto */
220  gboolean main_maximize;
223  gchar * expanded_group;
229 
230  /* Crypto */
231  gchar * secret;
232 
233  /* UID */
234  gchar * uid;
235 
237 
238  /* Usage stats */
239  gchar * last_success;
240 
241 } RemminaPref;
242 
243 #define DEFAULT_SSH_PARSECONFIG TRUE
244 #define DEFAULT_SSHTUNNEL_PORT 4732
245 #define DEFAULT_SSH_PORT 22
246 #define DEFAULT_SSH_LOGLEVEL 1
247 #define SSH_SOCKET_TCP_KEEPIDLE 20
248 #define SSH_SOCKET_TCP_KEEPINTVL 10
249 #define SSH_SOCKET_TCP_KEEPCNT 3
250 #define SSH_SOCKET_TCP_USER_TIMEOUT 60000 // 60 seconds
251 
252 extern const gchar *default_resolutions;
253 extern gchar *remmina_pref_file;
254 extern gchar *remmina_colors_file;
256 extern gboolean disabletoolbar;
257 extern gboolean fullscreen;
258 extern gboolean extrahardening;
259 extern gboolean disabletrayicon;
260 
261 void remmina_pref_init(void);
262 gboolean remmina_pref_is_rw(void);
263 gboolean remmina_pref_save(void);
264 
265 void remmina_pref_add_recent(const gchar *protocol, const gchar *server);
266 gchar *remmina_pref_get_recent(const gchar *protocol);
267 void remmina_pref_clear_recent(void);
268 
269 guint *remmina_pref_keymap_get_table(const gchar *keymap);
270 guint remmina_pref_keymap_get_keyval(const gchar *keymap, guint keyval);
271 gchar **remmina_pref_keymap_groups(void);
272 
275 gboolean remmina_pref_get_ssh_parseconfig(void);
277 void remmina_pref_file_load_colors(GKeyFile *gkeyfile, RemminaColorPref *color_pref);
282 
283 void remmina_pref_set_value(const gchar *key, const gchar *value);
284 gchar *remmina_pref_get_value(const gchar *key);
285 gboolean remmina_pref_get_boolean(const gchar *key);
286 
287 G_END_DECLS
guint shortcutkey_fullscreen
Definition: remmina_pref.h:175
gint floating_toolbar_placement
Definition: remmina_pref.h:225
gboolean hide_searchbar
Definition: remmina_pref.h:155
guint vte_shortcutkey_search_text
Definition: remmina_pref.h:210
gboolean remmina_pref_get_boolean(const gchar *key)
guint shortcutkey_minimize
Definition: remmina_pref.h:186
gboolean lock_connect
Definition: remmina_pref.h:194
gint remmina_pref_get_ssh_tcp_keepcnt(void)
void remmina_pref_clear_recent(void)
Definition: remmina_pref.c:999
const gchar * default_resolutions
Definition: remmina_pref.c:58
gboolean vte_system_colors
Definition: remmina_pref.h:203
const gchar * grab_color
Definition: remmina_pref.h:159
guint vte_shortcutkey_increase_font
Definition: remmina_pref.h:208
void remmina_pref_set_value(const gchar *key, const gchar *value)
gint default_action
Definition: remmina_pref.h:141
gchar * keystrokes
Definition: remmina_pref.h:146
guint shortcutkey_dynres
Definition: remmina_pref.h:180
void remmina_pref_init(void)
Definition: remmina_pref.c:220
guint shortcutkey_screenshot
Definition: remmina_pref.h:185
gboolean use_primary_password
Definition: remmina_pref.h:190
guint shortcutkey_prevtab
Definition: remmina_pref.h:177
gboolean ssh_parseconfig
Definition: remmina_pref.h:167
gchar * remmina_pref_get_value(const gchar *key)
gint ssh_tcp_keepintvl
Definition: remmina_pref.h:170
gchar * last_quickconnect_protocol
Definition: remmina_pref.h:228
gint auto_scroll_step
Definition: remmina_pref.h:143
guint vte_shortcutkey_copy
Definition: remmina_pref.h:205
gchar * last_success
Definition: remmina_pref.h:239
guint shortcutkey_autofit
Definition: remmina_pref.h:176
gboolean remmina_pref_is_rw(void)
Definition: remmina_pref.c:780
gchar * secret
Definition: remmina_pref.h:231
guint remmina_pref_keymap_get_keyval(const gchar *keymap, guint keyval)
gchar * highlight_foreground
Definition: remmina_pref.h:112
gint scale_quality
Definition: remmina_pref.h:142
gboolean deny_screenshot_clipboard
Definition: remmina_pref.h:138
gchar * resolutions
Definition: remmina_pref.h:145
guint vte_shortcutkey_select_all
Definition: remmina_pref.h:207
void remmina_pref_file_load_colors(GKeyFile *gkeyfile, RemminaColorPref *color_pref)
Definition: remmina_pref.c:177
gchar * remmina_pref_file
Definition: rcw.c:78
gint main_sort_order
Definition: remmina_pref.h:222
gboolean vte_allow_bold_text
Definition: remmina_pref.h:202
gboolean disable_tray_icon
Definition: remmina_pref.h:164
gboolean lock_view_passwords
Definition: remmina_pref.h:196
gint recent_maximum
Definition: remmina_pref.h:144
struct _RemminaPref RemminaPref
gchar * vte_font
Definition: remmina_pref.h:201
guint shortcutkey_multimon
Definition: remmina_pref.h:182
const gchar * screenshot_path
Definition: remmina_pref.h:137
gint remmina_pref_get_scale_quality(void)
gchar ** remmina_pref_keymap_groups(void)
gint unlock_timeout
Definition: remmina_pref.h:193
gboolean confirm_close
Definition: remmina_pref.h:147
gint toolbar_placement
Definition: remmina_pref.h:226
gboolean extrahardening
Definition: remmina.c:90
gboolean prevent_snap_welcome_message
Definition: remmina_pref.h:227
gchar * expanded_group
Definition: remmina_pref.h:223
guint vte_shortcutkey_decrease_font
Definition: remmina_pref.h:209
gboolean disabletrayicon
Definition: remmina.c:91
const gchar * unlock_password
Definition: remmina_pref.h:191
guint vte_shortcutkey_paste
Definition: remmina_pref.h:206
guint shortcutkey_disconnect
Definition: remmina_pref.h:187
gint ssh_tcp_usrtimeout
Definition: remmina_pref.h:172
gboolean remmina_pref_save(void)
Definition: remmina_pref.c:790
gboolean small_toolbutton
Definition: remmina_pref.h:213
guint shortcutkey_grab
Definition: remmina_pref.h:183
gboolean always_show_tab
Definition: remmina_pref.h:152
gboolean toolbar_pin_down
Definition: remmina_pref.h:224
gint main_sort_column_id
Definition: remmina_pref.h:221
guint shortcutkey_scale
Definition: remmina_pref.h:181
gboolean main_maximize
Definition: remmina_pref.h:220
const gchar * unlock_repassword
Definition: remmina_pref.h:192
gint remmina_pref_get_ssh_tcp_keepintvl(void)
gboolean fullscreen
Definition: remmina.c:89
guint shortcutkey_clipboard
Definition: remmina_pref.h:178
gint view_file_mode
Definition: remmina_pref.h:214
gboolean remmina_pref_get_ssh_parseconfig(void)
guint shortcutkey_nexttab
Definition: remmina_pref.h:179
gboolean applet_hide_count
Definition: remmina_pref.h:163
gboolean list_refresh_workaround
Definition: remmina_pref.h:150
gint ssh_tcp_keepidle
Definition: remmina_pref.h:169
gboolean lock_edit
Definition: remmina_pref.h:195
gboolean hide_toolbar
Definition: remmina_pref.h:212
gint remmina_pref_get_sshtunnel_port(void)
gboolean trust_all
Definition: remmina_pref.h:199
gboolean applet_enable_avahi
Definition: remmina_pref.h:216
const gchar * remmina_file_name
Definition: remmina_pref.h:136
RemminaPref remmina_pref
Definition: rcw.c:79
guint shortcutkey_toolbar
Definition: remmina_pref.h:188
gint remmina_pref_get_ssh_tcp_usrtimeout(void)
gint remmina_pref_get_ssh_tcp_keepidle(void)
gchar * remmina_colors_file
gint ssh_tcp_keepcnt
Definition: remmina_pref.h:171
gboolean applet_new_ontop
Definition: remmina_pref.h:162
const gchar * screenshot_name
Definition: remmina_pref.h:139
gboolean hide_connection_toolbar
Definition: remmina_pref.h:154
gboolean audit
Definition: remmina_pref.h:198
gint sshtunnel_port
Definition: remmina_pref.h:168
const gchar * datadir_path
Definition: remmina_pref.h:135
gboolean disabletoolbar
Definition: remmina.c:88
gchar * remmina_pref_get_recent(const gchar *protocol)
Definition: remmina_pref.c:980
gchar * cursor_foreground
Definition: remmina_pref.h:110
guint * remmina_pref_keymap_get_table(const gchar *keymap)
gboolean always_show_notes
Definition: remmina_pref.h:153
void remmina_pref_add_recent(const gchar *protocol, const gchar *server)
Definition: remmina_pref.c:942
RemminaColorPref color_pref
Definition: remmina_pref.h:236
guint shortcutkey_viewonly
Definition: remmina_pref.h:184
struct _RemminaColorPref RemminaColorPref
gboolean fullscreen_on_auto
Definition: remmina_pref.h:151
gboolean dark_theme
Definition: remmina_pref.h:149
gboolean save_view_mode
Definition: remmina_pref.h:140
gint fullscreen_toolbar_visibility
Definition: remmina_pref.h:158
gint remmina_pref_get_ssh_loglevel(void)
gboolean grab_color_switch
Definition: remmina_pref.h:160