gcstruct.h revision 6747b715
1/*********************************************************** 2 3Copyright 1987, 1998 The Open Group 4 5Permission to use, copy, modify, distribute, and sell this software and its 6documentation for any purpose is hereby granted without fee, provided that 7the above copyright notice appear in all copies and that both that 8copyright notice and this permission notice appear in supporting 9documentation. 10 11The above copyright notice and this permission notice shall be included in 12all copies or substantial portions of the Software. 13 14THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 18AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 19CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 21Except as contained in this notice, the name of The Open Group shall not be 22used in advertising or otherwise to promote the sale, use or other dealings 23in this Software without prior written authorization from The Open Group. 24 25 26Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. 27 28 All Rights Reserved 29 30Permission to use, copy, modify, and distribute this software and its 31documentation for any purpose and without fee is hereby granted, 32provided that the above copyright notice appear in all copies and that 33both that copyright notice and this permission notice appear in 34supporting documentation, and that the name of Digital not be 35used in advertising or publicity pertaining to distribution of the 36software without specific, written prior permission. 37 38DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING 39ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL 40DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR 41ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 42WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, 43ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 44SOFTWARE. 45 46******************************************************************/ 47 48 49 50#ifndef GCSTRUCT_H 51#define GCSTRUCT_H 52 53#include "gc.h" 54 55#include "regionstr.h" 56#include "region.h" 57#include "pixmap.h" 58#include "screenint.h" 59#include "privates.h" 60#include <X11/Xprotostr.h> 61 62#define GCAllBits ((1 << (GCLastBit + 1)) - 1) 63 64/* 65 * functions which modify the state of the GC 66 */ 67 68typedef struct _GCFuncs { 69 void (* ValidateGC)( 70 GCPtr /*pGC*/, 71 unsigned long /*stateChanges*/, 72 DrawablePtr /*pDrawable*/); 73 74 void (* ChangeGC)( 75 GCPtr /*pGC*/, 76 unsigned long /*mask*/); 77 78 void (* CopyGC)( 79 GCPtr /*pGCSrc*/, 80 unsigned long /*mask*/, 81 GCPtr /*pGCDst*/); 82 83 void (* DestroyGC)( 84 GCPtr /*pGC*/); 85 86 void (* ChangeClip)( 87 GCPtr /*pGC*/, 88 int /*type*/, 89 pointer /*pvalue*/, 90 int /*nrects*/); 91 92 void (* DestroyClip)( 93 GCPtr /*pGC*/); 94 95 void (* CopyClip)( 96 GCPtr /*pgcDst*/, 97 GCPtr /*pgcSrc*/); 98 DevUnion devPrivate; 99} GCFuncs; 100 101/* 102 * graphics operations invoked through a GC 103 */ 104 105typedef struct _GCOps { 106 void (* FillSpans)( 107 DrawablePtr /*pDrawable*/, 108 GCPtr /*pGC*/, 109 int /*nInit*/, 110 DDXPointPtr /*pptInit*/, 111 int * /*pwidthInit*/, 112 int /*fSorted*/); 113 114 void (* SetSpans)( 115 DrawablePtr /*pDrawable*/, 116 GCPtr /*pGC*/, 117 char * /*psrc*/, 118 DDXPointPtr /*ppt*/, 119 int * /*pwidth*/, 120 int /*nspans*/, 121 int /*fSorted*/); 122 123 void (* PutImage)( 124 DrawablePtr /*pDrawable*/, 125 GCPtr /*pGC*/, 126 int /*depth*/, 127 int /*x*/, 128 int /*y*/, 129 int /*w*/, 130 int /*h*/, 131 int /*leftPad*/, 132 int /*format*/, 133 char * /*pBits*/); 134 135 RegionPtr (* CopyArea)( 136 DrawablePtr /*pSrc*/, 137 DrawablePtr /*pDst*/, 138 GCPtr /*pGC*/, 139 int /*srcx*/, 140 int /*srcy*/, 141 int /*w*/, 142 int /*h*/, 143 int /*dstx*/, 144 int /*dsty*/); 145 146 RegionPtr (* CopyPlane)( 147 DrawablePtr /*pSrcDrawable*/, 148 DrawablePtr /*pDstDrawable*/, 149 GCPtr /*pGC*/, 150 int /*srcx*/, 151 int /*srcy*/, 152 int /*width*/, 153 int /*height*/, 154 int /*dstx*/, 155 int /*dsty*/, 156 unsigned long /*bitPlane*/); 157 void (* PolyPoint)( 158 DrawablePtr /*pDrawable*/, 159 GCPtr /*pGC*/, 160 int /*mode*/, 161 int /*npt*/, 162 DDXPointPtr /*pptInit*/); 163 164 void (* Polylines)( 165 DrawablePtr /*pDrawable*/, 166 GCPtr /*pGC*/, 167 int /*mode*/, 168 int /*npt*/, 169 DDXPointPtr /*pptInit*/); 170 171 void (* PolySegment)( 172 DrawablePtr /*pDrawable*/, 173 GCPtr /*pGC*/, 174 int /*nseg*/, 175 xSegment * /*pSegs*/); 176 177 void (* PolyRectangle)( 178 DrawablePtr /*pDrawable*/, 179 GCPtr /*pGC*/, 180 int /*nrects*/, 181 xRectangle * /*pRects*/); 182 183 void (* PolyArc)( 184 DrawablePtr /*pDrawable*/, 185 GCPtr /*pGC*/, 186 int /*narcs*/, 187 xArc * /*parcs*/); 188 189 void (* FillPolygon)( 190 DrawablePtr /*pDrawable*/, 191 GCPtr /*pGC*/, 192 int /*shape*/, 193 int /*mode*/, 194 int /*count*/, 195 DDXPointPtr /*pPts*/); 196 197 void (* PolyFillRect)( 198 DrawablePtr /*pDrawable*/, 199 GCPtr /*pGC*/, 200 int /*nrectFill*/, 201 xRectangle * /*prectInit*/); 202 203 void (* PolyFillArc)( 204 DrawablePtr /*pDrawable*/, 205 GCPtr /*pGC*/, 206 int /*narcs*/, 207 xArc * /*parcs*/); 208 209 int (* PolyText8)( 210 DrawablePtr /*pDrawable*/, 211 GCPtr /*pGC*/, 212 int /*x*/, 213 int /*y*/, 214 int /*count*/, 215 char * /*chars*/); 216 217 int (* PolyText16)( 218 DrawablePtr /*pDrawable*/, 219 GCPtr /*pGC*/, 220 int /*x*/, 221 int /*y*/, 222 int /*count*/, 223 unsigned short * /*chars*/); 224 225 void (* ImageText8)( 226 DrawablePtr /*pDrawable*/, 227 GCPtr /*pGC*/, 228 int /*x*/, 229 int /*y*/, 230 int /*count*/, 231 char * /*chars*/); 232 233 void (* ImageText16)( 234 DrawablePtr /*pDrawable*/, 235 GCPtr /*pGC*/, 236 int /*x*/, 237 int /*y*/, 238 int /*count*/, 239 unsigned short * /*chars*/); 240 241 void (* ImageGlyphBlt)( 242 DrawablePtr /*pDrawable*/, 243 GCPtr /*pGC*/, 244 int /*x*/, 245 int /*y*/, 246 unsigned int /*nglyph*/, 247 CharInfoPtr * /*ppci*/, 248 pointer /*pglyphBase*/); 249 250 void (* PolyGlyphBlt)( 251 DrawablePtr /*pDrawable*/, 252 GCPtr /*pGC*/, 253 int /*x*/, 254 int /*y*/, 255 unsigned int /*nglyph*/, 256 CharInfoPtr * /*ppci*/, 257 pointer /*pglyphBase*/); 258 259 void (* PushPixels)( 260 GCPtr /*pGC*/, 261 PixmapPtr /*pBitMap*/, 262 DrawablePtr /*pDst*/, 263 int /*w*/, 264 int /*h*/, 265 int /*x*/, 266 int /*y*/); 267 268 DevUnion devPrivate; 269} GCOps; 270 271/* there is padding in the bit fields because the Sun compiler doesn't 272 * force alignment to 32-bit boundaries. losers. 273 */ 274typedef struct _GC { 275 ScreenPtr pScreen; 276 unsigned char depth; 277 unsigned char alu; 278 unsigned short lineWidth; 279 unsigned short dashOffset; 280 unsigned short numInDashList; 281 unsigned char *dash; 282 unsigned int lineStyle : 2; 283 unsigned int capStyle : 2; 284 unsigned int joinStyle : 2; 285 unsigned int fillStyle : 2; 286 unsigned int fillRule : 1; 287 unsigned int arcMode : 1; 288 unsigned int subWindowMode : 1; 289 unsigned int graphicsExposures : 1; 290 unsigned int clientClipType : 2; /* CT_<kind> */ 291 unsigned int miTranslate:1; /* should mi things translate? */ 292 unsigned int tileIsPixel:1; /* tile is solid pixel */ 293 unsigned int fExpose:1; /* Call exposure handling */ 294 unsigned int freeCompClip:1; /* Free composite clip */ 295 unsigned int scratch_inuse:1; /* is this GC in a pool for reuse? */ 296 unsigned int unused:13; /* see comment above */ 297 unsigned long planemask; 298 unsigned long fgPixel; 299 unsigned long bgPixel; 300 /* 301 * alas -- both tile and stipple must be here as they 302 * are independently specifiable 303 */ 304 PixUnion tile; 305 PixmapPtr stipple; 306 DDXPointRec patOrg; /* origin for (tile, stipple) */ 307 struct _Font *font; 308 DDXPointRec clipOrg; 309 DDXPointRec lastWinOrg; /* position of window last validated */ 310 pointer clientClip; 311 unsigned long stateChanges; /* masked with GC_<kind> */ 312 unsigned long serialNumber; 313 GCFuncs *funcs; 314 GCOps *ops; 315 PrivateRec *devPrivates; 316 /* 317 * The following were moved here from private storage to allow device- 318 * independent access to them from screen wrappers. 319 * --- 1997.11.03 Marc Aurele La France (tsi@xfree86.org) 320 */ 321 PixmapPtr pRotatedPixmap; /* tile/stipple rotated for alignment */ 322 RegionPtr pCompositeClip; 323 /* fExpose & freeCompClip defined above */ 324} GC; 325 326#endif /* GCSTRUCT_H */ 327