Initial commit - from Precise source
[freerdp-ubuntu-pcb-backport.git] / include / freerdp / altsec.h
1 /**
2  * FreeRDP: A Remote Desktop Protocol Client
3  * Alternate Secondary Drawing Orders Interface API
4  *
5  * Copyright 2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *     http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19
20 #ifndef __UPDATE_ALTSEC_H
21 #define __UPDATE_ALTSEC_H
22
23 #include <freerdp/types.h>
24
25 #define DSDNG_STRETCH                   0x00000001
26 #define DSDNG_TILE                      0x00000002
27 #define DSDNG_PERPIXELALPHA             0x00000004
28 #define DSDNG_TRANSPARENT               0x00000008
29 #define DSDNG_MUSTFLIP                  0x00000010
30 #define DSDNG_TRUESIZE                  0x00000020
31
32 #define FRAME_START                     0x00000000
33 #define FRAME_END                       0x00000001
34
35 #define STREAM_BITMAP_END               0x01
36 #define STREAM_BITMAP_COMPRESSED        0x02
37 #define STREAM_BITMAP_V2                0x04
38
39 struct _OFFSCREEN_DELETE_LIST
40 {
41         uint32 sIndices;
42         uint32 cIndices;
43         uint16* indices;
44 };
45 typedef struct _OFFSCREEN_DELETE_LIST OFFSCREEN_DELETE_LIST;
46
47 struct _CREATE_OFFSCREEN_BITMAP_ORDER
48 {
49         uint32 id;
50         uint32 cx;
51         uint32 cy;
52         OFFSCREEN_DELETE_LIST deleteList;
53 };
54 typedef struct _CREATE_OFFSCREEN_BITMAP_ORDER CREATE_OFFSCREEN_BITMAP_ORDER;
55
56 struct _SWITCH_SURFACE_ORDER
57 {
58         uint32 bitmapId;
59 };
60 typedef struct _SWITCH_SURFACE_ORDER SWITCH_SURFACE_ORDER;
61
62 struct _NINE_GRID_BITMAP_INFO
63 {
64         uint32 flFlags;
65         uint32 ulLeftWidth;
66         uint32 ulRightWidth;
67         uint32 ulTopHeight;
68         uint32 ulBottomHeight;
69         uint32 crTransparent;
70 };
71 typedef struct _NINE_GRID_BITMAP_INFO NINE_GRID_BITMAP_INFO;
72
73 struct _CREATE_NINE_GRID_BITMAP_ORDER
74 {
75         uint32 bitmapBpp;
76         uint32 bitmapId;
77         uint32 cx;
78         uint32 cy;
79         NINE_GRID_BITMAP_INFO nineGridInfo;
80 };
81 typedef struct _CREATE_NINE_GRID_BITMAP_ORDER CREATE_NINE_GRID_BITMAP_ORDER;
82
83 struct _FRAME_MARKER_ORDER
84 {
85         uint32 action;
86 };
87 typedef struct _FRAME_MARKER_ORDER FRAME_MARKER_ORDER;
88
89 struct _STREAM_BITMAP_FIRST_ORDER
90 {
91         uint32 bitmapFlags;
92         uint32 bitmapBpp;
93         uint32 bitmapType;
94         uint32 bitmapWidth;
95         uint32 bitmapHeight;
96         uint32 bitmapSize;
97         uint32 bitmapBlockSize;
98         uint8* bitmapBlock;
99 };
100 typedef struct _STREAM_BITMAP_FIRST_ORDER STREAM_BITMAP_FIRST_ORDER;
101
102 struct _STREAM_BITMAP_NEXT_ORDER
103 {
104         uint32 bitmapFlags;
105         uint32 bitmapType;
106         uint32 bitmapBlockSize;
107         uint8* bitmapBlock;
108 };
109 typedef struct _STREAM_BITMAP_NEXT_ORDER STREAM_BITMAP_NEXT_ORDER;
110
111 struct _DRAW_GDIPLUS_FIRST_ORDER
112 {
113         uint32 cbSize;
114         uint32 cbTotalSize;
115         uint32 cbTotalEmfSize;
116         uint8* emfRecords;
117 };
118 typedef struct _DRAW_GDIPLUS_FIRST_ORDER DRAW_GDIPLUS_FIRST_ORDER;
119
120 struct _DRAW_GDIPLUS_NEXT_ORDER
121 {
122         uint32 cbSize;
123         uint8* emfRecords;
124 };
125 typedef struct _DRAW_GDIPLUS_NEXT_ORDER DRAW_GDIPLUS_NEXT_ORDER;
126
127 struct _DRAW_GDIPLUS_END_ORDER
128 {
129         uint32 cbSize;
130         uint32 cbTotalSize;
131         uint32 cbTotalEmfSize;
132         uint8* emfRecords;
133 };
134 typedef struct _DRAW_GDIPLUS_END_ORDER DRAW_GDIPLUS_END_ORDER;
135
136 struct _DRAW_GDIPLUS_CACHE_FIRST_ORDER
137 {
138         uint32 flags;
139         uint32 cacheType;
140         uint32 cacheIndex;
141         uint32 cbSize;
142         uint32 cbTotalSize;
143         uint8* emfRecords;
144 };
145 typedef struct _DRAW_GDIPLUS_CACHE_FIRST_ORDER DRAW_GDIPLUS_CACHE_FIRST_ORDER;
146
147 struct _DRAW_GDIPLUS_CACHE_NEXT_ORDER
148 {
149         uint32 flags;
150         uint32 cacheType;
151         uint32 cacheIndex;
152         uint32 cbSize;
153         uint8* emfRecords;
154 };
155 typedef struct _DRAW_GDIPLUS_CACHE_NEXT_ORDER DRAW_GDIPLUS_CACHE_NEXT_ORDER;
156
157 struct _DRAW_GDIPLUS_CACHE_END_ORDER
158 {
159         uint32 flags;
160         uint32 cacheType;
161         uint32 cacheIndex;
162         uint32 cbSize;
163         uint32 cbTotalSize;
164         uint8* emfRecords;
165 };
166 typedef struct _DRAW_GDIPLUS_CACHE_END_ORDER DRAW_GDIPLUS_CACHE_END_ORDER;
167
168 typedef void (*pCreateOffscreenBitmap)(rdpContext* context, CREATE_OFFSCREEN_BITMAP_ORDER* create_offscreen_bitmap);
169 typedef void (*pSwitchSurface)(rdpContext* context, SWITCH_SURFACE_ORDER* switch_surface);
170 typedef void (*pCreateNineGridBitmap)(rdpContext* context, CREATE_NINE_GRID_BITMAP_ORDER* create_nine_grid_bitmap);
171 typedef void (*pFrameMarker)(rdpContext* context, FRAME_MARKER_ORDER* frame_marker);
172 typedef void (*pStreamBitmapFirst)(rdpContext* context, STREAM_BITMAP_FIRST_ORDER* stream_bitmap_first);
173 typedef void (*pStreamBitmapNext)(rdpContext* context, STREAM_BITMAP_FIRST_ORDER* stream_bitmap_next);
174 typedef void (*pDrawGdiPlusFirst)(rdpContext* context, DRAW_GDIPLUS_FIRST_ORDER* draw_gdiplus_first);
175 typedef void (*pDrawGdiPlusNext)(rdpContext* context, DRAW_GDIPLUS_NEXT_ORDER* draw_gdiplus_next);
176 typedef void (*pDrawGdiPlusEnd)(rdpContext* context, DRAW_GDIPLUS_END_ORDER* draw_gdiplus_end);
177 typedef void (*pDrawGdiPlusCacheFirst)(rdpContext* context, DRAW_GDIPLUS_CACHE_FIRST_ORDER* draw_gdiplus_cache_first);
178 typedef void (*pDrawGdiPlusCacheNext)(rdpContext* context, DRAW_GDIPLUS_CACHE_NEXT_ORDER* draw_gdiplus_cache_next);
179 typedef void (*pDrawGdiPlusCacheEnd)(rdpContext* context, DRAW_GDIPLUS_CACHE_END_ORDER* draw_gdiplus_cache_end);
180
181 struct rdp_altsec_update
182 {
183         rdpContext* context; /* 0 */
184         uint32 paddingA[16 - 1]; /* 1 */
185
186         pCreateOffscreenBitmap CreateOffscreenBitmap; /* 16 */
187         pSwitchSurface SwitchSurface; /* 17 */
188         pCreateNineGridBitmap CreateNineGridBitmap; /* 18 */
189         pFrameMarker FrameMarker; /* 19 */
190         pStreamBitmapFirst StreamBitmapFirst; /* 20 */
191         pStreamBitmapNext StreamBitmapNext; /* 21 */
192         pDrawGdiPlusFirst DrawGdiPlusFirst; /* 22 */
193         pDrawGdiPlusNext DrawGdiPlusNext; /* 23 */
194         pDrawGdiPlusEnd DrawGdiPlusEnd; /* 24 */
195         pDrawGdiPlusCacheFirst DrawGdiPlusCacheFirst; /* 25 */
196         pDrawGdiPlusCacheNext DrawGdiPlusCacheNext; /* 26 */
197         pDrawGdiPlusCacheEnd DrawGdiPlusCacheEnd; /* 27 */
198         uint32 paddingB[32 - 28]; /* 28 */
199
200         /* internal */
201
202         CREATE_OFFSCREEN_BITMAP_ORDER create_offscreen_bitmap;
203         SWITCH_SURFACE_ORDER switch_surface;
204         CREATE_NINE_GRID_BITMAP_ORDER create_nine_grid_bitmap;
205         FRAME_MARKER_ORDER frame_marker;
206         STREAM_BITMAP_FIRST_ORDER stream_bitmap_first;
207         STREAM_BITMAP_FIRST_ORDER stream_bitmap_next;
208         DRAW_GDIPLUS_CACHE_FIRST_ORDER draw_gdiplus_cache_first;
209         DRAW_GDIPLUS_CACHE_NEXT_ORDER draw_gdiplus_cache_next;
210         DRAW_GDIPLUS_CACHE_END_ORDER draw_gdiplus_cache_end;
211         DRAW_GDIPLUS_FIRST_ORDER draw_gdiplus_first;
212         DRAW_GDIPLUS_NEXT_ORDER draw_gdiplus_next;
213         DRAW_GDIPLUS_END_ORDER draw_gdiplus_end;
214 };
215 typedef struct rdp_altsec_update rdpAltSecUpdate;
216
217 #endif /* __UPDATE_ALTSEC_H */