/*
* ion/de/style.c
*
- * Copyright (c) Tuomo Valkonen 1999-2007.
+ * Copyright (c) Tuomo Valkonen 1999-2008.
*
- * Ion is free software; you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
+ * See the included file LICENSE for details.
*/
#include <string.h>
if(style->extra_cgrps!=NULL)
free(style->extra_cgrps);
- extl_unref_table(style->data_table);
+ extl_unref_table(style->extras_table);
XFreeGC(ioncore_g.dpy, style->normal_gc);
}
-static void dump_style(DEStyle *style)
+void destyle_dump(DEStyle *style)
{
/* Allow the style still be used but get if off the list. */
UNLINK_ITEM(styles, style, next, prev);
style->n_extra_cgrps=0;
style->extra_cgrps=NULL;
- style->data_table=extl_table_none();
+ style->extras_table=extl_table_none();
create_normal_gc(style, rootwin);
}
-static DEStyle *do_create_style(WRootWin *rootwin, const char *name)
+DEStyle *de_create_style(WRootWin *rootwin, const char *name)
{
DEStyle *style=ALLOC(DEStyle);
if(style!=NULL){
}
-DEStyle *de_create_style(WRootWin *rootwin, const char *name)
+void destyle_add(DEStyle *style)
{
- DEStyle *oldstyle, *style;
- uint score;
-
- style=do_create_style(rootwin, name);
-
- if(style==NULL)
- return NULL;
-
- for(oldstyle=styles; oldstyle!=NULL; oldstyle=oldstyle->next){
- if(oldstyle->rootwin!=rootwin)
- continue;
- if(gr_stylespec_equals(&oldstyle->spec, &style->spec))
- break;
- }
-
- if(oldstyle!=NULL && !oldstyle->is_fallback)
- dump_style(oldstyle);
-
LINK_ITEM_FIRST(styles, style, next, prev);
-
- return style;
}
-
/*EXTL_DOC
* Clear all styles from drawing engine memory.
*/
for(style=styles; style!=NULL; style=next){
next=style->next;
if(!style->is_fallback)
- dump_style(style);
+ destyle_dump(style);
}
}
warn(TR("Style is still in use [%d] but the module "
"is being unloaded!"), style->usecount);
}
- dump_style(style);
+ destyle_dump(style);
}
}