void load_tab(unsigned char tab) { struct widget_config *w_cfg; DTABS("Loading tab %d\n", tab); /* stop rendering */ video_pause(); /* reset widgets module */ widgets_reset(); /* default video profile */ video_apply_config(0); if (tab == 0) { w_cfg = (struct widget_config*) tab0_widgets; } else { w_cfg = config.widgets; } /* load widgets config */ while (w_cfg->tab != TABS_END) { if (w_cfg->tab == tab) load_widget_config(w_cfg); w_cfg++; } load_widgets(); /* resume video rendering */ video_resume(); active_tab = tab; DTABS("Loaded\n"); }
void load_tab(unsigned char tab) { struct widget_config *w_cfg = &config.widgets[0]; struct widget *w; struct widget_config tmp_wcfg; struct widget **aw = active_widgets; DTABS("Loading tab %d\n", tab); /* stop rendering */ video_pause(); while ((*aw) != NULL) { if ((*aw)->ops->close != NULL) { DTABS("closing widget %p: %s\n", *aw, (*aw)->ops->name); (*aw)->ops->close(*aw); } aw++; } aw = active_widgets; /* reset widgets module */ widgets_reset(); if (tab == 0) { /* zero tab */ /* console */ tmp_wcfg.widget_id = WIDGET_CONSOLE_ID; tmp_wcfg.x = 0; tmp_wcfg.y = 0; tmp_wcfg.props.vjust = VJUST_TOP; tmp_wcfg.props.hjust = HJUST_LEFT; w = load_widget(&tmp_wcfg); tmp_wcfg.widget_id = WIDGET_VIDEOLVL_ID; tmp_wcfg.props.hjust = HJUST_RIGHT; w = load_widget(&tmp_wcfg); } else { /* load tab widgets */ while (w_cfg->tab != TABS_END) { if (w_cfg->tab == tab) { w = load_widget(w_cfg); if (w == NULL) break; *(aw++) = w; } w_cfg++; } } *aw = NULL; /* resume video rendering */ video_resume(); active_tab = tab; DTABS("Loaded\n"); }
int dtvideo_resume (void *video_priv) { dtvideo_context_t *vctx = (dtvideo_context_t *) video_priv; return video_resume (vctx); }