Пример #1
0
Файл: icons.c Проект: g7/fbpanel
static void
theme_changed(icons_priv *ics)
{
    ENTER;
    drop_config(ics);
    ics_parse_config(ics);
    do_net_client_list(ics);
    RET();
}
Пример #2
0
static int
icons_constructor(plugin *p)
{
    icons *ics;
    line s;

    ENTER;
    ics = g_new0(icons, 1);
    ics->plug = p;
    p->priv = ics;

    ics->wmpixno           = 0;
    ics->task_list         = g_hash_table_new(g_int_hash, g_int_equal);
    s.len = 256;
    while (get_line(p->fp, &s) != LINE_BLOCK_END) {
        if (s.type == LINE_NONE) {
            ERR( "icons: illegal token %s\n", s.str);
            goto error;
        }
        if (s.type == LINE_VAR) {
            if (!g_ascii_strcasecmp(s.t[0], "DefaultIcon")) {
                if (!read_dicon(ics, s.t[1])) {
                    goto error;
                }
            } else {
                ERR( "icons: unknown var %s\n", s.t[0]);
                goto error;
            }
        } else if (s.type == LINE_BLOCK_START) {
            if (!g_ascii_strcasecmp(s.t[0], "application")) {
                if (!read_application(p)) {
                    goto error;
                }
            } else {
                ERR( "icons: unknown var %s\n", s.t[0]);
                goto error;
            }
        } else {
            ERR( "icons: illegal in this context %s\n", s.str);
            goto error;
        }
    }

    icons_build_gui(p);
    do_net_client_list(NULL, ics);
    RET(1);

error:
    icons_destructor(p);
    RET(0);
}