Esempio n. 1
0
void FormattingSetting<VerticalFormatting>::writeXMLTagToStream(XMLSerializer& xml_stream) const
{
    if (d_propertySource.empty())
        xml_stream.openTag("VertFormat");
    else
        xml_stream.openTag("VertFormatProperty");
}
Esempio n. 2
0
//----------------------------------------------------------------------------//
void ComponentArea::writeXMLToStream(XMLSerializer& xml_stream) const
{
    xml_stream.openTag("Area");

    // see if we should write an AreaProperty element
    if (isAreaFetchedFromProperty())
    {
        xml_stream.openTag("AreaProperty")
            .attribute("name", d_namedSource)
            .closeTag();
    }
    else if (isAreaFetchedFromNamedArea())
    {
        xml_stream.openTag("NamedAreaSource")
            .attribute("look", d_namedAreaSourceLook)
            .attribute("name", d_namedSource)
            .closeTag();
    }
    // not a property, write out individual dimensions explicitly.
    else
    {
        d_left.writeXMLToStream(xml_stream);
        d_top.writeXMLToStream(xml_stream);
        d_right_or_width.writeXMLToStream(xml_stream);
        d_bottom_or_height.writeXMLToStream(xml_stream);
    }
    xml_stream.closeTag();
}
Esempio n. 3
0
//----------------------------------------------------------------------------//
bool FalagardComponentBase::writeColoursXML(XMLSerializer& xml_stream) const
{

    if (!d_colourPropertyName.empty())
    {
        xml_stream.openTag("ColourRectProperty");
        xml_stream.attribute("name", d_colourPropertyName)
            .closeTag();
    }
    else if (!d_colours.isMonochromatic() ||
              d_colours.d_top_left != Colour(1,1,1,1))
    {
        xml_stream.openTag("Colours")
            .attribute("topLeft",
                PropertyHelper<Colour>::toString(d_colours.d_top_left))
            .attribute("topRight",
                PropertyHelper<Colour>::toString(d_colours.d_top_right))
            .attribute("bottomLeft",
                PropertyHelper<Colour>::toString(d_colours.d_bottom_left))
            .attribute("bottomRight",
                PropertyHelper<Colour>::toString(d_colours.d_bottom_right))
            .closeTag();
    }
    else
        return false;

    return true;
}
Esempio n. 4
0
void FormattingSetting<HorizontalTextFormatting>::writeXMLTagToStream(XMLSerializer& xml_stream) const
{
    if (d_propertySource.empty())
        xml_stream.openTag("HorzFormat");
    else
        xml_stream.openTag("HorzFormatProperty");
}
Esempio n. 5
0
//----------------------------------------------------------------------------//
void FrameComponent::writeXMLToStream(XMLSerializer& xml_stream) const
{
    // opening tag
    xml_stream.openTag("FrameComponent");
    // write out area
    d_area.writeXMLToStream(xml_stream);

    // write images
    for (int i = 0; i < FIC_FRAME_IMAGE_COUNT; ++i)
    {
        if (d_frameImages[i].d_specified)
        {
            if (d_frameImages[i].d_propertyName.empty())
                xml_stream.openTag("Image")
                    .attribute("name", d_frameImages[i].d_image->getName())
                    .attribute("component", FalagardXMLHelper<FrameImageComponent>::toString(static_cast<FrameImageComponent>(i)))
                    .closeTag();
            else
                xml_stream.openTag("ImageProperty")
                    .attribute("name", d_frameImages[i].d_propertyName)
                    .attribute("component", FalagardXMLHelper<FrameImageComponent>::toString(static_cast<FrameImageComponent>(i)))
                    .closeTag();
        }
    }

    // get base class to write colours
    writeColoursXML(xml_stream);

    d_backgroundVertFormatting.writeXMLTagToStream(xml_stream);
    d_backgroundVertFormatting.writeXMLAttributesToStream(xml_stream);
    xml_stream.attribute("component", "Background").closeTag();

    d_leftEdgeFormatting.writeXMLTagToStream(xml_stream);
    d_leftEdgeFormatting.writeXMLAttributesToStream(xml_stream);
    xml_stream.attribute("component", "LeftEdge").closeTag();

    d_rightEdgeFormatting.writeXMLTagToStream(xml_stream);
    d_rightEdgeFormatting.writeXMLAttributesToStream(xml_stream);
    xml_stream.attribute("component", "RightEdge").closeTag();

    d_backgroundHorzFormatting.writeXMLTagToStream(xml_stream);
    d_backgroundHorzFormatting.writeXMLAttributesToStream(xml_stream);
    xml_stream.attribute("component", "Background").closeTag();

    d_topEdgeFormatting.writeXMLTagToStream(xml_stream);
    d_topEdgeFormatting.writeXMLAttributesToStream(xml_stream);
    xml_stream.attribute("component", "TopEdge").closeTag();

    d_bottomEdgeFormatting.writeXMLTagToStream(xml_stream);
    d_bottomEdgeFormatting.writeXMLAttributesToStream(xml_stream);
    xml_stream.attribute("component", "BottomEdge").closeTag();

    // closing tag
    xml_stream.closeTag();
}
Esempio n. 6
0
    void WidgetComponent::writeXMLToStream(XMLSerializer& xml_stream) const
    {
        // output opening tag
        xml_stream.openTag(Falagard_xmlHandler::ChildElement)
            .attribute(Falagard_xmlHandler::NameSuffixAttribute, d_name)
            .attribute(Falagard_xmlHandler::TypeAttribute, d_targetType);

        if (!d_rendererType.empty())
            xml_stream.attribute(Falagard_xmlHandler::RendererAttribute, d_rendererType);

        if (!d_autoWindow)
            xml_stream.attribute(Falagard_xmlHandler::AutoWindowAttribute, PropertyHelper<bool>::False);

        // Output <EventAction> elements
        for (EventActionList::const_iterator i = d_eventActions.begin();
                i != d_eventActions.end();
                ++i)
        {
            (*i).writeXMLToStream(xml_stream);
        }

        // output target area
        d_area.writeXMLToStream(xml_stream);

        // output vertical alignment if not-default
        if(d_vertAlign != VerticalAlignmentDefault)
        {
            xml_stream.openTag(Falagard_xmlHandler::VertAlignmentElement);
            xml_stream.attribute(Falagard_xmlHandler::TypeAttribute, FalagardXMLHelper<VerticalAlignment>::toString(d_vertAlign));
            xml_stream.closeTag();
        }

        // output horizontal alignment if not-default
        if(d_horzAlign != HorizontalAlignmentDefault)
        {
            xml_stream.openTag(Falagard_xmlHandler::HorzAlignmentElement);
            xml_stream.attribute(Falagard_xmlHandler::TypeAttribute, FalagardXMLHelper<HorizontalAlignment>::toString(d_horzAlign));
            xml_stream.closeTag();
        }

        //output property initialisers
        for (PropertyInitialiserList::const_iterator prop = d_propertyInitialisers.begin(); prop != d_propertyInitialisers.end(); ++prop)
        {
            (*prop).writeXMLToStream(xml_stream);
        }

        // output closing tag
        xml_stream.closeTag();
    }
Esempio n. 7
0
//----------------------------------------------------------------------------//
void Font::writeXMLToStream(XMLSerializer& xml_stream) const
{
    // output starting <Font ... > element
    xml_stream.openTag("Font")
        .attribute(Font_xmlHandler::FontNameAttribute, d_name)
        .attribute(Font_xmlHandler::FontFilenameAttribute, d_filename);

    if (!d_resourceGroup.empty())
        xml_stream.attribute(Font_xmlHandler::FontResourceGroupAttribute,
                             d_resourceGroup);

    if (d_nativeResolution.d_width != DefaultNativeHorzRes)
        xml_stream.attribute(Font_xmlHandler::FontNativeHorzResAttribute,
            PropertyHelper<uint>::toString(static_cast<uint>(d_nativeResolution.d_width)));

    if (d_nativeResolution.d_height != DefaultNativeVertRes)
        xml_stream.attribute(Font_xmlHandler::FontNativeVertResAttribute,
            PropertyHelper<uint>::toString(static_cast<uint>(d_nativeResolution.d_height)));

    if (d_autoScaled != ASM_Disabled)
        xml_stream.attribute(Font_xmlHandler::FontAutoScaledAttribute,
            PropertyHelper<AutoScaledMode>::toString(d_autoScaled));

    writeXMLToStream_impl(xml_stream);

    // output closing </Font> element.
    xml_stream.closeTag();
}
Esempio n. 8
0
//----------------------------------------------------------------------------//
void EventAction::writeXMLToStream(XMLSerializer& xml_stream) const
{
    xml_stream.openTag("EventAction")
        .attribute("event", d_eventName)
        .attribute("action", FalagardXMLHelper<ChildEventAction>::toString(d_action))
        .closeTag();
}
Esempio n. 9
0
 void NamedArea::writeXMLToStream(XMLSerializer& xml_stream) const
 {
     xml_stream.openTag("NamedArea")
         .attribute("name", d_name);
     d_area.writeXMLToStream(xml_stream);
     xml_stream.closeTag();
 }
Esempio n. 10
0
 void PropertyInitialiser::writeXMLToStream(XMLSerializer& xml_stream) const
 {
     xml_stream.openTag("Property")
         .attribute("name", d_propertyName)
         .attribute("value", d_propertyValue)
         .closeTag();
 }
Esempio n. 11
0
void Imageset::writeXMLToStream(XMLSerializer& xml_stream) const
{
    // output Imageset tag
    xml_stream.openTag("Imageset")
        .attribute("Name", d_name)
        .attribute("Imagefile", d_textureFilename);

    if (d_nativeHorzRes != DefaultNativeHorzRes)
        xml_stream.attribute("NativeHorzRes", 
          PropertyHelper::uintToString(static_cast<uint>(d_nativeHorzRes)));
    if (d_nativeVertRes != DefaultNativeVertRes)
        xml_stream.attribute("NativeVertRes", 
          PropertyHelper::uintToString(static_cast<uint>(d_nativeVertRes)));

    if (d_autoScale)
        xml_stream.attribute("AutoScaled", "true");

    // output images
    ImageIterator image = getIterator();
    while (!image.isAtEnd())
    {
        image.getCurrentValue().writeXMLToStream(xml_stream);
        ++image;
    }

    // output closing tag
    xml_stream.closeTag();
}
 void PropertyInitialiser::writeXMLToStream(XMLSerializer& xml_stream) const
 {
     xml_stream.openTag(Falagard_xmlHandler::PropertyElement)
         .attribute(Falagard_xmlHandler::NameAttribute, d_propertyName)
         .attribute(Falagard_xmlHandler::ValueAttribute, d_propertyValue)
         .closeTag();
 }
    void FrameComponent::writeXMLToStream(XMLSerializer& xml_stream) const
    {
        // opening tag
        xml_stream.openTag("FrameComponent");
        // write out area
        d_area.writeXMLToStream(xml_stream);

        // write images
        for (int i = 0; i < FIC_FRAME_IMAGE_COUNT; ++i)
        {
            if (d_frameImages[i])
            {
                xml_stream.openTag("Image")
                    .attribute("imageset", d_frameImages[i]->getImagesetName())
                    .attribute("image", d_frameImages[i]->getName())
                    .attribute("type", FalagardXMLHelper::frameImageComponentToString(static_cast<FrameImageComponent>(i)))
                    .closeTag();
            }
        }

        // get base class to write colours
        writeColoursXML(xml_stream);

        // write vert format, allowing base class to do this for us if a propety is in use
        if (!writeVertFormatXML(xml_stream))
        {
            // was not a property, so write out explicit formatting in use
            xml_stream.openTag("VertFormat")
                .attribute("type", FalagardXMLHelper::vertFormatToString(d_vertFormatting))
                .closeTag();

        }

        // write horz format, allowing base class to do this for us if a propety is in use
        if (!writeHorzFormatXML(xml_stream))
        {
            // was not a property, so write out explicit formatting in use
            xml_stream.openTag("HorzFormat")
                .attribute("type", FalagardXMLHelper::horzFormatToString(d_horzFormatting))
                .closeTag();
        }

        // closing tag
        xml_stream.closeTag();
    }
Esempio n. 14
0
//----------------------------------------------------------------------------//
void Dimension::writeXMLToStream(XMLSerializer& xml_stream) const
{
    xml_stream.openTag("Dim")
        .attribute("type", FalagardXMLHelper<DimensionType>::toString(d_type));

    if (d_value)
        d_value->writeXMLToStream(xml_stream);
    xml_stream.closeTag();
}
Esempio n. 15
0
    void ImagerySection::writeXMLToStream(XMLSerializer& xml_stream) const
    {
        // output opening tag
        xml_stream.openTag("ImagerySection")
            .attribute("name", d_name);

        // output modulative colours for this section
        if (!d_colourPropertyName.empty())
        {
            xml_stream.openTag("ColourRectProperty");
            xml_stream.attribute("name", d_colourPropertyName)
                .closeTag();
        }
        else if (!d_masterColours.isMonochromatic() || d_masterColours.d_top_left != Colour(1,1,1,1))
        {
            xml_stream.openTag("Colours")
                .attribute("topLeft", PropertyHelper<Colour>::toString(d_masterColours.d_top_left))
                .attribute("topRight", PropertyHelper<Colour>::toString(d_masterColours.d_top_right))
                .attribute("bottomLeft", PropertyHelper<Colour>::toString(d_masterColours.d_bottom_left))
                .attribute("bottomRight", PropertyHelper<Colour>::toString(d_masterColours.d_bottom_right))
                .closeTag();
        }

        // output all frame components.
        for(FrameList::const_iterator frame = d_frames.begin(); frame != d_frames.end(); ++frame)
        {
            (*frame).writeXMLToStream(xml_stream);
        }

        // output all imagery components
        for(ImageryList::const_iterator image = d_images.begin(); image != d_images.end(); ++image)
        {
            (*image).writeXMLToStream(xml_stream);
        }

        // output all text components
        for(TextList::const_iterator text = d_texts.begin(); text != d_texts.end(); ++text)
        {
            (*text).writeXMLToStream(xml_stream);
        }

        // output closing tag
        xml_stream.closeTag();
    }
Esempio n. 16
0
    void TextComponent::writeXMLToStream(XMLSerializer& xml_stream) const
    {
        // opening tag
        xml_stream.openTag(Falagard_xmlHandler::TextComponentElement);
        // write out area
        d_area.writeXMLToStream(xml_stream);

        // write text element
        if (!d_font.empty() || !getText().empty())
        {
            xml_stream.openTag(Falagard_xmlHandler::TextElement);
            if (!d_font.empty())
                xml_stream.attribute(Falagard_xmlHandler::FontAttribute, d_font);
            if (!getText().empty())
                xml_stream.attribute(Falagard_xmlHandler::StringAttribute, getText());
            xml_stream.closeTag();
        }

        // write text property element
        if (!d_textPropertyName.empty())
        {
            xml_stream.openTag(Falagard_xmlHandler::TextPropertyElement)
                .attribute(Falagard_xmlHandler::NameAttribute, d_textPropertyName)
                .closeTag();
        }

        // write font property element
        if (!d_fontPropertyName.empty())
        {
            xml_stream.openTag(Falagard_xmlHandler::FontPropertyElement)
                .attribute(Falagard_xmlHandler::NameAttribute, d_fontPropertyName)
                .closeTag();
        }

        // get base class to write colours
        writeColoursXML(xml_stream);

        d_vertFormatting.writeXMLToStream(xml_stream);
        d_horzFormatting.writeXMLToStream(xml_stream);

        // closing tag
        xml_stream.closeTag();
    }
Esempio n. 17
0
    void ImageryComponent::writeXMLToStream(XMLSerializer& xml_stream) const
    {
        // opening tag
        xml_stream.openTag("ImageryComponent");
        // write out area
        d_area.writeXMLToStream(xml_stream);

        // write image
        if (isImageFetchedFromProperty())
            xml_stream.openTag("ImageProperty")
                .attribute("name", d_imagePropertyName)
                .closeTag();
        else
            xml_stream.openTag("Image")
                .attribute("imageset", d_image->getImagesetName())
                .attribute("image", d_image->getName())
                .closeTag();

        // get base class to write colours
        writeColoursXML(xml_stream);

        // write vert format, allowing base class to do this for us if a propety is in use
        if (!writeVertFormatXML(xml_stream))
        {
            // was not a property, so write out explicit formatting in use
            xml_stream.openTag("VertFormat")
                .attribute("type", FalagardXMLHelper::vertFormatToString(d_vertFormatting))
                .closeTag();
        }

        // write horz format, allowing base class to do this for us if a propety is in use
        if (!writeHorzFormatXML(xml_stream))
        {
            // was not a property, so write out explicit formatting in use
            xml_stream.openTag("HorzFormat")
                .attribute("type", FalagardXMLHelper::horzFormatToString(d_horzFormatting))
                .closeTag();
        }

        // closing tag
        xml_stream.closeTag();
    }
    void SectionSpecification::writeXMLToStream(XMLSerializer& xml_stream) const
    {
        xml_stream.openTag(Falagard_xmlHandler::SectionElement);

        if (!d_owner.empty())
            xml_stream.attribute(Falagard_xmlHandler::LookAttribute, d_owner);

        xml_stream.attribute(Falagard_xmlHandler::SectionNameAttribute, d_sectionName);

        // render controlling property name if needed
        if (!d_renderControlProperty.empty())
            xml_stream.attribute(Falagard_xmlHandler::ControlPropertyAttribute, d_renderControlProperty);
        if (!d_renderControlValue.empty())
            xml_stream.attribute(Falagard_xmlHandler::ControlValueAttribute, d_renderControlValue);
        if (!d_renderControlWidget.empty())
            xml_stream.attribute(Falagard_xmlHandler::ControlWidgetAttribute, d_renderControlWidget);

        if (d_usingColourOverride)
        {
            // output modulative colours for this section
            if (!d_colourPropertyName.empty())
            {
                xml_stream.openTag(Falagard_xmlHandler::ColourRectPropertyElement);
                xml_stream.attribute(Falagard_xmlHandler::NameAttribute, d_colourPropertyName)
                    .closeTag();
            }
            else if (!d_coloursOverride.isMonochromatic() || d_coloursOverride.d_top_left != Colour(1,1,1,1))
            {
                xml_stream.openTag(Falagard_xmlHandler::ColoursElement)
                    .attribute(Falagard_xmlHandler::TopLeftAttribute, PropertyHelper<Colour>::toString(d_coloursOverride.d_top_left))
                    .attribute(Falagard_xmlHandler::TopRightAttribute, PropertyHelper<Colour>::toString(d_coloursOverride.d_top_right))
                    .attribute(Falagard_xmlHandler::BottomLeftAttribute, PropertyHelper<Colour>::toString(d_coloursOverride.d_bottom_left))
                    .attribute(Falagard_xmlHandler::BottomRightAttribute, PropertyHelper<Colour>::toString(d_coloursOverride.d_bottom_right))
                    .closeTag();
            }

        }
        // close section element 
        xml_stream.closeTag();
    }
    void SectionSpecification::writeXMLToStream(XMLSerializer& xml_stream) const
    {
        xml_stream.openTag("Section");

        if (!d_owner.empty())
            xml_stream.attribute("look", d_owner);

        xml_stream.attribute("section", d_sectionName);

        // render controlling property name if needed
        if (!d_renderControlProperty.empty())
            xml_stream.attribute("controlProperty", d_renderControlProperty);

        if (d_usingColourOverride)
        {
            // output modulative colours for this section
            if (!d_colourPropertyName.empty())
            {
                if (d_colourProperyIsRect)
                    xml_stream.openTag("ColourRectProperty");
                else
                    xml_stream.openTag("ColourProperty");

                xml_stream.attribute("name", d_colourPropertyName)
                    .closeTag();
            }
            else if (!d_coloursOverride.isMonochromatic() || d_coloursOverride.d_top_left != colour(1,1,1,1))
            {
                xml_stream.openTag("Colours")
                    .attribute("topLeft", PropertyHelper::colourToString(d_coloursOverride.d_top_left))
                    .attribute("topRight", PropertyHelper::colourToString(d_coloursOverride.d_top_right))
                    .attribute("bottomLeft", PropertyHelper::colourToString(d_coloursOverride.d_bottom_left))
                    .attribute("bottomRight", PropertyHelper::colourToString(d_coloursOverride.d_bottom_right))
                    .closeTag();
            }

        }
        // close section element 
        xml_stream.closeTag();
    }
Esempio n. 20
0
    void WidgetLookFeel::writeXMLToStream(XMLSerializer& xml_stream) const
    {

        xml_stream.openTag("WidgetLook")
                .attribute("name", d_lookName);

        // These sub-scobes of the loops avoid the "'curr'-already-initialized" compile error on VC6++
        {
          // output property definitions
          for (PropertyDefinitionList::const_iterator curr = d_propertyDefinitions.begin(); curr != d_propertyDefinitions.end(); ++curr)
              (*curr).writeXMLToStream(xml_stream);
        }

        {
          // output property link definitions
          for (PropertyLinkDefinitionList::const_iterator curr = d_propertyLinkDefinitions.begin(); curr != d_propertyLinkDefinitions.end(); ++curr)
              (*curr).writeXMLToStream(xml_stream);
        }

        {
          // output property initialisers.
          for (PropertyList::const_iterator curr = d_properties.begin(); curr != d_properties.end(); ++curr)
              (*curr).writeXMLToStream(xml_stream);
        }

        {
          // output named areas
          for (NamedAreaList::const_iterator curr = d_namedAreas.begin(); curr != d_namedAreas.end(); ++curr)
              (*curr).second.writeXMLToStream(xml_stream);
        }

        {
          // output child widgets
          for (WidgetList::const_iterator curr = d_childWidgets.begin(); curr != d_childWidgets.end(); ++curr)
              (*curr).writeXMLToStream(xml_stream);
        }

        {
          // output imagery sections
          for (ImageryList::const_iterator curr = d_imagerySections.begin(); curr != d_imagerySections.end(); ++curr)
              (*curr).second.writeXMLToStream(xml_stream);
        }

        {
          // output states
          for (StateList::const_iterator curr = d_stateImagery.begin(); curr != d_stateImagery.end(); ++curr)
              (*curr).second.writeXMLToStream(xml_stream);
        }

        xml_stream.closeTag();
    }
Esempio n. 21
0
    void TextComponent::writeXMLToStream(XMLSerializer& xml_stream) const
    {
        // opening tag
        xml_stream.openTag("TextComponent");
        // write out area
        d_area.writeXMLToStream(xml_stream);

        // write text element
        if (!d_font.empty() && !d_text.empty())
        {
            xml_stream.openTag("Text");
            if (!d_font.empty())
                xml_stream.attribute("font", d_font);
            if (!d_text.empty())
                xml_stream.attribute("string", d_text);
            xml_stream.closeTag();
        }

        // write text property element
        if (!d_textPropertyName.empty())
        {
            xml_stream.openTag("TextProperty")
                .attribute("name", d_textPropertyName)
                .closeTag();
        }

        // write font property element
        if (!d_fontPropertyName.empty())
        {
            xml_stream.openTag("FontProperty")
                .attribute("name", d_fontPropertyName)
                .closeTag();
        }

        // get base class to write colours
        writeColoursXML(xml_stream);

        // write vert format, allowing base class to do this for us if a propety is in use
        if (!writeVertFormatXML(xml_stream))
        {
            // was not a property, so write out explicit formatting in use
            xml_stream.openTag("VertFormat")
                .attribute("type", FalagardXMLHelper::vertTextFormatToString(d_vertFormatting))
                .closeTag();
        }

        // write horz format, allowing base class to do this for us if a propety is in use
        if (!writeHorzFormatXML(xml_stream))
        {
            // was not a property, so write out explicit formatting in use
            xml_stream.openTag("HorzFormat")
                .attribute("type", FalagardXMLHelper::horzTextFormatToString(d_horzFormatting))
                .closeTag();
        }

        // closing tag
        xml_stream.closeTag();
    }
Esempio n. 22
0
    void StateImagery::writeXMLToStream(XMLSerializer& xml_stream) const
    {
        xml_stream.openTag("StateImagery")
            .attribute("name", d_stateName);

        if (d_clipToDisplay)
            xml_stream.attribute("clipped", "false");

        // output all layers defined for this state
        for(LayersList::const_iterator curr = d_layers.begin(); curr != d_layers.end(); ++curr)
            (*curr).writeXMLToStream(xml_stream);
        // write closing </StateImagery> tag
        xml_stream.closeTag();
    }
Esempio n. 23
0
    void StateImagery::writeXMLToStream(XMLSerializer& xml_stream) const
    {
        xml_stream.openTag(Falagard_xmlHandler::StateImageryElement)
            .attribute(Falagard_xmlHandler::NameAttribute, d_stateName);

        if (d_clipToDisplay)
            xml_stream.attribute(Falagard_xmlHandler::ClippedAttribute, PropertyHelper<bool>::Falsee);

        // output all layers defined for this state
        for(LayersList::const_iterator curr = d_layers.begin(); curr != d_layers.end(); ++curr)
            (*curr).writeXMLToStream(xml_stream);
        // write closing </StateImagery> tag
        xml_stream.closeTag();
    }
Esempio n. 24
0
    void LayerSpecification::writeXMLToStream(XMLSerializer& xml_stream) const
    {
        xml_stream.openTag("Layer");

        if (d_layerPriority != 0)
            xml_stream.attribute("priority", PropertyHelper<uint>::toString(d_layerPriority));

        // ouput all sections in this layer
        for(SectionList::const_iterator curr = d_sections.begin(); curr != d_sections.end(); ++curr)
        {
            (*curr).writeXMLToStream(xml_stream);
        }

        xml_stream.closeTag();
    }
    void WidgetComponent::writeXMLToStream(XMLSerializer& xml_stream) const
    {
        // output opening tag
        xml_stream.openTag("Child")
            .attribute("type", d_baseType)
            .attribute("nameSuffix", d_nameSuffix);

        if (!d_imageryName.empty())
            xml_stream.attribute("look", d_imageryName);

        if (!d_rendererType.empty())
            xml_stream.attribute("renderer", d_rendererType);


        // output target area
        d_area.writeXMLToStream(xml_stream);

        // output vertical alignment
        xml_stream.openTag("VertAlignment")
            .attribute("type", FalagardXMLHelper::vertAlignmentToString(d_vertAlign))
            .closeTag();

        // output horizontal alignment
        xml_stream.openTag("HorzAlignment")
            .attribute("type", FalagardXMLHelper::horzAlignmentToString(d_horzAlign))
            .closeTag();

        //output property initialisers
        for (PropertiesList::const_iterator prop = d_properties.begin(); prop != d_properties.end(); ++prop)
        {
            (*prop).writeXMLToStream(xml_stream);
        }

        // output closing tag
        xml_stream.closeTag();
    }
Esempio n. 26
0
//----------------------------------------------------------------------------//
void PixmapFont::writeXMLToStream_impl (XMLSerializer& xml_stream) const
{
    float advscale = 1.0f / d_origHorzScaling;
    for (CodepointMap::const_iterator i = d_cp_map.begin(); i != d_cp_map.end(); ++i)
    {
        xml_stream.openTag("Mapping")
            .attribute(Font_xmlHandler::MappingCodepointAttribute,
                       PropertyHelper<uint>::toString(i->first))
            .attribute(Font_xmlHandler::MappingHorzAdvanceAttribute,
                       PropertyHelper<float>::toString(i->second.getAdvance() * advscale))
            .attribute(Font_xmlHandler::MappingImageAttribute,
                       i->second.getImage()->getName());

        xml_stream.closeTag();
    }
}
Esempio n. 27
0
/*************************************************************************
    Output XML <Image ... > element for this image
*************************************************************************/
void Image::writeXMLToStream(XMLSerializer& xml_stream) const
{
    xml_stream.openTag("Image")
        .attribute("Name", d_name)
        .attribute("XPos", PropertyHelper::uintToString(static_cast<uint>(d_area.d_left)))
        .attribute("YPos", PropertyHelper::uintToString(static_cast<uint>(d_area.d_top)))
        .attribute("Width", PropertyHelper::uintToString(static_cast<uint>(d_area.getWidth())))
        .attribute("Height", PropertyHelper::uintToString(static_cast<uint>(d_area.getHeight())));

    if (d_offset.d_x != 0.0f)
        xml_stream.attribute("XOffset", PropertyHelper::intToString(static_cast<int>(d_offset.d_x)));

    if (d_offset.d_y != 0.0f)
        xml_stream.attribute("YOffset", PropertyHelper::intToString(static_cast<int>(d_offset.d_x)));

    xml_stream.closeTag();
}
Esempio n. 28
0
//----------------------------------------------------------------------------//
void Property::writeXMLToStream(const PropertyReceiver* receiver, XMLSerializer& xml_stream) const
{
	if (d_writeXML)
	{
		xml_stream.openTag(XMLElementName)
			.attribute(NameXMLAttributeName,  d_name);
		// Detect wether it is a long property or not
		// Long property are needed if
		const String& value = get(receiver);
		if (value.find((String::value_type)'\n') != String::npos)
		{
			xml_stream.text(value);
		}
		else
		{
			xml_stream.attribute(ValueXMLAttributeName, get(receiver));
		}
		xml_stream.closeTag();
	}
}
Esempio n. 29
0
/*************************************************************************
    Writes an xml representation of this Font to \a out_stream.
*************************************************************************/
void Font::writeXMLToStream(XMLSerializer& xml_stream) const
{
    // output starting <Font ... > element
    xml_stream.openTag("Font")
        .attribute(FontNameAttribute, d_name)
        .attribute(FontFilenameAttribute, d_fileName);

    if (!d_resourceGroup.empty ())
        xml_stream.attribute (FontResourceGroupAttribute, d_resourceGroup);

    if (d_nativeHorzRes != DefaultNativeHorzRes)
        xml_stream.attribute(FontNativeHorzResAttribute, PropertyHelper::uintToString(static_cast<uint>(d_nativeHorzRes)));

    if (d_nativeVertRes != DefaultNativeVertRes)
        xml_stream.attribute(FontNativeVertResAttribute, PropertyHelper::uintToString(static_cast<uint>(d_nativeVertRes)));

    if (d_autoScale)
        xml_stream.attribute(FontAutoScaledAttribute, "True");

    writeXMLToStream_impl (xml_stream);

    // output closing </Font> element.
    xml_stream.closeTag();
}
Esempio n. 30
0
//----------------------------------------------------------------------------//
void PropertyDim::writeXMLElementName_impl(XMLSerializer& xml_stream) const
{
    xml_stream.openTag("PropertyDim");
}