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 | #include "privates.h"
|
---|
34 |
|
---|
35 | #define GlyphFormat1 0
|
---|
36 | #define GlyphFormat4 1
|
---|
37 | #define GlyphFormat8 2
|
---|
38 | #define GlyphFormat16 3
|
---|
39 | #define GlyphFormat32 4
|
---|
40 | #define GlyphFormatNum 5
|
---|
41 |
|
---|
42 | typedef struct _Glyph {
|
---|
43 | CARD32 refcnt;
|
---|
44 | PrivateRec *devPrivates;
|
---|
45 | unsigned char sha1[20];
|
---|
46 | CARD32 size; /* info + bitmap */
|
---|
47 | xGlyphInfo info;
|
---|
48 | /* per-screen pixmaps follow */
|
---|
49 | } GlyphRec, *GlyphPtr;
|
---|
50 |
|
---|
51 | #define GlyphPicture(glyph) ((PicturePtr *) ((glyph) + 1))
|
---|
52 |
|
---|
53 | typedef struct _GlyphRef {
|
---|
54 | CARD32 signature;
|
---|
55 | GlyphPtr glyph;
|
---|
56 | } GlyphRefRec, *GlyphRefPtr;
|
---|
57 |
|
---|
58 | #define DeletedGlyph ((GlyphPtr) 1)
|
---|
59 |
|
---|
60 | typedef struct _GlyphHashSet {
|
---|
61 | CARD32 entries;
|
---|
62 | CARD32 size;
|
---|
63 | CARD32 rehash;
|
---|
64 | } GlyphHashSetRec, *GlyphHashSetPtr;
|
---|
65 |
|
---|
66 | typedef struct _GlyphHash {
|
---|
67 | GlyphRefPtr table;
|
---|
68 | GlyphHashSetPtr hashSet;
|
---|
69 | CARD32 tableEntries;
|
---|
70 | } GlyphHashRec, *GlyphHashPtr;
|
---|
71 |
|
---|
72 | typedef struct _GlyphSet {
|
---|
73 | CARD32 refcnt;
|
---|
74 | PictFormatPtr format;
|
---|
75 | int fdepth;
|
---|
76 | GlyphHashRec hash;
|
---|
77 | int maxPrivate;
|
---|
78 | PrivateRec *devPrivates;
|
---|
79 | } GlyphSetRec, *GlyphSetPtr;
|
---|
80 |
|
---|
81 | #define GlyphSetGetPrivate(pGlyphSet,k) \
|
---|
82 | dixLookupPrivate(&(pGlyphSet)->devPrivates, k)
|
---|
83 |
|
---|
84 | #define GlyphSetSetPrivate(pGlyphSet,k,ptr) \
|
---|
85 | dixSetPrivate(&(pGlyphSet)->devPrivates, k, ptr)
|
---|
86 |
|
---|
87 | typedef struct _GlyphList {
|
---|
88 | INT16 xOff;
|
---|
89 | INT16 yOff;
|
---|
90 | CARD8 len;
|
---|
91 | PictFormatPtr format;
|
---|
92 | } GlyphListRec, *GlyphListPtr;
|
---|
93 |
|
---|
94 | GlyphHashSetPtr
|
---|
95 | FindGlyphHashSet (CARD32 filled);
|
---|
96 |
|
---|
97 | void
|
---|
98 | GlyphUninit (ScreenPtr pScreen);
|
---|
99 |
|
---|
100 | GlyphHashSetPtr
|
---|
101 | FindGlyphHashSet (CARD32 filled);
|
---|
102 |
|
---|
103 | GlyphRefPtr
|
---|
104 | FindGlyphRef (GlyphHashPtr hash,
|
---|
105 | CARD32 signature,
|
---|
106 | Bool match,
|
---|
107 | unsigned char sha1[20]);
|
---|
108 |
|
---|
109 | GlyphPtr
|
---|
110 | FindGlyphByHash (unsigned char sha1[20], int format);
|
---|
111 |
|
---|
112 | int
|
---|
113 | HashGlyph (xGlyphInfo *gi,
|
---|
114 | CARD8 *bits,
|
---|
115 | unsigned long size,
|
---|
116 | unsigned char sha1[20]);
|
---|
117 |
|
---|
118 | void
|
---|
119 | FreeGlyph (GlyphPtr glyph, int format);
|
---|
120 |
|
---|
121 | void
|
---|
122 | AddGlyph (GlyphSetPtr glyphSet, GlyphPtr glyph, Glyph id);
|
---|
123 |
|
---|
124 | Bool
|
---|
125 | DeleteGlyph (GlyphSetPtr glyphSet, Glyph id);
|
---|
126 |
|
---|
127 | GlyphPtr
|
---|
128 | FindGlyph (GlyphSetPtr glyphSet, Glyph id);
|
---|
129 |
|
---|
130 | GlyphPtr
|
---|
131 | AllocateGlyph (xGlyphInfo *gi, int format);
|
---|
132 |
|
---|
133 | Bool
|
---|
134 | AllocateGlyphHash (GlyphHashPtr hash, GlyphHashSetPtr hashSet);
|
---|
135 |
|
---|
136 | Bool
|
---|
137 | ResizeGlyphHash (GlyphHashPtr hash, CARD32 change, Bool global);
|
---|
138 |
|
---|
139 | Bool
|
---|
140 | ResizeGlyphSet (GlyphSetPtr glyphSet, CARD32 change);
|
---|
141 |
|
---|
142 | GlyphSetPtr
|
---|
143 | AllocateGlyphSet (int fdepth, PictFormatPtr format);
|
---|
144 |
|
---|
145 | int
|
---|
146 | FreeGlyphSet (pointer value,
|
---|
147 | XID gid);
|
---|
148 |
|
---|
149 |
|
---|
150 |
|
---|
151 | #endif /* _GLYPHSTR_H_ */
|
---|