summaryrefslogtreecommitdiffstats
path: root/include/freerdp/server/gfxredir.h
blob: 9e10cdf99010aabecd2d3db31bb88a747a843338 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/**
 * FreeRDP: A Remote Desktop Protocol Implementation
 * RDPXXXX Remote App Graphics Redirection Virtual Channel Extension
 *
 * Copyright 2020 Microsoft
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *	 http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef FREERDP_CHANNEL_GFXREDIR_SERVER_GFXREDIR_H
#define FREERDP_CHANNEL_GFXREDIR_SERVER_GFXREDIR_H

#include <freerdp/channels/gfxredir.h>

#include <freerdp/api.h>
#include <freerdp/types.h>

#ifdef __cplusplus
extern "C"
{
#endif

	typedef struct s_gfxredir_server_private GfxRedirServerPrivate;
	typedef struct s_gfxredir_server_context GfxRedirServerContext;

	typedef UINT (*psGfxRedirOpen)(GfxRedirServerContext* context);
	typedef UINT (*psGfxRedirClose)(GfxRedirServerContext* context);

	typedef UINT (*psGfxRedirError)(GfxRedirServerContext* context,
	                                const GFXREDIR_ERROR_PDU* error);

	typedef UINT (*psGfxRedirGraphicsRedirectionLegacyCaps)(
	    GfxRedirServerContext* context, const GFXREDIR_LEGACY_CAPS_PDU* graphicsCaps);

	typedef UINT (*psGfxRedirGraphicsRedirectionCapsAdvertise)(
	    GfxRedirServerContext* context, const GFXREDIR_CAPS_ADVERTISE_PDU* graphicsCapsAdvertise);
	typedef UINT (*psGfxRedirGraphicsRedirectionCapsConfirm)(
	    GfxRedirServerContext* context, const GFXREDIR_CAPS_CONFIRM_PDU* graphicsCapsConfirm);

	typedef UINT (*psGfxRedirOpenPool)(GfxRedirServerContext* context,
	                                   const GFXREDIR_OPEN_POOL_PDU* openPool);
	typedef UINT (*psGfxRedirClosePool)(GfxRedirServerContext* context,
	                                    const GFXREDIR_CLOSE_POOL_PDU* closePool);

	typedef UINT (*psGfxRedirCreateBuffer)(GfxRedirServerContext* context,
	                                       const GFXREDIR_CREATE_BUFFER_PDU* createBuffer);
	typedef UINT (*psGfxRedirDestroyBuffer)(GfxRedirServerContext* context,
	                                        const GFXREDIR_DESTROY_BUFFER_PDU* destroyBuffer);

	typedef UINT (*psGfxRedirPresentBuffer)(GfxRedirServerContext* context,
	                                        const GFXREDIR_PRESENT_BUFFER_PDU* presentBuffer);
	typedef UINT (*psGfxRedirPresentBufferAck)(
	    GfxRedirServerContext* context, const GFXREDIR_PRESENT_BUFFER_ACK_PDU* presentBufferAck);

	struct s_gfxredir_server_context
	{
		void* custom;
		HANDLE vcm;

		psGfxRedirOpen Open;
		psGfxRedirClose Close;

		psGfxRedirError Error;

		psGfxRedirGraphicsRedirectionLegacyCaps GraphicsRedirectionLegacyCaps;

		psGfxRedirGraphicsRedirectionCapsAdvertise GraphicsRedirectionCapsAdvertise;
		psGfxRedirGraphicsRedirectionCapsConfirm GraphicsRedirectionCapsConfirm;

		psGfxRedirOpenPool OpenPool;
		psGfxRedirClosePool ClosePool;

		psGfxRedirCreateBuffer CreateBuffer;
		psGfxRedirDestroyBuffer DestroyBuffer;

		psGfxRedirPresentBuffer PresentBuffer;
		psGfxRedirPresentBufferAck PresentBufferAck;

		GfxRedirServerPrivate* priv;
		rdpContext* rdpcontext;

		UINT32 confirmedCapsVersion;
	};

	WINPR_ATTR_MALLOC(gfxredir_server_context_free, 1)
	FREERDP_API GfxRedirServerContext* gfxredir_server_context_new(HANDLE vcm);
	FREERDP_API void gfxredir_server_context_free(GfxRedirServerContext* context);

#ifdef __cplusplus
}
#endif

#endif /* FREERDP_CHANNEL_GFXREDIR_SERVER_GFXREDIR_H */