X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=base%2Fdali-toolkit%2Finternal%2Fbuilder%2Fbuilder-signals.cpp;h=3124c46559580602cb01289fc2e309541629a566;hp=43c9aa35e76917aea44057e9c10b4f4014084ed9;hb=fc6a26b5914e2a4db7bc2b0eded44e77c0347a4d;hpb=40472c84617d3f505ba9861d3628f77e796ab45c diff --git a/base/dali-toolkit/internal/builder/builder-signals.cpp b/base/dali-toolkit/internal/builder/builder-signals.cpp index 43c9aa3..3124c46 100644 --- a/base/dali-toolkit/internal/builder/builder-signals.cpp +++ b/base/dali-toolkit/internal/builder/builder-signals.cpp @@ -1,18 +1,19 @@ -// -// Copyright (c) 2014 Samsung Electronics Co., Ltd. -// -// Licensed under the Flora License, Version 1.0 (the License); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://floralicense.org/license/ -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// +/* + * Copyright (c) 2014 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ // EXTERNAL INCLUDES #include @@ -42,17 +43,6 @@ using namespace Dali; // Signal Actions // -// Action quit; connected to signals -// TODO: MOVE TO BUILDER TEMPLATE -struct ActionQuit -{ - ActionQuit(void) {}; - - void operator()(void) { - // Dali::Application::Get().Quit(); - }; -}; - // Action on child actor. The child is found by alias so can be 'previous' etc. struct ChildActorAction { @@ -232,7 +222,7 @@ void DoNothing(void) {}; /** * Get an action as boost function callback */ -boost::function GetAction(const TreeNode &root, const TreeNode &child, Actor actor) +boost::function GetAction(const TreeNode &root, const TreeNode &child, Actor actor, boost::function quitAction) { OptionalString childActorName(IsString( IsChild(&child, "child-actor")) ); OptionalString actorName(IsString( IsChild(&child, "actor")) ); @@ -278,7 +268,7 @@ boost::function GetAction(const TreeNode &root, const TreeNode &chi } else if("quit" == *actionName) { - callback = ActionQuit(); + callback = quitAction; } else if("play" == *actionName) { @@ -382,7 +372,7 @@ Actor SetupPropertyNotification(const TreeNode &child, Actor actor); /** * Setup signals and actions on an actor */ -Actor SetupSignalAction(ConnectionTracker* tracker, const TreeNode &root, const TreeNode &child, Actor actor) +Actor SetupSignalAction(ConnectionTracker* tracker, const TreeNode &root, const TreeNode &child, Actor actor, boost::function quitAction) { DALI_ASSERT_ALWAYS(actor); @@ -399,7 +389,7 @@ Actor SetupSignalAction(ConnectionTracker* tracker, const TreeNode &root, const OptionalString name( IsString( IsChild( key_child.second, "name")) ); DALI_ASSERT_ALWAYS(name && "Signal must have a name"); - boost::function callback = GetAction(root, key_child.second, actor); + boost::function callback = GetAction(root, key_child.second, actor, quitAction); actor.ConnectSignal(tracker, *name, callback); } @@ -411,7 +401,7 @@ Actor SetupSignalAction(ConnectionTracker* tracker, const TreeNode &root, const /** * Setup Property notifications for an actor */ -Actor SetupPropertyNotification(ConnectionTracker* tracker, const TreeNode &root, const TreeNode &child, Actor actor) +Actor SetupPropertyNotification(ConnectionTracker* tracker, const TreeNode &root, const TreeNode &child, Actor actor, boost::function quitAction) { DALI_ASSERT_ALWAYS(actor); @@ -425,7 +415,7 @@ Actor SetupPropertyNotification(ConnectionTracker* tracker, const TreeNode &root // Actor actions reference by pointer because of circular reference actor->signal // So this callback should only go onto the actor maintained list. - boost::function callback = GetAction(root, key_child.second, actor); + boost::function callback = GetAction(root, key_child.second, actor, quitAction); OptionalString prop(IsString( IsChild(key_child.second, "property")) ); DALI_ASSERT_ALWAYS(prop && "Notification signal must specify a property");