/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
#include <dali/internal/adaptor/common/adaptor-impl.h>
// EXTERNAL INCLUDES
-#include <dali/public-api/common/dali-common.h>
#include <dali/public-api/common/stage.h>
#include <dali/public-api/actors/layer.h>
#include <dali/devel-api/actors/actor-devel.h>
#include <dali/integration-api/events/touch-event-integ.h>
// INTERNAL INCLUDES
+#include <dali/public-api/dali-adaptor-common.h>
#include <dali/internal/system/common/thread-controller.h>
#include <dali/internal/system/common/performance-interface-factory.h>
#include <dali/internal/adaptor/common/lifecycle-observer.h>
#include <dali/devel-api/text-abstraction/font-client.h>
#include <dali/internal/system/common/callback-manager.h>
-#include <dali/devel-api/adaptor-framework/render-surface.h>
#include <dali/internal/accessibility/common/tts-player-impl.h>
#include <dali/internal/accessibility/common/accessibility-adaptor-impl.h>
#include <dali/internal/input/common/gesture-manager.h>
#include <dali/internal/graphics/gles20/egl-sync-implementation.h>
#include <dali/internal/graphics/common/egl-image-extensions.h>
#include <dali/internal/graphics/gles20/egl-factory.h>
-#include <dali/internal/input/common/imf-manager-impl.h>
#include <dali/internal/clipboard/common/clipboard-impl.h>
#include <dali/internal/graphics/common/vsync-monitor.h>
#include <dali/internal/system/common/object-profiler.h>
#include <dali/internal/window-system/common/display-connection.h>
#include <dali/internal/window-system/common/window-impl.h>
+#include <dali/internal/window-system/common/window-render-surface.h>
#include <dali/internal/system/common/logging.h>
#include <dali/devel-api/adaptor-framework/image-loading.h>
mPerformanceInterface = PerformanceInterfaceFactory::CreateInterface( *this, *mEnvironmentOptions );
}
+ mEnvironmentOptions->CreateTraceManager( mPerformanceInterface );
+ mEnvironmentOptions->InstallTraceFunction(); // install tracing for main thread
+
mCallbackManager = CallbackManager::New();
PositionSize size = mSurface->GetPositionSize();
unsigned int dpiHor, dpiVer;
dpiHor = dpiVer = 0;
- Dali::DisplayConnection::GetDpi(dpiHor, dpiVer);
+ mSurface->GetDpi( dpiHor, dpiVer );
// tell core about the DPI value
mCore->SetDpi(dpiHor, dpiVer);
return mTtsPlayers[mode];
}
-bool Adaptor::AddIdle( CallbackBase* callback, bool forceAdd )
+bool Adaptor::AddIdle( CallbackBase* callback, bool hasReturnValue, bool forceAdd )
{
bool idleAdded(false);
// Only add an idle if the Adaptor is actually running
if( RUNNING == mState || READY == mState || forceAdd )
{
- idleAdded = mCallbackManager->AddIdleCallback( callback );
+ idleAdded = mCallbackManager->AddIdleCallback( callback, hasReturnValue );
}
return idleAdded;
// and we haven't installed the idle notification
if( ( ! mNotificationOnIdleInstalled ) && ( RUNNING == mState || READY == mState || forceProcess ) )
{
- mNotificationOnIdleInstalled = AddIdle( MakeCallback( this, &Adaptor::ProcessCoreEventsFromIdle ), forceProcess );
+ mNotificationOnIdleInstalled = AddIdleEnterer( MakeCallback( this, &Adaptor::ProcessCoreEventsFromIdle ), forceProcess );
}
}
// to start processing messages for new camera setup etc as soon as possible
ProcessCoreEvents();
- // this method blocks until the render thread has completed the resizing.
mThreadController->ResizeSurface();
}
RequestUpdateOnce();
}
+const LogFactoryInterface& Adaptor::GetLogFactory()
+{
+ return *mEnvironmentOptions;
+}
+
void Adaptor::RequestUpdateOnce()
{
if( mThreadController )
mCore->SetTopMargin(height);
}
-void Adaptor::ProcessCoreEventsFromIdle()
+bool Adaptor::ProcessCoreEventsFromIdle()
{
ProcessCoreEvents();
// the idle handle automatically un-installs itself
mNotificationOnIdleInstalled = false;
+
+ return false;
}
Adaptor::Adaptor(Any nativeWindow, Dali::Adaptor& adaptor, RenderSurface* surface, EnvironmentOptions* environmentOptions)
static_cast< LayoutDirection::Type >( Internal::Adaptor::Locale::GetDirection( std::string( locale ) ) ) );
}
+bool Adaptor::AddIdleEnterer( CallbackBase* callback, bool forceAdd )
+{
+ bool idleAdded( false );
+
+ // Only add an idle if the Adaptor is actually running
+ if( RUNNING == mState || READY == mState || forceAdd )
+ {
+ idleAdded = mCallbackManager->AddIdleEntererCallback( callback );
+ }
+
+ return idleAdded;
+}
+
+void Adaptor::RemoveIdleEnterer( CallbackBase* callback )
+{
+ mCallbackManager->RemoveIdleEntererCallback( callback );
+}
+
} // namespace Adaptor
} // namespace Internal