f78b12e570284aa8291f4ca1add24937fd107403vboxsync/*
f78b12e570284aa8291f4ca1add24937fd107403vboxsync *
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * Copyright © 2000 SuSE, Inc.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync *
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * Permission to use, copy, modify, distribute, and sell this software and its
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * documentation for any purpose is hereby granted without fee, provided that
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * the above copyright notice appear in all copies and that both that
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * copyright notice and this permission notice appear in supporting
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * documentation, and that the name of SuSE not be used in advertising or
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * publicity pertaining to distribution of the software without specific,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * written prior permission. SuSE makes no representations about the
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * suitability of this software for any purpose. It is provided "as is"
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * without express or implied warranty.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync *
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync *
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * Author: Keith Packard, SuSE, Inc.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#ifndef _GLYPHSTR_H_
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define _GLYPHSTR_H_
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#include <X11/extensions/renderproto.h>
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#include "picture.h"
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#include "screenint.h"
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#include "regionstr.h"
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#include "miscstruct.h"
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#include "privates.h"
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define GlyphFormat1 0
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define GlyphFormat4 1
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define GlyphFormat8 2
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define GlyphFormat16 3
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define GlyphFormat32 4
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define GlyphFormatNum 5
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsynctypedef struct _Glyph {
f78b12e570284aa8291f4ca1add24937fd107403vboxsync CARD32 refcnt;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync PrivateRec *devPrivates;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync unsigned char sha1[20];
f78b12e570284aa8291f4ca1add24937fd107403vboxsync CARD32 size; /* info + bitmap */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync xGlyphInfo info;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync /* per-screen pixmaps follow */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync} GlyphRec, *GlyphPtr;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define GlyphPicture(glyph) ((PicturePtr *) ((glyph) + 1))
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsynctypedef struct _GlyphRef {
f78b12e570284aa8291f4ca1add24937fd107403vboxsync CARD32 signature;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync GlyphPtr glyph;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync} GlyphRefRec, *GlyphRefPtr;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define DeletedGlyph ((GlyphPtr) 1)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsynctypedef struct _GlyphHashSet {
f78b12e570284aa8291f4ca1add24937fd107403vboxsync CARD32 entries;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync CARD32 size;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync CARD32 rehash;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync} GlyphHashSetRec, *GlyphHashSetPtr;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsynctypedef struct _GlyphHash {
f78b12e570284aa8291f4ca1add24937fd107403vboxsync GlyphRefPtr table;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync GlyphHashSetPtr hashSet;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync CARD32 tableEntries;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync} GlyphHashRec, *GlyphHashPtr;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsynctypedef struct _GlyphSet {
f78b12e570284aa8291f4ca1add24937fd107403vboxsync CARD32 refcnt;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync int fdepth;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync PictFormatPtr format;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync GlyphHashRec hash;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync PrivateRec *devPrivates;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync} GlyphSetRec, *GlyphSetPtr;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define GlyphSetGetPrivate(pGlyphSet,k) \
f78b12e570284aa8291f4ca1add24937fd107403vboxsync dixLookupPrivate(&(pGlyphSet)->devPrivates, k)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define GlyphSetSetPrivate(pGlyphSet,k,ptr) \
f78b12e570284aa8291f4ca1add24937fd107403vboxsync dixSetPrivate(&(pGlyphSet)->devPrivates, k, ptr)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsynctypedef struct _GlyphList {
f78b12e570284aa8291f4ca1add24937fd107403vboxsync INT16 xOff;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync INT16 yOff;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync CARD8 len;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync PictFormatPtr format;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync} GlyphListRec, *GlyphListPtr;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncextern _X_EXPORT GlyphHashSetPtr
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncFindGlyphHashSet (CARD32 filled);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncextern _X_EXPORT void
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncGlyphUninit (ScreenPtr pScreen);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncextern _X_EXPORT GlyphHashSetPtr
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncFindGlyphHashSet (CARD32 filled);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncextern _X_EXPORT GlyphRefPtr
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncFindGlyphRef (GlyphHashPtr hash,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync CARD32 signature,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync Bool match,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync unsigned char sha1[20]);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncextern _X_EXPORT GlyphPtr
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncFindGlyphByHash (unsigned char sha1[20], int format);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncextern _X_EXPORT int
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncHashGlyph (xGlyphInfo *gi,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync CARD8 *bits,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync unsigned long size,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync unsigned char sha1[20]);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncextern _X_EXPORT void
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncFreeGlyph (GlyphPtr glyph, int format);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncextern _X_EXPORT void
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncAddGlyph (GlyphSetPtr glyphSet, GlyphPtr glyph, Glyph id);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncextern _X_EXPORT Bool
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncDeleteGlyph (GlyphSetPtr glyphSet, Glyph id);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncextern _X_EXPORT GlyphPtr
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncFindGlyph (GlyphSetPtr glyphSet, Glyph id);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncextern _X_EXPORT GlyphPtr
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncAllocateGlyph (xGlyphInfo *gi, int format);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncextern _X_EXPORT Bool
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncAllocateGlyphHash (GlyphHashPtr hash, GlyphHashSetPtr hashSet);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncextern _X_EXPORT Bool
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncResizeGlyphHash (GlyphHashPtr hash, CARD32 change, Bool global);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncextern _X_EXPORT Bool
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncResizeGlyphSet (GlyphSetPtr glyphSet, CARD32 change);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncextern _X_EXPORT GlyphSetPtr
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncAllocateGlyphSet (int fdepth, PictFormatPtr format);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncextern _X_EXPORT int
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncFreeGlyphSet (pointer value,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync XID gid);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#endif /* _GLYPHSTR_H_ */