Remmina - The GTK+ Remote Desktop Client  v1.4.2
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.
plugin.h
Go to the documentation of this file.
1 /*
2  * Remmina - The GTK+ Remote Desktop Client
3  * Copyright (C) 2010-2011 Vic Lee
4  * Copyright (C) 2014-2015 Antenore Gatta, Fabio Castelli, Giovanni Panozzo
5  * Copyright (C) 2016-2020 Antenore Gatta, Giovanni Panozzo
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  * Boston, MA 02110-1301, USA.
21  *
22  * In addition, as a special exception, the copyright holders give
23  * permission to link the code of portions of this program with the
24  * OpenSSL library under certain conditions as described in each
25  * individual source file, and distribute linked combinations
26  * including the two.
27  * You must obey the GNU General Public License in all respects
28  * for all of the code used other than OpenSSL. * If you modify
29  * file(s) with this exception, you may extend this exception to your
30  * version of the file(s), but you are not obligated to do so. * If you
31  * do not wish to do so, delete this exception statement from your
32  * version. * If you delete this exception statement from all source
33  * files in the program, then also delete it here.
34  *
35  */
36 
37 #pragma once
38 
39 #include <remmina/types.h>
41 
42 G_BEGIN_DECLS
43 
44 typedef enum {
52 
53 typedef struct _RemminaPlugin {
55  const gchar * name;
56  const gchar * description;
57  const gchar * domain;
58  const gchar * version;
60 
61 typedef struct _RemminaProtocolPlugin {
63  const gchar * name;
64  const gchar * description;
65  const gchar * domain;
66  const gchar * version;
67 
68  const gchar * icon_name;
69  const gchar * icon_name_ssh;
74 
75  void (*init)(RemminaProtocolWidget *gp);
76  gboolean (*open_connection)(RemminaProtocolWidget *gp);
77  gboolean (*close_connection)(RemminaProtocolWidget *gp);
78  gboolean (*query_feature)(RemminaProtocolWidget *gp, const RemminaProtocolFeature *feature);
79  void (*call_feature)(RemminaProtocolWidget *gp, const RemminaProtocolFeature *feature);
80  void (*send_keystrokes)(RemminaProtocolWidget *gp, const guint keystrokes[], const gint keylen);
81  gboolean (*get_plugin_screenshot)(RemminaProtocolWidget *gp, RemminaPluginScreenshotData *rpsd);
83 
84 typedef struct _RemminaEntryPlugin {
86  const gchar * name;
87  const gchar * description;
88  const gchar * domain;
89  const gchar * version;
90 
91  void (*entry_func)(void);
93 
94 typedef struct _RemminaFilePlugin {
96  const gchar * name;
97  const gchar * description;
98  const gchar * domain;
99  const gchar * version;
100 
101  gboolean (*import_test_func)(const gchar *from_file);
102  RemminaFile * (*import_func)(const gchar * from_file);
103  gboolean (*export_test_func)(RemminaFile *file);
104  gboolean (*export_func)(RemminaFile *file, const gchar *to_file);
105  const gchar * export_hints;
107 
108 typedef struct _RemminaToolPlugin {
110  const gchar * name;
111  const gchar * description;
112  const gchar * domain;
113  const gchar * version;
114 
115  void (*exec_func)(void);
117 
118 typedef struct _RemminaPrefPlugin {
120  const gchar * name;
121  const gchar * description;
122  const gchar * domain;
123  const gchar * version;
124 
125  const gchar * pref_label;
126  GtkWidget * (*get_pref_body)(void);
128 
129 typedef struct _RemminaSecretPlugin {
131  const gchar * name;
132  const gchar * description;
133  const gchar * domain;
134  const gchar * version;
136 
137  gboolean (*init)(void);
138  gboolean (*is_service_available)(void);
139  void (*store_password)(RemminaFile *remminafile, const gchar *key, const gchar *password);
140  gchar * (*get_password)(RemminaFile * remminafile, const gchar *key);
141  void (*delete_password)(RemminaFile *remminafile, const gchar *key);
143 
144 /* Plugin Service is a struct containing a list of function pointers,
145  * which is passed from Remmina main program to the plugin module
146  * through the plugin entry function remmina_plugin_entry() */
147 typedef struct _RemminaPluginService {
148  gboolean (*register_plugin)(RemminaPlugin *plugin);
149 
150  gint (*protocol_plugin_get_width)(RemminaProtocolWidget *gp);
151  void (*protocol_plugin_set_width)(RemminaProtocolWidget *gp, gint width);
152  gint (*protocol_plugin_get_height)(RemminaProtocolWidget *gp);
153  void (*protocol_plugin_set_height)(RemminaProtocolWidget *gp, gint height);
155  gboolean (*protocol_plugin_get_expand)(RemminaProtocolWidget *gp);
156  void (*protocol_plugin_set_expand)(RemminaProtocolWidget *gp, gboolean expand);
157  gboolean (*protocol_plugin_has_error)(RemminaProtocolWidget *gp);
158  void (*protocol_plugin_set_error)(RemminaProtocolWidget *gp, const gchar *fmt, ...);
159  gboolean (*protocol_plugin_is_closed)(RemminaProtocolWidget *gp);
160  RemminaFile * (*protocol_plugin_get_file)(RemminaProtocolWidget * gp);
161  void (*protocol_plugin_emit_signal)(RemminaProtocolWidget *gp, const gchar *signal_name);
162  void (*protocol_plugin_register_hostkey)(RemminaProtocolWidget *gp, GtkWidget *widget);
163  gchar * (*protocol_plugin_start_direct_tunnel)(RemminaProtocolWidget * gp, gint default_port, gboolean port_plus);
164  gboolean (*protocol_plugin_start_reverse_tunnel)(RemminaProtocolWidget *gp, gint local_port);
165  gboolean (*protocol_plugin_start_xport_tunnel)(RemminaProtocolWidget *gp, RemminaXPortTunnelInitFunc init_func);
166  void (*protocol_plugin_set_display)(RemminaProtocolWidget *gp, gint display);
167  void (*protocol_plugin_signal_connection_closed)(RemminaProtocolWidget *gp);
168  void (*protocol_plugin_signal_connection_opened)(RemminaProtocolWidget *gp);
169  void (*protocol_plugin_update_align)(RemminaProtocolWidget *gp);
170  void (*protocol_plugin_unlock_dynres)(RemminaProtocolWidget *gp);
171  void (*protocol_plugin_desktop_resize)(RemminaProtocolWidget *gp);
172  gint (*protocol_plugin_init_auth)(RemminaProtocolWidget *gp, RemminaMessagePanelFlags pflags, const gchar *title, const gchar *default_username, const gchar *default_password, const gchar *default_domain, const gchar *password_prompt);
173  gint (*protocol_plugin_init_certificate)(RemminaProtocolWidget *gp, const gchar *subject, const gchar *issuer, const gchar *fingerprint);
174  gint (*protocol_plugin_changed_certificate)(RemminaProtocolWidget *gp, const gchar *subject, const gchar *issuer, const gchar *new_fingerprint, const gchar *old_fingerprint);
175  gchar * (*protocol_plugin_init_get_username)(RemminaProtocolWidget * gp);
176  gchar * (*protocol_plugin_init_get_password)(RemminaProtocolWidget * gp);
177  gchar * (*protocol_plugin_init_get_domain)(RemminaProtocolWidget * gp);
178  gboolean (*protocol_plugin_init_get_savepassword)(RemminaProtocolWidget *gp);
179  gint (*protocol_plugin_init_authx509)(RemminaProtocolWidget *gp);
180  gchar * (*protocol_plugin_init_get_cacert)(RemminaProtocolWidget * gp);
181  gchar * (*protocol_plugin_init_get_cacrl)(RemminaProtocolWidget * gp);
182  gchar * (*protocol_plugin_init_get_clientcert)(RemminaProtocolWidget * gp);
183  gchar * (*protocol_plugin_init_get_clientkey)(RemminaProtocolWidget * gp);
184  void (*protocol_plugin_init_save_cred)(RemminaProtocolWidget *gp);
185  void (*protocol_plugin_init_show_listen)(RemminaProtocolWidget *gp, gint port);
186  void (*protocol_plugin_init_show_retry)(RemminaProtocolWidget *gp);
187  void (*protocol_plugin_init_show)(RemminaProtocolWidget *gp);
188  void (*protocol_plugin_init_hide)(RemminaProtocolWidget *gp);
189  gboolean (*protocol_plugin_ssh_exec)(RemminaProtocolWidget *gp, gboolean wait, const gchar *fmt, ...);
190  void (*protocol_plugin_chat_open)(RemminaProtocolWidget *gp, const gchar *name, void (*on_send)(RemminaProtocolWidget *gp, const gchar *text), void (*on_destroy)(RemminaProtocolWidget *gp));
191  void (*protocol_plugin_chat_close)(RemminaProtocolWidget *gp);
192  void (*protocol_plugin_chat_receive)(RemminaProtocolWidget *gp, const gchar *text);
193  void (*protocol_plugin_send_keys_signals)(GtkWidget *widget, const guint *keyvals, int length, GdkEventType action);
194 
195  gchar * (*file_get_user_datadir)(void);
196 
197  RemminaFile * (*file_new)(void);
198  const gchar * (*file_get_path)(RemminaFile * remminafile);
199  void (*file_set_string)(RemminaFile *remminafile, const gchar *setting, const gchar *value);
200  const gchar * (*file_get_string)(RemminaFile * remminafile, const gchar *setting);
201  gchar * (*file_get_secret)(RemminaFile * remminafile, const gchar *setting);
202  void (*file_set_int)(RemminaFile *remminafile, const gchar *setting, gint value);
203  gint (*file_get_int)(RemminaFile *remminafile, const gchar *setting, gint default_value);
204  void (*file_unsave_passwords)(RemminaFile *remminafile);
205 
206  void (*pref_set_value)(const gchar *key, const gchar *value);
207  gchar * (*pref_get_value)(const gchar * key);
208  gint (*pref_get_scale_quality)(void);
209  gint (*pref_get_sshtunnel_port)(void);
210  gint (*pref_get_ssh_loglevel)(void);
211  gboolean (*pref_get_ssh_parseconfig)(void);
212  guint (*pref_keymap_get_keyval)(const gchar *keymap, guint keyval);
213 
214  void (*debug)(const gchar *fmt, ...);
215  void (*log_print)(const gchar *text);
216  void (*log_printf)(const gchar *fmt, ...);
217 
218  void (*ui_register)(GtkWidget *widget);
219 
220  GtkWidget * (*open_connection)(RemminaFile * remminafile, GCallback disconnect_cb, gpointer data, guint *handler);
221  void (*get_server_port)(const gchar *server, gint defaultport, gchar **host, gint *port);
222  gboolean (*is_main_thread)(void);
223  gboolean (*gtksocket_available)(void);
224  gint (*get_profile_remote_width)(RemminaProtocolWidget *gp);
225  gint (*get_profile_remote_height)(RemminaProtocolWidget *gp);
227 
228 /* "Prototype" of the plugin entry function */
229 typedef gboolean (*RemminaPluginEntryFunc) (RemminaPluginService *service);
230 
231 G_END_DECLS
RemminaPluginType type
Definition: plugin.h:130
const gchar * version
Definition: plugin.h:113
RemminaPluginType type
Definition: plugin.h:119
struct _RemminaPluginService RemminaPluginService
struct _RemminaPrefPlugin RemminaPrefPlugin
typedefG_BEGIN_DECLS struct _RemminaFile RemminaFile
Definition: types.h:41
RemminaPluginType type
Definition: plugin.h:54
const gchar * export_hints
Definition: plugin.h:105
const gchar * version
Definition: plugin.h:89
RemminaProtocolSSHSetting ssh_setting
Definition: plugin.h:72
struct _RemminaProtocolPlugin RemminaProtocolPlugin
const gchar * version
Definition: plugin.h:134
const RemminaProtocolFeature * features
Definition: plugin.h:73
const gchar * domain
Definition: plugin.h:57
const gchar * domain
Definition: plugin.h:133
const gchar * domain
Definition: plugin.h:88
const gchar * domain
Definition: plugin.h:122
RemminaScaleMode remmina_protocol_widget_get_current_scale_mode(RemminaProtocolWidget *gp)
const gchar * domain
Definition: plugin.h:98
const gchar * name
Definition: plugin.h:86
const gchar * description
Definition: plugin.h:56
const gchar * version
Definition: plugin.h:58
const gchar * description
Definition: plugin.h:87
Definition: plugin.h:84
struct _RemminaToolPlugin RemminaToolPlugin
const gchar * icon_name_ssh
Definition: plugin.h:69
RemminaMessagePanelFlags
Definition: types.h:131
const gchar * description
Definition: plugin.h:64
const gchar * description
Definition: plugin.h:132
const gchar * name
Definition: plugin.h:131
const gchar * domain
Definition: plugin.h:112
const gchar * description
Definition: plugin.h:121
RemminaProtocolSSHSetting
Definition: types.h:103
const gchar * pref_label
Definition: plugin.h:125
const gchar * name
Definition: plugin.h:96
const RemminaProtocolSetting * basic_settings
Definition: plugin.h:70
const gchar * description
Definition: plugin.h:111
const gchar * version
Definition: plugin.h:99
RemminaPluginType type
Definition: plugin.h:62
const gchar * name
Definition: plugin.h:110
gboolean(* RemminaPluginEntryFunc)(RemminaPluginService *service)
Definition: plugin.h:229
RemminaScaleMode
Definition: types.h:117
struct _RemminaSecretPlugin RemminaSecretPlugin
RemminaPluginType type
Definition: plugin.h:95
const gchar * version
Definition: plugin.h:123
const gchar * description
Definition: plugin.h:97
const gchar * name
Definition: plugin.h:120
const gchar * version
Definition: plugin.h:66
const gchar * name
Definition: plugin.h:63
RemminaPluginType type
Definition: plugin.h:85
const RemminaProtocolSetting * advanced_settings
Definition: plugin.h:71
RemminaPluginType
Definition: plugin.h:44
struct _RemminaFilePlugin RemminaFilePlugin
struct _RemminaEntryPlugin RemminaEntryPlugin
struct _RemminaPlugin RemminaPlugin
const gchar * icon_name
Definition: plugin.h:68
RemminaPluginType type
Definition: plugin.h:109
gboolean(* RemminaXPortTunnelInitFunc)(RemminaProtocolWidget *gp, gint remotedisplay, const gchar *server, gint port)
Definition: types.h:76
const gchar * domain
Definition: plugin.h:65
const gchar * name
Definition: plugin.h:55