3 * Copyright (c) 1998-2001 by The XFree86 Project, Inc.
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:
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
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.
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).
33 #include "scrnintstr.h"
34 #include "regionstr.h"
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
42 #define PRIORITY_LOW 0
43 #define PRIORITY_NORMAL 1
44 #define PRIORITY_EXTREME 2
47 typedef struct _FBArea
{
51 void (*MoveAreaCallback
)(struct _FBArea
*, struct _FBArea
*);
52 void (*RemoveAreaCallback
)(struct _FBArea
*);
56 typedef struct _FBLinear
{
61 void (*MoveLinearCallback
)(struct _FBLinear
*, struct _FBLinear
*);
62 void (*RemoveLinearCallback
)(struct _FBLinear
*);
64 } FBLinear
, *FBLinearPtr
;
66 typedef void (*FreeBoxCallbackProcPtr
)(ScreenPtr
, RegionPtr
, pointer
);
67 typedef void (*MoveAreaCallbackProcPtr
)(FBAreaPtr
, FBAreaPtr
);
68 typedef void (*RemoveAreaCallbackProcPtr
)(FBAreaPtr
);
70 typedef void (*MoveLinearCallbackProcPtr
)(FBLinearPtr
, FBLinearPtr
);
71 typedef void (*RemoveLinearCallbackProcPtr
)(FBLinearPtr
);
75 FBAreaPtr (*AllocateOffscreenArea
)(
79 MoveAreaCallbackProcPtr moveCB
,
80 RemoveAreaCallbackProcPtr removeCB
,
82 void (*FreeOffscreenArea
)(FBAreaPtr area
);
83 Bool (*ResizeOffscreenArea
)(FBAreaPtr area
, int w
, int h
);
84 Bool (*QueryLargestOffscreenArea
)(
86 int *width
, int *height
,
90 Bool (*RegisterFreeBoxCallback
)(
92 FreeBoxCallbackProcPtr FreeBoxCallback
,
94 /* linear functions */
95 FBLinearPtr (*AllocateOffscreenLinear
)(
99 MoveLinearCallbackProcPtr moveCB
,
100 RemoveLinearCallbackProcPtr removeCB
,
102 void (*FreeOffscreenLinear
)(FBLinearPtr area
);
103 Bool (*ResizeOffscreenLinear
)(FBLinearPtr area
, int size
);
104 Bool (*QueryLargestOffscreenLinear
)(
109 Bool (*PurgeOffscreenAreas
) (ScreenPtr
);
110 } FBManagerFuncs
, *FBManagerFuncsPtr
;
113 Bool
xf86RegisterOffscreenManager(
115 FBManagerFuncsPtr funcs
119 xf86InitFBManagerRegion(
121 RegionPtr ScreenRegion
125 xf86InitFBManagerArea(
138 xf86InitFBManagerLinear(
145 xf86FBManagerRunning(
150 xf86AllocateOffscreenArea (
154 MoveAreaCallbackProcPtr moveCB
,
155 RemoveAreaCallbackProcPtr removeCB
,
160 xf86AllocateLinearOffscreenArea (
164 MoveAreaCallbackProcPtr moveCB
,
165 RemoveAreaCallbackProcPtr removeCB
,
170 xf86AllocateOffscreenLinear (
174 MoveLinearCallbackProcPtr moveCB
,
175 RemoveLinearCallbackProcPtr removeCB
,
179 void xf86FreeOffscreenArea(FBAreaPtr area
);
180 void xf86FreeOffscreenLinear(FBLinearPtr area
);
183 xf86ResizeOffscreenArea(
189 xf86ResizeOffscreenLinear(
196 xf86RegisterFreeBoxCallback(
198 FreeBoxCallbackProcPtr FreeBoxCallback
,
203 xf86PurgeUnlockedOffscreenAreas(
209 xf86QueryLargestOffscreenArea(
211 int *width
, int *height
,
218 xf86QueryLargestOffscreenLinear(
226 #endif /* _XF86FBMAN_H */