Ejemplo n.º 1
0
/*!
    Returns the first extension associated with the MIME type.
*/
QString QMimeType::extension() const
{
    QStringList exts = extensions();
    if (exts.count())
        return extensions().first();
    return QString();
}
QStringList UnrestrictedModel::extensionsAvialable()
{
    QDir extensions("/usr/share/meegotouch/applicationextensions");
    QStringList list = extensions.entryList(QStringList() << "statusindicatormenu-*.desktop", QDir::Files, QDir::Name | QDir::IgnoreCase);
    list.removeAll("statusindicatormenu-safemode.desktop");
    return list;
}
/*!
    Blits from the \a sourceRect rectangle in the \a source framebuffer
    object to the \a targetRect rectangle in the \a target framebuffer object.

    If \a source or \a target is 0, the default framebuffer will be used
    instead of a framebuffer object as source or target respectively.

    The \a buffers parameter should be a mask consisting of any combination of
    \c GL_COLOR_BUFFER_BIT, \c GL_DEPTH_BUFFER_BIT, and
    \c GL_STENCIL_BUFFER_BIT.  Any buffer type that is not present both
    in the source and target buffers is ignored.

    The \a sourceRect and \a targetRect rectangles may have different sizes;
    in this case \a buffers should not contain \c GL_DEPTH_BUFFER_BIT or
    \c GL_STENCIL_BUFFER_BIT. The \a filter parameter should be set to
    \c GL_LINEAR or \c GL_NEAREST, and specifies whether linear or nearest
    interpolation should be used when scaling is performed.

    If \a source equals \a target a copy is performed within the same buffer.
    Results are undefined if the source and target rectangles overlap and
    have different sizes. The sizes must also be the same if any of the
    framebuffer objects are multisample framebuffers.

    Note that the scissor test will restrict the blit area if enabled.

    This function will have no effect unless hasOpenGLFramebufferBlit() returns
    true.

    \sa hasOpenGLFramebufferBlit()
*/
void QOpenGLFramebufferObject::blitFramebuffer(QOpenGLFramebufferObject *target, const QRect &targetRect,
                                           QOpenGLFramebufferObject *source, const QRect &sourceRect,
                                           GLbitfield buffers,
                                           GLenum filter)
{
    QOpenGLContext *ctx = QOpenGLContext::currentContext();
    if (!ctx)
        return;

    QOpenGLExtensions extensions(ctx);
    if (!extensions.hasOpenGLExtension(QOpenGLExtensions::FramebufferBlit))
        return;

    const int sx0 = sourceRect.left();
    const int sx1 = sourceRect.left() + sourceRect.width();
    const int sy0 = sourceRect.top();
    const int sy1 = sourceRect.top() + sourceRect.height();

    const int tx0 = targetRect.left();
    const int tx1 = targetRect.left() + targetRect.width();
    const int ty0 = targetRect.top();
    const int ty1 = targetRect.top() + targetRect.height();

    extensions.glBindFramebuffer(GL_READ_FRAMEBUFFER, source ? source->handle() : 0);
    extensions.glBindFramebuffer(GL_DRAW_FRAMEBUFFER, target ? target->handle() : 0);

    extensions.glBlitFramebuffer(sx0, sy0, sx1, sy1,
                                 tx0, ty0, tx1, ty1,
                                 buffers, filter);

    extensions.glBindFramebuffer(GL_FRAMEBUFFER, ctx->d_func()->current_fbo);
}
Ejemplo n.º 4
0
IIntroDescriptor::Pointer IntroRegistry::GetIntroForProduct(
    const std::string& targetProductId) const
{
  const IExtensionPoint* point =
      Platform::GetExtensionPointService()->GetExtensionPoint(
          PlatformUI::PLUGIN_ID + "." + WorkbenchRegistryConstants::PL_INTRO);
  if (!point)
  {
    return IIntroDescriptor::Pointer();
  }

  std::vector<const IExtension*> extensions(point->GetExtensions());
  extensions = RegistryReader::OrderExtensions(extensions);

  std::string targetIntroId = GetIntroForProduct(targetProductId, extensions);
  if (targetIntroId.empty())
  {
    return IIntroDescriptor::Pointer();
  }

  IIntroDescriptor::Pointer descriptor;

  std::vector<IIntroDescriptor::Pointer> intros(GetIntros());
  for (std::size_t i = 0; i < intros.size(); i++)
  {
    if (intros[i]->GetId() == targetIntroId)
    {
      descriptor = intros[i];
      break;
    }
  }

  return descriptor;
}
Ejemplo n.º 5
0
void Client::addExtension(const QString& ext, const Features& features)
{
	if (!ext.isEmpty()) {
		d->extension_features[ext] = features;
		d->capsExt = extensions().join(" ");
	}
}
Ejemplo n.º 6
0
void Client::removeExtension(const QString& ext)
{
	if (d->extension_features.contains(ext)) {
		d->extension_features.remove(ext);
		d->capsExt = extensions().join(" ");
	}
}
Ejemplo n.º 7
0
/*
  Put into |e| the list of command names, in our mode and its descendants,
  that begin with |name|.

  Forwarded to the set-version, so that repetitions will be automatically
  weeded out.
*/
std::vector<const char*> CommandTree::extensions(const char* name) const
{
  std::set<const char*,StrCmp> es;
  extensions(es,name);

  return std::vector<const char*>(es.begin(),es.end());
}
Ejemplo n.º 8
0
 /** @brief Returns true if the device supports double precision */
 bool double_support() const
 { 
   char buffer[1024];
   bool ret = false;
   
   //get extensions and search for double precision
   clGetDeviceInfo(device_, CL_DEVICE_EXTENSIONS, sizeof(char)*1024, buffer, NULL);
   std::string extensions(buffer);
   if (extensions.find("cl_khr_fp64") != std::string::npos
       || extensions.find("cl_amd_fp64") != std::string::npos)
   {
     ret = true;
   }
   
   #if defined(VIENNACL_DEBUG_ALL) || defined(VIENNACL_DEBUG_DEVICE)
   std::cout << "ViennaCL: Device extensions: " << std::endl;
   std::cout << extensions << std::endl;
   if (ret)
     std::cout << "ViennaCL: Device " << name() << " supports double precision." << std::endl;
   else
     std::cout << "ViennaCL: No double precision for device " << name() << "." << std::endl;
   #endif
   
   return ret;
 }
Ejemplo n.º 9
0
void hrRender::checkExtensions()
{
    QString extensions(reinterpret_cast<const char *>(glGetString(GL_EXTENSIONS)));

    /*if (extensions.contains("GL_ARB_texture_rectangle"))
    {
        qWarning("GL_ARB_texture_rectangle");
        target = GL_TEXTURE_RECTANGLE_ARB;
    }
    else if (extensions.contains("GL_NV_texture_rectangle"))
    {
        qWarning("GL_NV_texture_rectangle");
        target = GL_TEXTURE_RECTANGLE_NV;
    }
    else if (extensions.contains("GL_EXT_texture_rectangle"))
    {
        qWarning("GL_EXT_texture_rectangle");
        target = GL_TEXTURE_RECTANGLE_EXT;
    }
    else*/
    {
        //qWarning("GL_TEXTURE_2D");
        target = GL_TEXTURE_2D;
    }
}
Ejemplo n.º 10
0
static int info_listmedia(core_options *options, const char *gamename)
{
	int count = 0, devcount;
	int drvindex;
	machine_config *config;
	const device_config_image_interface *dev = NULL;
	const char *src;
	const char *driver_name;
	const char *name;
	const char *shortname;
	char paren_shortname[16];

	printf(" SYSTEM      DEVICE NAME (brief)   IMAGE FILE EXTENSIONS SUPPORTED    \n");
	printf("----------  --------------------  ------------------------------------\n");

	/* iterate over drivers */
	for (drvindex = 0; drivers[drvindex] != NULL; drvindex++)
		if (mame_strwildcmp(gamename, drivers[drvindex]->name) == 0)
		{
			/* allocate the machine config */
			config = global_alloc(machine_config(drivers[drvindex]->machine_config));

			driver_name = drivers[drvindex]->name;

			devcount = 0;

			for (bool gotone = config->m_devicelist.first(dev); gotone; gotone = dev->next(dev))
			{
				src = downcast<const legacy_image_device_config_base *>(dev)->file_extensions();
				name = downcast<const legacy_image_device_config_base *>(dev)->instance_name();
				shortname = downcast<const legacy_image_device_config_base *>(dev)->brief_instance_name();

				sprintf(paren_shortname, "(%s)", shortname);

				printf("%-13s%-12s%-8s   ", driver_name, name, paren_shortname);
				driver_name = " ";

				astring extensions(src);
				char *ext = strtok((char*)extensions.cstr(),",");
				while (ext != NULL)
				{
					printf(".%-5s",ext);
					ext = strtok (NULL, ",");
					devcount++;
				}
				printf("\n");
			}
			if (!devcount)
				printf("%-13s(none)\n",driver_name);

			count++;
			global_free(config);
		}

	if (!count)
		printf("There are no Computers or Consoles named %s\n", gamename);

	return (count > 0) ? MAMERR_NONE : MAMERR_NO_SUCH_GAME;
}
Ejemplo n.º 11
0
std::string Watcher::getExtensionPath(const PlatformProcess& child) {
  for (const auto& extension : extensions()) {
    if (*extension.second == child) {
      return extension.first;
    }
  }
  return "";
}
Ejemplo n.º 12
0
std::vector<std::string> hmd_type::get_vulkan_device_extensions_required(
	VkPhysicalDevice physical_device) const {
	vr::IVRCompositor *compositor(vr::VRCompositor());
	std::string extensions(compositor->GetVulkanDeviceExtensionsRequired(physical_device,
		nullptr, 0), '\0');
	compositor->GetVulkanDeviceExtensionsRequired(physical_device, &extensions[0],
		uint32_t(extensions.size()));
	return string_split(trim_null_characters(std::move(extensions)), " ");
}
Ejemplo n.º 13
0
void XmppMessage::setHtml(const QString &html)
{
    QDomDocument doc;
    doc.setContent(html);
    QXmppElement element(doc.documentElement());
    QXmppElementList elementList = extensions();
    elementList << element;
    setExtensions(elementList);
}
Ejemplo n.º 14
0
				std::vector<VkExtensionProperties> instance::getExtensionSupport() {
					uint32_t extensionCount = 0;
					vkEnumerateInstanceExtensionProperties(nullptr, &extensionCount, nullptr);

					std::vector<VkExtensionProperties> extensions(extensionCount);
					vkEnumerateInstanceExtensionProperties(nullptr, &extensionCount, extensions.data());

					return extensions;
				}
Ejemplo n.º 15
0
bool wxSTEditorNotebook::LoadFile( const wxFileName &fileName_,
                                   const wxString &extensions_,
                                   const wxString& encoding_ref)
{
    wxString encoding(encoding_ref);
    wxFileName fileName(fileName_);
    wxString extensions(extensions_.Length() ? extensions_ : GetOptions().GetDefaultFileExtensions());

    if (fileName.GetFullPath().IsEmpty())
    {
        wxSTEditorFileDialog fileDialog( this, _("Open file into new notebook page"),
                                 GetOptions().GetDefaultFilePath(),
                                 extensions,
                                 wxFD_OPEN | wxFD_FILE_MUST_EXIST);

        fileDialog.m_encoding = encoding;
        if (fileDialog.ShowModal() == wxID_OK)
        {
            fileName = fileDialog.GetPath();
            encoding = fileDialog.m_encoding;
        }
        else
            return false;
    }

    bool ok = fileName.FileExists();
    if (ok)
    {
        // load the file from disk and only load it once
        GetOptions().SetDefaultFilePath(fileName.GetPath());

        int page = FindEditorPageByFileName(fileName);
        if (page != wxNOT_FOUND)
        {
            ok = GetEditor(page)->LoadFile(fileName, wxEmptyString, true, encoding);
            SetSelection(page);
        }
        else if ( (GetEditor() == NULL) || GetEditor()->IsModified() || GetEditor()->IsFileFromDisk()) // non-empty editor?
        {
            // new splitter+editor
            wxSTEditorSplitter *splitter = CreateSplitter(wxID_ANY);
            wxCHECK_MSG(splitter, false, wxT("Invalid splitter"));
            ok = splitter->GetEditor()->LoadFile(fileName, wxEmptyString, true, encoding);
            if (ok)
            {
                ok = InsertEditorSplitter(-1, splitter, true);
            }
        }
        else // empty editor
        {
            // reuse editor
            ok = GetEditor()->LoadFile(fileName, wxEmptyString, true, encoding);
        }
    }
    return ok;
}
	__time64_t CDirectoryManager::GetLastUpdate(const std::string& fileName, bool bVerifyAllFiles)const
	{
		StringVector extensions(m_extensions, "|");

		__time64_t lastUpdate = -1;
		for (size_t i = 0; i < extensions.size(); i++)
			lastUpdate = std::max(lastUpdate, CDirectoryManagerBase::GetLastUpdate(fileName, extensions[i], bVerifyAllFiles));

		return lastUpdate;
	}
Ejemplo n.º 17
0
/**
 * \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;
}
Ejemplo n.º 18
0
bool V8Proxy::registeredExtensionWithV8(v8::Extension* extension)
{
    const V8Extensions& registeredExtensions = extensions();
    for (size_t i = 0; i < registeredExtensions.size(); ++i) {
        if (registeredExtensions[i] == extension)
            return true;
    }

    return false;
}
	bool CDirectoryManager::GetLastUpdate(const std::string& fileName, __time64_t& lastUpdate, bool bVerifyAllFiles)const
	{
		StringVector extensions(m_extensions, "|");

		bool bRep = false;
		for (size_t i = 0; i < extensions.size(); i++)
			bRep = bRep || CDirectoryManagerBase::GetLastUpdate(fileName, extensions[i], lastUpdate, bVerifyAllFiles);

		return bRep;
	}
Ejemplo n.º 20
0
/*
* DER encode a CRL_Entry
*/
void CRL_Entry::encode_into(DER_Encoder& der) const
   {
   der.start_cons(SEQUENCE)
      .encode(BigInt::decode(serial_number()))
      .encode(expire_time())
      .start_cons(SEQUENCE)
         .encode(extensions())
      .end_cons()
   .end_cons();
   }
Ejemplo n.º 21
0
bool_t query(const string_t& Extension)
{
	if(disabled().count(Extension))
		return false;

	if(enabled().count(Extension))
		return true;

	return extensions().count(Extension) ? true : false;
}
Ejemplo n.º 22
0
bool BaseEditor::isValidAssetPath(const char* assetPath) const
{
	const std::string path = assetPath;
	if (!path.empty())
	{
		std::string ext = FilePath::getExtension(path);
		const auto allEextensions = extensions();
		return std::find(allEextensions.begin(), allEextensions.end(), ext) != allEextensions.end();
	}
	return false;
}
Ejemplo n.º 23
0
bool EffectManager::isSupported(const string &str)
{
    tokenizer<> extensions(str);

	for(tokenizer<>::const_iterator iter = extensions.begin(); iter != extensions.end(); ++iter)
	{
		if(glewIsSupported((*iter).c_str())==GL_FALSE)
            return false;
	}

	return true;
}
Ejemplo n.º 24
0
  bool ExtensionsContain(const char* name, const char* c_extensions) {
    assert(name);
    if (!c_extensions)
      return false;
    std::string extensions(c_extensions);
    extensions += " ";

    std::string delimited_name(name);
    delimited_name += " ";

    return extensions.find(delimited_name) != std::string::npos;
  }
Ejemplo n.º 25
0
std::vector<const char*> Instance::getRequiredExtensions() {
	uint32_t glfwExtensionCount = 0;
	const char** glfwExtensions;
	glfwExtensions = glfwGetRequiredInstanceExtensions(&glfwExtensionCount);

	std::vector<const char*> extensions(glfwExtensions, glfwExtensions + glfwExtensionCount);

	if (enableValidationLayers) {
		extensions.push_back(VK_EXT_DEBUG_REPORT_EXTENSION_NAME);
	}

	return extensions;
}
Ejemplo n.º 26
0
      Device()
      {
        cl_int err;
        char buffer[1024];

        err = clGetPlatformIDs(1, &platform, NULL);
        CL_ERR_CHECK(err);
        
        // Try to find a suitable GPU
        err = clGetDeviceIDs(platform, CL_DEVICE_TYPE_GPU, 1, &device, NULL);
        if (err == CL_DEVICE_NOT_FOUND)
        {
          //No suitable GPU found. Try to find a suitable CPU (available via ATI Stream SDK)
          err = clGetDeviceIDs(platform, CL_DEVICE_TYPE_CPU, 1, &device, NULL);
          _type = CL_DEVICE_TYPE_CPU;
        }
        else
        {
          _type = CL_DEVICE_TYPE_GPU;
        }
        CL_ERR_CHECK(err);
        
        //create OpenCL context for device
        _context = clCreateContext(0, 1, &device, NULL, NULL, &err);
        CL_ERR_CHECK(err);
        default_command_queue = clCreateCommandQueue(_context.get(), device, 0, &err);
        CL_ERR_CHECK(err);

        //get extensions and search for double precision
        clGetDeviceInfo(device, CL_DEVICE_EXTENSIONS, sizeof(char)*1024, buffer, NULL);
        std::string extensions(buffer);
        supported_double = false;
        if (extensions.find("cl_khr_fp64") != std::string::npos
        #ifdef VIENNACL_EXPERIMENTAL_DOUBLE_PRECISION_WITH_STREAM_SDK_ON_CPU
          || extensions.find("cl_amd_fp64") != std::string::npos
        #endif
        #ifdef VIENNACL_EXPERIMENTAL_DOUBLE_PRECISION_WITH_STREAM_SDK_ON_GPU
          || extensions.find("cl_amd_fp64") != std::string::npos
        #endif
          )
        {
          //std::cout << "Double precision supported" << std::endl;
          supported_double = true;
        }
        
        //query a little bit of info:
        err = clGetDeviceInfo(device, CL_DEVICE_MAX_WORK_GROUP_SIZE, sizeof(size_t), &_max_work_group_size, NULL);
        CL_ERR_CHECK(err);
        err = clGetDeviceInfo(device, CL_DEVICE_MAX_COMPUTE_UNITS, sizeof(cl_uint), &_compute_units, NULL);
        CL_ERR_CHECK(err);
      }
Ejemplo n.º 27
0
 std::string double_support_extension() const
 {
   char buffer[1024];
   clGetDeviceInfo(device_, CL_DEVICE_EXTENSIONS, sizeof(char)*1024, buffer, NULL);
   std::string extensions(buffer);
   
   if (extensions.find("cl_amd_fp64") != std::string::npos) //AMD extension
     return "cl_amd_fp64";
   
   if (extensions.find("cl_khr_fp64") != std::string::npos) //Khronos-certified standard extension for double precision
     return "cl_khr_fp64";
   
   return "";
 }
Ejemplo n.º 28
0
void info_xml_creator::output_images(device_t &device, const char *root_tag)
{
	image_interface_iterator iter(device);
	for (const device_image_interface *imagedev = iter.first(); imagedev != NULL; imagedev = iter.next())
	{
		if (strcmp(imagedev->device().tag(), device.tag()))
		{
			astring newtag(imagedev->device().tag()), oldtag(":");
			newtag.substr(newtag.find(oldtag.cat(root_tag)) + oldtag.len());

			// print m_output device type
			fprintf(m_output, "\t\t<device type=\"%s\"", xml_normalize_string(imagedev->image_type_name()));

			// does this device have a tag?
			if (imagedev->device().tag())
				fprintf(m_output, " tag=\"%s\"", xml_normalize_string(newtag));

			// is this device mandatory?
			if (imagedev->must_be_loaded())
				fprintf(m_output, " mandatory=\"1\"");

			if (imagedev->image_interface() && imagedev->image_interface()[0])
				fprintf(m_output, " interface=\"%s\"", xml_normalize_string(imagedev->image_interface()));

			// close the XML tag
			fprintf(m_output, ">\n");

			const char *name = imagedev->instance_name();
			const char *shortname = imagedev->brief_instance_name();

			fprintf(m_output, "\t\t\t<instance");
			fprintf(m_output, " name=\"%s\"", xml_normalize_string(name));
			fprintf(m_output, " briefname=\"%s\"", xml_normalize_string(shortname));
			fprintf(m_output, "/>\n");

			astring extensions(imagedev->file_extensions());

			char *ext = strtok((char *)extensions.cstr(), ",");
			while (ext != NULL)
			{
				fprintf(m_output, "\t\t\t<extension");
				fprintf(m_output, " name=\"%s\"", xml_normalize_string(ext));
				fprintf(m_output, "/>\n");
				ext = strtok(NULL, ",");
			}

			fprintf(m_output, "\t\t</device>\n");
		}
	}
}
Ejemplo n.º 29
0
void ActivitySeriesBuilderTest::setUp()
{
    // Set up context before running a test.
    ::boost::filesystem::path plugin = "share/tu_exec_fwActivities-0.0/tu_builder";
    m_bundle                         = ::fwRuntime::io::BundleDescriptorReader::createBundle(plugin);

    m_activities = ::fwActivities::registry::Activities::New();

    ::fwRuntime::Bundle::ExtensionContainer extensionsSet( m_bundle->extensionsBegin(), m_bundle->extensionsEnd());
    std::vector< SPTR( ::fwRuntime::Extension ) > extensions(extensionsSet.begin(), extensionsSet.end());
    m_activities->parseBundleInformation(extensions);

    CPPUNIT_ASSERT_EQUAL( size_t(1), extensions.size());
}
Ejemplo n.º 30
0
bool IsGLExtensionSupported(const String &extension)
{
    String::size_type spacePosition = extension.find(" ");
    if(String::npos != spacePosition || extension.empty())
    {
        /* Extension names should not have spaces. */
        Logger::Info("[IsGLExtensionSupported] extension %s isn't supported", extension.c_str());
        return false;
    }
    
    String extensions((const char8 *)glGetString(GL_EXTENSIONS));
    String::size_type extPosition = extensions.find(extension);
    return (String::npos != extPosition);
}