mirror of
https://github.com/scratchfoundation/Gestouch.git
synced 2024-11-23 07:47:59 -05:00
Merge branch 'refs/heads/develop'
This commit is contained in:
commit
e2831d9dbd
10 changed files with 238 additions and 98 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -14,4 +14,5 @@ build.properties
|
||||||
*.iml
|
*.iml
|
||||||
*.ipr
|
*.ipr
|
||||||
*.iws
|
*.iws
|
||||||
.idea/
|
.idea/
|
||||||
|
target/
|
17
.project
17
.project
|
@ -1,17 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<projectDescription>
|
|
||||||
<name>Gestouch</name>
|
|
||||||
<comment></comment>
|
|
||||||
<projects>
|
|
||||||
</projects>
|
|
||||||
<buildSpec>
|
|
||||||
<buildCommand>
|
|
||||||
<name>com.powerflasher.fdt.core.FlashBuilder</name>
|
|
||||||
<arguments>
|
|
||||||
</arguments>
|
|
||||||
</buildCommand>
|
|
||||||
</buildSpec>
|
|
||||||
<natures>
|
|
||||||
<nature>com.powerflasher.fdt.core.FlashNature</nature>
|
|
||||||
</natures>
|
|
||||||
</projectDescription>
|
|
|
@ -1,15 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<AS3Classpath>
|
|
||||||
<AS3LibraryFolder>libs</AS3LibraryFolder>
|
|
||||||
<AS3Classpath generateProblems="true" sdkBased="false" type="source" useAsSharedCode="false">src</AS3Classpath>
|
|
||||||
<AS3Classpath generateProblems="false" sdkBased="true" type="lib" useAsSharedCode="false">frameworks/libs/air/airglobal.swc</AS3Classpath>
|
|
||||||
<AS3Classpath generateProblems="false" sdkBased="true" type="lib" useAsSharedCode="false">frameworks/libs/mobile/mobilecomponents.swc</AS3Classpath>
|
|
||||||
<AS3Classpath generateProblems="false" sdkBased="true" type="lib" useAsSharedCode="false">frameworks/libs/textLayout.swc</AS3Classpath>
|
|
||||||
<AS3Classpath generateProblems="false" sdkBased="true" type="lib" useAsSharedCode="false">frameworks/libs/framework.swc</AS3Classpath>
|
|
||||||
<AS3Classpath generateProblems="false" sdkBased="true" type="lib" useAsSharedCode="false">frameworks/libs/spark.swc</AS3Classpath>
|
|
||||||
<AS3Classpath generateProblems="false" sdkBased="true" type="lib" useAsSharedCode="false">frameworks/libs/sparkskins.swc</AS3Classpath>
|
|
||||||
<AS3Classpath generateProblems="false" sdkBased="true" type="lib" useAsSharedCode="false">frameworks/libs/air/servicemonitor.swc</AS3Classpath>
|
|
||||||
<AS3Classpath generateProblems="false" sdkBased="true" type="lib" useAsSharedCode="false">frameworks/themes/Mobile/mobile.swc</AS3Classpath>
|
|
||||||
<AS3Classpath generateProblems="false" sdkBased="true" type="lib" useAsSharedCode="false">frameworks/libs/mx/mx.swc</AS3Classpath>
|
|
||||||
<AS3Classpath generateProblems="false" sdkBased="false" type="lib" useAsSharedCode="false">libs/starling.swc</AS3Classpath>
|
|
||||||
</AS3Classpath>
|
|
|
@ -1,15 +0,0 @@
|
||||||
#Mon Apr 25 18:38:51 EEST 2011
|
|
||||||
com.powerflasher.fdt.core.CompatiblePlayers=AIR_Debug_Launcher
|
|
||||||
com.powerflasher.fdt.core.CompilerArguments=-load-config\="{flexSDK}/frameworks/airmobile-config.xml"\n-target-player\={playerVersion}\n-library-path+\="{flexSDK}/frameworks/locale/en_US"
|
|
||||||
com.powerflasher.fdt.core.DefaultOutputFolder=bin
|
|
||||||
com.powerflasher.fdt.core.DefaultPlayer=AIR_Debug_Launcher
|
|
||||||
com.powerflasher.fdt.core.Language=AS3
|
|
||||||
com.powerflasher.fdt.core.PassClasspath=true
|
|
||||||
com.powerflasher.fdt.core.PassMainclass=true
|
|
||||||
com.powerflasher.fdt.core.PassRsls=false
|
|
||||||
com.powerflasher.fdt.core.PassSwcs=true
|
|
||||||
com.powerflasher.fdt.core.PlayerVersion=10.2
|
|
||||||
com.powerflasher.fdt.core.ProjectTypeHint=Flex 4.5 Mobile
|
|
||||||
com.powerflasher.fdt.core.Runtime=AIR
|
|
||||||
com.powerflasher.fdt.core.SdkName=Flex 4.5
|
|
||||||
eclipse.preferences.version=1
|
|
|
@ -1,3 +0,0 @@
|
||||||
#Sun Apr 17 10:41:00 EEST 2011
|
|
||||||
eclipse.preferences.version=1
|
|
||||||
encoding/<project>=UTF-8
|
|
229
pom.xml
Normal file
229
pom.xml
Normal file
|
@ -0,0 +1,229 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<groupId>org.gestouch</groupId>
|
||||||
|
<artifactId>gestouch</artifactId>
|
||||||
|
<packaging>swc</packaging>
|
||||||
|
<version>0.4.7</version>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<flexmojos.version>5.0-beta</flexmojos.version>
|
||||||
|
<flex.sdk.version>4.6.b.23201</flex.sdk.version>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<!-- Continuous Integration build hosted by CloudBees -->
|
||||||
|
<ciManagement>
|
||||||
|
<system>jenkins</system>
|
||||||
|
<url>https://fljot.ci.cloudbees.com/job/Gestouch/</url>
|
||||||
|
</ciManagement>
|
||||||
|
|
||||||
|
<issueManagement>
|
||||||
|
<system>github</system>
|
||||||
|
<url>https://github.com/fljot/Gestouch/issues</url>
|
||||||
|
</issueManagement>
|
||||||
|
|
||||||
|
<!-- GitHub Software Configuration Management -->
|
||||||
|
<scm>
|
||||||
|
<url>https://github.com/fljot/Gestouch</url>
|
||||||
|
<connection>scm:git:ssh://git@github.com:fljot/Gestouch.git</connection>
|
||||||
|
<developerConnection>scm:git:ssh://git@github.com:fljot/Gestouch.git</developerConnection>
|
||||||
|
</scm>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<sourceDirectory>src/</sourceDirectory>
|
||||||
|
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>net.flexmojos.oss</groupId>
|
||||||
|
<artifactId>flexmojos-maven-plugin</artifactId>
|
||||||
|
<version>${flexmojos.version}</version>
|
||||||
|
<extensions>true</extensions>
|
||||||
|
<configuration>
|
||||||
|
<debug>true</debug>
|
||||||
|
<storepass/>
|
||||||
|
<skipTests>true</skipTests>
|
||||||
|
<skipTest>true</skipTest>
|
||||||
|
<debug>true</debug>
|
||||||
|
<verboseStacktraces>true</verboseStacktraces>
|
||||||
|
<!--
|
||||||
|
NB! SWC is compiled in debug mode with verbose stacktraces
|
||||||
|
for better development process.
|
||||||
|
It's okay and will not affect application performance
|
||||||
|
UNLESS you are using this library as RSL.
|
||||||
|
-->
|
||||||
|
<keepAs3Metadatas>
|
||||||
|
<!-- potentially for Apparat. probably useless -->
|
||||||
|
<keepAs3Metadata>Abstract</keepAs3Metadata>
|
||||||
|
</keepAs3Metadatas>
|
||||||
|
</configuration>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.adobe.flex</groupId>
|
||||||
|
<artifactId>compiler</artifactId>
|
||||||
|
<version>${flex.sdk.version}</version>
|
||||||
|
<type>pom</type>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
<groupId>net.flexmojos.oss</groupId>
|
||||||
|
<artifactId>flexmojos-maven-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>prepare-package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>asdoc</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
<configuration>
|
||||||
|
<storepass/>
|
||||||
|
<keepXml>true</keepXml>
|
||||||
|
<skipXsl>true</skipXsl>
|
||||||
|
<windowTitle>Gestouch ${project.version}</windowTitle>
|
||||||
|
<mainTitle>Gestouch ${project.version}</mainTitle>
|
||||||
|
<footer>Gestouch - http://github.com/fljot/Gestouch/ - Documentation generated at: ${maven.build.timestamp}</footer>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-antrun-plugin</artifactId>
|
||||||
|
<version>1.7</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>fail-to-deploy-in-develop</id>
|
||||||
|
<phase>package</phase>
|
||||||
|
<configuration>
|
||||||
|
<target>
|
||||||
|
<zip destfile="${project.build.directory}/${project.artifactId}-${project.version}.swc" update="true">
|
||||||
|
<zipfileset dir="${project.build.directory}/asdoc/tempdita" prefix="docs">
|
||||||
|
<include name="*.*"/>
|
||||||
|
<exclude name="ASDoc_Config.xml"/>
|
||||||
|
<exclude name="overviews.xml"/>
|
||||||
|
</zipfileset>
|
||||||
|
</zip>
|
||||||
|
</target>
|
||||||
|
</configuration>
|
||||||
|
<goals>
|
||||||
|
<goal>run</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
<!-- I don't think I need this as I put documentation into original SWC -->
|
||||||
|
<!--
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
|
<artifactId>build-helper-maven-plugin</artifactId>
|
||||||
|
<version>1.3</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>attach-artifacts</id>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>attach-artifact</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<artifacts>
|
||||||
|
<artifact>
|
||||||
|
<file>${project.build.directory}/${project.artifactId}-fat-${project.version}.swc</file>
|
||||||
|
<type>swc</type>
|
||||||
|
<classifier>fat</classifier>
|
||||||
|
</artifact>
|
||||||
|
</artifacts>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
-->
|
||||||
|
</plugins>
|
||||||
|
|
||||||
|
</build>
|
||||||
|
|
||||||
|
<reporting>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.sonatype.flexmojos</groupId>
|
||||||
|
<artifactId>flexmojos-maven-plugin</artifactId>
|
||||||
|
<version>${flexmojos.version}</version>
|
||||||
|
<reportSets>
|
||||||
|
<reportSet>
|
||||||
|
<id>flex-reports</id>
|
||||||
|
<reports>
|
||||||
|
<report>asdoc-report</report>
|
||||||
|
</reports>
|
||||||
|
</reportSet>
|
||||||
|
</reportSets>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</reporting>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.adobe.flex</groupId>
|
||||||
|
<artifactId>compiler</artifactId>
|
||||||
|
<version>${flex.sdk.version}</version>
|
||||||
|
<type>pom</type>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.adobe.flex.framework</groupId>
|
||||||
|
<artifactId>flex-framework</artifactId>
|
||||||
|
<version>${flex.sdk.version}</version>
|
||||||
|
<type>pom</type>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.gamua</groupId>
|
||||||
|
<artifactId>starling-framework</artifactId>
|
||||||
|
<version>[1.1,]</version>
|
||||||
|
<type>swc</type>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<repositories>
|
||||||
|
<repository>
|
||||||
|
<id>flex-mojos-repository</id>
|
||||||
|
<url>http://repository.sonatype.org/content/groups/flexgroup</url>
|
||||||
|
</repository>
|
||||||
|
|
||||||
|
<repository>
|
||||||
|
<id>starling-repository</id>
|
||||||
|
<url>http://repository-trylogic.forge.cloudbees.com/snapshot</url>
|
||||||
|
<releases>
|
||||||
|
<enabled>false</enabled>
|
||||||
|
</releases>
|
||||||
|
<snapshots>
|
||||||
|
<enabled>true</enabled>
|
||||||
|
</snapshots>
|
||||||
|
</repository>
|
||||||
|
</repositories>
|
||||||
|
|
||||||
|
<pluginRepositories>
|
||||||
|
<pluginRepository>
|
||||||
|
<id>flex-mojos-plugin-repository</id>
|
||||||
|
<url>http://repository.sonatype.org/content/groups/flexgroup</url>
|
||||||
|
<releases>
|
||||||
|
<enabled>true</enabled>
|
||||||
|
<updatePolicy>never</updatePolicy>
|
||||||
|
</releases>
|
||||||
|
<snapshots>
|
||||||
|
<enabled>false</enabled>
|
||||||
|
<updatePolicy>never</updatePolicy>
|
||||||
|
</snapshots>
|
||||||
|
</pluginRepository>
|
||||||
|
</pluginRepositories>
|
||||||
|
|
||||||
|
<developers>
|
||||||
|
<developer>
|
||||||
|
<name>Pavel fljōt Pevnitskiy</name>
|
||||||
|
<email>pavel.fljot at gmail.com</email>
|
||||||
|
</developer>
|
||||||
|
</developers>
|
||||||
|
</project>
|
|
@ -20,7 +20,6 @@ package org.gestouch.core
|
||||||
public class GesturesManager
|
public class GesturesManager
|
||||||
{
|
{
|
||||||
protected const _frameTickerShape:Shape = new Shape();
|
protected const _frameTickerShape:Shape = new Shape();
|
||||||
protected var _inputAdapters:Vector.<IInputAdapter> = new Vector.<IInputAdapter>();
|
|
||||||
protected var _gesturesMap:Dictionary = new Dictionary(true);
|
protected var _gesturesMap:Dictionary = new Dictionary(true);
|
||||||
protected var _gesturesForTouchMap:Dictionary = new Dictionary();
|
protected var _gesturesForTouchMap:Dictionary = new Dictionary();
|
||||||
protected var _gesturesForTargetMap:Dictionary = new Dictionary(true);
|
protected var _gesturesForTargetMap:Dictionary = new Dictionary(true);
|
||||||
|
@ -182,9 +181,9 @@ package org.gestouch.core
|
||||||
if (gesture.canPreventGesture(otherGesture) &&
|
if (gesture.canPreventGesture(otherGesture) &&
|
||||||
otherGesture.canBePreventedByGesture(gesture) &&
|
otherGesture.canBePreventedByGesture(gesture) &&
|
||||||
(gesture.gesturesShouldRecognizeSimultaneouslyCallback == null ||
|
(gesture.gesturesShouldRecognizeSimultaneouslyCallback == null ||
|
||||||
gesture.gesturesShouldRecognizeSimultaneouslyCallback(gesture, otherGesture)) &&
|
!gesture.gesturesShouldRecognizeSimultaneouslyCallback(gesture, otherGesture)) &&
|
||||||
(otherGesture.gesturesShouldRecognizeSimultaneouslyCallback == null ||
|
(otherGesture.gesturesShouldRecognizeSimultaneouslyCallback == null ||
|
||||||
otherGesture.gesturesShouldRecognizeSimultaneouslyCallback(otherGesture, gesture)))
|
!otherGesture.gesturesShouldRecognizeSimultaneouslyCallback(otherGesture, gesture)))
|
||||||
{
|
{
|
||||||
otherGesture.setState_internal(GestureState.FAILED);
|
otherGesture.setState_internal(GestureState.FAILED);
|
||||||
}
|
}
|
||||||
|
|
|
@ -116,8 +116,8 @@ package org.gestouch.core
|
||||||
public function clone():Touch
|
public function clone():Touch
|
||||||
{
|
{
|
||||||
var touch:Touch = new Touch(id);
|
var touch:Touch = new Touch(id);
|
||||||
touch._location = _location;
|
touch._location = _location.clone();
|
||||||
touch._beginLocation = _beginLocation;
|
touch._beginLocation = _beginLocation.clone();
|
||||||
touch.target = target;
|
touch.target = target;
|
||||||
touch.sizeX = sizeX;
|
touch.sizeX = sizeX;
|
||||||
touch.sizeY = sizeY;
|
touch.sizeY = sizeY;
|
||||||
|
|
|
@ -91,8 +91,6 @@ package org.gestouch.gestures
|
||||||
protected var _gesturesToFail:Dictionary = new Dictionary(true);
|
protected var _gesturesToFail:Dictionary = new Dictionary(true);
|
||||||
protected var _pendingRecognizedState:GestureState;
|
protected var _pendingRecognizedState:GestureState;
|
||||||
|
|
||||||
private var eventListeners:Dictionary = new Dictionary();
|
|
||||||
|
|
||||||
|
|
||||||
public function Gesture(target:Object = null)
|
public function Gesture(target:Object = null)
|
||||||
{
|
{
|
||||||
|
@ -223,43 +221,6 @@ package org.gestouch.gestures
|
||||||
//
|
//
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
|
|
||||||
override public function addEventListener(type:String, listener:Function,
|
|
||||||
useCapture:Boolean = false, priority:int = 0,
|
|
||||||
useWeakReference:Boolean = false):void
|
|
||||||
{
|
|
||||||
super.addEventListener(type, listener, useCapture, priority, useWeakReference);
|
|
||||||
|
|
||||||
const listenerProps:Array = eventListeners[listener] as Array;
|
|
||||||
if (listenerProps)
|
|
||||||
{
|
|
||||||
listenerProps.push(type, useCapture);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
eventListeners[listener] = [type, useCapture];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public function removeAllEventListeners():void
|
|
||||||
{
|
|
||||||
for (var listener:Object in eventListeners)
|
|
||||||
{
|
|
||||||
const listenerProps:Array = eventListeners[listener] as Array;
|
|
||||||
|
|
||||||
var n:uint = listenerProps.length;
|
|
||||||
for (var i:uint = 0; i < n;)
|
|
||||||
{
|
|
||||||
super.removeEventListener(listenerProps[i++] as String, listener as Function, listenerProps[i++] as Boolean);
|
|
||||||
}
|
|
||||||
|
|
||||||
delete eventListeners[listener];
|
|
||||||
}
|
|
||||||
|
|
||||||
// eventListeners = new Dictionary(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
[Abstract]
|
[Abstract]
|
||||||
/**
|
/**
|
||||||
* Reflects gesture class (for better perfomance).
|
* Reflects gesture class (for better perfomance).
|
||||||
|
@ -336,13 +297,11 @@ package org.gestouch.gestures
|
||||||
{
|
{
|
||||||
//TODO
|
//TODO
|
||||||
reset();
|
reset();
|
||||||
removeAllEventListeners();
|
|
||||||
target = null;
|
target = null;
|
||||||
gestureShouldReceiveTouchCallback = null;
|
gestureShouldReceiveTouchCallback = null;
|
||||||
gestureShouldBeginCallback = null;
|
gestureShouldBeginCallback = null;
|
||||||
gesturesShouldRecognizeSimultaneouslyCallback = null;
|
gesturesShouldRecognizeSimultaneouslyCallback = null;
|
||||||
_gesturesToFail = null;
|
_gesturesToFail = null;
|
||||||
eventListeners = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -87,7 +87,9 @@ package org.gestouch.gestures
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var currTransformVector:Point = _touch2.location.subtract(_touch1.location);
|
var currTransformVector:Point = _touch2.location.subtract(_touch1.location);
|
||||||
var rotation:Number = Math.atan2(currTransformVector.y, currTransformVector.x) - Math.atan2(_transformVector.y, _transformVector.x);
|
var cross:Number = (_transformVector.x * currTransformVector.y) - (currTransformVector.x * _transformVector.y);
|
||||||
|
var dot:Number = (_transformVector.x * currTransformVector.x) + (_transformVector.y * currTransformVector.y);
|
||||||
|
var rotation:Number = Math.atan2(cross, dot);
|
||||||
|
|
||||||
if (state == GestureState.POSSIBLE)
|
if (state == GestureState.POSSIBLE)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue