$(adaptor_adaptor_ubuntu_src_files) \
$(adaptor_clipboard_common_src_files) \
$(adaptor_clipboard_ubuntu_x11_src_files) \
+ $(adaptor_framework_generic_src_files) \
$(devel_api_src_files) \
$(adaptor_devel_api_text_abstraction_src_files) \
$(adaptor_graphics_common_src_files) \
$(adaptor_adaptor_tizen_wayland_src_files) \
$(adaptor_clipboard_common_src_files) \
$(adaptor_clipboard_tizen_wayland_src_files) \
+ $(adaptor_framework_generic_src_files) \
$(devel_api_src_files) \
$(adaptor_devel_api_text_abstraction_src_files) \
$(adaptor_graphics_common_src_files) \
$(adaptor_adaptor_tizen_wayland_src_files) \
$(adaptor_clipboard_common_src_files) \
$(adaptor_clipboard_tizen_wayland_src_files) \
+ $(adaptor_framework_generic_src_files) \
$(devel_api_src_files) \
$(adaptor_devel_api_text_abstraction_src_files) \
$(adaptor_graphics_common_src_files) \
$(adaptor_adaptor_tizen_wayland_src_files) \
$(adaptor_clipboard_common_src_files) \
$(adaptor_clipboard_tizen_wayland_src_files) \
+ $(adaptor_framework_generic_src_files) \
$(devel_api_src_files) \
$(adaptor_devel_api_text_abstraction_src_files) \
$(adaptor_graphics_common_src_files) \
$(adaptor_adaptor_tizen_wayland_src_files) \
$(adaptor_clipboard_common_src_files) \
$(adaptor_clipboard_tizen_wayland_src_files) \
+ $(adaptor_framework_generic_src_files) \
$(devel_api_src_files) \
$(adaptor_devel_api_text_abstraction_src_files) \
$(adaptor_graphics_common_src_files) \
$(adaptor_adaptor_tizen_wearable_src_files) \
$(adaptor_clipboard_common_src_files) \
$(adaptor_clipboard_tizen_wayland_src_files) \
+ $(adaptor_framework_generic_src_files) \
$(devel_api_src_files) \
$(adaptor_devel_api_text_abstraction_src_files) \
$(adaptor_graphics_common_src_files) \
adaptor_clipboard_dir = ../../../dali/internal/clipboard
include ../../../dali/internal/clipboard/file.list
+# module: adaptor-framework
+adaptor_framework_dir = ../../../dali/internal/adaptor-framework
+include ../../../dali/internal/adaptor-framework/file.list
+
# Module: graphics
adaptor_graphics_dir = ../../../dali/internal/graphics
include ../../../dali/internal/graphics/file.list
/*
- * Copyright (c) 2015 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.
// CLASS HEADER
#include <dali/devel-api/adaptor-framework/file-loader.h>
-
+// EXTERNAL INCLUDES
#include <iostream>
#include <fstream>
+// INTERNAL INCLUDES
+#include <dali/internal/adaptor-framework/common/file-loader-impl.h>
+
namespace Dali
{
int ReadFile(const std::string& filename, Dali::Vector<char> & memblock, FileLoader::FileType fileType)
{
- std::streampos size;
-
- return ReadFile( filename, size, memblock, fileType);
+ return Dali::Internal::Adaptor::ReadFile( filename, memblock, fileType );
}
-int ReadFile(const std::string& filename, std::streampos& fileSize, Dali::Vector<char> & memblock, FileLoader::FileType fileType)
+int ReadFile(const std::string& filename, std::streampos& fileSize, Dali::Vector<char>& memblock, FileLoader::FileType fileType)
{
- int errorCode = 0;
- std::ifstream * file;
-
-
- if( fileType == BINARY )
- {
- file = new std::ifstream (filename.c_str(), std::ios::in|std::ios::binary|std::ios::ate);
- }
- else if( fileType == TEXT )
- {
- file = new std::ifstream (filename.c_str(), std::ios::in|std::ios::ate);
- }
- else
- {
- return errorCode;
- }
-
- if( file->is_open() )
- {
- fileSize = file->tellg();
-
- memblock.Resize( fileSize );
-
- file->seekg (0, std::ios::beg);
- file->read( memblock.Begin(), fileSize );
- file->close();
-
- delete file;
-
- errorCode = 1;
- }
-
- return errorCode;
+ return Dali::Internal::Adaptor::ReadFile( filename, fileSize, memblock, fileType );;
}
-
std::streampos GetFileSize(const std::string& filename)
{
- std::streampos size = 0;
-
- std::ifstream file (filename.c_str(), std::ios::in|std::ios::binary|std::ios::ate);
- if( file.is_open() )
- {
- size = file.tellg();
- file.close();
- }
- return size;
+ return Dali::Internal::Adaptor::GetFileSize(filename);
}
} //FileLoader
--- /dev/null
+#ifndef DALI_FILE_LOADER_IMPL_GENERIC_H
+#define DALI_FILE_LOADER_IMPL_GENERIC_H
+
+/*
+ * 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.
+ * 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.
+ */
+
+// EXTERNAL INCLUDES
+#include <dali/devel-api/adaptor-framework/file-loader.h>
+
+// INTERNAL INCLUDES
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+int ReadFile(const std::string& filename, Dali::Vector<char>& memblock, Dali::FileLoader::FileType fileType = Dali::FileLoader::BINARY);
+
+int ReadFile(const std::string& filename, std::streampos& fileSize, Dali::Vector<char>& memblock, Dali::FileLoader::FileType fileType = Dali::FileLoader::BINARY);
+
+std::streampos GetFileSize(const std::string& filename);
+
+} // Adaptor
+
+} // Internal
+
+} // Dali
+#endif // DALI_FILE_LOADER_IMPL_GENERIC_H
--- /dev/null
+# module: adaptor-framework, backend: generic
+adaptor_framework_generic_src_files=\
+ ${adaptor_framework_dir}/generic/file-loader-impl-generic.cpp
--- /dev/null
+/*
+ * 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.
+ * 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 <dali/internal/adaptor-framework/common/file-loader-impl.h>
+
+// EXTERNAL INCLUDES
+#include <string>
+#include <fstream>
+
+#include <dali/integration-api/debug.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+int ReadFile(const std::string& filename, Dali::Vector<char> & memblock, Dali::FileLoader::FileType fileType)
+{
+ std::streampos size;
+
+ return Dali::Internal::Adaptor::ReadFile( filename, size, memblock, fileType);
+}
+
+int ReadFile(const std::string& filename, std::streampos& fileSize, Dali::Vector<char> & memblock, Dali::FileLoader::FileType fileType)
+{
+ int errorCode = 0;
+ std::ifstream * file;
+
+ if( fileType == Dali::FileLoader::BINARY )
+ {
+ file = new std::ifstream (filename.c_str(), std::ios::in|std::ios::binary|std::ios::ate);
+ }
+ else if( fileType == Dali::FileLoader::TEXT )
+ {
+ file = new std::ifstream (filename.c_str(), std::ios::in|std::ios::ate);
+ }
+ else
+ {
+ return errorCode;
+ }
+
+ if( file->is_open() )
+ {
+ fileSize = file->tellg();
+
+ memblock.Resize( fileSize );
+
+ file->seekg (0, std::ios::beg);
+ file->read( memblock.Begin(), fileSize );
+ file->close();
+
+ delete file;
+
+ errorCode = 1;
+ }
+ else
+ {
+ DALI_LOG_WARNING( "file open failed for: \"%s\"", filename );
+ }
+
+ return errorCode;
+}
+
+std::streampos GetFileSize(const std::string& filename)
+{
+ std::streampos size = 0;
+
+ std::ifstream file( filename.c_str(), std::ios::in|std::ios::binary|std::ios::ate );
+ if( file.is_open() )
+ {
+ size = file.tellg();
+ file.close();
+ }
+
+ return size;
+}
+
+} // Adaptor
+
+} // Internal
+
+} // Dali
// Force a render task
RequestUpdateOnce();
}
+ else if( RUNNING == mState )
+ {
+ // Force a render task
+ RequestUpdateOnce();
+
+ DALI_LOG_RELEASE_INFO( "Adaptor::OnWindowShown: Update requested.\n" );
+ }
else
{
// Force a render task
namespace
{
+ const uint32_t CHECK_EXTENSION_NUMBER = 2;
const std::string EGL_KHR_SURFACELESS_CONTEXT = "EGL_KHR_surfaceless_context";
+ const std::string EGL_KHR_CREATE_CONTEXT = "EGL_KHR_create_context";
}
namespace Dali
mIsWindow( true ),
mDepthBufferRequired( depthBufferRequired == Integration::DepthBufferAvailable::TRUE ),
mStencilBufferRequired( stencilBufferRequired == Integration::StencilBufferAvailable::TRUE ),
- mIsSurfacelessContextSupported( false )
+ mIsSurfacelessContextSupported( false ),
+ mIsKhrCreateContextSupported( false )
{
}
// Query EGL extensions to check whether surfaceless context is supported
const char* const extensionStr = eglQueryString( mEglDisplay, EGL_EXTENSIONS );
- std::istringstream stream(extensionStr);
+ std::istringstream stream( extensionStr );
std::string currentExtension;
- while ( std::getline( stream, currentExtension, ' ' ) )
+ uint32_t extensionCheckCount = 0;
+ while( std::getline( stream, currentExtension, ' ' ) && extensionCheckCount < CHECK_EXTENSION_NUMBER )
{
- if ( currentExtension == EGL_KHR_SURFACELESS_CONTEXT )
+ if( currentExtension == EGL_KHR_SURFACELESS_CONTEXT )
{
mIsSurfacelessContextSupported = true;
- break;
+ extensionCheckCount++;
+ }
+ if( currentExtension == EGL_KHR_CREATE_CONTEXT )
+ {
+ mIsKhrCreateContextSupported = true;
+ extensionCheckCount++;
}
}
Integration::Log::LogMessage(Integration::Log::DebugInfo, "Using OpenGL es %d.%d.\n", mGlesVersion / 10, mGlesVersion % 10 );
mContextAttribs.Clear();
- if( mGlesVersion >= 30 )
+ if( mIsKhrCreateContextSupported )
{
mContextAttribs.Reserve(5);
mContextAttribs.PushBack( EGL_CONTEXT_MAJOR_VERSION_KHR );
{
mContextAttribs.Reserve(3);
mContextAttribs.PushBack( EGL_CONTEXT_CLIENT_VERSION );
- mContextAttribs.PushBack( 2 );
+ mContextAttribs.PushBack( mGlesVersion / 10 );
}
mContextAttribs.PushBack( EGL_NONE );
bool mDepthBufferRequired;
bool mStencilBufferRequired;
bool mIsSurfacelessContextSupported;
+ bool mIsKhrCreateContextSupported;
};
} // namespace Adaptor
/*
- * Copyright (c) 2014 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/internal/haptics/common/feedback-player-impl.h>
// EXTERNAL INCLUDES
-#include <fstream>
#include <dali/public-api/object/type-registry.h>
+#include <dali/devel-api/adaptor-framework/file-loader.h>
+#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
#include <dali/internal/system/common/singleton-service-impl.h>
{
bool loaded = false;
- std::ifstream stream(filename.c_str());
-
- if( stream.is_open() )
+ std::streampos bufferSize = 0;
+ Dali::Vector<char> fileBuffer;
+ if( Dali::FileLoader::ReadFile( filename, bufferSize, fileBuffer, FileLoader::FileType::TEXT ) )
{
- data.assign((std::istreambuf_iterator<char>(stream)),
- std::istreambuf_iterator<char>());
+ data.assign( &fileBuffer[0], bufferSize );
loaded = true;
}
#include <dali/internal/styling/common/style-monitor-impl.h>
// EXTERNAL INCLUDES
+#include <dali/devel-api/adaptor-framework/file-loader.h>
#include <dali/public-api/object/type-registry.h>
-#include <fstream>
-#include <sstream>
#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
bool StyleMonitor::LoadThemeFile( const std::string& filename, std::string& output )
{
bool retval( false );
- std::ifstream in( filename.c_str(), std::ios::in );
- if( in )
- {
- std::stringstream buffer;
- buffer << in.rdbuf();
-
- output = buffer.str();
- in.close();
+ std::streampos bufferSize = 0;
+ Dali::Vector<char> fileBuffer;
+ if( Dali::FileLoader::ReadFile( filename, bufferSize, fileBuffer, FileLoader::FileType::TEXT ) )
+ {
+ output.assign( &fileBuffer[0], bufferSize );
retval = true;
}
+
return retval;
}
*/
// INTERNAL INCLUDES
+#include <dali/devel-api/adaptor-framework/file-loader.h>
// EXTERNAL INCLUDES
#include <cstdio>
/**
* @brief Construct a FileCloser guarding a new FILE* for accessing the path passed in.
*/
- FileCloser( const char * const filename, const char * const mode )
- : mFile(fopen(filename, mode))
+ FileCloser( const char* const filename, const char* const mode )
{
- DALI_ASSERT_DEBUG( filename != 0 && "Cant open a null filename." );
+ DALI_ASSERT_DEBUG( filename != 0 && "Can't open a null filename." );
DALI_ASSERT_DEBUG( mode != 0 && "Null mode is undefined behaviour in spec." );
- if( mFile == 0 )
+ Dali::FileLoader::FileType fileType = Dali::FileLoader::FileType::TEXT;
+
+ const char* modeStr = mode;
+ while( *modeStr )
+ {
+ switch ( *modeStr )
+ {
+ case 'r':
+ break;
+ case 'b':
+ fileType = FileLoader::FileType::BINARY;
+ break;
+ // Still has to use fopen for append and write modes
+ case 'a':
+ case 'w':
+ case '+':
+ mFile = fopen( filename, mode );
+ return;
+ default:
+ break;
+ }
+
+ ++modeStr;
+ }
+
+ std::streampos bufferSize = 0;
+ if( !Dali::FileLoader::ReadFile( filename, bufferSize, mFileBuffer, fileType ) )
+ {
+ mFile = nullptr;
+ }
+ else
{
- DALI_LOG_WARNING( "File open failed for: \"%s\" in mode: \"%s\".\n", filename, mode );
+ mFile = fmemopen( &mFileBuffer[0], bufferSize, mode );
}
}
/**
* @brief Construct a FileCloser guarding a FILE* for reading out of the memory buffer passed in.
*/
- FileCloser( uint8_t* buffer, size_t dataSize, const char * const mode )
+ FileCloser( uint8_t* buffer, size_t dataSize, const char* const mode )
: mFile( fmemopen( buffer, dataSize, mode) )
{
}
private:
FILE* mFile;
+ Dali::Vector<char> mFileBuffer;
};
} // namespace Platform
void WindowBaseEcoreWl2::SetEglWindowRotation( int angle )
{
- wl_egl_window_rotation rotation;
+ wl_egl_window_tizen_rotation rotation;
switch( angle )
{
case 0:
{
- rotation = ROTATION_0;
+ rotation = WL_EGL_WINDOW_TIZEN_ROTATION_0 ;
break;
}
case 90:
{
- rotation = ROTATION_270;
+ rotation = WL_EGL_WINDOW_TIZEN_ROTATION_90;
break;
}
case 180:
{
- rotation = ROTATION_180;
+ rotation = WL_EGL_WINDOW_TIZEN_ROTATION_180;
break;
}
case 270:
{
- rotation = ROTATION_90;
+ rotation = WL_EGL_WINDOW_TIZEN_ROTATION_90;
break;
}
default:
{
- rotation = ROTATION_0;
+ rotation = WL_EGL_WINDOW_TIZEN_ROTATION_0 ;
break;
}
}
- wl_egl_window_set_rotation( mEglWindow, rotation );
+ wl_egl_window_tizen_set_rotation( mEglWindow, rotation );
}
void WindowBaseEcoreWl2::SetEglWindowBufferTransform( int angle )
}
}
- wl_egl_window_set_buffer_transform( mEglWindow, bufferTransform );
+ wl_egl_window_tizen_set_buffer_transform( mEglWindow, bufferTransform );
}
void WindowBaseEcoreWl2::SetEglWindowTransform( int angle )
}
}
- wl_egl_window_set_window_transform( mEglWindow, windowTransform );
+ wl_egl_window_tizen_set_window_transform( mEglWindow, windowTransform );
}
void WindowBaseEcoreWl2::ResizeEglWindow( PositionSize positionSize )
bool WindowBaseEcoreWl2::IsEglWindowRotationSupported()
{
// Check capability
- wl_egl_window_capability capability = static_cast< wl_egl_window_capability >( wl_egl_window_get_capabilities( mEglWindow ) );
- if( capability == WL_EGL_WINDOW_CAPABILITY_ROTATION_SUPPORTED )
+ wl_egl_window_tizen_capability capability = static_cast< wl_egl_window_tizen_capability >( wl_egl_window_tizen_get_capabilities( mEglWindow ) );
+ if( capability == WL_EGL_WINDOW_TIZEN_CAPABILITY_ROTATION_SUPPORTED )
{
return true;
}
const unsigned int ADAPTOR_MAJOR_VERSION = 1;
const unsigned int ADAPTOR_MINOR_VERSION = 4;
-const unsigned int ADAPTOR_MICRO_VERSION = 26;
+const unsigned int ADAPTOR_MICRO_VERSION = 27;
const char * const ADAPTOR_BUILD_DATE = __DATE__ " " __TIME__;
#ifdef DEBUG_ENABLED
Name: dali-adaptor
Summary: The DALi Tizen Adaptor
-Version: 1.4.26
+Version: 1.4.27
Release: 1
Group: System/Libraries
License: Apache-2.0 and BSD-3-Clause and MIT