System::System(JNIEnv *env, jobject nidroid) { m_JNIScope = new jnipp::Env::Scope(env); jnipp::Ref<jnipp::Object> nidroidRef(nidroid); m_Nidroid.set(nidroidRef); m_NidroidClass.set(nidroidRef->getClass()); jnipp::StaticMethod<jdouble> getPixelRatio(m_NidroidClass, "getPixelRatio", "()D"); jnipp::StaticMethod<jnipp::String> getUserDirectory(m_NidroidClass, "getUserDirectory", "()Ljava/lang/String;"); jnipp::StaticMethod<jnipp::String> getLanguage(m_NidroidClass, "getLanguage", "()Ljava/lang/String;"); jnipp::Method<jnipp::String> getCacheDirectory(m_NidroidClass, "getCacheDirectory", "()Ljava/lang/String;"); m_PixelRatio = getPixelRatio(); m_UserDirectory = getUserDirectory()->str(); m_CacheDirectory = getCacheDirectory(m_Nidroid)->str(); m_Language = getLanguage()->str(); #ifdef NDM_ANDROID_DEVELOPMENT static const char embedDir[] = "/nidium/Embed/"; size_t size = (strlen(m_UserDirectory) + strlen(embedDir) + 1); m_EmbedDirectory = (char *)malloc(sizeof(char) * size); snprintf(m_EmbedDirectory, size, "%s%s", m_UserDirectory, embedDir); #else static const char embedDir[] = "/nidium/Embed/"; size_t size = (strlen(m_CacheDirectory) + strlen(embedDir) + 1); m_EmbedDirectory = (char *)malloc(sizeof(char) * size); snprintf(m_EmbedDirectory, size, "%s%s", m_CacheDirectory, embedDir); #endif }
//static std::string LLUI::locateSkin(const std::string& filename) { std::string slash = gDirUtilp->getDirDelimiter(); std::string found_file = filename; if (!gDirUtilp->fileExists(found_file)) { found_file = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, filename); // Should be CUSTOM_SKINS? } if (sConfigGroup && sConfigGroup->controlExists("Language")) { if (!gDirUtilp->fileExists(found_file)) { std::string localization = getLanguage(); std::string local_skin = "xui" + slash + localization + slash + filename; found_file = gDirUtilp->findSkinnedFilename(local_skin); } } if (!gDirUtilp->fileExists(found_file)) { std::string local_skin = "xui" + slash + "en-us" + slash + filename; found_file = gDirUtilp->findSkinnedFilename(local_skin); } if (!gDirUtilp->fileExists(found_file)) { found_file = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, filename); } return found_file; }
// let the "programming language" for a group depend on what is inserted into it. // First item that has an associated languages determines the language for the whole group. void GroupDef::updateLanguage(const Definition *d) { if (getLanguage()==SrcLangExt_Unknown && d->getLanguage()!=SrcLangExt_Unknown) { setLanguage(d->getLanguage()); } }
void NamespaceDef::addListReferences() { //bool fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN"); { QList<ListItemInfo> *xrefItems = xrefListItems(); addRefItem(xrefItems, qualifiedName(), getLanguage()==SrcLangExt_Fortran ? theTranslator->trModule(TRUE,TRUE) : theTranslator->trNamespace(TRUE,TRUE), getOutputFileBase(),displayName(), 0, this ); } MemberGroupSDict::Iterator mgli(*memberGroupSDict); MemberGroup *mg; for (; (mg=mgli.current()); ++mgli) { mg->addListReferences(this); } QListIterator<MemberList> mli(m_memberLists); MemberList *ml; for (mli.toFirst(); (ml=mli.current()); ++mli) { if (ml->listType()&MemberListType_documentationLists) { ml->addListReferences(this); } } }
bool SciDoc::SaveToFile(const char*filename, bool as_itself) { #ifdef WIN32 FXFile fh(filename, FXIO::WriteOnly|FXIO::Truncate|((FXStat::exists(filename))?0:FXIO::Create)); #else FXFile fh(filename, FXIO::Writing); #endif _lasterror=""; if (fh.isOpen()) { FXbool en=isEnabled(); FXbool hf=hasFocus(); FXTextCodec *codec=NULL; FXString recode=FXString::null; if (en) { disable(); } FXint len=sendMessage(SCI_GETLENGTH,0,0); const char*buf=(const char*)sendMessage(SCI_GETCHARACTERPOINTER,0,0); if (bom[0]) { fh.writeBlock(bom,strlen(bom)); switch ((FXuchar)bom[0]) { case 0xFF: { codec=new FXUTF16LECodec(); break; } case 0xFE: { codec=new FXUTF16BECodec(); break; } } } if (codec) { FXint old_len=len; len=codec->utf2mblen(buf,old_len); recode.length(len); codec->utf2mb((char*)recode.text(),len,buf,old_len); delete codec; buf=recode.text(); } FXival wrote=fh.writeBlock(buf,len); if (en) { enable(); } if (hf) { setFocus(); } if (fh.close() && (wrote==len)) { if (as_itself) { if (_filename.empty() && !getLanguage()) { if (!SetLanguageForHeader(filename)) { if (!setLanguageFromFileName(FXPath::name(filename).text())) { setLanguageFromContent(); } } } _filename=FXPath::absolute(filename); _filetime=FXStat::modified(_filename); sendMessage(SCI_SETSAVEPOINT,0,0); DoStaleTest(true); } return true; } } _lasterror=SystemErrorStr(); return false; }
/** * \fn isLanguageSet * */ bool ADM_audioStream::isLanguageSet(void) { const std::string lang=getLanguage(); if(lang.size()!=3) return false; // hackish... return true; }
void TattooEngine::initialize() { initGraphics(640, 480, true); // Initialize the base engine SherlockEngine::initialize(); // Initialise the global flags _flags.resize(3200); _flags[1] = _flags[4] = _flags[76] = true; _runningProlog = true; // Add some more files to the cache _res->addToCache("walk.lib"); // Set up list of people for (int idx = 0; idx < TATTOO_MAX_PEOPLE; ++idx) { _people->_characters.push_back(PersonData( getLanguage() == Common::FR_FRA ? FRENCH_NAMES[idx] : ENGLISH_NAMES[idx], PORTRAITS[idx], nullptr, nullptr)); } // Load the inventory loadInventory(); // Starting scene _scene->_goToScene = STARTING_INTRO_SCENE; // Load an initial palette loadInitialPalette(); }
QCString NamespaceDef::compoundTypeString() const { SrcLangExt lang = getLanguage(); if (lang==SrcLangExt_Java || lang==SrcLangExt_CSharp) { return "package"; } else if (lang==SrcLangExt_Fortran) { return "module"; } else if (lang==SrcLangExt_IDL) { if (isModule()) { return "module"; } else if (isConstantGroup()) { return "constants"; } else { err("Internal inconsistency: namespace in IDL not module or constant group\n"); } } return ""; }
Common::String *LureEngine::detectSave(int slotNumber) { Common::ReadStream *f = this->_saveFileMan->openForLoading( generateSaveName(slotNumber)); if (f == NULL) return NULL; Common::String *result = NULL; // Check for header char buffer[5]; f->read(&buffer[0], 5); if (memcmp(&buffer[0], "lure", 5) == 0) { // Check language version uint8 language = f->readByte(); uint8 version = f->readByte(); if ((language == getLanguage()) && (version >= LURE_MIN_SAVEGAME_MINOR)) { // Read in the savegame title char saveName[MAX_DESC_SIZE]; char *p = saveName; int decCtr = MAX_DESC_SIZE - 1; while ((decCtr > 0) && ((*p++ = f->readByte()) != 0)) --decCtr; *p = '\0'; result = new Common::String(saveName); } } delete f; return result; }
string CloudsClip::getSubtitlesPath() { //for Higa-san, return english subtitles if(getLanguage() == "JAPANESE" && GetLanguage() == "JAPANESE"){ return GetCloudsDataPath() + "language/ENGLISH/subtitles/" + getSubtitlesFilename(); } return GetCloudsDataPath() + "language/" + GetLanguage() + "/subtitles/" + getSubtitlesFilename(); }
std::string GameInfo::getPrintDetails() const { std::string ret; std::string title = getGameTitle(); if (title == "") title = "Unknown"; ret = title + ", "; std::string lang = getLanguage(); if (lang == "") lang = "Unknown"; ret += lang; if (type != GAME_PENTAGRAM_MENU) { // version, md5 don't make sense for the pentagram menu ret += ", version "; ret += getPrintableVersion(); ret += ", md5 "; ret += getPrintableMD5(); } return ret; }
int AgiEngine::showItems() { unsigned int x, i; for (x = i = 0; x < _game.numObjects; x++) { if (objectGetLocation(x) == EGO_OWNED) { // add object to our list! _intobj[i] = x; printItem(i, STATUS_FG, STATUS_BG); i++; } } if (i == 0) { switch (getLanguage()) { case Common::RU_RUS: printText(NOTHING_MSG_RU, 0, NOTHING_X_RU, NOTHING_Y_RU, 40, STATUS_FG, STATUS_BG); break; default: printText(NOTHING_MSG, 0, NOTHING_X, NOTHING_Y, 40, STATUS_FG, STATUS_BG); break; } } return i; }
const char *SagaEngine::getTextString(int textStringId) { const char *string; int lang = 0; switch (getLanguage()) { case Common::DE_DEU: lang = 1; break; case Common::IT_ITA: lang = 2; break; case Common::ES_ESP: lang = 3; break; case Common::RU_RUS: lang = 4; break; default: lang = 0; break; } string = ITEinterfaceTextStrings[lang][textStringId]; if (!string) string = ITEinterfaceTextStrings[0][textStringId]; return string; }
void GfxFeatureMapRequestPacket::printPacket() const { cout << "GfxFeatureMapRequestPacket::printPacket() for map " << getMapID() << endl; cout << "Bounding box for the GfxFeatureMapRequestPacket:" << endl; MC2BoundingBox bbox; getMC2BoundingBox(&bbox); bbox.dump(); uint16 x, y; getScreenSize(x, y); cout << "Screen size (x = " << x << ", y = " << y << ")" << endl; cout << "max scaleLevel = " << getMaxScaleLevel() << endl; cout << "min scaleLevel = " << getMinScaleLevel() << endl; cout << "filt scaleLevel = " << getFiltScaleLevel() << endl; cout << "language = " << (int)getLanguage() << endl; cout << "nbrNodeIDs " << getNbrNodeIDs() << endl; cout << " isStartAndEnd byte 0x" << hex << int( readByte(isStartAndEnd_POS)) << dec << endl; cout << "IgnoreStartOffset " << BP(getIgnoreStartOffset()) << endl; cout << " isStartAndEnd byte 0x" << hex << int(readByte(isStartAndEnd_POS)) << dec << endl; cout << "IgnoreEndOffset " << BP(getIgnoreEndOffset()) << endl; cout << "StartOffset " << getStartOffset() << endl; cout << "EndOffset " << getEndOffset() << endl; cout << "NbrReqPackets " << int(getNbrReqPackets()) << endl; cout << "DrawOverviewContents " << BP(getDrawOverviewContents()) << endl; }
int PrinceEngine::checkMob(Graphics::Surface *screen, Common::Array<Mob> &mobList, bool usePriorityList) { if (_mouseFlag == 0 || _mouseFlag == 3) { return -1; } Common::Point mousePos = _system->getEventManager()->getMousePos(); int mobNumber = getMob(mobList, usePriorityList, mousePos.x + _picWindowX, mousePos.y); if (mobNumber != -1) { Common::String mobName = mobList[mobNumber]._name; if (getLanguage() == Common::DE_DEU) { for (uint i = 0; i < mobName.size(); i++) { switch (mobName[i]) { case '\xc4': mobName.setChar('\x83', i); break; case '\xd6': mobName.setChar('\x84', i); break; case '\xdc': mobName.setChar('\x85', i); break; case '\xdf': mobName.setChar('\x7f', i); break; case '\xe4': mobName.setChar('\x80', i); break; case '\xf6': mobName.setChar('\x81', i); break; case '\xfc': mobName.setChar('\x82', i); break; } } } uint16 textW = getTextWidth(mobName.c_str()); uint16 x = mousePos.x - textW / 2; if (x > screen->w) { x = 0; } if (x + textW > screen->w) { x = screen->w - textW; } uint16 y = mousePos.y - _font->getFontHeight(); if (y > screen->h) { y = _font->getFontHeight() - 2; } _font->drawString(screen, mobName, x, y, screen->w, 216); } return mobNumber; }
/** * * * @author FloSoft */ const std::string Languages::setLanguage(unsigned int i) { const Language l = getLanguage(i); setLanguage(l.code); return l.code; }
void PageDef::writePageDocumentation(OutputList &ol) { bool markdownEnabled = Doxygen::markdownSupport; if (getLanguage()==SrcLangExt_Markdown) { Doxygen::markdownSupport = TRUE; } ol.startTextBlock(); ol.generateDoc( docFile(), // fileName docLine(), // startLine this, // context 0, // memberdef documentation()+inbodyDocumentation(), // docStr TRUE, // index words FALSE // not an example ); ol.endTextBlock(); Doxygen::markdownSupport = markdownEnabled; if (hasSubPages()) { // for printed documentation we write subpages as section's of the // parent page. ol.pushGeneratorState(); ol.disableAll(); ol.enable(OutputGenerator::Latex); ol.enable(OutputGenerator::RTF); PageSDict::Iterator pdi(*m_subPageDict); PageDef *subPage=pdi.toFirst(); for (pdi.toFirst();(subPage=pdi.current());++pdi) { SectionInfo::SectionType sectionType = SectionInfo::Paragraph; switch (m_nestingLevel) { case 0: sectionType = SectionInfo::Page; break; case 1: sectionType = SectionInfo::Section; break; case 2: sectionType = SectionInfo::Subsection; break; case 3: sectionType = SectionInfo::Subsubsection; break; default: sectionType = SectionInfo::Paragraph; break; } QCString title = subPage->title(); if (title.isEmpty()) title = subPage->name(); ol.startSection(subPage->name(),title,sectionType); ol.parseText(title); ol.endSection(subPage->name(),sectionType); Doxygen::subpageNestingLevel++; subPage->writePageDocumentation(ol); Doxygen::subpageNestingLevel--; } ol.popGeneratorState(); } }
void SkPaintOptionsAndroid::flatten(SkWriteBuffer& buffer) const { buffer.writeUInt(fFontVariant); #ifdef SKLANG_OPT buffer.writeString(getLanguage().getTag().c_str()); #else buffer.writeString(fLanguage.getTag().c_str()); #endif buffer.writeBool(fUseFontFallbacks); }
void TParseContextBase::finish() { if (!parsingBuiltins) { // Transfer the linkage symbols to AST nodes for (auto i = linkageSymbols.begin(); i != linkageSymbols.end(); ++i) intermediate.addSymbolLinkageNode(linkage, **i); intermediate.addSymbolLinkageNodes(linkage, getLanguage(), symbolTable); } }
/** * When the user changes the language, the codegenoptions page * language-dependent stuff has to be updated. * The way to do this is to call its "apply" method. */ void CodeGenOptionsPage::changeLanguage() { QString plStr = getLanguage(); Uml::ProgrammingLanguage::Enum pl = Uml::ProgrammingLanguage::fromString(plStr); UMLApp::app()->setActiveLanguage(pl); /* @todo is this needed? if yes adapt to new scheme m_CodeGenOptionsPage->setCodeGenerator(m_doc->getCurrentCodeGenerator()); */ apply(); }
void TParseContextBase::finish() { if (parsingBuiltins) return; // Transfer the linkage symbols to AST nodes TIntermAggregate* linkage = new TIntermAggregate; for (auto i = linkageSymbols.begin(); i != linkageSymbols.end(); ++i) intermediate.addSymbolLinkageNode(linkage, **i); intermediate.addSymbolLinkageNodes(linkage, getLanguage(), symbolTable); }
QCString NamespaceDef::displayName(bool includeScope) const { QCString result=includeScope ? name() : localName(); SrcLangExt lang = getLanguage(); QCString sep = getLanguageSpecificSeparator(lang); if (sep!="::") { result = substitute(result,"::",sep); } //printf("NamespaceDef::displayName() %s->%s lang=%d\n",name().data(),result.data(),lang); return result; }
opennlp::tools::namefind::TokenNameFinderModel *TokenNameFinderModel::updateFeatureGenerator(char descriptor[]) { TokenNameFinderModel *model = new TokenNameFinderModel(getLanguage(), getNameFinderModel(), descriptor, Collections::emptyMap<std::string, void*>(), Collections::emptyMap<std::string, std::string>()); // TODO: Not so nice! model->artifactMap->clear(); model->artifactMap->putAll(artifactMap); model->artifactMap->put(GENERATOR_DESCRIPTOR_ENTRY_NAME, descriptor); return model; }
uint8 DreamWebEngine::modifyChar(uint8 c) const { if (c < 128) return c; switch(getLanguage()) { case Common::DE_DEU: switch(c) { case 129: return 'Z' + 3; case 132: return 'Z' + 1; case 142: return 'Z' + 4; case 154: return 'Z' + 6; case 225: return 'A' - 1; case 153: return 'Z' + 5; case 148: return 'Z' + 2; default: return c; } case Common::ES_ESP: switch(c) { case 160: return 'Z' + 1; case 130: return 'Z' + 2; case 161: return 'Z' + 3; case 162: return 'Z' + 4; case 163: return 'Z' + 5; case 164: return 'Z' + 6; case 165: return ',' - 1; case 168: return 'A' - 1; case 173: return 'A' - 4; case 129: return 'A' - 5; default: return c; } default: return c; } }
bool CruiseEngine::loadLanguageStrings() { Common::File f; // Give preference to a language file if (f.open("DELPHINE.LNG")) { char *data = (char *)MemAlloc(f.size()); f.read(data, f.size()); char *ptr = data; for (int i = 0; i < MAX_LANGUAGE_STRINGS; ++i) { // Get the start of the next string while (*ptr != '"') ++ptr; const char *v = ++ptr; // Find the end of the string, and replace the end '"' with a NULL while (*ptr != '"') ++ptr; *ptr++ = '\0'; // Add the string to the list _langStrings.push_back(v); } f.close(); MemFree(data); } else { // Try and use one of the pre-defined language lists const char **p = NULL; switch (getLanguage()) { case Common::EN_ANY: p = englishLanguageStrings; break; case Common::FR_FRA: p = frenchLanguageStrings; break; case Common::DE_DEU: p = germanLanguageStrings; break; case Common::IT_ITA: p = italianLanguageStrings; break; default: return false; } // Load in the located language set for (int i = 0; i < 13; ++i, ++p) _langStrings.push_back(*p); } return true; }
NATraceList ElemDDLUdrLanguage::getDetailInfo() const { NAString detailText; NATraceList detailTextList; detailText = "Language: "; detailText += UnsignedToNAString((UInt32)getLanguage()); detailTextList.append(detailText); return detailTextList; }
TEST(FTSQueryNoop, Clone) { FTSQueryNoop q; q.setQuery("foo"); q.setLanguage("bar"); q.setCaseSensitive(true); q.setDiacriticSensitive(true); auto clone = q.clone(); ASSERT_EQUALS(clone->getQuery(), q.getQuery()); ASSERT_EQUALS(clone->getLanguage(), q.getLanguage()); ASSERT_EQUALS(clone->getCaseSensitive(), q.getCaseSensitive()); ASSERT_EQUALS(clone->getDiacriticSensitive(), q.getDiacriticSensitive()); }
void NamespaceDef::addNamespaceAttributes(OutputList &ol) { // UNO IDL constant groups may be published if (getLanguage()==SrcLangExt_IDL && isConstantGroup() && m_isPublished) { ol.pushGeneratorState(); ol.disableAllBut(OutputGenerator::Html); ol.startLabels(); ol.writeLabel("published",false); ol.endLabels(); ol.popGeneratorState(); } }
::Ice::DispatchStatus com::renren::sixin::account::MiscService::___getLanguage(::IceInternal::Incoming& __inS, const ::Ice::Current& __current) { __checkMode(::Ice::Normal, __current.mode); ::IceInternal::BasicStream* __is = __inS.is(); __is->startReadEncaps(); ::Ice::Long userId; __is->read(userId); __is->endReadEncaps(); ::IceInternal::BasicStream* __os = __inS.os(); ::com::renren::sixin::account::StringResultPtr __ret = getLanguage(userId, __current); __os->write(::Ice::ObjectPtr(::IceInternal::upCast(__ret.get()))); __os->writePendingObjects(); return ::Ice::DispatchOK; }
const char* getLanguageName(void) { const char *language = getLanguage(); unsigned int i; for (i = 0; i < ARRAY_SIZE(map); i++) { if (strcmp(language, map[i].language) == 0) { return gettext(map[i].name); } } return language; }