- * 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 <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);
LINK_ITEM(statusbars, p, sb_next, sb_prev);
return TRUE;
LINK_ITEM(statusbars, p, sb_next, sb_prev);
return TRUE;
+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++){
static WPHolder *statusbar_prepare_manage(WStatusBar *sb,
const WClientWin *cwin,
const WManageParams *param,
static WPHolder *statusbar_prepare_manage(WStatusBar *sb,
const WClientWin *cwin,
const WManageParams *param,
if(mgr!=NULL)
return region_prepare_manage(mgr, cwin, param,
if(mgr!=NULL)
return region_prepare_manage(mgr, cwin, param,
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);
+ }
* Resulting state is returned.
*/
EXTL_EXPORT_AS(WStatusBar, set_systray)
* Resulting state is returned.
*/
EXTL_EXPORT_AS(WStatusBar, set_systray)