<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">

  <Script file="RestrictedEnvironment.lua"/>
  <Script file="RestrictedFrames.lua"/>
  <Script file="RestrictedExecution.lua"/>
  <Script file="SecureHandlers.lua"/>
  

  <!-- Templates for the common handler actions, use Wrap to
       enable less common features -->

  <Frame name="SecureHandlerBaseTemplate" inherits="SecureFrameTemplate"
         virtual="true">
    <Size x="2" y="2"/>
    <Scripts>
      <OnLoad>
	SecureHandler_OnLoad(self);
      </OnLoad>
    </Scripts>
  </Frame>

  <Frame name="SecureHandlerStateTemplate" inherits="SecureFrameTemplate"
         virtual="true">
    <Size x="2" y="2"/>
    <Scripts>
      <OnLoad>
	SecureHandler_OnLoad(self);
      </OnLoad>
      <OnAttributeChanged>
        SecureHandler_StateOnAttributeChanged(self, name, value);
      </OnAttributeChanged>
    </Scripts>
  </Frame>

  <Frame name="SecureHandlerAttributeTemplate" inherits="SecureFrameTemplate"
         virtual="true">
    <Size x="2" y="2"/>
    <Scripts>
      <OnLoad>
	SecureHandler_OnLoad(self);
      </OnLoad>
      <OnAttributeChanged>
        SecureHandler_AttributeOnAttributeChanged(self, name, value);
      </OnAttributeChanged>
    </Scripts>
  </Frame>

  <Button name="SecureHandlerClickTemplate"
          inherits="SecureHandlerBaseTemplate"
          virtual="true">
    <Scripts>
      <OnClick>
        SecureHandler_OnClick(self, "_onclick", button, down);
      </OnClick>
    </Scripts>
  </Button>

  <Button name="SecureHandlerDoubleClickTemplate"
          inherits="SecureHandlerBaseTemplate"
          virtual="true">
    <Scripts>
      <OnDoubleClick>
        SecureHandler_OnClick(self, "_ondoubleclick", button, down);
      </OnDoubleClick>
    </Scripts>
  </Button>

  <Frame name="SecureHandlerShowHideTemplate"
         inherits="SecureHandlerBaseTemplate" virtual="true">
    <Scripts>
      <OnShow>
        SecureHandler_OnSimpleEvent(self, "_onshow");
      </OnShow>
      <OnHide>
        SecureHandler_OnSimpleEvent(self, "_onhide");
      </OnHide>
    </Scripts>
  </Frame>

  <Frame name="SecureHandlerDragTemplate"
         inherits="SecureHandlerBaseTemplate" virtual="true">
    <Scripts>
      <OnDragStart>
	SecureHandler_OnDragEvent("_ondragstart", self, button);
      </OnDragStart>
      <OnReceiveDrag>
	SecureHandler_OnDragEvent("_onreceivedrag", self);
      </OnReceiveDrag>
    </Scripts>
  </Frame>

  <Frame name="SecureHandlerEnterLeaveTemplate"
         inherits="SecureHandlerBaseTemplate" virtual="true">
    <Scripts>
      <OnEnter>
        if ( motion ) then
            self:SetAttribute("_entered", true);
            SecureHandler_OnSimpleEvent(self, "_onenter");
        end
      </OnEnter>
      <OnLeave>
        if ( motion and self:GetAttribute("_entered") ) then
            self:SetAttribute("_entered", nil);
            SecureHandler_OnSimpleEvent(self, "_onleave");
        end
      </OnLeave>
    </Scripts>
  </Frame>
</Ui>
