/*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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/public-api/dali-adaptor-common.h>
#include <dali/internal/graphics/gles/egl-graphics-factory.h>
-#include <dali/internal/graphics/gles/egl-graphics.h> // Temporary until Core is abstracted
+#include <dali/internal/graphics/gles/egl-graphics.h>
#include <dali/devel-api/text-abstraction/font-client.h>
#include <dali/internal/system/common/callback-manager.h>
#include <dali/internal/system/common/object-profiler.h>
#include <dali/internal/system/common/system-factory.h>
-#include <dali/internal/text-clipboard/common/text-clipboard-impl.h>
#include <dali/internal/window-system/common/display-connection.h>
#include <dali/internal/window-system/common/display-utils.h> // For Utils::MakeUnique
#include <dali/internal/window-system/common/event-handler.h>
mGraphics->GetStencilBufferRequired(),
mGraphics->GetPartialUpdateRequired());
+ // Create TextureUploadManager after mCore created
+ mTextureUploadManager = Dali::Devel::TextureUploadManager::Get();
+
defaultWindow->SetAdaptor(Get());
Dali::Integration::SceneHolder defaultSceneHolder(defaultWindow);
mConfigurationManager = Utils::MakeUnique<ConfigurationManager>(systemCachePath, mGraphics.get(), mThreadController);
}
-void Adaptor::AccessibilityObserver::OnAccessibleKeyEvent(const Dali::KeyEvent& event)
-{
- Accessibility::KeyEventType type;
- if(event.GetState() == Dali::KeyEvent::DOWN)
- {
- type = Accessibility::KeyEventType::KEY_PRESSED;
- }
- else if(event.GetState() == Dali::KeyEvent::UP)
- {
- type = Accessibility::KeyEventType::KEY_RELEASED;
- }
- else
- {
- return;
- }
- Dali::Accessibility::Bridge::GetCurrentBridge()->Emit(type, event.GetKeyCode(), event.GetKeyName(), event.GetTime(), !event.GetKeyString().empty());
-}
-
Adaptor::~Adaptor()
{
Accessibility::Bridge::GetCurrentBridge()->Terminate();
auto bridge = Accessibility::Bridge::GetCurrentBridge();
bridge->SetApplicationName(appName);
bridge->Initialize();
- Dali::Stage::GetCurrent().KeyEventSignal().Connect(&mAccessibilityObserver, &AccessibilityObserver::OnAccessibleKeyEvent);
Dali::Internal::Adaptor::SceneHolder* defaultWindow = mWindows.front();
mState = STOPPED;
+ RemoveSystemInformation();
+
DALI_LOG_RELEASE_INFO("Adaptor::Stop\n");
}
}
return mTtsPlayers[mode];
}
-bool Adaptor::AddIdle(CallbackBase* callback, bool hasReturnValue, bool forceAdd)
+bool Adaptor::AddIdle(CallbackBase* callback, bool hasReturnValue)
{
bool idleAdded(false);
- // Only add an idle if the Adaptor is actually running
- if(RUNNING == mState || READY == mState || forceAdd)
+ // We want to run the processes even when paused
+ if(STOPPED != mState)
{
idleAdded = mCallbackManager->AddIdleCallback(callback, hasReturnValue);
}
+ if(!idleAdded)
+ {
+ // Delete callback
+ delete callback;
+ }
+
return idleAdded;
}
windows = mWindows;
}
+Devel::TextureUploadManager& Adaptor::GetTextureUploadManager()
+{
+ return mTextureUploadManager;
+}
+
void Adaptor::DestroyTtsPlayer(Dali::TtsPlayer::Mode mode)
{
if(mTtsPlayers[mode])
}
}
+void Adaptor::FlushUpdateMessages()
+{
+ if(mCore)
+ {
+ DALI_TRACE_SCOPE(gTraceFilter, "DALI_FLUSH_UPDATE_MESSAGES");
+
+ mCore->ForceRelayout();
+ }
+}
+
void Adaptor::ProcessCoreEvents()
{
if(mCore)
if(!mNotificationOnIdleInstalled)
{
// If we haven't installed the idle notification, install it idle enterer.
- mNotificationOnIdleInstalled = AddIdleEnterer(MakeCallback(this, &Adaptor::ProcessCoreEventsFromIdle), true);
+ mNotificationOnIdleInstalled = AddIdleEnterer(MakeCallback(this, &Adaptor::ProcessCoreEventsFromIdle));
}
else
{
ProcessCoreEvents();
}
+void Adaptor::IncreaseSurfaceResizeCounter()
+{
+ // Nofify surface resizing before flushing event queue
+ if(mThreadController)
+ {
+ mThreadController->ResizeSurface();
+ }
+}
+
void Adaptor::NotifySceneCreated()
{
GetCore().SceneCreated();
return *mEnvironmentOptions;
}
+const TraceFactoryInterface& Adaptor::GetTraceFactory()
+{
+ return *mEnvironmentOptions;
+}
+
void Adaptor::RegisterProcessor(Integration::Processor& processor, bool postProcessor)
{
GetCore().RegisterProcessor(processor, postProcessor);
mPerformanceInterface(nullptr),
mKernelTracer(),
mSystemTracer(),
+ mTextureUploadManager(),
mObjectProfiler(nullptr),
mMemoryPoolTimerSlotDelegate(this),
mSocketFactory(),
}
}
-bool Adaptor::AddIdleEnterer(CallbackBase* callback, bool forceAdd)
+bool Adaptor::AddIdleEnterer(CallbackBase* callback)
{
bool idleAdded(false);
- // Only add an idle if the Adaptor is actually running
- if(RUNNING == mState || READY == mState || forceAdd)
+ // We want to run the processes even when paused
+ if(STOPPED != mState)
{
idleAdded = mCallbackManager->AddIdleEntererCallback(callback);
}