QString DesignerUtils::getSchemaFileFilter(bool any, bool addOldExt) { QStringList exts(WorkflowUtils::WD_FILE_EXTENSIONS); if(addOldExt) { exts << WorkflowUtils::WD_XML_FORMAT_EXTENSION; } return DialogUtils::prepareFileFilter(WorkflowUtils::tr("UGENE workflow documents"), exts, any); }
void nglContext::Dump(uint Level) const { nglContextInfo info; if (!GetContextInfo(info)) return; info.Dump(Level); nglString version((const char*)glGetString(GL_VERSION)); nglString renderer((const char*)glGetString(GL_RENDERER)); nglString vendor((const char*)glGetString(GL_VENDOR)); nglString exts((const char*)glGetString(GL_EXTENSIONS)); #if (!defined _UIKIT_) && (!defined _ANDROID_) nglString sl((const char*)glGetString(GL_SHADING_LANGUAGE_VERSION)); #endif NGL_LOG(_T("context"), Level, _T(" OpenGL Version: %s"), version.GetChars()); NGL_LOG(_T("context"), Level, _T(" Renderer : %s"), renderer.GetChars()); NGL_LOG(_T("context"), Level, _T(" Vendor : %s"), vendor.GetChars()); #if (!defined _UIKIT_) && (!defined _ANDROID_) NGL_LOG(_T("context"), Level, _T(" GLSL version : %s"), sl.GetChars()); #endif NGL_LOG(_T("context"), Level, _T(" Extensions :")); std::vector<nglString> tokens; exts.Tokenize(tokens); for (int32 i = 0; i < tokens.size(); i++) { NGL_LOG(_T("context"), Level, _T(" %3d %s"), i, tokens[i].GetChars()); } }
FileFinder::FileFinder( bool recursiveScan, const string_t& rootPath, const string_t& extensions /*= ""*/, const string_t& ignoredFiles /*= ""*/ ) : rootPath_(rootPath) , recursiveScan_(recursiveScan) , numDirs_(0) { /// have normalized string Poco::Path tmp(rootPath); rootPath_ = tmp.toString(); Poco::StringTokenizer tokenizer(extensions, ";", Poco::StringTokenizer::TOK_IGNORE_EMPTY | Poco::StringTokenizer::TOK_TRIM); std::set<string_t> exts(tokenizer.begin(), tokenizer.end()); Poco::StringTokenizer ignoreToks( ignoredFiles, ";", Poco::StringTokenizer::TOK_IGNORE_EMPTY | Poco::StringTokenizer::TOK_TRIM); for (auto it = ignoreToks.begin(); it != ignoreToks.end(); ++it) { /// the reason we are inserting paths through Poco::Path is /// that it will let us have paths similar path in each platform /// in windows with '\', in linux '/' ignore_.insert(Poco::Path(*it).toString()); } performScan(rootPath_, exts); }
/** * \brief Flattens the caps specification into the set of 'simple' * specifications. * A 'simple' specification is a specification with exactly one extension, * or with the version number as the extension. * * Example: A caps specification with node=http://psi-im.org, version=0.10, * and ext='achat vchat' would be expanded into the following list of specs: * node=http://psi-im.org, ver=0.10, ext=0.10 * node=http://psi-im.org, ver=0.10, ext=achat * node=http://psi-im.org, ver=0.10, ext=vchat */ CapsSpecs CapsSpec::flatten() const { CapsSpecs l; l.append(CapsSpec(node(),version(),version())); QStringList exts(extensions().split(" ",QString::SkipEmptyParts)); for (QStringList::ConstIterator i = exts.begin(); i != exts.end(); ++i) { l.append(CapsSpec(node(),version(),*i)); } return l; }
/// Called from constructor to fill file extensions void FacilityInfo::fillExtensions(const Poco::XML::Element *elem) { std::string extsStr = elem->getAttribute("FileExtensions"); if (extsStr.empty()) { g_log.error("No file extensions defined"); throw std::runtime_error("No file extensions defined"); } typedef Poco::StringTokenizer tokenizer; tokenizer exts(extsStr, ",", tokenizer::TOK_IGNORE_EMPTY | tokenizer::TOK_TRIM); for (tokenizer::Iterator it = exts.begin(); it != exts.end(); ++it) { addExtension(*it); } }
//--------------------------------------------------------------------- void FreeImageCodec::startup(void) { FreeImage_Initialise(false); LogManager::getSingleton().logMessage( LML_NORMAL, "FreeImage version: " + String(FreeImage_GetVersion())); LogManager::getSingleton().logMessage( LML_NORMAL, FreeImage_GetCopyrightMessage()); // Register codecs StringUtil::StrStreamType strExt; strExt << "Supported formats: "; bool first = true; for (int i = 0; i < FreeImage_GetFIFCount(); ++i) { // Skip DDS codec since FreeImage does not have the option // to keep DXT data compressed, we'll use our own codec if ((FREE_IMAGE_FORMAT)i == FIF_DDS) continue; String exts(FreeImage_GetFIFExtensionList((FREE_IMAGE_FORMAT)i)); if (!first) { strExt << ","; } first = false; strExt << exts; // Pull off individual formats (separated by comma by FI) StringVector extsVector = StringUtil::split(exts, ","); for (StringVector::iterator v = extsVector.begin(); v != extsVector.end(); ++v) { ImageCodec* codec = OGRE_NEW FreeImageCodec(*v, i); msCodecList.push_back(codec); Codec::registerCodec(codec); } } LogManager::getSingleton().logMessage( LML_NORMAL, strExt.str()); // Set error handler FreeImage_SetOutputMessage(FreeImageErrorHandler); }
bool DeviceContext::CheckCapability(std::string cap) { if (backend_ == BACKEND_OpenCL) { #ifdef USE_GREENTEA viennacl::ocl::context &ctx = viennacl::ocl::get_context(id_); size_t size; size_t max_size = 1024 * 1024; clGetDeviceInfo(ctx.devices()[0].id(), CL_DEVICE_EXTENSIONS, 0, NULL, &size); // Cap at 1 MB to capture faulty OpenCL implementations (nVidia) std::vector<char> exts(std::min(size, max_size)); clGetDeviceInfo(ctx.devices()[0].id(), CL_DEVICE_EXTENSIONS, size, &(exts[0]), NULL); std::string extsstr(&(exts[0])); return extsstr.find(cap) != std::string::npos; #endif } return true; }
void GLLibraryEGL::InitExtensionsFromDisplay(EGLDisplay eglDisplay) { std::vector<nsCString> driverExtensionList; const char* rawExts = (const char*)fQueryString(eglDisplay, LOCAL_EGL_EXTENSIONS); if (rawExts) { nsDependentCString exts(rawExts); SplitByChar(exts, ' ', &driverExtensionList); } else { NS_WARNING("Failed to load EGL extension list!"); } const bool shouldDumpExts = GLContext::ShouldDumpExts(); if (shouldDumpExts) { printf_stderr("%i EGL driver extensions: (*: recognized)\n", (uint32_t)driverExtensionList.size()); } MarkBitfieldByStrings(driverExtensionList, shouldDumpExts, sEGLExtensionNames, &mAvailableExtensions); }
FreeImageImageCodec::FreeImageImageCodec() : ImageCodec("FreeImageCodec - FreeImage based image codec") { FreeImage_Initialise(true); FreeImage_SetOutputMessage(&FreeImageErrorHandler); // Getting extensions for (int i = 0; i < FreeImage_GetFIFCount(); ++i) { String exts(FreeImage_GetFIFExtensionList((FREE_IMAGE_FORMAT)i)); // Replace commas with spaces for (size_t i = 0; i < exts.length(); ++i) if (exts[i] == ',') exts[i] = ' '; // Add space after existing extensions if (!d_supportedFormat.empty()) d_supportedFormat += ' '; d_supportedFormat += exts; } }
nuiGLPainter::nuiGLPainter(nglContext* pContext, const nuiRect& rRect) : nuiPainter(rRect, pContext) { mCanRectangleTexture = 0; mTextureTarget = GL_TEXTURE_2D; mTwoPassBlend = false; mDefaultFramebuffer = 0; mDefaultRenderbuffer = 0; mpContext = pContext; if (mpContext) { mpContext->BeginSession(); const char* ext0 = (const char*)glGetString(GL_EXTENSIONS); nglString exts(ext0); //NGL_OUT(_T("Extensions: %ls\n"), exts.GetChars()); mpContext->CheckExtension(_T("GL_VERSION_1_2")); nuiCheckForGLErrors(); mpContext->CheckExtension(_T("GL_VERSION_1_3")); nuiCheckForGLErrors(); mpContext->CheckExtension(_T("GL_VERSION_1_4")); nuiCheckForGLErrors(); mpContext->CheckExtension(_T("GL_VERSION_1_5")); nuiCheckForGLErrors(); mpContext->CheckExtension(_T("GL_ARB_vertex_buffer_object")); nuiCheckForGLErrors(); mpContext->CheckExtension(_T("GL_EXT_framebuffer_object")); nuiCheckForGLErrors(); mpContext->CheckExtension(_T("GL_ARB_framebuffer_object")); nuiCheckForGLErrors(); if (mpContext->CheckExtension(_T("GL_ARB_texture_non_power_of_two"))) { mCanRectangleTexture = 1; } else if (mpContext->CheckExtension(_T("GL_EXT_texture_rectangle")) || mpContext->CheckExtension(_T("GL_ARB_texture_rectangle")) || mpContext->CheckExtension(_T("GL_NV_texture_rectangle"))) { mCanRectangleTexture = 2; } //mCanRectangleTexture = 0; if (!mActiveContexts) { glAAInit(); nuiCheckForGLErrors(); } nuiCheckForGLErrors(); } #ifdef _OPENGL_ES_ // mDefaultFramebuffer = 0; // mDefaultRenderbuffer = 0; glGetIntegerv(GL_FRAMEBUFFER_BINDING_NUI, &mDefaultFramebuffer); glGetIntegerv(GL_RENDERBUFFER_BINDING_NUI, (GLint *) &mDefaultRenderbuffer); #endif mActiveContexts++; }