1 |
|
---|
2 | /*
|
---|
3 | * Copyright (c) 1998-2001 by The XFree86 Project, Inc.
|
---|
4 | *
|
---|
5 | * Permission is hereby granted, free of charge, to any person obtaining a
|
---|
6 | * copy of this software and associated documentation files (the "Software"),
|
---|
7 | * to deal in the Software without restriction, including without limitation
|
---|
8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
---|
9 | * and/or sell copies of the Software, and to permit persons to whom the
|
---|
10 | * Software is furnished to do so, subject to the following conditions:
|
---|
11 | *
|
---|
12 | * The above copyright notice and this permission notice shall be included in
|
---|
13 | * all copies or substantial portions of the Software.
|
---|
14 | *
|
---|
15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
---|
16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
---|
17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
---|
18 | * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
---|
19 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
---|
20 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
---|
21 | * OTHER DEALINGS IN THE SOFTWARE.
|
---|
22 | *
|
---|
23 | * Except as contained in this notice, the name of the copyright holder(s)
|
---|
24 | * and author(s) shall not be used in advertising or otherwise to promote
|
---|
25 | * the sale, use or other dealings in this Software without prior written
|
---|
26 | * authorization from the copyright holder(s) and author(s).
|
---|
27 | */
|
---|
28 |
|
---|
29 | #ifndef _XF86FBMAN_H
|
---|
30 | #define _XF86FBMAN_H
|
---|
31 |
|
---|
32 |
|
---|
33 | #include "scrnintstr.h"
|
---|
34 | #include "regionstr.h"
|
---|
35 |
|
---|
36 |
|
---|
37 | #define FAVOR_AREA_THEN_WIDTH 0
|
---|
38 | #define FAVOR_AREA_THEN_HEIGHT 1
|
---|
39 | #define FAVOR_WIDTH_THEN_AREA 2
|
---|
40 | #define FAVOR_HEIGHT_THEN_AREA 3
|
---|
41 |
|
---|
42 | #define PRIORITY_LOW 0
|
---|
43 | #define PRIORITY_NORMAL 1
|
---|
44 | #define PRIORITY_EXTREME 2
|
---|
45 |
|
---|
46 |
|
---|
47 | typedef struct _FBArea {
|
---|
48 | ScreenPtr pScreen;
|
---|
49 | BoxRec box;
|
---|
50 | int granularity;
|
---|
51 | void (*MoveAreaCallback)(struct _FBArea*, struct _FBArea*);
|
---|
52 | void (*RemoveAreaCallback)(struct _FBArea*);
|
---|
53 | DevUnion devPrivate;
|
---|
54 | } FBArea, *FBAreaPtr;
|
---|
55 |
|
---|
56 | typedef struct _FBLinear {
|
---|
57 | ScreenPtr pScreen;
|
---|
58 | int size;
|
---|
59 | int offset;
|
---|
60 | int granularity;
|
---|
61 | void (*MoveLinearCallback)(struct _FBLinear*, struct _FBLinear*);
|
---|
62 | void (*RemoveLinearCallback)(struct _FBLinear*);
|
---|
63 | DevUnion devPrivate;
|
---|
64 | } FBLinear, *FBLinearPtr;
|
---|
65 |
|
---|
66 | typedef void (*FreeBoxCallbackProcPtr)(ScreenPtr, RegionPtr, pointer);
|
---|
67 | typedef void (*MoveAreaCallbackProcPtr)(FBAreaPtr, FBAreaPtr);
|
---|
68 | typedef void (*RemoveAreaCallbackProcPtr)(FBAreaPtr);
|
---|
69 |
|
---|
70 | typedef void (*MoveLinearCallbackProcPtr)(FBLinearPtr, FBLinearPtr);
|
---|
71 | typedef void (*RemoveLinearCallbackProcPtr)(FBLinearPtr);
|
---|
72 |
|
---|
73 |
|
---|
74 | typedef struct {
|
---|
75 | FBAreaPtr (*AllocateOffscreenArea)(
|
---|
76 | ScreenPtr pScreen,
|
---|
77 | int w, int h,
|
---|
78 | int granularity,
|
---|
79 | MoveAreaCallbackProcPtr moveCB,
|
---|
80 | RemoveAreaCallbackProcPtr removeCB,
|
---|
81 | pointer privData);
|
---|
82 | void (*FreeOffscreenArea)(FBAreaPtr area);
|
---|
83 | Bool (*ResizeOffscreenArea)(FBAreaPtr area, int w, int h);
|
---|
84 | Bool (*QueryLargestOffscreenArea)(
|
---|
85 | ScreenPtr pScreen,
|
---|
86 | int *width, int *height,
|
---|
87 | int granularity,
|
---|
88 | int preferences,
|
---|
89 | int priority);
|
---|
90 | Bool (*RegisterFreeBoxCallback)(
|
---|
91 | ScreenPtr pScreen,
|
---|
92 | FreeBoxCallbackProcPtr FreeBoxCallback,
|
---|
93 | pointer devPriv);
|
---|
94 | /* linear functions */
|
---|
95 | FBLinearPtr (*AllocateOffscreenLinear)(
|
---|
96 | ScreenPtr pScreen,
|
---|
97 | int size,
|
---|
98 | int granularity,
|
---|
99 | MoveLinearCallbackProcPtr moveCB,
|
---|
100 | RemoveLinearCallbackProcPtr removeCB,
|
---|
101 | pointer privData);
|
---|
102 | void (*FreeOffscreenLinear)(FBLinearPtr area);
|
---|
103 | Bool (*ResizeOffscreenLinear)(FBLinearPtr area, int size);
|
---|
104 | Bool (*QueryLargestOffscreenLinear)(
|
---|
105 | ScreenPtr pScreen,
|
---|
106 | int *size,
|
---|
107 | int granularity,
|
---|
108 | int priority);
|
---|
109 | Bool (*PurgeOffscreenAreas) (ScreenPtr);
|
---|
110 | } FBManagerFuncs, *FBManagerFuncsPtr;
|
---|
111 |
|
---|
112 |
|
---|
113 | Bool xf86RegisterOffscreenManager(
|
---|
114 | ScreenPtr pScreen,
|
---|
115 | FBManagerFuncsPtr funcs
|
---|
116 | );
|
---|
117 |
|
---|
118 | Bool
|
---|
119 | xf86InitFBManagerRegion(
|
---|
120 | ScreenPtr pScreen,
|
---|
121 | RegionPtr ScreenRegion
|
---|
122 | );
|
---|
123 |
|
---|
124 | Bool
|
---|
125 | xf86InitFBManagerArea(
|
---|
126 | ScreenPtr pScreen,
|
---|
127 | int PixalArea,
|
---|
128 | int Verbosity
|
---|
129 | );
|
---|
130 |
|
---|
131 | Bool
|
---|
132 | xf86InitFBManager(
|
---|
133 | ScreenPtr pScreen,
|
---|
134 | BoxPtr FullBox
|
---|
135 | );
|
---|
136 |
|
---|
137 | Bool
|
---|
138 | xf86InitFBManagerLinear(
|
---|
139 | ScreenPtr pScreen,
|
---|
140 | int offset,
|
---|
141 | int size
|
---|
142 | );
|
---|
143 |
|
---|
144 | Bool
|
---|
145 | xf86FBManagerRunning(
|
---|
146 | ScreenPtr pScreen
|
---|
147 | );
|
---|
148 |
|
---|
149 | FBAreaPtr
|
---|
150 | xf86AllocateOffscreenArea (
|
---|
151 | ScreenPtr pScreen,
|
---|
152 | int w, int h,
|
---|
153 | int granularity,
|
---|
154 | MoveAreaCallbackProcPtr moveCB,
|
---|
155 | RemoveAreaCallbackProcPtr removeCB,
|
---|
156 | pointer privData
|
---|
157 | );
|
---|
158 |
|
---|
159 | FBAreaPtr
|
---|
160 | xf86AllocateLinearOffscreenArea (
|
---|
161 | ScreenPtr pScreen,
|
---|
162 | int length,
|
---|
163 | int granularity,
|
---|
164 | MoveAreaCallbackProcPtr moveCB,
|
---|
165 | RemoveAreaCallbackProcPtr removeCB,
|
---|
166 | pointer privData
|
---|
167 | );
|
---|
168 |
|
---|
169 | FBLinearPtr
|
---|
170 | xf86AllocateOffscreenLinear (
|
---|
171 | ScreenPtr pScreen,
|
---|
172 | int length,
|
---|
173 | int granularity,
|
---|
174 | MoveLinearCallbackProcPtr moveCB,
|
---|
175 | RemoveLinearCallbackProcPtr removeCB,
|
---|
176 | pointer privData
|
---|
177 | );
|
---|
178 |
|
---|
179 | void xf86FreeOffscreenArea(FBAreaPtr area);
|
---|
180 | void xf86FreeOffscreenLinear(FBLinearPtr area);
|
---|
181 |
|
---|
182 | Bool
|
---|
183 | xf86ResizeOffscreenArea(
|
---|
184 | FBAreaPtr resize,
|
---|
185 | int w, int h
|
---|
186 | );
|
---|
187 |
|
---|
188 | Bool
|
---|
189 | xf86ResizeOffscreenLinear(
|
---|
190 | FBLinearPtr resize,
|
---|
191 | int size
|
---|
192 | );
|
---|
193 |
|
---|
194 |
|
---|
195 | Bool
|
---|
196 | xf86RegisterFreeBoxCallback(
|
---|
197 | ScreenPtr pScreen,
|
---|
198 | FreeBoxCallbackProcPtr FreeBoxCallback,
|
---|
199 | pointer devPriv
|
---|
200 | );
|
---|
201 |
|
---|
202 | Bool
|
---|
203 | xf86PurgeUnlockedOffscreenAreas(
|
---|
204 | ScreenPtr pScreen
|
---|
205 | );
|
---|
206 |
|
---|
207 |
|
---|
208 | Bool
|
---|
209 | xf86QueryLargestOffscreenArea(
|
---|
210 | ScreenPtr pScreen,
|
---|
211 | int *width, int *height,
|
---|
212 | int granularity,
|
---|
213 | int preferences,
|
---|
214 | int priority
|
---|
215 | );
|
---|
216 |
|
---|
217 | Bool
|
---|
218 | xf86QueryLargestOffscreenLinear(
|
---|
219 | ScreenPtr pScreen,
|
---|
220 | int *size,
|
---|
221 | int granularity,
|
---|
222 | int priority
|
---|
223 | );
|
---|
224 |
|
---|
225 |
|
---|
226 | #endif /* _XF86FBMAN_H */
|
---|