/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <dali/public-api/events/pan-gesture-detector.h>
#include <dali/public-api/object/any.h>
#include <dali/public-api/images/image.h>
-#include <dali/public-api/events/touch-event.h>
+#include <dali/public-api/events/touch-data.h>
#include <dali/public-api/events/hover-event.h>
#include <dali/public-api/events/wheel-event.h>
#include <dali/public-api/events/key-event.h>
#include <dali/public-api/events/pan-gesture.h>
-#include <dali/devel-api/object/weak-handle.h>
+#include <dali/public-api/object/weak-handle.h>
// INTERNAL INCLUDES
#include <v8-utils.h>
namespace // un-named namespace
{
-const char* const SIGNAL_TOUCHED = "touched";
+const char* const SIGNAL_TOUCH = "touch";
const char* const SIGNAL_HOVERED = "hovered";
const char* const SIGNAL_WHEEL_EVENT = "wheelEvent";
const char* const SIGNAL_ON_STAGE = "onStage";
const char* const STAGE_SIGNAL_KEY_EVENT = "keyEvent";
const char* const STAGE_SIGNAL_EVENT_PROCESSING_FINISHED = "eventProcessingFinished";
-const char* const STAGE_SIGNAL_TOUCHED = "touched";
+const char* const STAGE_SIGNAL_TOUCH = "touch";
const char* const SIGNAL_IMAGE_LOADING_FINISHED = "imageLoadingFinished";
const char* const SIGNAL_IMAGE_UPLOADED = "uploaded";
mActor(actor)
{
}
- bool OnTouch( Actor actor, const TouchEvent& event)
+ bool OnTouch( Actor actor, const TouchData& touch )
{
std::vector< Dali::Any > arguments; // Dali::Vector considers Dali::Any to be a non trivial type so won't compile
Dali::Any returnValue(false);
arguments.push_back( actor );
- arguments.push_back( event );
+ arguments.push_back( touch );
CallJavaScript( returnValue, arguments );
bool ret;
returnValue.Get(ret);
Dali::Any returnValue; //no return
CallJavaScript( returnValue, arguments );
}
- void TouchedSignal( const TouchEvent& touchEvent)
+ void TouchSignal( const TouchData& touch )
{
std::vector< Dali::Any > arguments;
Dali::Any returnValue; //no return
- arguments.push_back( touchEvent );
+ arguments.push_back( touch );
CallJavaScript( returnValue, arguments );
}
};
ActorCallback* callback =new ActorCallback( isolate, javaScriptCallback, signalName, actor );
- if( strcmp( signalName.c_str(), SIGNAL_TOUCHED ) == 0 )
+ if( strcmp( signalName.c_str(), SIGNAL_TOUCH ) == 0 )
{
- actor.TouchedSignal().Connect( callback, &ActorCallback::OnTouch );
+ actor.TouchSignal().Connect( callback, &ActorCallback::OnTouch );
}
else if( strcmp( signalName.c_str(), SIGNAL_HOVERED ) == 0 )
{
else
{
delete callback;
+ DALI_SCRIPT_EXCEPTION( isolate, "the signal is not available in this object.");
}
}
{
stage.EventProcessingFinishedSignal().Connect( callback, &StageCallback::EventProcessingFinishedSignal );
}
- else if (strcmp( signalName.c_str(), STAGE_SIGNAL_TOUCHED ) == 0 )
+ else if (strcmp( signalName.c_str(), STAGE_SIGNAL_TOUCH ) == 0 )
{
- stage.TouchedSignal().Connect( callback, &StageCallback::TouchedSignal );
+ stage.TouchSignal().Connect( callback, &StageCallback::TouchSignal );
}
else
{
// first paramter = signal to connect to
// Second parameter = function ( to run )
// args.This() = myActor
- // e.g. myActor.Connect("touched", myJavaScriptActorTouched );
+ // e.g. myActor.Connect("touch", myJavaScriptActorTouched );
// Inside Callback on myJavaScriptActorTouched
- // myActor.Disconnect("touched", myJavaScriptActorTouched );
+ // myActor.Disconnect("touch", myJavaScriptActorTouched );
v8::Isolate* isolate = args.GetIsolate();
v8::HandleScope handleScope( isolate );