void buttonClicked (Button* b) { if (b == &loadButton) loadScheme(); else saveScheme(); }
RenderWindow::RenderWindow(int width, int height, std::string name) : sf::RenderWindow(sf::VideoMode(width, height), name, sf::Style::Close | sf::Style::Titlebar) { elapsedclock = new sf::Clock; inpMan = new InputManager; glEnable(GL_TEXTURE_2D); CEGUI::OpenGLRenderer& renderer = CEGUI::OpenGLRenderer::bootstrapSystem(); CEGUI::DefaultResourceProvider* rp = static_cast<CEGUI::DefaultResourceProvider*>(CEGUI::System::getSingleton().getResourceProvider()); rp->setResourceGroupDirectory("schemes", GameManager::getGameFolderName() + "gui/schemes/"); rp->setResourceGroupDirectory("imagesets", GameManager::getGameFolderName() + "gui/imagesets/"); rp->setResourceGroupDirectory("fonts", GameManager::getGameFolderName() + "gui/fonts/"); rp->setResourceGroupDirectory("layouts", GameManager::getGameFolderName() + "gui/layouts/"); rp->setResourceGroupDirectory("looknfeels", GameManager::getGameFolderName() + "gui/looknfeel/"); rp->setResourceGroupDirectory("lua_scripts", GameManager::getGameFolderName() + "gui/lua_scripts/"); rp->setResourceGroupDirectory("falcon_scripts", GameManager::getGameFolderName() + "gui/falcon_scripts/"); rp->setResourceGroupDirectory("schemas", GameManager::getGameFolderName() + "gui/xml_schemas/"); CEGUI::ImageManager::setImagesetDefaultResourceGroup("imagesets"); CEGUI::Font::setDefaultResourceGroup("fonts"); CEGUI::Scheme::setDefaultResourceGroup("schemes"); CEGUI::WidgetLookManager::setDefaultResourceGroup("looknfeels"); CEGUI::WindowManager::setDefaultResourceGroup("layouts"); CEGUI::ScriptModule::setDefaultResourceGroup("falcon_scripts"); CEGUI::XMLParser* parser = CEGUI::System::getSingleton().getXMLParser(); if(parser->isPropertyPresent("SchemaDefaultResourceGroup")) parser->setProperty("SchemaDefaultResourceGroup", "schemas"); #ifdef FALCON1 #else CEGUI::System::getSingleton().setScriptingModule(FalconScriptingModule::create()); #endif CEGUI::System::getSingleton().executeScriptFile("gui", "falcon_scripts"); this->setVerticalSyncEnabled(true); this->setFramerateLimit(60); // Remove and put to script ASAP loadScheme("TaharezLook"); loadFont("Inconsolata-14"); setArrowandTooltipScheme("TaharezLook"); // --END-- setupMap(); }
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * LEXICAL SCANNER */ LOCAL te_dp_event yylex(void) { lastToken = DP_EV_INVALID; scanAgain: /* * Start the process of locating a token. * We branch here after skipping over a comment * or processing a directive (which may change our context). */ if (IS_WHITESPACE_CHAR(*pCurCtx->pzScan)) trim_whitespace(); switch (*pCurCtx->pzScan) { case NUL: /* * IF we are not inside an include context, * THEN go finish. */ if (pCurCtx->pCtx == NULL) goto lex_done; pop_context(); goto scanAgain; case '#': { extern char * processDirective(char*); char * pz = processDirective(pCurCtx->pzScan+1); /* * Ensure that the compiler doesn't try to save a copy of * "pCurCtx" in a register. It must be reloaded from memory. */ pCurCtx->pzScan = pz; goto scanAgain; } case '{': SET_LIT_TKN(O_BRACE); break; case '=': SET_LIT_TKN(EQ); break; case '}': SET_LIT_TKN(C_BRACE); break; case '[': SET_LIT_TKN(OPEN_BKT); break; case ']': SET_LIT_TKN(CLOSE_BKT); break; case ';': SET_LIT_TKN(SEMI); break; case ',': SET_LIT_TKN(COMMA); break; case '\'': case '"': { char* pz = ao_string_cook(pCurCtx->pzScan, &(pCurCtx->lineNo)); if (pz == NULL) goto NUL_error; pz_token = pCurCtx->pzScan; lastToken = DP_EV_STRING; pCurCtx->pzScan = pz; break; } case '<': switch (lex_here_string()) { case SUCCESS: break; case FAILURE: goto BrokenToken; case PROBLEM: return DP_EV_INVALID; } break; case '(': loadScheme(); break; case '\\': if (strncmp(pCurCtx->pzScan+1, "'(", (size_t)2) == 0) { alist_to_autogen_def(); goto scanAgain; } lex_escaped_char(); break; case '`': switch (lex_backquote()) { case FAILURE: goto NUL_error; case PROBLEM: goto scanAgain; case SUCCESS: break; } break; case '/': switch (lex_comment()) { case SUCCESS: goto scanAgain; default: break; } /* FALLTHROUGH */ /* to Invalid input char */ default: BrokenToken: pCurCtx->pzScan = assembleName(pCurCtx->pzScan, &lastToken); break; } /* switch (*pCurCtx->pzScan) */ return lastToken; NUL_error: AG_ABEND(aprf(zErrMsg, pzProg, "unterminated quote in definition", pCurCtx->pzCtxFname, pCurCtx->lineNo)); return DP_EV_INVALID; lex_done: /* * First time through, return the DP_EV_END token. * Second time through, we really finish. */ if (pCurCtx->pzScan == zNil) { pCurCtx->pCtx = pDoneCtx; pDoneCtx = pCurCtx; return DP_EV_INVALID; } pCurCtx->pzScan = (char*)zNil; return DP_EV_END; }
void AbstractEditTab::initialize() { ui_edit_edit->setCurrentFont(QFont("Courier")); // opt connections connect(this, SIGNAL(optimizerChanged(Optimizer*)), m_opt, SLOT(setOptimizer(Optimizer*)), Qt::DirectConnection); connect(this, SIGNAL(queueInterfaceChanged(QueueInterface*)), m_opt, SLOT(setQueueInterface(QueueInterface*)), Qt::DirectConnection); // Dialog connections connect(this, SIGNAL(optimizerChanged(Optimizer*)), m_dialog, SIGNAL(tabsUpdateGUI())); connect(this, SIGNAL(queueInterfaceChanged(QueueInterface*)), m_dialog, SIGNAL(tabsUpdateGUI())); // Edit tab connections connect(this, SIGNAL(optimizerChanged(Optimizer*)), this, SLOT(populateTemplates())); connect(this, SIGNAL(queueInterfaceChanged(QueueInterface*)), this, SLOT(populateTemplates())); connect(this, SIGNAL(optimizerChanged(Optimizer*)), this, SLOT(populateOptStepList())); connect(this, SIGNAL(queueInterfaceChanged(QueueInterface*)), this, SLOT(populateOptStepList())); connect(ui_push_optimizerConfig, SIGNAL(clicked()), this, SLOT(configureOptimizer())); connect(ui_push_queueInterfaceConfig, SIGNAL(clicked()), this, SLOT(configureQueueInterface())); connect(ui_push_help, SIGNAL(clicked()), this, SLOT(showHelp())); connect(ui_edit_edit, SIGNAL(textChanged()), this, SLOT(saveCurrentTemplate())); connect(ui_combo_templates, SIGNAL(currentIndexChanged(int)), this, SLOT(updateEditWidget())); connect(ui_push_add, SIGNAL(clicked()), this, SLOT(appendOptStep())); connect(ui_push_remove, SIGNAL(clicked()), this, SLOT(removeCurrentOptStep())); connect(ui_list_optStep, SIGNAL(currentRowChanged(int)), this, SLOT(updateEditWidget())); connect(ui_edit_user1, SIGNAL(editingFinished()), this, SLOT(updateUserValues())); connect(ui_edit_user2, SIGNAL(editingFinished()), this, SLOT(updateUserValues())); connect(ui_edit_user3, SIGNAL(editingFinished()), this, SLOT(updateUserValues())); connect(ui_edit_user4, SIGNAL(editingFinished()), this, SLOT(updateUserValues())); connect(ui_combo_optimizers, SIGNAL(currentIndexChanged(int)), this, SLOT(updateOptimizer())); connect(ui_combo_queueInterfaces, SIGNAL(currentIndexChanged(int)), this, SLOT(updateQueueInterface())); connect(ui_push_saveScheme, SIGNAL(clicked()), this, SLOT(saveScheme())); connect(ui_push_loadScheme, SIGNAL(clicked()), this, SLOT(loadScheme())); // Populate combo boxes unsigned int index; // QueueInterfaces ui_combo_queueInterfaces->clear(); index = 0; for (QList<QueueInterface*>::const_iterator it = m_queueInterfaces.constBegin(), it_end = m_queueInterfaces.constEnd(); it != it_end; ++it) { ui_combo_queueInterfaces->insertItem(index++, (*it)->getIDString()); } // Optimizers ui_combo_optimizers->clear(); index = 0; for (QList<Optimizer*>::const_iterator it = m_optimizers.constBegin(), it_end = m_optimizers.constEnd(); it != it_end; ++it) { ui_combo_optimizers->insertItem(index++, (*it)->getIDString()); } ui_combo_queueInterfaces->setCurrentIndex(0); ui_combo_optimizers->setCurrentIndex(0); AbstractTab::initialize(); updateGUI(); }