2 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include "ecore-indicator-impl.h"
24 #include <Ecore_Wayland.h>
26 #include <sys/types.h>
32 #include <dali/public-api/images/native-image.h>
33 #include <dali/public-api/events/touch-event.h>
34 #include <dali/public-api/events/touch-point.h>
35 #include <dali/public-api/common/stage.h>
36 #include <dali/public-api/images/buffer-image.h>
37 #include <dali/devel-api/images/texture-set-image.h>
38 #include <dali/integration-api/debug.h>
40 #include <tbm_surface.h>
41 #include <wayland-extension/tizen-remote-surface-client-protocol.h>
42 #include <wayland-client.h>
43 #include <wayland-tbm-client.h>
46 #include <adaptor-impl.h>
47 #include <accessibility-adaptor-impl.h>
48 #include <native-image-source.h>
52 #if defined(DEBUG_ENABLED)
53 #define STATE_DEBUG_STRING(state) (state==DISCONNECTED?"DISCONNECTED":state==CONNECTED?"CONNECTED":"UNKNOWN")
59 const float SLIDING_ANIMATION_DURATION( 0.2f ); // 200 milli seconds
60 const float AUTO_INDICATOR_STAY_DURATION(3.0f); // 3 seconds
61 const float SHOWING_DISTANCE_HEIGHT_RATE(0.34f); // 20 pixels
69 const int NUM_GRADIENT_INTERVALS(5); // Number of gradient intervals
70 const float GRADIENT_ALPHA[NUM_GRADIENT_INTERVALS+1] = { 0.6f, 0.38f, 0.20f, 0.08f, 0.0f, 0.0f };
72 #define MAKE_SHADER(A)#A
74 const char* BACKGROUND_VERTEX_SHADER = MAKE_SHADER(
75 attribute mediump vec2 aPosition;
76 attribute mediump float aAlpha;
77 varying mediump float vAlpha;
78 uniform mediump mat4 uMvpMatrix;
79 uniform mediump vec3 uSize;
83 mediump vec4 vertexPosition = vec4( aPosition * uSize.xy, 0.0, 1.0 );
84 vertexPosition = uMvpMatrix * vertexPosition;
87 gl_Position = vertexPosition;
91 const char* BACKGROUND_FRAGMENT_SHADER = MAKE_SHADER(
92 uniform lowp vec4 uColor;
93 varying mediump float vAlpha;
97 gl_FragColor = uColor;
98 gl_FragColor.a *= vAlpha;
102 const char* FOREGROUND_VERTEX_SHADER = DALI_COMPOSE_SHADER(
103 attribute mediump vec2 aPosition;\n
104 varying mediump vec2 vTexCoord;\n
105 uniform mediump mat4 uMvpMatrix;\n
106 uniform mediump vec3 uSize;\n
107 uniform mediump vec4 sTextureRect;\n
111 gl_Position = uMvpMatrix * vec4(aPosition * uSize.xy, 0.0, 1.0);\n
112 vTexCoord = aPosition + vec2(0.5);\n
116 const char* FOREGROUND_FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
117 varying mediump vec2 vTexCoord;\n
118 uniform sampler2D sTexture;\n
122 gl_FragColor = texture2D( sTexture, vTexCoord );\n // the foreground does not apply actor color
126 const char* FOREGROUND_TBM_FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
127 varying mediump vec2 vTexCoord;\n
128 uniform samplerExternalOES sTexture;\n
132 gl_FragColor = texture2D( sTexture, vTexCoord );\n // the foreground does not apply actor color
136 Dali::Geometry CreateQuadGeometry()
138 Dali::Property::Map quadVertexFormat;
139 quadVertexFormat["aPosition"] = Dali::Property::VECTOR2;
140 Dali::PropertyBuffer vertexData = Dali::PropertyBuffer::New( quadVertexFormat );
142 const float halfQuadSize = .5f;
143 struct QuadVertex { Dali::Vector2 position; };
144 QuadVertex quadVertexData[4] = {
145 { Dali::Vector2(-halfQuadSize, -halfQuadSize) },
146 { Dali::Vector2(-halfQuadSize, halfQuadSize) },
147 { Dali::Vector2( halfQuadSize, -halfQuadSize) },
148 { Dali::Vector2( halfQuadSize, halfQuadSize) } };
149 vertexData.SetData(quadVertexData, 4);
151 Dali::Geometry quad = Dali::Geometry::New();
152 quad.AddVertexBuffer( vertexData );
153 quad.SetType( Dali::Geometry::TRIANGLE_STRIP );
157 const float OPAQUE_THRESHOLD(0.99f);
158 const float TRANSPARENT_THRESHOLD(0.05f);
160 // indicator service name
161 const char* INDICATOR_SERVICE_NAME("elm_indicator");
163 // Copied from ecore_evas_extn_engine.h
179 OP_PROFILE_CHANGE_REQUEST,
180 OP_PROFILE_CHANGE_DONE,
198 // Copied from elm_conform.c
200 const int MSG_DOMAIN_CONTROL_INDICATOR( 0x10001 );
201 const int MSG_ID_INDICATOR_REPEAT_EVENT( 0x10002 );
202 const int MSG_ID_INDICATOR_ROTATION( 0x10003 );
203 const int MSG_ID_INDICATOR_OPACITY( 0X1004 );
204 const int MSG_ID_INDICATOR_TYPE( 0X1005 );
205 const int MSG_ID_INDICATOR_START_ANIMATION( 0X10006 );
217 struct IpcIndicatorDataAnimation
223 struct IpcDataEvMouseUp
226 Evas_Button_Flags flags;
228 unsigned int timestamp;
229 Evas_Event_Flags event_flags;
231 IpcDataEvMouseUp(unsigned long timestamp)
233 flags(EVAS_BUTTON_NONE),
235 timestamp(static_cast<unsigned int>(timestamp)),
236 event_flags(EVAS_EVENT_FLAG_NONE)
241 struct IpcDataEvMouseDown
244 Evas_Button_Flags flags;
246 unsigned int timestamp;
247 Evas_Event_Flags event_flags;
249 IpcDataEvMouseDown(unsigned long timestamp)
251 flags(EVAS_BUTTON_NONE),
253 timestamp(static_cast<unsigned int>(timestamp)),
254 event_flags(EVAS_EVENT_FLAG_NONE)
259 struct IpcDataEvMouseMove
262 Evas_Button_Flags flags;
264 unsigned int timestamp;
265 Evas_Event_Flags event_flags;
267 IpcDataEvMouseMove(const Dali::TouchPoint& touchPoint, unsigned long timestamp)
268 : x(static_cast<Evas_Coord>(touchPoint.local.x)),
269 y(static_cast<Evas_Coord>(touchPoint.local.y)),
270 flags(EVAS_BUTTON_NONE),
272 timestamp(static_cast<unsigned int>(timestamp)),
273 event_flags(EVAS_EVENT_FLAG_NONE)
278 struct IpcDataEvMouseOut
280 unsigned int timestamp;
282 Evas_Event_Flags event_flags;
284 IpcDataEvMouseOut(unsigned long timestamp)
285 : timestamp(static_cast<unsigned int>(timestamp)),
287 event_flags(EVAS_EVENT_FLAG_NONE)
292 static void UpdateIndicatorImage( void* data, struct tizen_remote_surface* remoteSurface, struct wl_buffer* buffer, uint32_t time )
294 Dali::Internal::Adaptor::Indicator* indicator = static_cast< Dali::Internal::Adaptor::Indicator* >( data );
298 tbm_surface_h tbmSurface = static_cast< tbm_surface_h >( wl_buffer_get_user_data( buffer ) );
300 indicator->UpdateIndicatorImage( tbmSurface );
304 static void MissingIndicatorImage( void* data, struct tizen_remote_surface* surface )
308 static const struct tizen_remote_surface_listener remoteSurfaceCallback =
310 UpdateIndicatorImage,
311 MissingIndicatorImage,
314 } // anonymous namespace
323 #if defined(DEBUG_ENABLED)
324 Debug::Filter* gIndicatorLogFilter = Debug::Filter::New(Debug::Concise, false, "LOG_INDICATOR");
327 // Impl to hide EFL implementation.
329 struct Indicator::Impl
331 enum // operation mode
334 INDICATOR_STAY_WITH_DURATION
340 Impl(Indicator* indicator)
341 : mIndicator(indicator),
342 mEcoreEventHandler(NULL)
344 #if defined(DALI_PROFILE_MOBILE)
345 mEcoreEventHandler = ecore_event_handler_add(ECORE_WL_EVENT_INDICATOR_FLICK, EcoreEventIndicator, this);
346 #endif // WAYLAND && DALI_PROFILE_MOBILE
354 if ( mEcoreEventHandler )
356 ecore_event_handler_del(mEcoreEventHandler);
360 static void SetIndicatorVisibility( void* data, int operation )
362 Indicator::Impl* indicatorImpl((Indicator::Impl*)data);
364 if ( indicatorImpl == NULL || indicatorImpl->mIndicator == NULL)
368 if ( operation == INDICATOR_STAY_WITH_DURATION )
370 // if indicator is not showing, INDICATOR_FLICK_DONE is given
371 if( indicatorImpl->mIndicator->mVisible == Dali::Window::AUTO &&
372 !indicatorImpl->mIndicator->mIsShowing )
374 indicatorImpl->mIndicator->ShowIndicator( AUTO_INDICATOR_STAY_DURATION );
377 else if( operation == INDICATOR_HIDE )
379 if( indicatorImpl->mIndicator->mVisible == Dali::Window::AUTO &&
380 indicatorImpl->mIndicator->mIsShowing )
382 indicatorImpl->mIndicator->ShowIndicator( HIDE_NOW );
386 #if defined(DALI_PROFILE_MOBILE)
388 * Called when the Ecore indicator event is received.
390 static Eina_Bool EcoreEventIndicator( void* data, int type, void* event )
392 SetIndicatorVisibility( data, INDICATOR_STAY_WITH_DURATION );
393 return ECORE_CALLBACK_PASS_ON;
395 #endif // WAYLAND && DALI_PROFILE_MOBILE
398 Indicator* mIndicator;
399 Ecore_Event_Handler* mEcoreEventHandler;
402 Indicator::LockFile::LockFile(const std::string filename)
403 : mFilename(filename),
406 mFileDescriptor = open(filename.c_str(), O_RDWR);
407 if( mFileDescriptor == -1 )
411 DALI_LOG_ERROR( "### Cannot open %s for indicator lock ###\n", mFilename.c_str() );
415 Indicator::LockFile::~LockFile()
417 // Closing file descriptor also unlocks file.
418 close( mFileDescriptor );
421 bool Indicator::LockFile::Lock()
423 DALI_LOG_TRACE_METHOD( gIndicatorLogFilter );
426 if( mFileDescriptor > 0 )
428 if( lockf( mFileDescriptor, F_LOCK, 0 ) == 0 ) // Note, operation may block.
436 // file descriptor is no longer valid or not writable
439 DALI_LOG_ERROR( "### Cannot lock indicator: bad file descriptor for %s ###\n", mFilename.c_str() );
447 void Indicator::LockFile::Unlock()
449 DALI_LOG_TRACE_METHOD( gIndicatorLogFilter );
450 if( lockf( mFileDescriptor, F_ULOCK, 0 ) != 0 )
454 // file descriptor is no longer valid or not writable
457 DALI_LOG_ERROR( "### Cannot unlock indicator: bad file descriptor for %s\n", mFilename.c_str() );
462 bool Indicator::LockFile::RetrieveAndClearErrorStatus()
464 bool error = mErrorThrown;
465 mErrorThrown = false;
469 Indicator::ScopedLock::ScopedLock(LockFile* lockFile)
470 : mLockFile(lockFile),
475 mLocked = mLockFile->Lock();
479 Indicator::ScopedLock::~ScopedLock()
487 bool Indicator::ScopedLock::IsLocked()
492 Indicator::Indicator( Adaptor* adaptor, Dali::Window::WindowOrientation orientation, IndicatorInterface::Observer* observer )
494 mGestureDetected( false ),
496 mOpacityMode( Dali::Window::OPAQUE ),
497 mState( DISCONNECTED ),
499 mServerConnection( NULL ),
500 mObserver( observer ),
501 mOrientation( orientation ),
504 mVisible( Dali::Window::INVISIBLE ),
506 mIsAnimationPlaying( false ),
507 mCurrentSharedFile( 0 ),
508 mSharedBufferType( BUFFER_TYPE_SHM ),
510 mBackgroundVisible( false )
512 mIndicatorContentActor = Dali::Actor::New();
513 mIndicatorContentActor.SetParentOrigin( ParentOrigin::TOP_CENTER );
514 mIndicatorContentActor.SetAnchorPoint( AnchorPoint::TOP_CENTER );
516 // Indicator image handles the touch event including "leave"
517 mIndicatorContentActor.SetLeaveRequired( true );
518 mIndicatorContentActor.TouchedSignal().Connect( this, &Indicator::OnTouched );
519 mIndicatorContentActor.SetColor( Color::BLACK );
521 mIndicatorActor = Dali::Actor::New();
522 mIndicatorActor.Add( mIndicatorContentActor );
524 // Event handler to find out flick down gesture
525 mEventActor = Dali::Actor::New();
526 mEventActor.SetParentOrigin( ParentOrigin::TOP_CENTER );
527 mEventActor.SetAnchorPoint( AnchorPoint::TOP_CENTER );
528 mIndicatorActor.Add( mEventActor );
530 // Attach pan gesture to find flick down during hiding.
531 // It can prevent the problem that scrollview gets pan gesture even indicator area is touched,
532 // since it consumes the pan gesture in advance.
533 mPanDetector = Dali::PanGestureDetector::New();
534 mPanDetector.DetectedSignal().Connect( this, &Indicator::OnPan );
535 mPanDetector.Attach( mEventActor );
539 // register indicator to accessibility adaptor
540 Dali::AccessibilityAdaptor accessibilityAdaptor = AccessibilityAdaptor::Get();
541 if(accessibilityAdaptor)
543 AccessibilityAdaptor::GetImplementation( accessibilityAdaptor ).SetIndicator( this );
545 // hide the indicator by default
546 mIndicatorActor.SetVisible( false );
548 // create impl to handle ecore event
549 mImpl = new Impl(this);
552 Indicator::~Indicator()
562 mEventActor.TouchedSignal().Disconnect( this, &Indicator::OnTouched );
567 void Indicator::SetAdaptor(Adaptor* adaptor)
570 mIndicatorBuffer->SetAdaptor( adaptor );
573 Dali::Actor Indicator::GetActor()
575 return mIndicatorActor;
578 void Indicator::Open( Dali::Window::WindowOrientation orientation )
580 DALI_LOG_TRACE_METHOD( gIndicatorLogFilter );
582 // Calls from Window should be set up to ensure we are in a
583 // disconnected state before opening a second time.
584 DALI_ASSERT_DEBUG( mState == DISCONNECTED );
586 mOrientation = orientation;
590 // Change background visibility depending on orientation
591 if( mOrientation == Dali::Window::LANDSCAPE || mOrientation == Dali::Window::LANDSCAPE_INVERSE )
593 if( mBackgroundRenderer )
595 mIndicatorContentActor.RemoveRenderer( mBackgroundRenderer );
596 mBackgroundVisible = false;
601 SetOpacityMode( mOpacityMode );
605 void Indicator::Close()
607 DALI_LOG_TRACE_METHOD_FMT( gIndicatorLogFilter, "State: %s", STATE_DEBUG_STRING(mState) );
609 if( mState == CONNECTED )
612 if( mObserver != NULL )
614 mObserver->IndicatorClosed( this );
618 Dali::Texture emptyTexture;
619 SetForegroundImage( emptyTexture );
622 void Indicator::SetOpacityMode( Dali::Window::IndicatorBgOpacity mode )
626 Dali::Geometry geometry = CreateBackgroundGeometry();
629 if( mBackgroundRenderer )
631 if( mBackgroundRenderer.GetGeometry() != geometry )
633 mBackgroundRenderer.SetGeometry( geometry );
638 if( !mBackgroundShader )
640 mBackgroundShader = Dali::Shader::New( BACKGROUND_VERTEX_SHADER, BACKGROUND_FRAGMENT_SHADER, Dali::Shader::Hint::OUTPUT_IS_TRANSPARENT );
643 mBackgroundRenderer = Dali::Renderer::New( geometry, mBackgroundShader );
646 if( !mBackgroundVisible )
648 mIndicatorContentActor.AddRenderer( mBackgroundRenderer );
649 mBackgroundVisible = true;
652 else if( mBackgroundRenderer )
654 mIndicatorContentActor.RemoveRenderer( mBackgroundRenderer );
655 mBackgroundVisible = false;
659 void Indicator::SetVisible( Dali::Window::IndicatorVisibleMode visibleMode, bool forceUpdate )
661 if ( visibleMode != mVisible || forceUpdate )
663 // If we were previously hidden, then we should update the image data before we display the indicator
664 if ( mVisible == Dali::Window::INVISIBLE )
666 UpdateImageData( mCurrentSharedFile );
669 if ( visibleMode == Dali::Window::INVISIBLE )
671 if (mServerConnection)
673 mServerConnection->SendEvent( OP_HIDE, NULL, 0 );
678 mIndicatorActor.SetVisible( true );
680 if( mServerConnection )
682 mServerConnection->SendEvent( OP_SHOW, NULL, 0 );
686 mVisible = visibleMode;
688 if( mForegroundRenderer &&
689 ( mForegroundRenderer.GetTextures().GetTexture( 0u ) ||
690 Dali::TextureGetImage( mForegroundRenderer.GetTextures(), 0u ) )
693 if( CheckVisibleState() && mVisible == Dali::Window::AUTO )
696 ShowIndicator( AUTO_INDICATOR_STAY_DURATION /* stay n sec */ );
698 else if( CheckVisibleState() && mVisible == Dali::Window::VISIBLE )
701 ShowIndicator( KEEP_SHOWING );
706 ShowIndicator( HIDE_NOW );
716 bool Indicator::IsConnected()
718 return ( mState == CONNECTED );
721 bool Indicator::SendMessage( int messageDomain, int messageId, const void *data, int size )
725 return mServerConnection->SendEvent( OP_MSG, messageDomain, messageId, data, size );
733 bool Indicator::OnTouched(Dali::Actor indicator, const Dali::TouchEvent& touchEvent)
735 if( mServerConnection )
737 const TouchPoint& touchPoint = touchEvent.GetPoint( 0 );
739 // Send touch event to indicator server when indicator is showing
740 if( CheckVisibleState() || mIsShowing )
742 switch( touchPoint.state )
744 case Dali::PointState::DOWN:
746 IpcDataEvMouseMove ipcMove( touchPoint, touchEvent.time );
747 IpcDataEvMouseDown ipcDown( touchEvent.time );
748 mServerConnection->SendEvent( OP_EV_MOUSE_MOVE, &ipcMove, sizeof(ipcMove) );
749 mServerConnection->SendEvent( OP_EV_MOUSE_DOWN, &ipcDown, sizeof(ipcDown) );
751 if( mVisible == Dali::Window::AUTO )
753 // Stop hiding indicator
754 ShowIndicator( KEEP_SHOWING );
759 case Dali::PointState::MOTION:
761 IpcDataEvMouseMove ipcMove( touchPoint, touchEvent.time );
762 mServerConnection->SendEvent( OP_EV_MOUSE_MOVE, &ipcMove, sizeof(ipcMove) );
766 case Dali::PointState::UP:
767 case Dali::PointState::INTERRUPTED:
769 IpcDataEvMouseUp ipcUp( touchEvent.time );
770 mServerConnection->SendEvent( OP_EV_MOUSE_UP, &ipcUp, sizeof(ipcUp) );
772 if( mVisible == Dali::Window::AUTO )
775 ShowIndicator( 0.5f /* hide after 0.5 sec */ );
780 case Dali::TouchPoint::Leave:
782 IpcDataEvMouseMove ipcMove( touchPoint, touchEvent.time );
783 mServerConnection->SendEvent( OP_EV_MOUSE_MOVE, &ipcMove, sizeof(ipcMove) );
784 IpcDataEvMouseUp ipcOut( touchEvent.time );
785 mServerConnection->SendEvent( OP_EV_MOUSE_OUT, &ipcOut, sizeof(ipcOut) );
800 bool Indicator::Connect()
802 DALI_LOG_TRACE_METHOD( gIndicatorLogFilter );
804 DALI_ASSERT_DEBUG( mState == DISCONNECTED );
806 bool connected = false;
808 mServerConnection = new ServerConnection( INDICATOR_SERVICE_NAME, 0, false, this );
809 if( mServerConnection )
811 connected = mServerConnection->IsConnected();
814 delete mServerConnection;
815 mServerConnection = NULL;
821 StartReconnectionTimer();
831 void Indicator::StartReconnectionTimer()
833 if( ! mReconnectTimer )
835 mReconnectTimer = Dali::Timer::New(1000);
836 mConnection.DisconnectAll();
837 mReconnectTimer.TickSignal().Connect( mConnection, &Indicator::OnReconnectTimer );
839 mReconnectTimer.Start();
842 bool Indicator::OnReconnectTimer()
846 if( mState == DISCONNECTED )
857 void Indicator::Disconnect()
859 DALI_LOG_TRACE_METHOD( gIndicatorLogFilter );
861 mState = DISCONNECTED;
863 delete mServerConnection;
864 mServerConnection = NULL;
866 ClearSharedFileInfo();
869 void Indicator::Resize( int width, int height )
880 if( mImageWidth != width || mImageHeight != height )
883 mImageHeight = height;
885 mIndicatorContentActor.SetSize( mImageWidth, mImageHeight );
886 mIndicatorActor.SetSize( mImageWidth, mImageHeight );
887 mEventActor.SetSize(mImageWidth, mImageHeight);
891 void Indicator::SetLockFileInfo( Ecore_Ipc_Event_Server_Data *epcEvent )
893 DALI_LOG_TRACE_METHOD( gIndicatorLogFilter );
895 // epcEvent->ref == w
896 // epcEvent->ref_to == h
897 // epcEvent->response == buffer num
898 // epcEvent->data = lockfile + nul byte
900 if( (epcEvent->ref > 0) && (epcEvent->ref_to > 0) && (epcEvent->data) &&
901 (((unsigned char *)epcEvent->data)[epcEvent->size - 1] == 0) )
903 int n = epcEvent->response;
905 if( n >= 0 && n < SHARED_FILE_NUMBER )
907 mCurrentSharedFile = n;
909 mSharedFileInfo[n].mImageWidth = epcEvent->ref;
910 mSharedFileInfo[n].mImageHeight = epcEvent->ref_to;
912 mSharedFileInfo[n].mLockFileName.clear();
914 mSharedFileInfo[n].mLockFileName = static_cast< char* >( epcEvent->data );
916 DALI_LOG_INFO( gIndicatorLogFilter, Debug::General, "SetLockFileInfo: buffer num = %d, w = %d, h = %d, lock = %s\n",
917 n, mSharedFileInfo[n].mImageWidth, mSharedFileInfo[n].mImageHeight, mSharedFileInfo[n].mLockFileName.c_str() );
922 void Indicator::SetSharedImageInfo( Ecore_Ipc_Event_Server_Data *epcEvent )
924 DALI_LOG_TRACE_METHOD( gIndicatorLogFilter );
926 // epcEvent->ref == shm id
927 // epcEvent->ref_to == shm num
928 // epcEvent->response == buffer num
929 // epcEvent->data = shm ref string + nul byte
931 if ( (epcEvent->data) &&
932 (epcEvent->size > 0) &&
933 (((unsigned char *)epcEvent->data)[epcEvent->size - 1] == 0) )
935 int n = epcEvent->response;
937 if( n >= 0 && n < SHARED_FILE_NUMBER )
939 mCurrentSharedFile = n;
941 mSharedFileInfo[n].mSharedFileName.clear();
943 mSharedFileInfo[n].mSharedFileName = static_cast< char* >( epcEvent->data );
945 mSharedFileInfo[n].mSharedFileID = epcEvent->ref;
946 mSharedFileInfo[n].mSharedFileNumber = epcEvent->ref_to;
948 DALI_LOG_INFO( gIndicatorLogFilter, Debug::General, "SetSharedImageInfo: buffer num %d, shared file = %s, id = %d, num = %d\n",
949 n, mSharedFileInfo[n].mSharedFileName.c_str(), mSharedFileInfo[n].mSharedFileID, mSharedFileInfo[n].mSharedFileNumber );
954 void Indicator::LoadSharedImage( Ecore_Ipc_Event_Server_Data *epcEvent )
956 DALI_LOG_TRACE_METHOD( gIndicatorLogFilter );
958 // epcEvent->ref == alpha
959 // epcEvent->ref_to == sys
960 // epcEvent->response == buffer num
962 if ( mSharedBufferType != BUFFER_TYPE_SHM )
967 int n = epcEvent->response;
969 if( n >= 0 && n < SHARED_FILE_NUMBER )
971 mCurrentSharedFile = n;
973 delete mSharedFileInfo[n].mSharedFile;
974 mSharedFileInfo[n].mSharedFile = NULL;
976 delete mSharedFileInfo[n].mLock;
977 mSharedFileInfo[n].mLock = NULL;
979 std::stringstream sharedFileID;
980 std::stringstream sharedFileNumber;
982 sharedFileID << mSharedFileInfo[n].mSharedFileID;
983 sharedFileNumber << mSharedFileInfo[n].mSharedFileNumber;
985 std::string sharedFilename = "/" + mSharedFileInfo[n].mSharedFileName + "-" + sharedFileID.str() + "." + sharedFileNumber.str();
987 DALI_LOG_INFO( gIndicatorLogFilter, Debug::General, "LoadSharedImage: file name = %s\n", sharedFilename.c_str() );
989 mSharedFileInfo[n].mSharedFile = SharedFile::New( sharedFilename.c_str(), mSharedFileInfo[n].mImageWidth * mSharedFileInfo[n].mImageWidth * 4, true );
990 if( mSharedFileInfo[n].mSharedFile != NULL )
992 mSharedFileInfo[n].mLock = new Indicator::LockFile( mSharedFileInfo[n].mLockFileName );
993 if( mSharedFileInfo[n].mLock->RetrieveAndClearErrorStatus() )
995 DALI_LOG_ERROR( "### Indicator error: Cannot open lock file %s ###\n", mSharedFileInfo[n].mLockFileName.c_str() );
1004 void Indicator::SetupNativeIndicatorImage( Ecore_Ipc_Event_Server_Data *epcEvent )
1006 // Bind tizen remote surface
1007 Eina_Inlist* globals;
1008 Ecore_Wl_Global* global;
1009 struct tizen_remote_surface_manager* remoteSurfaceManager = NULL;
1010 struct tizen_remote_surface* remoteSurface = NULL;
1011 struct wl_registry* registry;
1012 struct wayland_tbm_client* tbmClient;
1013 struct wl_tbm* wlTbm;
1015 if ( !remoteSurfaceManager )
1017 registry = ecore_wl_registry_get();
1018 globals = ecore_wl_globals_get();
1020 if (!registry || !globals)
1022 DALI_LOG_ERROR( "SetupNativeIndicatorImage registry or globals error\n" );
1026 EINA_INLIST_FOREACH(globals, global)
1028 if (!strcmp(global->interface, "tizen_remote_surface_manager"))
1030 remoteSurfaceManager = ( struct tizen_remote_surface_manager* )wl_registry_bind(registry, global->id, &tizen_remote_surface_manager_interface, 1);
1034 if ( !remoteSurfaceManager )
1036 DALI_LOG_ERROR( "SetupNativeIndicatorImage bind error\n" );
1040 tbmClient = ( struct wayland_tbm_client* )wayland_tbm_client_init( ecore_wl_display_get() );
1043 DALI_LOG_ERROR( "SetupNativeIndicatorImage client init error\n" );
1047 wlTbm = ( struct wl_tbm* )wayland_tbm_client_get_wl_tbm( tbmClient );
1050 DALI_LOG_ERROR( "SetupNativeIndicatorImage wl tbm error\n" );
1054 uint32_t resourceId = epcEvent->ref;
1055 remoteSurface = tizen_remote_surface_manager_create_surface( remoteSurfaceManager, resourceId, wlTbm );
1057 if( !remoteSurface )
1059 DALI_LOG_ERROR( "SetupNativeIndicatorImage create surface error\n" );
1063 tizen_remote_surface_add_listener( remoteSurface, &remoteSurfaceCallback, this );
1064 tizen_remote_surface_redirect( remoteSurface );
1065 tizen_remote_surface_transfer_visibility( remoteSurface, TIZEN_REMOTE_SURFACE_VISIBILITY_TYPE_VISIBLE);
1068 void Indicator::UpdateIndicatorImage( Any source )
1070 if( !mNativeImageSource )
1072 mNativeImageSource = Dali::NativeImageSource::New( source );
1073 Dali::NativeImage nativeImage = Dali::NativeImage::New( *mNativeImageSource );
1075 SetForegroundNativeImage( nativeImage );
1076 mIndicatorContentActor.SetSize( mImageWidth, mImageHeight );
1077 mIndicatorActor.SetSize( mImageWidth, mImageHeight );
1078 mEventActor.SetSize( mImageWidth, mImageHeight );
1084 mNativeImageSource->SetSource( source );
1085 Dali::Stage::GetCurrent().KeepRendering( 0.0f );
1088 void Indicator::UpdateVisibility()
1090 if( CheckVisibleState() )
1092 // set default indicator type (enable the quick panel)
1093 OnIndicatorTypeChanged( INDICATOR_TYPE_1 );
1097 // set default indicator type (disable the quick panel)
1098 OnIndicatorTypeChanged( INDICATOR_TYPE_2 );
1103 mIndicatorContentActor.SetPosition( 0.0f, -mImageHeight, 0.0f );
1106 SetVisible(mVisible, true);
1109 void Indicator::UpdateImageData( int bufferNumber )
1111 DALI_LOG_TRACE_METHOD_FMT( gIndicatorLogFilter, "State: %s mVisible: %s", STATE_DEBUG_STRING(mState), mVisible?"T":"F" );
1113 if( mState == CONNECTED && mVisible )
1117 // in case of shm indicator (not pixmap), not sure we can skip it when mIsShowing is false
1118 CopyToBuffer( bufferNumber );
1124 mAdaptor->RequestUpdateOnce();
1130 bool Indicator::CopyToBuffer( int bufferNumber )
1132 bool success = false;
1134 if( mSharedFileInfo[bufferNumber].mLock )
1136 Indicator::ScopedLock scopedLock(mSharedFileInfo[bufferNumber].mLock);
1137 if( mSharedFileInfo[bufferNumber].mLock->RetrieveAndClearErrorStatus() )
1141 else if( scopedLock.IsLocked() )
1143 unsigned char *src = mSharedFileInfo[bufferNumber].mSharedFile->GetAddress();
1144 size_t size = mSharedFileInfo[bufferNumber].mImageWidth * mSharedFileInfo[bufferNumber].mImageHeight * 4;
1146 if( mIndicatorBuffer->UpdatePixels( src, size ) )
1148 mAdaptor->RequestUpdateOnce();
1157 void Indicator::LoadPixmapImage( Ecore_Ipc_Event_Server_Data *epcEvent )
1161 void Indicator::CreateNewPixmapImage()
1165 void Indicator::CreateNewImage( int bufferNumber )
1167 DALI_LOG_TRACE_METHOD_FMT( gIndicatorLogFilter, "W:%d H:%d", mSharedFileInfo[bufferNumber].mImageWidth, mSharedFileInfo[bufferNumber].mImageHeight );
1168 mIndicatorBuffer = new IndicatorBuffer( mAdaptor, mSharedFileInfo[bufferNumber].mImageWidth, mSharedFileInfo[bufferNumber].mImageHeight, Pixel::BGRA8888 );
1169 bool success = false;
1171 if( CopyToBuffer( bufferNumber ) ) // Only create images if we have valid image buffer
1173 Dali::Texture texture = Dali::Texture::New( mIndicatorBuffer->GetNativeImage() );
1176 SetForegroundImage( texture );
1183 DALI_LOG_WARNING("### Cannot create indicator image - disconnecting ###\n");
1185 if( mObserver != NULL )
1187 mObserver->IndicatorClosed( this );
1189 // Don't do connection in this callback - strange things happen!
1190 StartReconnectionTimer();
1194 Dali::Geometry Indicator::CreateBackgroundGeometry()
1196 switch( mOpacityMode )
1198 case Dali::Window::TRANSLUCENT:
1199 if( !mTranslucentGeometry )
1201 // Construct 5 interval mesh
1215 struct BackgroundVertex
1221 unsigned int numVertices = 2 * ( NUM_GRADIENT_INTERVALS + 1 );
1222 BackgroundVertex vertices[ numVertices ];
1225 float delta = 1.0f / NUM_GRADIENT_INTERVALS;
1226 BackgroundVertex* currentVertex = vertices;
1227 for( int y = 0; y < NUM_GRADIENT_INTERVALS + 1; ++y, d += delta )
1229 currentVertex->mPosition = Vector2( -0.5f, d );
1230 currentVertex->mAlpha = GRADIENT_ALPHA[ y ];
1233 currentVertex->mPosition = Vector2( 0.5f, d );
1234 currentVertex->mAlpha = GRADIENT_ALPHA[ y ];
1239 unsigned int numIndices = 2 * 3 * NUM_GRADIENT_INTERVALS;
1240 unsigned short indices[ numIndices ];
1242 unsigned short* currentIndex = indices;
1243 for( int y = 0; y < NUM_GRADIENT_INTERVALS; ++y )
1245 *currentIndex++ = (2 * y);
1246 *currentIndex++ = (2 * y) + 3;
1247 *currentIndex++ = (2 * y) + 1;
1249 *currentIndex++ = (2 * y);
1250 *currentIndex++ = (2 * y) + 2;
1251 *currentIndex++ = (2 * y) + 3;
1254 Dali::Property::Map vertexFormat;
1255 vertexFormat[ "aPosition" ] = Dali::Property::VECTOR2;
1256 vertexFormat[ "aAlpha" ] = Dali::Property::FLOAT;
1257 Dali::PropertyBuffer vertexPropertyBuffer = Dali::PropertyBuffer::New( vertexFormat );
1258 vertexPropertyBuffer.SetData( vertices, numVertices );
1260 // Create the geometry object
1261 mTranslucentGeometry = Dali::Geometry::New();
1262 mTranslucentGeometry.AddVertexBuffer( vertexPropertyBuffer );
1263 mTranslucentGeometry.SetIndexBuffer( &indices[0], numIndices );
1266 return mTranslucentGeometry;
1267 case Dali::Window::OPAQUE:
1269 if( !mSolidGeometry )
1272 struct BackgroundVertex
1278 BackgroundVertex vertices[ 4 ] = { { Vector2( -0.5f, -0.5f ), 1.0f }, { Vector2( 0.5f, -0.5f ), 1.0f },
1279 { Vector2( -0.5f, 0.5f ), 1.0f }, { Vector2( 0.5f, 0.5f ), 1.0f } };
1282 unsigned short indices[ 6 ] = { 0, 3, 1, 0, 2, 3 };
1284 Dali::Property::Map vertexFormat;
1285 vertexFormat[ "aPosition" ] = Dali::Property::VECTOR2;
1286 vertexFormat[ "aAlpha" ] = Dali::Property::FLOAT;
1287 Dali::PropertyBuffer vertexPropertyBuffer = Dali::PropertyBuffer::New( vertexFormat );
1288 vertexPropertyBuffer.SetData( vertices, 4 );
1291 // Create the geometry object
1292 mSolidGeometry = Dali::Geometry::New();
1293 mSolidGeometry.AddVertexBuffer( vertexPropertyBuffer );
1294 mSolidGeometry.SetIndexBuffer( &indices[0], 6 );
1297 return mSolidGeometry;
1298 case Dali::Window::TRANSPARENT:
1302 return Dali::Geometry();
1305 void Indicator::SetForegroundImage( Dali::Texture texture )
1307 if( !mForegroundRenderer && texture )
1310 Dali::Shader shader = Dali::Shader::New( FOREGROUND_VERTEX_SHADER, FOREGROUND_FRAGMENT_SHADER );
1312 // Create renderer from geometry and material
1313 Dali::Geometry quad = CreateQuadGeometry();
1314 mForegroundRenderer = Dali::Renderer::New( quad, shader );
1315 // Make sure the foreground stays in front of the background
1316 mForegroundRenderer.SetProperty( Dali::Renderer::Property::DEPTH_INDEX, 1.f );
1318 // Set blend function
1319 mForegroundRenderer.SetProperty( Dali::Renderer::Property::BLEND_FACTOR_SRC_RGB, Dali::BlendFactor::ONE );
1320 mForegroundRenderer.SetProperty( Dali::Renderer::Property::BLEND_FACTOR_DEST_RGB, Dali::BlendFactor::ONE_MINUS_SRC_ALPHA );
1321 mForegroundRenderer.SetProperty( Dali::Renderer::Property::BLEND_FACTOR_SRC_ALPHA, Dali::BlendFactor::ONE );
1322 mForegroundRenderer.SetProperty( Dali::Renderer::Property::BLEND_FACTOR_DEST_ALPHA, Dali::BlendFactor::ONE );
1324 // Create a texture-set and add to renderer
1326 Dali::TextureSet textureSet = Dali::TextureSet::New();
1327 textureSet.SetTexture( 0u, texture );
1328 mForegroundRenderer.SetTextures( textureSet );
1330 mIndicatorContentActor.AddRenderer( mForegroundRenderer );
1332 else if( mForegroundRenderer )
1334 Dali::TextureSet textureSet = mForegroundRenderer.GetTextures();
1335 textureSet.SetTexture( 0u, texture );
1338 if( mImageWidth == 0 && mImageHeight == 0 && texture)
1340 Resize( texture.GetWidth(), texture.GetHeight() );
1344 void Indicator::SetForegroundNativeImage( Dali::Image image )
1346 if( !mForegroundRenderer && image )
1349 std::string fragmentShader = "#extension GL_OES_EGL_image_external:require\n";
1350 fragmentShader += "\n";
1351 fragmentShader += FOREGROUND_TBM_FRAGMENT_SHADER;
1354 Dali::Shader shader = Dali::Shader::New( FOREGROUND_VERTEX_SHADER, fragmentShader );
1356 // Create renderer from geometry and material
1357 Dali::Geometry quad = CreateQuadGeometry();
1358 mForegroundRenderer = Dali::Renderer::New( quad, shader );
1359 // Make sure the foreground stays in front of the background
1360 mForegroundRenderer.SetProperty( Dali::Renderer::Property::DEPTH_INDEX, 1.f );
1362 // Set blend function
1363 mForegroundRenderer.SetProperty( Dali::Renderer::Property::BLEND_FACTOR_SRC_RGB, Dali::BlendFactor::ONE );
1364 mForegroundRenderer.SetProperty( Dali::Renderer::Property::BLEND_FACTOR_DEST_RGB, Dali::BlendFactor::ONE_MINUS_SRC_ALPHA );
1365 mForegroundRenderer.SetProperty( Dali::Renderer::Property::BLEND_FACTOR_SRC_ALPHA, Dali::BlendFactor::ONE );
1366 mForegroundRenderer.SetProperty( Dali::Renderer::Property::BLEND_FACTOR_DEST_ALPHA, Dali::BlendFactor::ONE );
1368 // Create a texture-set and add to renderer
1370 Dali::TextureSet textureSet = Dali::TextureSet::New();
1371 Dali::TextureSetImage( textureSet, 0u, image );
1373 mForegroundRenderer.SetTextures( textureSet );
1375 mIndicatorContentActor.AddRenderer( mForegroundRenderer );
1377 else if( mForegroundRenderer )
1379 Dali::TextureSet textureSet = mForegroundRenderer.GetTextures();
1380 Dali::TextureSetImage( textureSet, 0u, image );
1383 if( mImageWidth == 0 && mImageHeight == 0 && image )
1385 Resize( image.GetWidth(), image.GetHeight() );
1389 void Indicator::OnIndicatorTypeChanged( Type indicatorType )
1391 if( mObserver != NULL )
1393 mObserver->IndicatorTypeChanged( indicatorType );
1397 void Indicator::DataReceived( void* event )
1399 DALI_LOG_TRACE_METHOD( gIndicatorLogFilter );
1400 Ecore_Ipc_Event_Server_Data *epcEvent = static_cast<Ecore_Ipc_Event_Server_Data *>( event );
1402 switch( epcEvent->minor )
1406 DALI_LOG_INFO( gIndicatorLogFilter, Debug::General, "Indicator client received: OP_UPDATE\n" );
1409 mAdaptor->RequestUpdateOnce();
1413 case OP_UPDATE_DONE:
1415 DALI_LOG_INFO( gIndicatorLogFilter, Debug::General, "Indicator client received: OP_UPDATE_DONE [%d]\n", epcEvent->response );
1416 // epcEvent->response == display buffer #
1417 UpdateImageData( epcEvent->response );
1422 DALI_LOG_INFO( gIndicatorLogFilter, Debug::General, "Indicator client received: OP_SHM_REF0\n" );
1423 SetSharedImageInfo( epcEvent );
1428 DALI_LOG_INFO( gIndicatorLogFilter, Debug::General, "Indicator client received: OP_SHM_REF1\n" );
1429 SetLockFileInfo( epcEvent );
1434 DALI_LOG_INFO( gIndicatorLogFilter, Debug::General, "Indicator client received: OP_SHM_REF2\n" );
1435 LoadSharedImage( epcEvent );
1440 DALI_LOG_INFO( gIndicatorLogFilter, Debug::General, "Indicator client received: OP_GL_REF\n" );
1441 SetupNativeIndicatorImage( epcEvent );
1446 DALI_LOG_INFO( gIndicatorLogFilter, Debug::General, "Indicator client received: OP_RESIZE\n" );
1448 if( (epcEvent->data) && (epcEvent->size >= (int)sizeof(IpcDataResize)) )
1450 IpcDataResize *newSize = static_cast<IpcDataResize*>( epcEvent->data );
1451 Resize( newSize->w, newSize->h );
1457 int msgDomain = epcEvent->ref;
1458 int msgId = epcEvent->ref_to;
1460 void *msgData = NULL;
1461 int msgDataSize = 0;
1462 msgData = epcEvent->data;
1463 msgDataSize = epcEvent->size;
1465 DALI_LOG_INFO( gIndicatorLogFilter, Debug::General, "Indicator client received: OP_MSG_PARENT. msgDomain = %d\n", msgDomain );
1467 if( msgDomain == MSG_DOMAIN_CONTROL_INDICATOR )
1471 case MSG_ID_INDICATOR_TYPE:
1473 DALI_LOG_INFO( gIndicatorLogFilter, Debug::General, "Indicator client received: OP_MSG_PARENT, INDICATOR_TYPE\n" );
1474 Type* indicatorType = static_cast<Type*>( epcEvent->data );
1475 OnIndicatorTypeChanged( *indicatorType );
1479 case MSG_ID_INDICATOR_START_ANIMATION:
1481 DALI_LOG_INFO( gIndicatorLogFilter, Debug::General, "Indicator client received: MSG_ID_INDICATOR_START_ANIMATION\n" );
1483 if (msgDataSize != (int)sizeof(IpcIndicatorDataAnimation))
1485 DALI_LOG_ERROR("Message data is incorrect\n");
1489 IpcIndicatorDataAnimation *animData = static_cast<IpcIndicatorDataAnimation*>(msgData);
1491 if(!CheckVisibleState())
1493 ShowIndicator( animData->duration /* n sec */ );
1504 void Indicator::ConnectionClosed()
1506 DALI_LOG_TRACE_METHOD( gIndicatorLogFilter );
1508 // Will get this callback if the server connection failed to start up.
1509 delete mServerConnection;
1510 mServerConnection = NULL;
1511 mState = DISCONNECTED;
1513 // Attempt to re-connect
1517 bool Indicator::CheckVisibleState()
1519 if( mOrientation == Dali::Window::LANDSCAPE
1520 || mOrientation == Dali::Window::LANDSCAPE_INVERSE
1521 || (mVisible == Dali::Window::INVISIBLE)
1522 || (mVisible == Dali::Window::AUTO && !mIsShowing) )
1530 void Indicator::ClearSharedFileInfo()
1532 for( int i = 0; i < SHARED_FILE_NUMBER; i++ )
1534 delete mSharedFileInfo[i].mLock;
1535 mSharedFileInfo[i].mLock = NULL;
1537 delete mSharedFileInfo[i].mSharedFile;
1538 mSharedFileInfo[i].mSharedFile = NULL;
1540 mSharedFileInfo[i].mLockFileName.clear();
1541 mSharedFileInfo[i].mSharedFileName.clear();
1546 * duration can be this
1550 * KEEP_SHOWING = -1,
1554 void Indicator::ShowIndicator(float duration)
1556 if( !mIndicatorAnimation )
1558 mIndicatorAnimation = Dali::Animation::New(SLIDING_ANIMATION_DURATION);
1559 mIndicatorAnimation.FinishedSignal().Connect(this, &Indicator::OnAnimationFinished);
1562 if(mIsShowing && !EqualsZero(duration))
1564 // If need to show during showing, do nothing.
1565 // In 2nd phase (below) will update timer
1567 else if(!mIsShowing && mIsAnimationPlaying && EqualsZero(duration))
1569 // If need to hide during hiding or hidden already, do nothing
1573 mIndicatorAnimation.Clear();
1575 if( EqualsZero(duration) )
1577 mIndicatorAnimation.AnimateTo( Property( mIndicatorContentActor, Dali::Actor::Property::POSITION ), Vector3(0, -mImageHeight, 0), Dali::AlphaFunction::EASE_OUT );
1581 OnIndicatorTypeChanged( INDICATOR_TYPE_2 ); // un-toucable
1585 mIndicatorAnimation.AnimateTo( Property( mIndicatorContentActor, Dali::Actor::Property::POSITION ), Vector3(0, 0, 0), Dali::AlphaFunction::EASE_OUT );
1589 OnIndicatorTypeChanged( INDICATOR_TYPE_1 ); // touchable
1592 mIndicatorAnimation.Play();
1593 mIsAnimationPlaying = true;
1600 mShowTimer = Dali::Timer::New(1000 * duration);
1601 mShowTimer.TickSignal().Connect(this, &Indicator::OnShowTimer);
1603 mShowTimer.SetInterval(1000* duration);
1606 if( mVisible == Dali::Window::AUTO )
1608 // check the stage touch
1609 Dali::Stage::GetCurrent().TouchedSignal().Connect( this, &Indicator::OnStageTouched );
1614 if(mShowTimer && mShowTimer.IsRunning())
1619 if( mVisible == Dali::Window::AUTO )
1621 // check the stage touch
1622 Dali::Stage::GetCurrent().TouchedSignal().Disconnect( this, &Indicator::OnStageTouched );
1627 bool Indicator::OnShowTimer()
1629 // after time up, hide indicator
1630 ShowIndicator( HIDE_NOW );
1635 void Indicator::OnAnimationFinished(Dali::Animation& animation)
1637 mIsAnimationPlaying = false;
1638 // once animation is finished and indicator is hidden, take it off stage
1639 if( mObserver != NULL )
1641 mObserver->IndicatorVisibilityChanged( mIsShowing ); // is showing?
1645 void Indicator::OnPan( Dali::Actor actor, const Dali::PanGesture& gesture )
1649 if( mServerConnection )
1651 switch( gesture.state )
1653 case Gesture::Started:
1655 mGestureDetected = false;
1657 // The gesture position is the current position after it has moved by the displacement.
1658 // We want to reference the original position.
1659 mGestureDeltaY = gesture.position.y - gesture.displacement.y;
1662 // No break, Fall through
1663 case Gesture::Continuing:
1665 if( mVisible == Dali::Window::AUTO && !mIsShowing )
1667 // Only take one touch point
1668 if( gesture.numberOfTouches == 1 && mGestureDetected == false )
1670 mGestureDeltaY += gesture.displacement.y;
1672 if( mGestureDeltaY >= mImageHeight * SHOWING_DISTANCE_HEIGHT_RATE )
1674 ShowIndicator( AUTO_INDICATOR_STAY_DURATION );
1675 mGestureDetected = true;
1683 case Gesture::Finished:
1684 case Gesture::Cancelled:
1686 // if indicator is showing, hide again when touching is finished (Since touch leave is activated, checking it in gesture::finish instead of touch::up)
1687 if( mVisible == Dali::Window::AUTO && mIsShowing )
1689 ShowIndicator( AUTO_INDICATOR_STAY_DURATION );
1701 void Indicator::OnStageTouched(const Dali::TouchEvent& touchEvent)
1703 const TouchPoint& touchPoint = touchEvent.GetPoint( 0 );
1705 // when stage is touched while indicator is showing temporary, hide it
1706 if( mIsShowing && ( CheckVisibleState() == false || mVisible == Dali::Window::AUTO ) )
1708 switch( touchPoint.state )
1710 case Dali::PointState::DOWN:
1712 // if touch point is inside the indicator, indicator is not hidden
1713 if( mImageHeight < int(touchPoint.screen.y) )
1715 ShowIndicator( HIDE_NOW );