Skip to content

Commit

Permalink
mouse and touch events
Browse files Browse the repository at this point in the history
  • Loading branch information
blooddy committed Oct 2, 2011
1 parent c90c357 commit 42222cc
Show file tree
Hide file tree
Showing 8 changed files with 780 additions and 23 deletions.
5 changes: 5 additions & 0 deletions .flexLibProperties
Expand Up @@ -17,6 +17,11 @@
<classEntry path="by.blooddy.secret.display.INativeEvent"/>
<classEntry path="by.blooddy.secret.display.EventFactory"/>
<classEntry path="by.blooddy.secret.display.$Event"/>
<classEntry path="by.blooddy.secret.display.$MouseEvent"/>
<classEntry path="by.blooddy.secret.display.$TouchEvent"/>
<classEntry path="by.blooddy.secret.display.$TransformGestureEvent"/>
<classEntry path="by.blooddy.secret.display.$PressAndTapGestureEvent"/>
<classEntry path="by.blooddy.secret.display.$GestureEvent"/>
</includeClasses>
<includeResources/>
<namespaceManifests/>
Expand Down
20 changes: 13 additions & 7 deletions src/by/blooddy/secret/display/$Event.as
Expand Up @@ -24,6 +24,19 @@ package by.blooddy.secret.display {
*/
internal final class $Event extends Event implements INativeEvent {

//--------------------------------------------------------------------------
//
// Internal class methods
//
//--------------------------------------------------------------------------

/**
* @private
*/
$internal static function get(event:Event):$Event {
return new $Event( event.type, event.bubbles, event.cancelable );
}

//--------------------------------------------------------------------------
//
// Constructor
Expand Down Expand Up @@ -135,13 +148,6 @@ package by.blooddy.secret.display {
return new $Event( super.type, super.bubbles, super.cancelable );
}

/**
* @private
*/
public override function toString():String {
return super.formatToString( 'Event', 'type', 'bubbles', 'cancelable' );
}

}

}
149 changes: 149 additions & 0 deletions src/by/blooddy/secret/display/$GestureEvent.as
@@ -0,0 +1,149 @@
////////////////////////////////////////////////////////////////////////////////
//
// (C) 2011 BlooDHounD
//
////////////////////////////////////////////////////////////////////////////////

package by.blooddy.secret.display {

import flash.events.Event;
import flash.events.GestureEvent;

use namespace $internal;

/**
* @author BlooDHounD
* @version 1.0
* @playerversion Flash 10
* @langversion 3.0
* @created 02.10.2011 23:59:55
*/
internal final class $GestureEvent extends GestureEvent implements INativeEvent {

//--------------------------------------------------------------------------
//
// Internal class methods
//
//--------------------------------------------------------------------------

/**
* @private
*/
$internal static function get(event:GestureEvent):$GestureEvent {
return new $GestureEvent( event.type, event.bubbles, event.cancelable, event.phase, event.localX, event.localY, event.ctrlKey, event.altKey, event.shiftKey );
}

//--------------------------------------------------------------------------
//
// Constructor
//
//--------------------------------------------------------------------------

/**
* Constructor
*/
public function $GestureEvent(type:String, bubbles:Boolean=true, cancelable:Boolean=false, phase:String=null, localX:Number=0, localY:Number=0, ctrlKey:Boolean=false, altKey:Boolean=false, shiftKey:Boolean=false) {
super( type, bubbles, cancelable, phase, localX, localY, ctrlKey, altKey, shiftKey );
}

//--------------------------------------------------------------------------
//
// Variables
//
//--------------------------------------------------------------------------

/**
* @private
*/
$internal var $stopped:Boolean = false;

/**
* @private
*/
$internal var $canceled:Boolean = false;

//--------------------------------------------------------------------------
//
// Overriden properties: Event
//
//--------------------------------------------------------------------------

//----------------------------------
// target
//----------------------------------

/**
* @private
*/
$internal var $target:Object;

/**
* @private
* Сцылка на таргет.
*/
public override function get target():Object {
return this.$target || super.target;
}

//----------------------------------
// eventPhase
//----------------------------------

/**
* @private
*/
$internal var $eventPhase:uint;

/**
* @private
* Фаза.
*/
public override function get eventPhase():uint {
return this.$eventPhase || super.eventPhase;
}

//--------------------------------------------------------------------------
//
// Overriden methods: Event
//
//--------------------------------------------------------------------------

/**
* @private
*/
public override function stopImmediatePropagation():void {
super.stopImmediatePropagation();
this.$stopped = true;
}

/**
* @private
*/
public override function stopPropagation():void {
this.$stopped = true;
}

/**
* @private
*/
public override function preventDefault():void {
if ( super.cancelable ) this.$canceled = true;
}

/**
* @private
*/
public override function isDefaultPrevented():Boolean {
return this.$canceled;
}

/**
* @private
*/
public override function clone():Event {
return new $GestureEvent( super.type, super.bubbles, super.cancelable, super.phase, super.localX, super.localY, super.ctrlKey, super.altKey, super.shiftKey );
}

}

}
150 changes: 150 additions & 0 deletions src/by/blooddy/secret/display/$MouseEvent.as
@@ -0,0 +1,150 @@
////////////////////////////////////////////////////////////////////////////////
//
// (C) 2011 BlooDHounD
//
////////////////////////////////////////////////////////////////////////////////

package by.blooddy.secret.display {

import flash.display.InteractiveObject;
import flash.events.Event;
import flash.events.MouseEvent;

use namespace $internal;

/**
* @author BlooDHounD
* @version 1.0
* @playerversion Flash 10
* @langversion 3.0
* @created 02.10.2011 23:26:51
*/
internal final class $MouseEvent extends MouseEvent implements INativeEvent {

//--------------------------------------------------------------------------
//
// Internal class methods
//
//--------------------------------------------------------------------------

/**
* @private
*/
$internal static function get(event:MouseEvent):$MouseEvent {
return new $MouseEvent( event.type, event.bubbles, event.cancelable, event.localX, event.localY, event.relatedObject, event.ctrlKey, event.altKey, event.shiftKey, event.buttonDown, event.delta );
}

//--------------------------------------------------------------------------
//
// Constructor
//
//--------------------------------------------------------------------------

/**
* Constructor
*/
public function $MouseEvent(type:String, bubbles:Boolean=true, cancelable:Boolean=false, localX:Number=NaN, localY:Number=NaN, relatedObject:InteractiveObject=null, ctrlKey:Boolean=false, altKey:Boolean=false, shiftKey:Boolean=false, buttonDown:Boolean=false, delta:int=0) {
super( type, bubbles, cancelable, localX, localY, relatedObject, ctrlKey, altKey, shiftKey, buttonDown, delta );
}

//--------------------------------------------------------------------------
//
// Variables
//
//--------------------------------------------------------------------------

/**
* @private
*/
$internal var $stopped:Boolean = false;

/**
* @private
*/
$internal var $canceled:Boolean = false;

//--------------------------------------------------------------------------
//
// Overriden properties: Event
//
//--------------------------------------------------------------------------

//----------------------------------
// target
//----------------------------------

/**
* @private
*/
$internal var $target:Object;

/**
* @private
* Сцылка на таргет.
*/
public override function get target():Object {
return this.$target || super.target;
}

//----------------------------------
// eventPhase
//----------------------------------

/**
* @private
*/
$internal var $eventPhase:uint;

/**
* @private
* Фаза.
*/
public override function get eventPhase():uint {
return this.$eventPhase || super.eventPhase;
}

//--------------------------------------------------------------------------
//
// Overriden methods: Event
//
//--------------------------------------------------------------------------

/**
* @private
*/
public override function stopImmediatePropagation():void {
super.stopImmediatePropagation();
this.$stopped = true;
}

/**
* @private
*/
public override function stopPropagation():void {
this.$stopped = true;
}

/**
* @private
*/
public override function preventDefault():void {
if ( super.cancelable ) this.$canceled = true;
}

/**
* @private
*/
public override function isDefaultPrevented():Boolean {
return this.$canceled;
}

/**
* @private
*/
public override function clone():Event {
return new $MouseEvent( super.type, super.bubbles, super.cancelable, super.localX, super.localY, super.relatedObject, super.ctrlKey, super.altKey, super.shiftKey, super.buttonDown, super.delta );
}

}

}

0 comments on commit 42222cc

Please sign in to comment.