#if ENABLE(TIZEN_WEBKIT2_FOCUS_RING)
#include "PageClientImpl.h"
+#if ENABLE(TOUCH_ADJUSTMENT)
+#include <Elementary.h>
+#endif
+
using namespace WebKit;
using namespace WebCore;
, m_imageOuterWidth(0)
, m_imageInnerWidth(0)
, m_showTimer(0)
+ , m_hideTimer(0)
{
}
if (m_showTimer)
ecore_timer_del(m_showTimer);
+ if (m_hideTimer)
+ ecore_timer_del(m_hideTimer);
+
if (m_focusRingObject)
evas_object_del(m_focusRingObject);
}
}
}
-void FocusRing::requestToShow(const IntPoint& position)
+void FocusRing::requestToShow(const IntPoint& position, bool immediately)
{
if (!m_imagePath.isNull())
return;
+ if (immediately) {
+ if (m_focusRingObject && evas_object_visible_get(m_focusRingObject))
+ return;
+ else {
+ if (m_showTimer) {
+ ecore_timer_del(m_showTimer);
+ m_showTimer = 0;
+ }
+
+ m_position = position;
+ show(IntRect());
+ return;
+ }
+ }
+
m_position = position;
if (m_showTimer)
void FocusRing::show(const IntRect& rect, const bool includeOnlyImage)
{
- if (rect.isEmpty())
- m_showTimer = 0;
+ if (rect.isEmpty()) {
+ if (m_showTimer) {
+ ecore_timer_del(m_showTimer);
+ m_showTimer = 0;
+ }
+ }
PageClientImpl* pageClientImpl = m_viewImpl->pageClient.get();
EINA_SAFETY_ON_NULL_RETURN(pageClientImpl);
if (rect.isEmpty()) {
#if ENABLE(TIZEN_WEBKIT2_HIT_TEST)
IntPoint contentsPosition = m_viewImpl->transformFromScene().mapPoint(m_position);
+#if ENABLE(TOUCH_ADJUSTMENT)
+ Evas_Coord size = elm_config_finger_size_get();
+ IntSize fingerSize = IntSize(size, size);
+#if ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE)
+ double scaleFactor = pageClientImpl->scaleFactor();
+ if (scaleFactor - 1 > numeric_limits<float>::epsilon())
+ fingerSize.scale(1 / scaleFactor, 1 / scaleFactor);
+#endif
+ WebHitTestResult::Data hitTestResultData = m_viewImpl->page()->hitTestResultAtPoint(contentsPosition, WebHitTestResult::HitTestModeDefault, fingerSize);
+#else
WebHitTestResult::Data hitTestResultData = m_viewImpl->page()->hitTestResultAtPoint(contentsPosition);
+#endif
if (hitTestResultData.focusedRect.isEmpty())
return;
evas_object_show(m_focusRingObject);
}
+void FocusRing::requestToHide(bool immediately)
+{
+ if (immediately) {
+ hide();
+ return;
+ }
+
+ if (m_hideTimer)
+ ecore_timer_del(m_hideTimer);
+ m_hideTimer = ecore_timer_add((double)s_hideTimerTime/1000.0, hideTimerCallback, this);
+}
+
+Eina_Bool FocusRing::hideTimerCallback(void* data)
+{
+ static_cast<FocusRing*>(data)->hide();
+ return ECORE_CALLBACK_CANCEL;
+}
+
void FocusRing::hide(bool onlyColorDrawing)
{
if (!m_imagePath.isNull() && onlyColorDrawing)
m_showTimer = 0;
}
+ if (m_hideTimer) {
+ ecore_timer_del(m_hideTimer);
+ m_hideTimer = 0;
+ }
+
if (m_focusRingObject && evas_object_visible_get(m_focusRingObject))
evas_object_hide(m_focusRingObject);