/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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 "shared/view.h"
#include "shared/utility.h"
#include <stdio.h>
+#include <dali/integration-api/debug.h>
+#include <dali/devel-api/adaptor-framework/file-stream.h>
using namespace Dali;
using Dali::Toolkit::TextLabel;
{
std::string fullpath( path );
fullpath += filename;
- FILE* file = fopen( fullpath.c_str(), "rb" );
- if( ! file )
+
+ Dali::FileStream fileStream( fullpath, Dali::FileStream::READ | Dali::FileStream::BINARY );
+ FILE* file = fileStream.GetFile();
+ if( !file )
{
return false;
}
bool retValue = false;
- if( ! fseek( file, 0, SEEK_END ) )
+ if( !fseek( file, 0, SEEK_END ) )
{
long int size = ftell( file );
}
}
- fclose( file );
return retValue;
}
// The Init signal is received once (only) during the Application lifetime
void Create( Application& application )
{
- // Get a handle to the stage
- Stage stage = Stage::GetCurrent();
-
- stage.GetRootLayer().TouchSignal().Connect( this, &RayMarchingExample::OnTouch );
+ // Get a handle to the window
+ Window window = application.GetWindow();
- stage.KeyEventSignal().Connect(this, &RayMarchingExample::OnKeyEvent);
+ window.GetRootLayer().TouchSignal().Connect( this, &RayMarchingExample::OnTouch );
- stage.SetBackgroundColor( Color::YELLOW );
+ window.KeyEventSignal().Connect(this, &RayMarchingExample::OnKeyEvent);
- // Hide the indicator bar
- application.GetWindow().ShowIndicator( Dali::Window::INVISIBLE );
+ window.SetBackgroundColor( Color::YELLOW );
// Creates a default view with a default tool bar.
- // The view is added to the stage.
+ // The view is added to the window.
mContentLayer = DemoHelper::CreateView( application,
mView,
mToolBar,
AddContentLayer();
}
- bool OnTouch( Actor actor, const TouchData& touch )
+ bool OnTouch( Actor actor, const TouchEvent& touch )
{
// quit the application
mApplication.Quit();
void AddContentLayer()
{
- Stage stage = Stage::GetCurrent();
+ Window window = mApplication.GetWindow();
//Create all the renderers
Renderer renderer = CreateQuadRenderer();
Actor actor = Actor::New();
actor.AddRenderer( renderer );
- actor.SetAnchorPoint( Dali::AnchorPoint::CENTER );
- actor.SetParentOrigin( Dali::ParentOrigin::CENTER );
+ actor.SetProperty( Actor::Property::ANCHOR_POINT, Dali::AnchorPoint::CENTER );
+ actor.SetProperty( Actor::Property::PARENT_ORIGIN, Dali::ParentOrigin::CENTER );
actor.SetResizePolicy( Dali::ResizePolicy::FILL_TO_PARENT, Dali::Dimension::ALL_DIMENSIONS );
mContentLayer.Add( actor );