Move native adapters to extensions package

This commit is contained in:
Pavel fljot 2012-08-07 17:38:10 +03:00
parent 9c817b7472
commit a3b618e90a
4 changed files with 31 additions and 24 deletions

View file

@ -1,8 +1,11 @@
package org.gestouch.core
{
import flash.utils.getQualifiedClassName;
import org.gestouch.extensions.native.NativeDisplayListAdapter;
import org.gestouch.extensions.native.NativeTouchHitTester;
import flash.display.DisplayObject;
import flash.utils.Dictionary;
import flash.utils.getQualifiedClassName;
/**
@ -115,7 +118,8 @@ package org.gestouch.core
private static function initClass():void
{
addDisplayListAdapter(DisplayObject, new DisplayListAdapter());
addTouchHitTester(new NativeTouchHitTester());
addDisplayListAdapter(DisplayObject, new NativeDisplayListAdapter());
}
}
}

View file

@ -23,8 +23,6 @@ package org.gestouch.core
public function TouchesManager(gesturesManager:GesturesManager)
{
_gesturesManager = gesturesManager;
addTouchHitTester(new DefaultTouchHitTester());
}
@ -224,18 +222,3 @@ package org.gestouch.core
}
}
}
import flash.geom.Point;
import flash.display.InteractiveObject;
import org.gestouch.core.ITouchHitTester;
class DefaultTouchHitTester implements ITouchHitTester
{
public function hitTest(point:Point, nativeTarget:InteractiveObject):Object
{
return nativeTarget;
}
}

View file

@ -1,21 +1,22 @@
package org.gestouch.core
package org.gestouch.extensions.native
{
import flash.display.Stage;
import flash.display.DisplayObject;
import flash.display.DisplayObjectContainer;
import flash.display.Stage;
import flash.geom.Point;
import flash.utils.Dictionary;
import org.gestouch.core.IDisplayListAdapter;
/**
* @author Pavel fljot
*/
final public class DisplayListAdapter implements IDisplayListAdapter
final public class NativeDisplayListAdapter implements IDisplayListAdapter
{
private var _targetWeekStorage:Dictionary;
public function DisplayListAdapter(target:DisplayObject = null)
public function NativeDisplayListAdapter(target:DisplayObject = null)
{
if (target)
{
@ -97,7 +98,7 @@ package org.gestouch.core
public function reflect():Class
{
return DisplayListAdapter;
return NativeDisplayListAdapter;
}
}
}

View file

@ -0,0 +1,19 @@
package org.gestouch.extensions.native
{
import org.gestouch.core.ITouchHitTester;
import flash.display.InteractiveObject;
import flash.geom.Point;
/**
* @author Pavel fljot
*/
final public class NativeTouchHitTester implements ITouchHitTester
{
public function hitTest(point:Point, nativeTarget:InteractiveObject):Object
{
return nativeTarget;
}
}
}