2011-10-21 01:28:59 +04:00
|
|
|
/**
|
2012-10-09 07:02:04 +04:00
|
|
|
* FreeRDP: A Remote Desktop Protocol Implementation
|
2011-10-21 01:28:59 +04:00
|
|
|
* X11 Graphical Objects
|
|
|
|
*
|
|
|
|
* Copyright 2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2012-08-15 01:20:53 +04:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
2011-10-21 02:18:45 +04:00
|
|
|
#include <X11/Xlib.h>
|
|
|
|
#include <X11/Xutil.h>
|
|
|
|
|
|
|
|
#ifdef WITH_XCURSOR
|
|
|
|
#include <X11/Xcursor/Xcursor.h>
|
|
|
|
#endif
|
|
|
|
|
2011-10-21 01:28:59 +04:00
|
|
|
#include <freerdp/codec/bitmap.h>
|
2012-07-24 23:05:22 +04:00
|
|
|
#include <freerdp/codec/rfx.h>
|
2012-06-27 03:57:18 +04:00
|
|
|
#include <freerdp/codec/jpeg.h>
|
2011-10-21 01:28:59 +04:00
|
|
|
|
|
|
|
#include "xf_graphics.h"
|
|
|
|
|
2011-10-21 02:18:45 +04:00
|
|
|
/* Bitmap Class */
|
|
|
|
|
2011-10-21 01:28:59 +04:00
|
|
|
void xf_Bitmap_New(rdpContext* context, rdpBitmap* bitmap)
|
|
|
|
{
|
|
|
|
uint8* data;
|
|
|
|
Pixmap pixmap;
|
|
|
|
XImage* image;
|
2012-07-25 21:05:03 +04:00
|
|
|
xfContext* context_ = (xfContext*) context;
|
|
|
|
xfInfo* xfi = context_->xfi;
|
2011-10-21 01:28:59 +04:00
|
|
|
|
2011-10-21 05:34:55 +04:00
|
|
|
XSetFunction(xfi->display, xfi->gc, GXcopy);
|
2011-10-21 01:28:59 +04:00
|
|
|
pixmap = XCreatePixmap(xfi->display, xfi->drawable, bitmap->width, bitmap->height, xfi->depth);
|
|
|
|
|
|
|
|
if (bitmap->data != NULL)
|
|
|
|
{
|
|
|
|
data = freerdp_image_convert(bitmap->data, NULL,
|
2012-07-25 21:05:03 +04:00
|
|
|
bitmap->width, bitmap->height, context_->settings->color_depth, xfi->bpp, xfi->clrconv);
|
2011-10-21 01:28:59 +04:00
|
|
|
|
2012-10-09 10:31:28 +04:00
|
|
|
if (bitmap->ephemeral != TRUE)
|
2011-10-21 05:34:55 +04:00
|
|
|
{
|
|
|
|
image = XCreateImage(xfi->display, xfi->visual, xfi->depth,
|
2011-10-21 01:28:59 +04:00
|
|
|
ZPixmap, 0, (char*) data, bitmap->width, bitmap->height, xfi->scanline_pad, 0);
|
|
|
|
|
2011-10-21 05:34:55 +04:00
|
|
|
XPutImage(xfi->display, pixmap, xfi->gc, image, 0, 0, 0, 0, bitmap->width, bitmap->height);
|
|
|
|
XFree(image);
|
2011-10-21 01:28:59 +04:00
|
|
|
|
2011-10-21 05:34:55 +04:00
|
|
|
if (data != bitmap->data)
|
2012-10-09 07:21:26 +04:00
|
|
|
free(data);
|
2011-10-21 05:34:55 +04:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-10-26 20:50:14 +04:00
|
|
|
if (data != bitmap->data)
|
2012-10-09 07:21:26 +04:00
|
|
|
free(bitmap->data);
|
2012-07-25 02:10:45 +04:00
|
|
|
|
2011-10-21 05:34:55 +04:00
|
|
|
bitmap->data = data;
|
|
|
|
}
|
2011-10-21 01:28:59 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
((xfBitmap*) bitmap)->pixmap = pixmap;
|
|
|
|
}
|
|
|
|
|
|
|
|
void xf_Bitmap_Free(rdpContext* context, rdpBitmap* bitmap)
|
|
|
|
{
|
|
|
|
xfInfo* xfi = ((xfContext*) context)->xfi;
|
|
|
|
|
|
|
|
if (((xfBitmap*) bitmap)->pixmap != 0)
|
|
|
|
XFreePixmap(xfi->display, ((xfBitmap*) bitmap)->pixmap);
|
|
|
|
}
|
|
|
|
|
2011-10-21 05:34:55 +04:00
|
|
|
void xf_Bitmap_Paint(rdpContext* context, rdpBitmap* bitmap)
|
2011-10-21 01:28:59 +04:00
|
|
|
{
|
2011-10-21 05:34:55 +04:00
|
|
|
XImage* image;
|
|
|
|
int width, height;
|
2011-10-21 01:28:59 +04:00
|
|
|
xfInfo* xfi = ((xfContext*) context)->xfi;
|
|
|
|
|
2011-10-21 05:34:55 +04:00
|
|
|
width = bitmap->right - bitmap->left + 1;
|
|
|
|
height = bitmap->bottom - bitmap->top + 1;
|
|
|
|
|
|
|
|
XSetFunction(xfi->display, xfi->gc, GXcopy);
|
|
|
|
|
|
|
|
image = XCreateImage(xfi->display, xfi->visual, xfi->depth,
|
|
|
|
ZPixmap, 0, (char*) bitmap->data, bitmap->width, bitmap->height, xfi->scanline_pad, 0);
|
|
|
|
|
2011-10-21 01:28:59 +04:00
|
|
|
XPutImage(xfi->display, xfi->primary, xfi->gc,
|
2011-10-21 05:34:55 +04:00
|
|
|
image, 0, 0, bitmap->left, bitmap->top, width, height);
|
|
|
|
|
|
|
|
XFree(image);
|
2011-10-21 01:28:59 +04:00
|
|
|
|
2012-10-09 10:31:28 +04:00
|
|
|
if (xfi->remote_app != TRUE)
|
2011-10-21 05:34:55 +04:00
|
|
|
{
|
|
|
|
XCopyArea(xfi->display, xfi->primary, xfi->drawable, xfi->gc,
|
|
|
|
bitmap->left, bitmap->top, width, height, bitmap->left, bitmap->top);
|
|
|
|
}
|
2011-10-21 01:28:59 +04:00
|
|
|
|
2011-10-21 05:34:55 +04:00
|
|
|
gdi_InvalidateRegion(xfi->hdc, bitmap->left, bitmap->top, width, height);
|
2011-10-21 01:28:59 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void xf_Bitmap_Decompress(rdpContext* context, rdpBitmap* bitmap,
|
2012-07-25 03:54:29 +04:00
|
|
|
uint8* data, int width, int height, int bpp, int length,
|
|
|
|
boolean compressed, int codec_id)
|
2011-10-21 01:28:59 +04:00
|
|
|
{
|
|
|
|
uint16 size;
|
2012-07-24 23:05:22 +04:00
|
|
|
RFX_MESSAGE* msg;
|
|
|
|
uint8* src;
|
|
|
|
uint8* dst;
|
|
|
|
int yindex;
|
|
|
|
int xindex;
|
2012-07-25 03:54:29 +04:00
|
|
|
xfInfo* xfi;
|
|
|
|
boolean status;
|
2011-10-21 01:28:59 +04:00
|
|
|
|
2011-10-25 06:04:51 +04:00
|
|
|
size = width * height * (bpp + 7) / 8;
|
2011-10-21 01:28:59 +04:00
|
|
|
|
|
|
|
if (bitmap->data == NULL)
|
2012-10-09 07:21:26 +04:00
|
|
|
bitmap->data = (uint8*) malloc(size);
|
2011-10-21 01:28:59 +04:00
|
|
|
else
|
2012-10-09 07:21:26 +04:00
|
|
|
bitmap->data = (uint8*) realloc(bitmap->data, size);
|
2011-10-21 01:28:59 +04:00
|
|
|
|
2012-07-25 03:54:29 +04:00
|
|
|
switch (codec_id)
|
2011-10-21 01:28:59 +04:00
|
|
|
{
|
2012-07-25 03:54:29 +04:00
|
|
|
case CODEC_ID_NSCODEC:
|
|
|
|
printf("xf_Bitmap_Decompress: nsc not done\n");
|
|
|
|
break;
|
|
|
|
case CODEC_ID_REMOTEFX:
|
|
|
|
xfi = ((xfContext*)context)->xfi;
|
|
|
|
rfx_context_set_pixel_format(xfi->rfx_context, RDP_PIXEL_FORMAT_B8G8R8A8);
|
|
|
|
msg = rfx_process_message(xfi->rfx_context, data, length);
|
|
|
|
if (msg == NULL)
|
|
|
|
{
|
|
|
|
printf("xf_Bitmap_Decompress: rfx Decompression Failed\n");
|
|
|
|
}
|
|
|
|
else
|
2012-07-24 23:05:22 +04:00
|
|
|
{
|
2012-07-25 03:54:29 +04:00
|
|
|
for (yindex = 0; yindex < height; yindex++)
|
2012-07-24 23:05:22 +04:00
|
|
|
{
|
2012-07-25 03:54:29 +04:00
|
|
|
src = msg->tiles[0]->data + yindex * 64 * 4;
|
|
|
|
dst = bitmap->data + yindex * width * 3;
|
|
|
|
for (xindex = 0; xindex < width; xindex++)
|
|
|
|
{
|
|
|
|
*(dst++) = *(src++);
|
|
|
|
*(dst++) = *(src++);
|
|
|
|
*(dst++) = *(src++);
|
|
|
|
src++;
|
|
|
|
}
|
2012-07-24 23:05:22 +04:00
|
|
|
}
|
2012-07-25 03:54:29 +04:00
|
|
|
rfx_message_free(xfi->rfx_context, msg);
|
2012-07-24 23:05:22 +04:00
|
|
|
}
|
2012-07-25 03:54:29 +04:00
|
|
|
break;
|
|
|
|
case CODEC_ID_JPEG:
|
|
|
|
if (!jpeg_decompress(data, bitmap->data, width, height, length, bpp))
|
|
|
|
{
|
|
|
|
printf("xf_Bitmap_Decompress: jpeg Decompression Failed\n");
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
if (compressed)
|
|
|
|
{
|
|
|
|
status = bitmap_decompress(data, bitmap->data, width, height, length, bpp, bpp);
|
2011-10-21 01:28:59 +04:00
|
|
|
|
2012-10-09 10:31:28 +04:00
|
|
|
if (status == FALSE)
|
2012-07-25 03:54:29 +04:00
|
|
|
{
|
|
|
|
printf("xf_Bitmap_Decompress: Bitmap Decompression Failed\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
freerdp_image_flip(data, bitmap->data, width, height, bpp);
|
|
|
|
}
|
|
|
|
break;
|
2011-10-21 01:28:59 +04:00
|
|
|
}
|
|
|
|
|
2012-10-09 10:31:28 +04:00
|
|
|
bitmap->compressed = FALSE;
|
2011-10-21 01:28:59 +04:00
|
|
|
bitmap->length = size;
|
|
|
|
bitmap->bpp = bpp;
|
|
|
|
}
|
|
|
|
|
2011-10-21 02:18:45 +04:00
|
|
|
void xf_Bitmap_SetSurface(rdpContext* context, rdpBitmap* bitmap, boolean primary)
|
|
|
|
{
|
|
|
|
xfInfo* xfi = ((xfContext*) context)->xfi;
|
|
|
|
|
|
|
|
if (primary)
|
|
|
|
xfi->drawing = xfi->primary;
|
|
|
|
else
|
|
|
|
xfi->drawing = ((xfBitmap*) bitmap)->pixmap;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Pointer Class */
|
|
|
|
|
|
|
|
void xf_Pointer_New(rdpContext* context, rdpPointer* pointer)
|
|
|
|
{
|
|
|
|
XcursorImage ci;
|
|
|
|
xfInfo* xfi = ((xfContext*) context)->xfi;
|
|
|
|
|
|
|
|
memset(&ci, 0, sizeof(ci));
|
|
|
|
ci.version = XCURSOR_IMAGE_VERSION;
|
|
|
|
ci.size = sizeof(ci);
|
|
|
|
ci.width = pointer->width;
|
|
|
|
ci.height = pointer->height;
|
|
|
|
ci.xhot = pointer->xPos;
|
|
|
|
ci.yhot = pointer->yPos;
|
2012-05-07 17:24:07 +04:00
|
|
|
ci.pixels = (XcursorPixel*) xzalloc(ci.width * ci.height * 4);
|
2011-10-21 02:18:45 +04:00
|
|
|
|
|
|
|
if ((pointer->andMaskData != 0) && (pointer->xorMaskData != 0))
|
|
|
|
{
|
|
|
|
freerdp_alpha_cursor_convert((uint8*) (ci.pixels), pointer->xorMaskData, pointer->andMaskData,
|
|
|
|
pointer->width, pointer->height, pointer->xorBpp, xfi->clrconv);
|
|
|
|
}
|
|
|
|
|
|
|
|
((xfPointer*) pointer)->cursor = XcursorImageLoadCursor(xfi->display, &ci);
|
2012-10-09 07:21:26 +04:00
|
|
|
free(ci.pixels);
|
2011-10-21 02:18:45 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void xf_Pointer_Free(rdpContext* context, rdpPointer* pointer)
|
|
|
|
{
|
|
|
|
xfInfo* xfi = ((xfContext*) context)->xfi;
|
|
|
|
|
|
|
|
if (((xfPointer*) pointer)->cursor != 0)
|
|
|
|
XFreeCursor(xfi->display, ((xfPointer*) pointer)->cursor);
|
|
|
|
}
|
|
|
|
|
|
|
|
void xf_Pointer_Set(rdpContext* context, rdpPointer* pointer)
|
|
|
|
{
|
|
|
|
xfInfo* xfi = ((xfContext*) context)->xfi;
|
|
|
|
|
2011-11-24 22:01:34 +04:00
|
|
|
/* in RemoteApp mode, window can be null if none has had focus */
|
|
|
|
|
2011-11-15 02:36:25 +04:00
|
|
|
if (xfi->window != NULL)
|
2011-10-21 02:18:45 +04:00
|
|
|
XDefineCursor(xfi->display, xfi->window->handle, ((xfPointer*) pointer)->cursor);
|
|
|
|
}
|
2012-02-24 16:44:23 +04:00
|
|
|
|
|
|
|
void xf_Pointer_SetNull(rdpContext* context)
|
|
|
|
{
|
|
|
|
xfInfo* xfi = ((xfContext*) context)->xfi;
|
|
|
|
static Cursor nullcursor = None;
|
|
|
|
|
|
|
|
if (nullcursor == None)
|
|
|
|
{
|
|
|
|
XcursorImage ci;
|
|
|
|
XcursorPixel xp = 0;
|
|
|
|
memset(&ci, 0, sizeof(ci));
|
|
|
|
ci.version = XCURSOR_IMAGE_VERSION;
|
|
|
|
ci.size = sizeof(ci);
|
|
|
|
ci.width = ci.height = 1;
|
|
|
|
ci.xhot = ci.yhot = 0;
|
|
|
|
ci.pixels = &xp;
|
|
|
|
nullcursor = XcursorImageLoadCursor(xfi->display, &ci);
|
|
|
|
}
|
|
|
|
if (xfi->window != NULL && nullcursor != None)
|
|
|
|
XDefineCursor(xfi->display, xfi->window->handle, nullcursor);
|
|
|
|
}
|
|
|
|
|
|
|
|
void xf_Pointer_SetDefault(rdpContext* context)
|
|
|
|
{
|
|
|
|
xfInfo* xfi = ((xfContext*) context)->xfi;
|
|
|
|
|
|
|
|
if (xfi->window != NULL)
|
|
|
|
XUndefineCursor(xfi->display, xfi->window->handle);
|
|
|
|
}
|
|
|
|
|
2011-11-09 21:16:09 +04:00
|
|
|
/* Glyph Class */
|
|
|
|
|
|
|
|
void xf_Glyph_New(rdpContext* context, rdpGlyph* glyph)
|
|
|
|
{
|
|
|
|
xfInfo* xfi;
|
|
|
|
int scanline;
|
|
|
|
XImage* image;
|
|
|
|
xfGlyph* xf_glyph;
|
|
|
|
|
|
|
|
xf_glyph = (xfGlyph*) glyph;
|
|
|
|
xfi = ((xfContext*) context)->xfi;
|
|
|
|
|
|
|
|
scanline = (glyph->cx + 7) / 8;
|
|
|
|
|
2011-12-13 21:18:11 +04:00
|
|
|
xf_glyph->pixmap = XCreatePixmap(xfi->display, xfi->drawing, glyph->cx, glyph->cy, 1);
|
2011-11-09 21:16:09 +04:00
|
|
|
|
|
|
|
image = XCreateImage(xfi->display, xfi->visual, 1,
|
|
|
|
ZPixmap, 0, (char*) glyph->aj, glyph->cx, glyph->cy, 8, scanline);
|
|
|
|
|
|
|
|
image->byte_order = MSBFirst;
|
|
|
|
image->bitmap_bit_order = MSBFirst;
|
|
|
|
|
|
|
|
XInitImage(image);
|
|
|
|
XPutImage(xfi->display, xf_glyph->pixmap, xfi->gc_mono, image, 0, 0, 0, 0, glyph->cx, glyph->cy);
|
|
|
|
XFree(image);
|
|
|
|
}
|
|
|
|
|
|
|
|
void xf_Glyph_Free(rdpContext* context, rdpGlyph* glyph)
|
|
|
|
{
|
2011-11-24 22:01:34 +04:00
|
|
|
xfInfo* xfi = ((xfContext*) context)->xfi;
|
2011-11-09 21:16:09 +04:00
|
|
|
|
2011-11-24 22:01:34 +04:00
|
|
|
if (((xfGlyph*) glyph)->pixmap != 0)
|
|
|
|
XFreePixmap(xfi->display, ((xfGlyph*) glyph)->pixmap);
|
2011-11-09 21:16:09 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void xf_Glyph_Draw(rdpContext* context, rdpGlyph* glyph, int x, int y)
|
|
|
|
{
|
2011-11-24 22:01:34 +04:00
|
|
|
xfGlyph* xf_glyph;
|
|
|
|
xfInfo* xfi = ((xfContext*) context)->xfi;
|
|
|
|
|
|
|
|
xf_glyph = (xfGlyph*) glyph;
|
|
|
|
|
|
|
|
XSetStipple(xfi->display, xfi->gc, xf_glyph->pixmap);
|
|
|
|
XSetTSOrigin(xfi->display, xfi->gc, x, y);
|
2011-12-13 21:18:11 +04:00
|
|
|
XFillRectangle(xfi->display, xfi->drawing, xfi->gc, x, y, glyph->cx, glyph->cy);
|
2011-11-24 22:01:34 +04:00
|
|
|
XSetStipple(xfi->display, xfi->gc, xfi->bitmap_mono);
|
2011-11-09 21:16:09 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void xf_Glyph_BeginDraw(rdpContext* context, int x, int y, int width, int height, uint32 bgcolor, uint32 fgcolor)
|
|
|
|
{
|
2012-07-25 21:05:03 +04:00
|
|
|
xfContext* context_ = (xfContext*) context;
|
|
|
|
xfInfo* xfi = context_->xfi;
|
2011-11-24 22:01:34 +04:00
|
|
|
|
2012-01-10 02:08:57 +04:00
|
|
|
bgcolor = (xfi->clrconv->invert)?
|
2012-07-25 21:05:03 +04:00
|
|
|
freerdp_color_convert_var_bgr(bgcolor, context_->settings->color_depth, xfi->bpp, xfi->clrconv):
|
|
|
|
freerdp_color_convert_var_rgb(bgcolor, context_->settings->color_depth, xfi->bpp, xfi->clrconv);
|
2012-01-10 02:08:57 +04:00
|
|
|
|
|
|
|
fgcolor = (xfi->clrconv->invert)?
|
2012-07-25 21:05:03 +04:00
|
|
|
freerdp_color_convert_var_bgr(fgcolor, context_->settings->color_depth, xfi->bpp, xfi->clrconv):
|
|
|
|
freerdp_color_convert_var_rgb(fgcolor, context_->settings->color_depth, xfi->bpp, xfi->clrconv);
|
2011-11-09 21:16:09 +04:00
|
|
|
|
2011-11-24 22:01:34 +04:00
|
|
|
XSetFunction(xfi->display, xfi->gc, GXcopy);
|
2011-12-13 21:18:11 +04:00
|
|
|
XSetFillStyle(xfi->display, xfi->gc, FillSolid);
|
2011-11-24 22:01:34 +04:00
|
|
|
XSetForeground(xfi->display, xfi->gc, fgcolor);
|
2011-12-13 21:18:11 +04:00
|
|
|
XFillRectangle(xfi->display, xfi->drawing, xfi->gc, x, y, width, height);
|
|
|
|
|
|
|
|
XSetForeground(xfi->display, xfi->gc, bgcolor);
|
|
|
|
XSetBackground(xfi->display, xfi->gc, fgcolor);
|
2011-11-24 22:01:34 +04:00
|
|
|
XSetFillStyle(xfi->display, xfi->gc, FillStippled);
|
2011-11-09 21:16:09 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void xf_Glyph_EndDraw(rdpContext* context, int x, int y, int width, int height, uint32 bgcolor, uint32 fgcolor)
|
|
|
|
{
|
2011-11-24 22:01:34 +04:00
|
|
|
xfInfo* xfi = ((xfContext*) context)->xfi;
|
|
|
|
|
2011-12-13 21:18:11 +04:00
|
|
|
if (xfi->drawing == xfi->primary)
|
2011-11-24 22:01:34 +04:00
|
|
|
{
|
2012-10-09 10:31:28 +04:00
|
|
|
if (xfi->remote_app != TRUE)
|
2011-12-13 21:18:11 +04:00
|
|
|
{
|
|
|
|
XCopyArea(xfi->display, xfi->primary, xfi->drawable, xfi->gc, x, y, width, height, x, y);
|
|
|
|
}
|
2011-11-09 21:16:09 +04:00
|
|
|
|
2011-12-13 21:18:11 +04:00
|
|
|
gdi_InvalidateRegion(xfi->hdc, x, y, width, height);
|
|
|
|
}
|
2011-11-09 21:16:09 +04:00
|
|
|
}
|
|
|
|
|
2011-10-21 02:18:45 +04:00
|
|
|
/* Graphics Module */
|
|
|
|
|
2011-10-21 01:28:59 +04:00
|
|
|
void xf_register_graphics(rdpGraphics* graphics)
|
|
|
|
{
|
2011-11-09 21:16:09 +04:00
|
|
|
rdpBitmap* bitmap;
|
|
|
|
rdpPointer* pointer;
|
|
|
|
rdpGlyph* glyph;
|
|
|
|
|
|
|
|
bitmap = xnew(rdpBitmap);
|
|
|
|
bitmap->size = sizeof(xfBitmap);
|
|
|
|
|
|
|
|
bitmap->New = xf_Bitmap_New;
|
|
|
|
bitmap->Free = xf_Bitmap_Free;
|
|
|
|
bitmap->Paint = xf_Bitmap_Paint;
|
|
|
|
bitmap->Decompress = xf_Bitmap_Decompress;
|
|
|
|
bitmap->SetSurface = xf_Bitmap_SetSurface;
|
|
|
|
|
|
|
|
graphics_register_bitmap(graphics, bitmap);
|
2012-10-09 07:21:26 +04:00
|
|
|
free(bitmap);
|
2011-11-09 21:16:09 +04:00
|
|
|
|
|
|
|
pointer = xnew(rdpPointer);
|
|
|
|
pointer->size = sizeof(xfPointer);
|
|
|
|
|
|
|
|
pointer->New = xf_Pointer_New;
|
|
|
|
pointer->Free = xf_Pointer_Free;
|
|
|
|
pointer->Set = xf_Pointer_Set;
|
2012-02-24 16:44:23 +04:00
|
|
|
pointer->SetNull = xf_Pointer_SetNull;
|
|
|
|
pointer->SetDefault = xf_Pointer_SetDefault;
|
2011-11-09 21:16:09 +04:00
|
|
|
|
|
|
|
graphics_register_pointer(graphics, pointer);
|
2012-10-09 07:21:26 +04:00
|
|
|
free(pointer);
|
2011-11-09 21:16:09 +04:00
|
|
|
|
|
|
|
glyph = xnew(rdpGlyph);
|
|
|
|
glyph->size = sizeof(xfGlyph);
|
|
|
|
|
|
|
|
glyph->New = xf_Glyph_New;
|
|
|
|
glyph->Free = xf_Glyph_Free;
|
|
|
|
glyph->Draw = xf_Glyph_Draw;
|
|
|
|
glyph->BeginDraw = xf_Glyph_BeginDraw;
|
|
|
|
glyph->EndDraw = xf_Glyph_EndDraw;
|
|
|
|
|
|
|
|
graphics_register_glyph(graphics, glyph);
|
2012-10-09 07:21:26 +04:00
|
|
|
free(glyph);
|
2011-10-21 01:28:59 +04:00
|
|
|
}
|