Lines Matching +full:use +full:- +full:case
5 Permission to use, copy, modify, distribute, and sell this software and its
19 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 used in advertising or otherwise to promote the sale, use or other dealings
29 Permission to use, copy, modify, and distribute this software and its
40 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
42 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
48 #include <dix-config.h>
77 (*pGC->funcs->ValidateGC) (pGC, pGC->stateChanges, pDraw); in ValidateGC()
78 pGC->stateChanges = 0; in ValidateGC()
79 pGC->serialNumber = pDraw->serialNumber; in ValidateGC()
91 * If you have any XIDs, you must use ChangeGCXIDs:
99 * use ChangeGC:
106 * If you have neither XIDs nor pointers, you can use either function,
116 _var = (_type)(pUnion->val); pUnion++; \
120 _var = (_type)pUnion->ptr; pUnion++; }
131 pGC->serialNumber |= GC_CHANGE_SERIAL_BIT; in ChangeGC()
137 pGC->stateChanges |= index2; in ChangeGC()
139 case GCFunction: in ChangeGC()
145 pGC->alu = newalu; in ChangeGC()
148 client->errorValue = newalu; in ChangeGC()
153 case GCPlaneMask: in ChangeGC()
154 NEXTVAL(unsigned long, pGC->planemask); in ChangeGC()
157 case GCForeground: in ChangeGC()
158 NEXTVAL(unsigned long, pGC->fgPixel); in ChangeGC()
163 if (!pGC->tileIsPixel && !pGC->tile.pixmap) { in ChangeGC()
164 pGC->tileIsPixel = TRUE; in ChangeGC()
165 pGC->tile.pixel = pGC->fgPixel; in ChangeGC()
168 case GCBackground: in ChangeGC()
169 NEXTVAL(unsigned long, pGC->bgPixel); in ChangeGC()
172 case GCLineWidth: /* ??? line width is a CARD16 */ in ChangeGC()
173 NEXTVAL(CARD16, pGC->lineWidth); in ChangeGC()
176 case GCLineStyle: in ChangeGC()
182 pGC->lineStyle = newlinestyle; in ChangeGC()
185 client->errorValue = newlinestyle; in ChangeGC()
190 case GCCapStyle: in ChangeGC()
196 pGC->capStyle = newcapstyle; in ChangeGC()
199 client->errorValue = newcapstyle; in ChangeGC()
204 case GCJoinStyle: in ChangeGC()
210 pGC->joinStyle = newjoinstyle; in ChangeGC()
213 client->errorValue = newjoinstyle; in ChangeGC()
218 case GCFillStyle: in ChangeGC()
224 pGC->fillStyle = newfillstyle; in ChangeGC()
227 client->errorValue = newfillstyle; in ChangeGC()
232 case GCFillRule: in ChangeGC()
238 pGC->fillRule = newfillrule; in ChangeGC()
241 client->errorValue = newfillrule; in ChangeGC()
246 case GCTile: in ChangeGC()
249 if ((pPixmap->drawable.depth != pGC->depth) || in ChangeGC()
250 (pPixmap->drawable.pScreen != pGC->pScreen)) { in ChangeGC()
254 pPixmap->refcnt++; in ChangeGC()
255 if (!pGC->tileIsPixel) in ChangeGC()
256 (*pGC->pScreen->DestroyPixmap) (pGC->tile.pixmap); in ChangeGC()
257 pGC->tileIsPixel = FALSE; in ChangeGC()
258 pGC->tile.pixmap = pPixmap; in ChangeGC()
261 case GCStipple: in ChangeGC()
264 if (pPixmap && ((pPixmap->drawable.depth != 1) || in ChangeGC()
265 (pPixmap->drawable.pScreen != pGC->pScreen))) in ChangeGC()
271 pPixmap->refcnt++; in ChangeGC()
272 if (pGC->stipple) in ChangeGC()
273 (*pGC->pScreen->DestroyPixmap) (pGC->stipple); in ChangeGC()
274 pGC->stipple = pPixmap; in ChangeGC()
277 case GCTileStipXOrigin: in ChangeGC()
278 NEXTVAL(INT16, pGC->patOrg.x); in ChangeGC()
281 case GCTileStipYOrigin: in ChangeGC()
282 NEXTVAL(INT16, pGC->patOrg.y); in ChangeGC()
285 case GCFont: in ChangeGC()
290 pFont->refcnt++; in ChangeGC()
291 if (pGC->font) in ChangeGC()
292 CloseFont(pGC->font, (Font) 0); in ChangeGC()
293 pGC->font = pFont; in ChangeGC()
296 case GCSubwindowMode: in ChangeGC()
302 pGC->subWindowMode = newclipmode; in ChangeGC()
305 client->errorValue = newclipmode; in ChangeGC()
310 case GCGraphicsExposures: in ChangeGC()
316 pGC->graphicsExposures = newge; in ChangeGC()
319 client->errorValue = newge; in ChangeGC()
324 case GCClipXOrigin: in ChangeGC()
325 NEXTVAL(INT16, pGC->clipOrg.x); in ChangeGC()
328 case GCClipYOrigin: in ChangeGC()
329 NEXTVAL(INT16, pGC->clipOrg.y); in ChangeGC()
332 case GCClipMask: in ChangeGC()
336 if ((pPixmap->drawable.depth != 1) || in ChangeGC()
337 (pPixmap->drawable.pScreen != pGC->pScreen)) { in ChangeGC()
341 pPixmap->refcnt++; in ChangeGC()
343 (*pGC->funcs->ChangeClip) (pGC, pPixmap ? CT_PIXMAP : CT_NONE, in ChangeGC()
346 case GCDashOffset: in ChangeGC()
347 NEXTVAL(INT16, pGC->dashOffset); in ChangeGC()
350 case GCDashList: in ChangeGC()
356 if (pGC->dash != DefaultDash) { in ChangeGC()
357 free(pGC->dash); in ChangeGC()
358 pGC->numInDashList = 2; in ChangeGC()
359 pGC->dash = DefaultDash; in ChangeGC()
367 if (pGC->dash != DefaultDash) in ChangeGC()
368 free(pGC->dash); in ChangeGC()
369 pGC->numInDashList = 2; in ChangeGC()
370 pGC->dash = dash; in ChangeGC()
379 client->errorValue = newdash; in ChangeGC()
384 case GCArcMode: in ChangeGC()
390 pGC->arcMode = newarcmode; in ChangeGC()
393 client->errorValue = newarcmode; in ChangeGC()
400 client->errorValue = maskQ; in ChangeGC()
406 if (pGC->fillStyle == FillTiled && pGC->tileIsPixel) { in ChangeGC()
408 pGC->fillStyle = FillSolid; in ChangeGC()
412 (*pGC->funcs->ChangeGC) (pGC, maskQ); in ChangeGC()
437 client->errorValue = mask; in ChangeGCXIDs()
440 for (i = Ones(mask); i--;) in ChangeGCXIDs()
447 offset = Ones(mask & (xidfields[i].mask - 1)); in ChangeGCXIDs()
456 client->errorValue = vals[offset].val; in ChangeGCXIDs()
473 pGC->pScreen = pScreen; in NewGCObject()
474 pGC->depth = depth; in NewGCObject()
475 pGC->alu = GXcopy; /* dst <- src */ in NewGCObject()
476 pGC->planemask = ~0; in NewGCObject()
477 pGC->serialNumber = 0; in NewGCObject()
478 pGC->funcs = 0; in NewGCObject()
479 pGC->fgPixel = 0; in NewGCObject()
480 pGC->bgPixel = 1; in NewGCObject()
481 pGC->lineWidth = 0; in NewGCObject()
482 pGC->lineStyle = LineSolid; in NewGCObject()
483 pGC->capStyle = CapButt; in NewGCObject()
484 pGC->joinStyle = JoinMiter; in NewGCObject()
485 pGC->fillStyle = FillSolid; in NewGCObject()
486 pGC->fillRule = EvenOddRule; in NewGCObject()
487 pGC->arcMode = ArcPieSlice; in NewGCObject()
488 pGC->tile.pixel = 0; in NewGCObject()
489 pGC->tile.pixmap = NullPixmap; in NewGCObject()
491 pGC->tileIsPixel = TRUE; in NewGCObject()
492 pGC->patOrg.x = 0; in NewGCObject()
493 pGC->patOrg.y = 0; in NewGCObject()
494 pGC->subWindowMode = ClipByChildren; in NewGCObject()
495 pGC->graphicsExposures = TRUE; in NewGCObject()
496 pGC->clipOrg.x = 0; in NewGCObject()
497 pGC->clipOrg.y = 0; in NewGCObject()
498 pGC->clientClip = (void *) NULL; in NewGCObject()
499 pGC->numInDashList = 2; in NewGCObject()
500 pGC->dash = DefaultDash; in NewGCObject()
501 pGC->dashOffset = 0; in NewGCObject()
503 /* use the default font and stipple */ in NewGCObject()
504 pGC->font = defaultFont; in NewGCObject()
505 if (pGC->font) /* necessary, because open of default font could fail */ in NewGCObject()
506 pGC->font->refcnt++; in NewGCObject()
507 pGC->stipple = pGC->pScreen->defaultStipple; in NewGCObject()
508 if (pGC->stipple) in NewGCObject()
509 pGC->stipple->refcnt++; in NewGCObject()
512 pGC->scratch_inuse = FALSE; in NewGCObject()
518 in any non-default values.
520 returns status of non-default fields in pStatus
531 pGC = NewGCObject(pDrawable->pScreen, pDrawable->depth); in CreateGC()
537 pGC->serialNumber = GC_CHANGE_SERIAL_BIT; in CreateGC()
540 * magic special case -- ChangeGC checks for this condition in CreateGC()
541 * and snags the Foreground value to create a pseudo default-tile in CreateGC()
543 pGC->tileIsPixel = FALSE; in CreateGC()
546 pGC->tileIsPixel = TRUE; in CreateGC()
555 pGC->stateChanges = GCAllBits; in CreateGC()
556 if (!(*pGC->pScreen->CreateGC) (pGC)) in CreateGC()
565 if (!pGC->tileIsPixel && !pGC->tile.pixmap) in CreateGC()
566 pGC->tileIsPixel = TRUE; /* undo special case */ in CreateGC()
585 (*pGC->pScreen->QueryBestSize) (TileShape, &w, &h, pGC->pScreen); in CreateDefaultTile()
587 (*pGC->pScreen->CreatePixmap) (pGC->pScreen, w, h, pGC->depth, 0); in CreateDefaultTile()
588 pgcScratch = GetScratchGC(pGC->depth, pGC->pScreen); in CreateDefaultTile()
591 (*pTile->drawable.pScreen->DestroyPixmap) (pTile); in CreateDefaultTile()
597 tmpval[1].val = pGC->tile.pixel; in CreateDefaultTile()
606 (*pgcScratch->ops->PolyFillRect) ((DrawablePtr) pTile, pgcScratch, 1, in CreateDefaultTile()
608 /* Always remember to free the scratch graphics context after use. */ in CreateDefaultTile()
611 pGC->tileIsPixel = FALSE; in CreateDefaultTile()
612 pGC->tile.pixmap = pTile; in CreateDefaultTile()
625 pgcDst->serialNumber |= GC_CHANGE_SERIAL_BIT; in CopyGC()
626 pgcDst->stateChanges |= mask; in CopyGC()
632 case GCFunction: in CopyGC()
633 pgcDst->alu = pgcSrc->alu; in CopyGC()
635 case GCPlaneMask: in CopyGC()
636 pgcDst->planemask = pgcSrc->planemask; in CopyGC()
638 case GCForeground: in CopyGC()
639 pgcDst->fgPixel = pgcSrc->fgPixel; in CopyGC()
641 case GCBackground: in CopyGC()
642 pgcDst->bgPixel = pgcSrc->bgPixel; in CopyGC()
644 case GCLineWidth: in CopyGC()
645 pgcDst->lineWidth = pgcSrc->lineWidth; in CopyGC()
647 case GCLineStyle: in CopyGC()
648 pgcDst->lineStyle = pgcSrc->lineStyle; in CopyGC()
650 case GCCapStyle: in CopyGC()
651 pgcDst->capStyle = pgcSrc->capStyle; in CopyGC()
653 case GCJoinStyle: in CopyGC()
654 pgcDst->joinStyle = pgcSrc->joinStyle; in CopyGC()
656 case GCFillStyle: in CopyGC()
657 pgcDst->fillStyle = pgcSrc->fillStyle; in CopyGC()
659 case GCFillRule: in CopyGC()
660 pgcDst->fillRule = pgcSrc->fillRule; in CopyGC()
662 case GCTile: in CopyGC()
664 if (EqualPixUnion(pgcDst->tileIsPixel, in CopyGC()
665 pgcDst->tile, in CopyGC()
666 pgcSrc->tileIsPixel, pgcSrc->tile)) { in CopyGC()
669 if (!pgcDst->tileIsPixel) in CopyGC()
670 (*pgcDst->pScreen->DestroyPixmap) (pgcDst->tile.pixmap); in CopyGC()
671 pgcDst->tileIsPixel = pgcSrc->tileIsPixel; in CopyGC()
672 pgcDst->tile = pgcSrc->tile; in CopyGC()
673 if (!pgcDst->tileIsPixel) in CopyGC()
674 pgcDst->tile.pixmap->refcnt++; in CopyGC()
677 case GCStipple: in CopyGC()
679 if (pgcDst->stipple == pgcSrc->stipple) in CopyGC()
681 if (pgcDst->stipple) in CopyGC()
682 (*pgcDst->pScreen->DestroyPixmap) (pgcDst->stipple); in CopyGC()
683 pgcDst->stipple = pgcSrc->stipple; in CopyGC()
684 if (pgcDst->stipple) in CopyGC()
685 pgcDst->stipple->refcnt++; in CopyGC()
688 case GCTileStipXOrigin: in CopyGC()
689 pgcDst->patOrg.x = pgcSrc->patOrg.x; in CopyGC()
691 case GCTileStipYOrigin: in CopyGC()
692 pgcDst->patOrg.y = pgcSrc->patOrg.y; in CopyGC()
694 case GCFont: in CopyGC()
695 if (pgcDst->font == pgcSrc->font) in CopyGC()
697 if (pgcDst->font) in CopyGC()
698 CloseFont(pgcDst->font, (Font) 0); in CopyGC()
699 if ((pgcDst->font = pgcSrc->font) != NullFont) in CopyGC()
700 (pgcDst->font)->refcnt++; in CopyGC()
702 case GCSubwindowMode: in CopyGC()
703 pgcDst->subWindowMode = pgcSrc->subWindowMode; in CopyGC()
705 case GCGraphicsExposures: in CopyGC()
706 pgcDst->graphicsExposures = pgcSrc->graphicsExposures; in CopyGC()
708 case GCClipXOrigin: in CopyGC()
709 pgcDst->clipOrg.x = pgcSrc->clipOrg.x; in CopyGC()
711 case GCClipYOrigin: in CopyGC()
712 pgcDst->clipOrg.y = pgcSrc->clipOrg.y; in CopyGC()
714 case GCClipMask: in CopyGC()
715 (*pgcDst->funcs->CopyClip) (pgcDst, pgcSrc); in CopyGC()
717 case GCDashOffset: in CopyGC()
718 pgcDst->dashOffset = pgcSrc->dashOffset; in CopyGC()
720 case GCDashList: in CopyGC()
721 if (pgcSrc->dash == DefaultDash) { in CopyGC()
722 if (pgcDst->dash != DefaultDash) { in CopyGC()
723 free(pgcDst->dash); in CopyGC()
724 pgcDst->numInDashList = pgcSrc->numInDashList; in CopyGC()
725 pgcDst->dash = pgcSrc->dash; in CopyGC()
732 dash = malloc(pgcSrc->numInDashList * sizeof(unsigned char)); in CopyGC()
734 if (pgcDst->dash != DefaultDash) in CopyGC()
735 free(pgcDst->dash); in CopyGC()
736 pgcDst->numInDashList = pgcSrc->numInDashList; in CopyGC()
737 pgcDst->dash = dash; in CopyGC()
738 for (i = 0; i < pgcSrc->numInDashList; i++) in CopyGC()
739 dash[i] = pgcSrc->dash[i]; in CopyGC()
745 case GCArcMode: in CopyGC()
746 pgcDst->arcMode = pgcSrc->arcMode; in CopyGC()
752 if (pgcDst->fillStyle == FillTiled && pgcDst->tileIsPixel) { in CopyGC()
754 pgcDst->fillStyle = FillSolid; in CopyGC()
758 (*pgcDst->funcs->CopyGC) (pgcSrc, maskQ, pgcDst); in CopyGC()
772 CloseFont(pGC->font, (Font) 0); in FreeGC()
773 (*pGC->funcs->DestroyClip) (pGC); in FreeGC()
775 if (!pGC->tileIsPixel) in FreeGC()
776 (*pGC->pScreen->DestroyPixmap) (pGC->tile.pixmap); in FreeGC()
777 if (pGC->stipple) in FreeGC()
778 (*pGC->pScreen->DestroyPixmap) (pGC->stipple); in FreeGC()
780 (*pGC->funcs->DestroyGC) (pGC); in FreeGC()
781 if (pGC->dash != DefaultDash) in FreeGC()
782 free(pGC->dash); in FreeGC()
793 stipples anyway (in case the CreateGC() call has provided a
794 value for them -- we can't set the default tile until the
795 client-supplied attributes are installed, since the fgPixel
809 pGC->stateChanges = GCAllBits; in CreateScratchGC()
810 if (!(*pScreen->CreateGC) (pGC)) { in CreateScratchGC()
814 pGC->graphicsExposures = FALSE; in CreateScratchGC()
826 ppGC = pScreen->GCperDepth; in FreeGCperDepth()
828 for (i = 0; i <= pScreen->numDepths; i++) { in FreeGCperDepth()
843 ppGC = pScreen->GCperDepth; in CreateGCperDepth()
848 if (pScreen->numDepths > MAXFORMATS) in CreateGCperDepth()
851 pDepth = pScreen->allowedDepths; in CreateGCperDepth()
852 for (i = 0; i < pScreen->numDepths; i++, pDepth++) { in CreateGCperDepth()
853 if (!(ppGC[i + 1] = CreateScratchGC(pScreen, pDepth->depth))) { in CreateGCperDepth()
854 for (; i >= 0; i--) in CreateGCperDepth()
875 (*pScreen->QueryBestSize) (StippleShape, &w, &h, pScreen); in CreateDefaultStipple()
876 if (!(pScreen->defaultStipple = pScreen->CreatePixmap(pScreen, w, h, 1, 0))) in CreateDefaultStipple()
884 (*pScreen->DestroyPixmap) (pScreen->defaultStipple); in CreateDefaultStipple()
889 ValidateGC((DrawablePtr) pScreen->defaultStipple, pgcScratch); in CreateDefaultStipple()
894 (*pgcScratch->ops->PolyFillRect) ((DrawablePtr) pScreen->defaultStipple, in CreateDefaultStipple()
905 (*pScreen->DestroyPixmap) (pScreen->defaultStipple); in FreeDefaultStipple()
917 while (i--) { in SetDashes()
931 pGC->serialNumber |= GC_CHANGE_SERIAL_BIT; in SetDashes()
932 if (offset != pGC->dashOffset) { in SetDashes()
933 pGC->dashOffset = offset; in SetDashes()
934 pGC->stateChanges |= GCDashOffset; in SetDashes()
938 if (pGC->dash != DefaultDash) in SetDashes()
939 free(pGC->dash); in SetDashes()
940 pGC->numInDashList = ndash; in SetDashes()
941 pGC->dash = p; in SetDashes()
943 pGC->numInDashList += ndash; in SetDashes()
946 while (i--) in SetDashes()
949 while (ndash--) in SetDashes()
951 pGC->stateChanges |= GCDashList; in SetDashes()
954 if (pGC->funcs->ChangeGC) in SetDashes()
955 (*pGC->funcs->ChangeGC) (pGC, maskQ); in SetDashes()
966 case Unsorted: in VerifyRectOrder()
968 case YSorted: in VerifyRectOrder()
972 if (prectN->y < prectP->y) in VerifyRectOrder()
973 return -1; in VerifyRectOrder()
976 case YXSorted: in VerifyRectOrder()
980 if ((prectN->y < prectP->y) || in VerifyRectOrder()
981 ((prectN->y == prectP->y) && (prectN->x < prectP->x))) in VerifyRectOrder()
982 return -1; in VerifyRectOrder()
985 case YXBanded: in VerifyRectOrder()
989 if ((prectN->y != prectP->y && in VerifyRectOrder()
990 prectN->y < prectP->y + (int) prectP->height) || in VerifyRectOrder()
991 ((prectN->y == prectP->y) && in VerifyRectOrder()
992 (prectN->height != prectP->height || in VerifyRectOrder()
993 prectN->x < prectP->x + (int) prectP->width))) in VerifyRectOrder()
994 return -1; in VerifyRectOrder()
998 return -1; in VerifyRectOrder()
1016 pGC->serialNumber |= GC_CHANGE_SERIAL_BIT; in SetClipRects()
1017 pGC->clipOrg.x = xOrigin; in SetClipRects()
1018 pGC->stateChanges |= GCClipXOrigin; in SetClipRects()
1020 pGC->clipOrg.y = yOrigin; in SetClipRects()
1021 pGC->stateChanges |= GCClipYOrigin; in SetClipRects()
1025 (*pGC->funcs->ChangeClip) (pGC, newct, (void *) prectsNew, nrects); in SetClipRects()
1026 if (pGC->funcs->ChangeGC) in SetClipRects()
1027 (*pGC->funcs->ChangeGC) (pGC, in SetClipRects()
1034 if we can get a pre-allocated one, use it and mark it as used.
1035 if we can't, create one out of whole cloth (The Velveteen GC -- if
1036 you use it often enough it will become real.)
1044 for (i = 0; i <= pScreen->numDepths; i++) { in GetScratchGC()
1045 pGC = pScreen->GCperDepth[i]; in GetScratchGC()
1046 if (pGC && pGC->depth == depth && !pGC->scratch_inuse) { in GetScratchGC()
1047 pGC->scratch_inuse = TRUE; in GetScratchGC()
1049 pGC->alu = GXcopy; in GetScratchGC()
1050 pGC->planemask = ~0; in GetScratchGC()
1051 pGC->serialNumber = 0; in GetScratchGC()
1052 pGC->fgPixel = 0; in GetScratchGC()
1053 pGC->bgPixel = 1; in GetScratchGC()
1054 pGC->lineWidth = 0; in GetScratchGC()
1055 pGC->lineStyle = LineSolid; in GetScratchGC()
1056 pGC->capStyle = CapButt; in GetScratchGC()
1057 pGC->joinStyle = JoinMiter; in GetScratchGC()
1058 pGC->fillStyle = FillSolid; in GetScratchGC()
1059 pGC->fillRule = EvenOddRule; in GetScratchGC()
1060 pGC->arcMode = ArcChord; in GetScratchGC()
1061 pGC->patOrg.x = 0; in GetScratchGC()
1062 pGC->patOrg.y = 0; in GetScratchGC()
1063 pGC->subWindowMode = ClipByChildren; in GetScratchGC()
1064 pGC->graphicsExposures = FALSE; in GetScratchGC()
1065 pGC->clipOrg.x = 0; in GetScratchGC()
1066 pGC->clipOrg.y = 0; in GetScratchGC()
1067 if (pGC->clientClip) in GetScratchGC()
1068 (*pGC->funcs->ChangeClip) (pGC, CT_NONE, NULL, 0); in GetScratchGC()
1069 pGC->stateChanges = GCAllBits; in GetScratchGC()
1078 if the gc to free is in the table of pre-existing ones,
1085 if (pGC->scratch_inuse) in FreeScratchGC()
1086 pGC->scratch_inuse = FALSE; in FreeScratchGC()