void SVGAnimationElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
    if (!isSupportedAttribute(name)) {
        SVGSMILElement::parseAttribute(name, value);
        return;
    }

    if (name == SVGNames::valuesAttr) {
        // Per the SMIL specification, leading and trailing white space,
        // and white space before and after semicolon separators, is allowed and will be ignored.
        // http://www.w3.org/TR/SVG11/animate.html#ValuesAttribute
        value.string().split(';', m_values);
        for (unsigned i = 0; i < m_values.size(); ++i)
            m_values[i] = m_values[i].stripWhiteSpace();

        updateAnimationMode();
        return;
    }

    if (name == SVGNames::keyTimesAttr) {
        parseKeyTimes(value, m_keyTimes, true);
        return;
    }

    if (name == SVGNames::keyPointsAttr) {
        if (hasTagName(SVGNames::animateMotionTag)) {
            // This is specified to be an animateMotion attribute only but it is simpler to put it here 
            // where the other timing calculatations are.
            parseKeyTimes(value, m_keyPoints, false);
        }
        return;
    }

    if (name == SVGNames::keySplinesAttr) {
        parseKeySplines(value, m_keySplines);
        return;
    }

    if (name == SVGNames::attributeTypeAttr) {
        setAttributeType(value);
        return;
    }

    if (name == SVGNames::calcModeAttr) {
        setCalcMode(value);
        return;
    }

    if (name == SVGNames::fromAttr || name == SVGNames::toAttr || name == SVGNames::byAttr) {
        updateAnimationMode();
        return;
    }

    if (SVGTests::parseAttribute(name, value))
        return;
    if (SVGExternalResourcesRequired::parseAttribute(name, value))
        return;

    ASSERT_NOT_REACHED();
}
void SVGAnimationElement::parseAttribute(const QualifiedName& name, const AtomicString& oldValue, const AtomicString& value)
{
    if (name == SVGNames::valuesAttr) {
        if (!parseValues(value, m_values)) {
            reportAttributeParsingError(ParsingAttributeFailedError, name, value);
            return;
        }
        updateAnimationMode();
        return;
    }

    if (name == SVGNames::keyTimesAttr) {
        if (!parseKeyTimes(value, m_keyTimes, true))
            reportAttributeParsingError(ParsingAttributeFailedError, name, value);
        return;
    }

    if (name == SVGNames::keyPointsAttr) {
        if (isSVGAnimateMotionElement(*this)) {
            // This is specified to be an animateMotion attribute only but it is simpler to put it here
            // where the other timing calculatations are.
            if (!parseKeyTimes(value, m_keyPoints, false))
                reportAttributeParsingError(ParsingAttributeFailedError, name, value);
        }
        return;
    }

    if (name == SVGNames::keySplinesAttr) {
        if (!parseKeySplines(value, m_keySplines))
            reportAttributeParsingError(ParsingAttributeFailedError, name, value);
        return;
    }

    if (name == SVGNames::attributeTypeAttr) {
        setAttributeType(value);
        return;
    }

    if (name == SVGNames::calcModeAttr) {
        setCalcMode(value);
        return;
    }

    if (name == SVGNames::fromAttr || name == SVGNames::toAttr || name == SVGNames::byAttr) {
        updateAnimationMode();
        return;
    }

    SVGSMILElement::parseAttribute(name, oldValue, value);
}
Exemplo n.º 3
0
Arquivo: http.c Projeto: ic-hep/emi3
/************************************************
Function:    extractRequestSubjectToAOS
Parameters:  const xacml_request_t           request
Description:
             This function extracts the Subject information details
             from the request and puts that into the EEF AOS.
Return:
          0 : good
         !0 : bad 
************************************************/
int extractRequestSubjectToAOS (const xacml_request_t request)
{
  /*char * logstr = "extractRequestSubjectToAOS()";*/
    size_t count = 0;
    size_t i     = 0;

    const char *category;
    const char *attribute_id;
    const char *data_type;
    const char *issuer;
    const char *value;
        
    aos_context_t*   aos_context = NULL;
    aos_attribute_t* aos_attribute = NULL;

    xacml_request_get_subject_attribute_count(request, &count);

    if (count > 0)
    {
      rewindContexts();
      if((aos_context = getNextContext(SUBJECT, NULL)) == NULL){
        if((aos_context = createContext (SUBJECT)) == NULL){
          return 1;
        }
      }
      /* aos_context should be set now */
    }

    for (i = 0; i < count; i++)
    {

        category     = NULL;
        attribute_id = NULL;
        data_type    = NULL;
        issuer       = NULL;
        value        = NULL;

        xacml_request_get_subject_attribute(
                request, i, &category, &attribute_id, &data_type, &issuer, &value);

        /* EEF AOS magic */
        /*fprintf (stderr, "aos_set_string (\"%s\", \"%s\")\n", attribute_id, (const char *) value);*/
        /* if (strcmp ("http://authz-interop.org/xacml/subject/voms-fqan", attribute_id) == 0) */
        /* { */
            /* fprintf (stderr, "Skipping voms-fqan\n"); */
            /* continue; */
        /* } */

        /* aos_set_string (attribute_id, (char *) value); */

        if (aos_context){
          if((aos_attribute = createAttribute())){
            setAttributeId    (aos_attribute, attribute_id);
            setAttributeIssuer(aos_attribute, issuer);
            setAttributeType  (aos_attribute, data_type);
            setAttributeValue (aos_attribute, value, strlen(value) + 1);
            addAttribute(aos_context, aos_attribute);
          }
        }
    }

    if(aos_context){
      addContext (aos_context);
    }

    return 0;
}
Exemplo n.º 4
0
Arquivo: http.c Projeto: ic-hep/emi3
/************************************************
Function:    extractRequestActionToAOS
Parameters:  const xacml_request_t           request
Description:
             This function extracts the Action information details
             from the request and puts that into the EEF AOS.
Return:
          0 : good
         !0 : bad 
************************************************/
int extractRequestActionToAOS (const xacml_request_t request)
{
    int                           rc;
    size_t                        i;
    size_t                        count;
    const char *                  attribute_id;
    const char *                  data_type;
    const char *                  issuer;
    const char *                  value;
    /*char *                        logstr = "extractRequestActionToAOS";*/

    aos_context_t*   aos_context = NULL;
    aos_attribute_t* aos_attribute = NULL;

    rc = xacml_request_get_action_attribute_count(request, &count);


    if (count > 0)
    {
      rewindContexts();
      if((aos_context = getNextContext(ACTION, NULL)) == NULL){
        if((aos_context = createContext (ACTION)) == NULL){
          return 1;
        }
      }
      /* aos_context should be set now */
    }

    for (i = 0 ; i < count; i++)
    {
        attribute_id = NULL;
        data_type    = NULL;
        issuer       = NULL;
        value        = NULL;
        rc = xacml_request_get_action_attribute(
                request,
                i,
                &attribute_id,
                &data_type,
                &issuer,
                &value);
        /* EEF AOS magic */
        /*fprintf (stderr, "aos_set_string (\"%s\", \"%s\")\n", attribute_id, (char *) value);*/

        /* aos_set_string (attribute_id, (char *) value); */

        if (aos_context){
          if((aos_attribute = createAttribute())){
            setAttributeId    (aos_attribute, attribute_id);
            setAttributeIssuer(aos_attribute, issuer);
            setAttributeType  (aos_attribute, data_type);
            setAttributeValue (aos_attribute, value, strlen(value) + 1);
            addAttribute(aos_context, aos_attribute);
          }
        }
    }

    if(aos_context){
      addContext (aos_context);
    }

    return 0;
}
Exemplo n.º 5
0
Arquivo: http.c Projeto: ic-hep/emi3
/************************************************
Function:    extractRequestResourceToAOS
Parameters:  const xacml_request_t           request
Description:
             This function extracts the Action information details
             from the request and puts that into the EEF AOS
Return:
          0 : good
         !0 : bad 
************************************************/
int extractRequestResourceToAOS (const xacml_request_t           request)
{
    int                                 rc;
    size_t                              i;
    size_t                              j;
    size_t                              count;
    const char *                        attribute_id;
    const char *                        data_type;
    const char *                        issuer;
    const char *                        value;
    xacml_resource_attribute_t          resource_attribute  = NULL;
    size_t                              resource_attr_count = 0;
    /*const char *                        logstr = "extractRequestResourceToAOS";*/

    aos_context_t*   aos_context = NULL;
    aos_attribute_t* aos_attribute = NULL;


    rc = xacml_request_get_resource_attribute_count(request, &resource_attr_count);

    for (i = 0 ; i < resource_attr_count; i++)
    {
        rc = xacml_request_get_resource_attribute(
                request,
                i,
                &resource_attribute);

        if (resource_attribute)
        {
            rc = xacml_resource_attribute_get_count(
                       resource_attribute,
                       &count);

            if((aos_context = createContext (RESOURCE)) == NULL){
              return 1;
            }
            /* aos_context should be set now */

            for (j = 0; j < count; j++)
            {
                attribute_id = NULL;
                data_type    = NULL;
                issuer       = NULL;
                value        = NULL;
                rc = xacml_resource_attribute_get_attribute(
                           resource_attribute,
                           j,
                           &attribute_id,
                           &data_type,
                           &issuer,
                           &value);
                /* EEF AOS magic */
                /*fprintf (stderr, "aos_set_string (\"%s\", \"%s\")\n", attribute_id, (char *) value);*/

                /* aos_set_string (attribute_id, (char *) value); */

                if (aos_context){
                  if((aos_attribute = createAttribute())){
                    setAttributeId    (aos_attribute, attribute_id);
                    setAttributeIssuer(aos_attribute, issuer);
                    setAttributeType  (aos_attribute, data_type);
                    setAttributeValue (aos_attribute, value, strlen(value) + 1);
                    addAttribute(aos_context, aos_attribute);
                    aos_attribute = NULL;
                  }
                }
            }
            if(aos_context){
              addContext (aos_context);
              aos_context = NULL;
            }
        }
    }

    return 0;
}