MCPcopy Create free account
hub / github.com/SimHacker/micropolis / DisplayBitmap

Function DisplayBitmap

micropolis-activity/src/tk/tkcvbmap.c:442–468  ·  view source on GitHub ↗
(canvasPtr, itemPtr, drawable)

Source from the content-addressed store, hash-verified

440 *
441 * Side effects:
442 * ItemPtr is drawn in drawable using the transformation
443 * information in canvasPtr.
444 *
445 *--------------------------------------------------------------
446 */
447
448static void
449DisplayBitmap(canvasPtr, itemPtr, drawable)
450 register Tk_Canvas *canvasPtr; /* Canvas that contains item. */
451 Tk_Item *itemPtr; /* Item to be displayed. */
452 Drawable drawable; /* Pixmap or window in which to draw
453 * item. */
454{
455 register BitmapItem *bmapPtr = (BitmapItem *) itemPtr;
456
457 if (bmapPtr->bitmap != None) {
458#if defined(USE_XPM3)
459 XCopyArea(Tk_Display(canvasPtr->tkwin), bmapPtr->bitmap, drawable,
460 bmapPtr->gc, 0, 0,
461 (unsigned int) bmapPtr->header.x2 - bmapPtr->header.x1,
462 (unsigned int) bmapPtr->header.y2 - bmapPtr->header.y1,
463 bmapPtr->header.x1 - canvasPtr->drawableXOrigin,
464 bmapPtr->header.y1 - canvasPtr->drawableYOrigin);
465#else
466 XCopyPlane(Tk_Display(canvasPtr->tkwin), bmapPtr->bitmap, drawable,
467 bmapPtr->gc, 0, 0,
468 (unsigned int) bmapPtr->header.x2 - bmapPtr->header.x1,
469 (unsigned int) bmapPtr->header.y2 - bmapPtr->header.y1,
470 bmapPtr->header.x1 - canvasPtr->drawableXOrigin,
471 bmapPtr->header.y1 - canvasPtr->drawableYOrigin, 1);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected