/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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-toolkit/dali-toolkit.h>
-#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
#include <dali-toolkit/devel-api/image-loader/texture-manager.h>
#include "shared/view.h"
class ImageViewUrlApp : public ConnectionTracker
{
public:
- ImageViewUrlApp( Application& application )
+ ImageViewUrlApp( Application& application, std::string url )
: mApplication( application ),
+ mUrl( url ),
mDeltaPropertyIndex( Property::INVALID_INDEX )
{
// Connect to the Application's Init signal
// Add a button to switch the scene. (right of toolbar)
Toolkit::PushButton switchButton = Toolkit::PushButton::New();
- switchButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, BUTTON_ICON );
- switchButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, BUTTON_ICON_SELECTED );
+ switchButton.SetProperty( Toolkit::Button::Property::UNSELECTED_BACKGROUND_VISUAL, BUTTON_ICON );
+ switchButton.SetProperty( Toolkit::Button::Property::SELECTED_BACKGROUND_VISUAL, BUTTON_ICON_SELECTED );
switchButton.ClickedSignal().Connect( this, &ImageViewUrlApp::OnButtonClicked );
toolBar.AddControl( switchButton,
DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage,
Toolkit::Alignment::HorizontalRight,
DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
- CreateRenderTask( );
+ std::string url = mUrl;
+ if( url.empty() )
+ {
+ url = BIG_TEST_IMAGE;
+ }
+
+ CreateRenderTask( url );
CreateScene( );
}
- void CreateRenderTask()
+ void CreateRenderTask( const std::string& url )
{
auto rootActor = Stage::GetCurrent().GetRootLayer();
{
// create actor to render input with applied shader
- mActorForInput = Toolkit::ImageView::New(BIG_TEST_IMAGE);
+ mActorForInput = Toolkit::ImageView::New( url );
mActorForInput.SetParentOrigin(ParentOrigin::CENTER);
mActorForInput.SetSize(TARGET_SIZE);
Property::Map customShader;
Pixel::RGB888,
unsigned(TARGET_SIZE.width),
unsigned(TARGET_SIZE.height));
- auto framebuffer = FrameBuffer::New(TARGET_SIZE.width, TARGET_SIZE.height, Pixel::RGB888);
+ auto framebuffer = FrameBuffer::New(TARGET_SIZE.width, TARGET_SIZE.height, FrameBuffer::Attachment::NONE );
framebuffer.AttachColorTexture(mOutputTexture);
renderTask.SetFrameBuffer(framebuffer);
private:
Application& mApplication;
+ std::string mUrl;
Layer mContent;
Toolkit::ImageView mImageView;
Animation mAnimation;
int DALI_EXPORT_API main( int argc, char **argv )
{
Application application = Application::New( &argc, &argv );
- ImageViewUrlApp test( application );
+
+ std::string url;
+ if( argc > 1 )
+ {
+ url = argv[1];
+ }
+
+ ImageViewUrlApp test( application, url );
application.MainLoop();
return 0;
}