END_TEST;
}
-int UtcDaliControlImplOnStyleChangeP(void)
+int UtcDaliControlImplOnStyleChangeN(void)
{
ToolkitTestApplication application;
- DummyControl dummy = DummyControl::New( true );
+ Control dummy = Control::New();
Toolkit::Internal::Control& controlImpl = Toolkit::Internal::GetImplementation( dummy );
- Dali::Toolkit::StyleManager styleManager;
- controlImpl.OnStyleChange( styleManager, StyleChange::THEME_CHANGE );
-
- // unfortunately OnStyleChange does not return anything
- DALI_TEST_CHECK( true );
+ // test that style manager is being used, passing an empty handle throws exception
+ try
+ {
+ Dali::Toolkit::StyleManager styleManager;
+ controlImpl.OnStyleChange( styleManager, StyleChange::THEME_CHANGE );
+ tet_result(TET_FAIL);
+ }
+ catch (DaliException &exception)
+ {
+ tet_result(TET_PASS);
+ }
END_TEST;
}
int UtcDaliControlImplOnAccessibilityPanP(void)
{
ToolkitTestApplication application;
- DummyControl dummy = DummyControl::New( true );
- DummyControlImplOverride& dummyImpl = static_cast<DummyControlImplOverride&>(dummy.GetImplementation());
+ Control dummy = Control::New();
+ Toolkit::Internal::Control& controlImpl = Toolkit::Internal::GetImplementation( dummy );
+
PanGesture pan;
- DALI_TEST_EQUALS( false, dummyImpl.OnAccessibilityPan( pan ), TEST_LOCATION );
+ DALI_TEST_EQUALS( false, controlImpl.OnAccessibilityPan( pan ), TEST_LOCATION );
END_TEST;
}
int UtcDaliControlImplOnAccessibilityTouchP(void)
{
ToolkitTestApplication application;
- DummyControl dummy = DummyControl::New( true );
- DummyControlImplOverride& dummyImpl = static_cast<DummyControlImplOverride&>(dummy.GetImplementation());
+ Control dummy = Control::New();
+ Toolkit::Internal::Control& controlImpl = Toolkit::Internal::GetImplementation( dummy );
TouchEvent touch;
- DALI_TEST_EQUALS( false, dummyImpl.OnAccessibilityTouch( touch ), TEST_LOCATION );
+ DALI_TEST_EQUALS( false, controlImpl.OnAccessibilityTouch( touch ), TEST_LOCATION );
END_TEST;
}
int UtcDaliControlImplGetNextKeyboardFocusableActorP(void)
{
ToolkitTestApplication application;
- DummyControl dummy = DummyControl::New( true );
- DummyControlImplOverride& dummyImpl = static_cast<DummyControlImplOverride&>(dummy.GetImplementation());
+ Control dummy = Control::New();
+ Toolkit::Internal::Control& controlImpl = Toolkit::Internal::GetImplementation( dummy );
Actor currentFocusedActor;
- Actor result = dummyImpl.GetNextKeyboardFocusableActor( currentFocusedActor, Control::Left, false );
+ Actor result = controlImpl.GetNextKeyboardFocusableActor( currentFocusedActor, Control::Left, false );
DALI_TEST_EQUALS( result, currentFocusedActor, TEST_LOCATION );
# 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
--- /dev/null
+.image
+{
+ text-align: left;
+ margin-left: 50px;
+}
{
}
+Magnifier Magnifier::DownCast( BaseHandle handle )
+{
+ return Control::DownCast<Magnifier, Internal::Magnifier>(handle);
+}
+
void Magnifier::SetSourceActor(Actor actor)
{
GetImpl(*this).SetSourceActor( actor );
#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>
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 );
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;
}
}
+ 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
}
}
+ 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,
if( control )
{
// if cast succeeds there is an implementation so no need to check
- Internal::GetImplementation( control ).OnAccessibilityActivated();
+ ret = Internal::GetImplementation( control ).OnAccessibilityActivated();
}
}
controlImpl.EnableGestureDetection( Gesture::LongPress );
controlImpl.GetLongPressGestureDetector().DetectedSignal().Connect( tracker, functor );
}
- else
- {
- // signalName does not match any signal
- connected = false;
- }
}
return connected;
}
OnAccessibilityActivated();
}
-void Control::OnAccessibilityActivated()
+bool Control::OnAccessibilityActivated()
{
+ return false; // Accessibility activation is not handled by default
}
bool Control::OnAccessibilityPan(PanGesture gesture)
* @brief This method is called when the control is accessibility activated.
*
* Derived classes should override this to perform custom accessibility activation.
+ * @return true if this control can perform accessibility activation.
*/
- virtual void OnAccessibilityActivated();
+ virtual bool OnAccessibilityActivated();
/**
* @brief This method should be overridden by deriving classes when they wish to respond the accessibility
<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
+ [Resource Tracking](@ref resourcetracking)
+ Logging
+ GUI Builder
- + Stagehand
+ + [Stagehand - DALi Visual Debugger](@ref stagehand)
### Viewing Modes
+ [Overview](@ref viewing-modes)
--- /dev/null
+/**
+ *
+# 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