*
* 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
*
* 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
#include <ioncore/names.h>
#include <ioncore/strings.h>
#include <ioncore/basicpholder.h>
#include <ioncore/names.h>
#include <ioncore/strings.h>
#include <ioncore/basicpholder.h>
static void do_calc_systray_w(WStatusBar *p, WSBElem *el);
static void statusbar_calc_systray_w(WStatusBar *p);
static void do_calc_systray_w(WStatusBar *p, WSBElem *el);
static void statusbar_calc_systray_w(WStatusBar *p);
+static bool gets_stringstore(ExtlTab t, const char *str, StringId *id)
+{
+ char *s;
+
+ if(extl_table_gets_s(t, str, &s)){
+ *id=stringstore_alloc(s);
+ free(s);
+ return (*id!=STRINGID_NONE);
+ }
+
+ return FALSE;
+}
+
+
static WSBElem *get_sbelems(ExtlTab t, int *nret, int *filleridxret)
{
int i, n=extl_table_get_n(t);
static WSBElem *get_sbelems(ExtlTab t, int *nret, int *filleridxret)
{
int i, n=extl_table_get_n(t);
if(el[i].type==WSBELEM_TEXT || el[i].type==WSBELEM_STRETCH){
extl_table_gets_s(tt, "text", &(el[i].text));
}else if(el[i].type==WSBELEM_METER){
if(el[i].type==WSBELEM_TEXT || el[i].type==WSBELEM_STRETCH){
extl_table_gets_s(tt, "text", &(el[i].text));
}else if(el[i].type==WSBELEM_METER){
extl_table_gets_s(tt, "tmpl", &(el[i].tmpl));
extl_table_gets_i(tt, "align", &(el[i].align));
extl_table_gets_i(tt, "zeropad", &(el[i].zeropad));
el[i].zeropad=maxof(el[i].zeropad, 0);
}else if(el[i].type==WSBELEM_SYSTRAY){
extl_table_gets_s(tt, "tmpl", &(el[i].tmpl));
extl_table_gets_i(tt, "align", &(el[i].align));
extl_table_gets_i(tt, "zeropad", &(el[i].zeropad));
el[i].zeropad=maxof(el[i].zeropad, 0);
}else if(el[i].type==WSBELEM_SYSTRAY){
extl_table_gets_s(cwin->proptab, "statusbar", &name);
for(i=0; i<sb->nelems; i++){
extl_table_gets_s(cwin->proptab, "statusbar", &name);
for(i=0; i<sb->nelems; i++){
extl_table_sets_i(tt, "type", sb->elems[i].type);
extl_table_sets_s(tt, "text", sb->elems[i].text);
extl_table_sets_i(tt, "type", sb->elems[i].type);
extl_table_sets_s(tt, "text", sb->elems[i].text);
extl_table_sets_s(tt, "tmpl", sb->elems[i].tmpl);
extl_table_sets_i(tt, "align", sb->elems[i].align);
extl_table_sets_i(tt, "zeropad", sb->elems[i].zeropad);
extl_table_sets_s(tt, "tmpl", sb->elems[i].tmpl);
extl_table_sets_i(tt, "align", sb->elems[i].align);
extl_table_sets_i(tt, "zeropad", sb->elems[i].zeropad);
- extl_table_gets_s(t, attrnm, &(el->attr));
+ char *s;
+ if(extl_table_gets_s(t, attrnm, &s)){
+ el->attr=stringstore_alloc(s);
+ free(s);
+ }