static gboolean read_int(XrmDatabase db, char *rname, int *value);
static gboolean read_string(XrmDatabase db, char *rname, char **value);
static gboolean read_color(XrmDatabase db, const RrInstance *inst,
- gchar *rname, color_rgb **value);
+ gchar *rname, RrColor **value);
static gboolean read_mask(XrmDatabase db, const RrInstance *inst,
gchar *rname, gchar *theme,
RrPixmapMask **value);
gchar *font_str;
RrTheme *theme;
- theme = g_new(RrTheme, 1);
+ theme = g_new0(RrTheme, 1);
theme->inst = inst;
theme->winfont_shadow_tint < 100 || theme->winfont_shadow_tint > 100)
theme->winfont_shadow_tint = 25;
- theme->winfont = font_open(inst, font_str);
- theme->winfont_height = font_height(theme->winfont, theme->winfont_shadow,
- theme->winfont_shadow_offset);
+ if (!(theme->winfont = RrFontOpen(inst, font_str))) {
+ RrThemeFree(theme);
+ return NULL;
+ }
+ theme->winfont_height = RrFontHeight(theme->winfont, theme->winfont_shadow,
+ theme->winfont_shadow_offset);
winjust = RR_JUSTIFY_LEFT;
if (read_string(db, "window.justify", &str)) {
theme->mtitlefont_shadow_tint > 100)
theme->mtitlefont_shadow_tint = 25;
- theme->mtitlefont = font_open(inst, font_str);
- theme->mtitlefont_height = font_height(theme->mtitlefont,
- theme->mtitlefont_shadow,
- theme->mtitlefont_shadow_offset);
+ if (!(theme->mtitlefont = RrFontOpen(inst, font_str))) {
+ RrThemeFree(theme);
+ return NULL;
+ }
+ theme->mtitlefont_height = RrFontHeight(theme->mtitlefont,
+ theme->mtitlefont_shadow,
+ theme->mtitlefont_shadow_offset);
mtitlejust = RR_JUSTIFY_LEFT;
if (read_string(db, "menu.title.justify", &str)) {
theme->mfont_shadow_tint > 100)
theme->mfont_shadow_tint = 25;
- theme->mfont = font_open(inst, font_str);
- theme->mfont_height = font_height(theme->mfont, theme->mfont_shadow,
- theme->mfont_shadow_offset);
+ if (!(theme->mfont = RrFontOpen(inst, font_str))) {
+ RrThemeFree(theme);
+ return NULL;
+ }
+ theme->mfont_height = RrFontHeight(theme->mfont, theme->mfont_shadow,
+ theme->mfont_shadow_offset);
mjust = RR_JUSTIFY_LEFT;
if (read_string(db, "menu.frame.justify", &str)) {
RrPixmapMaskFree(theme->iconify_mask);
RrPixmapMaskFree(theme->close_mask);
- font_close(theme->winfont);
- font_close(theme->mtitlefont);
- font_close(theme->mfont);
+ RrFontClose(theme->winfont);
+ RrFontClose(theme->mtitlefont);
+ RrFontClose(theme->mfont);
g_free(theme->title_layout);
}
static gboolean read_color(XrmDatabase db, const RrInstance *inst,
- gchar *rname, color_rgb **value)
+ gchar *rname, RrColor **value)
{
gboolean ret = FALSE;
char *rclass = create_class_name(rname);
if (XrmGetResource(db, rname, rclass, &rettype, &retvalue) &&
retvalue.addr != NULL) {
- color_rgb *c = RrColorParse(inst, retvalue.addr);
+ RrColor *c = RrColorParse(inst, retvalue.addr);
if (c != NULL) {
*value = c;
ret = TRUE;
if (strstr(tex, "gradient") != NULL) {
if (strstr(tex, "crossdiagonal") != NULL)
*grad = RR_SURFACE_CROSS_DIAGONAL;
- else if (strstr(tex, "rectangle") != NULL)
- *grad = RR_SURFACE_RECTANGLE;
else if (strstr(tex, "pyramid") != NULL)
*grad = RR_SURFACE_PYRAMID;
- else if (strstr(tex, "pipecross") != NULL)
- *grad = RR_SURFACE_PIPECROSS;
- else if (strstr(tex, "elliptic") != NULL)
- *grad = RR_SURFACE_PIPECROSS;
else if (strstr(tex, "horizontal") != NULL)
*grad = RR_SURFACE_HORIZONTAL;
else if (strstr(tex, "vertical") != NULL)