Blame client/Windows/wf_channels.c

Packit 1fb8d4
/**
Packit 1fb8d4
 * FreeRDP: A Remote Desktop Protocol Implementation
Packit 1fb8d4
 *
Packit 1fb8d4
 * Copyright 2014 Marc-Andre Moreau <marcandre.moreau@gmail.com>
Packit 1fb8d4
 *
Packit 1fb8d4
 * Licensed under the Apache License, Version 2.0 (the "License");
Packit 1fb8d4
 * you may not use this file except in compliance with the License.
Packit 1fb8d4
 * You may obtain a copy of the License at
Packit 1fb8d4
 *
Packit 1fb8d4
 *     http://www.apache.org/licenses/LICENSE-2.0
Packit 1fb8d4
 *
Packit 1fb8d4
 * Unless required by applicable law or agreed to in writing, software
Packit 1fb8d4
 * distributed under the License is distributed on an "AS IS" BASIS,
Packit 1fb8d4
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Packit 1fb8d4
 * See the License for the specific language governing permissions and
Packit 1fb8d4
 * limitations under the License.
Packit 1fb8d4
 */
Packit 1fb8d4
Packit 1fb8d4
#ifdef HAVE_CONFIG_H
Packit 1fb8d4
#include "config.h"
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit 1fb8d4
#include "wf_channels.h"
Packit 1fb8d4
Packit 1fb8d4
#include "wf_rail.h"
Packit 1fb8d4
#include "wf_cliprdr.h"
Packit 1fb8d4
Packit 1fb8d4
#include <freerdp/gdi/gfx.h>
Packit 1fb8d4
Packit 1fb8d4
#include <freerdp/log.h>
Packit 1fb8d4
#define TAG CLIENT_TAG("windows")
Packit 1fb8d4
Packit 1fb8d4
void wf_OnChannelConnectedEventHandler(void* context,
Packit 1fb8d4
                                       ChannelConnectedEventArgs* e)
Packit 1fb8d4
{
Packit 1fb8d4
	wfContext* wfc = (wfContext*) context;
Packit 1fb8d4
	rdpSettings* settings = wfc->context.settings;
Packit 1fb8d4
Packit 1fb8d4
	if (strcmp(e->name, RDPEI_DVC_CHANNEL_NAME) == 0)
Packit 1fb8d4
	{
Packit 1fb8d4
	}
Packit 1fb8d4
	else if (strcmp(e->name, RDPGFX_DVC_CHANNEL_NAME) == 0)
Packit 1fb8d4
	{
Packit 1fb8d4
		if (!settings->SoftwareGdi)
Packit 1fb8d4
			WLog_WARN(TAG,
Packit 1fb8d4
			          "Channel "RDPGFX_DVC_CHANNEL_NAME" does not support hardware acceleration, using fallback.");
Packit 1fb8d4
Packit 1fb8d4
		gdi_graphics_pipeline_init(wfc->context.gdi, (RdpgfxClientContext*) e->pInterface);
Packit 1fb8d4
	}
Packit 1fb8d4
	else if (strcmp(e->name, RAIL_SVC_CHANNEL_NAME) == 0)
Packit 1fb8d4
	{
Packit 1fb8d4
		wf_rail_init(wfc, (RailClientContext*) e->pInterface);
Packit 1fb8d4
	}
Packit 1fb8d4
	else if (strcmp(e->name, CLIPRDR_SVC_CHANNEL_NAME) == 0)
Packit 1fb8d4
	{
Packit 1fb8d4
		wf_cliprdr_init(wfc, (CliprdrClientContext*) e->pInterface);
Packit 1fb8d4
	}
Packit 1fb8d4
	else if (strcmp(e->name, ENCOMSP_SVC_CHANNEL_NAME) == 0)
Packit 1fb8d4
	{
Packit 1fb8d4
	}
Packit 1fb8d4
}
Packit 1fb8d4
Packit 1fb8d4
void wf_OnChannelDisconnectedEventHandler(void* context,
Packit 1fb8d4
        ChannelDisconnectedEventArgs* e)
Packit 1fb8d4
{
Packit 1fb8d4
	wfContext* wfc = (wfContext*) context;
Packit 1fb8d4
	rdpSettings* settings = wfc->context.settings;
Packit 1fb8d4
Packit 1fb8d4
	if (strcmp(e->name, RDPEI_DVC_CHANNEL_NAME) == 0)
Packit 1fb8d4
	{
Packit 1fb8d4
	}
Packit 1fb8d4
	else if (strcmp(e->name, RDPGFX_DVC_CHANNEL_NAME) == 0)
Packit 1fb8d4
	{
Packit 1fb8d4
		gdi_graphics_pipeline_uninit(wfc->context.gdi,
Packit 1fb8d4
		                             (RdpgfxClientContext*) e->pInterface);
Packit 1fb8d4
	}
Packit 1fb8d4
	else if (strcmp(e->name, RAIL_SVC_CHANNEL_NAME) == 0)
Packit 1fb8d4
	{
Packit 1fb8d4
		wf_rail_uninit(wfc, (RailClientContext*) e->pInterface);
Packit 1fb8d4
	}
Packit 1fb8d4
	else if (strcmp(e->name, CLIPRDR_SVC_CHANNEL_NAME) == 0)
Packit 1fb8d4
	{
Packit 1fb8d4
		wf_cliprdr_uninit(wfc, (CliprdrClientContext*) e->pInterface);
Packit 1fb8d4
	}
Packit 1fb8d4
	else if (strcmp(e->name, ENCOMSP_SVC_CHANNEL_NAME) == 0)
Packit 1fb8d4
	{
Packit 1fb8d4
	}
Packit 1fb8d4
}