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 | #include "scrnintstr.h"
|
---|
33 | #include "regionstr.h"
|
---|
34 |
|
---|
35 | #define FAVOR_AREA_THEN_WIDTH 0
|
---|
36 | #define FAVOR_AREA_THEN_HEIGHT 1
|
---|
37 | #define FAVOR_WIDTH_THEN_AREA 2
|
---|
38 | #define FAVOR_HEIGHT_THEN_AREA 3
|
---|
39 |
|
---|
40 | #define PRIORITY_LOW 0
|
---|
41 | #define PRIORITY_NORMAL 1
|
---|
42 | #define PRIORITY_EXTREME 2
|
---|
43 |
|
---|
44 | typedef struct _FBArea {
|
---|
45 | ScreenPtr pScreen;
|
---|
46 | BoxRec box;
|
---|
47 | int granularity;
|
---|
48 | void (*MoveAreaCallback) (struct _FBArea *, struct _FBArea *);
|
---|
49 | void (*RemoveAreaCallback) (struct _FBArea *);
|
---|
50 | DevUnion devPrivate;
|
---|
51 | } FBArea, *FBAreaPtr;
|
---|
52 |
|
---|
53 | typedef struct _FBLinear {
|
---|
54 | ScreenPtr pScreen;
|
---|
55 | int size;
|
---|
56 | int offset;
|
---|
57 | int granularity;
|
---|
58 | void (*MoveLinearCallback) (struct _FBLinear *, struct _FBLinear *);
|
---|
59 | void (*RemoveLinearCallback) (struct _FBLinear *);
|
---|
60 | DevUnion devPrivate;
|
---|
61 | } FBLinear, *FBLinearPtr;
|
---|
62 |
|
---|
63 | typedef void (*FreeBoxCallbackProcPtr) (ScreenPtr, RegionPtr, pointer);
|
---|
64 | typedef void (*MoveAreaCallbackProcPtr) (FBAreaPtr, FBAreaPtr);
|
---|
65 | typedef void (*RemoveAreaCallbackProcPtr) (FBAreaPtr);
|
---|
66 |
|
---|
67 | typedef void (*MoveLinearCallbackProcPtr) (FBLinearPtr, FBLinearPtr);
|
---|
68 | typedef void (*RemoveLinearCallbackProcPtr) (FBLinearPtr);
|
---|
69 |
|
---|
70 | typedef struct {
|
---|
71 | FBAreaPtr(*AllocateOffscreenArea) (ScreenPtr pScreen,
|
---|
72 | int w, int h,
|
---|
73 | int granularity,
|
---|
74 | MoveAreaCallbackProcPtr moveCB,
|
---|
75 | RemoveAreaCallbackProcPtr removeCB,
|
---|
76 | pointer privData);
|
---|
77 | void (*FreeOffscreenArea) (FBAreaPtr area);
|
---|
78 | Bool (*ResizeOffscreenArea) (FBAreaPtr area, int w, int h);
|
---|
79 | Bool (*QueryLargestOffscreenArea) (ScreenPtr pScreen,
|
---|
80 | int *width, int *height,
|
---|
81 | int granularity,
|
---|
82 | int preferences, int priority);
|
---|
83 | Bool (*RegisterFreeBoxCallback) (ScreenPtr pScreen,
|
---|
84 | FreeBoxCallbackProcPtr FreeBoxCallback,
|
---|
85 | pointer devPriv);
|
---|
86 | /* linear functions */
|
---|
87 | FBLinearPtr(*AllocateOffscreenLinear) (ScreenPtr pScreen,
|
---|
88 | int size,
|
---|
89 | int granularity,
|
---|
90 | MoveLinearCallbackProcPtr moveCB,
|
---|
91 | RemoveLinearCallbackProcPtr
|
---|
92 | removeCB, pointer privData);
|
---|
93 | void (*FreeOffscreenLinear) (FBLinearPtr area);
|
---|
94 | Bool (*ResizeOffscreenLinear) (FBLinearPtr area, int size);
|
---|
95 | Bool (*QueryLargestOffscreenLinear) (ScreenPtr pScreen,
|
---|
96 | int *size,
|
---|
97 | int granularity, int priority);
|
---|
98 | Bool (*PurgeOffscreenAreas) (ScreenPtr);
|
---|
99 | } FBManagerFuncs, *FBManagerFuncsPtr;
|
---|
100 |
|
---|
101 | extern _X_EXPORT Bool xf86RegisterOffscreenManager(ScreenPtr pScreen,
|
---|
102 | FBManagerFuncsPtr funcs);
|
---|
103 |
|
---|
104 | extern _X_EXPORT Bool
|
---|
105 | xf86InitFBManagerRegion(ScreenPtr pScreen, RegionPtr ScreenRegion);
|
---|
106 |
|
---|
107 | extern _X_EXPORT Bool
|
---|
108 | xf86InitFBManagerArea(ScreenPtr pScreen, int PixalArea, int Verbosity);
|
---|
109 |
|
---|
110 | extern _X_EXPORT Bool
|
---|
111 | xf86InitFBManager(ScreenPtr pScreen, BoxPtr FullBox);
|
---|
112 |
|
---|
113 | extern _X_EXPORT Bool
|
---|
114 | xf86InitFBManagerLinear(ScreenPtr pScreen, int offset, int size);
|
---|
115 |
|
---|
116 | extern _X_EXPORT Bool
|
---|
117 | xf86FBManagerRunning(ScreenPtr pScreen);
|
---|
118 |
|
---|
119 | extern _X_EXPORT FBAreaPtr
|
---|
120 | xf86AllocateOffscreenArea(ScreenPtr pScreen,
|
---|
121 | int w, int h,
|
---|
122 | int granularity,
|
---|
123 | MoveAreaCallbackProcPtr moveCB,
|
---|
124 | RemoveAreaCallbackProcPtr removeCB, pointer privData);
|
---|
125 |
|
---|
126 | extern _X_EXPORT FBAreaPtr
|
---|
127 | xf86AllocateLinearOffscreenArea(ScreenPtr pScreen,
|
---|
128 | int length,
|
---|
129 | int granularity,
|
---|
130 | MoveAreaCallbackProcPtr moveCB,
|
---|
131 | RemoveAreaCallbackProcPtr removeCB,
|
---|
132 | pointer privData);
|
---|
133 |
|
---|
134 | extern _X_EXPORT FBLinearPtr
|
---|
135 | xf86AllocateOffscreenLinear(ScreenPtr pScreen,
|
---|
136 | int length,
|
---|
137 | int granularity,
|
---|
138 | MoveLinearCallbackProcPtr moveCB,
|
---|
139 | RemoveLinearCallbackProcPtr removeCB,
|
---|
140 | pointer privData);
|
---|
141 |
|
---|
142 | extern _X_EXPORT void xf86FreeOffscreenArea(FBAreaPtr area);
|
---|
143 | extern _X_EXPORT void xf86FreeOffscreenLinear(FBLinearPtr area);
|
---|
144 |
|
---|
145 | extern _X_EXPORT Bool
|
---|
146 | xf86ResizeOffscreenArea(FBAreaPtr resize, int w, int h);
|
---|
147 |
|
---|
148 | extern _X_EXPORT Bool
|
---|
149 | xf86ResizeOffscreenLinear(FBLinearPtr resize, int size);
|
---|
150 |
|
---|
151 | extern _X_EXPORT Bool
|
---|
152 |
|
---|
153 | xf86RegisterFreeBoxCallback(ScreenPtr pScreen,
|
---|
154 | FreeBoxCallbackProcPtr FreeBoxCallback,
|
---|
155 | pointer devPriv);
|
---|
156 |
|
---|
157 | extern _X_EXPORT Bool
|
---|
158 | xf86PurgeUnlockedOffscreenAreas(ScreenPtr pScreen);
|
---|
159 |
|
---|
160 | extern _X_EXPORT Bool
|
---|
161 |
|
---|
162 | xf86QueryLargestOffscreenArea(ScreenPtr pScreen,
|
---|
163 | int *width, int *height,
|
---|
164 | int granularity, int preferences, int priority);
|
---|
165 |
|
---|
166 | extern _X_EXPORT Bool
|
---|
167 |
|
---|
168 | xf86QueryLargestOffscreenLinear(ScreenPtr pScreen,
|
---|
169 | int *size, int granularity, int priority);
|
---|
170 |
|
---|
171 | #endif /* _XF86FBMAN_H */
|
---|