2 * FreeRDP: A Remote Desktop Protocol Client
5 * Copyright 2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
23 typedef struct rdp_bitmap rdpBitmap;
24 typedef struct rdp_pointer rdpPointer;
25 typedef struct rdp_glyph rdpGlyph;
28 #include <freerdp/api.h>
29 #include <freerdp/types.h>
30 #include <freerdp/freerdp.h>
34 typedef void (*pBitmap_New)(rdpContext* context, rdpBitmap* bitmap);
35 typedef void (*pBitmap_Free)(rdpContext* context, rdpBitmap* bitmap);
36 typedef void (*pBitmap_Paint)(rdpContext* context, rdpBitmap* bitmap);
37 typedef void (*pBitmap_Decompress)(rdpContext* context, rdpBitmap* bitmap,
38 uint8* data, int width, int height, int bpp, int length, boolean compressed);
39 typedef void (*pBitmap_SetSurface)(rdpContext* context, rdpBitmap* bitmap, boolean primary);
44 pBitmap_New New; /* 1 */
45 pBitmap_Free Free; /* 2 */
46 pBitmap_Paint Paint; /* 3 */
47 pBitmap_Decompress Decompress; /* 4 */
48 pBitmap_SetSurface SetSurface; /* 5 */
49 uint32 paddingA[16 - 6]; /* 6 */
53 uint32 right; /* 18 */
54 uint32 bottom; /* 19 */
55 uint32 width; /* 20 */
56 uint32 height; /* 21 */
58 uint32 flags; /* 23 */
59 uint32 length; /* 24 */
61 uint32 paddingB[32 - 26]; /* 26 */
63 boolean compressed; /* 32 */
64 boolean ephemeral; /* 33 */
65 uint32 paddingC[64 - 34]; /* 34 */
68 FREERDP_API rdpBitmap* Bitmap_Alloc(rdpContext* context);
69 FREERDP_API void Bitmap_New(rdpContext* context, rdpBitmap* bitmap);
70 FREERDP_API void Bitmap_Free(rdpContext* context, rdpBitmap* bitmap);
71 FREERDP_API void Bitmap_Register(rdpContext* context, rdpBitmap* bitmap);
72 FREERDP_API void Bitmap_Decompress(rdpContext* context, rdpBitmap* bitmap,
73 uint8* data, int width, int height, int bpp, int length, boolean compressed);
74 FREERDP_API void Bitmap_SetRectangle(rdpContext* context, rdpBitmap* bitmap,
75 uint16 left, uint16 top, uint16 right, uint16 bottom);
76 FREERDP_API void Bitmap_SetDimensions(rdpContext* context, rdpBitmap* bitmap, uint16 width, uint16 height);
77 FREERDP_API void Bitmap_SetSurface(rdpContext* context, rdpBitmap* bitmap, boolean primary);
81 typedef void (*pPointer_New)(rdpContext* context, rdpPointer* pointer);
82 typedef void (*pPointer_Free)(rdpContext* context, rdpPointer* pointer);
83 typedef void (*pPointer_Set)(rdpContext* context, rdpPointer* pointer);
88 pPointer_New New; /* 1 */
89 pPointer_Free Free; /* 2 */
90 pPointer_Set Set; /* 3 */
91 uint32 paddingA[16 - 4]; /* 4 */
95 uint32 width; /* 18 */
96 uint32 height; /* 19 */
97 uint32 xorBpp; /* 20 */
98 uint32 lengthAndMask; /* 21 */
99 uint32 lengthXorMask; /* 22 */
100 uint8* xorMaskData; /* 23 */
101 uint8* andMaskData; /* 24 */
102 uint32 paddingB[32 - 25]; /* 25 */
105 FREERDP_API rdpPointer* Pointer_Alloc(rdpContext* context);
106 FREERDP_API void Pointer_New(rdpContext* context, rdpPointer* pointer);
107 FREERDP_API void Pointer_Free(rdpContext* context, rdpPointer* pointer);
108 FREERDP_API void Pointer_Set(rdpContext* context, rdpPointer* pointer);
112 typedef void (*pGlyph_New)(rdpContext* context, rdpGlyph* glyph);
113 typedef void (*pGlyph_Free)(rdpContext* context, rdpGlyph* glyph);
114 typedef void (*pGlyph_Draw)(rdpContext* context, rdpGlyph* glyph, int x, int y);
115 typedef void (*pGlyph_BeginDraw)(rdpContext* context, int x, int y, int width, int height, uint32 bgcolor, uint32 fgcolor);
116 typedef void (*pGlyph_EndDraw)(rdpContext* context, int x, int y, int width, int height, uint32 bgcolor, uint32 fgcolor);
121 pGlyph_New New; /* 1 */
122 pGlyph_Free Free; /* 2 */
123 pGlyph_Draw Draw; /* 3 */
124 pGlyph_BeginDraw BeginDraw; /* 4 */
125 pGlyph_EndDraw EndDraw; /* 5 */
126 uint32 paddingA[16 - 6]; /* 6 */
134 uint32 paddingB[32 - 22]; /* 22 */
137 FREERDP_API rdpGlyph* Glyph_Alloc(rdpContext* context);
138 FREERDP_API void Glyph_New(rdpContext* context, rdpGlyph* glyph);
139 FREERDP_API void Glyph_Free(rdpContext* context, rdpGlyph* glyph);
140 FREERDP_API void Glyph_Draw(rdpContext* context, rdpGlyph* glyph, int x, int y);
141 FREERDP_API void Glyph_BeginDraw(rdpContext* context, int x, int y, int width, int height, uint32 bgcolor, uint32 fgcolor);
142 FREERDP_API void Glyph_EndDraw(rdpContext* context, int x, int y, int width, int height, uint32 bgcolor, uint32 fgcolor);
144 /* Graphics Module */
148 rdpContext* context; /* 0 */
149 rdpBitmap* Bitmap_Prototype; /* 1 */
150 rdpPointer* Pointer_Prototype; /* 2 */
151 rdpGlyph* Glyph_Prototype; /* 3 */
152 uint32 paddingA[16 - 4]; /* 4 */
155 FREERDP_API void graphics_register_bitmap(rdpGraphics* graphics, rdpBitmap* bitmap);
156 FREERDP_API void graphics_register_pointer(rdpGraphics* graphics, rdpPointer* pointer);
157 FREERDP_API void graphics_register_glyph(rdpGraphics* graphics, rdpGlyph* glyph);
159 FREERDP_API rdpGraphics* graphics_new(rdpContext* context);
160 FREERDP_API void graphics_free(rdpGraphics* graphics);
162 #endif /* __GRAPHICS_H */