1 | /*
|
---|
2 | *
|
---|
3 | * Copyright © 2000 SuSE, Inc.
|
---|
4 | *
|
---|
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.
|
---|
14 | *
|
---|
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.
|
---|
21 | *
|
---|
22 | * Author: Keith Packard, SuSE, Inc.
|
---|
23 | */
|
---|
24 |
|
---|
25 | #ifndef _GLYPHSTR_H_
|
---|
26 | #define _GLYPHSTR_H_
|
---|
27 |
|
---|
28 | #include <X11/extensions/renderproto.h>
|
---|
29 | #include "picture.h"
|
---|
30 | #include "screenint.h"
|
---|
31 | #include "regionstr.h"
|
---|
32 | #include "miscstruct.h"
|
---|
33 |
|
---|
34 | #define GlyphFormat1 0
|
---|
35 | #define GlyphFormat4 1
|
---|
36 | #define GlyphFormat8 2
|
---|
37 | #define GlyphFormat16 3
|
---|
38 | #define GlyphFormat32 4
|
---|
39 | #define GlyphFormatNum 5
|
---|
40 |
|
---|
41 | typedef struct _Glyph {
|
---|
42 | CARD32 refcnt;
|
---|
43 | DevUnion *devPrivates;
|
---|
44 | CARD32 size; /* info + bitmap */
|
---|
45 | xGlyphInfo info;
|
---|
46 | /* bits follow */
|
---|
47 | } GlyphRec, *GlyphPtr;
|
---|
48 |
|
---|
49 | typedef struct _GlyphRef {
|
---|
50 | CARD32 signature;
|
---|
51 | GlyphPtr glyph;
|
---|
52 | } GlyphRefRec, *GlyphRefPtr;
|
---|
53 |
|
---|
54 | #define DeletedGlyph ((GlyphPtr) 1)
|
---|
55 |
|
---|
56 | typedef struct _GlyphHashSet {
|
---|
57 | CARD32 entries;
|
---|
58 | CARD32 size;
|
---|
59 | CARD32 rehash;
|
---|
60 | } GlyphHashSetRec, *GlyphHashSetPtr;
|
---|
61 |
|
---|
62 | typedef struct _GlyphHash {
|
---|
63 | GlyphRefPtr table;
|
---|
64 | GlyphHashSetPtr hashSet;
|
---|
65 | CARD32 tableEntries;
|
---|
66 | } GlyphHashRec, *GlyphHashPtr;
|
---|
67 |
|
---|
68 | typedef struct _GlyphSet {
|
---|
69 | CARD32 refcnt;
|
---|
70 | PictFormatPtr format;
|
---|
71 | int fdepth;
|
---|
72 | GlyphHashRec hash;
|
---|
73 | int maxPrivate;
|
---|
74 | pointer *devPrivates;
|
---|
75 | } GlyphSetRec, *GlyphSetPtr;
|
---|
76 |
|
---|
77 | #define GlyphSetGetPrivate(pGlyphSet,n) \
|
---|
78 | ((n) > (pGlyphSet)->maxPrivate ? \
|
---|
79 | (pointer) 0 : \
|
---|
80 | (pGlyphSet)->devPrivates[n])
|
---|
81 |
|
---|
82 | #define GlyphSetSetPrivate(pGlyphSet,n,ptr) \
|
---|
83 | ((n) > (pGlyphSet)->maxPrivate ? \
|
---|
84 | _GlyphSetSetNewPrivate(pGlyphSet, n, ptr) : \
|
---|
85 | ((((pGlyphSet)->devPrivates[n] = (ptr)) != 0) || TRUE))
|
---|
86 |
|
---|
87 | typedef struct _GlyphList {
|
---|
88 | INT16 xOff;
|
---|
89 | INT16 yOff;
|
---|
90 | CARD8 len;
|
---|
91 | PictFormatPtr format;
|
---|
92 | } GlyphListRec, *GlyphListPtr;
|
---|
93 |
|
---|
94 | extern GlyphHashRec globalGlyphs[GlyphFormatNum];
|
---|
95 |
|
---|
96 | GlyphHashSetPtr
|
---|
97 | FindGlyphHashSet (CARD32 filled);
|
---|
98 |
|
---|
99 | int
|
---|
100 | AllocateGlyphSetPrivateIndex (void);
|
---|
101 |
|
---|
102 | void
|
---|
103 | ResetGlyphSetPrivateIndex (void);
|
---|
104 |
|
---|
105 | Bool
|
---|
106 | _GlyphSetSetNewPrivate (GlyphSetPtr glyphSet, int n, pointer ptr);
|
---|
107 |
|
---|
108 | void
|
---|
109 | ResetGlyphPrivates (void);
|
---|
110 |
|
---|
111 | int
|
---|
112 | AllocateGlyphPrivateIndex (void);
|
---|
113 |
|
---|
114 | Bool
|
---|
115 | AllocateGlyphPrivate (ScreenPtr pScreen,
|
---|
116 | int index2,
|
---|
117 | unsigned amount);
|
---|
118 |
|
---|
119 | Bool
|
---|
120 | GlyphInit (ScreenPtr pScreen);
|
---|
121 |
|
---|
122 | Bool
|
---|
123 | GlyphFinishInit (ScreenPtr pScreen);
|
---|
124 |
|
---|
125 | void
|
---|
126 | GlyphUninit (ScreenPtr pScreen);
|
---|
127 |
|
---|
128 | GlyphHashSetPtr
|
---|
129 | FindGlyphHashSet (CARD32 filled);
|
---|
130 |
|
---|
131 | GlyphRefPtr
|
---|
132 | FindGlyphRef (GlyphHashPtr hash, CARD32 signature, Bool match, GlyphPtr compare);
|
---|
133 |
|
---|
134 | CARD32
|
---|
135 | HashGlyph (GlyphPtr glyph);
|
---|
136 |
|
---|
137 | void
|
---|
138 | FreeGlyph (GlyphPtr glyph, int format);
|
---|
139 |
|
---|
140 | void
|
---|
141 | AddGlyph (GlyphSetPtr glyphSet, GlyphPtr glyph, Glyph id);
|
---|
142 |
|
---|
143 | Bool
|
---|
144 | DeleteGlyph (GlyphSetPtr glyphSet, Glyph id);
|
---|
145 |
|
---|
146 | GlyphPtr
|
---|
147 | FindGlyph (GlyphSetPtr glyphSet, Glyph id);
|
---|
148 |
|
---|
149 | GlyphPtr
|
---|
150 | AllocateGlyph (xGlyphInfo *gi, int format);
|
---|
151 |
|
---|
152 | Bool
|
---|
153 | AllocateGlyphHash (GlyphHashPtr hash, GlyphHashSetPtr hashSet);
|
---|
154 |
|
---|
155 | Bool
|
---|
156 | ResizeGlyphHash (GlyphHashPtr hash, CARD32 change, Bool global);
|
---|
157 |
|
---|
158 | Bool
|
---|
159 | ResizeGlyphSet (GlyphSetPtr glyphSet, CARD32 change);
|
---|
160 |
|
---|
161 | GlyphSetPtr
|
---|
162 | AllocateGlyphSet (int fdepth, PictFormatPtr format);
|
---|
163 |
|
---|
164 | int
|
---|
165 | FreeGlyphSet (pointer value,
|
---|
166 | XID gid);
|
---|
167 |
|
---|
168 |
|
---|
169 |
|
---|
170 | #endif /* _GLYPHSTR_H_ */
|
---|