void Application::Quit()
{
// Actually quit the application.
+ // Force a call to Quit even if adaptor is not running.
Internal::Adaptor::Adaptor::GetImplementation(*mAdaptor).AddIdle( MakeCallback( this, &Application::QuitFromMainLoop ), true );
}
void Application::OnInit()
{
+ DALI_LOG_RELEASE_INFO( "Application::OnInit has started.\n" );
+
mFramework->AddAbortCallback( MakeCallback( this, &Application::QuitFromMainLoop ) );
DoInit();
mInitSignal.Emit( application );
DoStart();
+
+ DALI_LOG_RELEASE_INFO( "Application::OnInit has finished.\n" );
}
void Application::OnTerminate()
{
+ DALI_LOG_RELEASE_INFO( "Application::OnTerminate\n" );
+
// we've been told to quit by AppCore, ecore_x_destroy has been called, need to quit synchronously
// delete the window as ecore_x has been destroyed by AppCore
void Application::OnPause()
{
- DALI_LOG_RELEASE_INFO( "Application::OnPause\n" );
+ DALI_LOG_RELEASE_INFO( "Application::OnPause has started.\n" );
// A DALi app should handle Pause/Resume events.
// DALi just delivers the framework Pause event to the application, but not actually pause DALi core.
// Pausing DALi core only occurs on the Window Hidden framework event
Dali::Application application(this);
mPauseSignal.Emit( application );
+
+ DALI_LOG_RELEASE_INFO( "Application::OnPause has finished.\n" );
}
void Application::OnResume()
{
- DALI_LOG_RELEASE_INFO( "Application::OnResume\n" );
+ DALI_LOG_RELEASE_INFO( "Application::OnResume has started.\n" );
// Emit the signal first so the application can queue any messages before we do an update/render
// This ensures we do not just redraw the last frame before pausing if that's not required
// DALi just delivers the framework Resume event to the application.
// Resuming DALi core only occurs on the Window Show framework event
+
+ DALI_LOG_RELEASE_INFO( "Application::OnResume has finished.\n" );
}
void Application::OnReset()
void Application::OnAppControl(void *data)
{
+ DALI_LOG_RELEASE_INFO( "Application::OnAppControl has started.\n" );
+
Dali::Application application(this);
mAppControlSignal.Emit( application , data );
+
+ DALI_LOG_RELEASE_INFO( "Application::OnAppControl has finished.\n" );
}
void Application::OnLanguageChanged()
}
StyleMonitor::StyleMonitor()
-: mDefaultFontSize(-1)
+: mDefaultFontSize(-1),
+ mIgnoreGlobalFontSizeChange(-1)
{
mFontClient = TextAbstraction::FontClient::Get();
GetSystemDefaultFontFamily( mFontClient, mDefaultFontFamily );
return retval;
}
-Dali::StyleMonitor::StyleChangeSignalType& StyleMonitor::StyleChangeSignal()
-{
- return mStyleChangeSignal;
-}
-
void StyleMonitor::EmitStyleChangeSignal( StyleChange::Type styleChange )
{
if( !mStyleChangeSignal.Empty() )
}
}
+int StyleMonitor::GetIgnoreGlobalFontSizeChange()
+{
+ return mIgnoreGlobalFontSizeChange;
+}
+
+void StyleMonitor::SetIgnoreGlobalFontSizeChange(int value)
+{
+ mIgnoreGlobalFontSizeChange = value;
+}
+
+Dali::StyleMonitor::StyleChangeSignalType& StyleMonitor::StyleChangeSignal()
+{
+ return mStyleChangeSignal;
+}
+
} // namespace Adaptor
} // namespace Internal
*/
bool LoadThemeFile( const std::string& filename, std::string& output );
+ /**
+ * @copydoc Dali::StyleMonitor::GetIgnoreGlobalFontSizeChange()
+ */
+ int GetIgnoreGlobalFontSizeChange();
+
+ /**
+ * @copydoc Dali::StyleMonitor::SetIgnoreGlobalFontSizeChange()
+ */
+ void SetIgnoreGlobalFontSizeChange(int value);
+
// Signals
/**
std::string mDefaultFontStyle; ///< The default font style
std::string mUserDefinedThemeFilePath; ///< String containing the user defined theme file path
int mDefaultFontSize; ///< The default accessibility font size e.g. 0 is smallest
+ int mIgnoreGlobalFontSizeChange; ///< Ignore global font size change when it is 1
};
} // namespace Adaptor
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
const char *fileName; /**< The absolute path of the file. */
unsigned char *globalMap ; /**< A pointer to the entire contents of the file that have been mapped with mmap(2). */
- unsigned long long length; /**< The length of the file in bytes. */
+ long long length; /**< The length of the file in bytes. */
int fileDescriptor; /**< The file descriptor. */
};
uint32_t *p;
// what we need is image size.
- SavedImage *sp = nullptr;
+ SavedImage *sp;
sp = &gif->SavedImages[ gif->ImageCount - 1 ];
- if( sp != nullptr )
+ if( !sp )
{
goto on_error;
}
return false;
}
- fileData.length = static_cast<unsigned long long> ( lseek( fileData.fileDescriptor, 0, SEEK_END ) );
- lseek( fileData.fileDescriptor, 0, SEEK_SET );
+ fileData.length = lseek( fileData.fileDescriptor, 0, SEEK_END );
+ if( fileData.length <= -1 )
+ {
+ close( fileData.fileDescriptor );
+ return false;
+ }
+
+ if( lseek( fileData.fileDescriptor, 0, SEEK_SET ) == -1 )
+ {
+ close( fileData.fileDescriptor );
+ return false;
+ }
// map the file and store/track info
fileData.globalMap = reinterpret_cast<unsigned char *>( mmap(NULL, fileData.length, PROT_READ, MAP_SHARED, fileData.fileDescriptor, 0 ));
{
FillFrame( thisFrame->data, prop.w, gif, frameInfo, x, y, w, h );
}
-
else if( frameInfo->dispose == DISPOSE_PREVIOUS ) // GIF_DISPOSE_RESTORE
{
int prevIndex = 2;
{
// Find last preserved frame.
lastPreservedFrame = FindFrame( animated, imageNumber - prevIndex );
+ if( ! lastPreservedFrame )
+ {
+ LOADERR( "LOAD_ERROR_LAST_PRESERVED_FRAME_NOT_FOUND" );
+ }
prevIndex++;
} while( lastPreservedFrame && lastPreservedFrame->info.dispose == DISPOSE_PREVIOUS );
#define __DALI_INTERNAL_GIF_LOADING_H__
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
*/
GifLoading( const std::string& url );
+ // Moveable but not copyable
+
+ GifLoading( const GifLoading& ) = delete;
+ GifLoading& operator=( const GifLoading& ) = delete;
+ GifLoading( GifLoading&& ) = default;
+ GifLoading& operator=( GifLoading&& ) = default;
+
/**
* @brief Destructor
*/
/**
* @brief Source key.
*/
- DALI_KEY_SOURCE = 72
+ DALI_KEY_SOURCE = 72,
+ /**
+ * @brief Control Return key.
+ */
+ DALI_KEY_RETURN = 36
};
} // namespace DevelKey
return GetImplementation(*this).LoadThemeFile( filename, output );
}
+int StyleMonitor::GetIgnoreGlobalFontSizeChange()
+{
+ return GetImplementation(*this).GetIgnoreGlobalFontSizeChange();
+}
+
+void StyleMonitor::SetIgnoreGlobalFontSizeChange(int value)
+{
+ GetImplementation(*this).SetIgnoreGlobalFontSizeChange( value );
+}
+
StyleMonitor::StyleChangeSignalType& StyleMonitor::StyleChangeSignal()
{
return GetImplementation(*this).StyleChangeSignal();
*/
bool LoadThemeFile( const std::string& filename, std::string& output );
+ /**
+ * Return the value of mIgnoreGlobalFontSizeChange.
+ * @return Return mIgnoreGlobalFontSizeChange.
+ */
+ int GetIgnoreGlobalFontSizeChange();
+
+ /**
+ * Informs the Style Monitor that the style has changed.
+ * @param[in] value The value of mIgnoreGlobalFontSizeChange.
+ */
+ void SetIgnoreGlobalFontSizeChange(int value);
+
public: // Signals
/**
#endif // DALI_ELDBUS_AVAILABLE
/**
+ * EcoreInputModifierToEcoreIMFLock function converts from Ecore_Event_Modifier to Ecore_IMF_Keyboard_Locks enums.
+ * @param[in] modifier the Ecore_Event_Modifier input.
+ * @return the Ecore_IMF_Keyboard_Locks output.
+ */
+Ecore_IMF_Keyboard_Locks EcoreInputModifierToEcoreIMFLock( unsigned int modifier )
+{
+ unsigned int lock( ECORE_IMF_KEYBOARD_LOCK_NONE ); // If no other matches, returns NONE.
+
+ if( modifier & ECORE_EVENT_LOCK_NUM )
+ {
+ lock |= ECORE_IMF_KEYBOARD_LOCK_NUM; // Num lock is active.
+ }
+
+ if( modifier & ECORE_EVENT_LOCK_CAPS )
+ {
+ lock |= ECORE_IMF_KEYBOARD_LOCK_CAPS; // Caps lock is active.
+ }
+
+ if( modifier & ECORE_EVENT_LOCK_SCROLL )
+ {
+ lock |= ECORE_IMF_KEYBOARD_LOCK_SCROLL; // Scroll lock is active.
+ }
+
+ return static_cast<Ecore_IMF_Keyboard_Locks>( lock );
+}
+
+/**
* Ecore_Event_Modifier enums in Ecore_Input.h do not match Ecore_IMF_Keyboard_Modifiers in Ecore_IMF.h.
* This function converts from Ecore_Event_Modifier to Ecore_IMF_Keyboard_Modifiers enums.
* @param[in] ecoreModifier the Ecore_Event_Modifier input.
*/
Ecore_IMF_Keyboard_Modifiers EcoreInputModifierToEcoreIMFModifier(unsigned int ecoreModifier)
{
- int modifier( ECORE_IMF_KEYBOARD_MODIFIER_NONE ); // If no other matches returns NONE.
+ unsigned int modifier( ECORE_IMF_KEYBOARD_MODIFIER_NONE ); // If no other matches returns NONE.
if ( ecoreModifier & ECORE_EVENT_MODIFIER_SHIFT ) // enums from ecore_input/Ecore_Input.h
ecoreKeyDownEvent.compose = keyEvent->compose;
ecoreKeyDownEvent.timestamp = keyEvent->timestamp;
ecoreKeyDownEvent.modifiers = EcoreInputModifierToEcoreIMFModifier ( keyEvent->modifiers );
- ecoreKeyDownEvent.locks = (Ecore_IMF_Keyboard_Locks) ECORE_IMF_KEYBOARD_LOCK_NONE;
+ ecoreKeyDownEvent.locks = EcoreInputModifierToEcoreIMFLock( keyEvent->modifiers );
ecoreKeyDownEvent.dev_name = ecore_device_name_get( keyEvent->dev );
ecoreKeyDownEvent.dev_class = static_cast<Ecore_IMF_Device_Class>( ecore_device_class_get( keyEvent->dev ) );
ecoreKeyDownEvent.dev_subclass = static_cast<Ecore_IMF_Device_Subclass>( ecore_device_subclass_get( keyEvent->dev ) );
ecoreKeyUpEvent.compose = keyEvent->compose;
ecoreKeyUpEvent.timestamp = keyEvent->timestamp;
ecoreKeyUpEvent.modifiers = EcoreInputModifierToEcoreIMFModifier ( keyEvent->modifiers );
- ecoreKeyUpEvent.locks = (Ecore_IMF_Keyboard_Locks) ECORE_IMF_KEYBOARD_LOCK_NONE;
+ ecoreKeyUpEvent.locks = EcoreInputModifierToEcoreIMFLock( keyEvent->modifiers );
ecoreKeyUpEvent.dev_name = ecore_device_name_get( keyEvent->dev );
ecoreKeyUpEvent.dev_class = static_cast<Ecore_IMF_Device_Class>( ecore_device_class_get( keyEvent->dev ) );
ecoreKeyUpEvent.dev_subclass = static_cast<Ecore_IMF_Device_Subclass>( ecore_device_subclass_get( keyEvent->dev ) );
{ "Delete", static_cast<Dali::KEY>( DevelKey::DALI_KEY_DELETE ), false },
{ "Control_L", static_cast<Dali::KEY>( DevelKey::DALI_KEY_CONTROL_LEFT ), false },
{ "Control_R", static_cast<Dali::KEY>( DevelKey::DALI_KEY_CONTROL_RIGHT ), false },
- { "XF86Display", static_cast<Dali::KEY>( DevelKey::DALI_KEY_SOURCE ), true }
+ { "XF86Display", static_cast<Dali::KEY>( DevelKey::DALI_KEY_SOURCE ), true },
+ { "Return", static_cast<Dali::KEY>( DevelKey::DALI_KEY_RETURN ), false }
};
const std::size_t KEY_LOOKUP_COUNT = (sizeof( KeyLookupTable ))/ (sizeof( KeyLookup ));
{
// Use ecore_wl_window_activate to prevent the window shown without rendering
ecore_wl_window_activate( mEventHandler->mEcoreWindow );
+
+ DALI_LOG_RELEASE_INFO( "Window::Raise is called.\n" );
}
void Window::Lower()
{
ecore_wl_window_lower( mEventHandler->mEcoreWindow );
+
+ DALI_LOG_RELEASE_INFO( "Window::Lower is called.\n" );
}
void Window::Activate()
{
ecore_wl_window_activate( mEventHandler->mEcoreWindow );
+
+ DALI_LOG_RELEASE_INFO( "Window::Activate is called.\n" );
}
Dali::DragAndDropDetector Window::GetDragAndDropDetector() const
{
bool found = false;
- if ((orientation >= Dali::Window::PORTRAIT) && (orientation <= Dali::Window::LANDSCAPE_INVERSE))
+ if ( orientation <= Dali::Window::LANDSCAPE_INVERSE )
{
- for( std::size_t i=0; i<mAvailableOrientations.size(); i++ )
+ for( std::size_t i = 0; i < mAvailableOrientations.size(); i++ )
{
- if(mAvailableOrientations[i] == orientation)
+ if( mAvailableOrientations[i] == orientation )
{
found = true;
break;
mVisible = true;
ecore_wl_window_show( mEventHandler->mEcoreWindow );
- DALI_LOG_RELEASE_INFO( "Window::Show: mIconified [%d]\n", mIconified );
+ DALI_LOG_RELEASE_INFO( "Window::Show is called : mIconified [%d]\n", mIconified );
if( !mIconified )
{
mVisible = false;
ecore_wl_window_hide( mEventHandler->mEcoreWindow );
- DALI_LOG_RELEASE_INFO( "Window::Hide: mIconified [%d]\n", mIconified );
+ DALI_LOG_RELEASE_INFO( "Window::Hide is called : mIconified [%d]\n", mIconified );
if( !mIconified )
{
public:
class Impl; // Class declaration is public so we can internally add devel API's to the WidgetImpl
- /*
+ /**
* Set pointer of WidgetImpl Internal.
* @SINCE_1_3_5
*/
const unsigned int ADAPTOR_MAJOR_VERSION = 1;
const unsigned int ADAPTOR_MINOR_VERSION = 2;
-const unsigned int ADAPTOR_MICRO_VERSION = 81;
+const unsigned int ADAPTOR_MICRO_VERSION = 82;
const char * const ADAPTOR_BUILD_DATE = __DATE__ " " __TIME__;
#ifdef DEBUG_ENABLED
{ "Shift_R", DALI_KEY_SHIFT_RIGHT, false },
{ "Delete", static_cast<Dali::KEY>( DevelKey::DALI_KEY_DELETE ), false },
{ "Control_L", static_cast<Dali::KEY>( DevelKey::DALI_KEY_CONTROL_LEFT ), false },
- { "Control_R", static_cast<Dali::KEY>( DevelKey::DALI_KEY_CONTROL_RIGHT ), false }
+ { "Control_R", static_cast<Dali::KEY>( DevelKey::DALI_KEY_CONTROL_RIGHT ), false },
+ { "Return", static_cast<Dali::KEY>( DevelKey::DALI_KEY_RETURN ), false }
};
const std::size_t KEY_LOOKUP_COUNT = (sizeof( KeyLookupTable ))/ (sizeof( KeyLookup ));
{ "Shift_R", DALI_KEY_SHIFT_RIGHT, false },
{ "Delete", static_cast<Dali::KEY>( DevelKey::DALI_KEY_DELETE ), false },
{ "Control_L", static_cast<Dali::KEY>( DevelKey::DALI_KEY_CONTROL_LEFT ), false },
- { "Control_R", static_cast<Dali::KEY>( DevelKey::DALI_KEY_CONTROL_RIGHT ), false }
+ { "Control_R", static_cast<Dali::KEY>( DevelKey::DALI_KEY_CONTROL_RIGHT ), false },
+ { "Return", static_cast<Dali::KEY>( DevelKey::DALI_KEY_RETURN ), false }
};
const std::size_t KEY_LOOKUP_COUNT = (sizeof( KeyLookupTable ))/ (sizeof( KeyLookup ));
{ "Shift_R", DALI_KEY_SHIFT_RIGHT, false },
{ "Delete", static_cast<Dali::KEY>( DevelKey::DALI_KEY_DELETE ), false },
{ "Control_L", static_cast<Dali::KEY>( DevelKey::DALI_KEY_CONTROL_LEFT ), false },
- { "Control_R", static_cast<Dali::KEY>( DevelKey::DALI_KEY_CONTROL_RIGHT ), false }
+ { "Control_R", static_cast<Dali::KEY>( DevelKey::DALI_KEY_CONTROL_RIGHT ), false },
+ { "Return", static_cast<Dali::KEY>( DevelKey::DALI_KEY_RETURN ), false }
};
const std::size_t KEY_LOOKUP_COUNT = (sizeof( KeyLookupTable ))/ (sizeof( KeyLookup ));
// CLASS HEADER
#include "watch-application-impl.h"
+#include <style-monitor.h>
namespace Dali
{
}
WatchApplication::WatchApplication( int* argc, char** argv[], const std::string& stylesheet, Dali::Application::WINDOW_MODE windowMode )
-: Application(argc, argv, stylesheet, windowMode, PositionSize(), Framework::WATCH)
+: Application(argc, argv, stylesheet, windowMode, PositionSize(), Framework::WATCH),
+ mState( UNINITIALIZED )
{
+ Dali::StyleMonitor::Get().SetIgnoreGlobalFontSizeChange(1);
}
WatchApplication::~WatchApplication()
enum WatchApplicationState
{
+ UNINITIALIZED,
INITIALIZED,
PAUSED,
RESUMED = INITIALIZED,
#endif // DALI_ELDBUS_AVAILABLE
/**
+ * EcoreInputModifierToEcoreIMFLock function converts from Ecore_Event_Modifier to Ecore_IMF_Keyboard_Locks enums.
+ * @param[in] modifier the Ecore_Event_Modifier input.
+ * @return the Ecore_IMF_Keyboard_Locks output.
+ */
+Ecore_IMF_Keyboard_Locks EcoreInputModifierToEcoreIMFLock( unsigned int modifier )
+{
+ unsigned int lock( ECORE_IMF_KEYBOARD_LOCK_NONE ); // If no other matches, returns NONE.
+
+ if( modifier & ECORE_EVENT_LOCK_NUM )
+ {
+ lock |= ECORE_IMF_KEYBOARD_LOCK_NUM; // Num lock is active.
+ }
+
+ if( modifier & ECORE_EVENT_LOCK_CAPS )
+ {
+ lock |= ECORE_IMF_KEYBOARD_LOCK_CAPS; // Caps lock is active.
+ }
+
+ if( modifier & ECORE_EVENT_LOCK_SCROLL )
+ {
+ lock |= ECORE_IMF_KEYBOARD_LOCK_SCROLL; // Scroll lock is active.
+ }
+
+ return static_cast<Ecore_IMF_Keyboard_Locks>( lock );
+}
+
+/**
* Ecore_Event_Modifier enums in Ecore_Input.h do not match Ecore_IMF_Keyboard_Modifiers in Ecore_IMF.h.
* This function converts from Ecore_Event_Modifier to Ecore_IMF_Keyboard_Modifiers enums.
* @param[in] ecoreModifier the Ecore_Event_Modifier input.
*/
Ecore_IMF_Keyboard_Modifiers EcoreInputModifierToEcoreIMFModifier(unsigned int ecoreModifier)
{
- int modifier( ECORE_IMF_KEYBOARD_MODIFIER_NONE ); // If no other matches returns NONE.
+ unsigned int modifier( ECORE_IMF_KEYBOARD_MODIFIER_NONE ); // If no other matches returns NONE.
if ( ecoreModifier & ECORE_EVENT_MODIFIER_SHIFT ) // enums from ecore_input/Ecore_Input.h
ecoreKeyDownEvent.compose = keyEvent->compose;
ecoreKeyDownEvent.timestamp = keyEvent->timestamp;
ecoreKeyDownEvent.modifiers = EcoreInputModifierToEcoreIMFModifier ( keyEvent->modifiers );
- ecoreKeyDownEvent.locks = (Ecore_IMF_Keyboard_Locks) ECORE_IMF_KEYBOARD_LOCK_NONE;
+ ecoreKeyDownEvent.locks = EcoreInputModifierToEcoreIMFLock( keyEvent->modifiers );
#ifdef ECORE_IMF_1_13
ecoreKeyDownEvent.dev_name = "";
ecoreKeyDownEvent.dev_class = ECORE_IMF_DEVICE_CLASS_KEYBOARD;
ecoreKeyUpEvent.compose = keyEvent->compose;
ecoreKeyUpEvent.timestamp = keyEvent->timestamp;
ecoreKeyUpEvent.modifiers = EcoreInputModifierToEcoreIMFModifier ( keyEvent->modifiers );
- ecoreKeyUpEvent.locks = (Ecore_IMF_Keyboard_Locks) ECORE_IMF_KEYBOARD_LOCK_NONE;
+ ecoreKeyUpEvent.locks = EcoreInputModifierToEcoreIMFLock( keyEvent->modifiers );
#ifdef ECORE_IMF_1_13
ecoreKeyUpEvent.dev_name = "";
#endif // ECORE_IMF_1_13
{ "Shift_R", DALI_KEY_SHIFT_RIGHT, false },
{ "Delete", static_cast<Dali::KEY>( DevelKey::DALI_KEY_DELETE ), false },
{ "Control_L", static_cast<Dali::KEY>( DevelKey::DALI_KEY_CONTROL_LEFT ), false },
- { "Control_R", static_cast<Dali::KEY>( DevelKey::DALI_KEY_CONTROL_RIGHT ), false }
+ { "Control_R", static_cast<Dali::KEY>( DevelKey::DALI_KEY_CONTROL_RIGHT ), false },
+ { "Return", static_cast<Dali::KEY>( DevelKey::DALI_KEY_RETURN ), false }
};
const std::size_t KEY_LOOKUP_COUNT = (sizeof( KeyLookupTable ))/ (sizeof( KeyLookup ));
Name: dali-adaptor
Summary: The DALi Tizen Adaptor
-Version: 1.2.81
+Version: 1.2.82
Release: 1
Group: System/Libraries
License: Apache-2.0 and BSD-3-Clause and MIT
#include <harfbuzz/hb-ft.h>
#include <ft2build.h>
+#include <iostream>
namespace Dali
{
hb_buffer_set_script( harfBuzzBuffer,
SCRIPT_TO_HARFBUZZ[ script ] ); /* see hb-unicode.h */
- hb_buffer_set_language( harfBuzzBuffer,
- hb_language_from_string( DEFAULT_LANGUAGE,
- DEFAULT_LANGUAGE_LENGTH ) );
+
+ char* currentLocale = setlocale(LC_MESSAGES,NULL);
+
+ std::istringstream stringStream( currentLocale );
+ std::string localeString;
+ std::getline(stringStream, localeString, '_');
+ hb_buffer_set_language( harfBuzzBuffer, hb_language_from_string( localeString.c_str(), localeString.size() ) );
/* Layout the text */
hb_buffer_add_utf32( harfBuzzBuffer, text, numberOfCharacters, 0u, numberOfCharacters );