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.c
Go to the documentation of this file.
1 /*
2  * Remmina - The GTK+ Remote Desktop Client
3  * Copyright (C) 2010 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 #include "plugin_config.h"
38 
39 #include "common/remmina_plugin.h"
40 
41 #include <gtk/gtkx.h>
42 #include <gdk/gdkx.h>
43 
45 
47 {
48  TRACE_CALL(__func__);
49  remmina_plugin_service->debug("[%s] Plugin init", PLUGIN_NAME);
50 }
51 
53 {
54  TRACE_CALL(__func__);
55  remmina_plugin_service->debug("[%s] Plugin open connection", PLUGIN_NAME);
56 
57  GtkDialog *dialog;
58  dialog = GTK_DIALOG(gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL | GTK_DIALOG_USE_HEADER_BAR,
59  GTK_MESSAGE_INFO, GTK_BUTTONS_OK, PLUGIN_DESCRIPTION));
60  gtk_dialog_run(dialog);
61  gtk_widget_destroy(GTK_WIDGET(dialog));
62  return FALSE;
63 }
64 
66 {
67  TRACE_CALL(__func__);
68  remmina_plugin_service->debug("[%s] Plugin close connection", PLUGIN_NAME);
69  remmina_plugin_service->protocol_plugin_emit_signal(gp, "disconnect");
70  return FALSE;
71 }
72 
73 /* Array of RemminaProtocolSetting for basic settings.
74  * Each item is composed by:
75  * a) RemminaProtocolSettingType for setting type
76  * b) Setting name
77  * c) Setting description
78  * d) Compact disposition
79  * e) Values for REMMINA_PROTOCOL_SETTING_TYPE_SELECT or REMMINA_PROTOCOL_SETTING_TYPE_COMBO
80  * f) Setting Tooltip
81  */
83 {
84  { REMMINA_PROTOCOL_SETTING_TYPE_END, NULL, NULL, FALSE, NULL, NULL }
85 };
86 
87 /* Protocol plugin definition and features */
90  PLUGIN_NAME, // Name
91  PLUGIN_DESCRIPTION, // Description
92  GETTEXT_PACKAGE, // Translation domain
93  PLUGIN_VERSION, // Version number
94  PLUGIN_APPICON, // Icon for normal connection
95  PLUGIN_APPICON, // Icon for SSH connection
96  remmina_plugin_tool_basic_settings, // Array for basic settings
97  NULL, // Array for advanced settings
98  REMMINA_PROTOCOL_SSH_SETTING_NONE, // SSH settings type
99  NULL, // Array for available features
100  remmina_plugin_tool_init, // Plugin initialization
101  remmina_plugin_tool_open_connection, // Plugin open connection
102  remmina_plugin_tool_close_connection, // Plugin close connection
103  NULL, // Query for available features
104  NULL, // Call a feature
105  NULL, // Send a keystroke
106  NULL // No screenshot support available
107 };
108 
109 G_MODULE_EXPORT gboolean remmina_plugin_entry(RemminaPluginService *service)
110 {
111  TRACE_CALL(__func__);
112  remmina_plugin_service = service;
113 
114  bindtextdomain(GETTEXT_PACKAGE, REMMINA_RUNTIME_LOCALEDIR);
115  bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
116 
117  if (!service->register_plugin((RemminaPlugin*)&remmina_plugin)) {
118  return FALSE;
119  }
120 
121  return TRUE;
122 }
void(* debug)(const gchar *fmt,...)
Definition: plugin.h:214
static const RemminaProtocolSetting remmina_plugin_tool_basic_settings[]
Definition: plugin.c:82
static void remmina_plugin_tool_init(RemminaProtocolWidget *gp)
Definition: plugin.c:46
gboolean(* register_plugin)(RemminaPlugin *plugin)
Definition: plugin.h:148
static gboolean remmina_plugin_tool_open_connection(RemminaProtocolWidget *gp)
Definition: plugin.c:52
G_MODULE_EXPORT gboolean remmina_plugin_entry(RemminaPluginService *service)
Definition: plugin.c:109
static RemminaProtocolPlugin remmina_plugin
Definition: plugin.c:88
static gboolean remmina_plugin_tool_close_connection(RemminaProtocolWidget *gp)
Definition: plugin.c:65
void(* protocol_plugin_emit_signal)(RemminaProtocolWidget *gp, const gchar *signal_name)
Definition: plugin.h:161
static RemminaPluginService * remmina_plugin_service
Definition: plugin.c:44