Blame include/freerdp/graphics.h

Packit 1fb8d4
/**
Packit 1fb8d4
 * FreeRDP: A Remote Desktop Protocol Implementation
Packit 1fb8d4
 * Graphical Objects
Packit 1fb8d4
 *
Packit 1fb8d4
 * Copyright 2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
Packit 1fb8d4
 * Copyright 2016 Armin Novak <armin.novak@thincast.com>
Packit 1fb8d4
 * Copyright 2016 Thincast Technologies GmbH
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
#ifndef FREERDP_GRAPHICS_H
Packit 1fb8d4
#define FREERDP_GRAPHICS_H
Packit 1fb8d4
Packit 1fb8d4
typedef struct rdp_bitmap rdpBitmap;
Packit 1fb8d4
typedef struct rdp_pointer rdpPointer;
Packit 1fb8d4
typedef struct rdp_glyph rdpGlyph;
Packit 1fb8d4
Packit 1fb8d4
#include <stdlib.h>
Packit 1fb8d4
#include <freerdp/api.h>
Packit 1fb8d4
#include <freerdp/types.h>
Packit 1fb8d4
#include <freerdp/freerdp.h>
Packit 1fb8d4
Packit 1fb8d4
#ifdef __cplusplus
Packit Service 5a9772
extern "C"
Packit Service 5a9772
{
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit Service 5a9772
	/* Bitmap Class */
Packit Service 5a9772
	typedef BOOL (*pBitmap_New)(rdpContext* context, rdpBitmap* bitmap);
Packit Service 5a9772
	typedef void (*pBitmap_Free)(rdpContext* context, rdpBitmap* bitmap);
Packit Service 5a9772
	typedef BOOL (*pBitmap_Paint)(rdpContext* context, rdpBitmap* bitmap);
Packit Service 5a9772
	typedef BOOL (*pBitmap_Decompress)(rdpContext* context, rdpBitmap* bitmap, const BYTE* data,
Packit Service 5a9772
	                                   UINT32 width, UINT32 height, UINT32 bpp, UINT32 length,
Packit Service 5a9772
	                                   BOOL compressed, UINT32 codec_id);
Packit Service 5a9772
	typedef BOOL (*pBitmap_SetSurface)(rdpContext* context, rdpBitmap* bitmap, BOOL primary);
Packit Service 5a9772
Packit Service 5a9772
	struct rdp_bitmap
Packit Service 5a9772
	{
Packit Service 5a9772
		size_t size;                   /* 0 */
Packit Service 5a9772
		pBitmap_New New;               /* 1 */
Packit Service 5a9772
		pBitmap_Free Free;             /* 2 */
Packit Service 5a9772
		pBitmap_Paint Paint;           /* 3 */
Packit Service 5a9772
		pBitmap_Decompress Decompress; /* 4 */
Packit Service 5a9772
		pBitmap_SetSurface SetSurface; /* 5 */
Packit Service 5a9772
		UINT32 paddingA[16 - 6];       /* 6 */
Packit Service 5a9772
Packit Service 5a9772
		UINT32 left;              /* 16 */
Packit Service 5a9772
		UINT32 top;               /* 17 */
Packit Service 5a9772
		UINT32 right;             /* 18 */
Packit Service 5a9772
		UINT32 bottom;            /* 19 */
Packit Service 5a9772
		UINT32 width;             /* 20 */
Packit Service 5a9772
		UINT32 height;            /* 21 */
Packit Service 5a9772
		UINT32 format;            /* 22 */
Packit Service 5a9772
		UINT32 flags;             /* 23 */
Packit Service 5a9772
		UINT32 length;            /* 24 */
Packit Service 5a9772
		BYTE* data;               /* 25 */
Packit Service 5a9772
		UINT32 paddingB[32 - 26]; /* 26 */
Packit Service 5a9772
Packit Service 5a9772
		BOOL compressed;          /* 32 */
Packit Service 5a9772
		BOOL ephemeral;           /* 33 */
Packit Service 5a9772
		UINT32 paddingC[64 - 34]; /* 34 */
Packit Service 5a9772
	};
Packit Service 5a9772
Packit Service 5a9772
	FREERDP_API rdpBitmap* Bitmap_Alloc(rdpContext* context);
Packit Service 5a9772
	FREERDP_API BOOL Bitmap_SetRectangle(rdpBitmap* bitmap, UINT16 left, UINT16 top, UINT16 right,
Packit Service 5a9772
	                                     UINT16 bottom);
Packit Service 5a9772
	FREERDP_API BOOL Bitmap_SetDimensions(rdpBitmap* bitmap, UINT16 width, UINT16 height);
Packit Service 5a9772
Packit Service 5a9772
	/* Pointer Class */
Packit Service 5a9772
Packit Service 5a9772
	typedef BOOL (*pPointer_New)(rdpContext* context, rdpPointer* pointer);
Packit Service 5a9772
	typedef void (*pPointer_Free)(rdpContext* context, rdpPointer* pointer);
Packit Service 5a9772
	typedef BOOL (*pPointer_Set)(rdpContext* context, const rdpPointer* pointer);
Packit Service 5a9772
	typedef BOOL (*pPointer_SetNull)(rdpContext* context);
Packit Service 5a9772
	typedef BOOL (*pPointer_SetDefault)(rdpContext* context);
Packit Service 5a9772
	typedef BOOL (*pPointer_SetPosition)(rdpContext* context, UINT32 x, UINT32 y);
Packit Service 5a9772
Packit Service 5a9772
	struct rdp_pointer
Packit Service 5a9772
	{
Packit Service 5a9772
		size_t size;                      /* 0 */
Packit Service 5a9772
		pPointer_New New;                 /* 1 */
Packit Service 5a9772
		pPointer_Free Free;               /* 2 */
Packit Service 5a9772
		pPointer_Set Set;                 /* 3 */
Packit Service 5a9772
		pPointer_SetNull SetNull;         /* 4*/
Packit Service 5a9772
		pPointer_SetDefault SetDefault;   /* 5 */
Packit Service 5a9772
		pPointer_SetPosition SetPosition; /* 6 */
Packit Service 5a9772
		UINT32 paddingA[16 - 7];          /* 7 */
Packit Service 5a9772
Packit Service 5a9772
		UINT32 xPos;              /* 16 */
Packit Service 5a9772
		UINT32 yPos;              /* 17 */
Packit Service 5a9772
		UINT32 width;             /* 18 */
Packit Service 5a9772
		UINT32 height;            /* 19 */
Packit Service 5a9772
		UINT32 xorBpp;            /* 20 */
Packit Service 5a9772
		UINT32 lengthAndMask;     /* 21 */
Packit Service 5a9772
		UINT32 lengthXorMask;     /* 22 */
Packit Service 5a9772
		BYTE* xorMaskData;        /* 23 */
Packit Service 5a9772
		BYTE* andMaskData;        /* 24 */
Packit Service 5a9772
		UINT32 paddingB[32 - 25]; /* 25 */
Packit Service 5a9772
	};
Packit Service 5a9772
Packit Service 5a9772
	FREERDP_API rdpPointer* Pointer_Alloc(rdpContext* context);
Packit Service 5a9772
Packit Service 5a9772
	/* Glyph Class */
Packit Service 5a9772
	typedef BOOL (*pGlyph_New)(rdpContext* context, const rdpGlyph* glyph);
Packit Service 5a9772
	typedef void (*pGlyph_Free)(rdpContext* context, rdpGlyph* glyph);
Packit Service 5a9772
	typedef BOOL (*pGlyph_Draw)(rdpContext* context, const rdpGlyph* glyph, INT32 x, INT32 y,
Packit Service 5a9772
	                            INT32 w, INT32 h, INT32 sx, INT32 sy, BOOL fOpRedundant);
Packit Service 5a9772
	typedef BOOL (*pGlyph_BeginDraw)(rdpContext* context, INT32 x, INT32 y, INT32 width,
Packit Service 5a9772
	                                 INT32 height, UINT32 bgcolor, UINT32 fgcolor,
Packit Service 5a9772
	                                 BOOL fOpRedundant);
Packit Service 5a9772
	typedef BOOL (*pGlyph_EndDraw)(rdpContext* context, INT32 x, INT32 y, INT32 width, INT32 height,
Packit Service 5a9772
	                               UINT32 bgcolor, UINT32 fgcolor);
Packit Service 5a9772
	typedef BOOL (*pGlyph_SetBounds)(rdpContext* context, INT32 x, INT32 y, INT32 width,
Packit Service 5a9772
	                                 INT32 height);
Packit Service 5a9772
Packit Service 5a9772
	struct rdp_glyph
Packit Service 5a9772
	{
Packit Service 5a9772
		size_t size;                /* 0 */
Packit Service 5a9772
		pGlyph_New New;             /* 1 */
Packit Service 5a9772
		pGlyph_Free Free;           /* 2 */
Packit Service 5a9772
		pGlyph_Draw Draw;           /* 3 */
Packit Service 5a9772
		pGlyph_BeginDraw BeginDraw; /* 4 */
Packit Service 5a9772
		pGlyph_EndDraw EndDraw;     /* 5 */
Packit Service 5a9772
		pGlyph_SetBounds SetBounds; /* 6 */
Packit Service 5a9772
		UINT32 paddingA[16 - 7];    /* 7 */
Packit Service 5a9772
Packit Service 5a9772
		INT32 x;                  /* 16 */
Packit Service 5a9772
		INT32 y;                  /* 17 */
Packit Service 5a9772
		UINT32 cx;                /* 18 */
Packit Service 5a9772
		UINT32 cy;                /* 19 */
Packit Service 5a9772
		UINT32 cb;                /* 20 */
Packit Service 5a9772
		BYTE* aj;                 /* 21 */
Packit Service 5a9772
		UINT32 paddingB[32 - 22]; /* 22 */
Packit Service 5a9772
	};
Packit Service 5a9772
Packit Service 5a9772
	FREERDP_API rdpGlyph* Glyph_Alloc(rdpContext* context, INT32 x, INT32 y, UINT32 cx, UINT32 cy,
Packit Service 5a9772
	                                  UINT32 cb, const BYTE* aj);
Packit Service 5a9772
Packit Service 5a9772
	/* Graphics Module */
Packit Service 5a9772
Packit Service 5a9772
	struct rdp_graphics
Packit Service 5a9772
	{
Packit Service 5a9772
		rdpContext* context;           /* 0 */
Packit Service 5a9772
		rdpBitmap* Bitmap_Prototype;   /* 1 */
Packit Service 5a9772
		rdpPointer* Pointer_Prototype; /* 2 */
Packit Service 5a9772
		rdpGlyph* Glyph_Prototype;     /* 3 */
Packit Service 5a9772
		UINT32 paddingA[16 - 4];       /* 4 */
Packit Service 5a9772
	};
Packit Service 5a9772
Packit Service 5a9772
	FREERDP_API void graphics_register_bitmap(rdpGraphics* graphics, rdpBitmap* bitmap);
Packit Service 5a9772
	FREERDP_API void graphics_register_pointer(rdpGraphics* graphics, rdpPointer* pointer);
Packit Service 5a9772
	FREERDP_API void graphics_register_glyph(rdpGraphics* graphics, rdpGlyph* glyph);
Packit Service 5a9772
Packit Service 5a9772
	FREERDP_API rdpGraphics* graphics_new(rdpContext* context);
Packit Service 5a9772
	FREERDP_API void graphics_free(rdpGraphics* graphics);
Packit 1fb8d4
Packit 1fb8d4
#ifdef __cplusplus
Packit 1fb8d4
}
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit 1fb8d4
#endif /* FREERDP_GRAPHICS_H */