projects
/
platform
/
core
/
uifw
/
dali-toolkit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Merge branch 'tizen' into devel/new_mesh" into devel/new_mesh
[platform/core/uifw/dali-toolkit.git]
/
dali-toolkit
/
internal
/
focus-manager
/
keyinput-focus-manager-impl.cpp
diff --git
a/dali-toolkit/internal/focus-manager/keyinput-focus-manager-impl.cpp
b/dali-toolkit/internal/focus-manager/keyinput-focus-manager-impl.cpp
index
dc8cefa
..
48f0ebf
100644
(file)
--- a/
dali-toolkit/internal/focus-manager/keyinput-focus-manager-impl.cpp
+++ b/
dali-toolkit/internal/focus-manager/keyinput-focus-manager-impl.cpp
@@
-19,6
+19,7
@@
#include "keyinput-focus-manager-impl.h"
// EXTERNAL INCLUDES
#include "keyinput-focus-manager-impl.h"
// EXTERNAL INCLUDES
+#include <cstring> // for strcmp
#include <dali/public-api/actors/layer.h>
#include <dali/public-api/common/stage.h>
#include <dali/public-api/actors/layer.h>
#include <dali/public-api/common/stage.h>
@@
-35,6
+36,16
@@
namespace Toolkit
namespace Internal
{
namespace Internal
{
+namespace
+{
+
+// Signals
+
+const char* const SIGNAL_KEY_INPUT_FOCUS_CHANGED = "key-input-focus-changed";
+const char* const SIGNAL_UNHANDLED_KEY_EVENT = "unhandled-key-event";
+
+}
+
KeyInputFocusManager::KeyInputFocusManager()
: mSlotDelegate( this )
{
KeyInputFocusManager::KeyInputFocusManager()
: mSlotDelegate( this )
{
@@
-77,13
+88,13
@@
void KeyInputFocusManager::SetFocus( Toolkit::Control control )
if( previousFocusControl )
{
// Notify the control that it has lost key input focus
if( previousFocusControl )
{
// Notify the control that it has lost key input focus
-
previousFocusControl.GetImplementation(
).OnKeyInputFocusLost();
+
GetImplementation( previousFocusControl
).OnKeyInputFocusLost();
}
mFocusStack.PushBack( &control.GetBaseObject() );
// Tell the new actor that it has gained focus.
}
mFocusStack.PushBack( &control.GetBaseObject() );
// Tell the new actor that it has gained focus.
-
control.GetImplementation(
).OnKeyInputFocusGained();
+
GetImplementation( control
).OnKeyInputFocusGained();
// Emit the signal to inform focus change to the application.
if ( !mKeyInputFocusChangedSignal.Empty() )
// Emit the signal to inform focus change to the application.
if ( !mKeyInputFocusChangedSignal.Empty() )
@@
-102,7
+113,7
@@
void KeyInputFocusManager::RemoveFocus( Toolkit::Control control )
control.OffStageSignal().Disconnect( mSlotDelegate, &KeyInputFocusManager::OnFocusControlStageDisconnection );
// Notify the control that it has lost key input focus
control.OffStageSignal().Disconnect( mSlotDelegate, &KeyInputFocusManager::OnFocusControlStageDisconnection );
// Notify the control that it has lost key input focus
-
control.GetImplementation(
).OnKeyInputFocusLost();
+
GetImplementation( control
).OnKeyInputFocusLost();
// If this is the top-most actor, pop it and change focus to the previous control
if( pos == mFocusStack.End() - 1 )
// If this is the top-most actor, pop it and change focus to the previous control
if( pos == mFocusStack.End() - 1 )
@@
-113,7
+124,7
@@
void KeyInputFocusManager::RemoveFocus( Toolkit::Control control )
if( previouslyFocusedControl )
{
// Tell the control that it has gained focus.
if( previouslyFocusedControl )
{
// Tell the control that it has gained focus.
-
previouslyFocusedControl.GetImplementation(
).OnKeyInputFocusGained();
+
GetImplementation( previouslyFocusedControl
).OnKeyInputFocusGained();
}
}
else
}
}
else
@@
-183,7
+194,7
@@
void KeyInputFocusManager::OnKeyEvent( const KeyEvent& event )
if( control )
{
// Notify the control about the key event
if( control )
{
// Notify the control about the key event
- consumed =
control.GetImplementation(
).EmitKeyEventSignal( event );
+ consumed =
GetImplementation( control
).EmitKeyEventSignal( event );
}
}
}
}
}
}
@@
-220,12
+231,16
@@
bool KeyInputFocusManager::DoConnectSignal( BaseObject* object, ConnectionTracke
Dali::BaseHandle handle( object );
bool connected( true );
Dali::BaseHandle handle( object );
bool connected( true );
- KeyInputFocusManager* manager = dynamic_cast<KeyInputFocusManager*>(
object
);
+ KeyInputFocusManager* manager = dynamic_cast<KeyInputFocusManager*>(
object
);
- if(
Dali::Toolkit::KeyInputFocusManager::SIGNAL_KEY_INPUT_FOCUS_CHANGED == signalName
)
+ if(
0 == strcmp( signalName.c_str(), SIGNAL_KEY_INPUT_FOCUS_CHANGED )
)
{
manager->KeyInputFocusChangedSignal().Connect( tracker, functor );
}
{
manager->KeyInputFocusChangedSignal().Connect( tracker, functor );
}
+ else if( 0 == strcmp( signalName.c_str(), SIGNAL_UNHANDLED_KEY_EVENT ) )
+ {
+ manager->UnhandledKeyEventSignal().Connect( tracker, functor );
+ }
else
{
// signalName does not match any signal
else
{
// signalName does not match any signal