return new DisplayConnection(internal);
}
+DisplayConnection* DisplayConnection::New( RenderSurface::Type type )
+{
+ Internal::Adaptor::DisplayConnection* internal(Internal::Adaptor::DisplayConnection::New());
+ internal->SetSurfaceType( type );
+
+ return new DisplayConnection(internal);
+}
+
DisplayConnection::DisplayConnection()
: mImpl( NULL )
{
#include <dali/public-api/object/any.h>
// INTERNAL INCLUDES
+#include <render-surface.h>
namespace Dali
*/
static DisplayConnection* New();
+ /**
+ * @brief Create an initialized DisplayConnection.
+ * Native surface will need this instead of DisplayConnection::New()
+ *
+ * @param[in] type Render surface type
+ * @return A handle to a newly allocated DisplayConnection resource.
+ */
+ static DisplayConnection* New( RenderSurface::Type type );
+
/**
* @brief Create a DisplayConnection handle; this can be initialised with DisplayConnection::New().
*
// set the initial values before render thread starts
mSurface = adaptorInterfaces.GetRenderSurfaceInterface();
- mDisplayConnection = Dali::DisplayConnection::New();
+ if( mSurface )
+ {
+ mDisplayConnection = Dali::DisplayConnection::New( mSurface->GetSurfaceType() );
+ }
+ else
+ {
+ mDisplayConnection = Dali::DisplayConnection::New();
+ }
}
RenderHelper::~RenderHelper()
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 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.
return idleAdded;
}
+void Adaptor::RemoveIdle( CallbackBase* callback )
+{
+ mCallbackManager->RemoveIdleCallback( callback );
+}
Dali::Adaptor& Adaptor::Get()
{
#define __DALI_INTERNAL_ADAPTOR_IMPL_H__
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 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.
*/
virtual bool AddIdle( CallbackBase* callback );
+ /**
+ * @copydoc Dali::Adaptor::RemoveIdle()
+ */
+ virtual void RemoveIdle( CallbackBase* callback );
+
public:
/**
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 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.
return mImpl->AddIdle( callback );
}
+void Adaptor::RemoveIdle( CallbackBase* callback )
+{
+ mImpl->RemoveIdle( callback );
+}
+
void Adaptor::ReplaceSurface( Any nativeWindow, Dali::RenderSurface& surface )
{
mImpl->ReplaceSurface(nativeWindow, surface);
#include <style-monitor.h>
#include <command-line-options.h>
#include <common/adaptor-impl.h>
+#include <common/framework.h>
#include <singleton-service-impl.h>
#include <lifecycle-controller-impl.h>
#include <iostream> //TODOVR
mWindow = newWindow;
}
+std::string Application::GetResourcePath()
+{
+ return Internal::Adaptor::Framework::GetResourcePath();
+}
+
} // namespace Adaptor
} // namespace Internal
*/
void ReplaceWindow(PositionSize windowPosition, const std::string& name);
+ /**
+ * @copydoc Dali::Application::GetResourcePath();
+ */
+ static std::string GetResourcePath();
+
public: // Stereoscopy
/**
#define __DALI_INTERNAL_CALLBACK_MANAGER_H__
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 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.
virtual ~CallbackManager() {}
/**
- * Adds a call back to be run on idle.
- * Must be call from main thread only.
- * @param callback custom call back function
- * @param priority call back priority
+ * @brief Adds a @p callback to be run on idle.
+ * @note Must be called from the main thread only.
+ *
+ * @param[in] callback custom callback function.
+ *
* @return true on success
*/
virtual bool AddIdleCallback( CallbackBase* callback ) = 0;
+ /**
+ * @brief Removes a previously added @p callback.
+ * @note Must be called from main thread only.
+ *
+ * Does nothing if the @p callback doesn't exist.
+ *
+ * @param[in] callback The callback to be removed.
+ */
+ virtual void RemoveIdleCallback( CallbackBase* callback ) = 0;
+
/**
* Starts the callback manager.
*/
bool SetItem(const std::string &itemData);
/**
- * @copydoc Dali::Clipboard::GetItem()
+ * @copydoc Dali::Clipboard::RequestItem()
*/
- std::string GetItem( unsigned int index );
+ void RequestItem();
/**
* @copydoc Dali::Clipboard::NumberOfClipboardItems()
/**
* @copydoc Dali::Clipboard::HideClipboard()
*/
- void HideClipboard();
+ void HideClipboard(bool skipFirstHide);
+
+ /**
+ * @copydoc Dali::Clipboard::IsVisible()
+ */
+ bool IsVisible() const;
+
+ /**
+ * @brief exchange either sending or receiving buffered data
+ *
+ * @param[in] type true for send buffered data, false for receive data to buffer
+ * @param[in] event information pointer
+ * @return The buffer pointer for send or receive data
+ */
+ char* ExcuteBuffered( bool type, void *event );
private:
Impl* mImpl;
-}; // class clipboard
+public:
+}; // class clipboard
} // namespace Adaptor
} // namespace Internal
- inline static Internal::Adaptor::Clipboard& GetImplementation(Dali::Clipboard& clipboard)
- {
- DALI_ASSERT_ALWAYS( clipboard && "Clipboard handle is empty" );
- BaseObject& handle = clipboard.GetBaseObject();
- return static_cast<Internal::Adaptor::Clipboard&>(handle);
- }
-
- inline static const Internal::Adaptor::Clipboard& GetImplementation(const Dali::Clipboard& clipboard)
- {
- DALI_ASSERT_ALWAYS( clipboard && "Clipboard handle is empty" );
- const BaseObject& handle = clipboard.GetBaseObject();
- return static_cast<const Internal::Adaptor::Clipboard&>(handle);
- }
+inline static Internal::Adaptor::Clipboard& GetImplementation(Dali::Clipboard& clipboard)
+{
+ DALI_ASSERT_ALWAYS( clipboard && "Clipboard handle is empty" );
+ BaseObject& handle = clipboard.GetBaseObject();
+ return static_cast<Internal::Adaptor::Clipboard&>(handle);
+}
+
+inline static const Internal::Adaptor::Clipboard& GetImplementation(const Dali::Clipboard& clipboard)
+{
+ DALI_ASSERT_ALWAYS( clipboard && "Clipboard handle is empty" );
+ const BaseObject& handle = clipboard.GetBaseObject();
+ return static_cast<const Internal::Adaptor::Clipboard&>(handle);
+}
} // namespace Dali
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 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.
return false;
}
- CallbackData *callbackData = new CallbackData( callback );
+ CallbackData* callbackData = new CallbackData( callback );
callbackData->mRemoveFromContainerFunction = MakeCallback( this, &EcoreCallbackManager::RemoveCallbackFromContainer );
return true;
}
+void EcoreCallbackManager::RemoveIdleCallback( CallbackBase* callback )
+{
+ for( CallbackList::iterator it = mCallbackContainer.begin(),
+ endIt = mCallbackContainer.end();
+ it != endIt;
+ ++it )
+ {
+ CallbackData* data = *it;
+
+ if( data->mCallback == callback )
+ {
+ // remove callback data from the container.
+ CallbackBase::Execute( *data->mRemoveFromContainerFunction, data );
+
+ ecore_idler_del( data->mIdler );
+ }
+ }
+}
+
void EcoreCallbackManager::RemoveCallbackFromContainer(CallbackData *callbackData)
{
mCallbackContainer.remove(callbackData);
#define __DALI_ECORE_CALLBACK_MANAGER_H__
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 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.
}
/**
- * @copydoc CallbackManager::AddCallback()
+ * @copydoc CallbackManager::AddIdleCallback()
*/
virtual bool AddIdleCallback( CallbackBase* callback );
+ /**
+ * @copydoc CallbackManager::RemoveIdleCallback()
+ */
+ virtual void RemoveIdleCallback( CallbackBase* callback );
+
/**
* @copydoc CallbackManager::Start()
*/
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 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.
return false;
}
- CallbackData *callbackData = new CallbackData(callback );
+ CallbackData *callbackData = new CallbackData( callback );
// To inform the manager a callback has finished, we get it to call RemoveCallbackFromContainer
callbackData->mRemoveFromContainerFunction = MakeCallback( this, &UvCallbackManager::RemoveCallbackFromContainer );
return true;
}
+void UvCallbackManager::RemoveIdleCallback( CallbackBase* callback )
+{
+ for( CallbackList::iterator it = mCallbackContainer.begin(),
+ endIt = mCallbackContainer.end();
+ it != endIt;
+ ++it )
+ {
+ CallbackData* data = *it;
+
+ if( data->mCallback == callback )
+ {
+ // remove callback data from the container.
+ CallbackBase::Execute( *data->mRemoveFromContainerFunction, data );
+
+ delete data;
+ }
+ }
+}
+
void UvCallbackManager::RemoveCallbackFromContainer(CallbackData *callbackData)
{
mCallbackContainer.remove(callbackData);
#define __DALI_UV_CALLBACK_MANAGER_H__
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 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.
~UvCallbackManager(){}
/**
- * @copydoc CallbackManager::AddCallback()
+ * @copydoc CallbackManager::AddIdleCallback()
*/
virtual bool AddIdleCallback( CallbackBase* callback );
+ /**
+ * @copydoc CallbackManager::RemoveIdleCallback()
+ */
+ virtual void RemoveIdleCallback( CallbackBase* callback );
+
/**
* @copydoc CallbackManager::Start()
*/
{
/**
- * The Framework class is used to register callbacks with the TIZEN platform so that
+ * The Framework class is ideally placed to provide key API required by Applications.
+ *
+ * The class is also used to register callbacks with the TIZEN platform so that
* we know when any of the application lifecycle events occur. This includes events
* like when our application is to be initialised, terminated, paused, resumed etc.
+ *
*/
class Framework
{
*/
std::string GetBundleId() const;
+ /**
+ * Gets the path at which application resources are stored.
+ */
+ static std::string GetResourcePath();
+
private:
// Undefined
{
return Internal::Adaptor::Clipboard::Get();
}
+
bool Clipboard::SetItem( const std::string &itemData)
{
return GetImplementation(*this).SetItem( itemData );
}
-std::string Clipboard::GetItem( unsigned int index )
+void Clipboard::RequestItem()
{
- return GetImplementation(*this).GetItem( index );
+ GetImplementation(*this).RequestItem();
}
unsigned int Clipboard::NumberOfItems()
void Clipboard::HideClipboard()
{
- GetImplementation(*this).HideClipboard();
+ GetImplementation(*this).HideClipboard(false);
+}
+
+bool Clipboard::IsVisible() const
+{
+ return GetImplementation(*this).IsVisible();
}
} // namespace Dali
#define __DALI_CLIPBOARD_H__
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 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.
bool SetItem( const std::string& itemData );
/**
- * @brief Retreive the string at the given index in the clipboard.
+ * @brief Request clipboard service to retrieve an item
*
- * @param[in] index item in clipboard list to retrieve
- * @return string the text item at the current index.
+ * Calling this method will trigger a signal from the clipboard event notifier.
+ * @see Dali::ClipboardEventNotifier::ContentSelectedSignal()
*/
- std::string GetItem( unsigned int index );
+ void RequestItem();
/**
* @brief Returns the number of item currently in the clipboard.
*/
void HideClipboard();
+ /**
+ * @brief Retrieves the clipboard's visibility
+ * @return bool true if the clipboard is visible.
+ */
+ bool IsVisible() const;
+
};
} // namespace Dali
return Internal::Adaptor::ImfManager::GetImplementation(*this).GetSurroundingText();
}
+void ImfManager::NotifyTextInputMultiLine( bool multiLine )
+{
+ Internal::Adaptor::ImfManager::GetImplementation(*this).NotifyTextInputMultiLine( multiLine );
+}
+
ImfManager::ImfManagerSignalType& ImfManager::ActivatedSignal()
{
return Internal::Adaptor::ImfManager::GetImplementation(*this).ActivatedSignal();
*/
const std::string& GetSurroundingText() const;
+ /**
+ * @brief Notifies IMF context that text input is set to multi line or not
+ *
+ * @param[in] multiLine True if multiline text input is used
+ */
+ void NotifyTextInputMultiLine( bool multiLine );
+
public:
// Signals
{
public:
+ enum Type
+ {
+ ECORE_RENDER_SURFACE,
+ WAYLAND_RENDER_SURFACE,
+ NATIVE_RENDER_SURFACE
+ };
+
/**
* @brief Constructor
* Inlined as this is a pure abstract interface
*/
virtual void SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization ) = 0;
+ virtual RenderSurface::Type GetSurfaceType() = 0;
+
private:
/**
// EXTERNAL INCLUDES
#include <Ecore.h>
#include <Evas.h>
+#ifdef WAYLAND
+#include <Ecore_Wayland.h>
+#else
+#include <Ecore_X.h>
+#endif
#include <sys/types.h>
#include <sys/stat.h>
// Copied from ecore_evas_extn_engine.h
+#define NBUF 2
+
enum // opcodes
{
OP_RESIZE,
OP_EV_KEY_DOWN,
OP_EV_HOLD,
OP_MSG_PARENT,
- OP_MSG
+ OP_MSG,
+ OP_PIXMAP_REF,
};
// Copied from elm_conform.c
Debug::Filter* gIndicatorLogFilter = Debug::Filter::New(Debug::Concise, false, "LOG_INDICATOR");
#endif
+// Impl to hide EFL implementation.
+
+struct Indicator::Impl
+{
+ enum // operation mode
+ {
+ INDICATOR_HIDE,
+ INDICATOR_STAY_WITH_DURATION
+ };
+
+ /**
+ * Constructor
+ */
+ Impl(Indicator* indicator)
+ : mIndicator(indicator),
+ mEcoreEventHandler(NULL)
+ {
+#if defined(DALI_PROFILE_MOBILE)
+#if defined(WAYLAND)
+ mEcoreEventHandler = ecore_event_handler_add(ECORE_WL_EVENT_INDICATOR_FLICK, EcoreEventIndicator, this);
+#else
+ mEcoreEventHandler = ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE, EcoreEventClientMessage, this);
+#endif
+#endif // WAYLAND && DALI_PROFILE_MOBILE
+ }
+
+ /**
+ * Destructor
+ */
+ ~Impl()
+ {
+ if ( mEcoreEventHandler )
+ {
+ ecore_event_handler_del(mEcoreEventHandler);
+ }
+ }
+
+ static void SetIndicatorVisibility( void* data, int operation )
+ {
+ Indicator::Impl* indicatorImpl((Indicator::Impl*)data);
+
+ if ( indicatorImpl == NULL || indicatorImpl->mIndicator == NULL)
+ {
+ return;
+ }
+ if ( operation == INDICATOR_STAY_WITH_DURATION )
+ {
+ // if indicator is not showing, INDICATOR_FLICK_DONE is given
+ if( indicatorImpl->mIndicator->mVisible == Dali::Window::AUTO &&
+ !indicatorImpl->mIndicator->mIsShowing )
+ {
+ indicatorImpl->mIndicator->ShowIndicator( AUTO_INDICATOR_STAY_DURATION );
+ }
+ }
+ else if( operation == INDICATOR_HIDE )
+ {
+ if( indicatorImpl->mIndicator->mVisible == Dali::Window::AUTO &&
+ indicatorImpl->mIndicator->mIsShowing )
+ {
+ indicatorImpl->mIndicator->ShowIndicator( HIDE_NOW );
+ }
+ }
+ }
+#if defined(DALI_PROFILE_MOBILE)
+#if defined(WAYLAND)
+ /**
+ * Called when the Ecore indicator event is received.
+ */
+ static Eina_Bool EcoreEventIndicator( void* data, int type, void* event )
+ {
+ SetIndicatorVisibility( data, INDICATOR_STAY_WITH_DURATION );
+ return ECORE_CALLBACK_PASS_ON;
+ }
+#else
+ /**
+ * Called when the client messages (i.e. quick panel state) are received.
+ */
+ static Eina_Bool EcoreEventClientMessage( void* data, int type, void* event )
+ {
+ Ecore_X_Event_Client_Message* clientMessageEvent((Ecore_X_Event_Client_Message*)event);
+
+ if ( clientMessageEvent != NULL )
+ {
+ if (clientMessageEvent->message_type == ECORE_X_ATOM_E_INDICATOR_FLICK_DONE)
+ {
+ SetIndicatorVisibility( data, INDICATOR_STAY_WITH_DURATION );
+ }
+ else if ( clientMessageEvent->message_type == ECORE_X_ATOM_E_MOVE_QUICKPANEL_STATE )
+ {
+ SetIndicatorVisibility( data, INDICATOR_HIDE );
+ }
+ }
+ return ECORE_CALLBACK_PASS_ON;
+ }
+#endif
+#endif // WAYLAND && DALI_PROFILE_MOBILE
+
+ // Data
+ Indicator* mIndicator;
+ Ecore_Event_Handler* mEcoreEventHandler;
+};
Indicator::LockFile::LockFile(const std::string filename)
: mFilename(filename),
mIsShowing( true ),
mIsAnimationPlaying( false ),
mCurrentSharedFile( 0 ),
+ mSharedBufferType( BUFFER_TYPE_SHM ),
+ mImpl( NULL ),
mBackgroundVisible( false )
{
mIndicatorContentActor = Dali::Actor::New();
}
// hide the indicator by default
mIndicatorActor.SetVisible( false );
+
+ // create impl to handle ecore event
+ mImpl = new Impl(this);
}
Indicator::~Indicator()
{
+ if(mImpl)
+ {
+ delete mImpl;
+ mImpl = NULL;
+ }
+
if(mEventActor)
{
mEventActor.TouchedSignal().Disconnect( this, &Indicator::OnTouched );
{
UpdateImageData( mCurrentSharedFile );
}
- if ( visibleMode != Dali::Window::INVISIBLE )
+
+ if ( visibleMode == Dali::Window::INVISIBLE )
+ {
+ if (mServerConnection)
+ {
+ mServerConnection->SendEvent( OP_HIDE, NULL, 0 );
+ }
+ }
+ else
{
mIndicatorActor.SetVisible( true );
+
+ if( mServerConnection )
+ {
+ mServerConnection->SendEvent( OP_SHOW, NULL, 0 );
+ }
}
mVisible = visibleMode;
ShowIndicator( HIDE_NOW );
}
}
+ else
+ {
+ mIsShowing = false;
+ }
}
}
break;
case Dali::PointState::UP:
+ case Dali::PointState::INTERRUPTED:
{
IpcDataEvMouseUp ipcUp( touchEvent.time );
mServerConnection->SendEvent( OP_EV_MOUSE_UP, &ipcUp, sizeof(ipcUp) );
// epcEvent->ref_to == sys
// epcEvent->response == buffer num
+ if ( mSharedBufferType != BUFFER_TYPE_SHM )
+ {
+ return ;
+ }
+
int n = epcEvent->response;
if( n >= 0 && n < SHARED_FILE_NUMBER )
}
CreateNewImage( n );
-
- if( CheckVisibleState() )
- {
- // set default indicator type (enable the quick panel)
- OnIndicatorTypeChanged( INDICATOR_TYPE_1 );
- }
- else
- {
- // set default indicator type (disable the quick panel)
- OnIndicatorTypeChanged( INDICATOR_TYPE_2 );
- }
-
- SetVisible(mVisible, true);
+ UpdateVisibility();
}
}
}
{
DALI_LOG_TRACE_METHOD( gIndicatorLogFilter );
- // epcEvent->ref == w
- // epcEvent->ref_to == h
- // epcEvent->response == alpha
- // epcEvent->data = pixmap id
+ // epcEvent->ref == pixmap id
+ // epcEvent->ref_to == type
+ // epcEvent->response == buffer num
- if( ( epcEvent->data ) &&
- (epcEvent->size >= (int)sizeof(PixmapId)) )
+ if( (epcEvent->ref > 0) && (epcEvent->ref_to > 0) )
{
+ mSharedBufferType = (BufferType)(epcEvent->ref_to);
+
ClearSharedFileInfo();
- if( (epcEvent->ref > 0) && (epcEvent->ref_to > 0) )
- {
- mImageWidth = epcEvent->ref;
- mImageHeight = epcEvent->ref_to;
+ mPixmap = static_cast<PixmapId>(epcEvent->ref);
+ DALI_LOG_INFO( gIndicatorLogFilter, Debug::General, "mPixmap [%x]", mPixmap);
- mPixmap = *(static_cast<PixmapId*>(epcEvent->data));
- CreateNewPixmapImage();
+ CreateNewPixmapImage();
+ UpdateVisibility();
+ }
+}
- if( CheckVisibleState() )
- {
- // set default indicator type (enable the quick panel)
- OnIndicatorTypeChanged( INDICATOR_TYPE_1 );
- }
- else
- {
- // set default indicator type (disable the quick panel)
- OnIndicatorTypeChanged( INDICATOR_TYPE_2 );
- }
+void Indicator::UpdateVisibility()
+{
+ if( CheckVisibleState() )
+ {
+ // set default indicator type (enable the quick panel)
+ OnIndicatorTypeChanged( INDICATOR_TYPE_1 );
+ }
+ else
+ {
+ // set default indicator type (disable the quick panel)
+ OnIndicatorTypeChanged( INDICATOR_TYPE_2 );
+ }
- SetVisible(mVisible, true);
- }
+ if( !mIsShowing )
+ {
+ mIndicatorContentActor.SetPosition( 0.0f, -mImageHeight, 0.0f );
}
+
+ SetVisible(mVisible, true);
}
void Indicator::UpdateImageData( int bufferNumber )
DALI_LOG_INFO( gIndicatorLogFilter, Debug::General, "Indicator client received: OP_UPDATE\n" );
if( mIsShowing )
{
- mAdaptor->RequestUpdateOnce();
+ //mAdaptor->RequestUpdateOnce();
}
break;
}
{
DALI_LOG_INFO( gIndicatorLogFilter, Debug::General, "Indicator client received: OP_UPDATE_DONE [%d]\n", epcEvent->response );
// epcEvent->response == display buffer #
- UpdateImageData( epcEvent->response );
+ //UpdateImageData( epcEvent->response );
break;
}
case OP_SHM_REF0:
LoadSharedImage( epcEvent );
break;
}
+ case OP_PIXMAP_REF:
+ {
+ DALI_LOG_INFO( gIndicatorLogFilter, Debug::General, "Indicator client received: OP_PIXMAP_REF\n" );
+ LoadPixmapImage( epcEvent );
+ break;
+ }
case OP_RESIZE:
{
DALI_LOG_INFO( gIndicatorLogFilter, Debug::General, "Indicator client received: OP_RESIZE\n" );
}
break;
}
-
}
}
break;
{
if( mOrientation == Dali::Window::LANDSCAPE
|| mOrientation == Dali::Window::LANDSCAPE_INVERSE
- || (mVisible != Dali::Window::VISIBLE) )
+ || (mVisible == Dali::Window::INVISIBLE)
+ || (mVisible == Dali::Window::AUTO && !mIsShowing) )
{
return false;
}
}
else
{
+ mIndicatorAnimation.Clear();
+
if( EqualsZero(duration) )
{
mIndicatorAnimation.AnimateTo( Property( mIndicatorContentActor, Dali::Actor::Property::POSITION ), Vector3(0, -mImageHeight, 0), Dali::AlphaFunction::EASE_OUT );
{
mIsAnimationPlaying = false;
// once animation is finished and indicator is hidden, take it off stage
- if( !mIsShowing )
+ if( mObserver != NULL )
{
- if( mObserver != NULL )
- {
- mObserver->IndicatorVisibilityChanged( mIsShowing ); // is showing?
- }
+ mObserver->IndicatorVisibilityChanged( mIsShowing ); // is showing?
}
}
void Indicator::OnPan( Dali::Actor actor, const Dali::PanGesture& gesture )
{
+ return ;
+
if( mServerConnection )
{
switch( gesture.state )
{
case Dali::PointState::DOWN:
{
- ShowIndicator( HIDE_NOW );
+ // if touch point is inside the indicator, indicator is not hidden
+ if( mImageHeight < int(touchPoint.screen.y) )
+ {
+ ShowIndicator( HIDE_NOW );
+ }
break;
}
CONNECTED
};
+ /**
+ * copied from ecore_evas_extn_engine.h
+ */
+ enum BufferType
+ {
+ BUFFER_TYPE_SHM = 0, ///< shared memory-based buffer backend
+ BUFFER_TYPE_DRI2_PIXMAP, ///< dri2 pixmap-based buffer backend
+ BUFFER_TYPE_EVASGL_PIXMAP, ///< pixmap backend for Evas GL only (DEPRECATED)
+ BUFFER_TYPE_GL_PIXMAP, ///< double buffered GL pixmap backend
+ };
protected:
/**
*/
void LoadPixmapImage( Ecore_Ipc_Event_Server_Data *epcEvent );
+ /**
+ * Update the visibility and position of the actors
+ */
+ void UpdateVisibility();
+
/**
* Inform dali that the indicator data has been updated.
* @param[in] bufferNumber The shared file number
int mCurrentSharedFile; ///< Current shared file number
SharedFileInfo mSharedFileInfo[SHARED_FILE_NUMBER]; ///< Table to store shared file info
+ BufferType mSharedBufferType; ///< Shared buffer type which is used to render indicator
+
+ struct Impl; ///< Contains Ecore specific information
+ Impl* mImpl; ///< Created on construction and destroyed on destruction.
+
bool mBackgroundVisible; ///< Indicate whether background is visible
};
#include <dali/public-api/object/any.h>
#include <dali/public-api/object/type-registry.h>
#include <dali/integration-api/debug.h>
+#include <unistd.h>
+
+#ifdef DALI_ELDBUS_AVAILABLE
+#include <Eldbus.h>
+#endif // DALI_ELDBUS_AVAILABLE
// INTERNAL INCLUDES
#include <singleton-service-impl.h>
-namespace //unnamed namespace
-{
-const char* const CBHM_WINDOW = "CBHM_XWIN";
-const char* const CBHM_MSG = "CBHM_MSG";
-const char* const CBHM_ITEM = "CBHM_ITEM";
-const char* const CBHM_cCOUNT = "CBHM_cCOUNT";
-const char* const CBHM_ERROR = "CBHM_ERROR";
-const char* const SET_ITEM = "SET_ITEM";
-const char* const SHOW = "show0";
-const char* const HIDE = "cbhm_hide";
-}
+#define CBHM_DBUS_OBJPATH "/org/tizen/cbhm/dbus"
+#ifndef CBHM_DBUS_INTERFACE
+#define CBHM_DBUS_INTERFACE "org.tizen.cbhm.dbus"
+#endif /* CBHM_DBUS_INTERFACE */
+
+#define CLIPBOARD_STR "CLIPBOARD_STR"
+#define CLIPBOARD_BUFFER_SIZE 512
///////////////////////////////////////////////////////////////////////////////////////////////////
// Clipboard
struct Clipboard::Impl
{
- // Put implementation here.
+ Impl()
+ {
+ Eldbus_Object *eldbus_obj;
+ cbhm_conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION);
+ eldbus_obj = eldbus_object_get(cbhm_conn, CBHM_DBUS_INTERFACE, CBHM_DBUS_OBJPATH);
+ eldbus_proxy = eldbus_proxy_get(eldbus_obj, CBHM_DBUS_INTERFACE);
+ eldbus_name_owner_changed_callback_add(cbhm_conn, CBHM_DBUS_INTERFACE, NULL, cbhm_conn, EINA_TRUE);
+ eldbus_proxy_signal_handler_add(eldbus_proxy, "ItemClicked", _on_item_clicked, this);
+ mVisible = false;
+ mIsFirstTimeHidden = true;
+ }
+
+ ~Impl()
+ {
+ if (cbhm_conn)
+ eldbus_connection_unref(cbhm_conn);
+ }
+
+ Eldbus_Proxy* cbhm_proxy_get()
+ {
+ return eldbus_proxy;
+ }
+
+ Eldbus_Connection* cbhm_connection_get()
+ {
+ return cbhm_conn;
+ }
+
+ void SetItem( const std::string &itemData )
+ {
+ const char *data = itemData.c_str();
+ const char *types[10] = {0, };
+ int i = -1;
+
+ if (data == NULL)
+ {
+ return;
+ }
+ strcpy(mSendBuf, data);
+
+ // ELM_SEL_TYPE_CLIPBOARD - To distinguish clipboard selection in cbhm
+ types[++i] = "CLIPBOARD_BEGIN";
+
+ types[++i] = "application/x-elementary-markup";
+ types[++i] = "text/plain";
+ types[++i] = "text/plain;charset=utf-8";
+
+ // ELM_SEL_TYPE_CLIPBOARD - To distinguish clipboard selection in cbhm
+ types[++i] = "CLIPBOARD_END";
+ ecore_wl_dnd_selection_set(ecore_wl_input_get(), types);
+ }
+
+ void RequestItem()
+ {
+ const char *types[10] = {0, };
+ int i = -1;
+
+ types[++i] = "application/x-elementary-markup";
+ types[++i] = "text/plain";
+ types[++i] = "text/plain;charset=utf-8";
+ ecore_wl_dnd_selection_get(ecore_wl_input_get(), *types);
+ }
+
+ char *ExcuteSend( void *event )
+ {
+ Ecore_Wl_Event_Data_Source_Send *ev = (Ecore_Wl_Event_Data_Source_Send *)event;
+ int len_buf = strlen(mSendBuf);
+ int len_remained = len_buf;
+ int len_written = 0, ret;
+ char *buf = mSendBuf;
+
+ while (len_written < len_buf)
+ {
+ ret = write(ev->fd, buf, len_remained);
+ if (ret == -1) break;
+ buf += ret;
+ len_written += ret;
+ len_remained -= ret;
+ }
+ close(ev->fd);
+ return (char *)mSendBuf;
+ }
+
+ char *ExcuteReceive( void *event )
+ {
+ Ecore_Wl_Event_Selection_Data_Ready *ev = (Ecore_Wl_Event_Selection_Data_Ready *)event;
+
+ strncpy(mReceiveBuf, (char *)ev->data, ev->len);
+ mReceiveBuf[ev->len] = '\0';
+ return (char *)mReceiveBuf;
+ }
+
+ int GetCount()
+ {
+ Eldbus_Message *reply, *req;
+ const char *errname = NULL, *errmsg = NULL;
+ int count = -1;
+
+ if (!(req = eldbus_proxy_method_call_new(eldbus_proxy, "CbhmGetCount")))
+ {
+ DALI_LOG_ERROR("Failed to create method call on org.freedesktop.DBus.Properties.Get");
+ return -1;
+ }
+
+ eldbus_message_ref(req);
+ reply = eldbus_proxy_send_and_block(eldbus_proxy, req, 100);
+ if (!reply || eldbus_message_error_get(reply, &errname, &errmsg))
+ {
+ DALI_LOG_ERROR("Unable to call method org.freedesktop.DBus.Properties.Get: %s %s",
+ errname, errmsg);
+ eldbus_message_unref(req);
+ return -1;
+ }
+
+ if (!eldbus_message_arguments_get(reply, "i", &count))
+ {
+ DALI_LOG_ERROR("Cannot get arguments from eldbus");
+ eldbus_message_unref(req);
+ return -1;
+ }
+
+ eldbus_message_unref(req);
+ DALI_LOG_ERROR("cbhm item count(%d)", count);
+ return count;
+ }
+
+ void ShowClipboard()
+ {
+ eldbus_proxy_call(cbhm_proxy_get(), "CbhmShow", NULL, NULL, -1, "s", "0");
+ mIsFirstTimeHidden = true;
+ mVisible = true;
+ }
+
+ void HideClipboard( bool skipFirstHide )
+ {
+ if ( skipFirstHide && mIsFirstTimeHidden )
+ {
+ mIsFirstTimeHidden = false;
+ return;
+ }
+ eldbus_proxy_call(cbhm_proxy_get(), "CbhmHide", NULL, NULL, -1, "");
+ mIsFirstTimeHidden = false;
+ mVisible = false;
+ }
+
+ bool IsVisible() const
+ {
+ return mVisible;
+ }
+
+ static void _on_item_clicked(void *data, const Eldbus_Message *msg EINA_UNUSED)
+ {
+ static_cast<Clipboard::Impl*>(data)->RequestItem();
+ }
+
+ Eldbus_Proxy *eldbus_proxy;
+ Eldbus_Connection *cbhm_conn;
+
+ char mSendBuf[CLIPBOARD_BUFFER_SIZE];
+ char mReceiveBuf[CLIPBOARD_BUFFER_SIZE];
+ bool mVisible;
+ bool mIsFirstTimeHidden;
};
Clipboard::Clipboard(Impl* impl)
bool Clipboard::SetItem(const std::string &itemData )
{
+ mImpl->SetItem( itemData );
return true;
}
/*
- * Get string at given index of clipboard
+ * Request clipboard service to give an item
*/
-std::string Clipboard::GetItem( unsigned int index ) // change string to a Dali::Text object.
+void Clipboard::RequestItem()
{
- if ( index >= NumberOfItems() )
- {
- return "";
- }
-
- std::string emptyString( "" );
- char sendBuf[20];
-
- snprintf( sendBuf, 20, "%s%d", CBHM_ITEM, index );
- return emptyString;
+ mImpl->RequestItem();
}
/*
*/
unsigned int Clipboard::NumberOfItems()
{
- int count = -1;
-
- return count;
+ return mImpl->GetCount();
}
-/**
- * Show clipboard window
- * Function to send message to show the Clipboard (cbhm) as no direct API available
- * Reference elementary/src/modules/ctxpopup_copypasteUI/cbhm_helper.c
- */
void Clipboard::ShowClipboard()
{
+ mImpl->ShowClipboard();
}
-void Clipboard::HideClipboard()
+void Clipboard::HideClipboard(bool skipFirstHide)
{
+ mImpl->HideClipboard(skipFirstHide);
}
+bool Clipboard::IsVisible() const
+{
+ return mImpl->IsVisible();
+}
+
+char* Clipboard::ExcuteBuffered( bool type, void *event )
+{
+ return (type ? mImpl->ExcuteSend( event ) : mImpl->ExcuteReceive( event ));
+}
} // namespace Adaptor
#include <dali/integration-api/debug.h>
// INTERNAL HEADERS
-#include <pixmap-render-surface.h>
+#include <native-render-surface.h>
namespace Dali
{
}
DisplayConnection::DisplayConnection()
-: mDisplay(NULL)
{
- mDisplay = ecore_wl_display_get();
}
DisplayConnection::~DisplayConnection()
{
- //FIXME
+ if( mSurfaceType == RenderSurface::NATIVE_RENDER_SURFACE )
+ {
+ ReleaseNativeDisplay();
+ }
}
Any DisplayConnection::GetDisplay()
{
- return Any(mDisplay);
+ return Any( mDisplay );
}
void DisplayConnection::ConsumeEvents()
{
EglImplementation& eglImpl = static_cast<EglImplementation&>(egl);
- if (!eglImpl.InitializeGles(reinterpret_cast<EGLNativeDisplayType>(mDisplay)))
+ if( !eglImpl.InitializeGles( mDisplay ) )
{
DALI_LOG_ERROR("Failed to initialize GLES.\n");
return false;
return true;
}
+void DisplayConnection::SetSurfaceType( RenderSurface::Type type )
+{
+ mSurfaceType = type;
+
+ if( mSurfaceType == RenderSurface::NATIVE_RENDER_SURFACE )
+ {
+ mDisplay = GetNativeDisplay();
+ }
+ else
+ {
+ mDisplay = reinterpret_cast< EGLNativeDisplayType >( ecore_wl_display_get() );
+ }
+}
+
void DisplayConnection::GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVertical)
{
// calculate DPI
-#ifndef __DALI_INTERNAL_ECORE_X_DIPLAY_CONNECTION_H__
-#define __DALI_INTERNAL_ECORE_X_DIPLAY_CONNECTION_H__
+#ifndef __DALI_INTERNAL_ECORE_WAYLAND_DIPLAY_CONNECTION_H__
+#define __DALI_INTERNAL_ECORE_WAYLAND_DIPLAY_CONNECTION_H__
/*
* Copyright (c) 2015 Samsung Electronics Co., Ltd.
*/
bool InitializeEgl(EglInterface& egl);
+ /**
+ * @brief Sets surface type
+ */
+ void SetSurfaceType( RenderSurface::Type type );
+
public:
/**
protected:
+ /**
+ * @brief Gets display connection for native surface
+ */
+ EGLNativeDisplayType GetNativeDisplay();
+
+ /**
+ * @brief Release display connection for native surface
+ */
+ void ReleaseNativeDisplay();
+
// Undefined
DisplayConnection(const DisplayConnection&);
DisplayConnection& operator=(const DisplayConnection& rhs);
private:
- WlDisplay* mDisplay; ///< Wayland-display for rendering
+ EGLNativeDisplayType mDisplay; ///< Wayland-display for rendering
+ RenderSurface::Type mSurfaceType;
};
} // namespace Adaptor
mEcoreEventHandler.push_back( ecore_event_handler_add( ECORE_EVENT_KEY_DOWN, EcoreEventKeyDown, handler ) );
mEcoreEventHandler.push_back( ecore_event_handler_add( ECORE_EVENT_KEY_UP, EcoreEventKeyUp, handler ) );
+ // Register Selection event - clipboard selection
+ mEcoreEventHandler.push_back( ecore_event_handler_add( ECORE_WL_EVENT_DATA_SOURCE_SEND, EcoreEventDataSend, handler ) );
+ mEcoreEventHandler.push_back( ecore_event_handler_add( ECORE_WL_EVENT_SELECTION_DATA_READY, EcoreEventDataReceive, handler ) );
+
+ // Register Detent event
+ mEcoreEventHandler.push_back( ecore_event_handler_add( ECORE_EVENT_DETENT_ROTATE, EcoreEventDetent, handler) );
+
#ifndef DALI_PROFILE_UBUNTU
// Register Vconf notify - font name and size
vconf_notify_key_changed( DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, VconfNotifyFontNameChanged, handler );
}
}
}
- // No need to connect callbacks as KeyboardStatusChanged will be called.
+ Dali::Clipboard clipboard = Clipboard::Get();
+ clipboard.HideClipboard();
}
return ECORE_CALLBACK_PASS_ON;
}
}
- // Clipboard don't support that whether clipboard is shown or not. Hide clipboard.
+ // Hiding clipboard event will be ignored once because window focus out event is always received on showing clipboard
Dali::Clipboard clipboard = Clipboard::Get();
- clipboard.HideClipboard();
+ if ( clipboard )
+ {
+ Clipboard& clipBoardImpl( GetImplementation( clipboard ) );
+ clipBoardImpl.HideClipboard(true);
+ }
}
return ECORE_CALLBACK_PASS_ON;
return ECORE_CALLBACK_PASS_ON;
}
+ /**
+ * Called when the source window notifies us the content in clipboard is selected.
+ */
+ static Eina_Bool EcoreEventDataSend( void* data, int type, void* event )
+ {
+ DALI_LOG_INFO(gSelectionEventLogFilter, Debug::Concise, "EcoreEventDataSend\n" );
+
+ Dali::Clipboard clipboard = Clipboard::Get();
+ if ( clipboard )
+ {
+ Clipboard& clipBoardImpl( GetImplementation( clipboard ) );
+ clipBoardImpl.ExcuteBuffered( true, event );
+ }
+ return ECORE_CALLBACK_PASS_ON;
+ }
+
+ /**
+ * Called when the source window sends us about the selected content.
+ * For example, when item is selected in the clipboard.
+ */
+ static Eina_Bool EcoreEventDataReceive( void* data, int type, void* event )
+ {
+ DALI_LOG_INFO(gSelectionEventLogFilter, Debug::Concise, "EcoreEventDataReceive\n" );
+
+ EventHandler* handler( (EventHandler*)data );
+ Dali::Clipboard clipboard = Clipboard::Get();
+ char *selectionData = NULL;
+ if ( clipboard )
+ {
+ Clipboard& clipBoardImpl( GetImplementation( clipboard ) );
+ selectionData = clipBoardImpl.ExcuteBuffered( false, event );
+ }
+ if ( selectionData && handler->mClipboardEventNotifier )
+ {
+ ClipboardEventNotifier& clipboardEventNotifier( ClipboardEventNotifier::GetImplementation( handler->mClipboardEventNotifier ) );
+ std::string content( selectionData, strlen(selectionData) );
+
+ clipboardEventNotifier.SetContent( content );
+ clipboardEventNotifier.EmitContentSelectedSignal();
+ }
+ return ECORE_CALLBACK_PASS_ON;
+ }
+
+ /*
+ * Called when detent event is recevied
+ */
+ static Eina_Bool EcoreEventDetent( void* data, int type, void* event )
+ {
+ DALI_LOG_INFO(gSelectionEventLogFilter, Debug::Concise, "EcoreEventDetent\n" );
+ EventHandler* handler( (EventHandler*)data );
+ Ecore_Event_Detent_Rotate *e((Ecore_Event_Detent_Rotate *)event);
+ int direction = (e->direction == ECORE_DETENT_DIRECTION_CLOCKWISE) ? 1 : -1;
+ int timeStamp = e->timestamp;
+
+ WheelEvent wheelEvent( WheelEvent::CUSTOM_WHEEL, 0, 0, Vector2(0.0f, 0.0f), direction, timeStamp );
+ handler->SendWheelEvent( wheelEvent );
+ return ECORE_CALLBACK_PASS_ON;
+ }
+
/////////////////////////////////////////////////////////////////////////////////////////////////
// Font Callbacks
/////////////////////////////////////////////////////////////////////////////////////////////////
return mSurroundingText;
}
+void ImfManager::NotifyTextInputMultiLine( bool multiLine )
+{
+ Ecore_IMF_Input_Hints currentHint = ecore_imf_context_input_hint_get(mIMFContext);
+ ecore_imf_context_input_hint_set(mIMFContext, (Ecore_IMF_Input_Hints)(multiLine ?
+ (currentHint | ECORE_IMF_INPUT_HINT_MULTILINE) :
+ (currentHint & ~ECORE_IMF_INPUT_HINT_MULTILINE)));
+}
+
} // Adaptor
} // Internal
*/
const std::string& GetSurroundingText() const;
+ /**
+ * @copydoc Dali::ImfManager::NotifyTextInputMultiLine()
+ */
+ void NotifyTextInputMultiLine( bool multiLine );
+
public: // Signals
/**
return surfaceId;
}
+RenderSurface::Type EcoreWlRenderSurface::GetSurfaceType()
+{
+ return RenderSurface::ECORE_RENDER_SURFACE;
+}
+
} // namespace ECore
} // namespace Dali
void Window::SetIndicatorProperties( bool isShow, Dali::Window::WindowOrientation lastOrientation )
{
+ ECore::WindowRenderSurface* wlSurface( dynamic_cast< ECore::WindowRenderSurface * >( mSurface ) );
+
+ if( wlSurface )
+ {
+ Ecore_Wl_Window* wlWindow = wlSurface->GetWlWindow();
+ if ( isShow )
+ {
+ ecore_wl_window_indicator_state_set(wlWindow, ECORE_WL_INDICATOR_STATE_ON);
+ }
+ else
+ {
+ ecore_wl_window_indicator_state_set(wlWindow, ECORE_WL_INDICATOR_STATE_OFF);
+ }
+ }
}
void Window::IndicatorTypeChanged(Indicator::Type type)
{
+#if defined(DALI_PROFILE_MOBILE)
+ ECore::WindowRenderSurface* wlSurface( dynamic_cast< ECore::WindowRenderSurface * >( mSurface ) );
+
+ if( wlSurface )
+ {
+ Ecore_Wl_Window* wlWindow = wlSurface->GetWlWindow();
+ switch(type)
+ {
+ case Indicator::INDICATOR_TYPE_1:
+ ecore_wl_indicator_visible_type_set(wlWindow, ECORE_WL_INDICATOR_VISIBLE_TYPE_SHOWN);
+ break;
+
+ case Indicator::INDICATOR_TYPE_2:
+ ecore_wl_indicator_visible_type_set(wlWindow, ECORE_WL_INDICATOR_VISIBLE_TYPE_HIDDEN);
+ break;
+
+ case Indicator::INDICATOR_TYPE_UNKNOWN:
+ default:
+ break;
+ }
+ }
+#endif //MOBILE
}
void Window::IndicatorClosed( IndicatorInterface* indicator )
#define __DALI_INTEGRATION_ADAPTOR_H__
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 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.
*/
bool AddIdle( CallbackBase* callback );
+ /**
+ * @brief Removes a previously added @p callback.
+ * @note Function must be called from the main event thread only.
+ *
+ * Does nothing if the @p callback doesn't exist.
+ *
+ * @param[in] callback The callback to be removed.
+ */
+ void RemoveIdle( CallbackBase* callback );
+
/**
* @brief Replaces the rendering surface
*
$(adaptor_integration_api_dir)/thread-synchronization-interface.h \
$(adaptor_integration_api_dir)/trigger-event-interface.h \
$(adaptor_integration_api_dir)/trigger-event-factory-interface.h \
- $(adaptor_integration_api_dir)/trigger-event-factory.h \
- $(adaptor_integration_api_dir)/pixmap-render-surface-factory.h
+ $(adaptor_integration_api_dir)/trigger-event-factory.h
adaptor_integration_wayland_api_header_files = \
$(adaptor_integration_api_dir)/wayland/wl-types.h \
$(adaptor_integration_api_dir)/wayland/ecore-wl-render-surface.h \
- $(adaptor_integration_api_dir)/wayland/pixmap-render-surface.h
+ $(adaptor_integration_api_dir)/wayland/native-render-surface.h \
+ $(adaptor_integration_api_dir)/native-render-surface-factory.h
adaptor_integration_x11_api_header_files = \
$(adaptor_integration_api_dir)/x11/ecore-x-types.h \
$(adaptor_integration_api_dir)/x11/ecore-x-render-surface.h \
$(adaptor_integration_api_dir)/x11/pixmap-render-surface.h \
- $(adaptor_integration_api_dir)/x11/imf-manager-impl.h
+ $(adaptor_integration_api_dir)/x11/imf-manager-impl.h \
+ $(adaptor_integration_api_dir)/pixmap-render-surface-factory.h
--- /dev/null
+#ifndef __DALI_INTEGRATION_NATIVE_RENDER_SURFACE_FACTORY_H__
+#define __DALI_INTEGRATION_NATIVE_RENDER_SURFACE_FACTORY_H__
+
+/*
+ * Copyright (c) 2014 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 <string>
+#include <dali/public-api/object/any.h>
+#include <dali/public-api/common/dali-common.h>
+
+// INTERNAL INCLUDES
+
+namespace Dali
+{
+
+class NativeRenderSurface;
+
+/**
+ * Factory function for native surface
+ * A native surface is created.
+ *
+ * @param [in] positionSize the position and size of the surface to create
+ * @param [in] name Name of surface passed in
+ * @param [in] isTransparent Whether the surface has an alpha channel
+ */
+NativeRenderSurface* CreateNativeSurface( PositionSize positionSize,
+ const std::string& name,
+ bool isTransparent );
+
+} // namespace Dali
+
+#endif // __DALI_INTEGRATION_NATIVE_RENDER_SURFACE_FACTORY_H__
#include <dali/public-api/signals/callback.h>
// INTERNAL INCLUDES
+#ifdef DALI_ADAPTOR_COMPILATION
#include <trigger-event-interface.h>
+#else
+#include <dali/integration-api/adaptors/trigger-event-interface.h>
+#endif
namespace Dali
{
*/
// INTERNAL INCLUDES
-#include <trigger-event-factory-interface.h>
#include <dali/public-api/common/dali-common.h>
+#ifdef DALI_ADAPTOR_COMPILATION
+#include <trigger-event-factory-interface.h>
+#else
+#include <dali/integration-api/adaptors/trigger-event-factory-interface.h>
+#endif
namespace Dali
{
*/
virtual void ReleaseLock() = 0;
+ /**
+ * @copydoc Dali::RenderSurface::GetSurfaceType()
+ */
+ virtual RenderSurface::Type GetSurfaceType();
+
private:
/**
--- /dev/null
+#ifndef __DALI_NATIVE_RENDER_SURFACE_H__
+#define __DALI_NATIVE_RENDER_SURFACE_H__
+
+/*
+ * Copyright (c) 2014 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 <tbm_surface.h>
+#include <dali/public-api/common/dali-common.h>
+
+// INTERNAL INCLUDES
+#ifdef DALI_ADAPTOR_COMPILATION
+#include <render-surface.h>
+#include <egl-interface.h>
+#else
+#include <dali/devel-api/adaptor-framework/render-surface.h>
+#include <dali/integration-api/adaptors/egl-interface.h>
+#endif
+
+namespace Dali
+{
+
+class TriggerEventInterface;
+
+/**
+ * Ecore X11 implementation of render surface.
+ */
+class DALI_IMPORT_API NativeRenderSurface : public Dali::RenderSurface
+{
+public:
+
+ /**
+ * Uses an Wayland surface to render to.
+ * @param [in] positionSize the position and size of the surface
+ * @param [in] name optional name of surface passed in
+ * @param [in] isTransparent if it is true, surface has 32 bit color depth, otherwise, 24 bit
+ */
+ NativeRenderSurface( Dali::PositionSize positionSize,
+ const std::string& name,
+ bool isTransparent = false );
+
+ /**
+ * @copydoc Dali::RenderSurface::~RenderSurface
+ */
+ virtual ~NativeRenderSurface();
+
+public: // API
+
+ /**
+ * @brief Sets the render notification trigger to call when render thread is completed a frame
+ *
+ * @param renderNotification to use
+ */
+ void SetRenderNotification( TriggerEventInterface* renderNotification );
+
+ /**
+ * @brief Gets the tbm surface for offscreen rendering
+ */
+ virtual tbm_surface_h GetDrawable();
+
+ /**
+ * @brief Get the surface
+ *
+ * @return tbm surface
+ */
+ virtual Any GetSurface();
+
+ /**
+ * @brief Release the surface
+ */
+ virtual void ReleaseSurface();
+
+public: // from Dali::RenderSurface
+
+ /**
+ * @copydoc Dali::RenderSurface::GetPositionSize()
+ */
+ virtual PositionSize GetPositionSize() const;
+
+ /**
+ * @copydoc Dali::RenderSurface::InitializeEgl()
+ */
+ virtual void InitializeEgl( EglInterface& egl );
+
+ /**
+ * @copydoc Dali::RenderSurface::CreateEglSurface()
+ */
+ virtual void CreateEglSurface( EglInterface& egl );
+
+ /**
+ * @copydoc Dali::RenderSurface::DestroyEglSurface()
+ */
+ virtual void DestroyEglSurface( EglInterface& egl );
+
+ /**
+ * @copydoc Dali::RenderSurface::ReplaceEGLSurface()
+ */
+ virtual bool ReplaceEGLSurface( EglInterface& egl );
+
+ /**
+ * @copydoc Dali::RenderSurface::MoveResize()
+ */
+ virtual void MoveResize( Dali::PositionSize positionSize);
+
+ /**
+ * @copydoc Dali::RenderSurface::SetViewMode()
+ */
+ void SetViewMode( ViewMode viewMode );
+
+ /**
+ * @copydoc Dali::RenderSurface::StartRender()
+ */
+ virtual void StartRender();
+
+ /**
+ * @copydoc Dali::RenderSurface::PreRender()
+ */
+ virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction );
+
+ /**
+ * @copydoc Dali::RenderSurface::PostRender()
+ */
+ virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface );
+
+ /**
+ * @copydoc Dali::RenderSurface::StopRender()
+ */
+ virtual void StopRender();
+
+ /**
+ * @copydoc Dali::RenderSurface::SetThreadSynchronization
+ */
+ virtual void SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization );
+
+ /**
+ * @copydoc Dali::RenderSurface::GetSurfaceType()
+ */
+ virtual RenderSurface::Type GetSurfaceType();
+
+private:
+
+ /**
+ * Release any locks.
+ */
+ void ReleaseLock();
+
+ /**
+ * Create tbm surface
+ */
+ virtual void CreateNativeRenderable();
+
+private: // Data
+
+ struct Impl;
+
+ Impl* mImpl;
+
+};
+
+} // namespace Dali
+
+#endif // __DALI_NATIVE_RENDER_SURFACE_H__
*/
virtual void ReleaseLock() = 0;
+ /**
+ * @copydoc Dali::RenderSurface::GetSurfaceType()
+ */
+ virtual RenderSurface::Type GetSurfaceType();
+
private:
/**
*/
const std::string& GetSurroundingText() const;
+ /**
+ * @copydoc Dali::ImfManager::NotifyTextInputMultiLine()
+ */
+ void NotifyTextInputMultiLine( bool multiLine );
+
public: // Signals
/**
*/
virtual void SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization );
+ virtual RenderSurface::Type GetSurfaceType();
+
private:
/**
return "";
}
+std::string Framework::GetResourcePath()
+{
+ // TIZEN_PLATFORM_CONFIG_SUPPORTED not defined for libuv so path not available.
+ return "";
+}
+
void Framework::SetBundleId(const std::string& id)
{
}
# mobile profile internal files
adaptor_common_internal_mobile_profile_src_files = \
$(adaptor_mobile_dir)/accessibility-adaptor-impl-mobile.cpp \
- $(adaptor_mobile_dir)/pixmap-render-surface-factory.cpp \
$(adaptor_mobile_dir)/mobile-system-settings.cpp \
$(adaptor_mobile_dir)/mobile-color-controller-impl.cpp
+
+adaptor_common_internal_wayland_mobile_profile_src_files = \
+ $(adaptor_mobile_dir)/native-render-surface-factory.cpp
+
+adaptor_common_internal_x_mobile_profile_src_files = \
+ $(adaptor_mobile_dir)/pixmap-render-surface-factory.cpp
--- /dev/null
+/*
+ * Copyright (c) 2016 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 <native-render-surface.h>
+
+namespace Dali
+{
+
+DALI_EXPORT_API NativeRenderSurface* CreateNativeSurface(
+ PositionSize positionSize,
+ const std::string& name,
+ bool isTransparent)
+{
+ return new NativeRenderSurface( positionSize, name, isTransparent );
+}
+
+} // namespace Dali
Internal::Adaptor::GetImplementation(*this).ReplaceWindow(windowPosition, name);
}
+std::string Application::GetResourcePath()
+{
+ return Internal::Adaptor::Application::GetResourcePath();
+}
+
void Application::SetViewMode( ViewMode viewMode )
{
Internal::Adaptor::GetImplementation(*this).SetViewMode( viewMode );
/**
* @brief This is the constructor for applications without an argument list.
* @SINCE_1_0.0
+ * @PRIVLEVEL_PUBLIC
+ * @PRIVILEGE_DISPLAY
*/
static Application New();
* @brief This is the constructor for applications.
*
* @SINCE_1_0.0
+ * @PRIVLEVEL_PUBLIC
+ * @PRIVILEGE_DISPLAY
* @param[in,out] argc A pointer to the number of arguments
* @param[in,out] argv A pointer the the argument list
*/
* @brief This is the constructor for applications with a name
*
* @SINCE_1_0.0
+ * @PRIVLEVEL_PUBLIC
+ * @PRIVILEGE_DISPLAY
* @param[in,out] argc A pointer to the number of arguments
* @param[in,out] argv A pointer the the argument list
* @param[in] stylesheet The path to user defined theme file
+ * @note If the stylesheet is not specified, then the library's default stylesheet will not be overridden.
*/
static Application New( int* argc, char **argv[], const std::string& stylesheet );
* @brief This is the constructor for applications with a name
*
* @SINCE_1_0.0
+ * @PRIVLEVEL_PUBLIC
+ * @PRIVILEGE_DISPLAY
* @param[in,out] argc A pointer to the number of arguments
* @param[in,out] argv A pointer the the argument list
* @param[in] stylesheet The path to user defined theme file
* @param[in] windowMode A member of WINDOW_MODE
+ * @note If the stylesheet is not specified, then the library's default stylesheet will not be overridden.
*/
static Application New( int* argc, char **argv[], const std::string& stylesheet, WINDOW_MODE windowMode );
*/
void ReplaceWindow(PositionSize windowPosition, const std::string& name);
+ /**
+ * @brief Get path application resources are stored at
+ *
+ * @SINCE_1_2.2
+ * @return the full path of the resources
+ */
+ static std::string GetResourcePath();
+
+
public: // Stereoscopy
/**
/**
* @brief Set the stereo base (eye separation) for Stereoscopic 3D
*
+ * The stereo base is the distance in millimetres between the eyes. Typical values are
+ * between 50mm and 70mm. The default value is 65mm.
* @SINCE_1_0.0
* @param[in] stereoBase The stereo base (eye separation) for Stereoscopic 3D
*/
AppSignalType& MemoryLowSignal();
public: // Not intended for application developers
+ /// @cond internal
/**
* @brief Internal constructor
* @SINCE_1_0.0
*/
explicit DALI_INTERNAL Application(Internal::Adaptor::Application* application);
+ /// @endcond
};
/**
*
* NativeImageSource can be created internally or
* externally by native image source.
+ * NativeImage is a platform specific way of providing pixel data to the GPU for rendering,
+ * for example via an EGL image.
*
* @SINCE_1_1.4
+ * @see NativeImage
*/
class DALI_IMPORT_API NativeImageSource : public NativeImageInterface
{
* @SINCE_1_0.0
* @param[in] nativeImageSource must be a any handle with native image source
* @return A smart-pointer to a newly allocated image.
+ * @see NativeImageInterface
*/
static NativeImageSourcePtr New( Any nativeImageSource );
private:
+ /// @cond internal
/**
* @brief Private constructor
* @SINCE_1_0.0
* @param[in] rhs A reference to the object to copy.
*/
DALI_INTERNAL NativeImageSource& operator=(const NativeImageSource& rhs);
+ /// @endcond
private:
+ /// @cond internal
Internal::Adaptor::NativeImageSource* mImpl; ///< Implementation pointer
+ /// @endcond
};
/**
enum Mode
{
DEFAULT = 0, ///< Default mode for normal application @SINCE_1_0.0
- NOTIFICATION, ///< Notification mode @SINCE_1_0.0
- SCREEN_READER, ///< Screen reader mode @SINCE_1_0.0
+ NOTIFICATION, ///< Notification mode, such as playing utterance is started or completed @SINCE_1_0.0
+ SCREEN_READER, ///< Screen reader mode. To help visually impaired users interact with their devices, screen reader reads text or graphic elements on the screen using the TTS engine. @SINCE_1_0.0
MODE_NUM
};
public: // Not intended for application developers
+ /// @cond internal
/**
* @brief This constructor is used by TtsPlayer::Get().
* @SINCE_1_0.0
* @param[in] ttsPlayer A pointer to the TTS player.
*/
explicit DALI_INTERNAL TtsPlayer( Internal::Adaptor::TtsPlayer* ttsPlayer );
+ /// @endcond
};
/**
// Enumerations
/**
- * @brief Orientation of the window.
+ * @brief Orientation of the window is the way in which a rectangular page is oriented for normal viewing.
* @SINCE_1_0.0
*/
enum WindowOrientation
{
- PORTRAIT = 0, ///< Portrait orientation @SINCE_1_0.0
- LANDSCAPE = 90, ///< Landscape orientation @SINCE_1_0.0
+ PORTRAIT = 0, ///< Portrait orientation. The height of the display area is greater than the width. @SINCE_1_0.0
+ LANDSCAPE = 90, ///< Landscape orientation. A wide view area is needed. @SINCE_1_0.0
PORTRAIT_INVERSE = 180, ///< Portrait inverse orientation @SINCE_1_0.0
LANDSCAPE_INVERSE = 270 ///< Landscape inverse orientation @SINCE_1_0.0
};
/**
* @brief Returns the Drag & drop detector which can be used to receive drag & drop events.
+ * @note Not intended for application developers.
* @SINCE_1_0.0
* @return A handle to the DragAndDropDetector.
*/
/**
* @brief Get the native handle of the window.
+ *
+ * When users call this function, it wraps the actual type used by the underlying window system.
* @SINCE_1_0.0
* @return The native handle of the window or an empty handle.
*/
IndicatorSignalType& IndicatorVisibilityChangedSignal();
public: // Not intended for application developers
+ /// @cond internal
/**
* @brief This constructor is used by Dali::Application::GetWindow().
* @SINCE_1_0.0
* @param[in] window A pointer to the window.
*/
explicit DALI_INTERNAL Window( Internal::Adaptor::Window* window );
+ /// @endcond
};
/**
{
const unsigned int ADAPTOR_MAJOR_VERSION = 1;
-const unsigned int ADAPTOR_MINOR_VERSION = 1;
-const unsigned int ADAPTOR_MICRO_VERSION = 45;
+const unsigned int ADAPTOR_MINOR_VERSION = 2;
+const unsigned int ADAPTOR_MICRO_VERSION = 5;
const char * const ADAPTOR_BUILD_DATE = __DATE__ " " __TIME__;
#ifdef DEBUG_ENABLED
--- /dev/null
+/*
+ * Copyright (c) 2016 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 <display-connection-impl.h>
+
+// EXTERNAL_HEADERS
+#include <tbm_bufmgr.h>
+#include <dali/integration-api/debug.h>
+
+// INTERNAL HEADERS
+#include <native-render-surface.h>
+#include <gl/egl-implementation.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+EGLNativeDisplayType DisplayConnection::GetNativeDisplay()
+{
+ return (EGLNativeDisplayType)tbm_bufmgr_init( -1 );
+}
+
+void DisplayConnection::ReleaseNativeDisplay()
+{
+ if( mDisplay )
+ {
+ tbm_bufmgr_deinit( (tbm_bufmgr)mDisplay );
+ }
+}
+
+} // namespace Adaptor
+
+} // namespace Internal
+
+} // namespace Dali
$(adaptor_tizen_dir)/gl/egl-image-extensions-tizen.cpp
adaptor_tizen_internal_native_image_src_files = \
+ $(adaptor_tizen_dir)/display-connection-impl-tizen.cpp \
+ $(adaptor_tizen_dir)/native-render-surface-tizen.cpp \
$(adaptor_tizen_dir)/native-image-source-impl-tizen.cpp
public_api_adaptor_tizen_header_files = \
#include <appcore-watch/watch_app.h>
#endif
+#if defined( TIZEN_PLATFORM_CONFIG_SUPPORTED ) && TIZEN_PLATFORM_CONFIG_SUPPORTED
+#include <tzplatform_config.h>
+#endif // TIZEN_PLATFORM_CONFIG_SUPPORTED
+
#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
if( featureFlag == false )
{
set_last_result( TIZEN_ERROR_NOT_SUPPORTED );
- throw Dali::DaliException( "", "OpenGL ES 2.0 is not supported." );
}
InitThreads();
return mBundleId;
}
+std::string Framework::GetResourcePath()
+{
+ std::string resourcePath = "";
+#if defined( TIZEN_PLATFORM_CONFIG_SUPPORTED ) && TIZEN_PLATFORM_CONFIG_SUPPORTED
+ resourcePath = app_get_resource_path();
+#endif //TIZEN_PLATFORM_CONFIG_SUPPORTED
+
+ return resourcePath;
+}
+
void Framework::SetBundleId(const std::string& id)
{
mBundleId = id;
--- /dev/null
+/*
+ * Copyright (c) 2016 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 <native-render-surface.h>
+
+// EXTERNAL INCLUDES
+#include <dali/integration-api/gl-abstraction.h>
+#include <dali/integration-api/debug.h>
+#include <dali/devel-api/threading/conditional-wait.h>
+
+#include <Ecore_Wayland.h>
+#include <tbm_bufmgr.h>
+#include <tbm_surface_queue.h>
+
+// INTERNAL INCLUDES
+#include <trigger-event.h>
+#include <gl/egl-implementation.h>
+#include <base/display-connection.h>
+#include <integration-api/thread-synchronization-interface.h>
+
+namespace Dali
+{
+
+#if defined(DEBUG_ENABLED)
+extern Debug::Filter* gRenderSurfaceLogFilter;
+#endif
+
+struct NativeRenderSurface::Impl
+{
+ Impl( Dali::PositionSize positionSize, const std::string& name, bool isTransparent )
+ : mPosition( positionSize ),
+ mTitle( name ),
+ mRenderNotification( NULL ),
+ mColorDepth( isTransparent ? COLOR_DEPTH_32 : COLOR_DEPTH_24 ),
+ mTbmFormat( isTransparent ? TBM_FORMAT_ARGB8888 : TBM_FORMAT_RGB888 ),
+ mOwnSurface( false ),
+ mConsumeSurface( NULL ),
+ mThreadSynchronization( NULL )
+ {
+ }
+
+ PositionSize mPosition;
+ std::string mTitle;
+ TriggerEventInterface* mRenderNotification;
+ ColorDepth mColorDepth;
+ tbm_format mTbmFormat;
+ bool mOwnSurface;
+
+ tbm_surface_queue_h mTbmQueue;
+ tbm_surface_h mConsumeSurface;
+ ThreadSynchronizationInterface* mThreadSynchronization; ///< A pointer to the thread-synchronization
+ ConditionalWait mTbmSurfaceCondition;
+};
+
+NativeRenderSurface::NativeRenderSurface(Dali::PositionSize positionSize,
+ const std::string& name,
+ bool isTransparent)
+: mImpl( new Impl( positionSize, name, isTransparent ) )
+{
+ ecore_wl_init(NULL);
+ CreateNativeRenderable();
+}
+
+NativeRenderSurface::~NativeRenderSurface()
+{
+ // release the surface if we own one
+ if( mImpl->mOwnSurface )
+ {
+
+ if( mImpl->mConsumeSurface )
+ {
+ tbm_surface_queue_release( mImpl->mTbmQueue, mImpl->mConsumeSurface );
+ mImpl->mConsumeSurface = NULL;
+ }
+
+ if( mImpl->mTbmQueue )
+ {
+ tbm_surface_queue_destroy( mImpl->mTbmQueue );
+ }
+
+ delete mImpl;
+
+ DALI_LOG_INFO( gRenderSurfaceLogFilter, Debug::General, "Own tbm surface queue destroy\n" );
+ }
+}
+
+void NativeRenderSurface::SetRenderNotification( TriggerEventInterface* renderNotification )
+{
+ mImpl->mRenderNotification = renderNotification;
+}
+
+tbm_surface_h NativeRenderSurface::GetDrawable()
+{
+ ConditionalWait::ScopedLock lock( mImpl->mTbmSurfaceCondition );
+
+ return mImpl->mConsumeSurface;
+}
+
+Any NativeRenderSurface::GetSurface()
+{
+ return Any( NULL );
+}
+
+void NativeRenderSurface::InitializeEgl( EglInterface& egl )
+{
+ DALI_LOG_TRACE_METHOD( gRenderSurfaceLogFilter );
+
+ Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
+
+ eglImpl.ChooseConfig( true, mImpl->mColorDepth );
+}
+
+void NativeRenderSurface::CreateEglSurface( EglInterface& egl )
+{
+ DALI_LOG_TRACE_METHOD( gRenderSurfaceLogFilter );
+
+ Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
+
+ eglImpl.CreateSurfaceWindow( (EGLNativeWindowType)mImpl->mTbmQueue, mImpl->mColorDepth );
+}
+
+void NativeRenderSurface::DestroyEglSurface( EglInterface& egl )
+{
+ DALI_LOG_TRACE_METHOD( gRenderSurfaceLogFilter );
+
+ Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
+ eglImpl.DestroySurface();
+}
+
+bool NativeRenderSurface::ReplaceEGLSurface( EglInterface& egl )
+{
+ DALI_LOG_TRACE_METHOD( gRenderSurfaceLogFilter );
+
+ if( mImpl->mConsumeSurface )
+ {
+ tbm_surface_queue_release( mImpl->mTbmQueue, mImpl->mConsumeSurface );
+ mImpl->mConsumeSurface = NULL;
+ }
+
+ if( mImpl->mTbmQueue )
+ {
+ tbm_surface_queue_destroy( mImpl->mTbmQueue );
+ }
+
+ CreateNativeRenderable();
+
+ if( !mImpl->mTbmQueue )
+ {
+ return false;
+ }
+
+ Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
+
+ return eglImpl.ReplaceSurfaceWindow( (EGLNativeWindowType)mImpl->mTbmQueue ); // reinterpret_cast does not compile
+}
+
+void NativeRenderSurface::StartRender()
+{
+}
+
+bool NativeRenderSurface::PreRender( EglInterface&, Integration::GlAbstraction& )
+{
+ // nothing to do for pixmaps
+ return true;
+}
+
+void NativeRenderSurface::PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface )
+{
+ Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
+ eglImpl.SwapBuffers();
+
+ // flush gl instruction queue
+ glAbstraction.Flush();
+
+ {
+ if( tbm_surface_queue_can_acquire( mImpl->mTbmQueue, 1 ) )
+ {
+ if( tbm_surface_queue_acquire( mImpl->mTbmQueue, &mImpl->mConsumeSurface ) != TBM_SURFACE_QUEUE_ERROR_NONE )
+ {
+ DALI_LOG_ERROR( "Failed aquire consume tbm_surface\n" );
+ return;
+ }
+ }
+ }
+
+ // create damage for client applications which wish to know the update timing
+ if( mImpl->mRenderNotification )
+ {
+ // use notification trigger
+ // Tell the event-thread to render the pixmap
+ mImpl->mRenderNotification->Trigger();
+ }
+ else
+ {
+ // FIXME
+ }
+
+}
+
+void NativeRenderSurface::StopRender()
+{
+ ReleaseLock();
+}
+
+PositionSize NativeRenderSurface::GetPositionSize() const
+{
+ return mImpl->mPosition;
+}
+
+void NativeRenderSurface::MoveResize( Dali::PositionSize positionSize )
+{
+}
+
+void NativeRenderSurface::SetViewMode( ViewMode viewMode )
+{
+}
+
+void NativeRenderSurface::SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization )
+{
+ mImpl->mThreadSynchronization = &threadSynchronization;
+}
+
+RenderSurface::Type NativeRenderSurface::GetSurfaceType()
+{
+ return RenderSurface::NATIVE_RENDER_SURFACE;
+}
+
+void NativeRenderSurface::CreateNativeRenderable()
+{
+ // check we're creating one with a valid size
+ DALI_ASSERT_ALWAYS( mImpl->mPosition.width > 0 && mImpl->mPosition.height > 0 && "Pixmap size is invalid" );
+
+ mImpl->mTbmQueue = tbm_surface_queue_create( 3, mImpl->mPosition.width, mImpl->mPosition.height, mImpl->mTbmFormat, TBM_BO_DEFAULT );
+
+ if( mImpl->mTbmQueue )
+ {
+ mImpl->mOwnSurface = true;
+ }
+ else
+ {
+ mImpl->mOwnSurface = false;
+ }
+}
+
+void NativeRenderSurface::ReleaseSurface()
+{
+ if( mImpl->mConsumeSurface )
+ {
+ tbm_surface_queue_release( mImpl->mTbmQueue, mImpl->mConsumeSurface );
+ mImpl->mConsumeSurface = NULL;
+ }
+}
+
+void NativeRenderSurface::ReleaseLock()
+{
+ if( mImpl->mThreadSynchronization )
+ {
+ mImpl->mThreadSynchronization->PostRenderComplete();
+ }
+}
+
+} // namespace Dali
return mBundleId;
}
+std::string Framework::GetResourcePath()
+{
+ // "DALI_APPLICATION_PACKAGE" is used by Ubuntu specifically to get the already configured Application package path.
+ const char* ubuntuEnvironmentVariable = "DALI_APPLICATION_PACKAGE";
+ char* value = getenv( ubuntuEnvironmentVariable );
+ std::string resourcePath;
+ if ( value != NULL )
+ {
+ resourcePath = value;
+ }
+
+ return resourcePath;
+}
+
void Framework::SetBundleId(const std::string& id)
{
mBundleId = id;
}
/*
- * Get string at given index of clipboard
+ * Request clipboard service to retrieve an item
*/
-std::string Clipboard::GetItem( unsigned int index ) // change string to a Dali::Text object.
+void Clipboard::RequestItem()
{
- return "not supported";
}
/*
{
}
-void Clipboard::HideClipboard()
+void Clipboard::HideClipboard(bool skipFirstHide)
{
}
+bool Clipboard::IsVisible() const
+{
+ return false;
+}
+
+char* Clipboard::ExcuteBuffered( bool type, void *event )
+{
+ return NULL;
+}
} // namespace Adaptor
return true;
}
+void DisplayConnection::SetSurfaceType( RenderSurface::Type type )
+{
+}
+
void DisplayConnection::GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVertical)
{
CompositorOutput::GetDpi( dpiHorizontal, dpiVertical);
*/
bool InitializeEgl(EglInterface& egl);
+ void SetSurfaceType( RenderSurface::Type type );
+
public:
/**
protected:
+ EGLNativeDisplayType GetNativeDisplay();
+
+ void ReleaseNativeDisplay();
+
// Undefined
DisplayConnection(const DisplayConnection&);
return mSurroundingText;
}
+void ImfManager::NotifyTextInputMultiLine( bool multiLine )
+{
+}
+
} // Adaptor
} // Internal
*/
const std::string& GetSurroundingText() const;
+ /**
+ * @copydoc Dali::ImfManager::NotifyTextInputMultiLine()
+ */
+ void NotifyTextInputMultiLine( bool multiLine );
+
public: // Signals
/**
{
}
-
+RenderSurface::Type RenderSurface::GetSurfaceType()
+{
+ return RenderSurface::WAYLAND_RENDER_SURFACE;
+}
} // namespace Wayland
*/
virtual void SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization );
+ /**
+ * @copydoc Dali::RenderSurface::GetSurfaceType()
+ */
+ virtual RenderSurface::Type GetSurfaceType();
+
protected: // Data
Window mWindow;
WatchTimeSignal& TimeTickSignal();
/**
- * @brief This signal is emitted at every second in ambient mode
+ * @brief This signal is emitted at each minute in ambient mode
* A callback of the following type may be connected:
* @code
* void YourCallbackName(Application& application, WatchTimeSignal &time);
* @endcode
* time(watch time handle) will not be available after returning this callback. It will be freed by the framework.
* @SINCE_1_1.37
+ * @remarks http://tizen.org/privilege/alarm.set privilege is needed to receive ambient ticks at each minute.
+ * The AmbientTickSignal() will be ignored if your app doesn't have the privilege
*/
WatchTimeSignal& AmbientTickSignal();
WatchBoolSignal& AmbientChangedSignal();
public: // Not intended for application developers
+ /// @cond internal
/**
* @brief Internal constructor
* @SINCE_1_1.37
*/
explicit DALI_INTERNAL WatchApplication(Internal::Adaptor::WatchApplication* implementation);
+ /// @endcond
};
/**
void *mTimeHandle;
};
-WatchTime::WatchTime()
- :mImpl(NULL)
-{
-}
-
WatchTime::WatchTime(void *time_handle)
{
mImpl = new Impl(time_handle);
#ifdef APPCORE_WATCH_AVAILABLE
+WatchTime::WatchTime()
+{
+ watch_time_h watch_time = {0,};
+
+ watch_time_get_current_time(&watch_time);
+ mImpl = new Impl(watch_time);
+}
+
int WatchTime::GetHour() const
{
int hour;
#else
+WatchTime::WatchTime()
+ :mImpl(NULL)
+{
+}
+
int WatchTime::GetHour() const
{
return 0;
return 0;
}
-#endif
+#endif // APPCORE_WATCH_AVAILABLE
} // namespace Dali
#include <adaptor-impl.h>
#include <ecore-x-window-interface.h>
#include <singleton-service-impl.h>
+#include <clipboard-event-notifier-impl.h>
namespace //unnamed namespace
{
}
/*
- * Get string at given index of clipboard
+ * Request clipboard service to retrieve an item
*/
-std::string Clipboard::GetItem( unsigned int index ) // change string to a Dali::Text object.
+void Clipboard::RequestItem()
{
- if ( index >= NumberOfItems() )
- {
- return "";
- }
-
+ int index = 0;
char sendBuf[20];
snprintf( sendBuf, 20, "%s%d", CBHM_ITEM, index );
Ecore_X_Atom xAtomCbhmItem = ecore_x_atom_get( sendBuf );
Ecore_X_Atom xAtomCbhmError = ecore_x_atom_get( CBHM_ERROR );
if ( xAtomItemType != xAtomCbhmError )
{
- return clipboardString;
+ // Call ClipboardEventNotifier to notify event observe of retrieved string
+ Dali::ClipboardEventNotifier clipboardEventNotifier(ClipboardEventNotifier::Get());
+ if ( clipboardEventNotifier )
+ {
+ ClipboardEventNotifier& notifierImpl( ClipboardEventNotifier::GetImplementation( clipboardEventNotifier ) );
+
+ notifierImpl.SetContent( clipboardString );
+ notifierImpl.EmitContentSelectedSignal();
+ }
}
}
- return "";
}
/*
ECore::WindowInterface::SendXEvent( ecore_x_display_get(), cbhmWin, False, NoEventMask, atomCbhmMsg, 8, SHOW );
}
-void Clipboard::HideClipboard()
+void Clipboard::HideClipboard(bool skipFirstHide)
{
Ecore_X_Window cbhmWin = ECore::WindowInterface::GetWindow();
// Launch the clipboard window
ecore_x_selection_secondary_clear();
}
+bool Clipboard::IsVisible() const
+{
+ return false;
+}
+
+char* Clipboard::ExcuteBuffered( bool type, void *event )
+{
+ return NULL;
+}
} // namespace Adaptor
DisplayConnection::DisplayConnection()
: mDisplay(NULL)
{
- // Because of DDK issue, we need to use separated x display instead of ecore default display
- mDisplay = XOpenDisplay(0);
}
DisplayConnection::~DisplayConnection()
return true;
}
+void DisplayConnection::SetSurfaceType( RenderSurface::Type type )
+{
+ if( type == RenderSurface::ECORE_RENDER_SURFACE )
+ {
+ // Because of DDK issue, we need to use separated x display instead of ecore default display
+ mDisplay = XOpenDisplay(0);
+ }
+}
+
void DisplayConnection::GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVertical)
{
// calculate DPI
*/
bool InitializeEgl(EglInterface& egl);
+ void SetSurfaceType( RenderSurface::Type type );
+
public:
/**
return surfaceId;
}
+RenderSurface::Type EcoreXRenderSurface::GetSurfaceType()
+{
+ return RenderSurface::ECORE_RENDER_SURFACE;
+}
+
} // namespace ECore
} // namespace Dali
return mSurroundingText;
}
+void ImfManager::NotifyTextInputMultiLine( bool multiLine )
+{
+}
+
} // Adaptor
} // Internal
}
}
+RenderSurface::Type PixmapRenderSurface::GetSurfaceType()
+{
+ return RenderSurface::ECORE_RENDER_SURFACE;
+}
+
} // namespace ECore
} // namespace Dali
our $debug=0;
our $pd_debug=0;
our $opt_cached;
-our $opt_head;
-#our $opt_workingtree;
-#our $opt_diff=1;
our $opt_help;
-our $opt_verbose;
+our $opt_output;
our $opt_quiet;
+our $opt_verbose;
my %options = (
"cached" => { "optvar"=>\$opt_cached, "desc"=>"Use index" },
- "head" => { "optvar"=>\$opt_head, "desc"=>"Use git show" },
+ "output:s" => { "optvar"=>\$opt_output, "desc"=>"Generate html output"},
"help" => { "optvar"=>\$opt_help, "desc"=>""},
"quiet" => { "optvar"=>\$opt_quiet, "desc"=>""},
"verbose" => { "optvar"=>\$opt_verbose, "desc"=>"" });
# output for the patch.
sub run_diff
{
+ #print "run_diff(" . join(" ", @_) . ")\n";
my ($fh, $c) = $repo->command_output_pipe(@_);
our @patch=();
while(<$fh>)
}
$repo->command_close_pipe($fh, $c);
+ print "Patch size: " . scalar(@patch) . "\n" if $debug;
+
# @patch has slurped diff for all files...
my $filesref = parse_diff ( \@patch );
show_patch_lines($filesref) if $debug;
for my $file (keys(%$filesref))
{
my ($name, $path, $suffix) = fileparse($file, qr{\.[^.]*$});
+ next if($path !~ /^dali/);
if($suffix eq ".cpp" || $suffix eq ".c" || $suffix eq ".h")
{
get_coverage($file, $filesref);
return $filesref;
}
-
sub calc_patch_coverage_percentage
{
my $filesref = shift;
foreach my $file (keys(%$filesref))
{
+ my ($name, $path, $suffix) = fileparse($file, qr{\.[^.]*$});
+ next if($path !~ /^dali/);
+
my $covered_lines = 0;
my $uncovered_lines = 0;
my $percent = 0;
if($total_exec > 0) { $percent = 100 * $total_covered_lines / $total_exec; }
- return $percent;
+ return [ $total_exec, $percent ];
}
sub patch_output
}
+sub patch_html_output
+{
+ my $filesref = shift;
+
+ open( my $filehandle, ">", $opt_output ) || die "Can't open $opt_output for writing:$!\n";
+
+ my $OUTPUT_FH = select;
+ select $filehandle;
+ print <<EOH;
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
+"http://www.w3.org/TR/REC-html40/loose.dtd">
+<html>
+<head>
+<title>Patch Coverage</title>
+</head>
+<body bgcolor="white">
+EOH
+
+ foreach my $file (keys(%$filesref))
+ {
+ my ($name, $path, $suffix) = fileparse($file, qr{\.[^.]*$});
+ next if($path !~ /^dali/);
+
+ my $patchref = $filesref->{$file}->{"patch"};
+ my $b_lines_ref = $filesref->{$file}->{"b_lines"};
+ my $coverage_ref = $filesref->{$file}->{"coverage"};
+ print "<h2>$file</h2>\n";
+
+ if($coverage_ref)
+ {
+ if( $coverage_ref->{"covered_lines"} > 0
+ ||
+ $coverage_ref->{"uncovered_lines"} > 0 )
+ {
+ print "<p style=\"color:green;\">Covered: " .
+ $coverage_ref->{"covered_lines"} . "<p>" .
+ "<p style=\"color:red;\">Uncovered: " .
+ $coverage_ref->{"uncovered_lines"} . "</span></p>";
+ }
+ }
+ else
+ {
+ print "<p>";
+ my $span=0;
+ if($suffix eq ".cpp" || $suffix eq ".c" || $suffix eq ".h")
+ {
+ print "<span style=\"color:red;\">";
+ $span=1;
+ }
+ print "No coverage found";
+ print "</span>" if $span;
+ }
+ print "</p>";
+
+ for my $patch (@$patchref)
+ {
+ my $hunkstr="Hunk: " . $patch->[0];
+ if( $patch->[1] > 1 )
+ {
+ $hunkstr .= " - " . ($patch->[0]+$patch->[1]-1);
+ }
+ print "<p style=\"font-weight:bold;\">" . $hunkstr . "</p>";
+
+ print "<pre>";
+ for(my $i = 0; $i < $patch->[1]; $i++ )
+ {
+ my $line = $i + $patch->[0];
+ my $num_line_digits=log($line)/log(10);
+ for $i (0..(6-$num_line_digits-1))
+ {
+ print " ";
+ }
+ print "$line ";
+
+ if($coverage_ref)
+ {
+ my $color;
+ if($coverage_ref->{"covered"}->{$line})
+ {
+ print("<span style=\"color:green;\">");
+ }
+ elsif($coverage_ref->{"uncovered"}->{$line})
+ {
+ print("<span style=\"color:red;font-weight:bold;\">");
+ }
+ else
+ {
+ #print("<span style=\"color:black;font-weight:normal;\">");
+ }
+ my $src=$coverage_ref->{"src"}->{$line};
+ chomp($src);
+ #print $color, "$src\n", RESET;
+ print "$src</span>\n";
+ }
+ else
+ {
+ # We don't have coverage data, so print it from the patch instead.
+ my $src = $b_lines_ref->{$line};
+ print "$src\n";
+ }
+ }
+ print "<\pre>\n";
+ }
+ }
+
+ print $filehandle "<hr>\n</body>\n</html>\n";
+ close $filehandle;
+ select $OUTPUT_FH;
+}
+
+
################################################################################
## MAIN ##
################################################################################
my @cmd=('--no-pager','diff','--no-ext-diff','-U0','--no-color');
my $status = $repo->command("status", "-s");
-if( $status eq "" )
+if( $status eq "" && !scalar(@ARGV))
{
- # There are no changes in the index or working tree. Use the last patch instead
+ # There are no changes in the index or working tree, and
+ # no diff arguments to append. Use the last patch instead.
push @cmd, ('HEAD~1','HEAD');
}
-elsif($opt_cached) # TODO: Remove this option. Instead, need full diff
+else
{
- push @cmd, "--cached";
+ # detect if there are only cached changes or only working tree changes
+ my $cached = 0;
+ my $working = 0;
+ for my $fstat ( split(/\n/, $status) )
+ {
+ if(substr( $fstat, 0, 1 ) ne " "){ $cached++; }
+ if(substr( $fstat, 1, 1 ) ne " "){ $working++; }
+ }
+ if($cached > 0 )
+ {
+ if($working == 0)
+ {
+ push @cmd, "--cached";
+ }
+ else
+ {
+ die "Both cached & working files - cannot get correct patch from git\n";
+ # Would have to diff from separate clone.
+ }
+ }
}
push @cmd, @ARGV;
my $filesref = run_diff(@cmd);
-my $percent = calc_patch_coverage_percentage($filesref);
-if( ! $opt_quiet )
+chdir $cwd;
+
+# Check how many actual source files there are in the patch
+my $filecount = 0;
+foreach my $file (keys(%$filesref))
+{
+ my ($name, $path, $suffix) = fileparse($file, qr{\.[^.]*$});
+ next if($path !~ /^dali/);
+ next if($suffix ne ".cpp" && $suffix ne ".c" && $suffix ne ".h");
+ $filecount++;
+}
+if( $filecount == 0 )
+{
+ print "No source files found\n";
+ exit 0; # Exit with no error.
+}
+
+my $percentref = calc_patch_coverage_percentage($filesref);
+if($percentref->[0] == 0)
+{
+ print "No coverable lines found\n";
+ exit 0;
+}
+my $percent = $percentref->[1];
+
+my $color=BOLD RED;
+if($opt_output)
+{
+ print "Outputing to $opt_output\n" if $debug;
+ patch_html_output($filesref);
+}
+elsif( ! $opt_quiet )
{
patch_output($filesref);
- my $color=BOLD RED;
if($percent>=90)
{
$color=GREEN;
}
- printf("Percentage of change covered: $color %5.2f%\n" . RESET, $percent);
+ print RESET;
}
+
+printf("Percentage of change covered: %5.2f%\n", $percent);
+
exit($percent<90);
int UtcDaliFontClient(void)
{
- const int ORDERED_VALUES[] = { 50, 63, 75, 87, 100, 113, 125, 150, 200 };
+ const int ORDERED_VALUES[] = { -1, 50, 63, 75, 87, 100, 113, 125, 150, 200 };
const unsigned int NUM_OF_ORDERED_VALUES = sizeof( ORDERED_VALUES ) / sizeof( int );
TestApplication application;
- int preciseIndex = 0;
int result=0;
- tet_infoline("UtcDaliFontClient center range");
- preciseIndex = 4;
- result = TextAbstraction::Internal::ValueToIndex( ORDERED_VALUES[preciseIndex], ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
- DALI_TEST_EQUALS( preciseIndex, result, TEST_LOCATION );
+ tet_infoline("UtcDaliFontClient No table");
+ result = TextAbstraction::Internal::ValueToIndex( 100, NULL, 0u );
+ DALI_TEST_EQUALS( -1, result, TEST_LOCATION );
- tet_infoline("UtcDaliFontClient start of range");
- preciseIndex = 0;
- result = TextAbstraction::Internal::ValueToIndex( ORDERED_VALUES[preciseIndex], ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
- DALI_TEST_EQUALS( preciseIndex, result, TEST_LOCATION );
-
- tet_infoline("UtcDaliFontClient end of range");
- preciseIndex = 8;
- result = TextAbstraction::Internal::ValueToIndex( ORDERED_VALUES[preciseIndex], ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
- DALI_TEST_EQUALS( preciseIndex, result, TEST_LOCATION );
+ tet_infoline("UtcDaliFontClient Non defined values");
+ result = TextAbstraction::Internal::ValueToIndex( -1, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
+ DALI_TEST_EQUALS( 0, result, TEST_LOCATION );
+ result = TextAbstraction::Internal::ValueToIndex( -3, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
+ DALI_TEST_EQUALS( 0, result, TEST_LOCATION );
- tet_infoline("UtcDaliFontClient below of range");
+ tet_infoline("UtcDaliFontClient Between non defined and first of range.");
+ result = TextAbstraction::Internal::ValueToIndex( 0, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
+ DALI_TEST_EQUALS( 1, result, TEST_LOCATION );
result = TextAbstraction::Internal::ValueToIndex( 30, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
- DALI_TEST_EQUALS( 0, result, TEST_LOCATION );
+ DALI_TEST_EQUALS( 1, result, TEST_LOCATION );
+ result = TextAbstraction::Internal::ValueToIndex( 49, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
+ DALI_TEST_EQUALS( 1, result, TEST_LOCATION );
- tet_infoline("UtcDaliFontClient below of range");
- result = TextAbstraction::Internal::ValueToIndex( 220, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
+ tet_infoline("UtcDaliFontClient Defined in range");
+ for( unsigned int index = 1u; index < NUM_OF_ORDERED_VALUES; ++index )
+ {
+ result = TextAbstraction::Internal::ValueToIndex( ORDERED_VALUES[index], ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
+ DALI_TEST_EQUALS( index, result, TEST_LOCATION );
+ }
+
+ tet_infoline("UtcDaliFontClient Non defined in range");
+ result = TextAbstraction::Internal::ValueToIndex( 51, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
+ DALI_TEST_EQUALS( 1, result, TEST_LOCATION );
+ result = TextAbstraction::Internal::ValueToIndex( 55, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
+ DALI_TEST_EQUALS( 1, result, TEST_LOCATION );
+ result = TextAbstraction::Internal::ValueToIndex( 62, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
+ DALI_TEST_EQUALS( 2, result, TEST_LOCATION );
+ result = TextAbstraction::Internal::ValueToIndex( 64, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
+ DALI_TEST_EQUALS( 2, result, TEST_LOCATION );
+ result = TextAbstraction::Internal::ValueToIndex( 151, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
DALI_TEST_EQUALS( 8, result, TEST_LOCATION );
+ result = TextAbstraction::Internal::ValueToIndex( 175, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
+ DALI_TEST_EQUALS( 9, result, TEST_LOCATION );
+ result = TextAbstraction::Internal::ValueToIndex( 176, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
+ DALI_TEST_EQUALS( 9, result, TEST_LOCATION );
+ result = TextAbstraction::Internal::ValueToIndex( 199, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
+ DALI_TEST_EQUALS( 9, result, TEST_LOCATION );
- tet_infoline("UtcDaliFontClient zero ");
- result = TextAbstraction::Internal::ValueToIndex( 0, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
- DALI_TEST_EQUALS( 0, result, TEST_LOCATION );
+ tet_infoline("UtcDaliFontClient above of range");
+ result = TextAbstraction::Internal::ValueToIndex( 220, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
+ DALI_TEST_EQUALS( 9, result, TEST_LOCATION );
+ result = TextAbstraction::Internal::ValueToIndex( 500, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
+ DALI_TEST_EQUALS( 9, result, TEST_LOCATION );
END_TEST;
}
{
return CreateBufferImage(4, 4, Color::WHITE);
}
+
+namespace Test
+{
+
+struct ObjectDestructionFunctor
+{
+ // Create a ObjectDestructionFunctor passing in a Dali::RefObject* to be monitored and a bool variable.
+ // Create ObjectRegistry instance and connect to the ObjectDestroyedSignal passing in the above functor for the callback.
+ // Get the ObjectPointer (Actor::GetObjectPtr) of the Actor to be checked for destruction and assign it to the Dali::RefObject*
+ // Check the bool variable which would be true when object destroyed.
+ ObjectDestructionFunctor( Dali::RefObject* objectPtr, bool& refObjectDestroyed )
+ : refObjectPointerToCheck( objectPtr ),
+ refObjectDestroyedBoolean( refObjectDestroyed )
+ {
+ refObjectDestroyed = false;
+ }
+
+ void operator()( const Dali::RefObject* objectPointer )
+ {
+ if ( refObjectPointerToCheck == objectPointer )
+ {
+ refObjectDestroyedBoolean = true;
+ }
+ }
+
+ Dali::RefObject* refObjectPointerToCheck;
+ bool& refObjectDestroyedBoolean;
+};
+
+ObjectDestructionTracker::ObjectDestructionTracker()
+ :mRefObjectDestroyed( false)
+{
+}
+
+void ObjectDestructionTracker::Start( Actor actor )
+{
+ ObjectDestructionFunctor destructionFunctor( actor.GetObjectPtr(), mRefObjectDestroyed );
+
+ ObjectRegistry objectRegistry = Stage::GetCurrent().GetObjectRegistry();
+ objectRegistry.ObjectDestroyedSignal().Connect( this, destructionFunctor );
+}
+
+bool ObjectDestructionTracker::IsDestroyed()
+{
+ return mRefObjectDestroyed;
+}
+
+} // namespace Test
BufferImage CreateBufferImage();
BufferImage CreateBufferImage(int width, int height, const Vector4& color);
+// Test namespace to prevent pollution of Dali namespace, add Test helper functions here
+namespace Test
+{
+/**
+ * @brief
+ *
+ * Helper to check object destruction occurred
+ * 1) In main part of code create an ObjectDestructionTracker
+ * 2) Within sub section of main create object Actor test and call Start with Actor to test for destruction
+ * 3) Perform code which is expected to destroy Actor
+ * 4) Back in main part of code use IsDestroyed() to test if Actor was destroyed
+ */
+class ObjectDestructionTracker : public ConnectionTracker
+{
+public:
+
+ /**
+ * @brief Call in main part of code
+ */
+ ObjectDestructionTracker();
+
+ /**
+ * @brief Call in sub bock of code where the Actor being checked is still alive.
+ *
+ * @param[in] actor Actor to be checked for destruction
+ */
+ void Start( Actor actor );
+
+ /**
+ * @brief Call to check if Actor alive or destroyed.
+ *
+ * @return bool true if Actor was destroyed
+ */
+ bool IsDestroyed();
+
+private:
+ bool mRefObjectDestroyed;
+};
+
+} // namespace Test
+
#endif // __DALI_TEST_SUITE_UTILS_H__
return FindIndexFromMethodAndParams( method, params ) > -1;
}
+bool TraceCallStack::FindMethodAndParamsFromStartIndex( std::string method, std::string params, size_t& startIndex ) const
+{
+ for( size_t i = startIndex; i < mCallStack.size(); ++i )
+ {
+ if( ( mCallStack[i].method.compare( method ) == 0 ) && ( mCallStack[i].paramList.compare( params ) == 0 ) )
+ {
+ startIndex = i;
+ return true;
+ }
+ }
+ return false;
+}
/**
* Search for a method in the stack with the given parameter list
*/
bool FindMethodAndParams(std::string method, const NamedParams& params) const;
+ /**
+ * Search for a method in the stack with the given parameter list.
+ * The search is done from a given index.
+ * This allows the order of methods and parameters to be checked.
+ * @param[in] method The name of the method
+ * @param[in] params A comma separated list of parameter values
+ * @param[in/out] startIndex The method index to start looking from.
+ * This is updated if a method is found so subsequent
+ * calls can search for methods occuring after this one.
+ * @return True if the method was in the stack
+ */
+ bool FindMethodAndParamsFromStartIndex( std::string method, std::string params, size_t& startIndex ) const;
+
/**
* Search for a method in the stack with the given parameter list
* @param[in] method The name of the method
END_TEST;
}
+
+int UtcDaliApplicationGetResourcePathP(void)
+{
+ Application application = Application::New();
+ std::string result ("**invalid path**"); // Calling GetResourcePath should replace this with a system dependent path or "".
+ result = application.GetResourcePath();
+ DALI_TEST_CHECK( result !="**invalid path**" );
+
+ END_TEST;
+}
+
endif
+# IVI
+if IVI_PROFILE
+
+adaptor_internal_src_files += $(adaptor_common_internal_src_files) \
+ $(adaptor_common_internal_mobile_profile_src_files) \
+ $(adaptor_tizen_internal_src_files) \
+ $(static_libraries_libunibreak_src_files)
+
+if WAYLAND
+if USE_ECORE_WAYLAND
+adaptor_internal_src_files += $(adaptor_ecore_wayland_tizen_internal_src_files)
+else
+adaptor_internal_src_files += $(adaptor_wayland_tizen_internal_src_files)
+endif # USE_ECORE_WAYLAND
+
+adaptor_internal_src_files += $(adaptor_tizen_internal_egl_extension_src_files)\
+ $(adaptor_tizen_internal_native_image_src_files)
+
+else
+adaptor_internal_src_files += $(adaptor_x11_tizen_internal_src_files) \
+ $(adaptor_common_internal_egl_extension_src_files)
+endif # WAYLAND
+
+endif # IVI_PROFILE
+
+
# Node JS support for using an external libuv main loop. If not enabled then just use e-core as normal
# Used for things like callbacks, file-monintors, x input handling
if LIB_UV_EVENT_LOOP
-DFONT_DOWNLOADED_PATH="\"${fontDownloadedPath}\"" \
-DFONT_APPLICATION_PATH="\"${fontApplicationPath}\"" \
-DFONT_CONFIGURATION_FILE="\"${fontConfigurationFile}\"" \
+ -DTIZEN_PLATFORM_CONFIG_SUPPORTED=${tizenPlatformConfigSupported} \
-DNON_POWER_OF_TWO_TEXTURES \
-DDALI_COMPILATION -DDALI_ADAPTOR_COMPILATION \
-Werror -Wall -lgcc \
else
-if MOBILE_PROFILE
+libdali_adaptor_uv_la_CXXFLAGS += $(ECORE_WAYLAND_CFLAGS)
+libdali_adaptor_uv_la_LIBADD += $(ECORE_WAYLAND_LIBS)
+
+if IVI_PROFILE
libdali_adaptor_uv_la_CXXFLAGS += $(ECORE_WAYLAND_CFLAGS)
libdali_adaptor_uv_la_LIBADD += $(ECORE_WAYLAND_LIBS)
endif
libdali_adaptor_uv_la_LIBADD +=
endif
+if IVI_PROFILE
+libdali_adaptor_uv_la_CXXFLAGS += \
+ $(DEVICED_CFLAGS) \
+ $(EFL_ASSIST_CFLAGS) \
+ $(NATIVE_BUFFER_CFLAGS) \
+ $(NATIVE_BUFFER_POOL_CFLAGS)
+
+libdali_adaptor_uv_la_LIBADD += \
+ $(EFL_ASSIST_LIBS) \
+ $(NATIVE_BUFFER_LIBS) \
+ $(NATIVE_BUFFER_POOL_LIBS)
+endif
+
if UBUNTU_PROFILE
libdali_adaptor_uv_la_LIBADD += -ljpeg
CFLAGS += -fPIC
# Tizen Profile options
AC_ARG_ENABLE([profile],
- [AC_HELP_STRING([--enable-profile=COMMON,MOBILE,WEARABLE,TV,UBUNTU],
+ [AC_HELP_STRING([--enable-profile=COMMON,MOBILE,WEARABLE,TV,IVI,UBUNTU],
[Select the variant of tizen])],
[enable_profile=$enableval],
[enable_profile=UBUNTU])
# Ensure valid profile selected
-if test "x$enable_profile" != "xCOMMON" -a "x$enable_profile" != "xMOBILE" -a "x$enable_profile" != "xWEARABLE" -a "x$enable_profile" != "xTV" -a "x$enable_profile" != "xUBUNTU"; then
+if test "x$enable_profile" != "xCOMMON" -a "x$enable_profile" != "xMOBILE" -a "x$enable_profile" != "xWEARABLE" -a "x$enable_profile" != "xTV" -a "x$enable_profile" != "xIVI" -a "x$enable_profile" != "xUBUNTU"; then
AC_MSG_ERROR([$enable_profile is an invalid profile])
fi
AM_CONDITIONAL([MOBILE_PROFILE], [test x$enable_profile = xMOBILE])
AM_CONDITIONAL([WEARABLE_PROFILE], [test x$enable_profile = xWEARABLE])
AM_CONDITIONAL([TV_PROFILE], [test x$enable_profile = xTV])
+AM_CONDITIONAL([IVI_PROFILE], [test x$enable_profile = xIVI])
AM_CONDITIONAL([UBUNTU_PROFILE], [test x$enable_profile = xUBUNTU])
AM_CONDITIONAL([WAYLAND], [test x$enable_wayland = xyes])
AM_CONDITIONAL([USE_EFL], [test x$enable_efl = xyes])
PKG_CHECK_MODULES(OPENGLES20, glesv2)
fi
+if test "x$enable_profile" = "xIVI"; then
+PKG_CHECK_MODULES(OPENGLES20, glesv2)
+fi
+
if test "x$enable_profile" = "xUBUNTU"; then
PKG_CHECK_MODULES(OPENGLES20, glesv2 egl)
else
else
-# dali-adaptor-uv for MOBILE profile needs ecore-wayland even if enable_efl==no
-# because adaptors/mobile/pixmap-render-surface-factory.cpp uses it.
-if test "x$enable_profile" = "xMOBILE"; then
+# For adaptors/mobile/native-render-surface-factory.cpp
+PKG_CHECK_MODULES(ECORE_WAYLAND, ecore-wayland)
+
+if test "x$enable_profile" = "xIVI"; then
PKG_CHECK_MODULES(ECORE_WAYLAND, ecore-wayland)
fi
fontConfigurationFile=$FONT_CONFIGURATION_FILE
fi
+if test x$TIZEN_PLATFORM_CONFIG_SUPPORTED != x; then
+ tizenPlatformConfigSupported=$TIZEN_PLATFORM_CONFIG_SUPPORTED
+else
+ tizenPlatformConfigSupported=0
+fi
+
AC_SUBST(dataReadWriteDir)
AC_SUBST(dataReadOnlyDir)
AC_SUBST(DALI_ADAPTOR_CFLAGS)
AC_SUBST(DALI_PROFILE_CFLAGS)
AC_SUBST(fontConfigurationFile)
+AC_SUBST(tizenPlatformConfigSupported)
# Specify the include directory for development headers
#devincludepath=${includedir}/dali/internal
Font config file: $fontConfigurationFile
Building with EFL Libraries: $enable_efl
Using Tizen APP FW libraries: $enable_appfw
- OpenGL ES version: $enable_gles"
+ OpenGL ES version: $enable_gles
+ Tizen Platform Config supported: $tizenPlatformConfigSupported
+"
# optional output of node.js source path if we're building with libuv
if test "x$build_for_libuv" != "xno"; then
echo " LibUV header path $with_libuv"
endif # USE_ECORE_WAYLAND
adaptor_internal_src_files += $(adaptor_tizen_internal_egl_extension_src_files) \
- $(adaptor_tizen_internal_native_image_src_files)
+ $(adaptor_tizen_internal_native_image_src_files) \
+ $(adaptor_common_internal_wayland_mobile_profile_src_files)
else
adaptor_internal_src_files += $(adaptor_x11_tizen_internal_src_files) \
- $(adaptor_common_internal_egl_extension_src_files)
+ $(adaptor_common_internal_egl_extension_src_files) \
+ $(adaptor_common_internal_x_mobile_profile_src_files)
endif # WAYLAND
endif # MOBILE_PROFILE
adaptor_internal_src_files += $(adaptor_tizen_internal_egl_extension_src_files) \
$(adaptor_tizen_internal_native_image_src_files) \
- $(adaptor_internal_wearable_profile_src_files)
+ $(adaptor_internal_wearable_profile_src_files) \
+ $(adaptor_common_internal_wayland_mobile_profile_src_files)
else
adaptor_internal_src_files += $(adaptor_x11_tizen_internal_src_files) \
- $(adaptor_common_internal_egl_extension_src_files)
+ $(adaptor_common_internal_egl_extension_src_files) \
+ $(adaptor_common_internal_x_mobile_profile_src_files)
endif # WAYLAND
endif # WEARABLE
endif
+# IVI
+if IVI_PROFILE
+
+adaptor_internal_src_files += $(adaptor_common_internal_src_files) \
+ $(adaptor_common_internal_mobile_profile_src_files) \
+ $(adaptor_tizen_internal_src_files) \
+ $(static_libraries_libunibreak_src_files)
+
+if WAYLAND
+
+if USE_ECORE_WAYLAND
+adaptor_internal_src_files += $(adaptor_ecore_wayland_tizen_internal_src_files)
+else
+adaptor_internal_src_files += $(adaptor_wayland_tizen_internal_src_files)
+endif # USE_ECORE_WAYLAND
+
+adaptor_internal_src_files += $(adaptor_tizen_internal_egl_extension_src_files) \
+ $(adaptor_tizen_internal_native_image_src_files)
+else
+adaptor_internal_src_files += $(adaptor_x11_tizen_internal_src_files) \
+ $(adaptor_common_internal_egl_extension_src_files)
+endif # WAYLAND
+
+endif # IVI_PROFILE
+
+
+
# Node JS support for using an external libuv main loop. If not enabled then just use e-core as normal
# Used for things like callbacks, file-monintors, x input handling
if LIB_UV_EVENT_LOOP
-DFONT_DOWNLOADED_PATH="\"${fontDownloadedPath}\"" \
-DFONT_APPLICATION_PATH="\"${fontApplicationPath}\"" \
-DFONT_CONFIGURATION_FILE="\"${fontConfigurationFile}\"" \
+ -DTIZEN_PLATFORM_CONFIG_SUPPORTED=${tizenPlatformConfigSupported} \
-DNON_POWER_OF_TWO_TEXTURES \
-DDALI_COMPILATION -DDALI_ADAPTOR_COMPILATION \
-Werror -Wall -lgcc \
libdali_adaptor_la_LIBADD +=
endif
+if IVI_PROFILE
+libdali_adaptor_la_CXXFLAGS += \
+ $(DEVICED_CFLAGS) \
+ $(EFL_ASSIST_CFLAGS) \
+ $(NATIVE_BUFFER_CFLAGS) \
+ $(NATIVE_BUFFER_POOL_CFLAGS)
+
+libdali_adaptor_la_LIBADD += \
+ $(EFL_ASSIST_LIBS) \
+ $(NATIVE_BUFFER_LIBS) \
+ $(NATIVE_BUFFER_POOL_LIBS)
+endif
+
if UBUNTU_PROFILE
libdali_adaptor_la_LIBADD += -ljpeg
CFLAGS += -fPIC
# Tizen Profile options
AC_ARG_ENABLE([profile],
- [AC_HELP_STRING([--enable-profile=COMMON,MOBILE,WEARABLE,TV,UBUNTU],
+ [AC_HELP_STRING([--enable-profile=COMMON,MOBILE,WEARABLE,TV,IVI,UBUNTU],
[Select the variant of tizen])],
[enable_profile=$enableval],
[enable_profile=UBUNTU])
# Ensure valid profile selected
-if test "x$enable_profile" != "xCOMMON" -a "x$enable_profile" != "xMOBILE" -a "x$enable_profile" != "xWEARABLE" -a "x$enable_profile" != "xTV" -a "x$enable_profile" != "xUBUNTU"; then
+if test "x$enable_profile" != "xCOMMON" -a "x$enable_profile" != "xMOBILE" -a "x$enable_profile" != "xWEARABLE" -a "x$enable_profile" != "xTV" -a "x$enable_profile" != "xIVI" -a "x$enable_profile" != "xUBUNTU"; then
AC_MSG_ERROR([$enable_profile is an invalid profile])
fi
AM_CONDITIONAL([MOBILE_PROFILE], [test x$enable_profile = xMOBILE])
AM_CONDITIONAL([WEARABLE_PROFILE], [test x$enable_profile = xWEARABLE])
AM_CONDITIONAL([TV_PROFILE], [test x$enable_profile = xTV])
+AM_CONDITIONAL([IVI_PROFILE], [test x$enable_profile = xIVI])
AM_CONDITIONAL([UBUNTU_PROFILE], [test x$enable_profile = xUBUNTU])
AM_CONDITIONAL([WAYLAND], [test x$enable_wayland = xyes])
AM_CONDITIONAL([USE_EFL], [test x$enable_efl = xyes])
PKG_CHECK_MODULES(OPENGLES20, glesv2)
fi
+if test "x$enable_profile" = "xIVI"; then
+PKG_CHECK_MODULES(OPENGLES20, glesv2)
+fi
+
if test "x$enable_profile" = "xUBUNTU"; then
PKG_CHECK_MODULES(OPENGLES20, glesv2 egl)
#PKG_CHECK_MODULES(OPENGLES20, gl egl)
dataReadOnlyDir=${prefix}/share/dali/
fi
+if test x$TIZEN_PLATFORM_CONFIG_SUPPORTED != x; then
+ tizenPlatformConfigSupported=$TIZEN_PLATFORM_CONFIG_SUPPORTED
+else
+ tizenPlatformConfigSupported=0
+fi
+
if test x$FONT_CONFIGURATION_FILE != x; then
fontConfigurationFile=$FONT_CONFIGURATION_FILE
fi
AC_SUBST(DALI_ADAPTOR_CFLAGS)
AC_SUBST(DALI_PROFILE_CFLAGS)
AC_SUBST(fontConfigurationFile)
+AC_SUBST(tizenPlatformConfigSupported)
# Specify the include directory for development headers
#devincludepath=${includedir}/dali/internal
Building with EFL Libraries: $enable_efl
Using Tizen APP FW libraries: $enable_appfw
OpenGL ES version: $enable_gles
+ Tizen Platform Config supported $tizenPlatformConfigSupported
TizenVR Engine: $enable_tizenvr
TizenVR Engine Dir: $with_tizenvr_dir
"
Name: dali-adaptor
Summary: The DALi Tizen Adaptor
-Version: 1.1.45
+Version: 1.2.5
Release: 1
Group: System/Libraries
License: Apache-2.0 and BSD-2-Clause and MIT
#need libtzplatform-config for directory if tizen version is 3.x
-%if "%{tizen_version_major}" == "3"
+%if "%{tizen_version_major}" >= "3"
+%define tizen_platform_config_supported 1
BuildRequires: pkgconfig(libtzplatform-config)
%endif
%define gles_requirement_setup 1
%endif
+%if "%{profile}" == "ivi"
+%define dali_profile IVI
+%define dali_feedback_plugin 0
+%define dali_videoplayer_plugin 1
+%define shaderbincache_flag DISABLE
+BuildRequires: pkgconfig(glesv2)
+%define gles_requirement_setup 1
+%endif
+
%if "%{profile}" == "common"
%define dali_profile COMMON
%define dali_feedback_plugin 0
%prep
%setup -q
-#Use TZ_PATH when tizen version is 3.x
+#Use TZ_PATH when tizen version is 3.x or greater
-%if "%{tizen_version_major}" == "2"
-%define dali_data_rw_dir /usr/share/dali/
-%define dali_data_ro_dir /usr/share/dali/
-%define font_preloaded_path /usr/share/fonts/
-%define font_downloaded_path /opt/share/fonts/
-%define font_application_path /usr/share/app_fonts/
-%define font_configuration_file /opt/etc/fonts/conf.avail/99-slp.conf
-%else
+%if "%{tizen_version_major}" >= "3"
%define dali_data_rw_dir %TZ_SYS_RO_SHARE/dali/
%define dali_data_ro_dir %TZ_SYS_RO_SHARE/dali/
%define font_preloaded_path %TZ_SYS_RO_SHARE/fonts/
%define font_downloaded_path %TZ_SYS_SHARE/fonts/
%define font_application_path %TZ_SYS_RO_SHARE/app_fonts/
%define font_configuration_file %TZ_SYS_ETC/fonts/conf.avail/99-slp.conf
+%else
+%define dali_data_rw_dir /usr/share/dali/
+%define dali_data_ro_dir /usr/share/dali/
+%define font_preloaded_path /usr/share/fonts/
+%define font_downloaded_path /opt/share/fonts/
+%define font_application_path /usr/share/app_fonts/
+%define font_configuration_file /opt/etc/fonts/conf.avail/99-slp.conf
%endif
%define user_shader_cache_dir %{dali_data_ro_dir}/core/shaderbin/
FONT_DOWNLOADED_PATH="%{font_downloaded_path}" ; export FONT_DOWNLOADED_PATH
FONT_APPLICATION_PATH="%{font_application_path}" ; export FONT_APPLICATION_PATH
FONT_CONFIGURATION_FILE="%{font_configuration_file}" ; export FONT_CONFIGURATION_FILE
+%if 0%{?tizen_platform_config_supported}
+TIZEN_PLATFORM_CONFIG_SUPPORTED="%{tizen_platform_config_supported}" ; export TIZEN_PLATFORM_CONFIG_SUPPORTED
+%endif
# Default to GLES 2.0 if not specified.
%{!?target_gles_version: %define target_gles_version 20}
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 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.
bool HandleExtensionRecordType( GifFileType* gifInfo )
{
SavedImage image;
- image.ExtensionBlocks = NULL;
- image.ExtensionBlockCount = 0;
GifByteType *extensionByte( NULL );
#ifdef LIBGIF_VERSION_5_1_OR_ABOVE
+ ExtensionBlock extensionBlocks;
+ image.ExtensionBlocks = &extensionBlocks;
+ image.ExtensionBlockCount = 1;
int *extensionBlockTypePointer = &image.ExtensionBlocks->Function;
#else
+ image.ExtensionBlocks = NULL;
+ image.ExtensionBlockCount = 0;
int *extensionBlockTypePointer = &image.Function;
#endif
return GetImplementation(*this).GetPointSize( id );
}
-FontId FontClient::FindDefaultFont( Character charcode, PointSize26Dot6 requestedPointSize, bool preferColor )
+FontId FontClient::FindDefaultFont( Character charcode,
+ PointSize26Dot6 requestedPointSize,
+ bool preferColor )
{
- return GetImplementation(*this).FindDefaultFont( charcode, requestedPointSize, preferColor );
+ return GetImplementation(*this).FindDefaultFont( charcode,
+ requestedPointSize,
+ preferColor );
}
-FontId FontClient::FindFallbackFont( FontId preferredFont, Character charcode, PointSize26Dot6 requestedPointSize, bool preferColor )
+FontId FontClient::FindFallbackFont( Character charcode,
+ const FontDescription& preferredFontDescription,
+ PointSize26Dot6 requestedPointSize,
+ bool preferColor )
{
- return GetImplementation(*this).FindFallbackFont( preferredFont, charcode, requestedPointSize, preferColor );
+ return GetImplementation(*this).FindFallbackFont( charcode, preferredFontDescription, requestedPointSize, preferColor );
}
FontId FontClient::GetFontId( const FontPath& path, PointSize26Dot6 requestedPointSize, FaceIndex faceIndex )
/**
* @brief Retrieve the list of default fonts supported by the system.
*
- * @param[out] defaultFonts A list of default font paths, family & style strings.
+ * @param[out] defaultFonts A list of default font paths, family, width, weight and slant.
*/
void GetDefaultFonts( FontList& defaultFonts );
/**
- * @brief Retrieve the active default font from the system
+ * @brief Retrieve the active default font from the system.
*
- * @param[out] fontDescription font structure describing the default font
+ * @param[out] fontDescription font structure describing the default font.
*/
void GetDefaultPlatformFontDescription( FontDescription& fontDescription );
/**
* @brief Retrieve the list of fonts supported by the system.
*
- * @param[out] systemFonts A list of font paths, family & style strings.
+ * @param[out] systemFonts A list of font paths, family, width, weight and slant.
*/
void GetSystemFonts( FontList& systemFonts );
/**
* @brief Retrieves the font description of a given font @p id.
*
- * @param[in] id The font id.
- * @param[out] fontDescription The path, family & style describing the font.
+ * @param[in] id The font identifier.
+ * @param[out] fontDescription The path, family & style (width, weight and slant) describing the font.
*/
void GetDescription( FontId id, FontDescription& fontDescription );
/**
* @brief Retrieves the font point size of a given font @p id.
*
- * @param[in] id The font id.
+ * @param[in] id The font identifier.
*
* @return The point size in 26.6 fractional points.
*/
*
* This is useful when localised strings are provided for multiple languages
* i.e. when a single default font does not work for all languages.
+ *
* @param[in] charcode The character for which a font is needed.
* @param[in] requestedPointSize The point size in 26.6 fractional points; the default point size is 12*64.
- * @param[in] preferColor True if a color font is preferred.
- * @return A valid font ID, or zero if the font does not exist.
+ * @param[in] preferColor @e true if a color font is preferred.
+ *
+ * @return A valid font identifier, or zero if the font does not exist.
*/
FontId FindDefaultFont( Character charcode,
PointSize26Dot6 requestedPointSize = DEFAULT_POINT_SIZE,
*
* This is useful when localised strings are provided for multiple languages
* i.e. when a single default font does not work for all languages.
- * @param[in] preferredFont The preferred font which may not provide a glyph for charcode.
- * The fallback-font will be the closest match to preferredFont, which does support the required glyph.
+ *
* @param[in] charcode The character for which a font is needed.
+ * @param[in] preferredFontDescription Description of the preferred font which may not provide a glyph for @p charcode.
+ * The fallback-font will be the closest match to @p preferredFontDescription, which does support the required glyph.
* @param[in] requestedPointSize The point size in 26.6 fractional points; the default point size is 12*64.
- * @param[in] preferColor True if a color font is preferred.
- * @return A valid font ID, or zero if the font does not exist.
+ * @param[in] preferColor @e true if a color font is preferred.
+ *
+ * @return A valid font identifier, or zero if the font does not exist.
*/
- FontId FindFallbackFont( FontId preferredFont,
- Character charcode,
+ FontId FindFallbackFont( Character charcode,
+ const FontDescription& preferredFontDescription,
PointSize26Dot6 requestedPointSize = DEFAULT_POINT_SIZE,
bool preferColor = false );
* @param[in] path The path to a font file.
* @param[in] requestedPointSize The point size in 26.6 fractional points; the default point size is 12*64.
* @param[in] faceIndex The index of the font face (optional).
- * @return A valid font ID, or zero if the font does not exist.
+ *
+ * @return A valid font identifier, or zero if the font does not exist.
*/
FontId GetFontId( const FontPath& path,
PointSize26Dot6 requestedPointSize = DEFAULT_POINT_SIZE,
FaceIndex faceIndex = 0 );
/**
- * @brief Retrieve the unique identifier for a font.
+ * @brief Retrieves a unique font identifier for a given description.
*
- * @note It the font style is not empty, it will be used instead the font weight and font slant slant.
- *
- * @param[in] fontDescription A font description.
+ * @param[in] preferredFontDescription Description of the preferred font.
+ * The font will be the closest match to @p preferredFontDescription.
* @param[in] requestedPointSize The point size in 26.6 fractional points; the default point size is 12*64.
* @param[in] faceIndex The index of the font face (optional).
- * @return A valid font ID, or zero if the font does not exist.
+ *
+ * @return A valid font identifier, or zero if no font is found.
*/
- FontId GetFontId( const FontDescription& fontDescription,
+ FontId GetFontId( const FontDescription& preferredFontDescription,
PointSize26Dot6 requestedPointSize = DEFAULT_POINT_SIZE,
FaceIndex faceIndex = 0 );
/**
* @brief Query the metrics for a font.
*
- * @param[in] fontId The ID of the font for the required glyph.
+ * @param[in] fontId The identifier of the font for the required glyph.
* @param[out] metrics The font metrics.
*/
void GetFontMetrics( FontId fontId, FontMetrics& metrics );
/**
* @brief Retrieve the glyph index for a UTF-32 character code.
*
- * @param[in] fontId The ID of the font for the required glyph.
+ * @param[in] fontId The identifier of the font for the required glyph.
* @param[in] charcode The UTF-32 character code.
+ *
* @return The glyph index, or zero if the character code is undefined.
*/
GlyphIndex GetGlyphIndex( FontId fontId, Character charcode );
* @brief Retrieve the metrics for a series of glyphs.
*
* @param[in,out] array An array of glyph-info structures with initialized FontId & GlyphIndex values.
- * It may contain the advance and an offset set into the bearing from the shaping tool.
- * On return, the glyph's size value will be initialized. The bearing value will be updated by adding the font's glyph bearing to the one set by the shaping tool.
+ * It may contain the advance and an offset set into the bearing from the shaping tool.
+ * On return, the glyph's size value will be initialized. The bearing value will be updated by adding the font's glyph bearing to the one set by the shaping tool.
* @param[in] size The size of the array.
* @param[in] type The type of glyphs used for rendering; either bitmaps or vectors.
* @param[in] horizontal True for horizontal layouts (set to false for vertical layouting).
- * @return True if all of the requested metrics were found.
+ *
+ * @return @e true if all of the requested metrics were found.
*/
bool GetGlyphMetrics( GlyphInfo* array, uint32_t size, GlyphType type, bool horizontal = true );
/**
* @brief Create a bitmap representation of a glyph.
*
- * @param[in] fontId The ID of the font.
+ * @param[in] fontId The identifier of the font.
* @param[in] glyphIndex The index of a glyph within the specified font.
+ *
* @return A valid BufferImage, or an empty handle if the glyph could not be rendered.
*/
PixelData CreateBitmap( FontId fontId, GlyphIndex glyphIndex );
* @brief Create a vector representation of a glyph.
*
* @note This feature requires highp shader support and is not available on all platforms
- * @param[in] fontId The ID of the font.
+ * @param[in] fontId The identifier of the font.
* @param[in] glyphIndex The index of a glyph within the specified font.
* @param[out] blob A blob of data; this is owned by FontClient and should be copied by the caller of CreateVectorData().
* @param[out] blobLength The length of the blob data, or zero if the blob creation failed.
*/
enum Type
{
+ NONE, ///< Means not defined. Will use what is set as default, currently NORMAL.
ULTRA_CONDENSED,
EXTRA_CONDENSED,
CONDENSED,
SEMI_EXPANDED,
EXPANDED,
EXTRA_EXPANDED,
- ULTRA_EXPANDED,
+ ULTRA_EXPANDED
+ };
+
+ const char* const Name[] =
+ {
+ "NONE",
+ "ULTRA_CONDENSED",
+ "EXTRA_CONDENSED",
+ "CONDENSED",
+ "SEMI_CONDENSED",
+ "NORMAL",
+ "SEMI_EXPANDED",
+ "EXPANDED",
+ "EXTRA_EXPANDED",
+ "ULTRA_EXPANDED"
};
} // namespace FontWidth
*/
enum Type
{
+ NONE, ///< Means not defined. Will use what is set as default, currently NORMAL.
THIN,
ULTRA_LIGHT,
EXTRA_LIGHT = ULTRA_LIGHT,
HEAVY = BLACK,
EXTRA_BLACK = BLACK
};
+
+ const char* const Name[] =
+ {
+ "NONE",
+ "THIN",
+ "ULTRA_LIGHT",
+ "LIGHT",
+ "DEMI_LIGHT",
+ "BOOK",
+ "NORMAL",
+ "MEDIUM",
+ "DEMI_BOLD",
+ "BOLD",
+ "ULTRA_BOLD",
+ "BLACK"
+ };
}
namespace FontSlant
*/
enum Type
{
+ NONE, ///< Means not defined. Will use what is set as default, currently NORMAL.
NORMAL,
ROMAN = NORMAL,
ITALIC,
OBLIQUE
};
+
+ const char* const Name[] =
+ {
+ "NONE",
+ "NORMAL",
+ "ITALIC",
+ "OBLIQUE"
+ };
} // namespace FontSlant
struct FontDescription
FontDescription()
: path(),
family(),
- width( FontWidth::NORMAL ),
- weight( FontWeight::NORMAL ),
- slant( FontSlant::NORMAL )
+ width( FontWidth::NONE ),
+ weight( FontWeight::NONE ),
+ slant( FontSlant::NONE )
{}
~FontDescription()
Script GetCharacterScript( Character character )
{
- // Latin script:
+ // Latin script: It contains punctuation characters and symbols which are not part of the latin script. https://en.wikipedia.org/wiki/Latin_script_in_Unicode
// 0x0000 - 0x007f C0 Controls and Basic Latin
+ //
+ // ASCII digits (not part of LATIN script):
+ // 0x0030 - 0x0039
+ //
+ // ASCII punctuation and symbols (not part of LATIN script):
+ // 0x0020 - 0x002F
+ // 0x003A - 0x0040
+ // 0x005B - 0x0060
+ // 0x007B - 0x007E
+ //
+ // Controls (not part of LATIN script):
+ // 0x007F
+ //
// 0x0080 - 0x00ff C1 Controls and Latin-1 Supplement
+ //
+ // Controls (not part of LATIN script):
+ // 0x0080 - 0x009F
+ //
+ // Punctuations and symbols (not part of LATIN script):
+ // 0x00A0 - 0x00BF
+ //
+ // Mathematical operators (not part of LATIN script):
+ // 0x00D7
+ // 0x00F7
+ //
// 0x0100 - 0x017f Latin Extended-A
// 0x0180 - 0x024f Latin Extended-B
// 0x0250 - 0x02af IPA Extensions
// 0x02b0 - 0x02ff Spacing Modifier Letters
+ //
+ // Punctuation (not part of LATIN script):
+ // 0x02B9 - 0x02BF
+ //
// 0x1d00 - 0x1d7f Phonetic Extensions
+ //
+ // Uralic Phonetic (not part of LATIN script):
+ // 0x1D26 - 0x1D2B
+ //
+ // Subscripts and superscripts
+ // 0x1D5D - 0x1D61
+ // 0x1D66 - 0x1D6A
+ // 0x1D78
+ //
// 0x1d80 - 0x1dbf Phonetic Extensions Supplement
+ //
+ // 0x1DBF (subscript or superscript. Not part of LATIN script )
+ //
// 0x1e00 - 0x1eff Latin Extended Additional
// 0x2070 - 0x209f Superscripts and Subscripts
- // 0x2100 - 0x214f Letterlike symbols
- // 0x2150 - 0x218f Number Forms
+ //
+ // 0x2070 (not part of LATIN script)
+ // 0x2074 - 0x207E (not part of LATIN script)
+ //
+ // 0x2100 - 0x214f Letterlike symbols (not part of LATIN script)
+ //
+ // 0x212A - 0x212B (are part of LATIN script)
+ // 0x2132 (are part of LATIN script)
+ // 0x214E (are part of LATIN script)
+ //
+ // 0x2150 - 0x2189 Number Forms
+ //
+ // 0x2150 - 0x215F Fractions (not part of LATIN script)
+ // 0x2189 Fractions (not part of LATIN script)
+ //
// 0x2c60 - 0x2c7f Latin Extended-C
// 0xa720 - 0xa7ff Latin Extended-D
+ //
+ // 0xA720 - 0xA721 Uralic Phonetic (not part of LATIN script)
+ // 0xA788 (not part of LATIN script)
+ // 0xA789 - 0xA78A Budu (not part of LATIN script)
+ //
// 0xab30 - 0xab6f Latin Extended-E
+ //
// 0xfb00 - 0xfb06 Latin Alphabetic Presentation Forms
// 0xff00 - 0xffef Halfwidth and Fullwidth Forms
+ //
+ // 0xFF00 - 0xFF20 HWFW Symbols (not part of LATIN script)
+ // 0xFF3B - 0xFF40 HWFW Symbols (not part of LATIN script)
+ // 0xFF5B - 0xFFEF HWFW Symbols (not part of LATIN script)
// Brahmic scripts:
// 0x0900 - 0x097f Devanagari
// 6b. Additional transport and map symbols ( 1F681 - 1F6C5 )
// 6c. Other additional symbols ( 1F30D - 1F567 )
+ // Symbols. Work around for these symbols.
+ // 0x25cb
+ // 0x25cf
+ // 0x25a1
+ // 0x25a0
+ // 0x2664
+ // 0x2661
+ // 0x2662
+ // 0x2667
+ // 0x2606
+ // 0x25aa
+ // 0x262a
+
if( IsCommonScript( character ) )
{
return COMMON;
{
if( character <= 0x077f )
{
- if( character == 0x00A9 )
+ if( ( 0x0030 <= character ) && ( character <= 0x0039 ) )
+ {
+ return ASCII_DIGITS;
+ }
+ if( character <= 0x007E )
{
- return EMOJI; // 5. Uncategorized: copyright sign
+ if( ( 0x0020 <= character ) && ( character <= 0x002F ) )
+ {
+ return ASCII_PS;
+ }
+ if( ( 0x003A <= character ) && ( character <= 0x0040 ) )
+ {
+ return ASCII_PS;
+ }
+ if( ( 0x005B <= character ) && ( character <= 0x0060 ) )
+ {
+ return ASCII_PS;
+ }
+ if( ( 0x007B <= character ) && ( character <= 0x007E ) )
+ {
+ return ASCII_PS;
+ }
}
- if( character == 0x00AE )
+ if( ( 0x007F <= character ) && ( character <= 0x009F ) )
{
- return EMOJI; // 5. Uncategorized: registered sign
+ // 0x007F is actually part of C0 Controls and Basic Latin. However, is the last and only control character of its block
+ // and the following characters of the next block are consecutive.
+ return C1_CONTROLS;
+ }
+ if( ( 0x00A0 <= character ) && ( character <= 0x00BF ) )
+ {
+ if( character == 0x00A9 )
+ {
+ return EMOJI; // 5. Uncategorized: copyright sign
+ }
+ if( character == 0x00AE )
+ {
+ return EMOJI; // 5. Uncategorized: registered sign
+ }
+
+ return C1_PS;
+ }
+ if( character == 0x00D7 )
+ {
+ return C1_MATH;
+ }
+ if( character == 0x00F7 )
+ {
+ return C1_MATH;
}
if( character <= 0x02ff )
{
+ if( ( 0x02B9 <= character ) && ( character <= 0x02BF ) )
+ {
+ return SML_P;
+ }
+
return LATIN;
}
if( ( 0x0370 <= character ) && ( character <= 0x03ff ) )
}
if( ( 0x1d00 <= character ) && ( character <= 0x1eff ) )
{
+ if( ( 0x1D26 <= character ) && ( character <= 0x1D2B ) )
+ {
+ return PHONETIC_U;
+ }
+ if( ( 0x1D5D <= character ) && ( character <= 0x1D61 ) )
+ {
+ return PHONETIC_SS;
+ }
+ if( ( 0x1D66 <= character ) && ( character <= 0x1D6A ) )
+ {
+ return PHONETIC_SS;
+ }
+ if( character == 0x1D78 )
+ {
+ return PHONETIC_SS;
+ }
+ if( character == 0x1DBF)
+ {
+ return PHONETIC_SS;
+ }
+
return LATIN;
}
}
}
if( ( 0x2070 <= character ) && ( character <= 0x209f ) )
{
+ if( character == 0x2070 )
+ {
+ return NUMERIC_SS;
+ }
+ if( ( 0x2074 <= character ) && ( character <= 0x207E ) )
+ {
+ return NUMERIC_SS;
+ }
+
return LATIN;
}
if( character == 0x20e3 )
{
return EMOJI; // 5. Uncategorized: information source
}
- if( ( 0x2100 <= character ) && ( character <= 0x218f ) )
- {
+ if( ( 0x2100 <= character ) && ( character <= 0x2189 ) )
+ {
+ if( ( 0x2100 <= character ) && ( character <= 0x214f ) )
+ {
+ if( ( 0x212A <= character ) && ( character <= 0x212B ) )
+ {
+ return LATIN;
+ }
+ if( character == 0x2132 )
+ {
+ return LATIN;
+ }
+ if( character == 0x214E )
+ {
+ return LATIN;
+ }
+
+ return LETTER_LIKE;
+ }
+ if( ( 0x2150 <= character ) && ( character <= 0x215F ) )
+ {
+ return FRACTIONS_NF;
+ }
+ if( character == 0x2189 )
+ {
+ return FRACTIONS_NF;
+ }
+
return LATIN;
}
+
+ // Symbols
+ if( ( 0x25cb == character ) ||
+ ( 0x25cf == character ) ||
+ ( 0x25a1 == character ) )
+ {
+ return SYMBOLS1;
+ }
+
+ if( 0x25a0 == character )
+ {
+ return SYMBOLS2;
+ }
+
+ if( ( 0x2664 == character ) ||
+ ( 0x2661 == character ) ||
+ ( 0x2662 == character ) ||
+ ( 0x2667 == character ) )
+ {
+ return SYMBOLS3;
+ }
+
+ if( ( 0x2606 == character ) ||
+ ( 0x25aa == character ) )
+ {
+ return SYMBOLS4;
+ }
+
+ if( 0x262a == character )
+ {
+ return SYMBOLS5;
+ }
+
// U+2194 5. Uncategorized: left right arrow
// U+2B55 5. Uncategorized: heavy large circle
if( ( 0x2194 <= character ) && ( character <= 0x2B55 ) )
}
if( ( 0xa720 <= character ) && ( character <= 0xa7ff ) )
{
+ if( character == 0xA720 )
+ {
+ return PHONETIC_U;
+ }
+ if( character == 0xA721 )
+ {
+ return PHONETIC_U;
+ }
+ if( character == 0xA788 )
+ {
+ return NON_LATIN_LED;
+ }
+ if( character == 0xA789 )
+ {
+ return NON_LATIN_LED;
+ }
+ if( character == 0xA78A )
+ {
+ return NON_LATIN_LED;
+ }
+
return LATIN;
}
if( ( 0xa960 <= character ) && ( character <= 0xa97f ) )
}
if( ( 0xff00 <= character ) && ( character <= 0xffef ) )
{
+ if( ( 0xFF00 <= character ) && ( character <= 0xFF20 ) )
+ {
+ return HWFW_S;
+ }
+ if( ( 0xFF3B <= character ) && ( character <= 0xFF40 ) )
+ {
+ return HWFW_S;
+ }
+ if( ( 0xFF5B <= character ) && ( character <= 0xFFEF ) )
+ {
+ return HWFW_S;
+ }
+
return LATIN;
}
if( ( 0x1ee00 <= character ) && ( character <= 0x1eeff ) )
*/
enum Script
{
- COMMON, ///< Valid for all scripts. i.e white space or '\n'.
-
- CYRILLIC, ///< The Cyrillic script. Used by Russian, Bulgarian, Ukrainian, Macedonian, ...
- GREEK, ///< The Greek script. Used by Greek.
- LATIN, ///< The latin script. Used by many western languages and others around the world.
-
- ARABIC, ///< The arabic script. Used by Arab and Urdu among others.
- HEBREW, ///< The Hebrew script. Used by the Hebrew, Yiddish, Ladino, and Judeo-Arabic.
-
- ARMENIAN, ///< The Armenian script. Used by Armenian.
- GEORGIAN, ///< The Georgian script. Used by Georgian.
-
- CJK, ///< The CJK script. Used by Chinese, Japanese, Korean and Vietnamese(old writing system).
- HANGUL, ///< The Hangul jamo script. Used by Korean.
- HIRAGANA, ///< The Hiragana script. Used by the Japanese.
- KATAKANA, ///< The Katakana script. Used by the Japanese.
- BOPOMOFO, ///< The Bopomofo script. Also called Zhuyin fuhao or Zhuyin. A phonetic notation used for the transcription of spoken Chinese.
-
- BENGALI, ///< The Bengali script. Used by Bangla, Assamese, Bishnupriya Manipuri, Daphla, Garo, Hallam, Khasi, Mizo, Munda, Naga, Rian, and Santali.
- BURMESE, ///< The Burmese script. Used by the Burmese (Myanmar) language.
- DEVANAGARI, ///< The devanagari script. Used by Hindi, Marathi, Sindhi, Nepali and Sanskrit.
- GUJARATI, ///< The Gujarati script. Used by Gujarati.
- GURMUKHI, ///< The Gurmukhi script. Used by Punjabi.
- KANNADA, ///< The Kannada script. Used by Kannada and Tulu.
- MALAYALAM, ///< The Malayalam script. Used by Malayalam.
- ORIYA, ///< The Oriya script. Used by Oriya (Odia), Khondi, and Santali.
- SINHALA, ///< The Sinhala script. Used by Sinhala and Pali.
- TAMIL, ///< The Tamil script. Used by Tamil, Badaga, and Saurashtra.
- TELUGU, ///< The Telugu script. Used by Telugu, Gondi, and Lambadi.
-
- LAO, ///< The Lao script. Used by the Lao language.
- THAI, ///< The Thai script. Used by the Thai language
- KHMER, ///< The Khmer script. Used by the Khmer language.
-
- EMOJI, ///< The Emoji which map to standardized Unicode characters.
-
- UNKNOWN ///< The script is unknown.
+ COMMON, ///< Valid for all scripts. i.e white space or '\n'.
+
+ ASCII_DIGITS, ///< ASCII digits.
+ ASCII_PS, ///< ASCII punctuation and symbols.
+
+ C1_CONTROLS, ///< Controls of the C1 Controls and Latin-1 Supplement unicode block.
+ C1_PS, ///< Punctuation and symbols of the C1 Controls and Latin-1 Supplement unicode block.
+ C1_MATH, ///< Math symbols of the C1 Controls and Latin-1 Supplement unicode block.
+
+ SML_P, ///< Punctuation symbols of the Spacing Modifier Letters unicode block.
+ PHONETIC_U, ///< Uralic phonetic symbols of the Phonetic Extensions unicode block.
+ PHONETIC_SS, ///< Subscripts and superscripts of the Phonetic Extensions unicode block.
+
+ NUMERIC_SS, ///< Numeric subscripts and superscripts.
+
+ LETTER_LIKE, ///< Symbols of the Letterlike unicode block.
+ NUMBER_FORMS, ///< Number Forms unicode block.
+ FRACTIONS_NF, ///< Numeric fraction symbols of the Number Forms unicode block.
+ NON_LATIN_LED, ///< Non latin symbols within the Latin Extended D unicode block.
+ HWFW_S, ///< Non latin symbols within the Halfwidth and fullwidth unicode block.
+
+ CYRILLIC, ///< The Cyrillic script. Used by Russian, Bulgarian, Ukrainian, Macedonian, ...
+ GREEK, ///< The Greek script. Used by Greek.
+ LATIN, ///< The latin script. Used by many western languages and others around the world.
+
+ ARABIC, ///< The arabic script. Used by Arab and Urdu among others.
+ HEBREW, ///< The Hebrew script. Used by the Hebrew, Yiddish, Ladino, and Judeo-Arabic.
+
+ ARMENIAN, ///< The Armenian script. Used by Armenian.
+ GEORGIAN, ///< The Georgian script. Used by Georgian.
+
+ CJK, ///< The CJK script. Used by Chinese, Japanese, Korean and Vietnamese(old writing system).
+ HANGUL, ///< The Hangul jamo script. Used by Korean.
+ HIRAGANA, ///< The Hiragana script. Used by the Japanese.
+ KATAKANA, ///< The Katakana script. Used by the Japanese.
+ BOPOMOFO, ///< The Bopomofo script. Also called Zhuyin fuhao or Zhuyin. A phonetic notation used for the transcription of spoken Chinese.
+
+ BENGALI, ///< The Bengali script. Used by Bangla, Assamese, Bishnupriya Manipuri, Daphla, Garo, Hallam, Khasi, Mizo, Munda, Naga, Rian, and Santali.
+ BURMESE, ///< The Burmese script. Used by the Burmese (Myanmar) language.
+ DEVANAGARI, ///< The devanagari script. Used by Hindi, Marathi, Sindhi, Nepali and Sanskrit.
+ GUJARATI, ///< The Gujarati script. Used by Gujarati.
+ GURMUKHI, ///< The Gurmukhi script. Used by Punjabi.
+ KANNADA, ///< The Kannada script. Used by Kannada and Tulu.
+ MALAYALAM, ///< The Malayalam script. Used by Malayalam.
+ ORIYA, ///< The Oriya script. Used by Oriya (Odia), Khondi, and Santali.
+ SINHALA, ///< The Sinhala script. Used by Sinhala and Pali.
+ TAMIL, ///< The Tamil script. Used by Tamil, Badaga, and Saurashtra.
+ TELUGU, ///< The Telugu script. Used by Telugu, Gondi, and Lambadi.
+
+ LAO, ///< The Lao script. Used by the Lao language.
+ THAI, ///< The Thai script. Used by the Thai language
+ KHMER, ///< The Khmer script. Used by the Khmer language.
+
+ EMOJI, ///< The Emoji which map to standardized Unicode characters.
+
+ SYMBOLS1, ///< Some symbols.
+ SYMBOLS2, ///< Some symbols.
+ SYMBOLS3, ///< Some symbols.
+ SYMBOLS4, ///< Some symbols.
+ SYMBOLS5, ///< Some symbols.
+
+ UNKNOWN ///< The script is unknown.
};
const char* const ScriptName[] =
{
- "COMMON", ///< Valid for all scripts. i.e white space or '\n'.
-
- "CYRILLIC", ///< The Cyrillic script. Used by Russian, Bulgarian, Ukrainian, Macedonian, ...
- "GREEK", ///< The Greek script. Used by Greek.
- "LATIN", ///< The latin script. Used by many western languages and others around the world.
-
- "ARABIC", ///< The arabic script. Used by Arab and Urdu among others.
- "HEBREW", ///< The Hebrew script. Used by the Hebrew, Yiddish, Ladino, and Judeo-Arabic.
-
- "ARMENIAN", ///< The Armenian script. Used by Armenian.
- "GEORGIAN", ///< The Georgian script. Used by Georgian.
-
- "CJK", ///< The CJK script. Used by Chinese, Japanese, Korean and Vietnamese(old writing system).
- "HANGUL", ///< The Hangul jamo script. Used by Korean.
- "HIRAGANA", ///< The Hiragana script. Used by the Japanese.
- "KATAKANA", ///< The Katakana script. Used by the Japanese.
- "BOPOMOFO", ///< The Bopomofo script. Also called Zhuyin fuhao or Zhuyin. A phonetic notation used for the transcription of spoken Chinese.
-
- "BENGALI", ///< The Bengali script. Used by Bangla, Assamese, Bishnupriya Manipuri, Daphla, Garo, Hallam, Khasi, Mizo, Munda, Naga, Rian, and Santali.
- "BURMESE", ///< The Burmese script. Used by the Burmese (Myanmar) language.
- "DEVANAGARI", ///< The devanagari script. Used by Hindi, Marathi, Sindhi, Nepali and Sanskrit.
- "GUJARATI", ///< The Gujarati script. Used by Gujarati.
- "GURMUKHI", ///< The Gurmukhi script. Used by Punjabi.
- "KANNADA", ///< The Kannada script. Used by Kannada and Tulu.
- "MALAYALAM", ///< The Malayalam script. Used by Malayalam.
- "ORIYA", ///< The Oriya script. Used by Oriya (Odia), Khondi, and Santali.
- "SINHALA", ///< The Sinhala script. Used by Sinhala and Pali.
- "TAMIL", ///< The Tamil script. Used by Tamil, Badaga, and Saurashtra.
- "TELUGU", ///< The Telugu script. Used by Telugu, Gondi, and Lambadi.
-
- "LAO", ///< The Lao script. Used by the Lao language.
- "THAI", ///< The Thai script. Used by the Thai language
- "KHMER", ///< The Khmer script. Used by the Khmer language.
-
- "EMOJI", ///< The Emoji which map to standardized Unicode characters.
-
- "UNKNOWN" ///< The script is unknown.
+ "COMMON", ///< Valid for all scripts. i.e white space or '\n'.
+
+ "ASCII_DIGITS", ///< ASCII digits.
+ "ASCII_PS", ///< ASCII punctuation and symbols.
+
+ "C1_CONTROLS", ///< Controls of the C1 Controls and Latin-1 Supplement unicode block.
+ "C1_PS", ///< Punctuation and symbols of the C1 Controls and Latin-1 Supplement unicode block.
+ "C1_MATH", ///< Math symbols of the C1 Controls and Latin-1 Supplement unicode block.
+
+ "SML_P", ///< Punctuation symbols of the Spacing Modifier Letters unicode block.
+ "PHONETIC_U", ///< Uralic phonetic symbols of the Phonetic Extensions unicode block.
+ "PHONETIC_SS", ///< Subscripts and superscripts of the Phonetic Extensions unicode block.
+
+ "NUMERIC_SS", ///< Numeric subscripts and superscripts.
+
+ "LETTER_LIKE", ///< Symbols of the Letterlike unicode block.
+ "NUMBER_FORMS", ///< Number Forms unicode block.
+ "FRACTIONS_NF", ///< Numeric fraction symbols of the Number Forms unicode block.
+ "NON_LATIN_LED", ///< Non latin symbols within the Latin Extended D unicode block.
+ "HWFW_S", ///< Non latin symbols within the Halfwidth and fullwidth unicode block.
+
+ "CYRILLIC", ///< The Cyrillic script. Used by Russian, Bulgarian, Ukrainian, Macedonian, ...
+ "GREEK", ///< The Greek script. Used by Greek.
+ "LATIN", ///< The latin script. Used by many western languages and others around the world.
+
+ "ARABIC", ///< The arabic script. Used by Arab and Urdu among others.
+ "HEBREW", ///< The Hebrew script. Used by the Hebrew, Yiddish, Ladino, and Judeo-Arabic.
+
+ "ARMENIAN", ///< The Armenian script. Used by Armenian.
+ "GEORGIAN", ///< The Georgian script. Used by Georgian.
+
+ "CJK", ///< The CJK script. Used by Chinese, Japanese, Korean and Vietnamese(old writing system).
+ "HANGUL", ///< The Hangul jamo script. Used by Korean.
+ "HIRAGANA", ///< The Hiragana script. Used by the Japanese.
+ "KATAKANA", ///< The Katakana script. Used by the Japanese.
+ "BOPOMOFO", ///< The Bopomofo script. Also called Zhuyin fuhao or Zhuyin. A phonetic notation used for the transcription of spoken Chinese.
+
+ "BENGALI", ///< The Bengali script. Used by Bangla, Assamese, Bishnupriya Manipuri, Daphla, Garo, Hallam, Khasi, Mizo, Munda, Naga, Rian, and Santali.
+ "BURMESE", ///< The Burmese script. Used by the Burmese (Myanmar) language.
+ "DEVANAGARI", ///< The devanagari script. Used by Hindi, Marathi, Sindhi, Nepali and Sanskrit.
+ "GUJARATI", ///< The Gujarati script. Used by Gujarati.
+ "GURMUKHI", ///< The Gurmukhi script. Used by Punjabi.
+ "KANNADA", ///< The Kannada script. Used by Kannada and Tulu.
+ "MALAYALAM", ///< The Malayalam script. Used by Malayalam.
+ "ORIYA", ///< The Oriya script. Used by Oriya (Odia), Khondi, and Santali.
+ "SINHALA", ///< The Sinhala script. Used by Sinhala and Pali.
+ "TAMIL", ///< The Tamil script. Used by Tamil, Badaga, and Saurashtra.
+ "TELUGU", ///< The Telugu script. Used by Telugu, Gondi, and Lambadi.
+
+ "LAO", ///< The Lao script. Used by the Lao language.
+ "THAI", ///< The Thai script. Used by the Thai language
+ "KHMER", ///< The Khmer script. Used by the Khmer language.
+
+ "EMOJI", ///< The Emoji which map to standardized Unicode characters.
+
+ "SYMBOLS1", ///< Some symbols.
+ "SYMBOLS2", ///< Some symbols.
+ "SYMBOLS3", ///< Some symbols.
+ "SYMBOLS4", ///< Some symbols.
+ "SYMBOLS5", ///< Some symbols.
+
+ "UNKNOWN" ///< The script is unknown.
};
/**
{
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "-->FontClient::Plugin::ValueToIndex value(%d)\n", value);
- if( ( NULL == table ) ||
- ( value <= table[0] ) )
+ if( NULL == table )
+ {
+ // Return an invalid index if there is no table.
+ return -1;
+ }
+
+ if( value <= table[0] )
{
return 0;
}
return maxIndex;
}
- for( unsigned int index = 0u; index < maxIndex; )
+ for( unsigned int index = 0u; index < maxIndex; ++index )
{
const int v1 = table[index];
- const unsigned int indexPlus = ++index;
+ const unsigned int indexPlus = index + 1u;
const int v2 = table[indexPlus];
if( ( v1 < value ) && ( value <= v2 ) )
{
- const int result = ( ( value - v1 ) < ( v2 - value ) ) ? index : indexPlus;
+ const int result = ( ( v1 > 0 ) && ( ( value - v1 ) < ( v2 - value ) ) ) ? index : indexPlus;
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "FontClient::Plugin::ValueToIndex result(%d)\n", result );
return result;
}
mPlugin->GetSystemFonts( systemFonts );
}
-FontId FontClient::FindDefaultFont( Character charcode, PointSize26Dot6 requestedPointSize, bool preferColor )
+FontId FontClient::FindDefaultFont( Character charcode,
+ PointSize26Dot6 requestedPointSize,
+ bool preferColor )
{
CreatePlugin();
- return mPlugin->FindDefaultFont( charcode, requestedPointSize, preferColor );
+ return mPlugin->FindDefaultFont( charcode,
+ requestedPointSize,
+ preferColor );
}
-FontId FontClient::FindFallbackFont( FontId preferredFont, Character charcode, PointSize26Dot6 requestedPointSize, bool preferColor )
+FontId FontClient::FindFallbackFont( Character charcode,
+ const FontDescription& preferredFontDescription,
+ PointSize26Dot6 requestedPointSize,
+ bool preferColor )
{
CreatePlugin();
- return mPlugin->FindFallbackFont( preferredFont, charcode, requestedPointSize, preferColor );
+ return mPlugin->FindFallbackFont( charcode,
+ preferredFontDescription,
+ requestedPointSize,
+ preferColor );
}
bool FontClient::IsScalable( const FontPath& path )
/**
* @copydoc Dali::FontClient::FindDefaultFont()
*/
- FontId FindDefaultFont( Character charcode, PointSize26Dot6 requestedPointSize, bool preferColor );
+ FontId FindDefaultFont( Character charcode,
+ PointSize26Dot6 requestedPointSize,
+ bool preferColor );
/**
* @copydoc Dali::FontClient::FindFallbackFont()
*/
- FontId FindFallbackFont( FontId preferredFont, Character charcode, PointSize26Dot6 requestedPointSize, bool preferColor );
+ FontId FindFallbackFont( Character charcode,
+ const FontDescription& preferredFontDescription,
+ PointSize26Dot6 requestedPointSize,
+ bool preferColor );
/**
* @copydoc Dali::FontClient::GetFontId( const FontPath& path, PointSize26Dot6 requestedPointSize, FaceIndex faceIndex )
// http://www.freedesktop.org/software/fontconfig/fontconfig-user.html
+// NONE -1 --> DEFAULT_FONT_WIDTH (NORMAL) will be used.
// ULTRA_CONDENSED 50
// EXTRA_CONDENSED 63
// CONDENSED 75
// EXPANDED 125
// EXTRA_EXPANDED 150
// ULTRA_EXPANDED 200
-const int FONT_WIDTH_TYPE_TO_INT[] = { 50, 63, 75, 87, 100, 113, 125, 150, 200 };
+const int FONT_WIDTH_TYPE_TO_INT[] = { -1, 50, 63, 75, 87, 100, 113, 125, 150, 200 };
const unsigned int NUM_FONT_WIDTH_TYPE = sizeof( FONT_WIDTH_TYPE_TO_INT ) / sizeof( int );
+// NONE -1 --> DEFAULT_FONT_WEIGHT (NORMAL) will be used.
// THIN 0
// ULTRA_LIGHT, EXTRA_LIGHT 40
// LIGHT 50
// BOLD 200
// ULTRA_BOLD, EXTRA_BOLD 205
// BLACK, HEAVY, EXTRA_BLACK 210
-const int FONT_WEIGHT_TYPE_TO_INT[] = { 0, 40, 50, 55, 75, 80, 100, 180, 200, 205, 210 };
+const int FONT_WEIGHT_TYPE_TO_INT[] = { -1, 0, 40, 50, 55, 75, 80, 100, 180, 200, 205, 210 };
const unsigned int NUM_FONT_WEIGHT_TYPE = sizeof( FONT_WEIGHT_TYPE_TO_INT ) / sizeof( int );
-// NORMAL, ROMAN 0
-// ITALIC 100
-// OBLIQUE 110
-const int FONT_SLANT_TYPE_TO_INT[] = { 0, 100, 110 };
+// NONE -1 --> DEFAULT_FONT_SLANT (NORMAL) will be used.
+// NORMAL, ROMAN 0
+// ITALIC 100
+// OBLIQUE 110
+const int FONT_SLANT_TYPE_TO_INT[] = { -1, 0, 100, 110 };
const unsigned int NUM_FONT_SLANT_TYPE = sizeof( FONT_SLANT_TYPE_TO_INT ) / sizeof( int );
} // namespace
{
}
-FontClient::Plugin::CacheItem::CacheItem( FT_Face ftFace,
- const FontPath& path,
- PointSize26Dot6 requestedPointSize,
- FaceIndex face,
- const FontMetrics& metrics )
+FontClient::Plugin::FontFaceCacheItem::FontFaceCacheItem( FT_Face ftFace,
+ const FontPath& path,
+ PointSize26Dot6 requestedPointSize,
+ FaceIndex face,
+ const FontMetrics& metrics )
: mFreeTypeFace( ftFace ),
mPath( path ),
mRequestedPointSize( requestedPointSize ),
{
}
-FontClient::Plugin::CacheItem::CacheItem( FT_Face ftFace,
- const FontPath& path,
- PointSize26Dot6 requestedPointSize,
- FaceIndex face,
- const FontMetrics& metrics,
- float fixedWidth,
- float fixedHeight )
+FontClient::Plugin::FontFaceCacheItem::FontFaceCacheItem( FT_Face ftFace,
+ const FontPath& path,
+ PointSize26Dot6 requestedPointSize,
+ FaceIndex face,
+ const FontMetrics& metrics,
+ float fixedWidth,
+ float fixedHeight )
: mFreeTypeFace( ftFace ),
mPath( path ),
mRequestedPointSize( requestedPointSize ),
{
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "FontClient::Plugin::FindFontForCharacter\n");
- FontId fontId(0);
- bool foundColor(false);
+ FontId fontId = 0u;
+ bool foundColor = false;
// Traverse the list of fonts.
- // Check for each default font if supports the character.
-
+ // Check for each font if supports the character.
for( FontList::const_iterator it = fontList.begin(), endIt = fontList.end();
it != endIt;
++it )
}
}
- // Keep going unless we prefer a different (color) font
+ // Keep going unless we prefer a different (color) font.
if( !preferColor || foundColor )
{
FcPatternDestroy( match );
fontDescription.width = IntToWidthType( DEFAULT_FONT_WIDTH );
fontDescription.weight = IntToWeightType( DEFAULT_FONT_WEIGHT );
fontDescription.slant = IntToSlantType( DEFAULT_FONT_SLANT );
+
SetFontList( fontDescription, mDefaultFonts );
}
return fontId;
}
-FontId FontClient::Plugin::FindFallbackFont( FontId preferredFont,
- Character charcode,
+FontId FontClient::Plugin::FindFallbackFont( Character charcode,
+ const FontDescription& preferredFontDescription,
PointSize26Dot6 requestedPointSize,
bool preferColor )
{
FontId fontId = 0u;
FontDescription fontDescription;
- GetDescription( preferredFont, fontDescription );
+
+ // Fill the font description with the preferred font description and complete with the defaults.
+ fontDescription.family = preferredFontDescription.family.empty() ? DEFAULT_FONT_FAMILY_NAME : preferredFontDescription.family;
+ fontDescription.weight = ( ( FontWeight::NONE == preferredFontDescription.weight ) ? IntToWeightType( DEFAULT_FONT_WEIGHT ) : preferredFontDescription.weight );
+ fontDescription.width = ( ( FontWidth::NONE == preferredFontDescription.width ) ? IntToWidthType( DEFAULT_FONT_WIDTH ) : preferredFontDescription.width );
+ fontDescription.slant = ( ( FontSlant::NONE == preferredFontDescription.slant ) ? IntToSlantType( DEFAULT_FONT_SLANT ) : preferredFontDescription.slant );
// Check first if the font's description has been queried before.
FontList* fontList( NULL );
SetFontList( fontDescription, *fontList );
// Add the font-list to the cache.
- mFallbackCache.push_back( FallbackCacheItem(fontDescription, fontList) );
+ mFallbackCache.push_back( FallbackCacheItem( fontDescription, fontList ) );
}
if( fontList )
if( ( fontId > 0 ) &&
( fontId - 1u < mFontCache.size() ) )
{
- const CacheItem& font = mFontCache[fontId-1];
+ const FontFaceCacheItem& font = mFontCache[fontId-1];
metrics = font.mMetrics;
if( fontId > 0 &&
fontId-1 < mFontCache.size() )
{
- const CacheItem& font = mFontCache[fontId-1];
+ const FontFaceCacheItem& font = mFontCache[fontId-1];
FT_Face ftFace = font.mFreeTypeFace;
if( fontId > 0 &&
fontId-1 < mFontCache.size() )
{
- CacheItem& font = mFontCache[fontId-1];
+ FontFaceCacheItem& font = mFontCache[fontId-1];
if( ! font.mVectorFontId )
{
if( fontId > 0 &&
fontId-1 < mFontCache.size() )
{
- CacheItem& font = mFontCache[fontId-1];
+ FontFaceCacheItem& font = mFontCache[fontId-1];
if( ! font.mVectorFontId )
{
fontDescription.width = IntToWidthType( width );
fontDescription.weight = IntToWeightType( weight );
fontDescription.slant = IntToSlantType( slant );
+
// destroyed the matched pattern
FcPatternDestroy( match );
ret = true;
// add a property to the pattern for the font family
FcPatternAddString( fontFamilyPattern, FC_FAMILY, reinterpret_cast<const FcChar8*>( fontDescription.family.c_str() ) );
- FcPatternAddInteger( fontFamilyPattern, FC_WIDTH, FONT_WIDTH_TYPE_TO_INT[fontDescription.width] );
- FcPatternAddInteger( fontFamilyPattern, FC_WEIGHT, FONT_WEIGHT_TYPE_TO_INT[fontDescription.weight] );
- FcPatternAddInteger( fontFamilyPattern, FC_SLANT, FONT_SLANT_TYPE_TO_INT[fontDescription.slant] );
+ int width = FONT_WIDTH_TYPE_TO_INT[fontDescription.width];
+ if( width < 0 )
+ {
+ // Use default.
+ width = DEFAULT_FONT_WIDTH;
+ }
+
+ int weight = FONT_WEIGHT_TYPE_TO_INT[fontDescription.weight];
+ if( weight < 0 )
+ {
+ // Use default.
+ weight = DEFAULT_FONT_WEIGHT;
+ }
+
+ int slant = FONT_SLANT_TYPE_TO_INT[fontDescription.slant];
+ if( slant < 0 )
+ {
+ // Use default.
+ slant = DEFAULT_FONT_SLANT;
+ }
+
+ FcPatternAddInteger( fontFamilyPattern, FC_WIDTH, width );
+ FcPatternAddInteger( fontFamilyPattern, FC_WEIGHT, weight );
+ FcPatternAddInteger( fontFamilyPattern, FC_SLANT, slant );
// Add a property of the pattern, to say we want to match TrueType fonts
FcPatternAddString( fontFamilyPattern , FC_FONTFORMAT, reinterpret_cast<const FcChar8*>( FONT_FORMAT.c_str() ) );
0.0f,
0.0f );
- mFontCache.push_back( CacheItem( ftFace, path, requestedPointSize, faceIndex, metrics, fixedWidth, fixedHeight ) );
+ mFontCache.push_back( FontFaceCacheItem( ftFace, path, requestedPointSize, faceIndex, metrics, fixedWidth, fixedHeight ) );
id = mFontCache.size();
if( cacheDescription )
static_cast< float >( ftFace->underline_position ) * FROM_266,
static_cast< float >( ftFace->underline_thickness ) * FROM_266 );
- mFontCache.push_back( CacheItem( ftFace, path, requestedPointSize, faceIndex, metrics ) );
+ mFontCache.push_back( FontFaceCacheItem( ftFace, path, requestedPointSize, faceIndex, metrics ) );
id = mFontCache.size();
if( cacheDescription )
FontId& fontId ) const
{
fontId = 0u;
- for( std::vector<CacheItem>::const_iterator it = mFontCache.begin(),
+ for( std::vector<FontFaceCacheItem>::const_iterator it = mFontCache.begin(),
endIt = mFontCache.end();
it != endIt;
++it, ++fontId )
{
- const CacheItem& cacheItem = *it;
+ const FontFaceCacheItem& cacheItem = *it;
if( cacheItem.mRequestedPointSize == requestedPointSize &&
cacheItem.mFaceIndex == faceIndex &&
FontDescription description;
description.path = path;
description.family = FontFamily( ftFace->family_name );
- description.weight = FontWeight::NORMAL;
- description.width = FontWidth::NORMAL;
- description.slant = FontSlant::NORMAL;
+ description.weight = FontWeight::NONE;
+ description.width = FontWidth::NONE;
+ description.slant = FontSlant::NONE;
// Note FreeType doesn't give too much info to build a proper font style.
if( ftFace->style_flags & FT_STYLE_FLAG_ITALIC )
FontDescriptionId validatedFontId; ///< Index to the vector with font descriptions.
PointSize26Dot6 requestedPointSize; ///< The font point size.
- FontId fontId; ///< The font id.
+ FontId fontId; ///< The font identifier.
};
/**
* @brief Caches the FreeType face and font metrics of the triplet 'path to the font file name, font point size and face index'.
*/
- struct CacheItem
+ struct FontFaceCacheItem
{
- CacheItem( FT_Face ftFace,
- const FontPath& path,
- PointSize26Dot6 requestedPointSize,
- FaceIndex face,
- const FontMetrics& metrics );
-
- CacheItem( FT_Face ftFace,
- const FontPath& path,
- PointSize26Dot6 requestedPointSize,
- FaceIndex face,
- const FontMetrics& metrics,
- float fixedWidth,
- float fixedHeight );
+ FontFaceCacheItem( FT_Face ftFace,
+ const FontPath& path,
+ PointSize26Dot6 requestedPointSize,
+ FaceIndex face,
+ const FontMetrics& metrics );
+
+ FontFaceCacheItem( FT_Face ftFace,
+ const FontPath& path,
+ PointSize26Dot6 requestedPointSize,
+ FaceIndex face,
+ const FontMetrics& metrics,
+ float fixedWidth,
+ float fixedHeight );
FT_Face mFreeTypeFace; ///< The FreeType face.
FontPath mPath; ///< The path to the font file name.
/**
* @copydoc Dali::FontClient::SetDefaultFont()
*/
- void SetDefaultFont( const FontDescription& fontDescription );
+ void SetDefaultFont( const FontDescription& preferredFontDescription );
/**
* @copydoc Dali::FontClient::GetDefaultPlatformFontDescription()
PointSize26Dot6 GetPointSize( FontId id );
/**
- * @copydoc Dali::FontClient::FindFontForCharacter()
+ * @brief Finds within the @p fontList a font which support the @p carcode.
+ *
+ * @param[in] fontList A list of font paths, family, width, weight and slant.
+ * @param[in] charcode The character for which a font is needed.
+ * @param[in] requestedPointSize The point size in 26.6 fractional points.
+ * @param[in] preferColor @e true if a color font is preferred.
+ *
+ * @return A valid font identifier, or zero if no font is found.
*/
FontId FindFontForCharacter( const FontList& fontList,
Character charcode,
/**
* @copydoc Dali::FontClient::FindDefaultFont()
*/
- FontId FindDefaultFont( Character charcode, PointSize26Dot6 requestedPointSize, bool preferColor );
+ FontId FindDefaultFont( Character charcode,
+ PointSize26Dot6 requestedPointSize,
+ bool preferColor );
/**
* @copydoc Dali::FontClient::FindFallbackFont()
*/
- FontId FindFallbackFont( FontId preferredFont, Character charcode, PointSize26Dot6 requestedPointSize, bool preferColor );
+ FontId FindFallbackFont( Character charcode,
+ const FontDescription& preferredFontDescription,
+ PointSize26Dot6 requestedPointSize,
+ bool preferColor );
/**
* @see Dali::FontClient::GetFontId( const FontPath& path, PointSize26Dot6 requestedPointSize, FaceIndex faceIndex )
bool cacheDescription = true );
/**
- * @copydoc Dali::FontClient::GetFontId( const FontDescription& fontDescription, PointSize26Dot6 requestedPointSize, FaceIndex faceIndex )
+ * @see Dali::FontClient::GetFontId( const FontDescription& preferredFontDescription, PointSize26Dot6 requestedPointSize, FaceIndex faceIndex )
+ *
+ * @param[in] actualPointSize The actual point size. In case of emojis the @p requestedPointSize is used to build the metrics and cache the font and the @p actualPointSize is used to load the glyph.
*/
FontId GetFontId( const FontDescription& fontDescription,
PointSize26Dot6 requestedPointSize,
* @param[in] faceIndex A face index.
* @param[in] cacheDescription Whether to cache the font description.
*
- * @return The font id.
+ * @return The font identifier.
*/
FontId CreateFont( const FontPath& path,
PointSize26Dot6 requestedPointSize,
/**
* @brief Finds in the cache if there is a triplet with the path to the font file name, the font point size and the face index.
- * If there is one , if writes the font id in the param @p fontId.
+ * If there is one , if writes the font identifier in the param @p fontId.
*
* @param[in] path Path to the font file name.
* @param[in] requestedPointSize The font point size.
* @param[in] faceIndex The face index.
- * @param[out] fontId The font id.
+ * @param[out] fontId The font identifier.
*
* @return @e true if there triplet is found.
*/
FontList*& fontList );
/**
- * @brief Finds in the cache a pair 'validated font id and font point size'.
- * If there is one it writes the font id in the param @p fontId.
+ * @brief Finds in the cache a pair 'validated font identifier and font point size'.
+ * If there is one it writes the font identifier in the param @p fontId.
*
* @param[in] validatedFontId Index to the vector with font descriptions.
* @param[in] requestedPointSize The font point size.
- * @param[out] fontId The font id.
+ * @param[out] fontId The font identifier.
*
* @return @e true if the pair is found.
*/
std::vector<FallbackCacheItem> mFallbackCache; ///< Cached fallback font lists.
- std::vector<CacheItem> mFontCache; ///< Caches the FreeType face and font metrics of the triplet 'path to the font file name, font point size and face index'.
+ std::vector<FontFaceCacheItem> mFontCache; ///< Caches the FreeType face and font metrics of the triplet 'path to the font file name, font point size and face index'.
std::vector<FontDescriptionCacheItem> mValidatedFontCache; ///< Caches indices to the vector of font descriptions for a given font.
FontList mFontDescriptionCache; ///< Caches font descriptions for the validated font.
- std::vector<FontIdCacheItem> mFontIdCache; ///< Caches font ids for the pairs of font point size and the index to the vector with font descriptions of the validated fonts.
+ std::vector<FontIdCacheItem> mFontIdCache; ///< Caches font identifiers for the pairs of font point size and the index to the vector with font descriptions of the validated fonts.
VectorFontCache* mVectorFontCache; ///< Separate cache for vector data blobs etc.
{
HB_SCRIPT_COMMON,
+ HB_SCRIPT_COMMON, // ASCII_DIGITS
+ HB_SCRIPT_COMMON, // ASCII_PS
+
+ HB_SCRIPT_COMMON, // C1_CONTROLS
+ HB_SCRIPT_COMMON, // C1_PS
+ HB_SCRIPT_COMMON, // C1_MATH
+ HB_SCRIPT_COMMON, // SML_P
+ HB_SCRIPT_COMMON, // PHONETIC_U
+ HB_SCRIPT_COMMON, // PHONETIC_SS
+ HB_SCRIPT_COMMON, // NUMERIC_SS
+ HB_SCRIPT_COMMON, // LETTER_LIKE
+ HB_SCRIPT_COMMON, // NUMBER_FORMS
+ HB_SCRIPT_COMMON, // FRACTIONS_NF
+ HB_SCRIPT_COMMON, // NON_LATIN_LED
+ HB_SCRIPT_COMMON, // HWFW_S
+
HB_SCRIPT_CYRILLIC,
HB_SCRIPT_GREEK,
HB_SCRIPT_LATIN,
HB_SCRIPT_KHMER,
HB_SCRIPT_UNKNOWN, // EMOJI
+ HB_SCRIPT_UNKNOWN, // SYMBOLS1
+ HB_SCRIPT_UNKNOWN, // SYMBOLS2
+ HB_SCRIPT_UNKNOWN, // SYMBOLS3
+ HB_SCRIPT_UNKNOWN, // SYMBOLS4
+ HB_SCRIPT_UNKNOWN, // SYMBOLS5
HB_SCRIPT_UNKNOWN
};