read fonts and titlebar layout from theme files

This commit is contained in:
Dana Jansens 2003-06-26 01:29:45 +00:00
parent 5410a9d149
commit a12e73cf37
6 changed files with 104 additions and 165 deletions

View file

@ -11,26 +11,28 @@
#include <string.h> #include <string.h>
#define ELIPSES "..." #define ELIPSES "..."
#define ELIPSES_LENGTH(font, shadow, offset) \ #define ELIPSES_LENGTH(font) \
(font->elipses_length + (shadow ? offset : 0)) (font->elipses_length + (font->shadow ? font->offset : 0))
#define OB_SHADOW "shadow"
#define OB_SHADOW_OFFSET "shadowoffset"
#define OB_SHADOW_ALPHA "shadowtint"
FcObjectType objs[] = {
{ OB_SHADOW, FcTypeBool },
{ OB_SHADOW_OFFSET, FcTypeInteger },
{ OB_SHADOW_ALPHA, FcTypeInteger }
};
static gboolean started = FALSE; static gboolean started = FALSE;
static void font_startup(void) static void font_startup(void)
{ {
#ifdef DEBUG
int version;
#endif /* DEBUG */
if (!XftInit(0)) { if (!XftInit(0)) {
g_warning(_("Couldn't initialize Xft.\n")); g_warning(_("Couldn't initialize Xft.\n"));
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
#ifdef DEBUG FcNameRegisterObjectTypes(objs, (sizeof(objs) / sizeof(objs[0])));
version = XftGetVersion();
g_message("Using Xft %d.%d.%d (Built against %d.%d.%d).",
version / 10000 % 100, version / 100 % 100, version % 100,
XFT_MAJOR, XFT_MINOR, XFT_REVISION);
#endif
} }
static void measure_font(RrFont *f) static void measure_font(RrFont *f)
@ -43,33 +45,68 @@ static void measure_font(RrFont *f)
f->elipses_length = (signed) info.xOff; f->elipses_length = (signed) info.xOff;
} }
static RrFont *openfont(const RrInstance *inst, char *fontstring)
{
RrFont *out;
FcPattern *pat, *match;
XftFont *font;
FcResult res;
gint tint;
if (!(pat = XftNameParse(fontstring)))
return NULL;
match = XftFontMatch(RrDisplay(inst), RrScreen(inst), pat, &res);
FcPatternDestroy(pat);
if (!match)
return NULL;
out = g_new(RrFont, 1);
out->inst = inst;
if (FcPatternGetBool(match, OB_SHADOW, 0, &out->shadow) != FcResultMatch)
out->shadow = FALSE;
g_message("shadow %d", out->shadow);
if (FcPatternGetInteger(match, OB_SHADOW_OFFSET, 0, &out->offset) !=
FcResultMatch)
out->offset = 1;
if (FcPatternGetInteger(match, OB_SHADOW_ALPHA, 0, &tint) != FcResultMatch)
tint = 25;
if (tint > 100) tint = 100;
else if (tint < -100) tint = -100;
out->tint = tint;
font = XftFontOpenPattern(RrDisplay(inst), match);
FcPatternDestroy(match);
if (!font) {
g_free(out);
return NULL;
} else
out->xftfont = font;
measure_font(out);
return out;
}
RrFont *RrFontOpen(const RrInstance *inst, char *fontstring) RrFont *RrFontOpen(const RrInstance *inst, char *fontstring)
{ {
RrFont *out; RrFont *out;
XftFont *xf;
if (!started) { if (!started) {
font_startup(); font_startup();
started = TRUE; started = TRUE;
} }
if ((xf = XftFontOpenName(RrDisplay(inst), RrScreen(inst), fontstring))) { if ((out = openfont(inst, fontstring)))
out = g_new(RrFont, 1);
out->inst = inst;
out->xftfont = xf;
measure_font(out);
return out; return out;
}
g_warning(_("Unable to load font: %s\n"), fontstring); g_warning(_("Unable to load font: %s\n"), fontstring);
g_warning(_("Trying fallback font: %s\n"), "sans"); g_warning(_("Trying fallback font: %s\n"), "sans");
if ((xf = XftFontOpenName(RrDisplay(inst), RrScreen(inst), "sans"))) { if ((out = openfont(inst, "sans")))
out = g_new(RrFont, 1);
out->inst = inst;
out->xftfont = xf;
measure_font(out);
return out; return out;
}
g_warning(_("Unable to load font: %s\n"), "sans"); g_warning(_("Unable to load font: %s\n"), "sans");
return NULL; return NULL;
@ -84,28 +121,28 @@ void RrFontClose(RrFont *f)
} }
static void font_measure_full(const RrFont *f, const gchar *str, static void font_measure_full(const RrFont *f, const gchar *str,
gint shadow, gint offset, gint *x, gint *y) gint *x, gint *y)
{ {
XGlyphInfo info; XGlyphInfo info;
XftTextExtentsUtf8(RrDisplay(f->inst), f->xftfont, XftTextExtentsUtf8(RrDisplay(f->inst), f->xftfont,
(const FcChar8*)str, strlen(str), &info); (const FcChar8*)str, strlen(str), &info);
*x = (signed) info.xOff + (shadow ? ABS(offset) : 0); *x = (signed) info.xOff + (f->shadow ? ABS(f->offset) : 0);
*y = info.height + (shadow ? ABS(offset) : 0); *y = info.height + (f->shadow ? ABS(f->offset) : 0);
} }
int RrFontMeasureString(const RrFont *f, const gchar *str, int RrFontMeasureString(const RrFont *f, const gchar *str)
gint shadow, gint offset)
{ {
gint x, y; gint x, y;
font_measure_full (f, str, shadow, offset, &x, &y); font_measure_full (f, str, &x, &y);
return x; return x;
} }
int RrFontHeight(const RrFont *f, gint shadow, gint offset) int RrFontHeight(const RrFont *f)
{ {
return f->xftfont->ascent + f->xftfont->descent + (shadow ? offset : 0); return f->xftfont->ascent + f->xftfont->descent +
(f->shadow ? f->offset : 0);
} }
int RrFontMaxCharWidth(const RrFont *f) int RrFontMaxCharWidth(const RrFont *f)
@ -124,7 +161,7 @@ void RrFontDraw(XftDraw *d, RrTextureText *t, Rect *area)
/* center vertically */ /* center vertically */
y = area->y + y = area->y +
(area->height - RrFontHeight(t->font, t->shadow, t->offset)) / 2; (area->height - RrFontHeight(t->font)) / 2;
/* the +2 and -4 leave a small blank edge on the sides */ /* the +2 and -4 leave a small blank edge on the sides */
x = area->x + 2; x = area->x + 2;
w = area->width - 4; w = area->width - 4;
@ -132,16 +169,16 @@ void RrFontDraw(XftDraw *d, RrTextureText *t, Rect *area)
text = g_string_new(t->string); text = g_string_new(t->string);
l = g_utf8_strlen(text->str, -1); l = g_utf8_strlen(text->str, -1);
font_measure_full(t->font, text->str, t->shadow, t->offset, &mw, &mh); font_measure_full(t->font, text->str, &mw, &mh);
while (l && mw > area->width) { while (l && mw > area->width) {
shortened = TRUE; shortened = TRUE;
/* remove a character from the middle */ /* remove a character from the middle */
text = g_string_erase(text, l-- / 2, 1); text = g_string_erase(text, l-- / 2, 1);
em = ELIPSES_LENGTH(t->font, t->shadow, t->offset); em = ELIPSES_LENGTH(t->font);
/* if the elipses are too large, don't show them at all */ /* if the elipses are too large, don't show them at all */
if (em > area->width) if (em > area->width)
shortened = FALSE; shortened = FALSE;
font_measure_full(t->font, text->str, t->shadow, t->offset, &mw, &mh); font_measure_full(t->font, text->str, &mw, &mh);
mw += em; mw += em;
} }
if (shortened) { if (shortened) {
@ -163,24 +200,24 @@ void RrFontDraw(XftDraw *d, RrTextureText *t, Rect *area)
l = strlen(text->str); /* number of bytes */ l = strlen(text->str); /* number of bytes */
if (t->shadow) { if (t->font->shadow) {
if (t->tint >= 0) { if (t->font->tint >= 0) {
c.color.red = 0; c.color.red = 0;
c.color.green = 0; c.color.green = 0;
c.color.blue = 0; c.color.blue = 0;
c.color.alpha = 0xffff * t->tint / 100; /* transparent shadow */ c.color.alpha = 0xffff * t->font->tint / 100;
c.pixel = BlackPixel(RrDisplay(t->font->inst), c.pixel = BlackPixel(RrDisplay(t->font->inst),
RrScreen(t->font->inst)); RrScreen(t->font->inst));
} else { } else {
c.color.red = 0xffff * -t->tint / 100; c.color.red = 0xffff;
c.color.green = 0xffff * -t->tint / 100; c.color.green = 0xffff;
c.color.blue = 0xffff * -t->tint / 100; c.color.blue = 0xffff;
c.color.alpha = 0xffff * -t->tint / 100; /* transparent shadow */ c.color.alpha = 0xffff * -t->font->tint / 100;
c.pixel = WhitePixel(RrDisplay(t->font->inst), c.pixel = WhitePixel(RrDisplay(t->font->inst),
RrScreen(t->font->inst)); RrScreen(t->font->inst));
} }
XftDrawStringUtf8(d, &c, t->font->xftfont, x + t->offset, XftDrawStringUtf8(d, &c, t->font->xftfont, x + t->font->offset,
t->font->xftfont->ascent + y + t->offset, t->font->xftfont->ascent + y + t->font->offset,
(FcChar8*)text->str, l); (FcChar8*)text->str, l);
} }
c.color.red = t->color->r | t->color->r << 8; c.color.red = t->color->r | t->color->r << 8;

View file

@ -9,6 +9,9 @@ struct _RrFont {
const RrInstance *inst; const RrInstance *inst;
XftFont *xftfont; XftFont *xftfont;
gint elipses_length; gint elipses_length;
gint shadow;
gchar tint;
gint offset;
}; };
RrFont *RrFontOpen(const RrInstance *inst, char *fontstring); RrFont *RrFontOpen(const RrInstance *inst, char *fontstring);

View file

@ -263,13 +263,9 @@ void RrMinsize(RrAppearance *l, gint *w, gint *h)
break; break;
case RR_TEXTURE_TEXT: case RR_TEXTURE_TEXT:
m = RrFontMeasureString(l->texture[i].data.text.font, m = RrFontMeasureString(l->texture[i].data.text.font,
l->texture[i].data.text.string, l->texture[i].data.text.string);
l->texture[i].data.text.shadow,
l->texture[i].data.text.offset);
*w = MAX(*w, m); *w = MAX(*w, m);
m = RrFontHeight(l->texture[i].data.text.font, m = RrFontHeight(l->texture[i].data.text.font);
l->texture[i].data.text.shadow,
l->texture[i].data.text.offset);
*h += MAX(*h, m); *h += MAX(*h, m);
break; break;
case RR_TEXTURE_RGBA: case RR_TEXTURE_RGBA:

View file

@ -76,9 +76,6 @@ struct _RrSurface {
struct _RrTextureText { struct _RrTextureText {
RrFont *font; RrFont *font;
RrJustify justify; RrJustify justify;
gint shadow;
gchar tint;
guchar offset;
RrColor *color; RrColor *color;
gchar *string; gchar *string;
}; };
@ -173,9 +170,8 @@ RrAppearance *RrAppearanceNew (const RrInstance *inst, gint numtex);
RrAppearance *RrAppearanceCopy (RrAppearance *a); RrAppearance *RrAppearanceCopy (RrAppearance *a);
void RrAppearanceFree (RrAppearance *a); void RrAppearanceFree (RrAppearance *a);
int RrFontMeasureString (const RrFont *f, const gchar *str, int RrFontMeasureString (const RrFont *f, const gchar *str);
gint shadow, gint offset); int RrFontHeight (const RrFont *f);
int RrFontHeight (const RrFont *f, gint shadow, gint offset);
int RrFontMaxCharWidth (const RrFont *f); int RrFontMaxCharWidth (const RrFont *f);
void RrPaint (RrAppearance *l, Window win, gint w, gint h); void RrPaint (RrAppearance *l, Window win, gint w, gint h);

View file

@ -108,29 +108,14 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name)
} }
/* load the font stuff */ /* load the font stuff */
font_str = "arial:bold:pixelsize=10"; if (!read_string(db, "window.title.xftfont", &font_str))
font_str = "arial,sans:bold:pixelsize=10:shadow=y:shadowtint=50";
theme->winfont_shadow = FALSE;
if (read_string(db, "window.xft.flags", &str)) {
if (g_strrstr(str, "shadow"))
theme->winfont_shadow = TRUE;
g_free(str);
}
if (!read_int(db, "window.xft.shadow.offset",
&theme->winfont_shadow_offset))
theme->winfont_shadow_offset = 1;
if (!read_int(db, "window.xft.shadow.tint",
&theme->winfont_shadow_tint) ||
theme->winfont_shadow_tint < 100 || theme->winfont_shadow_tint > 100)
theme->winfont_shadow_tint = 25;
if (!(theme->winfont = RrFontOpen(inst, font_str))) { if (!(theme->winfont = RrFontOpen(inst, font_str))) {
RrThemeFree(theme); RrThemeFree(theme);
return NULL; return NULL;
} }
theme->winfont_height = RrFontHeight(theme->winfont, theme->winfont_shadow, theme->winfont_height = RrFontHeight(theme->winfont);
theme->winfont_shadow_offset);
winjust = RR_JUSTIFY_LEFT; winjust = RR_JUSTIFY_LEFT;
if (read_string(db, "window.justify", &str)) { if (read_string(db, "window.justify", &str)) {
@ -138,34 +123,16 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name)
winjust = RR_JUSTIFY_RIGHT; winjust = RR_JUSTIFY_RIGHT;
else if (!g_ascii_strcasecmp(str, "center")) else if (!g_ascii_strcasecmp(str, "center"))
winjust = RR_JUSTIFY_CENTER; winjust = RR_JUSTIFY_CENTER;
g_free(str);
} }
font_str = "arial-10:bold"; if (!read_string(db, "menu.title.xftfont", &font_str))
font_str = "arial,sans:bold:pixelsize=12:shadow=y";
theme->mtitlefont_shadow = FALSE;
if (read_string(db, "menu.title.xft.flags", &str)) {
if (g_strrstr(str, "shadow"))
theme->mtitlefont_shadow = TRUE;
g_free(str);
}
if (!read_int(db, "menu.title.xft.shadow.offset",
&theme->mtitlefont_shadow_offset))
theme->mtitlefont_shadow_offset = 1;
if (!read_int(db, "menu.title.xft.shadow.tint",
&theme->mtitlefont_shadow_tint) ||
theme->mtitlefont_shadow_tint < 100 ||
theme->mtitlefont_shadow_tint > 100)
theme->mtitlefont_shadow_tint = 25;
if (!(theme->mtitlefont = RrFontOpen(inst, font_str))) { if (!(theme->mtitlefont = RrFontOpen(inst, font_str))) {
RrThemeFree(theme); RrThemeFree(theme);
return NULL; return NULL;
} }
theme->mtitlefont_height = RrFontHeight(theme->mtitlefont, theme->mtitlefont_height = RrFontHeight(theme->mtitlefont);
theme->mtitlefont_shadow,
theme->mtitlefont_shadow_offset);
mtitlejust = RR_JUSTIFY_LEFT; mtitlejust = RR_JUSTIFY_LEFT;
if (read_string(db, "menu.title.justify", &str)) { if (read_string(db, "menu.title.justify", &str)) {
@ -173,33 +140,16 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name)
mtitlejust = RR_JUSTIFY_RIGHT; mtitlejust = RR_JUSTIFY_RIGHT;
else if (!g_ascii_strcasecmp(str, "center")) else if (!g_ascii_strcasecmp(str, "center"))
mtitlejust = RR_JUSTIFY_CENTER; mtitlejust = RR_JUSTIFY_CENTER;
g_free(str);
} }
font_str = "arial-8"; if (!read_string(db, "menu.frame.xftfont", &font_str))
font_str = "arial,sans:bold:pixelsize=11:shadow=y";
theme->mfont_shadow = FALSE;
if (read_string(db, "menu.frame.xft.flags", &str)) {
if (g_strrstr(str, "shadow"))
theme->mfont_shadow = TRUE;
g_free(str);
}
if (!read_int(db, "menu.frame.xft.shadow.offset",
&theme->mfont_shadow_offset))
theme->mfont_shadow_offset = 1;
if (!read_int(db, "menu.frame.xft.shadow.tint",
&theme->mfont_shadow_tint) ||
theme->mfont_shadow_tint < 100 ||
theme->mfont_shadow_tint > 100)
theme->mfont_shadow_tint = 25;
if (!(theme->mfont = RrFontOpen(inst, font_str))) { if (!(theme->mfont = RrFontOpen(inst, font_str))) {
RrThemeFree(theme); RrThemeFree(theme);
return NULL; return NULL;
} }
theme->mfont_height = RrFontHeight(theme->mfont, theme->mfont_shadow, theme->mfont_height = RrFontHeight(theme->mfont);
theme->mfont_shadow_offset);
mjust = RR_JUSTIFY_LEFT; mjust = RR_JUSTIFY_LEFT;
if (read_string(db, "menu.frame.justify", &str)) { if (read_string(db, "menu.frame.justify", &str)) {
@ -207,11 +157,12 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name)
mjust = RR_JUSTIFY_RIGHT; mjust = RR_JUSTIFY_RIGHT;
else if (!g_ascii_strcasecmp(str, "center")) else if (!g_ascii_strcasecmp(str, "center"))
mjust = RR_JUSTIFY_CENTER; mjust = RR_JUSTIFY_CENTER;
g_free(str);
} }
/* load the title layout */ /* load the title layout */
theme->title_layout = g_strdup("NLIMC"); if (!read_string(db, "window.title.layout", &font_str))
font_str = "NLIMC";
theme->title_layout = g_strdup(font_str);
if (!read_int(db, "handleWidth", &theme->handle_height) || if (!read_int(db, "handleWidth", &theme->handle_height) ||
theme->handle_height < 0 || theme->handle_height > 100) theme->handle_height < 0 || theme->handle_height > 100)
@ -458,15 +409,6 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name)
theme->app_hilite_label->texture[0].data.text.justify = RR_JUSTIFY_LEFT; theme->app_hilite_label->texture[0].data.text.justify = RR_JUSTIFY_LEFT;
theme->a_focused_label->texture[0].data.text.font = theme->a_focused_label->texture[0].data.text.font =
theme->app_hilite_label->texture[0].data.text.font = theme->winfont; theme->app_hilite_label->texture[0].data.text.font = theme->winfont;
theme->a_focused_label->texture[0].data.text.shadow =
theme->app_hilite_label->texture[0].data.text.shadow =
theme->winfont_shadow;
theme->a_focused_label->texture[0].data.text.offset =
theme->app_hilite_label->texture[0].data.text.offset =
theme->winfont_shadow_offset;
theme->a_focused_label->texture[0].data.text.tint =
theme->app_hilite_label->texture[0].data.text.tint =
theme->winfont_shadow_tint;
theme->a_focused_label->texture[0].data.text.color = theme->a_focused_label->texture[0].data.text.color =
theme->app_hilite_label->texture[0].data.text.color = theme->app_hilite_label->texture[0].data.text.color =
theme->title_focused_color; theme->title_focused_color;
@ -477,15 +419,6 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name)
theme->app_unhilite_label->texture[0].data.text.justify = RR_JUSTIFY_LEFT; theme->app_unhilite_label->texture[0].data.text.justify = RR_JUSTIFY_LEFT;
theme->a_unfocused_label->texture[0].data.text.font = theme->a_unfocused_label->texture[0].data.text.font =
theme->app_unhilite_label->texture[0].data.text.font = theme->winfont; theme->app_unhilite_label->texture[0].data.text.font = theme->winfont;
theme->a_unfocused_label->texture[0].data.text.shadow =
theme->app_unhilite_label->texture[0].data.text.shadow =
theme->winfont_shadow;
theme->a_unfocused_label->texture[0].data.text.offset =
theme->app_unhilite_label->texture[0].data.text.offset =
theme->winfont_shadow_offset;
theme->a_unfocused_label->texture[0].data.text.tint =
theme->app_unhilite_label->texture[0].data.text.tint =
theme->winfont_shadow_tint;
theme->a_unfocused_label->texture[0].data.text.color = theme->a_unfocused_label->texture[0].data.text.color =
theme->app_unhilite_label->texture[0].data.text.color = theme->app_unhilite_label->texture[0].data.text.color =
theme->title_unfocused_color; theme->title_unfocused_color;
@ -493,11 +426,6 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name)
theme->a_menu_title->texture[0].type = RR_TEXTURE_TEXT; theme->a_menu_title->texture[0].type = RR_TEXTURE_TEXT;
theme->a_menu_title->texture[0].data.text.justify = mtitlejust; theme->a_menu_title->texture[0].data.text.justify = mtitlejust;
theme->a_menu_title->texture[0].data.text.font = theme->mtitlefont; theme->a_menu_title->texture[0].data.text.font = theme->mtitlefont;
theme->a_menu_title->texture[0].data.text.shadow = theme->mtitlefont_shadow;
theme->a_menu_title->texture[0].data.text.offset =
theme->mtitlefont_shadow_offset;
theme->a_menu_title->texture[0].data.text.tint =
theme->mtitlefont_shadow_tint;
theme->a_menu_title->texture[0].data.text.color = theme->menu_title_color; theme->a_menu_title->texture[0].data.text.color = theme->menu_title_color;
theme->a_menu_item->surface.grad = theme->a_menu_item->surface.grad =
@ -513,18 +441,6 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name)
theme->a_menu_item->texture[0].data.text.font = theme->a_menu_item->texture[0].data.text.font =
theme->a_menu_disabled->texture[0].data.text.font = theme->a_menu_disabled->texture[0].data.text.font =
theme->a_menu_hilite->texture[0].data.text.font = theme->mfont; theme->a_menu_hilite->texture[0].data.text.font = theme->mfont;
theme->a_menu_item->texture[0].data.text.shadow =
theme->a_menu_disabled->texture[0].data.text.shadow =
theme->a_menu_hilite->texture[0].data.text.shadow =
theme->mfont_shadow;
theme->a_menu_item->texture[0].data.text.offset =
theme->a_menu_disabled->texture[0].data.text.offset =
theme->a_menu_hilite->texture[0].data.text.offset =
theme->mfont_shadow_offset;
theme->a_menu_item->texture[0].data.text.tint =
theme->a_menu_disabled->texture[0].data.text.tint =
theme->a_menu_hilite->texture[0].data.text.tint =
theme->mfont_shadow_tint;
theme->a_menu_item->texture[0].data.text.color = theme->menu_color; theme->a_menu_item->texture[0].data.text.color = theme->menu_color;
theme->a_menu_disabled->texture[0].data.text.color = theme->a_menu_disabled->texture[0].data.text.color =
theme->menu_disabled_color; theme->menu_disabled_color;
@ -767,7 +683,7 @@ static gboolean read_string(XrmDatabase db, char *rname, char **value)
if (XrmGetResource(db, rname, rclass, &rettype, &retvalue) && if (XrmGetResource(db, rname, rclass, &rettype, &retvalue) &&
retvalue.addr != NULL) { retvalue.addr != NULL) {
*value = g_strdup(retvalue.addr); *value = retvalue.addr;
ret = TRUE; ret = TRUE;
} }

View file

@ -36,19 +36,10 @@ struct _RrTheme {
/* style settings - fonts */ /* style settings - fonts */
gint winfont_height; gint winfont_height;
RrFont *winfont; RrFont *winfont;
gboolean winfont_shadow;
gint winfont_shadow_offset;
gint winfont_shadow_tint;
gint mtitlefont_height; gint mtitlefont_height;
RrFont *mtitlefont; RrFont *mtitlefont;
gboolean mtitlefont_shadow;
gint mtitlefont_shadow_offset;
gint mtitlefont_shadow_tint;
gint mfont_height; gint mfont_height;
RrFont *mfont; RrFont *mfont;
gboolean mfont_shadow;
gint mfont_shadow_offset;
gint mfont_shadow_tint;
/* style settings - title layout */ /* style settings - title layout */
gchar *title_layout; gchar *title_layout;