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