/* * DRAW.C */ #include "defs.h" void RuneSysCall_xDrawPoint(void *args, int *res) { struct { int32_t xid; int32_t gcid; int32_t x; int32_t y; } *rhs; pthread_mutex_t *mtx; rhs = args; *res = XDrawPoint(SaveDisplay, rhs->xid, hashLookup(rhs->gcid, HASH_GC, &mtx), rhs->x, rhs->y); threadMutexUnlock(mtx); } void RuneSysCall_xDrawLine(void *args, int *res) { struct { int32_t xid; int32_t gcid; int32_t sx; int32_t sy; int32_t dx; int32_t dy; } *rhs; pthread_mutex_t *mtx; rhs = args; *res = XDrawLine(SaveDisplay, rhs->xid, hashLookup(rhs->gcid, HASH_GC, &mtx), rhs->sx, rhs->sy, rhs->dx, rhs->dy); threadMutexUnlock(mtx); } void RuneSysCall_xDrawRect(void *args, int *res) { struct { int32_t xid; int32_t gcid; int32_t sx; int32_t sy; int32_t w; int32_t h; } *rhs; pthread_mutex_t *mtx; rhs = args; if (rhs->w < 0) { rhs->sx += rhs->w; rhs->w = -rhs->w; } if (rhs->h < 0) { rhs->sy += rhs->h; rhs->h = -rhs->h; } *res = XDrawRectangle(SaveDisplay, rhs->xid, hashLookup(rhs->gcid, HASH_GC, &mtx), rhs->sx, rhs->sy, rhs->w, rhs->h); threadMutexUnlock(mtx); }