X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fdevel-api%2Fadaptor-framework%2Fapplication-devel.cpp;h=b33f173df9f95a1035c487bdd83dbee1498a574c;hb=HEAD;hp=196664acb7589f77465fa594fa1be2f2b05e06f1;hpb=977120877a7ebd86c03239e4c6812ebc1259f09d;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/devel-api/adaptor-framework/application-devel.cpp b/dali/devel-api/adaptor-framework/application-devel.cpp index 196664a..b33f173 100644 --- a/dali/devel-api/adaptor-framework/application-devel.cpp +++ b/dali/devel-api/adaptor-framework/application-devel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -17,18 +17,47 @@ // INTERNAL INCLUDES #include +#include +#include #include +#include namespace Dali { - namespace DevelApplication { +Application New(int* argc, char** argv[], const std::string& stylesheet, Application::WINDOW_MODE windowMode, PositionSize positionSize, WindowType type) +{ + Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::GetPreInitializedApplication(); + if(internal) + { + // Set Defaut Window type + internal->SetDefaultWindowType(type); + + // pre-initialized application + internal->SetCommandLineOptions(argc, argv); + internal->SetStyleSheet(stylesheet); + internal->GetWindow().SetTransparency((windowMode == Application::TRANSPARENT)); + + // Store only the value before adaptor is created + internal->StoreWindowPositionSize(positionSize); + } + else + { + WindowData windowData; + windowData.SetPositionSize(positionSize); + windowData.SetTransparency(windowMode == Application::TRANSPARENT); + windowData.SetWindowType(type); + + internal = Internal::Adaptor::Application::New(argc, argv, stylesheet, Internal::Adaptor::Framework::NORMAL, false, windowData); + } + return Application(internal.Get()); +} -bool AddIdleWithReturnValue( Application application, CallbackBase* callback ) +bool AddIdleWithReturnValue(Application application, CallbackBase* callback) { - return Internal::Adaptor::GetImplementation( application ).AddIdle( callback, true ); + return Internal::Adaptor::GetImplementation(application).AddIdle(callback, true); } std::string GetDataPath() @@ -36,13 +65,37 @@ std::string GetDataPath() return Internal::Adaptor::Application::GetDataPath(); } +Application DownCast(Dali::RefObject* refObject) +{ + return Application(dynamic_cast(refObject)); +} + +CustomCommandReceivedSignalType& CustomCommandReceivedSignal(Application application) +{ + DALI_ASSERT_ALWAYS(Adaptor::IsAvailable() && "Adaptor is not available") + + Internal::Adaptor::NetworkServicePtr networkService = Internal::Adaptor::NetworkService::Get(); + + DALI_ASSERT_ALWAYS(networkService && "Network Service Unavailable"); + + return networkService->CustomCommandReceivedSignal(); +} + +int32_t GetRenderThreadId(Application application) +{ + return Internal::Adaptor::GetImplementation(application).GetRenderThreadId(); +} + +void FlushUpdateMessages(Application application) +{ + Internal::Adaptor::GetImplementation(application).FlushUpdateMessages(); +} + } // namespace DevelApplication } // namespace Dali -extern "C" -void PreInitialize( int* argc, char** argv[] ) +extern "C" void ApplicationPreInitialize(int* argc, char** argv[]) { - Dali::Internal::Adaptor::Application::PreInitialize( argc, argv ); + Dali::Internal::Adaptor::Application::PreInitialize(argc, argv); } -