Exemplo n.º 1
0
bool exportToTarget(const OS_NAMESPACE_NAME::XMLDocument &document, XMLFormatTarget *target, const OS_NAMESPACE_NAME::String &encoding)
{
    try
    {
        AutoPtr<DOMDocument> doc = getImplementation()->createDocument();
        if(convertDocument(document, doc) == false)
            return false;

        AutoPtr<DOMLSSerializer> writer(createWriter());
        AutoPtr<DOMLSOutput> stream(createOutputStream(encoding));
        stream->setByteStream(target);

        writer->write(doc, stream);

        return true;
    }
    catch(const XMLException &e)
    {
        OS_LOG_ERROR(e.getMessage());
    }
    catch(const DOMException &e)
    {
        OS_LOG_ERROR(e.getMessage());
    }
    catch(...)
    {
        OS_LOG_ERROR(OS_ERR_UNKNOWN(xml));
    }

    return false;
}
Exemplo n.º 2
0
Error Device::getDevice(EGLAttrib *value)
{
    void *nativeDevice = nullptr;
    egl::Error error = getImplementation()->getDevice(&nativeDevice);
    *value = reinterpret_cast<EGLAttrib>(nativeDevice);
    return error;
}
Exemplo n.º 3
0
bool exportToString(const OS_NAMESPACE_NAME::XMLDocument &document, OS_NAMESPACE_NAME::String &str)
{
    try
    {
        AutoPtr<DOMDocument> doc = getImplementation()->createDocument();
        if(convertDocument(document, doc) == false)
            return false;

        AutoPtr<DOMLSSerializer> writer(createWriter());

        XMLCh *xmlString = writer->writeToString(doc->getDocumentElement());
        str = xmlString;
        XMLString::release(&xmlString);

        return true;
    }
    catch(const XMLException &e)
    {
        OS_LOG_ERROR(e.getMessage());
    }
    catch(const DOMException &e)
    {
        OS_LOG_ERROR(e.getMessage());
    }
    catch(...)
    {
        OS_LOG_ERROR(OS_ERR_UNKNOWN(xml));
    }

    return false;
}
Exemplo n.º 4
0
RigidBodyNode* MobilizedBody::CustomImpl::createRigidBodyNode(
    UIndex&        nextUSlot,
    USquaredIndex& nextUSqSlot,
    QIndex&        nextQSlot) const
{
    bool noX_MB = (getDefaultOutboardFrame().p() == 0 && getDefaultOutboardFrame().R() == Mat33(1));
    bool noR_PF = (getDefaultInboardFrame().R() == Mat33(1));
    switch (getImplementation().getImpl().getNU()) {
    case 1:
        INSTANTIATE_CUSTOM(1, getImplementation(), getDefaultRigidBodyMassProperties(),
            getDefaultInboardFrame(), getDefaultOutboardFrame(), isReversed(), nextUSlot, nextUSqSlot, nextQSlot)
    case 2:
        INSTANTIATE_CUSTOM(2, getImplementation(), getDefaultRigidBodyMassProperties(),
            getDefaultInboardFrame(), getDefaultOutboardFrame(), isReversed(), nextUSlot, nextUSqSlot, nextQSlot)
    case 3:
        INSTANTIATE_CUSTOM(3, getImplementation(), getDefaultRigidBodyMassProperties(),
            getDefaultInboardFrame(), getDefaultOutboardFrame(), isReversed(), nextUSlot, nextUSqSlot, nextQSlot)
    case 4:
        INSTANTIATE_CUSTOM(4, getImplementation(), getDefaultRigidBodyMassProperties(),
            getDefaultInboardFrame(), getDefaultOutboardFrame(), isReversed(), nextUSlot, nextUSqSlot, nextQSlot)
    case 5:
        INSTANTIATE_CUSTOM(5, getImplementation(), getDefaultRigidBodyMassProperties(),
            getDefaultInboardFrame(), getDefaultOutboardFrame(), isReversed(), nextUSlot, nextUSqSlot, nextQSlot)
    case 6:
        INSTANTIATE_CUSTOM(6, getImplementation(), getDefaultRigidBodyMassProperties(),
            getDefaultInboardFrame(), getDefaultOutboardFrame(), isReversed(), nextUSlot, nextUSqSlot, nextQSlot)
    default:
        assert(!"Illegal number of degrees of freedom for custom MobilizedBody");
        return 0;
    }
}
Exemplo n.º 5
0
DOMLSSerializer * createWriter()
{
    DOMLSSerializer *writer = getImplementation()->createLSSerializer();
    DOMConfiguration *config = writer->getDomConfig();

    if(config->canSetParameter(XMLUni::fgDOMWRTFormatPrettyPrint, true))
        config->setParameter(XMLUni::fgDOMWRTFormatPrettyPrint, true);

    return writer;
}
void HTMLElementImp::generateShadowContent(CSSStyleDeclarationImp* style)
{
    if (style->binding.getValue() != CSSBindingValueImp::Uri ||
        style->display.getValue() == CSSDisplayValueImp::None)
        return;
    if (getShadowTree())  // already attached?
        return;
    DocumentImp* document = getOwnerDocumentImp();
    assert(document);
    URL base(document->getDocumentURI());
    URL url(base, style->binding.getURL());
    if (!base.isSameExceptFragments(url)) {
        document = dynamic_cast<DocumentImp*>(document->loadBindingDocument(url).self());
        if (!document || document->getReadyState() != u"complete")
            return;
    }

    std::u16string hash = url.getHash();
    if (hash[0] == '#')
        hash.erase(0, 1);
    Element element = document->getElementById(hash);
    if (!element)
        return;
    auto binding = dynamic_cast<HTMLBindingElementImp*>(element.self());
    if (!binding)
        return;
    bindingImplementation = binding->getImplementation();
    if (!bindingImplementation)
        return;
    if (html::HTMLTemplateElement shadowTree = binding->cloneTemplate()) {
        setShadowTree(shadowTree);
        shadowTarget = new(std::nothrow) EventTargetImp;
        // TODO: if (not called from the background thread) {
#if 0
            DocumentWindowPtr window = document->activate();
            ECMAScriptContext* context = window->getContext();
            shadowImplementation = context->xblCreateImplementation(shadowTarget, bindingImplementation, this, shadowTree);
            shadowImplementation .xblEnteredDocument();
        }
#endif
    }
IntensityImage * ImageFactory::newIntensityImage() {
	return getImplementation()->newIntensityImage();
}
RGBImage * ImageFactory::newRGBImage() {
	return getImplementation()->newRGBImage();
}
IntensityImage * ImageFactory::newIntensityImage(const int width, const int height) {
	return getImplementation()->newIntensityImage(width, height);
}
Exemplo n.º 10
0
EGLint Device::getType()
{
    return getImplementation()->getType();
}
Exemplo n.º 11
0
DOMLSOutput * createOutputStream(const OS_NAMESPACE_NAME::String &encoding)
{
    DOMLSOutput *stream = getImplementation()->createLSOutput();
    stream->setEncoding(encoding.c_str());
    return stream;
}
Exemplo n.º 12
0
 /**
  * An operation is ready if it has an implementation and is
  * present in a TaskContext.
  * @return true if ready.
  */
 bool ready() const {
     return mowner && getImplementation();
 }
Exemplo n.º 13
0
ReverseAltFont::~ReverseAltFont() {
	CSPLOG(INFO, DATA) << "~ReverseAltFont " << this << ", imp=" << getImplementation();
}
Exemplo n.º 14
0
Error Device::getDevice(EGLAttrib *value)
{
    return getImplementation()->getDevice(value);
}