void owl_global_add_style(owl_global *g, owl_style *s) { /* * If we're redefining the current style, make sure to update * pointers to it. */ if(g->current_view.style && !strcmp(owl_style_get_name(g->current_view.style), owl_style_get_name(s))) g->current_view.style = s; owl_dict_insert_element(&(g->styledict), owl_style_get_name(s), s, (void (*)(void *))owl_style_delete); }
/* fmtext should already be initialized */ void owl_view_to_fmtext(const owl_view *v, owl_fmtext *fm) { owl_fmtext_append_normal(fm, "Name: "); owl_fmtext_append_normal(fm, v->name); owl_fmtext_append_normal(fm, "\n"); owl_fmtext_append_normal(fm, "Filter: "); owl_fmtext_append_normal(fm, owl_filter_get_name(v->filter)); owl_fmtext_append_normal(fm, "\n"); owl_fmtext_append_normal(fm, "Style: "); owl_fmtext_append_normal(fm, owl_style_get_name(v->style)); owl_fmtext_append_normal(fm, "\n"); }
const char *owl_view_get_style_name(const owl_view *v) { return(owl_style_get_name(v->style)); }