X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=docs%2Fcontent%2Fprogramming-guide%2Fevent-system.h;h=1498ed078e543382727f759a7d6757f105ab1d13;hb=763c96a171fb79c5ae983792434537c70ac231fb;hp=f3609473225af59c39bf48ab745d32658ab514fb;hpb=9f9bd6287b64fab61422e8b4a0d61a379c47176c;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git
diff --git a/docs/content/programming-guide/event-system.h b/docs/content/programming-guide/event-system.h
index f360947..1498ed0 100644
--- a/docs/content/programming-guide/event-system.h
+++ b/docs/content/programming-guide/event-system.h
@@ -2,25 +2,27 @@
DALi emits several signals to an application to inform it of user actions.
-
Touch Events
+Touch
-An application can be notified when a user interacts with the touch screen on the device by connecting to the touch signal provided by Dali::Actor. This signal will be emitted by DALi whenever the touch occurs within the connected actor's bounds.
+An application can be notified when a user interacts with the touch screen on the device by connecting to the touch signal provided by Dali::Actor.
+This signal will be emitted by DALi whenever the touch occurs within the connected actor's bounds.
-Each point on the screen that is currently being touched or where touch has stopped is represented by a Dali::TouchPoint. This object stores information about the state of the touch point (down, up, motion etc.) and the co-ordinates of the touch.
+Each point on the screen that is currently being touched or where touch has stopped is represented by a point.
+Dali::TouchData stores information about the state of each point (down, up, motion etc.) and the co-ordinates of the touch.
-A collection of touch points at a specific moment in time is collated into a Dali::TouchEvent. When a multi-touch event occurs, each touch point represents the points that are currently being touched or the points where touch has stopped.
+When a multi-touch event occurs, each point represents the points that are currently being touched or the points where touch has stopped.
The following example shows how a connection to a touch event signal can be established:
@code
-bool OnTouch(Actor actor, const TouchEvent& touch)
+bool OnTouch( Dali::Actor actor, const Dali::TouchData& touch )
{
bool handled = false;
- switch(touch.GetPointCount())
+ switch( touch.GetPointCount() )
{
case 1: // Single touch
- if (touch.GetPoint(0).GetState == TouchPoint::Down)
+ if ( touch.GetState( 0 ) == Dali::PointState::DOWN )
{
// Do action when first touches the touch screen.
...
@@ -39,41 +41,45 @@ bool OnTouch(Actor actor, const TouchEvent& touch)
}
// Elsewhere
-Actor actor = Actor::New();
-actor.SignalTouch().Connect(&OnTouch);
+Dali::Actor actor = Actor::New();
+actor.TouchSignal().Connect( &OnTouch );
@endcode
The primary touch point is the first point that the user touches.
-The touch event is first emitted to the actor which is hit by the primary touch point. If this hit actor does not handle the event, then the event is offered to the hit actor's parent. Again, if the parent does not handle this event, it is then offered to its parent and so on until the stage is reached or the event is consumed.
+The touch signal is first emitted to the actor which is hit by the primary touch point.
+If this hit actor does not handle (consume) the event, then the event is offered to the hit actor's parent.
+Again, if the parent does not handle this event, it is then offered to its parent and so on until the stage is reached or the event is consumed.
-If a parent and child both connect to the Touch signal, then the touch event is first offered to the child. If it is consumed by the child, then the parent will not be informed.
+If the TouchSignal of both a parent and child are connected to, then the touch event is first offered to the child's listener.
+If it is consumed by the child's listener, then the parent will not be informed.
Gestures
-A Dali::GestureDetector analyses a stream of touch events and attempts to determine the intention of the user. An actor is attached to a gesture detector and if the detector recognises a pattern, it will emit a detected signal to the application.
+A Dali::GestureDetector analyses a stream of touch input and attempts to determine the intention of the user.
+An actor is attached to a gesture detector and if the detector recognises a pattern, it will emit a detected signal to the application.
-The following gesture detectors are currently supported in Dali:
+The following gesture detectors are currently supported in DALi:
+- Dali::LongPressGestureDetector - When the user presses and holds a particular point on the screen for a specified length of time.
- Dali::PinchGestureDetector - When the user moves two fingers towards or away from each other.
- Dali::PanGestureDetector - When the user moves one or more fingers in the same direction.
+- Dali::TapGestureDetector - When the user taps the screen.
The example below shows how an application can be notified of a pinch gesture:
@code
-void OnPinch(Actor actor, PinchGesture pinch)
+void OnPinch( Dali::Actor actor, const Dali::PinchGesture& pinch )
{
// Scale your actor according to the pinch scale
- Vector3 newSize = actor.GetCurrentSize() * pinch.GetScale();
- actor.SetSize(newSize);
+ Vector3 newSize = actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ) * pinch.scale;
+ actor.SetProperty( Actor::Property::SIZE, newSize );
}
// Elsewhere
-PinchDetector detector = PinchDetector::New();
-detector.Attach(myActor);
-detector.SignalDetected().Connect(&OnPinch);
+Dali::PinchGestureDetector detector = Dali::PinchDetector::New();
+detector.Attach( myActor );
+detector.DetectedSignal().Connect( &OnPinch );
@endcode
- */
-
-// @TODO: Add "Key Events" section
+*/