<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
..\FrameXML\UI.xsd">

    <Frame name="VisualHealBarTemplate" framestrata="HIGH" toplevel="true" virtual="true" parent="UIParent" movable="true" enableMouse="true" hidden="true">
        <Size><AbsDimension x="196" y="23"/></Size>     

        <!-- Border -->
        <Backdrop edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true">
            <EdgeSize>
                <AbsValue val="16"/>
            </EdgeSize>
            <TileSize>
                <AbsValue val="16"/>
            </TileSize>
            <BackgroundInsets>
                <AbsInset left="5" right="5" top="5" bottom="5"/>
            </BackgroundInsets>
        </Backdrop>

        <Frames>
            <StatusBar name="$parentRight" framestrata="MEDIUM">
                <Size>
                    <AbsDimension x="558" y="13"/>
                </Size>
                <Anchors>
                    <Anchor point="TOPLEFT">
                        <Offset>
                            <AbsDimension x="5" y="-5"/>
                        </Offset>
                    </Anchor>
                </Anchors>
                <Layers>
                    <Layer level="BACKGROUND">
                        <Texture name="$parentBackground">
                            <Size>
                                <AbsDimension x="186" y="13"/>
                            </Size>
                            <Anchors>
                                <Anchor point="TOPLEFT">
                                    <Offset>
                                        <AbsDimension x="0" y="0"/>
                                    </Offset>
                                </Anchor>
                            </Anchors>
                            <Color r="0" g="0" b="0" a="0.5"/>
                        </Texture>      
                    </Layer>
                </Layers>
                <Scripts>
                    <OnLoad>
                        this:SetMinMaxValues(0, 3);
                        this:SetValue(0.6);
                    </OnLoad>
                </Scripts>
                <BarTexture file="Interface\TargetingFrame\UI-StatusBar"/>
                <BarColor r="0.4" g="0.6" b="0.4"/>
            </StatusBar>
            <StatusBar name="$parentMiddle" framestrata="MEDIUM">
                <Size>
                    <AbsDimension x="372" y="13"/>
                </Size>
                <Anchors>
                    <Anchor point="TOPLEFT">
                        <Offset>
                            <AbsDimension x="5" y="-5"/>
                        </Offset>
                    </Anchor>
                </Anchors>
                <Scripts>
                    <OnLoad>
                        this:SetMinMaxValues(0, 2);
                        this:SetValue(0.4);
                        this:SetFrameLevel(this:GetFrameLevel() + 1)
                    </OnLoad>
                </Scripts>
                <BarTexture file="Interface\TargetingFrame\UI-StatusBar"/>
                <BarColor r="0.4" g="0.6" b="0.4"/>
            </StatusBar>
            <StatusBar name="$parentLeft" framestrata="MEDIUM">
                <Size>
                    <AbsDimension x="186" y="13"/>
                </Size>
                <Anchors>
                    <Anchor point="TOPLEFT">
                        <Offset>
                            <AbsDimension x="5" y="-5"/>
                        </Offset>
                    </Anchor>
                </Anchors>
                <Scripts>
                    <OnLoad>
                        this:SetMinMaxValues(0, 1);
                        this:SetValue(0.2);
                        this:SetFrameLevel(this:GetFrameLevel() + 2)
                    </OnLoad>
                </Scripts>
                <BarTexture file="Interface\TargetingFrame\UI-StatusBar"/>
                <BarColor r="0.4" g="0.6" b="0.4"/>
            </StatusBar>
        </Frames>
        <Layers>
            <Layer level="OVERLAY">
                <Texture name="$parentSparkOne" file="Interface\CastingBar\UI-CastingBar-Spark" alphaMode="ADD">
                    <Size>
                        <AbsDimension x="16" y="30"/>
                    </Size>
                    <Anchors>
                        <Anchor point="CENTER"/>
                    </Anchors>
                </Texture>
            </Layer>
            <Layer level="OVERLAY">
                <Texture name="$parentSparkTwo" file="Interface\CastingBar\UI-CastingBar-Spark" alphaMode="ADD">
                    <Size>
                        <AbsDimension x="16" y="30"/>
                    </Size>
                    <Anchors>
                        <Anchor point="CENTER"/>
                    </Anchors>
                </Texture>
            </Layer>
        </Layers>
        <Scripts>
            <OnMouseDown>
                if (not this.IsLive and arg1 == "LeftButton") then
                    this:StartMoving();
                    GameTooltip:Hide();
                end
            </OnMouseDown>
            <OnMouseUp>
                if (not this.IsLive) then
                    if (arg1 == "LeftButton") then
                        if (IsShiftKeyDown()) then
                            this:ClearAllPoints();
                            this:SetPoint("CENTER", CastingBarFrame, "CENTER", 0, this.DefaultOffset);
                        end
                        this:StopMovingOrSizing();
                        VisualHeal:FrameMoved(this);
                    elseif (arg1 == "RightButton") then
                        this:Hide();
                    end 
                else
                    if (arg1 == "RightButton") then
                        this.IsLive = false;
                        this:Hide();
                    end 
                end
            </OnMouseUp>
            <OnEnter>
                local L = LibStub("AceLocale-3.0"):GetLocale("VisualHeal");
                if (not this.IsLive) then
                    GameTooltip:SetOwner(this, "ANCHOR_TOPLEFT");
                    GameTooltip:SetText("|cFFFFFFFF" .. this.Description .. "\n" .. L["|cFFCCCCCCLeft-click to drag."] .. "\n" .. L["Shift-left-click to re-attach to Casting Bar."] .. "\n" .. L["Right-click to hide."]);
                    this.tooltipShown = true;
                end
            </OnEnter>
            <OnLeave>
                GameTooltip:Hide();
                this.tooltipShown = false;
            </OnLeave>
        </Scripts>
    </Frame>

    <Frame name="VisualHealBar" inherits="VisualHealBarTemplate">
        <Anchors>
            <Anchor point="CENTER" relativeTo="CastingBarFrame" relativePoint="CENTER">
                <Offset>
                    <AbsDimension x="0" y="30"/>
                </Offset>
            </Anchor>
        </Anchors>
        <Layers>
            <Layer level="OVERLAY">
                <FontString name="$parentText" inherits="GameFontHighlightSmall" text="">
                    <Size>
                        <AbsDimension x="196" y="16"/>
                    </Size>
                    <Anchors>
                        <Anchor point="CENTER" relativeTo="$parent" relativePoint="CENTER">
                            <Offset>
                                <AbsDimension x="0" y="1"/>
                            </Offset>
                        </Anchor>
                    </Anchors>
                </FontString>
            </Layer>
        </Layers>
        <Scripts>
            <OnLoad>
                local L = LibStub("AceLocale-3.0"):GetLocale("VisualHeal");
                this.Description = L["HealBar: Shows your healing to others"];
                this.DefaultOffset = 30;
            </OnLoad>
        </Scripts>
    </Frame>

    <Frame name="VisualHealPlayerBar" inherits="VisualHealBarTemplate">
        <Anchors>
            <Anchor point="CENTER" relativeTo="CastingBarFrame" relativePoint="CENTER">
                <Offset>
                    <AbsDimension x="0" y="-25"/>
                </Offset>
            </Anchor>
        </Anchors>
        <Layers>
            <Layer level="OVERLAY">
                <FontString name="$parentTextLeft" inherits="GameFontHighlightSmall" justifyH="LEFT">
                    <Size>
                        <AbsDimension x="196" y="16"/>
                    </Size>
                    <Anchors>
                        <Anchor point="LEFT" relativeTo="$parent" relativePoint="LEFT">
                            <Offset>
                                <AbsDimension x="8" y="1"/>
                            </Offset>
                        </Anchor>
                    </Anchors>
                </FontString>
            </Layer>
            <Layer level="OVERLAY">
                <FontString name="$parentTextRight" inherits="GameFontHighlightSmall" justifyH="RIGHT">
                    <Size>
                        <AbsDimension x="196" y="16"/>
                    </Size>
                    <Anchors>
                        <Anchor point="RIGHT" relativeTo="$parent" relativePoint="RIGHT">
                            <Offset>
                                <AbsDimension x="-8" y="1"/>
                            </Offset>
                        </Anchor>
                    </Anchors>
                </FontString>
            </Layer>
        </Layers>
        <Scripts>
            <OnLoad>
                local L = LibStub("AceLocale-3.0"):GetLocale("VisualHeal");
                this.Description = L["PlayerBar: Shows incoming heals to you"];
                this.DefaultOffset = -25;
            </OnLoad>
        </Scripts>
    </Frame>
</Ui>
