|
|
1.1 ! root 1: #include "copyright.h" ! 2: ! 3: /* $Header: XCopyGC.c,v 11.8 87/09/11 08:02:20 toddb Exp $ */ ! 4: /* Copyright Massachusetts Institute of Technology 1986 */ ! 5: ! 6: #include "Xlibint.h" ! 7: ! 8: XCopyGC (dpy, srcGC, mask, destGC) ! 9: register Display *dpy; ! 10: unsigned long mask; /* which ones to set initially */ ! 11: GC srcGC, destGC; ! 12: { ! 13: register XGCValues *destgv = &destGC->values, ! 14: *srcgv = &srcGC->values; ! 15: register xCopyGCReq *req; ! 16: register _XExtension *ext; ! 17: ! 18: LockDisplay(dpy); ! 19: ! 20: /* preserve GC dirty bits in copy */ ! 21: destGC->dirty |= srcGC->dirty & mask; ! 22: ! 23: GetReq(CopyGC, req); ! 24: req->srcGC = srcGC->gid; ! 25: req->dstGC = destGC->gid; ! 26: req->mask = mask; ! 27: ! 28: if (mask & GCFunction) ! 29: destgv->function = srcgv->function; ! 30: ! 31: if (mask & GCPlaneMask) ! 32: destgv->plane_mask = srcgv->plane_mask; ! 33: ! 34: if (mask & GCForeground) ! 35: destgv->foreground = srcgv->foreground; ! 36: ! 37: if (mask & GCBackground) ! 38: destgv->background = srcgv->background; ! 39: ! 40: if (mask & GCLineWidth) ! 41: destgv->line_width = srcgv->line_width; ! 42: ! 43: if (mask & GCLineStyle) ! 44: destgv->line_style = srcgv->line_style; ! 45: ! 46: if (mask & GCCapStyle) ! 47: destgv->cap_style = srcgv->cap_style; ! 48: ! 49: if (mask & GCJoinStyle) ! 50: destgv->join_style = srcgv->join_style; ! 51: ! 52: if (mask & GCFillStyle) ! 53: destgv->fill_style = srcgv->fill_style; ! 54: ! 55: if (mask & GCFillRule) ! 56: destgv->fill_rule = srcgv->fill_rule; ! 57: ! 58: if (mask & GCArcMode) ! 59: destgv->arc_mode = srcgv->arc_mode; ! 60: ! 61: if (mask & GCTile) ! 62: destgv->tile = srcgv->tile; ! 63: ! 64: if (mask & GCStipple) ! 65: destgv->stipple = srcgv->stipple; ! 66: ! 67: if (mask & GCTileStipXOrigin) ! 68: destgv->ts_x_origin = srcgv->ts_x_origin; ! 69: ! 70: if (mask & GCTileStipYOrigin) ! 71: destgv->ts_y_origin = srcgv->ts_y_origin; ! 72: ! 73: if (mask & GCFont) ! 74: destgv->font = srcgv->font; ! 75: ! 76: if (mask & GCSubwindowMode) ! 77: destgv->subwindow_mode = srcgv->subwindow_mode; ! 78: ! 79: if (mask & GCGraphicsExposures) ! 80: destgv->graphics_exposures = srcgv->graphics_exposures; ! 81: ! 82: if (mask & GCClipXOrigin) ! 83: destgv->clip_x_origin = srcgv->clip_x_origin; ! 84: ! 85: if (mask & GCClipYOrigin) ! 86: destgv->clip_y_origin = srcgv->clip_y_origin; ! 87: ! 88: if (mask & GCClipMask) { ! 89: destGC->rects = srcGC->rects; ! 90: destgv->clip_mask = srcgv->clip_mask; ! 91: } ! 92: ! 93: if (mask & GCDashOffset) ! 94: destgv->dash_offset = srcgv->dash_offset; ! 95: ! 96: if (mask & GCDashList) { ! 97: destGC->dashes = srcGC->dashes; ! 98: destgv->dashes = srcgv->dashes; ! 99: } ! 100: ext = dpy->ext_procs; ! 101: while (ext) { /* call out to any extensions interested */ ! 102: if (ext->copy_GC != NULL) (*ext->copy_GC)(dpy, destGC, &ext->codes); ! 103: ext = ext->next; ! 104: } ! 105: UnlockDisplay(dpy); ! 106: SyncHandle(); ! 107: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.