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.
remmina_protocol_widget.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-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 "rcw.h"
40 #include "remmina_file.h"
41 #include "remmina_ssh.h"
42 
43 G_BEGIN_DECLS
44 
45 #define REMMINA_PROTOCOL_FEATURE_TOOL_SSH -1
46 #define REMMINA_PROTOCOL_FEATURE_TOOL_SFTP -2
47 
48 #define REMMINA_TYPE_PROTOCOL_WIDGET (remmina_protocol_widget_get_type())
49 #define REMMINA_PROTOCOL_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), REMMINA_TYPE_PROTOCOL_WIDGET, RemminaProtocolWidget))
50 #define REMMINA_PROTOCOL_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), REMMINA_TYPE_PROTOCOL_WIDGET, RemminaProtocolWidgetClass))
51 #define REMMINA_IS_PROTOCOL_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), REMMINA_TYPE_PROTOCOL_WIDGET))
52 #define REMMINA_IS_PROTOCOL_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), REMMINA_TYPE_PROTOCOL_WIDGET))
53 #define REMMINA_PROTOCOL_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), REMMINA_TYPE_PROTOCOL_WIDGET, RemminaProtocolWidgetClass))
54 
56 
58  GtkEventBox event_box;
61 };
62 
64  GtkEventBoxClass parent_class;
65 
66  void (*connect)(RemminaProtocolWidget *gp);
67  void (*disconnect)(RemminaProtocolWidget *gp);
71 };
72 
74 G_GNUC_CONST;
75 
76 GtkWidget *remmina_protocol_widget_new(void);
78 
85 
92 void remmina_protocol_widget_set_error(RemminaProtocolWidget *gp, const gchar *fmt, ...);
95 
109 /* Provide thread-safe way to emit signals */
110 void remmina_protocol_widget_emit_signal(RemminaProtocolWidget *gp, const gchar *signal_name);
112 
113 typedef gboolean (*RemminaHostkeyFunc)(RemminaProtocolWidget *gp, guint keyval, gboolean release);
115 
116 gboolean remmina_protocol_widget_ssh_exec(RemminaProtocolWidget *gp, gboolean wait, const gchar *fmt, ...);
117 
118 /* Start a SSH tunnel if it’s enabled. Returns a newly allocated string indicating:
119  * 1. The actual destination (host:port) if SSH tunnel is disable
120  * 2. The tunnel local destination (127.0.0.1:port) if SSH tunnel is enabled
121  */
122 gchar *remmina_protocol_widget_start_direct_tunnel(RemminaProtocolWidget *gp, gint default_port, gboolean port_plus);
123 
127 
128 /* Extension for remmina_protocol_widget_panel_authuserpwd() not currently exported to plugins */
129 gint remmina_protocol_widget_panel_authuserpwd_ssh_tunnel(RemminaProtocolWidget *gp, gboolean want_domain, gboolean allow_password_saving);
130 
131 /* Dialog panel API used by the plugins */
132 
133 gint remmina_protocol_widget_panel_auth(RemminaProtocolWidget *gp, RemminaMessagePanelFlags pflags, const gchar *title, const gchar *default_username, const gchar *default_password, const gchar *default_domain, const gchar *password_prompt);
134 gint remmina_protocol_widget_panel_new_certificate(RemminaProtocolWidget *gp, const gchar *subject, const gchar *issuer, const gchar *fingerprint);
135 gint remmina_protocol_widget_panel_changed_certificate(RemminaProtocolWidget *gp, const gchar *subject, const gchar *issuer, const gchar *new_fingerprint, const gchar *old_fingerprint);
137 
144 
146 
155 
156 void remmina_protocol_widget_chat_open(RemminaProtocolWidget *gp, const gchar *name, void (*on_send)(RemminaProtocolWidget *gp, const gchar *text), void (*on_destroy)(RemminaProtocolWidget *gp));
159 void remmina_protocol_widget_send_keys_signals(GtkWidget *widget, const guint *keyvals, int keyvals_length, GdkEventType action);
160 /* Check if the plugin accepts keystrokes */
162 /* Send to the plugin some keystrokes */
164 /* Take screenshot of plugin */
166 
168 
169 /* Functions to support execution of GTK code on master thread */
170 RemminaMessagePanel *remmina_protocol_widget_mpprogress(RemminaConnectionObject *cnnobj, const gchar *msg, RemminaMessagePanelCallback response_callback, gpointer response_callback_data);
172 
173 
174 G_END_DECLS
gchar * remmina_protocol_widget_start_direct_tunnel(RemminaProtocolWidget *gp, gint default_port, gboolean port_plus)
Start an SSH tunnel if possible and return the host:port string.
static gboolean desktop_resize(gpointer data)
gint remmina_protocol_widget_panel_new_certificate(RemminaProtocolWidget *gp, const gchar *subject, const gchar *issuer, const gchar *fingerprint)
void remmina_protocol_widget_grab_focus(RemminaProtocolWidget *gp)
void remmina_protocol_widget_signal_connection_closed(RemminaProtocolWidget *gp)
static gboolean unlock_dynres(gpointer data)
gboolean remmina_protocol_widget_get_savepassword(RemminaProtocolWidget *gp)
gchar * remmina_protocol_widget_get_clientkey(RemminaProtocolWidget *gp)
void remmina_protocol_widget_chat_close(RemminaProtocolWidget *gp)
typedefG_BEGIN_DECLS struct _RemminaFile RemminaFile
Definition: types.h:41
RemminaScaleMode remmina_protocol_widget_get_current_scale_mode(RemminaProtocolWidget *gp)
gint remmina_protocol_widget_panel_authuserpwd_ssh_tunnel(RemminaProtocolWidget *gp, gboolean want_domain, gboolean allow_password_saving)
void remmina_protocol_widget_chat_receive(RemminaProtocolWidget *gp, const gchar *text)
gboolean remmina_protocol_widget_ssh_exec(RemminaProtocolWidget *gp, gboolean wait, const gchar *fmt,...)
void remmina_protocol_widget_panel_show(RemminaProtocolWidget *gp)
void remmina_protocol_widget_save_cred(RemminaProtocolWidget *gp)
gboolean remmina_protocol_widget_is_closed(RemminaProtocolWidget *gp)
gboolean remmina_protocol_widget_start_reverse_tunnel(RemminaProtocolWidget *gp, gint local_port)
gboolean remmina_protocol_widget_query_feature_by_ref(RemminaProtocolWidget *gp, const RemminaProtocolFeature *feature)
gint remmina_protocol_widget_get_height(RemminaProtocolWidget *gp)
void remmina_protocol_widget_register_hostkey(RemminaProtocolWidget *gp, GtkWidget *widget)
void remmina_protocol_widget_mpdestroy(RemminaConnectionObject *cnnobj, RemminaMessagePanel *mp)
gchar * remmina_protocol_widget_get_cacert(RemminaProtocolWidget *gp)
GtkWidget * remmina_protocol_widget_new(void)
RemminaMessagePanelFlags
Definition: types.h:131
void remmina_protocol_widget_setup(RemminaProtocolWidget *gp, RemminaFile *remminafile, RemminaConnectionObject *cnnobj)
void remmina_protocol_widget_send_keystrokes(RemminaProtocolWidget *gp, GtkMenuItem *widget)
Send to the plugin some keystrokes.
gboolean remmina_protocol_widget_plugin_receives_keystrokes(RemminaProtocolWidget *gp)
Check if the plugin accepts keystrokes.
void remmina_protocol_widget_panel_destroy(RemminaProtocolWidget *gp)
gboolean remmina_protocol_widget_start_xport_tunnel(RemminaProtocolWidget *gp, RemminaXPortTunnelInitFunc init_func)
void remmina_protocol_widget_set_current_scale_mode(RemminaProtocolWidget *gp, RemminaScaleMode scalemode)
void remmina_protocol_widget_desktop_resize(RemminaProtocolWidget *gp)
RemminaProtocolWidgetPriv * priv
gboolean remmina_protocol_widget_has_error(RemminaProtocolWidget *gp)
gboolean(* RemminaHostkeyFunc)(RemminaProtocolWidget *gp, guint keyval, gboolean release)
void remmina_protocol_widget_panel_show_listen(RemminaProtocolWidget *gp, gint port)
gboolean remmina_protocol_widget_plugin_screenshot(RemminaProtocolWidget *gp, RemminaPluginScreenshotData *rpsd)
RemminaConnectionObject * cnnobj
gchar * remmina_protocol_widget_get_cacrl(RemminaProtocolWidget *gp)
const gchar * remmina_protocol_widget_get_error_message(RemminaProtocolWidget *gp)
void remmina_protocol_widget_set_height(RemminaProtocolWidget *gp, gint height)
gint remmina_protocol_widget_panel_question_yesno(RemminaProtocolWidget *gp, const char *msg)
gint remmina_protocol_widget_get_profile_remote_height(RemminaProtocolWidget *gp)
void remmina_protocol_widget_panel_hide(RemminaProtocolWidget *gp)
gchar * remmina_protocol_widget_get_clientcert(RemminaProtocolWidget *gp)
RemminaProtocolFeatureType
Definition: types.h:43
gchar * remmina_protocol_widget_get_password(RemminaProtocolWidget *gp)
void(* RemminaMessagePanelCallback)(void *user_data, int button)
GType remmina_protocol_widget_get_type(void) G_GNUC_CONST
void remmina_protocol_widget_set_expand(RemminaProtocolWidget *gp, gboolean expand)
RemminaScaleMode
Definition: types.h:117
void remmina_protocol_widget_signal_connection_opened(RemminaProtocolWidget *gp)
void remmina_protocol_widget_emit_signal(RemminaProtocolWidget *gp, const gchar *signal_name)
gint remmina_protocol_widget_panel_authx509(RemminaProtocolWidget *gp)
void remmina_protocol_widget_close_connection(RemminaProtocolWidget *gp)
gchar * remmina_protocol_widget_get_domain(RemminaProtocolWidget *gp)
gchar * remmina_protocol_widget_get_username(RemminaProtocolWidget *gp)
void remmina_protocol_widget_unlock_dynres(RemminaProtocolWidget *gp)
void remmina_protocol_widget_set_display(RemminaProtocolWidget *gp, gint display)
RemminaMessagePanel * remmina_protocol_widget_mpprogress(RemminaConnectionObject *cnnobj, const gchar *msg, RemminaMessagePanelCallback response_callback, gpointer response_callback_data)
void remmina_protocol_widget_call_feature_by_ref(RemminaProtocolWidget *gp, const RemminaProtocolFeature *feature)
void remmina_protocol_widget_panel_show_retry(RemminaProtocolWidget *gp)
void remmina_protocol_widget_set_error(RemminaProtocolWidget *gp, const gchar *fmt,...)
static gboolean update_align(gpointer data)
void remmina_protocol_widget_update_remote_resolution(RemminaProtocolWidget *gp)
void remmina_protocol_widget_send_keys_signals(GtkWidget *widget, const guint *keyvals, int keyvals_length, GdkEventType action)
void remmina_protocol_widget_call_feature_by_type(RemminaProtocolWidget *gp, RemminaProtocolFeatureType type, gint id)
void remmina_protocol_widget_set_hostkey_func(RemminaProtocolWidget *gp, RemminaHostkeyFunc func)
gint remmina_protocol_widget_get_width(RemminaProtocolWidget *gp)
void remmina_protocol_widget_update_align(RemminaProtocolWidget *gp)
gint remmina_protocol_widget_panel_auth(RemminaProtocolWidget *gp, RemminaMessagePanelFlags pflags, const gchar *title, const gchar *default_username, const gchar *default_password, const gchar *default_domain, const gchar *password_prompt)
gboolean remmina_protocol_widget_query_feature_by_type(RemminaProtocolWidget *gp, RemminaProtocolFeatureType type)
void remmina_protocol_widget_chat_open(RemminaProtocolWidget *gp, const gchar *name, void(*on_send)(RemminaProtocolWidget *gp, const gchar *text), void(*on_destroy)(RemminaProtocolWidget *gp))
const RemminaProtocolFeature * remmina_protocol_widget_get_features(RemminaProtocolWidget *gp)
gint remmina_protocol_widget_panel_changed_certificate(RemminaProtocolWidget *gp, const gchar *subject, const gchar *issuer, const gchar *new_fingerprint, const gchar *old_fingerprint)
gboolean(* RemminaXPortTunnelInitFunc)(RemminaProtocolWidget *gp, gint remotedisplay, const gchar *server, gint port)
Definition: types.h:76
gboolean remmina_protocol_widget_get_expand(RemminaProtocolWidget *gp)
RemminaFile * remmina_protocol_widget_get_file(RemminaProtocolWidget *gp)
void remmina_protocol_widget_set_width(RemminaProtocolWidget *gp, gint width)
gint remmina_protocol_widget_get_profile_remote_width(RemminaProtocolWidget *gp)
void remmina_protocol_widget_open_connection(RemminaProtocolWidget *gp)