#include <dali-toolkit/public-api/visuals/visual-properties.h>
#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
#include <dali/integration-api/debug.h>
+#include <dali/devel-api/events/touch-event-devel.h>
#include <string.h>
#include <Ecore_Input.h>
#include <widget_service.h>
int ret = widget_instance_pause( mInstanceId.c_str() );
if( ret < 0 )
{
- DALI_LOG_INFO( gWidgetViewLogging, Debug::Verbose, "WidgetView::PauseWidget: Fail to pause widget(%s, %s) [%d]\n", mWidgetId.c_str(), mInstanceId.c_str(), ret );
+ DALI_LOG_ERROR( "WidgetView::PauseWidget: Fail to pause widget(%s, %s) [%d]\n", mWidgetId.c_str(), mInstanceId.c_str(), ret );
return false;
}
int ret = widget_instance_resume( mInstanceId.c_str() );
if( ret < 0 )
{
- DALI_LOG_INFO( gWidgetViewLogging, Debug::Verbose, "WidgetView::ResumeWidget: Fail to resume widget(%s, %s) [%d]\n", mWidgetId.c_str(), mInstanceId.c_str(), ret );
+ DALI_LOG_ERROR( "WidgetView::ResumeWidget: Fail to resume widget(%s, %s) [%d]\n", mWidgetId.c_str(), mInstanceId.c_str(), ret );
return false;
}
if( visible )
{
- mLoadingText.SetProperty( Toolkit::TextLabel::Property::TEXT,
+ mLoadingText.SetProperty( Toolkit::TextLabel::Property::TEXT,
( mLoadingTextString.empty() )? GET_LOCALE_TEXT( "IDS_ST_POP_LOADING_ING" ) : mLoadingTextString );
}
mLoadingText.SetVisible( visible );
bool WidgetView::OnTouch( Dali::Actor actor, const Dali::TouchData& event )
{
- tizen_remote_surface_event_type type = TIZEN_REMOTE_SURFACE_EVENT_TYPE_NONE;
-
if( event.GetPointCount() == 0 )
{
return false;
}
- switch( event.GetState( 0 ) )
- {
- case Dali::PointState::UP:
- {
- type = TIZEN_REMOTE_SURFACE_EVENT_TYPE_MOUSE_UP;
-
- if( mRetryState )
- {
- ActivateFaultedWidget();
- return false;
- }
-
- break;
- }
- case Dali::PointState::DOWN:
- {
- type = TIZEN_REMOTE_SURFACE_EVENT_TYPE_MOUSE_DOWN;
- break;
- }
- case Dali::PointState::MOTION:
- {
- type = TIZEN_REMOTE_SURFACE_EVENT_TYPE_MOUSE_MOVE;
- break;
- }
- default:
- {
- return false;
- }
- }
-
if( mRemoteSurface == NULL )
{
return false;
}
- int button = 1;
-
- if( type == TIZEN_REMOTE_SURFACE_EVENT_TYPE_MOUSE_MOVE )
+ DevelDevice::Class::Type deviceType = DevelTouchData::GetDeviceClass( event, 0 );
+ if( deviceType == DevelDevice::Class::MOUSE )
{
- button = 0 ;
+ return MouseEvent( event );
+ }
+ else if( deviceType == DevelDevice::Class::TOUCH )
+ {
+ return TouchEvent( event );
}
- Vector2 localPos = event.GetLocalPosition( 0 );
-
- tizen_remote_surface_transfer_mouse_event( mRemoteSurface,
- type,
- 0,
- button,
- (int)localPos.x,
- (int)localPos.y,
- wl_fixed_from_double( event.GetEllipseRadius( 0 ).x ),
- wl_fixed_from_double( event.GetEllipseRadius( 0 ).y ),
- wl_fixed_from_double( event.GetPressure( 0 ) ),
- wl_fixed_from_double( event.GetAngle( 0 ).degree ),
- TIZEN_INPUT_DEVICE_CLAS_TOUCHSCREEN,
- TIZEN_INPUT_DEVICE_SUBCLAS_NONE,
- "",
- event.GetTime()
- );
- return true;
+ return false;
}
bool WidgetView::OnWheelEvent( Dali::Actor actor, const Dali::WheelEvent& event )
Property::Value* textColor = map.Find( TEXT_COLOR );
Vector4 color;
-
if( textColor && textColor->Get( color ) )
{
mRetryText.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, color );
return (pixelSize * 72.0f) / meanDpi;
}
+void WidgetView::MouseIn( const Dali::TouchData& event )
+{
+ Vector2 localPos = event.GetLocalPosition( 0 );
+
+ tizen_remote_surface_transfer_mouse_event( mRemoteSurface,
+ TIZEN_REMOTE_SURFACE_EVENT_TYPE_MOUSE_IN,
+ 0,
+ 0,
+ (int)localPos.x,
+ (int)localPos.y,
+ 0,
+ 0,
+ 0,
+ 0,
+ TIZEN_INPUT_DEVICE_CLAS_MOUSE,
+ DevelTouchData::GetDeviceSubclass( event, 0 ),
+ "",
+ event.GetTime()
+ );
+}
+
+void WidgetView::MouseOut( const Dali::TouchData& event )
+{
+ tizen_remote_surface_transfer_mouse_event( mRemoteSurface,
+ TIZEN_REMOTE_SURFACE_EVENT_TYPE_MOUSE_OUT,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ TIZEN_INPUT_DEVICE_CLAS_MOUSE,
+ DevelTouchData::GetDeviceSubclass( event, 0 ),
+ "",
+ event.GetTime()
+ );
+}
+
+bool WidgetView::MouseEvent( const Dali::TouchData& event )
+{
+ tizen_remote_surface_event_type type = TIZEN_REMOTE_SURFACE_EVENT_TYPE_NONE;
+ int button = 1;
+
+ switch( event.GetState( 0 ) )
+ {
+ case Dali::PointState::UP:
+ {
+ type = TIZEN_REMOTE_SURFACE_EVENT_TYPE_MOUSE_UP;
+
+ if( mRetryState )
+ {
+ ActivateFaultedWidget();
+ return false;
+ }
+
+ break;
+ }
+ case Dali::PointState::DOWN:
+ {
+ type = TIZEN_REMOTE_SURFACE_EVENT_TYPE_MOUSE_DOWN;
+ MouseIn( event );
+
+ break;
+ }
+ case Dali::PointState::MOTION:
+ {
+ type = TIZEN_REMOTE_SURFACE_EVENT_TYPE_MOUSE_MOVE;
+ button = 0 ;
+ break;
+ }
+ default:
+ {
+ return false;
+ }
+ }
+
+ Vector2 localPos = event.GetLocalPosition( 0 );
+
+ tizen_remote_surface_transfer_mouse_event( mRemoteSurface,
+ type,
+ 0,
+ button,
+ (int)localPos.x,
+ (int)localPos.y,
+ wl_fixed_from_double( event.GetEllipseRadius( 0 ).x ),
+ wl_fixed_from_double( event.GetEllipseRadius( 0 ).y ),
+ wl_fixed_from_double( event.GetPressure( 0 ) ),
+ wl_fixed_from_double( event.GetAngle( 0 ).degree ),
+ TIZEN_INPUT_DEVICE_CLAS_MOUSE,
+ DevelTouchData::GetDeviceSubclass( event, 0 ),
+ "",
+ event.GetTime()
+ );
+
+ if( event.GetState( 0 ) == Dali::PointState::UP)
+ {
+ MouseOut( event );
+ }
+
+ return true;
+}
+
+bool WidgetView::TouchEvent( const Dali::TouchData& event )
+{
+ tizen_remote_surface_event_type type = TIZEN_REMOTE_SURFACE_EVENT_TYPE_NONE;
+ int button = 1;
+
+ switch( event.GetState( 0 ) )
+ {
+ case Dali::PointState::UP:
+ {
+ type = TIZEN_REMOTE_SURFACE_EVENT_TYPE_TOUCH_UP;
+
+ if( mRetryState )
+ {
+ ActivateFaultedWidget();
+ return false;
+ }
+
+ break;
+ }
+ case Dali::PointState::DOWN:
+ {
+ type = TIZEN_REMOTE_SURFACE_EVENT_TYPE_TOUCH_DOWN;
+
+ break;
+ }
+ case Dali::PointState::MOTION:
+ {
+ type = TIZEN_REMOTE_SURFACE_EVENT_TYPE_TOUCH_MOVE;
+ button = 0;
+ break;
+ }
+ default:
+ {
+ return false;
+ }
+ }
+
+ Vector2 localPos = event.GetLocalPosition( 0 );
+
+ tizen_remote_surface_transfer_touch_event( mRemoteSurface,
+ type,
+ 0,
+ button,
+ (int)localPos.x,
+ (int)localPos.y,
+ wl_fixed_from_double( event.GetEllipseRadius( 0 ).x ),
+ wl_fixed_from_double( event.GetEllipseRadius( 0 ).y ),
+ wl_fixed_from_double( event.GetPressure( 0 ) ),
+ wl_fixed_from_double( event.GetAngle( 0 ).degree ),
+ TIZEN_INPUT_DEVICE_CLAS_TOUCHSCREEN,
+ DevelTouchData::GetDeviceSubclass( event, 0 ),
+ "",
+ event.GetTime()
+ );
+ return true;
+}
+
} // namespace Internal
} // namespace WidgetView