Merge "Fixed Control and Magnifier API" into tizen
authorKimmo Hoikka <kimmo.hoikka@samsung.com>
Thu, 28 May 2015 16:27:00 +0000 (09:27 -0700)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Thu, 28 May 2015 16:27:00 +0000 (09:27 -0700)
22 files changed:
build/tizen/docs/dali.doxy.in
build/tizen/docs/dali_doxygen.css [new file with mode: 0644]
dali-toolkit/internal/text/decorator/text-decorator.cpp
dali-toolkit/internal/text/text-controller-impl.cpp
docs/api_footer.html
docs/content/images/stage-hand/blocks.png [new file with mode: 0644]
docs/content/images/stage-hand/inner-workings.png [new file with mode: 0644]
docs/content/images/stage-hand/netstat.png [new file with mode: 0644]
docs/content/images/stage-hand/stagehand-logo.png [new file with mode: 0644]
docs/content/images/stage-hand/stagehand-mainscreen.png [new file with mode: 0644]
docs/content/images/stage-hand/stagehand-modify.png [new file with mode: 0644]
docs/content/images/stage-hand/stagehand-netcat.png [new file with mode: 0644]
docs/content/images/stage-hand/stagehand-performance.png [new file with mode: 0644]
docs/content/images/stage-hand/stagehand-refesh.png [new file with mode: 0644]
docs/content/images/stage-hand/stagehand-save.png [new file with mode: 0644]
docs/content/images/stage-hand/stagehand-screenshot.png [new file with mode: 0644]
docs/content/images/stage-hand/stagehand-settings.png [new file with mode: 0644]
docs/content/images/stage-hand/stagehand-tizen-connection.png [new file with mode: 0644]
docs/content/images/stage-hand/stagehand-ubuntu-connection.png [new file with mode: 0644]
docs/content/images/stage-hand/stagehand-zoom.png [new file with mode: 0644]
docs/content/main.md
docs/content/shared-javascript-and-cpp-documentation/stage-hand.md [new file with mode: 0644]

index bbb08c2..d7c78f9 100644 (file)
@@ -1120,7 +1120,7 @@ HTML_STYLESHEET        =
 # see the documentation.
 # This tag requires that the tag GENERATE_HTML is set to YES.
 
-HTML_EXTRA_STYLESHEET  =
+HTML_EXTRA_STYLESHEET  = dali_doxygen.css
 
 # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
 # other source files which should be copied to the HTML output directory. Note
diff --git a/build/tizen/docs/dali_doxygen.css b/build/tizen/docs/dali_doxygen.css
new file mode 100644 (file)
index 0000000..9bc0ef4
--- /dev/null
@@ -0,0 +1,5 @@
+.image
+{
+   text-align: left;
+   margin-left: 50px;
+}
index f529f70..e92866b 100644 (file)
@@ -30,6 +30,7 @@
 #include <dali/public-api/common/stage.h>
 #include <dali/public-api/events/tap-gesture.h>
 #include <dali/public-api/events/tap-gesture-detector.h>
+#include <dali/public-api/events/touch-event.h>
 #include <dali/public-api/events/pan-gesture.h>
 #include <dali/public-api/events/pan-gesture-detector.h>
 #include <dali/devel-api/geometry/mesh.h>
@@ -530,6 +531,7 @@ struct Decorator::Impl : public ConnectionTracker
       grabHandle.grabArea.SetSizeModeFactor( DEFAULT_GRAB_HANDLE_RELATIVE_SIZE );
       grabHandle.actor.Add( grabHandle.grabArea );
 
+      grabHandle.grabArea.TouchedSignal().Connect( this, &Decorator::Impl::OnGrabHandleTouched );
       mTapDetector.Attach( grabHandle.grabArea );
       mPanGestureDetector.Attach( grabHandle.grabArea );
 
@@ -733,10 +735,6 @@ struct Decorator::Impl : public ConnectionTracker
     if( Gesture::Started == gesture.state )
     {
       handle.grabDisplacementX = handle.grabDisplacementY = 0;
-      if( mHandleImages[type][HANDLE_IMAGE_PRESSED] )
-      {
-        handle.actor.SetImage( mHandleImages[type][HANDLE_IMAGE_PRESSED] );
-      }
     }
 
     handle.grabDisplacementX += gesture.displacement.x;
@@ -804,16 +802,42 @@ struct Decorator::Impl : public ConnectionTracker
     }
   }
 
+  bool OnGrabHandleTouched( Actor actor, const TouchEvent& event )
+  {
+    // Switch between pressed/release grab-handle images
+    if( event.GetPointCount() > 0 &&
+        mHandle[GRAB_HANDLE].actor )
+    {
+      const TouchPoint& point = event.GetPoint(0);
+
+      if( TouchPoint::Down == point.state &&
+          mHandleImages[GRAB_HANDLE][HANDLE_IMAGE_PRESSED] )
+      {
+        mHandle[GRAB_HANDLE].actor.SetImage( mHandleImages[GRAB_HANDLE][HANDLE_IMAGE_PRESSED] );
+      }
+      else if( TouchPoint::Up == point.state &&
+               mHandleImages[GRAB_HANDLE][HANDLE_IMAGE_RELEASED] )
+      {
+        mHandle[GRAB_HANDLE].actor.SetImage( mHandleImages[GRAB_HANDLE][HANDLE_IMAGE_RELEASED] );
+      }
+    }
+
+    // Consume to avoid pop-ups accidentally closing, when handle is outside of pop-up area
+    return true;
+  }
+
   bool OnHandleOneTouched( Actor actor, const TouchEvent& touch )
   {
     // TODO
-    return false;
+    // Consume to avoid pop-ups accidentally closing, when handle is outside of pop-up area
+    return true;
   }
 
   bool OnHandleTwoTouched( Actor actor, const TouchEvent& touch )
   {
     // TODO
-    return false;
+    // Consume to avoid pop-ups accidentally closing, when handle is outside of pop-up area
+    return true;
   }
 
   // Popup
index ec74f67..35c43b0 100644 (file)
@@ -1089,6 +1089,25 @@ void Controller::Impl::UpdateCursorPosition()
       }
     }
 
+    switch( mLayoutEngine.GetVerticalAlignment() )
+    {
+      case LayoutEngine::VERTICAL_ALIGN_TOP:
+      {
+        cursorPosition.y = 0.f;
+        break;
+      }
+      case LayoutEngine::VERTICAL_ALIGN_CENTER:
+      {
+        cursorPosition.y = floorf( 0.5f * ( mControlSize.height - lineHeight ) );
+        break;
+      }
+      case LayoutEngine::VERTICAL_ALIGN_BOTTOM:
+      {
+        cursorPosition.y = mControlSize.height - lineHeight;
+        break;
+      }
+    }
+
     mEventData->mDecorator->SetPosition( PRIMARY_CURSOR,
                                          cursorPosition.x,
                                          cursorPosition.y,
index ce7bd16..0179c50 100644 (file)
@@ -1,2 +1,2 @@
 <hr>\r
-<a href="http://www.samsung.com">Copyright (c) 2008-2014 Samsung Electronics, Co., Ltd.</a></body></html>\r
+<a href="http://www.samsung.com">Copyright (c) 2008-2015 Samsung Electronics, Co., Ltd.</a></body></html>\r
diff --git a/docs/content/images/stage-hand/blocks.png b/docs/content/images/stage-hand/blocks.png
new file mode 100644 (file)
index 0000000..fc5a28d
Binary files /dev/null and b/docs/content/images/stage-hand/blocks.png differ
diff --git a/docs/content/images/stage-hand/inner-workings.png b/docs/content/images/stage-hand/inner-workings.png
new file mode 100644 (file)
index 0000000..f77f16f
Binary files /dev/null and b/docs/content/images/stage-hand/inner-workings.png differ
diff --git a/docs/content/images/stage-hand/netstat.png b/docs/content/images/stage-hand/netstat.png
new file mode 100644 (file)
index 0000000..905f2c1
Binary files /dev/null and b/docs/content/images/stage-hand/netstat.png differ
diff --git a/docs/content/images/stage-hand/stagehand-logo.png b/docs/content/images/stage-hand/stagehand-logo.png
new file mode 100644 (file)
index 0000000..bdd1104
Binary files /dev/null and b/docs/content/images/stage-hand/stagehand-logo.png differ
diff --git a/docs/content/images/stage-hand/stagehand-mainscreen.png b/docs/content/images/stage-hand/stagehand-mainscreen.png
new file mode 100644 (file)
index 0000000..64ac3ea
Binary files /dev/null and b/docs/content/images/stage-hand/stagehand-mainscreen.png differ
diff --git a/docs/content/images/stage-hand/stagehand-modify.png b/docs/content/images/stage-hand/stagehand-modify.png
new file mode 100644 (file)
index 0000000..f1c2b48
Binary files /dev/null and b/docs/content/images/stage-hand/stagehand-modify.png differ
diff --git a/docs/content/images/stage-hand/stagehand-netcat.png b/docs/content/images/stage-hand/stagehand-netcat.png
new file mode 100644 (file)
index 0000000..c6d8cb8
Binary files /dev/null and b/docs/content/images/stage-hand/stagehand-netcat.png differ
diff --git a/docs/content/images/stage-hand/stagehand-performance.png b/docs/content/images/stage-hand/stagehand-performance.png
new file mode 100644 (file)
index 0000000..4f1d518
Binary files /dev/null and b/docs/content/images/stage-hand/stagehand-performance.png differ
diff --git a/docs/content/images/stage-hand/stagehand-refesh.png b/docs/content/images/stage-hand/stagehand-refesh.png
new file mode 100644 (file)
index 0000000..d7f77c4
Binary files /dev/null and b/docs/content/images/stage-hand/stagehand-refesh.png differ
diff --git a/docs/content/images/stage-hand/stagehand-save.png b/docs/content/images/stage-hand/stagehand-save.png
new file mode 100644 (file)
index 0000000..326fc0c
Binary files /dev/null and b/docs/content/images/stage-hand/stagehand-save.png differ
diff --git a/docs/content/images/stage-hand/stagehand-screenshot.png b/docs/content/images/stage-hand/stagehand-screenshot.png
new file mode 100644 (file)
index 0000000..bedbeac
Binary files /dev/null and b/docs/content/images/stage-hand/stagehand-screenshot.png differ
diff --git a/docs/content/images/stage-hand/stagehand-settings.png b/docs/content/images/stage-hand/stagehand-settings.png
new file mode 100644 (file)
index 0000000..f3b434d
Binary files /dev/null and b/docs/content/images/stage-hand/stagehand-settings.png differ
diff --git a/docs/content/images/stage-hand/stagehand-tizen-connection.png b/docs/content/images/stage-hand/stagehand-tizen-connection.png
new file mode 100644 (file)
index 0000000..fa4243a
Binary files /dev/null and b/docs/content/images/stage-hand/stagehand-tizen-connection.png differ
diff --git a/docs/content/images/stage-hand/stagehand-ubuntu-connection.png b/docs/content/images/stage-hand/stagehand-ubuntu-connection.png
new file mode 100644 (file)
index 0000000..cf824b9
Binary files /dev/null and b/docs/content/images/stage-hand/stagehand-ubuntu-connection.png differ
diff --git a/docs/content/images/stage-hand/stagehand-zoom.png b/docs/content/images/stage-hand/stagehand-zoom.png
new file mode 100644 (file)
index 0000000..e509acd
Binary files /dev/null and b/docs/content/images/stage-hand/stagehand-zoom.png differ
index 1289468..92ed866 100644 (file)
@@ -79,7 +79,7 @@
  + [Resource Tracking](@ref resourcetracking)
  + Logging
  + GUI Builder
- + Stagehand
+ + [Stagehand - DALi Visual Debugger](@ref stagehand)
 
 ### Viewing Modes
  + [Overview](@ref viewing-modes)
diff --git a/docs/content/shared-javascript-and-cpp-documentation/stage-hand.md b/docs/content/shared-javascript-and-cpp-documentation/stage-hand.md
new file mode 100644 (file)
index 0000000..ea16ab6
--- /dev/null
@@ -0,0 +1,167 @@
+/**
+ *
+# Stagehand Visual Debugger for DALi {#stagehand}
+
+![ ](../assets/img/stage-hand/blocks.png)
+![ ](blocks.png)
+
+## Introduction
+
+Stagehand  is an open source tool that allows a developer to:
+
+- Connect to a DALi application running on:
+ - Tizen
+ - Ubuntu
+- View a wireframe of the current scene on top of a screen shot
+- Modify properties in the scene
+- Monitor performance of the application
+
+  
+Full source code is available from http://github.com/gamoeba/stagehand.git
+
+Stagehand is released under the Apache 2 licence.
+
+## Installing StageHand on Ubuntu
+
+http://www.gamoeba.com/stagehand/
+
+Install both files on the website. Start with the QT dependencies first.
+
+
+## How it works
+
+Stagehand connects to DALi via the network using a TCP/IP connection.
+  
+![ ](../assets/img/stage-hand/inner-workings.png)
+![ ](inner-workings.png)
+
+## Network setup
+
+To enable network control on DALi, an environment variable must be set:
+
+~~~
+$ export DALI_NETWORK_CONTROL=1 to enable
+~~~
+Or run the application with the variable set.
+~~~
+$ DALI_NETWORK_CONTROL=1 /usr/apps/com.samsung.dali-demo/bin/dali-demo
+~~~
+
+Check what network port the application is using. It will be from port 3031 onwards.
+  
+If running DALi on desktop, just type netstat -tlnp. On Tizen log into the device and run netstat. E.g.
+~~~
+$ su
+
+$ netstat -tlpn
+~~~
+
+![ ](../assets/img/stage-hand/netstat.png)
+![ ](netstat.png)
+
+
+## Connecting with Stagehand
+
+Click the settings icons below
+  
+![ ](../assets/img/stage-hand/stagehand-settings.png)
+![ ](stagehand-settings.png)
+
+
+### Connecting to DALi running on Tizen
+
+Here we are connecting to a device running SDB
+  
+![ ](../assets/img/stage-hand/stagehand-tizen-connection.png)
+![ ](stagehand-tizen-connection.png)
+
+### Connect to DALi running on Desktop ( Ubuntu )
+  
+![ ](../assets/img/stage-hand/stagehand-ubuntu-connection.png)
+![ ](stagehand-ubuntu-connection.png)
+
+## Using Stagehand
+
+Click Refresh to load the current scene from the device.
+  
+![ ](../assets/img/stage-hand/stagehand-refesh.png)
+![ ](stagehand-refesh.png)
+
+Click screen shot to get overlay current screen
+  
+![ ](../assets/img/stage-hand/stagehand-screenshot.png)
+![ ](stagehand-screenshot.png)
+
+To cycle through the actor hierachy, keep clicking the same spot. Alternatively, select using the actor tree.
+
+  
+![ ](../assets/img/stage-hand/stagehand-mainscreen.png)
+![ ](stagehand-mainscreen.png)
+
+
+Click the save icon to save the scene
+  
+![ ](../assets/img/stage-hand/stagehand-save.png)
+![ ](stagehand-save.png)
+
+Zooming in and out
+  
+![ ](../assets/img/stage-hand/stagehand-zoom.png)
+![ ](stagehand-zoom.png)
+
+Modifying the scene
+  
+![ ](../assets/img/stage-hand/stagehand-modify.png)
+![ ](stagehand-modify.png)
+
+## Performance monitoring
+
+To enable performance option. Edit
+  
+~/.stagehand/stagehand.ini
+  
+Set perfmode=on
+
+Restart application. Click performance
+  
+![ ](../assets/img/stage-hand/stagehand-performance.png)
+![ ](stagehand-performance.png)
+
+## Trouble shooting
+
+You can manually check the network is enabled on the DALi application using netcat.
+
+In the example below we are connecting to a Tizen device using SDB port forwarding.
+  
+After running nc localhost 3031 we type help
+  
+![ ](../assets/img/stage-hand/stagehand-netcat.png)
+![ ](stagehand-netcat.png)
+
+
+## Tizen smack
+
+
+If you can't connect to a DALi application, but using netstat you can see a port is open.
+  
+Check the smack log for errors:
+~~~
+tail -f -n 10 /var/log/audit/audit.log | grep 'internet'
+~~~
+
+If it is being blocked, you temporarily enable it by editing:
+  
+~~~
+ /etc/smack/accesses2.d/ your-app-name
+
+then add: system::user_internet …..app-name rw
+~~~
+## Tizen Emulator connection problem
+
+
+Make sure  DALi application is run using launch_app:
+~~~
+launch_app [APP_ID] __AUL_SDK__ DEBUG __DLP_DEBUG_ARG__ :10003
+~~~
+
+@class _Guide_Visual_Debugger
\ No newline at end of file