void MMSSwitcher::show() { MMSConfigData config; int firstplugin = atoi(config.getFirstPlugin().c_str()); if(firstplugin > 0) { this->switchToPluginEx(firstplugin); } else { this->window->show(); } }
MMSPluginManager::MMSPluginManager() { MMSConfigData *config = new MMSConfigData(); this->source = new DataSource(config->getConfigDBDBMS(), config->getConfigDBDatabase(), config->getConfigDBAddress(), config->getConfigDBPort(), config->getConfigDBUser(), config->getConfigDBPassword()); delete config; this->service = new MMSPluginService(source); }
MMSTheme *MMSThemeManager::loadLocalTheme(string path, string themeName) { // check if initialized INITCHECK; // check if theme is already loaded for(vector<MMSTheme*>::const_iterator i = this->localThemes.begin(); i != this->localThemes.end(); ++i) { if(((*i)->getPath() == path) && ((*i)->getThemeName() == themeName)) { // already loaded return *i; } } // load new theme MMSConfigData config; MMSTheme *theme = new MMSTheme(config.getInitialLoad(), config.getDebugFrames()); loadLocalTheme(theme, path, themeName); // add theme to list this->localThemes.push_back(theme); return theme; }
void Cmd::prepareDb() { MMSRcParser rcparser; MMSConfigDataGlobal *rcGlobal; MMSConfigDataDB *rcConfigDB, *rcDataDB; MMSConfigDataGraphics *rcGraphics; MMSConfigDataLanguage *rcLanguage; //get datasource try { rcparser.parseFile(cmdline["config"]); rcparser.getMMSRc(&rcGlobal, &rcConfigDB, &rcDataDB, &rcGraphics,&rcLanguage); } catch (MMSRcParserError &ex) { char error[1024]; sprintf(error,"cannot read configuration file @[1m%s@[0m.",configfile.c_str()); cons.printError(error); exit(1); } rcGlobal->stdout = true; MMSConfigData config = MMSConfigData(*rcGlobal, *rcConfigDB, *rcDataDB, *rcGraphics,*rcLanguage); //printworkingdata(&config); try { /* get the active osd and central plugins */ datasource = new DataSource(config.getConfigDBDBMS(), config.getConfigDBDatabase(), config.getConfigDBAddress(), config.getConfigDBPort(), config.getConfigDBUser(), config.getConfigDBPassword()); } catch(MMSError &ex) { cons.printText("cannot get data source."); } }
void MMSWindowClass::setAttributesFromTAFF(MMSTaffFile *tafff, string *path, bool reset_paths) { MMSFBColor color; if ((reset_paths)&&(path)&&(*path!="")) { // unset my paths unsetBgImagePath(); } startTAFFScan { switch (attrid) { case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_alignment: setAlignment(getAlignmentFromString(attrval_str)); break; case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_dx: setDx(attrval_str); break; case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_dy: setDy(attrval_str); break; case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_w: setWidth(attrval_str); break; case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_h: setHeight(attrval_str); break; case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_bgcolor: setBgColor(MMSFBColor((unsigned int)attrval_int)); break; case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_bgcolor_a: color.a = color.r = color.g = color.b = 0; if (isBgColor()) getBgColor(color); color.a = attrval_int; setBgColor(color); break; case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_bgcolor_r: color.a = color.r = color.g = color.b = 0; if (isBgColor()) getBgColor(color); color.r = attrval_int; setBgColor(color); break; case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_bgcolor_g: color.a = color.r = color.g = color.b = 0; if (isBgColor()) getBgColor(color); color.g = attrval_int; setBgColor(color); break; case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_bgcolor_b: color.a = color.r = color.g = color.b = 0; if (isBgColor()) getBgColor(color); color.b = attrval_int; setBgColor(color); break; case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_bgimage: if (*attrval_str) setBgImagePath(""); else setBgImagePath((path)?*path:""); setBgImageName(attrval_str); break; case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_bgimage_path: if (*attrval_str) setBgImagePath(attrval_str); else setBgImagePath((path)?*path:""); break; case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_bgimage_name: setBgImageName(attrval_str); break; case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_opacity: setOpacity(attrval_int); break; case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_fadein: setFadeIn((attrval_int) ? true : false); break; case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_fadeout: setFadeOut((attrval_int) ? true : false); break; case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_debug: setDebug((attrval_int) ? true : false); break; case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_margin: setMargin(attrval_int); break; case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_up_arrow: setUpArrow(attrval_str); break; case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_down_arrow: setDownArrow(attrval_str); break; case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_left_arrow: setLeftArrow(attrval_str); break; case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_right_arrow: setRightArrow(attrval_str); break; case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_navigate_up: setNavigateUp(attrval_str); break; case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_navigate_down: setNavigateDown(attrval_str); break; case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_navigate_left: setNavigateLeft(attrval_str); break; case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_navigate_right: setNavigateRight(attrval_str); break; case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_own_surface: #ifdef __HAVE_DIRECTFB__ if(attrval_int) { MMSConfigData config; if(config.getBackend() == MMSFB_BE_DFB) { cerr << "Warning: DirectFB backend does not support own_surface=true (ignored)" << endl; break; } } #endif setOwnSurface((attrval_int) ? true : false); break; case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_movein: setMoveIn(getDirectionFromString(attrval_str)); break; case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_moveout: setMoveOut(getDirectionFromString(attrval_str)); break; case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_modal: setModal((attrval_int) ? true : false); break; case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_static_zorder: setStaticZOrder((attrval_int) ? true : false); break; case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_always_on_top: setAlwaysOnTop((attrval_int) ? true : false); break; case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_focusable: setFocusable((attrval_int) ? true : false); break; case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_backbuffer: setBackBuffer((attrval_int) ? true : false); break; case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_initial_load: setInitialLoad((attrval_int) ? true : false); break; } } endTAFFScan if ((reset_paths)&&(path)&&(*path!="")) { // set my paths if (!isBgImagePath()) setBgImagePath(*path); } }