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 1fb8d4
extern "C" {
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit 1fb8d4
/* Bitmap Class */
Packit 1fb8d4
typedef BOOL (*pBitmap_New)(rdpContext* context, rdpBitmap* bitmap);
Packit 1fb8d4
typedef void (*pBitmap_Free)(rdpContext* context, rdpBitmap* bitmap);
Packit 1fb8d4
typedef BOOL (*pBitmap_Paint)(rdpContext* context, rdpBitmap* bitmap);
Packit 1fb8d4
typedef BOOL (*pBitmap_Decompress)(rdpContext* context, rdpBitmap* bitmap,
Packit 1fb8d4
                                   const BYTE* data, UINT32 width, UINT32 height,
Packit 1fb8d4
                                   UINT32 bpp, UINT32 length, BOOL compressed,
Packit 1fb8d4
                                   UINT32 codec_id);
Packit 1fb8d4
typedef BOOL (*pBitmap_SetSurface)(rdpContext* context, rdpBitmap* bitmap,
Packit 1fb8d4
                                   BOOL primary);
Packit 1fb8d4
Packit 1fb8d4
struct rdp_bitmap
Packit 1fb8d4
{
Packit 1fb8d4
	size_t size; /* 0 */
Packit 1fb8d4
	pBitmap_New New; /* 1 */
Packit 1fb8d4
	pBitmap_Free Free; /* 2 */
Packit 1fb8d4
	pBitmap_Paint Paint; /* 3 */
Packit 1fb8d4
	pBitmap_Decompress Decompress; /* 4 */
Packit 1fb8d4
	pBitmap_SetSurface SetSurface; /* 5 */
Packit 1fb8d4
	UINT32 paddingA[16 - 6];  /* 6 */
Packit 1fb8d4
Packit 1fb8d4
	UINT32 left; /* 16 */
Packit 1fb8d4
	UINT32 top; /* 17 */
Packit 1fb8d4
	UINT32 right; /* 18 */
Packit 1fb8d4
	UINT32 bottom; /* 19 */
Packit 1fb8d4
	UINT32 width; /* 20 */
Packit 1fb8d4
	UINT32 height; /* 21 */
Packit 1fb8d4
	UINT32 format; /* 22 */
Packit 1fb8d4
	UINT32 flags; /* 23 */
Packit 1fb8d4
	UINT32 length; /* 24 */
Packit 1fb8d4
	BYTE* data; /* 25 */
Packit 1fb8d4
	UINT32 paddingB[32 - 26]; /* 26 */
Packit 1fb8d4
Packit 1fb8d4
	BOOL compressed; /* 32 */
Packit 1fb8d4
	BOOL ephemeral; /* 33 */
Packit 1fb8d4
	UINT32 paddingC[64 - 34]; /* 34 */
Packit 1fb8d4
};
Packit 1fb8d4
Packit 1fb8d4
FREERDP_API rdpBitmap* Bitmap_Alloc(rdpContext* context);
Packit 1fb8d4
FREERDP_API BOOL Bitmap_SetRectangle(rdpBitmap* bitmap,
Packit 1fb8d4
                                     UINT16 left,
Packit 1fb8d4
                                     UINT16 top, UINT16 right, UINT16 bottom);
Packit 1fb8d4
FREERDP_API BOOL Bitmap_SetDimensions(rdpBitmap* bitmap,
Packit 1fb8d4
                                      UINT16 width,
Packit 1fb8d4
                                      UINT16 height);
Packit 1fb8d4
Packit 1fb8d4
/* Pointer Class */
Packit 1fb8d4
Packit 1fb8d4
typedef BOOL (*pPointer_New)(rdpContext* context, rdpPointer* pointer);
Packit 1fb8d4
typedef void (*pPointer_Free)(rdpContext* context, rdpPointer* pointer);
Packit 1fb8d4
typedef BOOL (*pPointer_Set)(rdpContext* context, const rdpPointer* pointer);
Packit 1fb8d4
typedef BOOL (*pPointer_SetNull)(rdpContext* context);
Packit 1fb8d4
typedef BOOL (*pPointer_SetDefault)(rdpContext* context);
Packit 1fb8d4
typedef BOOL (*pPointer_SetPosition)(rdpContext* context, UINT32 x, UINT32 y);
Packit 1fb8d4
Packit 1fb8d4
struct rdp_pointer
Packit 1fb8d4
{
Packit 1fb8d4
	size_t size; /* 0 */
Packit 1fb8d4
	pPointer_New New; /* 1 */
Packit 1fb8d4
	pPointer_Free Free; /* 2 */
Packit 1fb8d4
	pPointer_Set Set; /* 3 */
Packit 1fb8d4
	pPointer_SetNull SetNull; /* 4*/
Packit 1fb8d4
	pPointer_SetDefault SetDefault; /* 5 */
Packit 1fb8d4
	pPointer_SetPosition SetPosition; /* 6 */
Packit 1fb8d4
	UINT32 paddingA[16 - 7]; /* 7 */
Packit 1fb8d4
Packit 1fb8d4
	UINT32 xPos; /* 16 */
Packit 1fb8d4
	UINT32 yPos; /* 17 */
Packit 1fb8d4
	UINT32 width; /* 18 */
Packit 1fb8d4
	UINT32 height; /* 19 */
Packit 1fb8d4
	UINT32 xorBpp; /* 20 */
Packit 1fb8d4
	UINT32 lengthAndMask; /* 21 */
Packit 1fb8d4
	UINT32 lengthXorMask; /* 22 */
Packit 1fb8d4
	BYTE* xorMaskData; /* 23 */
Packit 1fb8d4
	BYTE* andMaskData; /* 24 */
Packit 1fb8d4
	UINT32 paddingB[32 - 25]; /* 25 */
Packit 1fb8d4
};
Packit 1fb8d4
Packit 1fb8d4
FREERDP_API rdpPointer* Pointer_Alloc(rdpContext* context);
Packit 1fb8d4
Packit 1fb8d4
/* Glyph Class */
Packit 1fb8d4
typedef BOOL (*pGlyph_New)(rdpContext* context, const rdpGlyph* glyph);
Packit 1fb8d4
typedef void (*pGlyph_Free)(rdpContext* context, rdpGlyph* glyph);
Packit 1fb8d4
typedef BOOL (*pGlyph_Draw)(rdpContext* context, const rdpGlyph* glyph,
Packit 1fb8d4
                            INT32 x, INT32 y, INT32 w, INT32 h,
Packit 1fb8d4
                            INT32 sx, INT32 sy, BOOL fOpRedundant);
Packit 1fb8d4
typedef BOOL (*pGlyph_BeginDraw)(rdpContext* context, INT32 x, INT32 y,
Packit 1fb8d4
                                 INT32 width, INT32 height, UINT32 bgcolor,
Packit 1fb8d4
                                 UINT32 fgcolor, BOOL fOpRedundant);
Packit 1fb8d4
typedef BOOL (*pGlyph_EndDraw)(rdpContext* context, INT32 x, INT32 y,
Packit 1fb8d4
                               INT32 width, INT32 height, UINT32 bgcolor, UINT32 fgcolor);
Packit 1fb8d4
typedef BOOL (*pGlyph_SetBounds)(rdpContext* context, INT32 x, INT32 y,
Packit 1fb8d4
                                 INT32 width, INT32 height);
Packit 1fb8d4
Packit 1fb8d4
struct rdp_glyph
Packit 1fb8d4
{
Packit 1fb8d4
	size_t size; /* 0 */
Packit 1fb8d4
	pGlyph_New New; /* 1 */
Packit 1fb8d4
	pGlyph_Free Free; /* 2 */
Packit 1fb8d4
	pGlyph_Draw Draw; /* 3 */
Packit 1fb8d4
	pGlyph_BeginDraw BeginDraw; /* 4 */
Packit 1fb8d4
	pGlyph_EndDraw EndDraw; /* 5 */
Packit 1fb8d4
	pGlyph_SetBounds SetBounds; /* 6 */
Packit 1fb8d4
	UINT32 paddingA[16 - 7]; /* 7 */
Packit 1fb8d4
Packit 1fb8d4
	INT32 x; /* 16 */
Packit 1fb8d4
	INT32 y; /* 17 */
Packit 1fb8d4
	UINT32 cx; /* 18 */
Packit 1fb8d4
	UINT32 cy; /* 19 */
Packit 1fb8d4
	UINT32 cb; /* 20 */
Packit 1fb8d4
	BYTE* aj; /* 21 */
Packit 1fb8d4
	UINT32 paddingB[32 - 22]; /* 22 */
Packit 1fb8d4
};
Packit 1fb8d4
Packit 1fb8d4
FREERDP_API rdpGlyph* Glyph_Alloc(rdpContext* context, INT32 x, INT32 y,
Packit 1fb8d4
                                  UINT32 cx, UINT32 cy, UINT32 cb, const BYTE* aj);
Packit 1fb8d4
Packit 1fb8d4
/* Graphics Module */
Packit 1fb8d4
Packit 1fb8d4
struct rdp_graphics
Packit 1fb8d4
{
Packit 1fb8d4
	rdpContext* context; /* 0 */
Packit 1fb8d4
	rdpBitmap* Bitmap_Prototype; /* 1 */
Packit 1fb8d4
	rdpPointer* Pointer_Prototype; /* 2 */
Packit 1fb8d4
	rdpGlyph* Glyph_Prototype; /* 3 */
Packit 1fb8d4
	UINT32 paddingA[16 - 4]; /* 4 */
Packit 1fb8d4
};
Packit 1fb8d4
Packit 1fb8d4
FREERDP_API void graphics_register_bitmap(rdpGraphics* graphics,
Packit 1fb8d4
        rdpBitmap* bitmap);
Packit 1fb8d4
FREERDP_API void graphics_register_pointer(rdpGraphics* graphics,
Packit 1fb8d4
        rdpPointer* pointer);
Packit 1fb8d4
FREERDP_API void graphics_register_glyph(rdpGraphics* graphics,
Packit 1fb8d4
        rdpGlyph* glyph);
Packit 1fb8d4
Packit 1fb8d4
FREERDP_API rdpGraphics* graphics_new(rdpContext* context);
Packit 1fb8d4
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 */