- Added QuickPanelSignal to check QuickPanel changed or not.
- For example,
If Quickpanel is shown, dali accessibility should be disabled.
If All Apps application is shown, dali accessibility should be enabled.
Change-Id: I35246c883416b7990a19179c6c711702a9af0607
Signed-off-by: Seoyeon Kim <seoyeon2.kim@samsung.com>
namespace
{
+static constexpr auto QUICKPANEL_TYPE_SYSTEM_DEFAULT = 1;
+static constexpr auto QUICKPANEL_TYPE_APPS_MENU = 3;
+
// Copied from x server
static uint32_t GetCurrentMilliSeconds(void)
{
windowBase->SelectionDataReceivedSignal().Connect( this, &EventHandler::OnSelectionDataReceived );
windowBase->StyleChangedSignal().Connect( this, &EventHandler::OnStyleChanged );
windowBase->AccessibilitySignal().Connect( this, &EventHandler::OnAccessibilityNotification );
+ windowBase->QuickPanelSignal().Connect( this, &EventHandler::OnAccessibilityQuickpanelChanged );
}
else
{
return;
}
+ if( ( info.quickpanelInfo & ( 1 << QUICKPANEL_TYPE_SYSTEM_DEFAULT ) ) && ( info.quickpanelInfo & ( 1 << QUICKPANEL_TYPE_APPS_MENU ) ) )
+ {
+ DALI_LOG_ERROR("Quickpanel is top now, so all dali apps should be stopped \n");
+ return;
+ }
+
// Create a touch point object.
PointState::Type touchPointState( PointState::DOWN );
if( info.state == 0 )
#endif
}
+void EventHandler::OnAccessibilityQuickpanelChanged( const unsigned char& info )
+{
+#ifdef DALI_ELDBUS_AVAILABLE
+ if( mPaused )
+ {
+ return;
+ }
+
+ if( !mAccessibilityAdaptor )
+ {
+ DALI_LOG_ERROR( "Invalid accessibility adaptor\n" );
+ return;
+ }
+
+ AccessibilityAdaptor* accessibilityAdaptor( &AccessibilityAdaptor::GetImplementation( mAccessibilityAdaptor ) );
+ if( !accessibilityAdaptor )
+ {
+ DALI_LOG_ERROR( "Cannot access accessibility adaptor\n" );
+ return;
+ }
+
+ // Both QuickPanel and Apps are shown
+ if( ( info & ( 1 << QUICKPANEL_TYPE_SYSTEM_DEFAULT ) ) && ( info & ( 1 << QUICKPANEL_TYPE_APPS_MENU ) ) )
+ {
+ // dali apps should be disabled.
+ accessibilityAdaptor->DisableAccessibility();
+ }
+ // Only Apps menu (dali application) is shown
+ else if( info & ( 1 << QUICKPANEL_TYPE_APPS_MENU ) )
+ {
+ // dali app should be enabled.
+ accessibilityAdaptor->EnableAccessibility();
+ }
+ // QuickPanel is shown
+ else if( info & ( 1 << QUICKPANEL_TYPE_SYSTEM_DEFAULT ) )
+ {
+ // dali app should be disabled.
+ accessibilityAdaptor->DisableAccessibility();
+ }
+ else
+ {
+ // dali app should be enabled.
+ accessibilityAdaptor->EnableAccessibility();
+ }
+
+
+#endif
+}
+
void EventHandler::AddObserver( Observer& observer )
{
ObserverContainer::iterator match ( find(mObservers.begin(), mObservers.end(), &observer) );
*/
void OnAccessibilityNotification( const WindowBase::AccessibilityInfo& info );
+ /**
+ * Called when Ecore ElDBus quick panel event for accessibility is received.
+ */
+ void OnAccessibilityQuickpanelChanged( const unsigned char& info );
+
private:
// Undefined
mStyleChangedSignal(),
mAccessibilitySignal(),
mTransitionEffectEventSignal(),
- mKeyboardRepeatSettingsChangedSignal()
+ mKeyboardRepeatSettingsChangedSignal(),
+ mQuickPanelSignal()
{
}
return mAccessibilitySignal;
}
+WindowBase::QuickPanelSignalType& WindowBase::QuickPanelSignal()
+{
+ return mQuickPanelSignal;
+}
+
WindowBase::TransitionEffectEventSignalType& WindowBase::TransitionEffectEventSignal()
{
return mTransitionEffectEventSignal;
int endY;
int state;
int eventTime;
+ unsigned char quickpanelInfo; // to retrieve quick panel information for Accessibility
};
// Window
// Accessibility
typedef Signal< void ( StyleChange::Type ) > StyleSignalType;
typedef Signal< void ( const AccessibilityInfo& ) > AccessibilitySignalType;
+ typedef Signal< void ( const unsigned char& ) > QuickPanelSignalType;
/**
* @brief Default constructor
AccessibilitySignalType& AccessibilitySignal();
/**
+ * @brief This signal is emitted when a quick panel event for accessibility is received.
+ */
+ QuickPanelSignalType& QuickPanelSignal();
+
+ /**
* @brief This signal is emitted when window's transition animation is started or ended.
*/
TransitionEffectEventSignalType& TransitionEffectEventSignal();
TransitionEffectEventSignalType mTransitionEffectEventSignal;
KeyboardRepeatSettingsChangedSignalType mKeyboardRepeatSettingsChangedSignal;
WindowRedrawRequestSignalType mWindowRedrawRequestSignal;
+ QuickPanelSignalType mQuickPanelSignal;
};
} // namespace Adaptor
windowBase->OnEcoreElDBusAccessibilityNotification( context, message );
}
}
+
+// Callback for Ecore ElDBus accessibility quickpanel changed event.
+static void EcoreElDBusAccessibilityQuickpanelChanged( void* context, const Eldbus_Message* message )
+{
+ WindowBaseEcoreWl2* windowBase = static_cast< WindowBaseEcoreWl2* >( context );
+ if( windowBase )
+ {
+ windowBase->OnEcoreElDBusAccessibilityQuickpanelChanged( context, message );
+ }
+}
#endif // DALI_ELDBUS_AVAILABLE
static void RegistryGlobalCallback( void* data, struct wl_registry *registry, uint32_t name, const char* interface, uint32_t version )
#endif
}
+void WindowBaseEcoreWl2::OnEcoreElDBusAccessibilityQuickpanelChanged( void* context, const Eldbus_Message* message )
+{
+#ifdef DALI_ELDBUS_AVAILABLE
+ AccessibilityInfo info;
+
+ unsigned int type = 0; // For example, type 1 is QuickPanel, type 3 is AllApps
+ unsigned int state = 0; // 0 is hidden, 1 is shown
+
+ // The string defines the arg-list's respective types.
+ if( !eldbus_message_arguments_get( message, "uu", &type, &state ) )
+ {
+ DALI_LOG_ERROR( "OnEcoreElDBusAccessibilityQuickpanelChanged: Error getting arguments\n" );
+ }
+
+ if( state == 1 ) // Shown
+ {
+ info.quickpanelInfo |= 1 << type;
+ }
+ else // Hidden
+ {
+ info.quickpanelInfo &= ~( 1 << type );
+ }
+
+ mQuickPanelSignal.Emit( info.quickpanelInfo );
+#endif
+}
+
void WindowBaseEcoreWl2::OnTransitionEffectEvent( DevelWindow::EffectState state, DevelWindow::EffectType type )
{
mTransitionEffectEventSignal.Emit( state, type );
{
DALI_LOG_ERROR( "No signal handler returned\n" );
}
+
+ if( !eldbus_proxy_signal_handler_add( manager, "QuickpanelChanged", EcoreElDBusAccessibilityQuickpanelChanged, this ) )
+ {
+ DALI_LOG_ERROR( "No signal handler returned for QuickpanelChanged signal\n" );
+ }
#endif
}
* @brief Called when Ecore ElDBus accessibility event is received.
*/
void OnEcoreElDBusAccessibilityNotification( void* context, const Eldbus_Message* message );
+
+ /**
+ * @brief Called when Ecore ElDBus quick panel event for accessibility is received.
+ */
+ void OnEcoreElDBusAccessibilityQuickpanelChanged( void* context, const Eldbus_Message* message );
#endif
/**