1 | /*
|
---|
2 | * $XFree86: xc/programs/Xserver/render/glyphstr.h,v 1.3 2000/11/20 07:13:13 keithp Exp $
|
---|
3 | *
|
---|
4 | * Copyright © 2000 SuSE, Inc.
|
---|
5 | *
|
---|
6 | * Permission to use, copy, modify, distribute, and sell this software and its
|
---|
7 | * documentation for any purpose is hereby granted without fee, provided that
|
---|
8 | * the above copyright notice appear in all copies and that both that
|
---|
9 | * copyright notice and this permission notice appear in supporting
|
---|
10 | * documentation, and that the name of SuSE not be used in advertising or
|
---|
11 | * publicity pertaining to distribution of the software without specific,
|
---|
12 | * written prior permission. SuSE makes no representations about the
|
---|
13 | * suitability of this software for any purpose. It is provided "as is"
|
---|
14 | * without express or implied warranty.
|
---|
15 | *
|
---|
16 | * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
|
---|
17 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
|
---|
18 | * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
---|
19 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
|
---|
20 | * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
---|
21 | * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
---|
22 | *
|
---|
23 | * Author: Keith Packard, SuSE, Inc.
|
---|
24 | */
|
---|
25 |
|
---|
26 | #ifndef _GLYPHSTR_H_
|
---|
27 | #define _GLYPHSTR_H_
|
---|
28 |
|
---|
29 | #include <X11/extensions/renderproto.h>
|
---|
30 | #include "picture.h"
|
---|
31 | #include "screenint.h"
|
---|
32 |
|
---|
33 | #define GlyphFormat1 0
|
---|
34 | #define GlyphFormat4 1
|
---|
35 | #define GlyphFormat8 2
|
---|
36 | #define GlyphFormat16 3
|
---|
37 | #define GlyphFormat32 4
|
---|
38 | #define GlyphFormatNum 5
|
---|
39 |
|
---|
40 | typedef struct _Glyph {
|
---|
41 | CARD32 refcnt;
|
---|
42 | CARD32 size; /* info + bitmap */
|
---|
43 | xGlyphInfo info;
|
---|
44 | /* bits follow */
|
---|
45 | } GlyphRec, *GlyphPtr;
|
---|
46 |
|
---|
47 | typedef struct _GlyphRef {
|
---|
48 | CARD32 signature;
|
---|
49 | GlyphPtr glyph;
|
---|
50 | } GlyphRefRec, *GlyphRefPtr;
|
---|
51 |
|
---|
52 | #define DeletedGlyph ((GlyphPtr) 1)
|
---|
53 |
|
---|
54 | typedef struct _GlyphHashSet {
|
---|
55 | CARD32 entries;
|
---|
56 | CARD32 size;
|
---|
57 | CARD32 rehash;
|
---|
58 | } GlyphHashSetRec, *GlyphHashSetPtr;
|
---|
59 |
|
---|
60 | typedef struct _GlyphHash {
|
---|
61 | GlyphRefPtr table;
|
---|
62 | GlyphHashSetPtr hashSet;
|
---|
63 | CARD32 tableEntries;
|
---|
64 | } GlyphHashRec, *GlyphHashPtr;
|
---|
65 |
|
---|
66 | typedef struct _GlyphSet {
|
---|
67 | CARD32 refcnt;
|
---|
68 | PictFormatPtr format;
|
---|
69 | int fdepth;
|
---|
70 | GlyphHashRec hash;
|
---|
71 | int maxPrivate;
|
---|
72 | pointer *devPrivates;
|
---|
73 | } GlyphSetRec, *GlyphSetPtr;
|
---|
74 |
|
---|
75 | #define GlyphSetGetPrivate(pGlyphSet,n) \
|
---|
76 | ((n) > (pGlyphSet)->maxPrivate ? \
|
---|
77 | (pointer) 0 : \
|
---|
78 | (pGlyphSet)->devPrivates[n])
|
---|
79 |
|
---|
80 | #define GlyphSetSetPrivate(pGlyphSet,n,ptr) \
|
---|
81 | ((n) > (pGlyphSet)->maxPrivate ? \
|
---|
82 | _GlyphSetSetNewPrivate(pGlyphSet, n, ptr) : \
|
---|
83 | ((((pGlyphSet)->devPrivates[n] = (ptr)) != 0) || TRUE))
|
---|
84 |
|
---|
85 | typedef struct _GlyphList {
|
---|
86 | INT16 xOff;
|
---|
87 | INT16 yOff;
|
---|
88 | CARD8 len;
|
---|
89 | PictFormatPtr format;
|
---|
90 | } GlyphListRec, *GlyphListPtr;
|
---|
91 |
|
---|
92 | extern GlyphHashRec globalGlyphs[GlyphFormatNum];
|
---|
93 |
|
---|
94 | GlyphHashSetPtr
|
---|
95 | FindGlyphHashSet (CARD32 filled);
|
---|
96 |
|
---|
97 | int
|
---|
98 | AllocateGlyphSetPrivateIndex (void);
|
---|
99 |
|
---|
100 | void
|
---|
101 | ResetGlyphSetPrivateIndex (void);
|
---|
102 |
|
---|
103 | Bool
|
---|
104 | _GlyphSetSetNewPrivate (GlyphSetPtr glyphSet, int n, pointer ptr);
|
---|
105 |
|
---|
106 | Bool
|
---|
107 | GlyphInit (ScreenPtr pScreen);
|
---|
108 |
|
---|
109 | GlyphRefPtr
|
---|
110 | FindGlyphRef (GlyphHashPtr hash, CARD32 signature, Bool match, GlyphPtr compare);
|
---|
111 |
|
---|
112 | CARD32
|
---|
113 | HashGlyph (GlyphPtr glyph);
|
---|
114 |
|
---|
115 | void
|
---|
116 | FreeGlyph (GlyphPtr glyph, int format);
|
---|
117 |
|
---|
118 | void
|
---|
119 | AddGlyph (GlyphSetPtr glyphSet, GlyphPtr glyph, Glyph id);
|
---|
120 |
|
---|
121 | Bool
|
---|
122 | DeleteGlyph (GlyphSetPtr glyphSet, Glyph id);
|
---|
123 |
|
---|
124 | GlyphPtr
|
---|
125 | FindGlyph (GlyphSetPtr glyphSet, Glyph id);
|
---|
126 |
|
---|
127 | GlyphPtr
|
---|
128 | AllocateGlyph (xGlyphInfo *gi, int format);
|
---|
129 |
|
---|
130 | Bool
|
---|
131 | AllocateGlyphHash (GlyphHashPtr hash, GlyphHashSetPtr hashSet);
|
---|
132 |
|
---|
133 | Bool
|
---|
134 | ResizeGlyphHash (GlyphHashPtr hash, CARD32 change, Bool global);
|
---|
135 |
|
---|
136 | Bool
|
---|
137 | ResizeGlyphSet (GlyphSetPtr glyphSet, CARD32 change);
|
---|
138 |
|
---|
139 | GlyphSetPtr
|
---|
140 | AllocateGlyphSet (int fdepth, PictFormatPtr format);
|
---|
141 |
|
---|
142 | int
|
---|
143 | FreeGlyphSet (pointer value,
|
---|
144 | XID gid);
|
---|
145 |
|
---|
146 |
|
---|
147 |
|
---|
148 | #endif /* _GLYPHSTR_H_ */
|
---|