FreeRDP
glyph.c File Reference
#include <freerdp/config.h>
#include <stdio.h>
#include <winpr/crt.h>
#include <winpr/assert.h>
#include <freerdp/freerdp.h>
#include <winpr/stream.h>
#include <freerdp/log.h>
#include "glyph.h"
#include "cache.h"

Macros

#define TAG   FREERDP_TAG("cache.glyph")
 

Functions

static rdpGlyph * glyph_cache_get (rdpGlyphCache *glyphCache, UINT32 id, UINT32 index)
 
static BOOL glyph_cache_put (rdpGlyphCache *glyphCache, UINT32 id, UINT32 index, rdpGlyph *glyph)
 
static const void * glyph_cache_fragment_get (rdpGlyphCache *glyphCache, UINT32 index, UINT32 *size)
 
static BOOL glyph_cache_fragment_put (rdpGlyphCache *glyphCache, UINT32 index, UINT32 size, const void *fragment)
 
static UINT32 update_glyph_offset (const BYTE *data, size_t length, UINT32 index, INT32 *x, INT32 *y, UINT32 ulCharInc, UINT32 flAccel)
 
static BOOL update_process_glyph (rdpContext *context, const BYTE *data, UINT32 cacheIndex, INT32 *x, const INT32 *y, UINT32 cacheId, UINT32 flAccel, BOOL fOpRedundant, const RDP_RECT *bound)
 
static BOOL update_process_glyph_fragments (rdpContext *context, const BYTE *data, UINT32 length, UINT32 cacheId, UINT32 ulCharInc, UINT32 flAccel, UINT32 bgcolor, UINT32 fgcolor, INT32 x, INT32 y, INT32 bkX, INT32 bkY, INT32 bkWidth, INT32 bkHeight, INT32 opX, INT32 opY, INT32 opWidth, INT32 opHeight, BOOL fOpRedundant)
 
static BOOL update_gdi_glyph_index (rdpContext *context, GLYPH_INDEX_ORDER *glyphIndex)
 
static BOOL update_gdi_fast_index (rdpContext *context, const FAST_INDEX_ORDER *fastIndex)
 
static BOOL update_gdi_fast_glyph (rdpContext *context, const FAST_GLYPH_ORDER *fastGlyph)
 
static BOOL update_gdi_cache_glyph (rdpContext *context, const CACHE_GLYPH_ORDER *cacheGlyph)
 
static BOOL update_gdi_cache_glyph_v2 (rdpContext *context, const CACHE_GLYPH_V2_ORDER *cacheGlyphV2)
 
void glyph_cache_register_callbacks (rdpUpdate *update)
 
rdpGlyphCacheglyph_cache_new (rdpContext *context)
 
void glyph_cache_free (rdpGlyphCache *glyphCache)
 
CACHE_GLYPH_ORDERcopy_cache_glyph_order (rdpContext *context, const CACHE_GLYPH_ORDER *glyph)
 
void free_cache_glyph_order (rdpContext *context, CACHE_GLYPH_ORDER *glyph)
 
CACHE_GLYPH_V2_ORDERcopy_cache_glyph_v2_order (rdpContext *context, const CACHE_GLYPH_V2_ORDER *glyph)
 
void free_cache_glyph_v2_order (rdpContext *context, CACHE_GLYPH_V2_ORDER *glyph)
 

Macro Definition Documentation

◆ TAG

#define TAG   FREERDP_TAG("cache.glyph")

FreeRDP: A Remote Desktop Protocol Implementation Glyph Cache

Copyright 2011 Marc-Andre Moreau marca.nosp@m.ndre.nosp@m..more.nosp@m.au@g.nosp@m.mail..nosp@m.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.

Function Documentation

◆ copy_cache_glyph_order()

CACHE_GLYPH_ORDER* copy_cache_glyph_order ( rdpContext *  context,
const CACHE_GLYPH_ORDER glyph 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ copy_cache_glyph_v2_order()

CACHE_GLYPH_V2_ORDER* copy_cache_glyph_v2_order ( rdpContext *  context,
const CACHE_GLYPH_V2_ORDER glyph 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ free_cache_glyph_order()

void free_cache_glyph_order ( rdpContext *  context,
CACHE_GLYPH_ORDER glyph 
)
Here is the caller graph for this function:

◆ free_cache_glyph_v2_order()

void free_cache_glyph_v2_order ( rdpContext *  context,
CACHE_GLYPH_V2_ORDER glyph 
)
Here is the caller graph for this function:

◆ glyph_cache_fragment_get()

const void * glyph_cache_fragment_get ( rdpGlyphCache glyphCache,
UINT32  index,
UINT32 *  size 
)
static
Here is the caller graph for this function:

◆ glyph_cache_fragment_put()

BOOL glyph_cache_fragment_put ( rdpGlyphCache glyphCache,
UINT32  index,
UINT32  size,
const void *  fragment 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ glyph_cache_free()

void glyph_cache_free ( rdpGlyphCache glyphCache)
Here is the caller graph for this function:

◆ glyph_cache_get()

rdpGlyph * glyph_cache_get ( rdpGlyphCache glyphCache,
UINT32  id,
UINT32  index 
)
static
Here is the caller graph for this function:

◆ glyph_cache_new()

rdpGlyphCache* glyph_cache_new ( rdpContext *  context)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ glyph_cache_put()

BOOL glyph_cache_put ( rdpGlyphCache glyphCache,
UINT32  id,
UINT32  index,
rdpGlyph *  glyph 
)
static
Here is the caller graph for this function:

◆ glyph_cache_register_callbacks()

void glyph_cache_register_callbacks ( rdpUpdate *  update)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_gdi_cache_glyph()

static BOOL update_gdi_cache_glyph ( rdpContext *  context,
const CACHE_GLYPH_ORDER cacheGlyph 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_gdi_cache_glyph_v2()

static BOOL update_gdi_cache_glyph_v2 ( rdpContext *  context,
const CACHE_GLYPH_V2_ORDER cacheGlyphV2 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_gdi_fast_glyph()

static BOOL update_gdi_fast_glyph ( rdpContext *  context,
const FAST_GLYPH_ORDER fastGlyph 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_gdi_fast_index()

static BOOL update_gdi_fast_index ( rdpContext *  context,
const FAST_INDEX_ORDER fastIndex 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_gdi_glyph_index()

static BOOL update_gdi_glyph_index ( rdpContext *  context,
GLYPH_INDEX_ORDER glyphIndex 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_glyph_offset()

static UINT32 update_glyph_offset ( const BYTE data,
size_t  length,
UINT32  index,
INT32 *  x,
INT32 *  y,
UINT32  ulCharInc,
UINT32  flAccel 
)
static
Here is the caller graph for this function:

◆ update_process_glyph()

static BOOL update_process_glyph ( rdpContext *  context,
const BYTE data,
UINT32  cacheIndex,
INT32 *  x,
const INT32 *  y,
UINT32  cacheId,
UINT32  flAccel,
BOOL  fOpRedundant,
const RDP_RECT bound 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_process_glyph_fragments()

static BOOL update_process_glyph_fragments ( rdpContext *  context,
const BYTE data,
UINT32  length,
UINT32  cacheId,
UINT32  ulCharInc,
UINT32  flAccel,
UINT32  bgcolor,
UINT32  fgcolor,
INT32  x,
INT32  y,
INT32  bkX,
INT32  bkY,
INT32  bkWidth,
INT32  bkHeight,
INT32  opX,
INT32  opY,
INT32  opWidth,
INT32  opHeight,
BOOL  fOpRedundant 
)
static

Some Microsoft servers send erroneous high values close to the sint16 maximum in the OpRight field of the GlyphIndex, FastIndex and FastGlyph drawing orders, probably a result of applications trying to clear the text line to the very right end. One example where this can be seen is typing in notepad.exe within a RDP session to Windows XP Professional SP3. This workaround prevents resulting problems in the UI callbacks.

Some Microsoft servers send erroneous high values close to the sint16 maximum in the OpRight field of the GlyphIndex, FastIndex and FastGlyph drawing orders, probably a result of applications trying to clear the text line to the very right end. One example where this can be seen is typing in notepad.exe within a RDP session to Windows XP Professional SP3. This workaround prevents resulting problems in the UI callbacks.

Here is the call graph for this function:
Here is the caller graph for this function: