Interpreter - Incremental API changes
[rune.git] / dllx11 / fill.c
1 /*
2  * FILL.C
3  */
4
5 #include "defs.h"
6
7 void *
8 isys_XFillRect(runctx_p ct, Exp *exp, RefStor **prs)
9 {
10         struct {
11                 int32_t xid;
12                 int32_t gcid;
13                 int32_t sx;
14                 int32_t sy;
15                 int32_t w;
16                 int32_t h;
17         } *rhs;
18         TmpStor *ts;
19
20         rhs = exp->ex_Rhs->ex_Func(ct, exp->ex_Rhs, prs);
21         if (rhs->w < 0) {
22                 rhs->sx += rhs->w;
23                 rhs->w = -rhs->w;
24         }
25         if (rhs->h < 0) {
26                 rhs->sy += rhs->h;
27                 rhs->h = -rhs->h;
28         }
29         ts = getExpTmpData(ct, exp);
30         ts->ts_Int32 = XFillRectangle(SaveDisplay, rhs->xid,
31                                       hashLookup(rhs->gcid, HASH_GC),
32                                       rhs->sx, rhs->sy, rhs->w, rhs->h);
33         return(&ts->ts_Int32);
34 }