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"
34 #define GlyphFormat1 0
35 #define GlyphFormat4 1
36 #define GlyphFormat8 2
37 #define GlyphFormat16 3
38 #define GlyphFormat32 4
39 #define GlyphFormatNum 5
41 typedef struct _Glyph
{
43 DevUnion
*devPrivates
;
44 CARD32 size
; /* info + bitmap */
47 } GlyphRec
, *GlyphPtr
;
49 typedef struct _GlyphRef
{
52 } GlyphRefRec
, *GlyphRefPtr
;
54 #define DeletedGlyph ((GlyphPtr) 1)
56 typedef struct _GlyphHashSet
{
60 } GlyphHashSetRec
, *GlyphHashSetPtr
;
62 typedef struct _GlyphHash
{
64 GlyphHashSetPtr hashSet
;
66 } GlyphHashRec
, *GlyphHashPtr
;
68 typedef struct _GlyphSet
{
75 } GlyphSetRec
, *GlyphSetPtr
;
77 #define GlyphSetGetPrivate(pGlyphSet,n) \
78 ((n) > (pGlyphSet)->maxPrivate ? \
80 (pGlyphSet)->devPrivates[n])
82 #define GlyphSetSetPrivate(pGlyphSet,n,ptr) \
83 ((n) > (pGlyphSet)->maxPrivate ? \
84 _GlyphSetSetNewPrivate(pGlyphSet, n, ptr) : \
85 ((((pGlyphSet)->devPrivates[n] = (ptr)) != 0) || TRUE))
87 typedef struct _GlyphList
{
92 } GlyphListRec
, *GlyphListPtr
;
95 FindGlyphHashSet (CARD32 filled
);
98 AllocateGlyphSetPrivateIndex (void);
101 ResetGlyphSetPrivateIndex (void);
104 _GlyphSetSetNewPrivate (GlyphSetPtr glyphSet
, int n
, pointer ptr
);
107 ResetGlyphPrivates (void);
110 AllocateGlyphPrivateIndex (void);
113 AllocateGlyphPrivate (ScreenPtr pScreen
,
118 GlyphInit (ScreenPtr pScreen
);
121 GlyphFinishInit (ScreenPtr pScreen
);
124 GlyphUninit (ScreenPtr pScreen
);
127 FindGlyphHashSet (CARD32 filled
);
130 FindGlyphRef (GlyphHashPtr hash
, CARD32 signature
, Bool match
, GlyphPtr compare
);
133 HashGlyph (GlyphPtr glyph
);
136 FreeGlyph (GlyphPtr glyph
, int format
);
139 AddGlyph (GlyphSetPtr glyphSet
, GlyphPtr glyph
, Glyph id
);
142 DeleteGlyph (GlyphSetPtr glyphSet
, Glyph id
);
145 FindGlyph (GlyphSetPtr glyphSet
, Glyph id
);
148 AllocateGlyph (xGlyphInfo
*gi
, int format
);
151 AllocateGlyphHash (GlyphHashPtr hash
, GlyphHashSetPtr hashSet
);
154 ResizeGlyphHash (GlyphHashPtr hash
, CARD32 change
, Bool global
);
157 ResizeGlyphSet (GlyphSetPtr glyphSet
, CARD32 change
);
160 AllocateGlyphSet (int fdepth
, PictFormatPtr format
);
163 FreeGlyphSet (pointer value
,
168 #endif /* _GLYPHSTR_H_ */