mirror of
https://github.com/scratchfoundation/Gestouch.git
synced 2025-02-16 23:40:14 -05:00
Move native adapters to extensions package
This commit is contained in:
parent
9c817b7472
commit
a3b618e90a
4 changed files with 31 additions and 24 deletions
|
@ -1,8 +1,11 @@
|
||||||
package org.gestouch.core
|
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.display.DisplayObject;
|
||||||
import flash.utils.Dictionary;
|
import flash.utils.Dictionary;
|
||||||
|
import flash.utils.getQualifiedClassName;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -115,7 +118,8 @@ package org.gestouch.core
|
||||||
|
|
||||||
private static function initClass():void
|
private static function initClass():void
|
||||||
{
|
{
|
||||||
addDisplayListAdapter(DisplayObject, new DisplayListAdapter());
|
addTouchHitTester(new NativeTouchHitTester());
|
||||||
|
addDisplayListAdapter(DisplayObject, new NativeDisplayListAdapter());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,8 +23,6 @@ package org.gestouch.core
|
||||||
public function TouchesManager(gesturesManager:GesturesManager)
|
public function TouchesManager(gesturesManager:GesturesManager)
|
||||||
{
|
{
|
||||||
_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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,21 +1,22 @@
|
||||||
package org.gestouch.core
|
package org.gestouch.extensions.native
|
||||||
{
|
{
|
||||||
import flash.display.Stage;
|
|
||||||
import flash.display.DisplayObject;
|
import flash.display.DisplayObject;
|
||||||
import flash.display.DisplayObjectContainer;
|
import flash.display.DisplayObjectContainer;
|
||||||
|
import flash.display.Stage;
|
||||||
import flash.geom.Point;
|
import flash.geom.Point;
|
||||||
import flash.utils.Dictionary;
|
import flash.utils.Dictionary;
|
||||||
|
import org.gestouch.core.IDisplayListAdapter;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Pavel fljot
|
* @author Pavel fljot
|
||||||
*/
|
*/
|
||||||
final public class DisplayListAdapter implements IDisplayListAdapter
|
final public class NativeDisplayListAdapter implements IDisplayListAdapter
|
||||||
{
|
{
|
||||||
private var _targetWeekStorage:Dictionary;
|
private var _targetWeekStorage:Dictionary;
|
||||||
|
|
||||||
|
|
||||||
public function DisplayListAdapter(target:DisplayObject = null)
|
public function NativeDisplayListAdapter(target:DisplayObject = null)
|
||||||
{
|
{
|
||||||
if (target)
|
if (target)
|
||||||
{
|
{
|
||||||
|
@ -97,7 +98,7 @@ package org.gestouch.core
|
||||||
|
|
||||||
public function reflect():Class
|
public function reflect():Class
|
||||||
{
|
{
|
||||||
return DisplayListAdapter;
|
return NativeDisplayListAdapter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
19
src/org/gestouch/extensions/native/NativeTouchHitTester.as
Normal file
19
src/org/gestouch/extensions/native/NativeTouchHitTester.as
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue