3 * Copyright © 2000 SuSE, Inc.
5 * Permission to use, copy, modify, distribute, and sell this software and its
6 * documentation for any purpose is hereby granted without fee, provided that
7 * the above copyright notice appear in all copies and that both that
8 * copyright notice and this permission notice appear in supporting
9 * documentation, and that the name of SuSE not be used in advertising or
10 * publicity pertaining to distribution of the software without specific,
11 * written prior permission. SuSE makes no representations about the
12 * suitability of this software for any purpose. It is provided "as is"
13 * without express or implied warranty.
15 * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
17 * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
18 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
19 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
20 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22 * Author: Keith Packard, SuSE, Inc.
28 #include <X11/extensions/renderproto.h>
30 #include "screenint.h"
31 #include "regionstr.h"
32 #include "miscstruct.h"
35 #define GlyphFormat1 0
36 #define GlyphFormat4 1
37 #define GlyphFormat8 2
38 #define GlyphFormat16 3
39 #define GlyphFormat32 4
40 #define GlyphFormatNum 5
42 typedef struct _Glyph
{
44 PrivateRec
*devPrivates
;
45 unsigned char sha1
[20];
46 CARD32 size
; /* info + bitmap */
48 /* per-screen pixmaps follow */
49 } GlyphRec
, *GlyphPtr
;
51 #define GlyphPicture(glyph) ((PicturePtr *) ((glyph) + 1))
53 typedef struct _GlyphRef
{
56 } GlyphRefRec
, *GlyphRefPtr
;
58 #define DeletedGlyph ((GlyphPtr) 1)
60 typedef struct _GlyphHashSet
{
64 } GlyphHashSetRec
, *GlyphHashSetPtr
;
66 typedef struct _GlyphHash
{
68 GlyphHashSetPtr hashSet
;
70 } GlyphHashRec
, *GlyphHashPtr
;
72 typedef struct _GlyphSet
{
77 PrivateRec
*devPrivates
;
78 } GlyphSetRec
, *GlyphSetPtr
;
80 #define GlyphSetGetPrivate(pGlyphSet,k) \
81 dixLookupPrivate(&(pGlyphSet)->devPrivates, k)
83 #define GlyphSetSetPrivate(pGlyphSet,k,ptr) \
84 dixSetPrivate(&(pGlyphSet)->devPrivates, k, ptr)
86 typedef struct _GlyphList
{
91 } GlyphListRec
, *GlyphListPtr
;
94 GlyphUninit(ScreenPtr pScreen
);
96 extern _X_EXPORT GlyphHashSetPtr
FindGlyphHashSet(CARD32 filled
);
98 extern _X_EXPORT GlyphRefPtr
99 FindGlyphRef(GlyphHashPtr hash
,
100 CARD32 signature
, Bool match
, unsigned char sha1
[20]);
102 extern _X_EXPORT GlyphPtr
FindGlyphByHash(unsigned char sha1
[20], int format
);
106 HashGlyph(xGlyphInfo
* gi
,
107 CARD8
*bits
, unsigned long size
, unsigned char sha1
[20]);
109 extern _X_EXPORT
void
110 FreeGlyph(GlyphPtr glyph
, int format
);
112 extern _X_EXPORT
void
113 AddGlyph(GlyphSetPtr glyphSet
, GlyphPtr glyph
, Glyph id
);
115 extern _X_EXPORT Bool
116 DeleteGlyph(GlyphSetPtr glyphSet
, Glyph id
);
118 extern _X_EXPORT GlyphPtr
FindGlyph(GlyphSetPtr glyphSet
, Glyph id
);
120 extern _X_EXPORT GlyphPtr
AllocateGlyph(xGlyphInfo
* gi
, int format
);
122 extern _X_EXPORT Bool
123 AllocateGlyphHash(GlyphHashPtr hash
, GlyphHashSetPtr hashSet
);
125 extern _X_EXPORT Bool
126 ResizeGlyphHash(GlyphHashPtr hash
, CARD32 change
, Bool global
);
128 extern _X_EXPORT Bool
129 ResizeGlyphSet(GlyphSetPtr glyphSet
, CARD32 change
);
131 extern _X_EXPORT GlyphSetPtr
AllocateGlyphSet(int fdepth
, PictFormatPtr format
);
134 FreeGlyphSet(pointer value
, XID gid
);
136 #define GLYPH_HAS_GLYPH_PICTURE_ACCESSOR 1 /* used for api compat */
137 extern _X_EXPORT PicturePtr
138 GetGlyphPicture(GlyphPtr glyph
, ScreenPtr pScreen
);
139 extern _X_EXPORT
void
140 SetGlyphPicture(GlyphPtr glyph
, ScreenPtr pScreen
, PicturePtr picture
);
142 #endif /* _GLYPHSTR_H_ */