DALI_TEST_CHECK(!image3);
END_TEST;
}
-
-int UtcDaliDefaultControlsCreatePushButton(void)
-{
- ToolkitTestApplication application;
-
- tet_infoline(" UtcDaliDefaultControlsCreatePushButton");
-
- const std::string imagePath( "Facke image path" );
- const std::string voidImagePath( "" );
-
- ImageActor image = CreateSolidColorActor( Color::RED );
- ImageActor voidImage;
-
- PushButton button0, button1, button2, button3, button4, button5, button6;
-
- try
- {
- button0 = CreatePushButton( voidImagePath, voidImagePath, voidImagePath, voidImagePath, voidImagePath );
- button1 = CreatePushButton( imagePath, voidImagePath, voidImagePath, voidImagePath, voidImagePath );
- button2 = CreatePushButton( voidImagePath, imagePath, voidImagePath, voidImagePath, voidImagePath );
- button3 = CreatePushButton( voidImagePath, voidImagePath, imagePath, voidImagePath, voidImagePath );
- button4 = CreatePushButton( voidImagePath, voidImagePath, voidImagePath, imagePath, voidImagePath );
- button5 = CreatePushButton( voidImagePath, voidImagePath, voidImagePath, voidImagePath, imagePath );
- button6 = CreatePushButton( imagePath, imagePath, imagePath, imagePath, imagePath );
- }
- catch( ... )
- {
- tet_result( TET_FAIL );
- }
-
- DALI_TEST_CHECK( button0 );
- DALI_TEST_CHECK( button1 );
- DALI_TEST_CHECK( button2 );
- DALI_TEST_CHECK( button3 );
- DALI_TEST_CHECK( button4 );
- DALI_TEST_CHECK( button5 );
- DALI_TEST_CHECK( button6 );
-
- try
- {
- button0 = CreatePushButton( voidImage, voidImage, voidImage, voidImage, voidImage );
- button1 = CreatePushButton( image, voidImage, voidImage, voidImage, voidImage );
- button2 = CreatePushButton( voidImage, image, voidImage, voidImage, voidImage );
- button3 = CreatePushButton( voidImage, voidImage, image, voidImage, voidImage );
- button4 = CreatePushButton( voidImage, voidImage, voidImage, image, voidImage );
- button5 = CreatePushButton( voidImage, voidImage, voidImage, voidImage, image );
- button6 = CreatePushButton( image, image, image, image, image );
- }
- catch( ... )
- {
- tet_result( TET_FAIL );
- }
-
- DALI_TEST_CHECK( button0 );
- DALI_TEST_CHECK( button1 );
- DALI_TEST_CHECK( button2 );
- DALI_TEST_CHECK( button3 );
- DALI_TEST_CHECK( button4 );
- DALI_TEST_CHECK( button5 );
- DALI_TEST_CHECK( button6 );
-
- try
- {
- button0 = CreatePushButton( voidImagePath );
- button1 = CreatePushButton( imagePath );
- }
- catch( ... )
- {
- tet_result( TET_FAIL );
- }
-
- DALI_TEST_CHECK( button0 );
- DALI_TEST_CHECK( button1 );
-
- try
- {
- button0 = CreatePushButton( voidImage );
- button1 = CreatePushButton( image );
- }
- catch( ... )
- {
- tet_result( TET_FAIL );
- }
-
- DALI_TEST_CHECK( button0 );
- DALI_TEST_CHECK( button1 );
- END_TEST;
-}
-
-int UtcDaliDefaultControlsCreateCheckBoxButton(void)
-{
- ToolkitTestApplication application;
-
- tet_infoline(" UtcDaliDefaultControlsCreateCheckBoxButton");
-
- const std::string imagePath( "Facke image path" );
- const std::string voidImagePath( "" );
-
- ImageActor image = CreateSolidColorActor( Color::RED );
- ImageActor voidImage;
-
- CheckBoxButton button0, button1, button2, button3, button4, button5;
-
- try
- {
- button0 = CreateCheckBoxButton( voidImagePath, voidImagePath, voidImagePath, voidImagePath );
- button1 = CreateCheckBoxButton( imagePath, voidImagePath, voidImagePath, voidImagePath );
- button2 = CreateCheckBoxButton( voidImagePath, imagePath, voidImagePath, voidImagePath );
- button3 = CreateCheckBoxButton( voidImagePath, voidImagePath, imagePath, voidImagePath );
- button4 = CreateCheckBoxButton( voidImagePath, voidImagePath, voidImagePath, imagePath );
- button5 = CreateCheckBoxButton( imagePath, imagePath, imagePath, imagePath );
- }
- catch( ... )
- {
- tet_result( TET_FAIL );
- }
-
- DALI_TEST_CHECK( button0 );
- DALI_TEST_CHECK( button1 );
- DALI_TEST_CHECK( button2 );
- DALI_TEST_CHECK( button3 );
- DALI_TEST_CHECK( button4 );
- DALI_TEST_CHECK( button5 );
-
- try
- {
- button0 = CreateCheckBoxButton( voidImage, voidImage, voidImage, voidImage );
- button1 = CreateCheckBoxButton( image, voidImage, voidImage, voidImage );
- button2 = CreateCheckBoxButton( voidImage, image, voidImage, voidImage );
- button3 = CreateCheckBoxButton( voidImage, voidImage, image, voidImage );
- button4 = CreateCheckBoxButton( voidImage, voidImage, voidImage, image );
- button5 = CreateCheckBoxButton( image, image, image, image );
- }
- catch( ... )
- {
- tet_result( TET_FAIL );
- }
-
- DALI_TEST_CHECK( button0 );
- DALI_TEST_CHECK( button1 );
- DALI_TEST_CHECK( button2 );
- DALI_TEST_CHECK( button3 );
- DALI_TEST_CHECK( button4 );
- DALI_TEST_CHECK( button5 );
-
- try
- {
- button0 = CreateCheckBoxButton( voidImagePath, voidImagePath );
- button1 = CreateCheckBoxButton( voidImagePath, imagePath );
- button2 = CreateCheckBoxButton( imagePath, voidImagePath );
- button3 = CreateCheckBoxButton( imagePath, imagePath );
- }
- catch( ... )
- {
- tet_result( TET_FAIL );
- }
-
- DALI_TEST_CHECK( button0 );
- DALI_TEST_CHECK( button1 );
- DALI_TEST_CHECK( button2 );
- DALI_TEST_CHECK( button3 );
-
- try
- {
- button0 = CreateCheckBoxButton( voidImage, voidImage );
- button2 = CreateCheckBoxButton( voidImage, image );
- button3 = CreateCheckBoxButton( voidImage, image );
- button4 = CreateCheckBoxButton( image, image );
- }
- catch( ... )
- {
- tet_result( TET_FAIL );
- }
-
- DALI_TEST_CHECK( button0 );
- DALI_TEST_CHECK( button1 );
- DALI_TEST_CHECK( button2 );
- DALI_TEST_CHECK( button3 );
- END_TEST;
-}
#include <dali-toolkit/public-api/controls/buttons/radio-button.h>
#include <dali-toolkit/public-api/controls/control-impl.h>
#include <dali-toolkit/public-api/controls/control.h>
-#include <dali-toolkit/public-api/controls/default-controls/check-button-factory.h>
-#include <dali-toolkit/public-api/controls/default-controls/push-button-factory.h>
#include <dali-toolkit/public-api/controls/default-controls/solid-color-actor.h>
#include <dali-toolkit/public-api/controls/gaussian-blur-view/gaussian-blur-view.h>
#include <dali-toolkit/public-api/controls/image-view/masked-image-view.h>
+++ /dev/null
-/*
- * Copyright (c) 2015 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.
- *
- */
-
-// CLASS HEADER
-#include "check-button-factory.h"
-
-// EXTERNAL INCLUDES
-#include <dali/public-api/actors/image-actor.h>
-#include <dali/public-api/images/resource-image.h>
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/alignment/alignment.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace
-{
-
-Alignment CreateAlignedImage( Actor image )
-{
- Alignment alignmentContainer = Toolkit::Alignment::New();
- alignmentContainer.SetScaling( Toolkit::Alignment::ShrinkToFitKeepAspect );
-
- alignmentContainer.Add( image );
-
- return alignmentContainer;
-}
-
-Alignment CreateAlignedImage( const std::string& imagePath )
-{
- Image image = ResourceImage::New( imagePath );
-
- return CreateAlignedImage( ImageActor::New( image ) );
-}
-
-} // namespace
-
-
-CheckBoxButton CreateCheckBoxButton( const std::string& backgroundImagePath, const std::string& selectedImagePath, const std::string& disabledBackgroundImagePath, const std::string& disabledSelectedImagePath )
-{
- CheckBoxButton button = Toolkit::CheckBoxButton::New();
-
- if( !backgroundImagePath.empty() )
- {
- button.SetBackgroundImage( CreateAlignedImage( backgroundImagePath ) );
- }
-
- if( !selectedImagePath.empty() )
- {
- button.SetSelectedImage( CreateAlignedImage( selectedImagePath ) );
- }
-
- if( !disabledBackgroundImagePath.empty() )
- {
- button.SetDisabledBackgroundImage( CreateAlignedImage( disabledBackgroundImagePath ) );
- }
-
- if( !disabledSelectedImagePath.empty() )
- {
- button.SetDisabledSelectedImage( CreateAlignedImage( disabledSelectedImagePath ) );
- }
-
- return button;
-}
-
-CheckBoxButton CreateCheckBoxButton( Actor backgroundImageActor, Actor selectedImageActor, Actor disabledBackgroundImageActor, Actor disabledSelectedImagActor )
-{
- CheckBoxButton button = Toolkit::CheckBoxButton::New();
-
- if( backgroundImageActor )
- {
- button.SetBackgroundImage( CreateAlignedImage( backgroundImageActor ) );
- }
-
- if( selectedImageActor )
- {
- button.SetSelectedImage( CreateAlignedImage( selectedImageActor ) );
- }
-
- if( disabledBackgroundImageActor )
- {
- button.SetDisabledBackgroundImage( CreateAlignedImage( disabledBackgroundImageActor ) );
- }
-
- if( disabledSelectedImagActor )
- {
- button.SetDisabledSelectedImage( CreateAlignedImage( disabledSelectedImagActor ) );
- }
-
- return button;
-}
-
-CheckBoxButton CreateCheckBoxButton( const std::string& backgroundImagePath, const std::string& selectedImagePath )
-{
- CheckBoxButton button = Toolkit::CheckBoxButton::New();
-
- if( !backgroundImagePath.empty() )
- {
- button.SetBackgroundImage( CreateAlignedImage( backgroundImagePath ) );
- }
-
- if( !selectedImagePath.empty() )
- {
- button.SetSelectedImage( CreateAlignedImage( selectedImagePath ) );
- }
-
- return button;
-}
-
-CheckBoxButton CreateCheckBoxButton( Actor backgroundImageActor, Actor selectedImageActor )
-{
- CheckBoxButton button = Toolkit::CheckBoxButton::New();
-
- if( backgroundImageActor )
- {
- button.SetBackgroundImage( CreateAlignedImage( backgroundImageActor ) );
- }
-
- if( selectedImageActor )
- {
- button.SetSelectedImage( CreateAlignedImage( selectedImageActor ) );
- }
-
- return button;
-}
-
-} // namespace Toolkit
-
-} // namespace Dali
+++ /dev/null
-#ifndef __DALI_TOOLKIT_CHECK_BUTTON_FACTORY_H__
-#define __DALI_TOOLKIT_CHECK_BUTTON_FACTORY_H__
-
-/*
- * Copyright (c) 2015 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 <dali-toolkit/public-api/controls/buttons/check-box-button.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-/**
- * Creates a check box button with the given images.
- * Images will be shrunk to fit the button size keeping their aspect ratio.
- * @note Images won't be scaled to fill the whole button size.
- * @note If an image path is empty, this image is not set to the button.
- *
- * @param[in] backgroundImagePath Image path to be shown as button background.
- * @param[in] selectedImagePath Image path to be shown as selected button.
- * @param[in] disabledBackgroundImagePath Image path to be shown as button isabled background.
- * @param[in] disabledSelectedImagePath Image path to be shown as disabled selected button.
- */
-DALI_IMPORT_API CheckBoxButton CreateCheckBoxButton( const std::string& backgroundImagePath, const std::string& selectedImagePath, const std::string& disabledBackgroundImagePath, const std::string& disabledSelectedImagePath );
-
-/**
- * Creates a check box button with the given images.
- * Images will be shrunk to fit the button size keeping their aspect ratio.
- * @note Images won't be scaled to fill the whole button size.
- * @note If an image is an empty handle, this image is not set to the button.
- *
- * @param[in] backgroundImageActor Image to be shown as button background.
- * @param[in] selectedImageActor Image to be shown as selected button.
- * @param[in] disabledBackgroundImageActor Image to be shown as button disabled background.
- * @param[in] disabledSelectedImagActor Image to be shown as disabled selected button.
- */
-DALI_IMPORT_API CheckBoxButton CreateCheckBoxButton( Actor backgroundImageActor, Actor selectedImageActor, Actor disabledBackgroundImageActor, Actor disabledSelectedImagActor );
-
-/**
- * Creates a check box button with the given background and selected images.
- * Background and selected images will be shrunk to fit the button size keeping their aspect ratio.
- * @note Background and selected images won't be scaled to fill the whole button size.
- *
- * @param[in] backgroundImagePath Image path to be shown as button background.
- * @param[in] selectedImagePath Image path to be shown as selected button.
- */
-DALI_IMPORT_API CheckBoxButton CreateCheckBoxButton( const std::string& backgroundImagePath, const std::string& selectedImagePath );
-
-/**
- * Creates a check box button with the given background and selected images.
- * Background and selected images will be shrunk to fit the button size keeping their aspect ratio.
- * @note Background and selected images won't be scaled to fill the whole button size.
- *
- * @param[in] backgroundImageActor Image to be shown as button background.
- * @param[in] selectedImageActor Image to be shown as selected button.
- */
-DALI_IMPORT_API CheckBoxButton CreateCheckBoxButton( Actor backgroundImageActor, Actor selectedImageActor );
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif // __DALI_TOOLKIT_CHECK_BUTTON_FACTORY_H__
+++ /dev/null
-/*
- * Copyright (c) 2015 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.
- *
- */
-
-// HEADER
-#include <dali-toolkit/public-api/controls/default-controls/push-button-factory.h>
-
-// EXTERNAL INCLUDES
-#include <dali/public-api/actors/image-actor.h>
-#include <dali/public-api/images/resource-image.h>
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/alignment/alignment.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace
-{
-
-Alignment CreateAlignedImage( Actor image )
-{
- Alignment alignmentContainer = Toolkit::Alignment::New();
- alignmentContainer.SetScaling( Toolkit::Alignment::ShrinkToFitKeepAspect );
-
- alignmentContainer.Add( image );
-
- return alignmentContainer;
-}
-
-Alignment CreateAlignedImage( const std::string& imagePath )
-{
- Image image = ResourceImage::New( imagePath );
- return CreateAlignedImage( ImageActor::New( image ) );
-}
-
-} // namespace
-
-
-PushButton CreatePushButton( const std::string& unselectedImagePath, const std::string& selectedImagePath, const std::string& backgroundImagePath,
- const std::string& disabledUnselectedImagePath, const std::string& disabledBackgroundImagePath )
-{
- PushButton button = Toolkit::PushButton::New();
-
- if( !unselectedImagePath.empty() )
- {
- button.SetButtonImage( CreateAlignedImage( unselectedImagePath ) );
- }
-
- if( !selectedImagePath.empty() )
- {
- button.SetSelectedImage( CreateAlignedImage( selectedImagePath ) );
- }
-
- if( !backgroundImagePath.empty() )
- {
- button.SetBackgroundImage( CreateAlignedImage( backgroundImagePath ) );
- }
-
- if( !disabledUnselectedImagePath.empty() )
- {
- button.SetDisabledImage( CreateAlignedImage( disabledUnselectedImagePath ) );
- }
-
- if( !disabledBackgroundImagePath.empty() )
- {
- button.SetDisabledBackgroundImage( CreateAlignedImage( disabledBackgroundImagePath ) );
- }
-
- return button;
-}
-
-PushButton CreatePushButton( Actor unselectedImageActor, Actor selectedImageActor, Actor backgroundImageActor,
- Actor disabledUnselectedImageActor, Actor disabledBackgroundImageActor )
-{
- PushButton button = Toolkit::PushButton::New();
-
- if( unselectedImageActor )
- {
- button.SetButtonImage( CreateAlignedImage( unselectedImageActor ) );
- }
-
- if( selectedImageActor )
- {
- button.SetSelectedImage( CreateAlignedImage( selectedImageActor ) );
- }
-
- if( backgroundImageActor )
- {
- button.SetBackgroundImage( CreateAlignedImage( backgroundImageActor ) );
- }
-
- if( disabledUnselectedImageActor )
- {
- button.SetDisabledImage( CreateAlignedImage( disabledUnselectedImageActor ) );
- }
-
- if( disabledBackgroundImageActor )
- {
- button.SetDisabledBackgroundImage( CreateAlignedImage( disabledBackgroundImageActor ) );
- }
-
- return button;
-}
-
-PushButton CreatePushButton( const std::string& backgroundImagePath )
-{
- PushButton button = Toolkit::PushButton::New();
-
- if( !backgroundImagePath.empty() )
- {
- button.SetBackgroundImage( CreateAlignedImage( backgroundImagePath ) );
- }
-
- return button;
-}
-
-PushButton CreatePushButton( Actor backgroundImageActor )
-{
- PushButton button = Toolkit::PushButton::New();
-
- if( backgroundImageActor )
- {
- button.SetBackgroundImage( CreateAlignedImage( backgroundImageActor ) );
- }
-
- return button;
-}
-
-} // namespace Toolkit
-
-} // namespace Dali
+++ /dev/null
-#ifndef __DALI_TOOLKIT_PUSH_BUTTON_FACTORY_H__
-#define __DALI_TOOLKIT_PUSH_BUTTON_FACTORY_H__
-
-/*
- * Copyright (c) 2015 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 <dali-toolkit/public-api/controls/buttons/push-button.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-/**
- * @brief Creates a push button with the given images.
- * Images will be shrunk to fit the button size keeping their aspect ratio.
- * @note Images won't be scaled to fill the whole button size.
- * @note If an image path is empty, this image is not set to the button.
- *
- * @param[in] unselectedImagePath Image path to be shown when the button is unselected.
- * @param[in] selectedImagePath Image path to be shown when the button is selected.
- * @param[in] backgroundImagePath Image path to be shown as button background.
- * @param[in] disabledUnselectedImagePath Image path to be shown when the button is unselected and disabled.
- * @param[in] disabledBackgroundImagePath Image path to be shown as button background when the button is disabled.
- * @return A handle to the new push button
- */
-DALI_IMPORT_API PushButton CreatePushButton( const std::string& unselectedImagePath, const std::string& selectedImagePath, const std::string& backgroundImagePath,
- const std::string& disabledUnselectedImagePath, const std::string& disabledBackgroundImagePath );
-
-/**
- * @brief Creates a push button with the given images.
- *
- * Images will be shrunk to fit the button size keeping their aspect ratio.
- * @note Images won't be scaled to fill the whole button size.
- * @note If an image is an empty handle, this image is not set to the button.
- *
- * @param[in] unselectedImageActor Image to be shown when the button is unselected.
- * @param[in] selectedImageActor Image to be shown when the button is pressed.
- * @param[in] backgroundImageActor Image to be shown as button background.
- * @param[in] disabledUnselectedImageActor Image to be shown when the button is unselected and disabled.
- * @param[in] disabledBackgroundImageActor Image to be shown as button background when the button is disabled.
- * @return A handle to the new pushbutton
- */
-DALI_IMPORT_API PushButton CreatePushButton( Actor unselectedImageActor, Actor selectedImageActor, Actor backgroundImageActor,
- Actor disabledUnselectedImageActor, Actor disabledBackgroundImageActor );
-
-/**
- * @brief Creates a push button with the given background image.
- *
- * Background image will be shrunk to fit the button size keeping its aspect ratio.
- * @note Background image won't be scaled to fill the whole button size.
- *
- * @param[in] backgroundImagePath Image path to be shown as button background.
- * @return a handle to the new push button
- */
-DALI_IMPORT_API PushButton CreatePushButton( const std::string& backgroundImagePath );
-
-/**
- * @brief Creates a push button with the given background image.
- *
- * Background image will be shrunk to fit the button size keeping its aspect ratio.
- * @note Background image won't be scaled to fill the whole button size.
- *
- * @param[in] backgroundImageActor Image to be shown as button background.
- * @return a handle to the new push button
- */
-DALI_IMPORT_API PushButton CreatePushButton( Actor backgroundImageActor );
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif // __DALI_TOOLKIT_PUSH_BUTTON_FACTORY_H__
$(public_api_src_dir)/controls/buttons/check-box-button.cpp \
$(public_api_src_dir)/controls/buttons/push-button.cpp \
$(public_api_src_dir)/controls/buttons/radio-button.cpp \
- $(public_api_src_dir)/controls/default-controls/check-button-factory.cpp \
- $(public_api_src_dir)/controls/default-controls/push-button-factory.cpp \
$(public_api_src_dir)/controls/default-controls/solid-color-actor.cpp \
$(public_api_src_dir)/controls/scroll-bar/scroll-bar.cpp \
$(public_api_src_dir)/controls/scrollable/item-view/default-item-layout.cpp \
$(public_api_src_dir)/controls/buttons/radio-button.h
public_api_default_controls_header_files = \
- $(public_api_src_dir)/controls/default-controls/check-button-factory.h \
- $(public_api_src_dir)/controls/default-controls/push-button-factory.h \
$(public_api_src_dir)/controls/default-controls/solid-color-actor.h
public_api_gaussian_blur_view_header_files = \