+static void gradient_solid(RrAppearance *l, gint w, gint h)
+{
+ gint i;
+ RrPixel32 pix;
+ RrPixel32 *data = l->surface.pixel_data;
+ RrSurface *sp = &l->surface;
+ gint left = 0, top = 0, right = w - 1, bottom = h - 1;
+
+ pix = (sp->primary->r << RrDefaultRedOffset)
+ + (sp->primary->g << RrDefaultGreenOffset)
+ + (sp->primary->b << RrDefaultBlueOffset);
+
+ for (i = 0; i < w * h; i++)
+ *data++ = pix;
+
+ if (sp->interlaced)
+ return;
+
+ XFillRectangle(RrDisplay(l->inst), l->pixmap, RrColorGC(sp->primary),
+ 0, 0, w, h);
+
+ switch (sp->relief) {
+ case RR_RELIEF_RAISED:
+ if (!sp->bevel_dark)
+ create_bevel_colors(l);
+
+ switch (sp->bevel) {
+ case RR_BEVEL_1:
+ XDrawLine(RrDisplay(l->inst), l->pixmap, RrColorGC(sp->bevel_dark),
+ left, bottom, right, bottom);
+ XDrawLine(RrDisplay(l->inst), l->pixmap, RrColorGC(sp->bevel_dark),
+ right, bottom, right, top);
+
+ XDrawLine(RrDisplay(l->inst), l->pixmap,RrColorGC(sp->bevel_light),
+ left, top, right, top);
+ XDrawLine(RrDisplay(l->inst), l->pixmap,RrColorGC(sp->bevel_light),
+ left, bottom, left, top);
+ break;
+ case RR_BEVEL_2:
+ XDrawLine(RrDisplay(l->inst), l->pixmap, RrColorGC(sp->bevel_dark),
+ left + 2, bottom - 1, right - 2, bottom - 1);
+ XDrawLine(RrDisplay(l->inst), l->pixmap, RrColorGC(sp->bevel_dark),
+ right - 1, bottom - 1, right - 1, top + 1);
+
+ XDrawLine(RrDisplay(l->inst), l->pixmap,RrColorGC(sp->bevel_light),
+ left + 2, top + 1, right - 2, top + 1);
+ XDrawLine(RrDisplay(l->inst), l->pixmap,RrColorGC(sp->bevel_light),
+ left + 1, bottom - 1, left + 1, top + 1);
+ break;
+ default:
+ g_assert_not_reached(); /* unhandled BevelType */
+ }
+ break;
+ case RR_RELIEF_SUNKEN:
+ if (!sp->bevel_dark)
+ create_bevel_colors(l);
+
+ switch (sp->bevel) {
+ case RR_BEVEL_1:
+ XDrawLine(RrDisplay(l->inst), l->pixmap,RrColorGC(sp->bevel_light),
+ left, bottom, right, bottom);
+ XDrawLine(RrDisplay(l->inst), l->pixmap,RrColorGC(sp->bevel_light),
+ right, bottom, right, top);
+
+ XDrawLine(RrDisplay(l->inst), l->pixmap, RrColorGC(sp->bevel_dark),
+ left, top, right, top);
+ XDrawLine(RrDisplay(l->inst), l->pixmap, RrColorGC(sp->bevel_dark),
+ left, bottom, left, top);
+ break;
+ case RR_BEVEL_2:
+ XDrawLine(RrDisplay(l->inst), l->pixmap,RrColorGC(sp->bevel_light),
+ left + 2, bottom - 1, right - 2, bottom - 1);
+ XDrawLine(RrDisplay(l->inst), l->pixmap,RrColorGC(sp->bevel_light),
+ right - 1, bottom - 1, right - 1, top + 1);
+
+ XDrawLine(RrDisplay(l->inst), l->pixmap, RrColorGC(sp->bevel_dark),
+ left + 2, top + 1, right - 2, top + 1);
+ XDrawLine(RrDisplay(l->inst), l->pixmap, RrColorGC(sp->bevel_dark),
+ left + 1, bottom - 1, left + 1, top + 1);
+ break;
+ default:
+ g_assert_not_reached(); /* unhandled BevelType */
+ }
+ break;
+ case RR_RELIEF_FLAT:
+ if (sp->border) {
+ XDrawRectangle(RrDisplay(l->inst), l->pixmap,
+ RrColorGC(sp->border_color),
+ left, top, right, bottom);
+ }
+ break;
+ default:
+ g_assert_not_reached(); /* unhandled ReliefType */
+ }
+}