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.
rdp_channels.c
Go to the documentation of this file.
1 /*
2  * Remmina - The GTK+ Remote Desktop Client
3  * Copyright (C) 2012-2012 Jean-Louis Dupond
4  * Copyright (C) 2016-2020 Antenore Gatta, Giovanni Panozzo
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  *
21  * In addition, as a special exception, the copyright holders give
22  * permission to link the code of portions of this program with the
23  * OpenSSL library under certain conditions as described in each
24  * individual source file, and distribute linked combinations
25  * including the two.
26  * You must obey the GNU General Public License in all respects
27  * for all of the code used other than OpenSSL. * If you modify
28  * file(s) with this exception, you may extend this exception to your
29  * version of the file(s), but you are not obligated to do so. * If you
30  * do not wish to do so, delete this exception statement from your
31  * version. * If you delete this exception statement from all source
32  * files in the program, then also delete it here.
33  *
34  */
35 
36 #include "rdp_plugin.h"
37 #include "rdp_cliprdr.h"
38 #include "rdp_channels.h"
39 #include "rdp_event.h"
40 
41 #include <freerdp/freerdp.h>
42 #include <freerdp/channels/channels.h>
43 #include <freerdp/client/cliprdr.h>
44 #include <freerdp/gdi/gfx.h>
45 
46 void remmina_rdp_OnChannelConnectedEventHandler(rdpContext* context, ChannelConnectedEventArgs* e)
47 {
48  TRACE_CALL(__func__);
49 
50  rfContext* rfi = (rfContext*)context;
51 
52  if (g_strcmp0(e->name, RDPEI_DVC_CHANNEL_NAME) == 0) {
53  g_print("Unimplemented: channel %s connected but we can’t use it\n", e->name);
54  // xfc->rdpei = (RdpeiClientContext*) e->pInterface;
55  }else if (g_strcmp0(e->name, TSMF_DVC_CHANNEL_NAME) == 0) {
56  g_print("Unimplemented: channel %s connected but we can’t use it\n", e->name);
57  // xf_tsmf_init(xfc, (TsmfClientContext*) e->pInterface);
58  }else if (g_strcmp0(e->name, RDPGFX_DVC_CHANNEL_NAME) == 0) {
59  if (rfi->settings->SoftwareGdi) {
60  rfi->rdpgfxchan = TRUE;
61  gdi_graphics_pipeline_init(context->gdi, (RdpgfxClientContext*) e->pInterface);
62  }
63  else
64  g_print("Unimplemented: channel %s connected but libfreerdp is in HardwareGdi mode\n", e->name);
65  }else if (g_strcmp0(e->name, RAIL_SVC_CHANNEL_NAME) == 0) {
66  g_print("Unimplemented: channel %s connected but we can’t use it\n", e->name);
67  // xf_rail_init(xfc, (RailClientContext*) e->pInterface);
68  }else if (g_strcmp0(e->name, CLIPRDR_SVC_CHANNEL_NAME) == 0) {
69  remmina_rdp_cliprdr_init( rfi, (CliprdrClientContext*)e->pInterface);
70  }else if (g_strcmp0(e->name, ENCOMSP_SVC_CHANNEL_NAME) == 0) {
71  g_print("Unimplemented: channel %s connected but we can’t use it\n", e->name);
72  // xf_encomsp_init(xfc, (EncomspClientContext*) e->pInterface);
73  }else if (g_strcmp0(e->name, DISP_DVC_CHANNEL_NAME) == 0) {
74  // "disp" channel connected, save its context pointer
75  rfi->dispcontext = (DispClientContext*)e->pInterface;
76  // Notify rcw to unlock dynres capability
78  // Send monitor layout message here to ask for resize of remote desktop now
81  }
82  }remmina_plugin_service->debug("Channel %s has been opened", e->name);
83 }
84 
85 void remmina_rdp_OnChannelDisconnectedEventHandler(rdpContext* context, ChannelConnectedEventArgs* e)
86 {
87  TRACE_CALL(__func__);
88  rfContext* rfi = (rfContext*)context;
89 
90  if (strcmp(e->name, RDPGFX_DVC_CHANNEL_NAME) == 0) {
91  if (rfi->settings->SoftwareGdi)
92  gdi_graphics_pipeline_uninit(context->gdi, (RdpgfxClientContext*) e->pInterface);
93  }
94  remmina_plugin_service->debug("Channel %s has been closed", e->name);
95 
96 }
void(* debug)(const gchar *fmt,...)
Definition: plugin.h:214
void remmina_rdp_OnChannelDisconnectedEventHandler(rdpContext *context, ChannelConnectedEventArgs *e)
Definition: rdp_channels.c:85
void remmina_rdp_cliprdr_init(rfContext *rfi, CliprdrClientContext *cliprdr)
Definition: rdp_cliprdr.c:826
gboolean rdpgfxchan
Definition: rdp_plugin.h:266
RemminaProtocolWidget * protocol_widget
Definition: rdp_plugin.h:247
void(* protocol_plugin_unlock_dynres)(RemminaProtocolWidget *gp)
Definition: plugin.h:170
static RemminaPluginService * remmina_plugin_service
void remmina_rdp_event_send_delayed_monitor_layout(RemminaProtocolWidget *gp)
Definition: rdp_event.c:381
RemminaScaleMode scale
Definition: rdp_plugin.h:254
DispClientContext * dispcontext
Definition: rdp_plugin.h:259
rdpSettings * settings
Definition: rdp_plugin.h:250
void remmina_rdp_OnChannelConnectedEventHandler(rdpContext *context, ChannelConnectedEventArgs *e)
Definition: rdp_channels.c:46