Compare commits
18 commits
Author | SHA1 | Date | |
---|---|---|---|
|
7d929b23b6 | ||
|
3024eccd6e | ||
|
523c3a481d | ||
|
8d9c8d3bbb | ||
|
822f6d7860 | ||
|
51ebd1c4fb | ||
|
ca3488b948 | ||
|
350b3acea7 | ||
|
3951bc45de | ||
|
9d6bcb5708 | ||
|
9e0b749a49 | ||
|
27049339d3 | ||
|
fdb29695a9 | ||
|
6ead92f0d1 | ||
|
05e6053387 | ||
|
a390c79d46 | ||
|
788dfd576e | ||
|
6a16a3003c |
12 changed files with 260 additions and 83 deletions
|
@ -1,27 +1,29 @@
|
||||||
h1. Gestouch: multitouch gesture recognition library for Flash (ActionScript) development.
|
# Gestouch: multitouch gesture recognition library for Flash (ActionScript) development.
|
||||||
|
|
||||||
Gestouch is a ActionScript (AS3) library that helps you to deal with single- and multitouch gestures for building better NUI (Natural User Interface).
|
Gestouch is a ActionScript (AS3) library that helps you to deal with single- and multitouch gestures for building better NUI (Natural User Interface).
|
||||||
|
|
||||||
|
|
||||||
h3. Why? There's already gesture support in Flash/AIR!
|
### Why? There's already gesture support in Flash/AIR!
|
||||||
|
|
||||||
Yes, last versions of Flash Player and AIR runtimes have built-in touch and multitouch support, but the gestures support is very poor: only small set of gestures are supported, they depend on OS, they are not customizable in any way, only one can be processed at the same time and, finally, you are forced to use either raw TouchEvents, or gestures (@see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/ui/Multitouch.html#inputMode).
|
Yes, last versions of Flash Player and AIR runtimes have built-in touch and multitouch support, but the gestures support is very poor: only small set of gestures are supported, they depend on OS, they are not customizable in any way, only one can be processed at the same time and, finally, you are forced to use either raw TouchEvents, or gestures (@see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/ui/Multitouch.html#inputMode).
|
||||||
_Upd:_ With "native way" you also won't get anything out of Stage3D and of custom input like TUIO protocol.
|
_Upd:_ With "native way" you also won't get anything out of Stage3D and of custom input like TUIO protocol.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
h3. What Gestouch does in short?
|
### What Gestouch does in short?
|
||||||
|
|
||||||
Well basically there's 3 distinctive tasks to solve.
|
Well basically there's 3 distinctive tasks to solve:
|
||||||
# To provide various input. It can be native MouseEvents, TouchEvents or more complex things like custom input via TUIO protocol for your hand-made installation. So what we get here is Touches (touch points).
|
|
||||||
# To recognize gesture analyzing touches. Each type of Gesture has it's own inner algorithms that ...
|
1. To provide various input. It can be native MouseEvents, TouchEvents or more complex things like custom input via TUIO protocol for your hand-made installation. So what we get here is Touches (touch points).
|
||||||
# To manage gestures conflicts. As multiple gestures may be recognized simultaneously, we need to be able to control whether it's allowed or some of them should not be recognized (fail).
|
2. To recognize gesture analyzing touches. Each type of Gesture has it's own inner algorithms that ...
|
||||||
|
3. To manage gestures conflicts. As multiple gestures may be recognized simultaneously, we need to be able to control whether it's allowed or some of them should not be recognized (fail).
|
||||||
|
|
||||||
Gestouch solves these 3 tasks.
|
Gestouch solves these 3 tasks.
|
||||||
I was hardly inspired by Apple team, how they solved this (quite recently to my big surprise! I thought they had it right from the beginning) in they Cocoa-touch UIKit framework. Gestouch is very similar in many ways. But I wouldn't call it "direct port" because 1) the whole architecture was implemented based just on conference videos and user documentation 2) flash platform is a different platform with own specialization, needs, etc.
|
I was hardly inspired by Apple team, how they solved this (quite recently to my big surprise! I thought they had it right from the beginning) in they Cocoa-touch UIKit framework. Gestouch is very similar in many ways. But I wouldn't call it "direct port" because 1) the whole architecture was implemented based just on conference videos and user documentation 2) flash platform is a different platform with own specialization, needs, etc.
|
||||||
So I want Gestouch to go far beyond that.
|
So I want Gestouch to go far beyond that.
|
||||||
|
|
||||||
Features:
|
Features:
|
||||||
|
|
||||||
* Pretty neat architecture! Very similar to Apple's UIGestureRecognizers (Cocoa-Touch UIKit)
|
* Pretty neat architecture! Very similar to Apple's UIGestureRecognizers (Cocoa-Touch UIKit)
|
||||||
* Works with any display list hierarchy structures: native DisplayList (pure AS3/Flex/your UI framework), Starling or ND2D (Stage3D) and 3D libs...
|
* Works with any display list hierarchy structures: native DisplayList (pure AS3/Flex/your UI framework), Starling or ND2D (Stage3D) and 3D libs...
|
||||||
* Doesn't require any additional software (may use runtime's build-in touch support)
|
* Doesn't require any additional software (may use runtime's build-in touch support)
|
||||||
|
@ -31,7 +33,7 @@ Features:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
h3. Getting Started
|
### Getting Started
|
||||||
|
|
||||||
All gestures dispatch (if you listen to!) GestureEvent with the next types:
|
All gestures dispatch (if you listen to!) GestureEvent with the next types:
|
||||||
GestureEvent.GESTURE_STATE_CHANGE
|
GestureEvent.GESTURE_STATE_CHANGE
|
||||||
|
@ -71,23 +73,37 @@ private function onFreeTransform(event:GestureEvent):void
|
||||||
}
|
}
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
* Check the "Gestouch Examples":http://github.com/fljot/GestouchExamples project for a quick jump-in
|
* Check the [Gestouch Examples](http://github.com/fljot/GestouchExamples) project for a quick jump-in
|
||||||
* *+Highly recommended+* to watch videos from Apple WWDC conferences as they explain all the concepts and show more or less real-life examples. @see links below
|
* *+Highly recommended+* to watch videos from Apple WWDC conferences as they explain all the concepts and show more or less real-life examples. @see links below
|
||||||
* "Introduction video":http://www.youtube.com/watch?v=NjkmB8rfQjY - my first video, currently outdated
|
* TODO: wiki?
|
||||||
* TODO: wiki
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
h3. Advanced usage: Starling, ...
|
#### Memory Management
|
||||||
|
|
||||||
|
To make Gesture object available for Garbage Collector:
|
||||||
|
|
||||||
|
1. **Important!** Set gesture target to `null` or call `dispose()` method.
|
||||||
|
2. Remove all other references you've created (e.g. event listeners).
|
||||||
|
|
||||||
|
@see [examples](https://github.com/fljot/GestouchExamples/tree/master/src/org/gestouch/examples/views) for more details.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Advanced usage: Starling, ...
|
||||||
|
|
||||||
|
It is possible to work with [Starling](http://www.starling-framework.org) display objects as well as any other display list hierarchical structures, e.g. other Stage3D frameworks that have display objects hierarchy like [Genome2D](https://github.com/pshtif/Genome2D-AS3) or [ND2D](https://github.com/nulldesign/nd2d) or even 3D libraries.
|
||||||
|
|
||||||
Recent changes made it possible to work with "Starling":http://www.starling-framework.org display list objects as well as any other display list hierarchical structures, e.g. other Stage3D frameworks that have display objects hierarchy like "ND2D":https://github.com/nulldesign/nd2d or even 3D libraries.
|
|
||||||
In order to use Gestouch with Starling all you need to do is a bit of bootstrapping:
|
In order to use Gestouch with Starling all you need to do is a bit of bootstrapping:
|
||||||
<pre><code>starling = new Starling(MyStarlingRootClass, stage);
|
<pre><code>starling = new Starling(MyStarlingRootClass, stage);
|
||||||
/* setup & start your Starling instance here */
|
/* setup & start your Starling instance here */
|
||||||
|
|
||||||
// Gestouch initialization step 1 of 3:
|
// Gestouch initialization step 1 of 3:
|
||||||
// Initialize native (default) input adapter. Needed for non-DisplayList usage.
|
// Initialize native (default) input adapter. Needed for non-DisplayList usage.
|
||||||
Gestouch.inputAdapter ||= new NativeInputAdapter(stage);
|
if (!Gestouch.inputAdapter)
|
||||||
|
{
|
||||||
|
Gestouch.inputAdapter = new NativeInputAdapter(stage);
|
||||||
|
}
|
||||||
|
|
||||||
// Gestouch initialization step 2 of 3:
|
// Gestouch initialization step 2 of 3:
|
||||||
// Register instance of StarlingDisplayListAdapter to be used for objects of type starling.display.DisplayObject.
|
// Register instance of StarlingDisplayListAdapter to be used for objects of type starling.display.DisplayObject.
|
||||||
|
@ -110,7 +126,7 @@ Now you can register gestures as usual:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
h3. Roadmap, TODOs
|
### Roadmap, TODOs
|
||||||
|
|
||||||
* "Massive gestures" & Clusters. For bigger form-factor multitouch usage, when gestures must be a bit less about separate fingers but rather touch clusters (massive multitouch)
|
* "Massive gestures" & Clusters. For bigger form-factor multitouch usage, when gestures must be a bit less about separate fingers but rather touch clusters (massive multitouch)
|
||||||
* -Simulator (for testing multitouch gestures without special devices)- With new architecture it must be relatively easy to create SimulatorInputAdapter
|
* -Simulator (for testing multitouch gestures without special devices)- With new architecture it must be relatively easy to create SimulatorInputAdapter
|
||||||
|
@ -119,36 +135,33 @@ h3. Roadmap, TODOs
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
h3. News
|
### News
|
||||||
|
|
||||||
* "Follow me on Twitter":http://twitter.com/fljot for latest updates
|
* "Follow me on [Twitter](http://twitter.com/fljot) for latest updates
|
||||||
* Don't forget about "issues":https://github.com/fljot/Gestouch/issues section as a good platform for discussions.
|
* Don't forget about github [issues](https://github.com/fljot/Gestouch/issues) section as a good platform for discussions.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
h3. Contribution, Donations
|
### Contribution, Donations
|
||||||
|
|
||||||
Contribute, share. Found it useful, nothing to add? Hire me for some project.
|
Contribute, share. Found it useful, nothing to add? Hire me for some project.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
h3. Links
|
### Links
|
||||||
|
|
||||||
* "Gestouch Examples":http://github.com/fljot/GestouchExamples
|
* [Gestouch Examples](http://github.com/fljot/GestouchExamples)
|
||||||
|
|
||||||
* "Apple WWDC 2011: Making the Most of Multi-Touch on iOS":https://developer.apple.com/videos/wwdc/2011/?id=118
|
* [Apple WWDC 2011: Making the Most of Multi-Touch on iOS](https://developer.apple.com/videos/wwdc/2011/?id=118)
|
||||||
* "Apple WWDC 2010: Simplifying Touch Event Handling with Gesture Recognizers":https://developer.apple.com/videos/wwdc/2010/?id=120
|
* [Apple WWDC 2010: Simplifying Touch Event Handling with Gesture Recognizers](https://developer.apple.com/videos/wwdc/2010/?id=120)
|
||||||
* "Apple WWDC 2010: Advanced Gesture Recognition":https://developer.apple.com/videos/wwdc/2010/?id=121
|
* [Apple WWDC 2010: Advanced Gesture Recognition](https://developer.apple.com/videos/wwdc/2010/?id=121)
|
||||||
* "Event Handling Guide for iOS":https://developer.apple.com/library/ios/documentation/EventHandling/Conceptual/EventHandlingiPhoneOS/
|
* [Event Handling Guide for iOS](https://developer.apple.com/library/ios/documentation/EventHandling/Conceptual/EventHandlingiPhoneOS/)
|
||||||
* "UIGestureRecognizer Class Reference":https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIGestureRecognizer_Class/
|
* [UIGestureRecognizer Class Reference](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIGestureRecognizer_Class/)
|
||||||
|
|
||||||
* "TUIO":http://www.tuio.org
|
* [TUIO](http://www.tuio.org)
|
||||||
|
|
||||||
|
|
||||||
h2. License
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
## License
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
See LICENSE file.
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
26
build.xml
26
build.xml
|
@ -23,6 +23,31 @@
|
||||||
<arg value="-external-library-path+=${flexSDK.dir}/frameworks/libs"/>
|
<arg value="-external-library-path+=${flexSDK.dir}/frameworks/libs"/>
|
||||||
<!-- Exclude any external classes (such as Starling framework classes) -->
|
<!-- Exclude any external classes (such as Starling framework classes) -->
|
||||||
<arg value="-external-library-path+=${libs.dir}"/>
|
<arg value="-external-library-path+=${libs.dir}"/>
|
||||||
|
<arg value="-define+=CONFIG::GestouchDebug,false"/>
|
||||||
|
<arg value="-externs+=org.gestouch.utils:log"/>
|
||||||
|
<!-- Keep the metatags (Apparat?). -->
|
||||||
|
<arg value="-keep-as3-metadata+=Abstract"/>
|
||||||
|
<!-- Boolean mosh pit! -->
|
||||||
|
<arg value="-incremental=false"/>
|
||||||
|
<arg value="-static-link-runtime-shared-libraries=true"/>
|
||||||
|
<arg value="-verbose-stacktraces=true"/>
|
||||||
|
<arg value="-headless-server=true"/>
|
||||||
|
</java>
|
||||||
|
<echo>[compile] Release SWC gestouch-${project.version}.swc created successfully</echo>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="compile.swc.debug">
|
||||||
|
<echo>[compile] Compiling release SWC</echo>
|
||||||
|
<java jar="${flexSDK.dir}/lib/compc.jar" dir="${flexSDK.dir}/frameworks" fork="true" failonerror="true">
|
||||||
|
<!-- Build our SWC with a versioned name. -->
|
||||||
|
<arg value="-output=${binrelease.dir}/gestouch-${project.version}.swc"/>
|
||||||
|
<!-- We want all the org package classes in the SWC being built. -->
|
||||||
|
<arg value="-include-sources=${src.dir}"/>
|
||||||
|
<!-- Exclude Flex Framework classes (some mx events comes from binding). -->
|
||||||
|
<arg value="-external-library-path+=${flexSDK.dir}/frameworks/libs"/>
|
||||||
|
<!-- Exclude any external classes (such as Starling framework classes) -->
|
||||||
|
<arg value="-external-library-path+=${libs.dir}"/>
|
||||||
|
<arg value="-define+=CONFIG::GestouchDebug,true"/>
|
||||||
<!-- Keep the metatags (Apparat?). -->
|
<!-- Keep the metatags (Apparat?). -->
|
||||||
<arg value="-keep-as3-metadata+=Abstract"/>
|
<arg value="-keep-as3-metadata+=Abstract"/>
|
||||||
<!-- Boolean mosh pit! -->
|
<!-- Boolean mosh pit! -->
|
||||||
|
@ -51,6 +76,7 @@
|
||||||
<arg line="-output ${asdoc.dir}"/>
|
<arg line="-output ${asdoc.dir}"/>
|
||||||
<arg value="-keep-xml=true"/>
|
<arg value="-keep-xml=true"/>
|
||||||
<arg value="-skip-xsl=true"/>
|
<arg value="-skip-xsl=true"/>
|
||||||
|
<arg value="-define+=CONFIG::GestouchDebug,false"/>
|
||||||
<arg line="-window-title 'Gestouch ${project.version}'"/>
|
<arg line="-window-title 'Gestouch ${project.version}'"/>
|
||||||
<arg line="-main-title 'Gestouch ${project.version}'"/>
|
<arg line="-main-title 'Gestouch ${project.version}'"/>
|
||||||
<arg line="-footer 'Gestouch - http://github.com/fljot/Gestouch/ - Documentation generated at: ${docgen.time}'"/>
|
<arg line="-footer 'Gestouch - http://github.com/fljot/Gestouch/ - Documentation generated at: ${docgen.time}'"/>
|
||||||
|
|
BIN
libs/starling-framework-1.5.1.swc
Normal file
BIN
libs/starling-framework-1.5.1.swc
Normal file
Binary file not shown.
Binary file not shown.
106
pom.xml
106
pom.xml
|
@ -7,19 +7,16 @@
|
||||||
<groupId>org.gestouch</groupId>
|
<groupId>org.gestouch</groupId>
|
||||||
<artifactId>gestouch</artifactId>
|
<artifactId>gestouch</artifactId>
|
||||||
<packaging>swc</packaging>
|
<packaging>swc</packaging>
|
||||||
<version>0.4.7</version>
|
<version>0.4.8-SNAPSHOT</version>
|
||||||
|
|
||||||
|
<name>Gestouch</name>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<flexmojos.version>5.0-beta</flexmojos.version>
|
<flexmojos.version>5.0-beta</flexmojos.version>
|
||||||
<flex.sdk.version>4.6.b.23201</flex.sdk.version>
|
<flex.sdk.version>4.6.b.23201</flex.sdk.version>
|
||||||
|
<project.config.debug>false</project.config.debug>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<!-- Continuous Integration build hosted by CloudBees -->
|
|
||||||
<ciManagement>
|
|
||||||
<system>jenkins</system>
|
|
||||||
<url>https://fljot.ci.cloudbees.com/job/Gestouch/</url>
|
|
||||||
</ciManagement>
|
|
||||||
|
|
||||||
<issueManagement>
|
<issueManagement>
|
||||||
<system>github</system>
|
<system>github</system>
|
||||||
<url>https://github.com/fljot/Gestouch/issues</url>
|
<url>https://github.com/fljot/Gestouch/issues</url>
|
||||||
|
@ -32,6 +29,36 @@
|
||||||
<developerConnection>scm:git:ssh://git@github.com:fljot/Gestouch.git</developerConnection>
|
<developerConnection>scm:git:ssh://git@github.com:fljot/Gestouch.git</developerConnection>
|
||||||
</scm>
|
</scm>
|
||||||
|
|
||||||
|
<profiles>
|
||||||
|
<profile>
|
||||||
|
<id>release</id>
|
||||||
|
<activation>
|
||||||
|
<activeByDefault>true</activeByDefault>
|
||||||
|
</activation>
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>net.flexmojos.oss</groupId>
|
||||||
|
<artifactId>flexmojos-maven-plugin</artifactId>
|
||||||
|
<extensions>true</extensions>
|
||||||
|
<configuration>
|
||||||
|
<externs>
|
||||||
|
<extern>org.gestouch.utils.log</extern>
|
||||||
|
</externs>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</profile>
|
||||||
|
|
||||||
|
<profile>
|
||||||
|
<id>debug</id>
|
||||||
|
<properties>
|
||||||
|
<project.config.debug>true</project.config.debug>
|
||||||
|
</properties>
|
||||||
|
</profile>
|
||||||
|
</profiles>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<sourceDirectory>src/</sourceDirectory>
|
<sourceDirectory>src/</sourceDirectory>
|
||||||
|
|
||||||
|
@ -42,22 +69,25 @@
|
||||||
<version>${flexmojos.version}</version>
|
<version>${flexmojos.version}</version>
|
||||||
<extensions>true</extensions>
|
<extensions>true</extensions>
|
||||||
<configuration>
|
<configuration>
|
||||||
<debug>true</debug>
|
|
||||||
<storepass/>
|
<storepass/>
|
||||||
<skipTests>true</skipTests>
|
<skipTests>true</skipTests>
|
||||||
<skipTest>true</skipTest>
|
<skipTest>true</skipTest>
|
||||||
<debug>true</debug>
|
<debug>true</debug>
|
||||||
<verboseStacktraces>true</verboseStacktraces>
|
|
||||||
<!--
|
<!--
|
||||||
NB! SWC is compiled in debug mode with verbose stacktraces
|
NB! SWC is compiled in debug mode for better development process.
|
||||||
for better development process.
|
|
||||||
It's okay and will not affect application performance
|
It's okay and will not affect application performance
|
||||||
UNLESS you are using this library as RSL.
|
UNLESS you are somehow using this library as RSL.
|
||||||
-->
|
-->
|
||||||
<keepAs3Metadatas>
|
<keepAs3Metadatas>
|
||||||
<!-- potentially for Apparat. probably useless -->
|
<!-- potentially for Apparat. probably useless -->
|
||||||
<keepAs3Metadata>Abstract</keepAs3Metadata>
|
<keepAs3Metadata>Abstract</keepAs3Metadata>
|
||||||
</keepAs3Metadatas>
|
</keepAs3Metadatas>
|
||||||
|
<defines>
|
||||||
|
<property>
|
||||||
|
<name>CONFIG::GestouchDebug</name>
|
||||||
|
<value>${project.config.debug}</value>
|
||||||
|
</property>
|
||||||
|
</defines>
|
||||||
</configuration>
|
</configuration>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -84,9 +114,9 @@
|
||||||
<storepass/>
|
<storepass/>
|
||||||
<keepXml>true</keepXml>
|
<keepXml>true</keepXml>
|
||||||
<skipXsl>true</skipXsl>
|
<skipXsl>true</skipXsl>
|
||||||
<windowTitle>Gestouch ${project.version}</windowTitle>
|
<windowTitle>${project.name} ${project.version}</windowTitle>
|
||||||
<mainTitle>Gestouch ${project.version}</mainTitle>
|
<mainTitle>${project.name} ${project.version}</mainTitle>
|
||||||
<footer>Gestouch - http://github.com/fljot/Gestouch/ - Documentation generated at: ${maven.build.timestamp}</footer>
|
<footer>${project.name} - http://github.com/fljot/Gestouch/ - Documentation generated at: ${maven.build.timestamp}</footer>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
|
@ -164,27 +194,25 @@
|
||||||
</reporting>
|
</reporting>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<!--
|
||||||
<groupId>com.adobe.flex</groupId>
|
Note: while this includes the entire flex framework for compilation,
|
||||||
<artifactId>compiler</artifactId>
|
the default for SWCs is external linkage, so nothing from the Flex framework will be added to the final output.
|
||||||
<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>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.adobe.flex.framework</groupId>
|
<!-- non-modified, yet unofficial -->
|
||||||
<artifactId>flex-framework</artifactId>
|
<groupId>com.inreflected.forks.com.gamua</groupId>
|
||||||
<version>${flex.sdk.version}</version>
|
<artifactId>starling-framework</artifactId>
|
||||||
<type>pom</type>
|
<version>1.5.1</version>
|
||||||
<scope>provided</scope>
|
<type>swc</type>
|
||||||
</dependency>
|
<!-- scope is "external" by default because of SWC packaging -->
|
||||||
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>com.gamua</groupId>
|
|
||||||
<artifactId>starling-framework</artifactId>
|
|
||||||
<version>[1.1,]</version>
|
|
||||||
<type>swc</type>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<repositories>
|
<repositories>
|
||||||
|
@ -194,13 +222,13 @@
|
||||||
</repository>
|
</repository>
|
||||||
|
|
||||||
<repository>
|
<repository>
|
||||||
<id>starling-repository</id>
|
<id>bintray-flash-repository</id>
|
||||||
<url>http://repository-trylogic.forge.cloudbees.com/snapshot</url>
|
<url>http://dl.bintray.com/fljot/flash</url>
|
||||||
<releases>
|
<releases>
|
||||||
<enabled>false</enabled>
|
<enabled>true</enabled>
|
||||||
</releases>
|
</releases>
|
||||||
<snapshots>
|
<snapshots>
|
||||||
<enabled>true</enabled>
|
<enabled>false</enabled>
|
||||||
</snapshots>
|
</snapshots>
|
||||||
</repository>
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
|
|
|
@ -45,14 +45,14 @@ package org.gestouch.core
|
||||||
*/
|
*/
|
||||||
public static function get touchesManager():TouchesManager
|
public static function get touchesManager():TouchesManager
|
||||||
{
|
{
|
||||||
return _touchesManager ||= new TouchesManager(gesturesManager);
|
return _touchesManager || (_touchesManager = new TouchesManager(gesturesManager));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static var _gesturesManager:GesturesManager;
|
private static var _gesturesManager:GesturesManager;
|
||||||
public static function get gesturesManager():GesturesManager
|
public static function get gesturesManager():GesturesManager
|
||||||
{
|
{
|
||||||
return _gesturesManager ||= new GesturesManager();
|
return _gesturesManager || (_gesturesManager = new GesturesManager());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -65,6 +65,19 @@ package org.gestouch.core
|
||||||
|
|
||||||
_displayListAdaptersMap[targetClass] = adapter;
|
_displayListAdaptersMap[targetClass] = adapter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks whether touch hit-tester of specified type is registered.
|
||||||
|
* NB! Checks against type (class) without considering subclasses.
|
||||||
|
*
|
||||||
|
* @param type The touch hit-tester class
|
||||||
|
* @return Boolean
|
||||||
|
*/
|
||||||
|
public static function hasTouchHitTesterOfType(type:Class):Boolean
|
||||||
|
{
|
||||||
|
return touchesManager.gestouch_internal::hasTouchHitTesterOfType(type);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public static function addTouchHitTester(hitTester:ITouchHitTester, priority:int = 0):void
|
public static function addTouchHitTester(hitTester:ITouchHitTester, priority:int = 0):void
|
||||||
|
@ -75,7 +88,7 @@ package org.gestouch.core
|
||||||
|
|
||||||
public static function removeTouchHitTester(hitTester:ITouchHitTester):void
|
public static function removeTouchHitTester(hitTester:ITouchHitTester):void
|
||||||
{
|
{
|
||||||
touchesManager.gestouch_internal::removeInputAdapter(hitTester);
|
touchesManager.gestouch_internal::removeTouchHitTester(hitTester);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -48,8 +48,14 @@ package org.gestouch.core
|
||||||
{
|
{
|
||||||
_stage = stage;
|
_stage = stage;
|
||||||
|
|
||||||
Gestouch.inputAdapter ||= new NativeInputAdapter(stage);
|
if (!Gestouch.inputAdapter)
|
||||||
Gestouch.addTouchHitTester(new NativeTouchHitTester(stage));
|
{
|
||||||
|
Gestouch.inputAdapter = new NativeInputAdapter(stage);
|
||||||
|
}
|
||||||
|
if (!Gestouch.hasTouchHitTesterOfType(NativeTouchHitTester))
|
||||||
|
{
|
||||||
|
Gestouch.addTouchHitTester(new NativeTouchHitTester(stage));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -131,7 +131,7 @@ package org.gestouch.core
|
||||||
|
|
||||||
public function toString():String
|
public function toString():String
|
||||||
{
|
{
|
||||||
return "Touch [id: " + id + ", location: " + location + ", ...]";
|
return "Touch [id: " + id + ", location: " + location + ", target: " + target + ", time: " + time + "]";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -5,6 +5,9 @@ package org.gestouch.core
|
||||||
import flash.utils.Dictionary;
|
import flash.utils.Dictionary;
|
||||||
import flash.utils.getTimer;
|
import flash.utils.getTimer;
|
||||||
|
|
||||||
|
CONFIG::GestouchDebug
|
||||||
|
import org.gestouch.utils.log;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Pavel fljot
|
* @author Pavel fljot
|
||||||
|
@ -69,9 +72,23 @@ package org.gestouch.core
|
||||||
// Sort hit testers using their priorities
|
// Sort hit testers using their priorities
|
||||||
_hitTesters.sort(hitTestersSorter);
|
_hitTesters.sort(hitTestersSorter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
gestouch_internal function hasTouchHitTesterOfType(type:Class):Boolean
|
||||||
|
{
|
||||||
|
for each (var hitTester:ITouchHitTester in _hitTesters)
|
||||||
|
{
|
||||||
|
if ((hitTester as Object).constructor == type)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
gestouch_internal function removeInputAdapter(touchHitTester:ITouchHitTester):void
|
gestouch_internal function removeTouchHitTester(touchHitTester:ITouchHitTester):void
|
||||||
{
|
{
|
||||||
if (!touchHitTester)
|
if (!touchHitTester)
|
||||||
{
|
{
|
||||||
|
@ -147,6 +164,11 @@ package org.gestouch.core
|
||||||
|
|
||||||
_touchesMap[touchID] = touch;
|
_touchesMap[touchID] = touch;
|
||||||
_activeTouchesCount++;
|
_activeTouchesCount++;
|
||||||
|
|
||||||
|
CONFIG::GestouchDebug
|
||||||
|
{
|
||||||
|
log("Touch begin:", touch);
|
||||||
|
}
|
||||||
|
|
||||||
_gesturesManager.onTouchBegin(touch);
|
_gesturesManager.onTouchBegin(touch);
|
||||||
|
|
||||||
|
@ -165,6 +187,11 @@ package org.gestouch.core
|
||||||
// NB! It appeared that native TOUCH_MOVE event is dispatched also when
|
// NB! It appeared that native TOUCH_MOVE event is dispatched also when
|
||||||
// the location is the same, but size has changed. We are only interested
|
// the location is the same, but size has changed. We are only interested
|
||||||
// in location at the moment, so we shall ignore irrelevant calls.
|
// in location at the moment, so we shall ignore irrelevant calls.
|
||||||
|
|
||||||
|
CONFIG::GestouchDebug
|
||||||
|
{
|
||||||
|
log("Touch move:", touch);
|
||||||
|
}
|
||||||
|
|
||||||
_gesturesManager.onTouchMove(touch);
|
_gesturesManager.onTouchMove(touch);
|
||||||
}
|
}
|
||||||
|
@ -181,6 +208,11 @@ package org.gestouch.core
|
||||||
|
|
||||||
delete _touchesMap[touchID];
|
delete _touchesMap[touchID];
|
||||||
_activeTouchesCount--;
|
_activeTouchesCount--;
|
||||||
|
|
||||||
|
CONFIG::GestouchDebug
|
||||||
|
{
|
||||||
|
log("Touch end:", touch);
|
||||||
|
}
|
||||||
|
|
||||||
_gesturesManager.onTouchEnd(touch);
|
_gesturesManager.onTouchEnd(touch);
|
||||||
|
|
||||||
|
@ -198,6 +230,11 @@ package org.gestouch.core
|
||||||
|
|
||||||
delete _touchesMap[touchID];
|
delete _touchesMap[touchID];
|
||||||
_activeTouchesCount--;
|
_activeTouchesCount--;
|
||||||
|
|
||||||
|
CONFIG::GestouchDebug
|
||||||
|
{
|
||||||
|
log("Touch begin:", touch);
|
||||||
|
}
|
||||||
|
|
||||||
_gesturesManager.onTouchCancel(touch);
|
_gesturesManager.onTouchCancel(touch);
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,9 @@ package org.gestouch.input
|
||||||
import flash.ui.Multitouch;
|
import flash.ui.Multitouch;
|
||||||
import flash.ui.MultitouchInputMode;
|
import flash.ui.MultitouchInputMode;
|
||||||
|
|
||||||
|
CONFIG::GestouchDebug
|
||||||
|
import org.gestouch.utils.log;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Pavel fljot
|
* @author Pavel fljot
|
||||||
|
@ -67,6 +70,12 @@ package org.gestouch.input
|
||||||
|
|
||||||
public function init():void
|
public function init():void
|
||||||
{
|
{
|
||||||
|
CONFIG::GestouchDebug
|
||||||
|
{
|
||||||
|
log("Multitouch.supportsTouchEvents:", Multitouch.supportsTouchEvents);
|
||||||
|
log("_explicitlyHandleTouchEvents:", _explicitlyHandleTouchEvents);
|
||||||
|
}
|
||||||
|
|
||||||
if (Multitouch.supportsTouchEvents || _explicitlyHandleTouchEvents)
|
if (Multitouch.supportsTouchEvents || _explicitlyHandleTouchEvents)
|
||||||
{
|
{
|
||||||
_stage.addEventListener(TouchEvent.TOUCH_BEGIN, touchBeginHandler, true);
|
_stage.addEventListener(TouchEvent.TOUCH_BEGIN, touchBeginHandler, true);
|
||||||
|
@ -145,7 +154,12 @@ package org.gestouch.input
|
||||||
// (to catch on empty stage) phases only
|
// (to catch on empty stage) phases only
|
||||||
if (event.eventPhase == EventPhase.BUBBLING_PHASE)
|
if (event.eventPhase == EventPhase.BUBBLING_PHASE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
CONFIG::GestouchDebug
|
||||||
|
{
|
||||||
|
log("Touch begin via touch event:", event);
|
||||||
|
}
|
||||||
|
|
||||||
_touchesManager.onTouchBegin(event.touchPointID, event.stageX, event.stageY, event.target as InteractiveObject);
|
_touchesManager.onTouchBegin(event.touchPointID, event.stageX, event.stageY, event.target as InteractiveObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -156,7 +170,12 @@ package org.gestouch.input
|
||||||
// (to catch on empty stage) phases only
|
// (to catch on empty stage) phases only
|
||||||
if (event.eventPhase == EventPhase.BUBBLING_PHASE)
|
if (event.eventPhase == EventPhase.BUBBLING_PHASE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
CONFIG::GestouchDebug
|
||||||
|
{
|
||||||
|
log("Touch move via touch event:", event);
|
||||||
|
}
|
||||||
|
|
||||||
_touchesManager.onTouchMove(event.touchPointID, event.stageX, event.stageY);
|
_touchesManager.onTouchMove(event.touchPointID, event.stageX, event.stageY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -167,6 +186,11 @@ package org.gestouch.input
|
||||||
// (to catch on empty stage) phases only
|
// (to catch on empty stage) phases only
|
||||||
if (event.eventPhase == EventPhase.BUBBLING_PHASE)
|
if (event.eventPhase == EventPhase.BUBBLING_PHASE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
CONFIG::GestouchDebug
|
||||||
|
{
|
||||||
|
log("Touch end/cancel via touch event:", event);
|
||||||
|
}
|
||||||
|
|
||||||
if (event.hasOwnProperty("isTouchPointCanceled") && event["isTouchPointCanceled"])
|
if (event.hasOwnProperty("isTouchPointCanceled") && event["isTouchPointCanceled"])
|
||||||
{
|
{
|
||||||
|
@ -185,6 +209,11 @@ package org.gestouch.input
|
||||||
// (to catch on empty stage) phases only
|
// (to catch on empty stage) phases only
|
||||||
if (event.eventPhase == EventPhase.BUBBLING_PHASE)
|
if (event.eventPhase == EventPhase.BUBBLING_PHASE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
CONFIG::GestouchDebug
|
||||||
|
{
|
||||||
|
log("Touch begin via mouse event:", event);
|
||||||
|
}
|
||||||
|
|
||||||
const touchAccepted:Boolean = _touchesManager.onTouchBegin(MOUSE_TOUCH_POINT_ID, event.stageX, event.stageY, event.target as InteractiveObject);
|
const touchAccepted:Boolean = _touchesManager.onTouchBegin(MOUSE_TOUCH_POINT_ID, event.stageX, event.stageY, event.target as InteractiveObject);
|
||||||
|
|
||||||
|
@ -201,7 +230,12 @@ package org.gestouch.input
|
||||||
// (to catch on empty stage) phases only
|
// (to catch on empty stage) phases only
|
||||||
if (event.eventPhase == EventPhase.BUBBLING_PHASE)
|
if (event.eventPhase == EventPhase.BUBBLING_PHASE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
CONFIG::GestouchDebug
|
||||||
|
{
|
||||||
|
log("Touch move via mouse event:", event);
|
||||||
|
}
|
||||||
|
|
||||||
_touchesManager.onTouchMove(MOUSE_TOUCH_POINT_ID, event.stageX, event.stageY);
|
_touchesManager.onTouchMove(MOUSE_TOUCH_POINT_ID, event.stageX, event.stageY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -211,7 +245,12 @@ package org.gestouch.input
|
||||||
// We listen in EventPhase.CAPTURE_PHASE or EventPhase.AT_TARGET
|
// We listen in EventPhase.CAPTURE_PHASE or EventPhase.AT_TARGET
|
||||||
// (to catch on empty stage) phases only
|
// (to catch on empty stage) phases only
|
||||||
if (event.eventPhase == EventPhase.BUBBLING_PHASE)
|
if (event.eventPhase == EventPhase.BUBBLING_PHASE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
CONFIG::GestouchDebug
|
||||||
|
{
|
||||||
|
log("Touch end via mouse event:", event);
|
||||||
|
}
|
||||||
|
|
||||||
_touchesManager.onTouchEnd(MOUSE_TOUCH_POINT_ID, event.stageX, event.stageY);
|
_touchesManager.onTouchEnd(MOUSE_TOUCH_POINT_ID, event.stageX, event.stageY);
|
||||||
|
|
||||||
|
|
15
src/org/gestouch/utils/log.as
Normal file
15
src/org/gestouch/utils/log.as
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
package org.gestouch.utils
|
||||||
|
{
|
||||||
|
public function log(...args):void
|
||||||
|
{
|
||||||
|
// You can switch to custom logging if you really need it for debugging
|
||||||
|
|
||||||
|
var tmp:Array = new Error().getStackTrace().split("\n");
|
||||||
|
tmp = tmp[2].split(" ");
|
||||||
|
tmp = tmp[1].split("[");
|
||||||
|
// tmp[0] is a string "class/method()"
|
||||||
|
|
||||||
|
args.unshift("[Gestouch]", tmp[0]);
|
||||||
|
trace.apply(null, args);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1 +1 @@
|
||||||
project.version = 0.4.6
|
project.version = 0.4.8-SNAPSHOT
|
||||||
|
|
Reference in a new issue