+ cname = g_strconcat(rname, ".color", NULL);
+ ctoname = g_strconcat(rname, ".colorTo", NULL);
+ bcname = g_strconcat(rname, ".border.color", NULL);
+ icname = g_strconcat(rname, ".interlace.color", NULL);
+ hname = g_strconcat(rname, ".highlight", NULL);
+ sname = g_strconcat(rname, ".shadow", NULL);
+ csplitname = g_strconcat(rname, ".color.splitTo", NULL);
+ ctosplitname = g_strconcat(rname, ".colorTo.splitTo", NULL);
+
+ if (XrmGetResource(db, rname, rclass, &rettype, &retvalue) &&
+ retvalue.addr != NULL) {
+ parse_appearance(retvalue.addr,
+ &value->surface.grad,
+ &value->surface.relief,
+ &value->surface.bevel,
+ &value->surface.interlaced,
+ &value->surface.border,
+ allow_trans);
+ if (!read_color(db, inst, cname, &value->surface.primary))
+ value->surface.primary = RrColorNew(inst, 0, 0, 0);
+ if (!read_color(db, inst, ctoname, &value->surface.secondary))
+ value->surface.secondary = RrColorNew(inst, 0, 0, 0);
+ if (value->surface.border)
+ if (!read_color(db, inst, bcname,
+ &value->surface.border_color))
+ value->surface.border_color = RrColorNew(inst, 0, 0, 0);
+ if (value->surface.interlaced)
+ if (!read_color(db, inst, icname,
+ &value->surface.interlace_color))
+ value->surface.interlace_color = RrColorNew(inst, 0, 0, 0);
+ if (read_int(db, hname, &i) && i >= 0)
+ value->surface.bevel_light_adjust = i;
+ if (read_int(db, sname, &i) && i >= 0 && i <= 256)
+ value->surface.bevel_dark_adjust = i;
+
+ if (value->surface.grad == RR_SURFACE_SPLIT_VERTICAL) {
+ gint r, g, b;
+
+ if (!read_color(db, inst, csplitname,
+ &value->surface.split_primary))
+ {
+ r = value->surface.primary->r;
+ r += r >> 2;
+ g = value->surface.primary->g;
+ g += g >> 2;
+ b = value->surface.primary->b;
+ b += b >> 2;
+ if (r > 0xFF) r = 0xFF;
+ if (g > 0xFF) g = 0xFF;
+ if (b > 0xFF) b = 0xFF;
+ value->surface.split_primary = RrColorNew(inst, r, g, b);
+ }
+
+ if (!read_color(db, inst, ctosplitname,
+ &value->surface.split_secondary))
+ {
+ r = value->surface.secondary->r;
+ r += r >> 4;
+ g = value->surface.secondary->g;
+ g += g >> 4;
+ b = value->surface.secondary->b;
+ b += b >> 4;
+ if (r > 0xFF) r = 0xFF;
+ if (g > 0xFF) g = 0xFF;
+ if (b > 0xFF) b = 0xFF;
+ value->surface.split_secondary = RrColorNew(inst, r, g, b);
+ }