X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit%2Fdali-toolkit-test-utils%2Ftoolkit-test-application.h;h=5cc5befc8fd21a46945f4cac1212e2c5d98e0f21;hb=f4c1e7f52d49c3ce033b9ee4c3c7414b06a22d45;hp=a90881c87661f4cb5f8b848b0e2e77d773d836be;hpb=fa6279fb2830427d5ab569ca14e6ade1557ef2fa;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-test-application.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-test-application.h index a90881c..5cc5bef 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-test-application.h +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-test-application.h @@ -1,27 +1,28 @@ #ifndef __DALI_TOOLKIT_TEST_APPLICATION_H__ #define __DALI_TOOLKIT_TEST_APPLICATION_H__ -// -// Copyright (c) 2014 Samsung Electronics Co., Ltd. -// -// Licensed under the Flora License, Version 1.0 (the License); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://floralicense.org/license/ -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// +/* + * Copyright (c) 2016 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ // INTERNAL INCLUDES #include - -#include "toolkit-adaptor.h" -#include "toolkit-orientation.h" +#include +#include +#include namespace Dali { @@ -40,6 +41,13 @@ public: : TestApplication( false, surfaceWidth, surfaceHeight, horizontalDpi, verticalDpi ) { Initialize(); + + // set the DPI value for font rendering + Dali::TextAbstraction::FontClient fontClient = Dali::TextAbstraction::FontClient::Get(); + if( fontClient ) + { + fontClient.SetDpi( mDpi.x, mDpi.y ); + } } ~ToolkitTestApplication() @@ -49,30 +57,48 @@ public: mCore = NULL; } - inline ToolkitAdaptor& GetAdaptor() - { - return mAdaptor; - } - //ToolkitOrientation& GetOrientation() //{ //return mOrientation; //} + /** + * @brief Creates an adaptor implementation for those controls like the + * text-field and the text-editor which connects a callback to the idle signal. + */ + void CreateAdaptor() + { + Adaptor::Get(); + } + + /** + * @brief Executes the idle callbacks. + * + * Some controls like the text-field and the text-editor connect callbacks to the + * idle signal. + */ + void RunIdles() + { + if( Adaptor::IsAvailable() ) + { + for( Vector::Iterator it = Internal::Adaptor::Adaptor::mCallbacks.Begin(), + endIt = Internal::Adaptor::Adaptor::mCallbacks.End(); + it != endIt; + ++it ) + { + CallbackBase* callback = *it; + + CallbackBase::Execute( *callback ); + } + + Internal::Adaptor::Adaptor::mCallbacks.Clear(); + } + } + private: - ToolkitAdaptor mAdaptor; //ToolkitOrientation mOrientation; }; } // namespace Dali -inline ImageActor CreateSolidColorImageActor(ToolkitTestApplication& application, const Vector4& color, int width, int height) -{ - ImageActor actor = ImageActor::New(CreateBitmapImage(width, height, color)); - application.SendNotification(); - application.Render(); - return actor; -} - - #endif // __DALI_TOOLKIT_TEST_APPLICATION_H__