uint64_t timeToSleepUntil = 0;
int extraFramesDropped = 0;
+ const unsigned int renderToFboInterval = mEnvironmentOptions.GetRenderToFboInterval();
+ const bool renderToFboEnabled = 0u != renderToFboInterval;
+ unsigned int frameCount = 0u;
+
while( UpdateRenderReady( useElapsedTime, updateRequired, timeToSleepUntil ) )
{
LOG_UPDATE_RENDER_TRACE;
// RESIZE SURFACE
//////////////////////////////
+ const bool isRenderingToFbo = renderToFboEnabled && ( ( 0u == frameCount ) || ( 0u != frameCount % renderToFboInterval ) );
+ ++frameCount;
+
// The resizing will be applied in the next loop
bool surfaceResized = ShouldSurfaceBeResized();
if( DALI_UNLIKELY( surfaceResized ) )
Integration::UpdateStatus updateStatus;
AddPerformanceMarker( PerformanceInterface::UPDATE_START );
- mCore.Update( frameDelta, currentTime, nextFrameTime, updateStatus );
+ mCore.Update( frameDelta,
+ currentTime,
+ nextFrameTime,
+ updateStatus,
+ renderToFboEnabled,
+ isRenderingToFbo );
AddPerformanceMarker( PerformanceInterface::UPDATE_END );
unsigned int keepUpdatingStatus = updateStatus.KeepUpdating();
if( renderStatus.NeedsPostRender() )
{
- mRenderHelper.PostRender();
+ mRenderHelper.PostRender( isRenderingToFbo );
}
// Trigger event thread to request Update/Render thread to sleep if update not required
}
}
- // Sleep until at least the the default frame duration has elapsed. This will return immediately if the specified end-time has already passed.
- TimeService::SleepUntil( timeToSleepUntil );
+ // Render to FBO is intended to measure fps above 60 so sleep is not wanted.
+ if( 0u == renderToFboInterval )
+ {
+ // Sleep until at least the the default frame duration has elapsed. This will return immediately if the specified end-time has already passed.
+ TimeService::SleepUntil( timeToSleepUntil );
+ }
}
// Inform core of context destruction & shutdown EGL
namespace
{
const unsigned int DEFAULT_STATISTICS_LOG_FREQUENCY = 2;
+const int DEFAULT_MULTI_SAMPLING_LEVEL = -1;
unsigned int GetIntegerEnvironmentVariable( const char* variable, unsigned int defaultValue )
{
mPanMinimumDistance(-1),
mPanMinimumEvents(-1),
mGlesCallTime( 0 ),
- mWindowWidth( 0 ),
- mWindowHeight( 0 ),
+ mWindowWidth( 0u ),
+ mWindowHeight( 0u ),
mThreadingMode( ThreadingMode::COMBINED_UPDATE_RENDER ),
- mRenderRefreshRate( 1 ),
+ mRenderRefreshRate( 1u ),
mGlesCallAccumulate( false ),
- mMultiSamplingLevel( 0 ),
+ mMultiSamplingLevel( DEFAULT_MULTI_SAMPLING_LEVEL ),
mMaxTextureSize( 0 ),
+ mIndicatorVisibleMode( -1 ),
+ mRenderToFboInterval( 0u ),
mLogFunction( NULL )
{
ParseEnvironmentOptions();
return mRenderRefreshRate;
}
-unsigned int EnvironmentOptions::GetMultiSamplingLevel() const
+int EnvironmentOptions::GetMultiSamplingLevel() const
{
return mMultiSamplingLevel;
}
return mMaxTextureSize;
}
+int EnvironmentOptions::GetIndicatorVisibleMode() const
+{
+ return mIndicatorVisibleMode;
+}
+
+unsigned int EnvironmentOptions::GetRenderToFboInterval() const
+{
+ return mRenderToFboInterval;
+}
+
bool EnvironmentOptions::PerformanceServerRequired() const
{
return ( ( GetPerformanceStatsLoggingOptions() > 0) ||
int multiSamplingLevel( 0 );
if( GetIntegerEnvironmentVariable( DALI_ENV_MULTI_SAMPLING_LEVEL, multiSamplingLevel ) )
{
- if( multiSamplingLevel > 0 )
- {
- mMultiSamplingLevel = multiSamplingLevel;
- }
+ mMultiSamplingLevel = multiSamplingLevel;
}
int maxTextureSize( 0 );
mMaxTextureSize = maxTextureSize;
}
}
+
+ int indicatorVisibleMode( -1 );
+ if( GetIntegerEnvironmentVariable( DALI_ENV_INDICATOR_VISIBLE_MODE, indicatorVisibleMode ) )
+ {
+ if( indicatorVisibleMode > -1 )
+ {
+ mIndicatorVisibleMode = indicatorVisibleMode;
+ }
+ }
+
+ mRenderToFboInterval = GetIntegerEnvironmentVariable( DALI_RENDER_TO_FBO, 0u );
}
} // Adaptor
-#ifndef __DALI_INTERNAL_ADAPTOR_ENVIRONMENT_OPTIONS_H__
-#define __DALI_INTERNAL_ADAPTOR_ENVIRONMENT_OPTIONS_H__
+#ifndef DALI_INTERNAL_ADAPTOR_ENVIRONMENT_OPTIONS_H
+#define DALI_INTERNAL_ADAPTOR_ENVIRONMENT_OPTIONS_H
/*
* Copyright (c) 2017 Samsung Electronics Co., Ltd.
*/
class EnvironmentOptions
{
-
public:
/**
/**
* @return The number of samples required in multisample buffers
*/
- unsigned int GetMultiSamplingLevel() const;
+ int GetMultiSamplingLevel() const;
/**
* @return The maximum texture size
*/
unsigned int GetMaxTextureSize() const;
+ /**
+ * @return The maximum texture size
+ */
+ int GetIndicatorVisibleMode() const;
+
+ /**
+ * @brief Retrieves the interval of frames to be rendered into the Frame Buffer Object and the Frame Buffer.
+ *
+ * @return The number of frames that are going to be rendered into the Frame Buffer Object but the last one which is going to be rendered into the Frame Buffer.
+ */
+ unsigned int GetRenderToFboInterval() const;
+
private: // Internal
/**
ThreadingMode::Type mThreadingMode; ///< threading mode
unsigned int mRenderRefreshRate; ///< render refresh rate
bool mGlesCallAccumulate; ///< Whether or not to accumulate gles call statistics
- unsigned int mMultiSamplingLevel; ///< The number of samples required in multisample buffers
+ int mMultiSamplingLevel; ///< The number of samples required in multisample buffers
unsigned int mMaxTextureSize; ///< The maximum texture size that GL can handle
+ int mIndicatorVisibleMode; ///< Indicator visible mode
+ unsigned int mRenderToFboInterval; ///< The number of frames that are going to be rendered into the Frame Buffer Object but the last one which is going to be rendered into the Frame Buffer.
Dali::Integration::Log::LogFunction mLogFunction;
} // Internal
} // Dali
-#endif // __DALI_INTERNAL_ADAPTOR_ENVIRONMENT_OPTIONS_H__
+#endif // DALI_INTERNAL_ADAPTOR_ENVIRONMENT_OPTIONS_H
-#ifndef __DALI_INTERNAL_ADAPTOR_ENVIRONMENT_VARIABLES_H__
-#define __DALI_INTERNAL_ADAPTOR_ENVIRONMENT_VARIABLES_H__
+#ifndef DALI_INTERNAL_ADAPTOR_ENVIRONMENT_VARIABLES_H
+#define DALI_INTERNAL_ADAPTOR_ENVIRONMENT_VARIABLES_H
/*
* Copyright (c) 2017 Samsung Electronics Co., Ltd.
#define DALI_ENV_MAX_TEXTURE_SIZE "DALI_MAX_TEXTURE_SIZE"
+#define DALI_ENV_INDICATOR_VISIBLE_MODE "DALI_INDICATOR_VISIBLE_MODE"
+
+#define DALI_RENDER_TO_FBO "DALI_RENDER_TO_FBO"
+
} // namespace Adaptor
} // namespace Internal
} // namespace Dali
-#endif // __DALI_INTERNAL_ADAPTOR_ENVIRONMENT_VARIABLES_H__
+#endif // DALI_INTERNAL_ADAPTOR_ENVIRONMENT_VARIABLES_H
return true;
}
-void RenderHelper::PostRender()
+void RenderHelper::PostRender( bool renderToFbo )
{
// Inform the gl implementation that rendering has finished before informing the surface
mGLES.PostRender();
- if( mSurface )
+ if( renderToFbo )
+ {
+ mGLES.Flush();
+ mGLES.Finish();
+ }
+ else
{
- // Inform the surface that rendering this frame has finished.
- mSurface->PostRender( *mEGL, mGLES, mDisplayConnection, mSurfaceReplaced, mSurfaceResized );
+ if( mSurface )
+ {
+ // Inform the surface that rendering this frame has finished.
+ mSurface->PostRender( *mEGL, mGLES, mDisplayConnection, mSurfaceReplaced, mSurfaceResized );
+ }
}
mSurfaceReplaced = false;
mSurfaceResized = false;
-#ifndef __DALI_INTERNAL_RENDER_HELPER_H__
-#define __DALI_INTERNAL_RENDER_HELPER_H__
+#ifndef DALI_INTERNAL_RENDER_HELPER_H
+#define DALI_INTERNAL_RENDER_HELPER_H
/*
* Copyright (c) 2017 Samsung Electronics Co., Ltd.
* Called after core has rendered the scene
*
* @note Called from render thread
+ *
+ * @param[in] renderToFbo Whether to render to a Frame Buffer Object.
*/
- void PostRender();
+ void PostRender( bool renderToFbo );
private:
} // namespace Dali
-#endif // __DALI_INTERNAL_RENDER_HELPER_H__
+#endif // DALI_INTERNAL_RENDER_HELPER_H
EglSyncImplementation* eglSyncImpl = mEglFactory->GetSyncImplementation();
- mCore = Integration::Core::New( *this, *mPlatformAbstraction, *mGLES, *eglSyncImpl, *mGestureManager, dataRetentionPolicy );
+ mCore = Integration::Core::New( *this,
+ *mPlatformAbstraction,
+ *mGLES,
+ *eglSyncImpl,
+ *mGestureManager,
+ dataRetentionPolicy ,
+ 0u != mEnvironmentOptions->GetRenderToFboInterval() );
const unsigned int timeInterval = mEnvironmentOptions->GetObjectProfilerInterval();
if( 0u < timeInterval )
// Initialize the thread controller
mThreadController->Initialize();
- mState = RUNNING;
-
ProcessCoreEvents(); // Ensure any startup messages are processed.
for ( ObserverContainer::iterator iter = mObservers.begin(), endIter = mObservers.end(); iter != endIter; ++iter )
}
mThreadController->Pause();
- mCore->Suspend();
mState = PAUSED;
}
}
(*iter)->OnResume();
}
- // Resume core so it processes any requests as well
- mCore->Resume();
+ // trigger processing of events queued up while paused
+ mCore->ProcessEvents();
// Do at end to ensure our first update/render after resumption includes the processed messages as well
mThreadController->Resume();
}
mThreadController->Stop();
- mCore->Suspend();
// Delete the TTS player
for(int i =0; i < Dali::TtsPlayer::MODE_NUM; i++)
return mTtsPlayers[mode];
}
-bool Adaptor::AddIdle( CallbackBase* callback )
+bool Adaptor::AddIdle( CallbackBase* callback, bool forceAdd )
{
bool idleAdded(false);
// Only add an idle if the Adaptor is actually running
- if( RUNNING == mState )
+ if( RUNNING == mState || forceAdd )
{
idleAdded = mCallbackManager->AddIdleCallback( callback );
}
}
}
-void Adaptor::RequestUpdate()
+void Adaptor::RequestUpdate( bool forceUpdate )
{
- // When Dali applications are partially visible behind the lock-screen,
- // the indicator must be updated (therefore allow updates in the PAUSED state)
- if ( PAUSED == mState ||
- RUNNING == mState )
+ switch( mState )
{
- mThreadController->RequestUpdate();
+ case RUNNING:
+ {
+ mThreadController->RequestUpdate();
+ break;
+ }
+ case PAUSED:
+ case PAUSED_WHILE_HIDDEN:
+ {
+ // When Dali applications are partially visible behind the lock-screen,
+ // the indicator must be updated (therefore allow updates in the PAUSED state)
+ if( forceUpdate )
+ {
+ mThreadController->RequestUpdateOnce();
+ }
+ break;
+ }
+ default:
+ {
+ // Do nothing
+ break;
+ }
}
}
-void Adaptor::RequestProcessEventsOnIdle()
+void Adaptor::RequestProcessEventsOnIdle( bool forceProcess )
{
// Only request a notification if the Adaptor is actually running
// and we haven't installed the idle notification
- if( ( ! mNotificationOnIdleInstalled ) && ( RUNNING == mState ) )
+ if( ( ! mNotificationOnIdleInstalled ) && ( RUNNING == mState || forceProcess ) )
{
- mNotificationOnIdleInstalled = AddIdle( MakeCallback( this, &Adaptor::ProcessCoreEventsFromIdle ) );
+ mNotificationOnIdleInstalled = AddIdle( MakeCallback( this, &Adaptor::ProcessCoreEventsFromIdle ), forceProcess );
}
}
void Adaptor::OnWindowHidden()
{
- if ( STOPPED != mState )
+ if ( RUNNING == mState )
{
Pause();
void Adaptor::OnDamaged( const DamageArea& area )
{
// This is needed for the case where Dali window is partially obscured
- RequestUpdate();
+ RequestUpdate( false );
}
-void Adaptor::SurfaceResizePrepare( Dali::Adaptor::SurfaceSize surfaceSize )
+void Adaptor::SurfaceResizePrepare( SurfaceSize surfaceSize )
{
// let the core know the surface size has changed
mCore->SurfaceResized( surfaceSize.GetWidth(), surfaceSize.GetHeight() );
mResizedSignal.Emit( mAdaptor );
}
-void Adaptor::SurfaceResizeComplete( Dali::Adaptor::SurfaceSize surfaceSize )
+void Adaptor::SurfaceResizeComplete( SurfaceSize surfaceSize )
{
// flush the event queue to give the update-render thread chance
// to start processing messages for new camera setup etc as soon as possible
// process after surface is created (registering to remote surface provider if required)
SurfaceInitialized();
+
+ mState = RUNNING;
}
void Adaptor::NotifyLanguageChanged()
void Adaptor::RequestUpdateOnce()
{
- if( PAUSED_WHILE_HIDDEN != mState )
+ if( mThreadController )
{
- if( mThreadController )
- {
- mThreadController->RequestUpdateOnce();
- }
+ mThreadController->RequestUpdateOnce();
}
}
{
Dali::Stage stage = Dali::Stage::GetCurrent();
- stage.GetRootLayer().SetProperty( DevelActor::Property::LAYOUT_DIRECTION,
- static_cast< DevelActor::LayoutDirection::Type >( Internal::Adaptor::Locale::GetDirection( std::string( locale ) ) ) );
+ stage.GetRootLayer().SetProperty( Dali::Actor::Property::LAYOUT_DIRECTION,
+ static_cast< LayoutDirection::Type >( Internal::Adaptor::Locale::GetDirection( std::string( locale ) ) ) );
}
} // namespace Adaptor
#include <dali/public-api/common/view-mode.h>
#include <dali/public-api/math/rect.h>
#include <dali/public-api/signals/callback.h>
+#include <dali/public-api/math/uint-16-pair.h>
#include <dali/integration-api/render-controller.h>
// INTERNAL INCLUDES
typedef Dali::Adaptor::AdaptorSignalType AdaptorSignalType;
+ typedef Uint16Pair SurfaceSize; ///< Surface size type
+
/**
* Creates a New Adaptor
* @param[in] nativeWindow Native window handle
/**
* @copydoc Dali::Adaptor::AddIdle()
*/
- virtual bool AddIdle( CallbackBase* callback );
+ virtual bool AddIdle( CallbackBase* callback, bool forceAdd );
/**
* @copydoc Dali::Adaptor::RemoveIdle()
/**
* Informs core the surface size has changed
*/
- void SurfaceResizePrepare( Dali::Adaptor::SurfaceSize surfaceSize );
+ void SurfaceResizePrepare( SurfaceSize surfaceSize );
/**
* Informs ThreadController the surface size has changed
*/
- void SurfaceResizeComplete( Dali::Adaptor::SurfaceSize surfaceSize );
+ void SurfaceResizeComplete( SurfaceSize surfaceSize );
/**
* Sets layout direction of root by system language
private: // From Dali::Integration::RenderController
/**
- * Called by the Dali core when it requires another update
+ * @copydoc Dali::Integration::RenderController::RequestUpdate()
*/
- virtual void RequestUpdate();
+ virtual void RequestUpdate( bool forceUpdate );
/**
- * Called by Dali core when it requires an notification event being sent on idle.
- * Multi-threading note: this method must be called from the main thread only.
+ * @copydoc Dali::Integration::RenderController::RequestProcessEventsOnIdle()
*/
- virtual void RequestProcessEventsOnIdle();
+ virtual void RequestProcessEventsOnIdle( bool forceProcess );
private: // From Dali::Internal::Adaptor::WindowVisibilityObserver
Any mNativeWindow; ///< window identifier
RenderSurface* mSurface; ///< Current surface
- TizenPlatform::TizenPlatformAbstraction* mPlatformAbstraction; ///< Platform abstraction
+ TizenPlatform::TizenPlatformAbstraction* mPlatformAbstraction; ///< Platform abstraction
EventHandler* mEventHandler; ///< event handler
CallbackManager* mCallbackManager; ///< Used to install callbacks
bool Adaptor::AddIdle( CallbackBase* callback )
{
- return mImpl->AddIdle( callback );
+ return mImpl->AddIdle( callback, false );
}
void Adaptor::RemoveIdle( CallbackBase* callback )
const std::string& windowClassName = mEnvironmentOptions.GetWindowClassName();
mWindow = Dali::Window::New( mWindowPositionSize, mName, windowClassName, mWindowMode == Dali::Application::TRANSPARENT );
+ int indicatorVisibleMode = mEnvironmentOptions.GetIndicatorVisibleMode();
+ if( indicatorVisibleMode >= Dali::Window::INVISIBLE && indicatorVisibleMode <= Dali::Window::AUTO )
+ {
+ GetImplementation( mWindow ).SetIndicatorVisibleMode( static_cast< Dali::Window::IndicatorVisibleMode >( indicatorVisibleMode ) );
+ }
+
// Quit the application when the window is closed
GetImplementation( mWindow ).DeleteRequestSignal().Connect( mSlotDelegate, &Application::Quit );
}
mRegionChangedSignal.Emit( application );
}
-void Application::OnBatteryLow()
+void Application::OnBatteryLow( Dali::DeviceStatus::Battery::Status status )
{
Dali::Application application(this);
mBatteryLowSignal.Emit( application );
+
+ mLowBatterySignal.Emit( status );
}
-void Application::OnMemoryLow()
+void Application::OnMemoryLow( Dali::DeviceStatus::Memory::Status status )
{
Dali::Application application(this);
mMemoryLowSignal.Emit( application );
-}
+ mLowMemorySignal.Emit( status );
+}
void Application::OnResize(Dali::Adaptor& adaptor)
{
Dali::Application application(this);
return mAdaptor->AddIdle( callback );
}
+std::string Application::GetRegion() const
+{
+ return mFramework->GetRegion();
+}
+
+std::string Application::GetLanguage() const
+{
+ return mFramework->GetLanguage();
+}
+
Dali::Adaptor& Application::GetAdaptor()
{
return *mAdaptor;
Dali::Window newWindow = Dali::Window::New( positionSize, name, mWindowMode == Dali::Application::TRANSPARENT );
Window& windowImpl = GetImplementation(newWindow);
windowImpl.SetAdaptor(*mAdaptor);
- newWindow.ShowIndicator(Dali::Window::INVISIBLE);
+
+ int indicatorVisibleMode = mEnvironmentOptions.GetIndicatorVisibleMode();
+ if( indicatorVisibleMode >= Dali::Window::INVISIBLE && indicatorVisibleMode <= Dali::Window::AUTO )
+ {
+ GetImplementation( newWindow ).SetIndicatorVisibleMode( static_cast< Dali::Window::IndicatorVisibleMode >( indicatorVisibleMode ) );
+ }
+
Dali::RenderSurface* renderSurface = windowImpl.GetSurface();
Any nativeWindow = newWindow.GetNativeHandle();
{
public:
+ typedef Dali::Application::LowBatterySignalType LowBatterySignalType;
+ typedef Dali::Application::LowMemorySignalType LowMemorySignalType;
typedef Dali::Application::AppSignalType AppSignalType;
typedef Dali::Application::AppControlSignalType AppControlSignalType;
typedef Dali::Application::WINDOW_MODE WINDOW_MODE;
Dali::Window GetWindow();
/**
+ * @copydoc Dali::Application::GetRegion();
+ */
+ std::string GetRegion() const;
+
+ /**
+ * @copydoc Dali::Application::GetLanguage();
+ */
+ std::string GetLanguage() const;
+
+ /**
* @copydoc Dali::Application::ReplaceWindow();
*/
void ReplaceWindow( const PositionSize& positionSize, const std::string& name);
/**
* Called when the framework informs the application that the battery level of the device is low.
*/
- virtual void OnBatteryLow();
+ virtual void OnBatteryLow( Dali::DeviceStatus::Battery::Status status );
/**
* Called when the framework informs the application that the memory level of the device is low.
*/
- virtual void OnMemoryLow();
+ virtual void OnMemoryLow( Dali::DeviceStatus::Memory::Status status );
public:
*/
Dali::Application::AppSignalType& MemoryLowSignal() { return mMemoryLowSignal; }
+ /**
+ * @copydoc Dali::Application::LowBatterySignal()
+ */
+ Dali::Application::LowBatterySignalType& LowBatterySignal() { return mLowBatterySignal; }
+
+ /**
+ * @copydoc Dali::Application:::LowMemorySignal()
+ */
+ Dali::Application::LowMemorySignalType& LowMemorySignal() { return mLowMemorySignal; }
+
protected:
/**
private:
- AppSignalType mInitSignal;
- AppSignalType mTerminateSignal;
- AppSignalType mPauseSignal;
- AppSignalType mResumeSignal;
- AppSignalType mResetSignal;
- AppSignalType mResizeSignal;
- AppControlSignalType mAppControlSignal;
- AppSignalType mLanguageChangedSignal;
- AppSignalType mRegionChangedSignal;
- AppSignalType mBatteryLowSignal;
- AppSignalType mMemoryLowSignal;
+ AppSignalType mInitSignal;
+ AppSignalType mTerminateSignal;
+ AppSignalType mPauseSignal;
+ AppSignalType mResumeSignal;
+ AppSignalType mResetSignal;
+ AppSignalType mResizeSignal;
+ AppControlSignalType mAppControlSignal;
+ AppSignalType mLanguageChangedSignal;
+ AppSignalType mRegionChangedSignal;
+ AppSignalType mBatteryLowSignal;
+ AppSignalType mMemoryLowSignal;
+ LowBatterySignalType mLowBatterySignal;
+ LowMemorySignalType mLowMemorySignal;
EventLoop* mEventLoop;
Framework* mFramework;
// CLASS HEADER
#include "timer-impl.h"
+// INTERNAL INCLUDES
+#include <adaptor-impl.h>
+
// EXTERNAL INCLUDES
+#include <dali/public-api/common/dali-common.h>
+
// Ecore is littered with C style cast
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wold-style-cast"
Timer::~Timer()
{
- // stop timers
- Stop();
-
+ ResetTimerData();
delete mImpl;
}
void Timer::Start()
{
+ // Timer should be used in the event thread
+ DALI_ASSERT_DEBUG( Adaptor::IsAvailable() );
+
if(mImpl->mId != NULL)
{
Stop();
void Timer::Stop()
{
- if (mImpl->mId != NULL)
- {
- ecore_timer_del(mImpl->mId);
- mImpl->mId = NULL;
- }
+ // Timer should be used in the event thread
+ DALI_ASSERT_DEBUG( Adaptor::IsAvailable() );
+
+ ResetTimerData();
}
void Timer::SetInterval( unsigned int interval )
return mTickSignal;
}
+void Timer::ResetTimerData()
+{
+ if (mImpl->mId != NULL)
+ {
+ ecore_timer_del(mImpl->mId);
+ mImpl->mId = NULL;
+ }
+}
+
bool Timer::IsRunning() const
{
return mImpl->mId != NULL;
// INTERNAL INCLUDES
#include <abort-handler.h>
+#include <device-status.h>
namespace Dali
{
class Framework
{
public:
+
enum Type
{
NORMAL, ///< normal appFramework
/**
* Invoked when the battery level of the device is low.
*/
- virtual void OnBatteryLow() {}
+ virtual void OnBatteryLow( Dali::DeviceStatus::Battery::Status status ) {}
/**
* Invoked when the memory level of the device is low.
*/
- virtual void OnMemoryLow() {}
+ virtual void OnMemoryLow( Dali::DeviceStatus::Memory::Status status ) {}
};
public:
*/
static std::string GetResourcePath();
+ /**
+ * Sets system language.
+ */
+ void SetLanguage( const std::string& language );
+
+ /**
+ * Sets system region.
+ */
+ void SetRegion( const std::string& region );
+
+ /**
+ * Gets system language.
+ */
+ std::string GetLanguage() const;
+
+ /**
+ * Gets system region.
+ */
+ std::string GetRegion() const;
+
private:
// Undefined
namespace Adaptor
{
-EglFactory::EglFactory( unsigned int multiSamplingLevel )
+EglFactory::EglFactory( int multiSamplingLevel )
: mEglImplementation(NULL),
mEglImageExtensions(NULL),
mEglSync(new EglSyncImplementation), // Created early, as needed by Core constructor
- mMultiSamplingLevel( 4 )
+ mMultiSamplingLevel( multiSamplingLevel )
{
- if( multiSamplingLevel > 0 )
- {
- mMultiSamplingLevel = multiSamplingLevel;
- }
}
EglFactory::~EglFactory()
/**
* Constructor
*/
- EglFactory( unsigned int multiSamplingLevel );
+ EglFactory( int multiSamplingLevel );
/**
* Destructor
EglImageExtensions* mEglImageExtensions;
EglSyncImplementation* mEglSync;
- unsigned int mMultiSamplingLevel;
+ int mMultiSamplingLevel;
};
}
} \
}
-EglImplementation::EglImplementation( unsigned int multiSamplingLevel )
+EglImplementation::EglImplementation( int multiSamplingLevel )
: mEglNativeDisplay(0),
mEglNativeWindow(0),
mCurrentEglNativePixmap(0),
configAttribs.PushBack( EGL_STENCIL_SIZE );
configAttribs.PushBack( 8 );
#ifndef DALI_PROFILE_UBUNTU
- configAttribs.PushBack( EGL_SAMPLES );
- configAttribs.PushBack( mMultiSamplingLevel );
- configAttribs.PushBack( EGL_SAMPLE_BUFFERS );
- configAttribs.PushBack( 1 );
+ if( mMultiSamplingLevel != EGL_DONT_CARE )
+ {
+ configAttribs.PushBack( EGL_SAMPLES );
+ configAttribs.PushBack( mMultiSamplingLevel );
+ configAttribs.PushBack( EGL_SAMPLE_BUFFERS );
+ configAttribs.PushBack( 1 );
+ }
#endif // DALI_PROFILE_UBUNTU
configAttribs.PushBack( EGL_NONE );
* Constructor
* @param environmentOptions To check the envirionment options
*/
- EglImplementation( unsigned int multiSamplingLevel );
+ EglImplementation( int multiSamplingLevel );
/**
* Destructor
bool mIsWindow;
ColorDepth mColorDepth;
- unsigned int mMultiSamplingLevel;
+ int mMultiSamplingLevel;
};
} // namespace Adaptor
#define __DALI_INTERNAL_GL_IMPLEMENTATION_H__
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
void InvalidateFramebuffer(GLenum target, GLsizei numAttachments, const GLenum* attachments)
{
#if DALI_GLES_VERSION >= 30
- // if OpenGL ES 2.0 compatibility is need this can be implemented with
- // glDiscardFramebufferEXT
glInvalidateFramebuffer(target,numAttachments,attachments);
+#else
+ mGlExtensions.DiscardFrameBuffer(target, numAttachments, attachments);
#endif // DALI_GLES_VERSION >= 30
}
// INTERNAL INCLUDES
#include "pixel-manipulation.h"
#include "alpha-mask.h"
+#include "gaussian-blur.h"
#include <platform-abstractions/portable/image-operations.h>
namespace Dali
return outBuffer;
}
+void PixelBuffer::ApplyGaussianBlur( const float blurRadius )
+{
+ // This method only works for pixel buffer in RGBA format.
+ if( mWidth > 0 && mHeight > 0 && mPixelFormat == Pixel::RGBA8888 )
+ {
+ if ( blurRadius > Math::MACHINE_EPSILON_1 )
+ {
+ PerformGaussianBlurRGBA( *this, blurRadius );
+ }
+ }
+ else
+ {
+ DALI_LOG_ERROR( "Trying to apply gaussian blur to an empty pixel buffer or a pixel buffer not in RGBA format" );
+ }
+}
+
}// namespace Adaptor
}// namespace Internal
}// namespace Dali
*/
void ApplyMask( const PixelBuffer& mask, float contentScale, bool cropToMask );
+ /**
+ * Apply a Gaussian blur to the current buffer with the given radius.
+ *
+ * @param[in] blurRadius The radius for Gaussian blur
+ */
+ void ApplyGaussianBlur( const float blurRadius );
+
private:
/*
* Undefined copy constructor.
#define __DALI_INTERNAL_TIMER_H__
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
Timer( const Timer& );
Timer& operator=( const Timer& );
+ /**
+ * Resets any stored timer data.
+ */
+ void ResetTimerData();
+
private: // Data
Dali::Timer::TimerSignalType mTickSignal;
return mPlugin->GetUrl();
}
- return std::string( NULL );
+ return std::string();
}
void VideoPlayer::SetLooping(bool looping)
}
}
+bool VideoPlayer::IsVideoTextureSupported() const
+{
+ if( mPlugin != NULL )
+ {
+ return mPlugin->IsVideoTextureSupported();
+ }
+
+ return false;
+}
+
} // namespace Adaptor;
} // namespace Internal;
} // namespace Dali;
*/
void Backward( int millisecond );
+ /**
+ * @brief Dali::VideoPlayer::IsVideoTextureSupported()
+ */
+ bool IsVideoTextureSupported() const;
+
private:
/**
#define __DALI_INTERNAL_VIRTUAL_KEYBOARD_H__
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
/**
* @copydox Dali::VirtualKeyboard::ResizedSignal()
*/
-Dali::VirtualKeyboard::VoidSignalType& ResizedSignal();
+Dali::VirtualKeyboard::KeyboardResizedSignalType& ResizedSignal();
/**
* @copydox Dali::VirtualKeyboard::LanguageChangedSignal()
*/
-Dali::VirtualKeyboard::VoidSignalType& LanguageChangedSignal();
+Dali::VirtualKeyboard::LanguageChangedSignalType& LanguageChangedSignal();
/**
* @copydoc Dali::VirtualKeyboard::GetTextDirection
#include <orientation.h>
#include <render-surface.h>
#include <drag-and-drop-detector.h>
-#include <window-devel.h>
namespace Dali
{
{
public:
typedef Dali::Window::IndicatorSignalType IndicatorSignalType;
- typedef Dali::DevelWindow::FocusSignalType FocusSignalType;
- typedef Dali::DevelWindow::ResizedSignalType ResizedSignalType;
+ typedef Dali::Window::FocusSignalType FocusSignalType;
+ typedef Dali::Window::ResizedSignalType ResizedSignalType;
typedef Signal< void () > SignalType;
/**
Dali::Any GetNativeHandle() const;
/**
- * @copydoc Dali::DevelWindow::SetAcceptFocus()
+ * @copydoc Dali::Window::SetAcceptFocus()
*/
void SetAcceptFocus( bool accept );
/**
- * @copydoc Dali::DevelWindow::IsFocusAcceptable()
+ * @copydoc Dali::Window::IsFocusAcceptable()
*/
- bool IsFocusAcceptable();
+ bool IsFocusAcceptable() const;
/**
- * @copydoc Dali::DevelWindow::Show()
+ * @copydoc Dali::Window::Show()
*/
void Show();
/**
- * @copydoc Dali::DevelWindow::Hide()
+ * @copydoc Dali::Window::Hide()
*/
void Hide();
/**
- * @copydoc Dali::DevelWindow::IsVisible() const
+ * @copydoc Dali::Window::IsVisible() const
*/
bool IsVisible() const;
/**
- * @copydoc Dali::DevelWindow::GetSupportedAuxiliaryHintCount()
+ * @copydoc Dali::Window::GetSupportedAuxiliaryHintCount()
*/
- unsigned int GetSupportedAuxiliaryHintCount();
+ unsigned int GetSupportedAuxiliaryHintCount() const;
/**
- * @copydoc Dali::DevelWindow::GetSupportedAuxiliaryHint()
+ * @copydoc Dali::Window::GetSupportedAuxiliaryHint()
*/
- std::string GetSupportedAuxiliaryHint( unsigned int index );
+ std::string GetSupportedAuxiliaryHint( unsigned int index ) const;
/**
- * @copydoc Dali::DevelWindow::AddAuxiliaryHint()
+ * @copydoc Dali::Window::AddAuxiliaryHint()
*/
unsigned int AddAuxiliaryHint( const std::string& hint, const std::string& value );
/**
- * @copydoc Dali::DevelWindow::RemoveAuxiliaryHint()
+ * @copydoc Dali::Window::RemoveAuxiliaryHint()
*/
bool RemoveAuxiliaryHint( unsigned int id );
/**
- * @copydoc Dali::DevelWindow::SetAuxiliaryHintValue()
+ * @copydoc Dali::Window::SetAuxiliaryHintValue()
*/
bool SetAuxiliaryHintValue( unsigned int id, const std::string& value );
/**
- * @copydoc Dali::DevelWindow::GetAuxiliaryHintValue()
+ * @copydoc Dali::Window::GetAuxiliaryHintValue()
*/
std::string GetAuxiliaryHintValue( unsigned int id ) const;
/**
- * @copydoc Dali::DevelWindow::GetAuxiliaryHintId()
+ * @copydoc Dali::Window::GetAuxiliaryHintId()
*/
unsigned int GetAuxiliaryHintId( const std::string& hint ) const;
/**
- * @copydoc Dali::DevelWindow::SetInputRegion()
+ * @copydoc Dali::Window::SetInputRegion()
*/
void SetInputRegion( const Rect< int >& inputRegion );
/**
- * @copydoc Dali::DevelWindow::SetType()
+ * @copydoc Dali::Window::SetType()
*/
- void SetType( Dali::DevelWindow::Type type );
+ void SetType( Dali::Window::Type type );
/**
- * @copydoc Dali::DevelWindow::GetType() const
+ * @copydoc Dali::Window::GetType() const
*/
- Dali::DevelWindow::Type GetType() const;
+ Dali::Window::Type GetType() const;
/**
- * @copydoc Dali::DevelWindow::SetNotificationLevel()
+ * @copydoc Dali::Window::SetNotificationLevel()
*/
- bool SetNotificationLevel( Dali::DevelWindow::NotificationLevel::Type level );
+ bool SetNotificationLevel( Dali::Window::NotificationLevel::Type level );
/**
- * @copydoc Dali::DevelWindow::GetNotificationLevel()
+ * @copydoc Dali::Window::GetNotificationLevel()
*/
- Dali::DevelWindow::NotificationLevel::Type GetNotificationLevel();
+ Dali::Window::NotificationLevel::Type GetNotificationLevel() const;
/**
- * @copydoc Dali::DevelWindow::SetOpaqueState()
+ * @copydoc Dali::Window::SetOpaqueState()
*/
void SetOpaqueState( bool opaque );
/**
- * @copydoc Dali::DevelWindow::IsOpaqueState()
+ * @copydoc Dali::Window::IsOpaqueState()
*/
- bool IsOpaqueState();
+ bool IsOpaqueState() const;
/**
- * @copydoc Dali::DevelWindow::SetScreenMode()
+ * @copydoc Dali::Window::SetScreenOffMode()
*/
- bool SetScreenMode( Dali::DevelWindow::ScreenMode::Type screenMode );
+ bool SetScreenOffMode(Dali::Window::ScreenOffMode::Type screenOffMode);
/**
- * @copydoc Dali::DevelWindow::GetScreenMode()
+ * @copydoc Dali::Window::GetScreenOffMode()
*/
- Dali::DevelWindow::ScreenMode::Type GetScreenMode();
+ Dali::Window::ScreenOffMode::Type GetScreenOffMode() const;
/**
- * @copydoc Dali::DevelWindow::SetBrightness()
+ * @copydoc Dali::Window::SetBrightness()
*/
bool SetBrightness( int brightness );
/**
- * @copydoc Dali::DevelWindow::GetBrightness()
+ * @copydoc Dali::Window::GetBrightness()
*/
- int GetBrightness();
+ int GetBrightness() const;
/**
- * @copydoc Dali::DevelWindow::SetSize()
+ * @copydoc Dali::Window::SetSize()
*/
- void SetSize( Dali::DevelWindow::WindowSize size );
+ void SetSize( Dali::Window::WindowSize size );
/**
- * @copydoc Dali::DevelWindow::GetSize()
+ * @copydoc Dali::Window::GetSize()
*/
- Dali::DevelWindow::WindowSize GetSize();
+ Dali::Window::WindowSize GetSize() const;
/**
- * @copydoc Dali::DevelWindow::SetPosition()
+ * @copydoc Dali::Window::SetPosition()
*/
- void SetPosition( Dali::DevelWindow::WindowPosition position );
+ void SetPosition( Dali::Window::WindowPosition position );
/**
- * @copydoc Dali::DevelWindow::GetPosition()
+ * @copydoc Dali::Window::GetPosition()
*/
- Dali::DevelWindow::WindowPosition GetPosition();
+ Dali::Window::WindowPosition GetPosition() const;
/**
- * @copydoc Dali::DevelWindow::SetTransparency()
+ * @copydoc Dali::Window::SetTransparency()
*/
void SetTransparency( bool transparent );
*/
void RotationDone( int orientation, int width, int height );
+ /**
+ * Set the indicator visible mode
+ */
+ void SetIndicatorVisibleMode( Dali::Window::IndicatorVisibleMode mode );
+
private:
/**
* Private constructor.
IndicatorSignalType& IndicatorVisibilityChangedSignal() { return mIndicatorVisibilityChangedSignal; }
/**
- * @copydoc Dali::DevelWindow::FocusChangedSignal()
+ * @copydoc Dali::Window::FocusChangedSignal()
*/
FocusSignalType& FocusChangedSignal() { return mFocusChangedSignal; }
/**
- * @copydoc Dali::DevelWindow::ResizedSignal()
+ * @copydoc Dali::Window::ResizedSignal()
*/
ResizedSignalType& ResizedSignal() { return mResizedSignal; }
bool mEcoreEventHander:1;
bool mIsFocusAcceptable:1;
bool mVisible:1;
+ bool mIconified:1;
bool mOpaqueState:1;
bool mResizeEnabled:1;
IndicatorInterface* mIndicator;
Integration::SystemOverlay* mOverlay;
Adaptor* mAdaptor;
Dali::DragAndDropDetector mDragAndDropDetector;
- Dali::DevelWindow::Type mType;
+ Dali::Window::Type mType;
struct EventHandler;
EventHandler* mEventHandler;
// INTERNAL INCLUDES
#include <adaptors/devel-api/adaptor-framework/application-devel.h>
-#include <adaptors/devel-api/adaptor-framework/window-devel.h>
#include <adaptors/common/application-impl.h>
namespace Dali
namespace DevelApplication
{
-Application New( int* argc, char **argv[], const std::string& stylesheet, Application::WINDOW_MODE windowMode, PositionSize positionSize )
-{
- Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::GetPreInitializedApplication();
- if( internal )
- {
- if( argc && ( *argc > 0 ) )
- {
- internal->GetWindow().SetClass( (*argv)[0], "" );
- }
- internal->SetStyleSheet( stylesheet );
-
- DevelWindow::SetTransparency( internal->GetWindow(), ( windowMode == Application::OPAQUE ? false : true ) );
- DevelWindow::SetSize( internal->GetWindow(), DevelWindow::WindowSize( positionSize.width, positionSize.height ) );
- DevelWindow::SetPosition( internal->GetWindow(), DevelWindow::WindowPosition( positionSize.x, positionSize.y ) );
-
- return Application( internal.Get() );
- }
- else
- {
- internal = Internal::Adaptor::Application::New( argc, argv, stylesheet, windowMode, positionSize, Internal::Adaptor::Framework::NORMAL );
- return Application( internal.Get() );
- }
-}
-
void PreInitialize( int* argc, char** argv[] )
{
Internal::Adaptor::Application::PreInitialize( argc, argv );
namespace DevelApplication
{
-
-/**
- * @brief This is the constructor for applications.
- *
- * @PRIVLEVEL_PUBLIC
- * @PRIVILEGE_DISPLAY
- * @param[in,out] argc A pointer to the number of arguments
- * @param[in,out] argv A pointer to the argument list
- * @param[in] stylesheet The path to user defined theme file
- * @param[in] windowMode A member of WINDOW_MODE
- * @param[in] positionSize A position and a size of the window
- * @return A handle to the Application
- * @note If the stylesheet is not specified, then the library's default stylesheet will not be overridden.
- */
-DALI_IMPORT_API Application New( int* argc, char **argv[], const std::string& stylesheet, Application::WINDOW_MODE windowMode, PositionSize positionSize );
-
/**
* @brief This is used to improve application launch performance.
* It preloads so files, initializes some functions in advance and makes a window in advance.
*
* @return The maximum texture size
*/
-unsigned int GetMaxTextureSize();
+DALI_IMPORT_API unsigned int GetMaxTextureSize();
} // Dali
Internal::Adaptor::ImfManager::GetImplementation(*this).ApplyOptions( options );
}
-void ImfManager::SetInputPanelUserData( const std::string& data )
+void ImfManager::SetInputPanelData( const std::string& data )
{
- Internal::Adaptor::ImfManager::GetImplementation(*this).SetInputPanelUserData( data );
+ Internal::Adaptor::ImfManager::GetImplementation(*this).SetInputPanelData( data );
}
-void ImfManager::GetInputPanelUserData( std::string& data )
+void ImfManager::GetInputPanelData( std::string& data )
{
- Internal::Adaptor::ImfManager::GetImplementation(*this).GetInputPanelUserData( data );
+ Internal::Adaptor::ImfManager::GetImplementation(*this).GetInputPanelData( data );
}
Dali::ImfManager::State ImfManager::GetInputPanelState()
return Internal::Adaptor::ImfManager::GetImplementation(*this).StatusChangedSignal();
}
-ImfManager::VoidSignalType& ImfManager::ResizedSignal()
+ImfManager::KeyboardResizedSignalType& ImfManager::ResizedSignal()
{
return Internal::Adaptor::ImfManager::GetImplementation(*this).ResizedSignal();
}
-ImfManager::VoidSignalType& ImfManager::LanguageChangedSignal()
+ImfManager::LanguageChangedSignalType& ImfManager::LanguageChangedSignal()
{
return Internal::Adaptor::ImfManager::GetImplementation(*this).LanguageChangedSignal();
}
typedef Signal< void (ImfManager&) > ImfManagerSignalType; ///< Keyboard actived signal
typedef Signal< ImfCallbackData ( ImfManager&, const ImfEventData& ) > ImfEventSignalType; ///< keyboard events
typedef Signal< void () > VoidSignalType;
- typedef Signal< void (bool) > StatusSignalType;
- typedef Signal< void (KeyboardType) > KeyboardTypeSignalType; ///< keyboard type
+ typedef Signal< void ( bool ) > StatusSignalType;
+ typedef Signal< void ( KeyboardType ) > KeyboardTypeSignalType; ///< keyboard type
+ typedef Signal< void ( int ) > KeyboardResizedSignalType; ///< Keyboard resized signal
+ typedef Signal< void ( int ) > LanguageChangedSignalType; ///< Language changed signal
public:
* @brief Sets up the input-panel specific data.
* @param[in] data The specific data to be set to the input panel
*/
- void SetInputPanelUserData( const std::string& data );
+ void SetInputPanelData( const std::string& data );
/**
* @brief Gets the specific data of the current active input panel.
+ *
+ * Input Panel Data is not always the data which is set by SetInputPanelData().
+ * Data can be changed internally in the input panel.
+ * It is just used to get a specific data from the input panel to an application.
* @param[in] data The specific data to be got from the input panel
*/
- void GetInputPanelUserData( std::string& data );
+ void GetInputPanelData( std::string& data );
/**
* @brief Gets the state of the current active input panel.
*
* A callback of the following type may be connected:
* @code
- * void YourCallbackName();
+ * void YourCallbackName( int resolvedResize );
* @endcode
+ * The parameter sends the resolved resize defined by the IMF.
+ *
* User can get changed size by using GetInputMethodArea() in the callback
* @return The signal to connect to.
*/
- VoidSignalType& ResizedSignal();
+ KeyboardResizedSignalType& ResizedSignal();
/**
* @brief Connect to this signal to be notified when the virtual keyboard's language is changed.
*
* A callback of the following type may be connected:
* @code
- * void YourCallbackName();
+ * void YourCallbackName( int resolvedLanguage );
* @endcode
+ * The parameter sends the resolved language defined by the IMF.
+ *
* User can get the text direction of the language by calling GetTextDirection() in the callback.
* @return The signal to connect to.
*/
- VoidSignalType& LanguageChangedSignal();
+ LanguageChangedSignalType& LanguageChangedSignal();
/**
* @brief Connect to this signal to be notified when the keyboard type is changed.
GetImplementation(*this).ApplyMask( GetImplementation( mask ), contentScale, cropToMask );
}
+void PixelBuffer::ApplyGaussianBlur( const float blurRadius )
+{
+ GetImplementation(*this).ApplyGaussianBlur( blurRadius );
+}
+
} // namespace Devel
} // namespace Dali
*/
void ApplyMask( PixelBuffer mask, float contentScale=1.0f, bool cropToMask=false );
+ /**
+ * Apply a Gaussian blur to this pixel data with the given radius.
+ *
+ * @note A bigger radius will yield a blurrier image. Only works for pixel data in RGBA format.
+ *
+ * @param[in] blurRadius The radius for Gaussian blur. A value of 0 or negative value indicates no blur.
+ */
+ void ApplyGaussianBlur( const float blurRadius );
+
public:
/**
*/
virtual void Backward( int millisecond ) = 0;
+ /**
+ * @brief Checks whether the video texture is supported
+ * @return True if supported, otherwise false.
+ */
+ virtual bool IsVideoTextureSupported() const = 0;
+
};
} // namespace Dali;
GetImplementation( *this ).Backward( millisecond );
}
+bool VideoPlayer::IsVideoTextureSupported() const
+{
+ return GetImplementation( *this ).IsVideoTextureSupported();
+}
+
} // namespace Dali;
*/
void Backward( int millisecond );
+ /**
+ * @brief Checks whether the video texture is supported
+ * @return True if supported, otherwise false.
+ */
+ bool IsVideoTextureSupported() const;
+
private: // Not intended for application developers
/**
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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 Internal::Adaptor::VirtualKeyboard::StatusChangedSignal();
}
-VoidSignalType& ResizedSignal()
+KeyboardResizedSignalType& ResizedSignal()
{
return Internal::Adaptor::VirtualKeyboard::ResizedSignal();
}
-VoidSignalType& LanguageChangedSignal()
+LanguageChangedSignalType& LanguageChangedSignal()
{
return Internal::Adaptor::VirtualKeyboard::LanguageChangedSignal();
}
#define __DALI_VIRTUAL_KEYBOARD_H__
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
// Types
typedef Signal< void () > VoidSignalType;
-typedef Signal< void (bool) > StatusSignalType;
+typedef Signal< void ( bool ) > StatusSignalType;
+typedef Signal< void ( int ) > KeyboardResizedSignalType;
+typedef Signal< void ( int ) > LanguageChangedSignalType;
// Enumerations
*
* A callback of the following type may be connected:
* @code
- * void YourCallbackName();
+ * void YourCallbackName( int resolvedResize );
* @endcode
+ * The parameter sends the resolved resize defined by the IMF.
+ *
* User can get changed size by using GetSizeAndPosition() in the callback
* @return The signal to connect to.
*/
-DALI_IMPORT_API VoidSignalType& ResizedSignal();
+DALI_IMPORT_API KeyboardResizedSignalType& ResizedSignal();
/**
* @brief Connect to this signal to be notified when the virtual keyboard's language is changed.
*
* A callback of the following type may be connected:
* @code
- * void YourCallbackName();
+ * void YourCallbackName( int resolvedLanguage );
* @endcode
+ * The parameter sends the resolved language defined by the IMF.
+ *
* User can get the text direction of the language by calling GetTextDirection() in the callback.
* @return The signal to connect to.
*/
-DALI_IMPORT_API VoidSignalType& LanguageChangedSignal();
+DALI_IMPORT_API LanguageChangedSignalType& LanguageChangedSignal();
} // namespace VirtualKeyboard
+++ /dev/null
-/*
- * Copyright (c) 2017 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 <adaptors/devel-api/adaptor-framework/window-devel.h>
-#include <adaptors/common/window-impl.h>
-
-namespace Dali
-{
-
-namespace DevelWindow
-{
-
-FocusSignalType& FocusChangedSignal( Window window )
-{
- return GetImplementation( window ).FocusChangedSignal();
-}
-
-void SetAcceptFocus( Window window, bool accept )
-{
- GetImplementation( window ).SetAcceptFocus( accept );
-}
-
-bool IsFocusAcceptable( Window window )
-{
- return GetImplementation( window ).IsFocusAcceptable();
-}
-
-void Show( Window window )
-{
- GetImplementation( window ).Show();
-}
-
-void Hide( Window window )
-{
- GetImplementation( window ).Hide();
-}
-
-bool IsVisible( Window window )
-{
- return GetImplementation( window ).IsVisible();
-}
-
-unsigned int GetSupportedAuxiliaryHintCount( Window window )
-{
- return GetImplementation( window ).GetSupportedAuxiliaryHintCount();
-}
-
-std::string GetSupportedAuxiliaryHint( Window window, unsigned int index )
-{
- return GetImplementation( window ).GetSupportedAuxiliaryHint( index );
-}
-
-unsigned int AddAuxiliaryHint( Window window, const std::string& hint, const std::string& value )
-{
- return GetImplementation( window ).AddAuxiliaryHint( hint, value );
-}
-
-bool RemoveAuxiliaryHint( Window window, unsigned int id )
-{
- return GetImplementation( window ).RemoveAuxiliaryHint( id );
-}
-
-bool SetAuxiliaryHintValue( Window window, unsigned int id, const std::string& value )
-{
- return GetImplementation( window ).SetAuxiliaryHintValue( id, value );
-}
-
-std::string GetAuxiliaryHintValue( Window window, unsigned int id )
-{
- return GetImplementation( window ).GetAuxiliaryHintValue( id );
-}
-
-unsigned int GetAuxiliaryHintId( Window window, const std::string& hint )
-{
- return GetImplementation( window ).GetAuxiliaryHintId( hint );
-}
-
-void SetInputRegion( Window window, const Rect< int >& inputRegion )
-{
- return GetImplementation( window ).SetInputRegion( inputRegion );
-}
-
-void SetType( Window window, Type type )
-{
- GetImplementation( window ).SetType( type );
-}
-
-Type GetType( Window window )
-{
- return GetImplementation( window ).GetType();
-}
-
-bool SetNotificationLevel( Window window, NotificationLevel::Type level )
-{
- return GetImplementation( window ).SetNotificationLevel( level );
-}
-
-NotificationLevel::Type GetNotificationLevel( Window window )
-{
- return GetImplementation( window ).GetNotificationLevel();
-}
-
-void SetOpaqueState( Window window, bool opaque )
-{
- GetImplementation( window ).SetOpaqueState( opaque );
-}
-
-bool IsOpaqueState( Window window )
-{
- return GetImplementation( window ).IsOpaqueState();
-}
-
-bool SetScreenMode( Window window, ScreenMode::Type screenMode )
-{
- return GetImplementation( window ).SetScreenMode( screenMode );
-}
-
-ScreenMode::Type GetScreenMode( Window window )
-{
- return GetImplementation( window ).GetScreenMode();
-}
-
-bool SetBrightness( Window window, int brightness )
-{
- return GetImplementation( window ).SetBrightness( brightness );
-}
-
-int GetBrightness( Window window )
-{
- return GetImplementation( window ).GetBrightness();
-}
-
-ResizedSignalType& ResizedSignal( Window window )
-{
- return GetImplementation( window ).ResizedSignal();
-}
-
-void SetSize( Window window, WindowSize size )
-{
- GetImplementation( window ).SetSize( size );
-}
-
-WindowSize GetSize( Window window )
-{
- return GetImplementation( window ).GetSize();
-}
-
-void SetPosition( Window window, WindowPosition position )
-{
- GetImplementation( window ).SetPosition( position );
-}
-
-WindowPosition GetPosition( Window window )
-{
- return GetImplementation( window ).GetPosition();
-}
-
-void SetTransparency( Window window, bool transparent )
-{
- GetImplementation( window ).SetTransparency( transparent );
-}
-
-} // namespace DevelWindow
-
-} // namespace Dali
+++ /dev/null
-#ifndef DALI_WINDOW_DEVEL_H
-#define DALI_WINDOW_DEVEL_H
-
-/*
- * Copyright (c) 2017 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/math/rect.h>
-#include <dali/public-api/math/uint-16-pair.h>
-
-// INTERNAL INCLUDES
-#ifdef DALI_ADAPTOR_COMPILATION // full path doesn't exist until adaptor is installed so we have to use relative
-#include <window.h>
-#else
-#include <dali/public-api/adaptor-framework/window.h>
-#endif
-
-namespace Dali
-{
-
-namespace DevelWindow
-{
-
-namespace NotificationLevel
-{
-
-/**
- * @brief An enum of notification window's priority level.
- */
-enum Type
-{
- NONE = -1, ///< No notification level. Default level. This value makes the notification window place in the layer of the normal window.
- BASE = 10, ///< Base notification level.
- MEDIUM = 20, ///< Higher notification level than base.
- HIGH = 30, ///< Higher notification level than medium.
- TOP = 40 ///< The highest notification level.
-};
-
-} // namespace NotificationLevel
-
-namespace ScreenMode
-{
-
-/**
- * @brief An enum of screen mode.
- */
-enum Type
-{
- DEFAULT, ///< The mode which turns the screen off after a timeout.
- ALWAYS_ON ///< The mode which keeps the screen turned on.
-};
-
-} // namespace ScreenMode
-
-/**
- * @brief An enum of Window types.
- */
-enum Type
-{
- NORMAL, ///< A default window type. Indicates a normal, top-level window. Almost every window will be created with this type.
- NOTIFICATION, ///< A notification window, like a warning about battery life or a new E-Mail received.
- UTILITY, ///< A persistent utility window, like a toolbox or palette.
- DIALOG ///< Used for simple dialog windows.
-};
-
-typedef Uint16Pair WindowSize; ///< Window size type
-typedef Uint16Pair WindowPosition; ///< Window position type
-
-typedef Signal< void ( bool ) > FocusSignalType; ///< Window focus signal type
-typedef Signal< void ( WindowSize ) > ResizedSignalType; ///< Window resized signal type
-
-/**
- * @brief The user should connect to this signal to get a timing when window gains focus or loses focus.
- *
- * A callback of the following type may be connected:
- * @code
- * void YourCallbackName( bool focusIn );
- * @endcode
- * The parameter is true if window gains focus, otherwise false.
- *
- * @param[in] window The window to get a signal
- * @return The signal to connect to
- */
-DALI_IMPORT_API FocusSignalType& FocusChangedSignal( Window window );
-
-/**
- * @brief Sets whether window accepts focus or not.
- *
- * @param[in] window The window to accept focus
- * @param[in] accept If focus is accepted or not. Default is true.
- */
-DALI_IMPORT_API void SetAcceptFocus( Window window, bool accept );
-
-/**
- * @brief Returns whether window accepts focus or not.
- *
- * @param[in] window The window to accept focus
- * @return True if the window accept focus, false otherwise
- */
-DALI_IMPORT_API bool IsFocusAcceptable( Window window );
-
-/**
- * @brief Shows the window if it is hidden.
- * @param[in] window The window to show
- */
-DALI_IMPORT_API void Show( Window window );
-
-/**
- * @brief Hides the window if it is showing.
- * @param[in] window The window to hide
- */
-DALI_IMPORT_API void Hide( Window window );
-
-/**
- * @brief Returns whether the window is visible or not.
- * @param[in] window The window to query
- * @return True if the window is visible, false otherwise.
- */
-DALI_IMPORT_API bool IsVisible( Window window );
-
-/**
- * @brief Gets the count of supported auxiliary hints of the window.
- * @param[in] window The window to get the hint count
- * @return The number of supported auxiliary hints.
- *
- * @note The window auxiliary hint is the value which is used to decide which actions should be made available to the user by the window manager.
- * If you want to set specific hint to your window, then you should check whether it exists in the supported auxiliary hints.
- */
-DALI_IMPORT_API unsigned int GetSupportedAuxiliaryHintCount( Window window );
-
-/**
- * @brief Gets the supported auxiliary hint string of the window.
- * @param[in] window The window to get the hint
- * @param[in] index The index of the supported auxiliary hint lists
- * @return The auxiliary hint string of the index.
- *
- * @note The window auxiliary hint is the value which is used to decide which actions should be made available to the user by the window manager.
- * If you want to set specific hint to your window, then you should check whether it exists in the supported auxiliary hints.
- */
-DALI_IMPORT_API std::string GetSupportedAuxiliaryHint( Window window, unsigned int index );
-
-/**
- * @brief Creates an auxiliary hint of the window.
- * @param[in] window The window to create a hint
- * @param[in] hint The auxiliary hint string.
- * @param[in] value The value string.
- * @return The ID of created auxiliary hint, or @c 0 on failure.
- */
-DALI_IMPORT_API unsigned int AddAuxiliaryHint( Window window, const std::string& hint, const std::string& value );
-
-/**
- * @brief Removes an auxiliary hint of the window.
- * @param[in] window The window to remove a hint
- * @param[in] id The ID of the auxiliary hint.
- * @return True if no error occurred, false otherwise.
- */
-DALI_IMPORT_API bool RemoveAuxiliaryHint( Window window, unsigned int id );
-
-/**
- * @brief Changes a value of the auxiliary hint.
- * @param[in] window The window to set a value
- * @param[in] id The auxiliary hint ID.
- * @param[in] value The value string to be set.
- * @return True if no error occurred, false otherwise.
- */
-DALI_IMPORT_API bool SetAuxiliaryHintValue( Window window, unsigned int id, const std::string& value );
-
-/**
- * @brief Gets a value of the auxiliary hint.
- * @param[in] window The window to get a value
- * @param[in] id The auxiliary hint ID.
- * @return The string value of the auxiliary hint ID, or an empty string if none exists.
- */
-DALI_IMPORT_API std::string GetAuxiliaryHintValue( Window window, unsigned int id );
-
-/**
- * @brief Gets a ID of the auxiliary hint string.
- * @param[in] window The window to get an ID
- * @param[in] hint The auxiliary hint string.
- * @return The ID of the auxiliary hint string, or @c 0 if none exists.
- */
-DALI_IMPORT_API unsigned int GetAuxiliaryHintId( Window window, const std::string& hint );
-
-/**
- * @brief Sets a region to accept input events.
- * @param[in] window The window to set a region
- * @param[in] inputRegion The region to accept input events.
- */
-DALI_IMPORT_API void SetInputRegion( Window window, const Rect< int >& inputRegion );
-
-/**
- * @brief Sets a window type.
- * @param[in] window The window to set a type
- * @param[in] type The window type.
- * @remarks The default window type is NORMAL.
- */
-DALI_IMPORT_API void SetType( Window window, Type type );
-
-/**
- * @brief Gets a window type.
- * @param[in] window The window to get a type
- * @return A window type.
- */
-DALI_IMPORT_API Type GetType( Window window );
-
-/**
- * @brief Sets a priority level for the specified notification window.
- * @param[in] window The window to set a notification level
- * @param[in] level The notification window level.
- * @return True if no error occurred, false otherwise.
- * @PRIVLEVEL_PUBLIC
- * @PRIVILEGE_WINDOW_PRIORITY
- * @remarks This can be used for a notification type window only. The default level is NotificationLevel::NONE.
- */
-DALI_IMPORT_API bool SetNotificationLevel( Window window, NotificationLevel::Type level );
-
-/**
- * @brief Gets a priority level for the specified notification window.
- * @param[in] window The window to get a notification level
- * @return The notification window level.
- * @remarks This can be used for a notification type window only.
- */
-DALI_IMPORT_API NotificationLevel::Type GetNotificationLevel( Window window );
-
-/**
- * @brief Sets a transparent window's visual state to opaque.
- * @details If a visual state of a transparent window is opaque,
- * then the window manager could handle it as an opaque window when calculating visibility.
- * @param[in] window The window to set a state
- * @param[in] opaque Whether the window's visual state is opaque.
- * @remarks This will have no effect on an opaque window.
- * It doesn't change transparent window to opaque window but lets the window manager know the visual state of the window.
- */
-DALI_IMPORT_API void SetOpaqueState( Window window, bool opaque );
-
-/**
- * @brief Returns whether a transparent window's visual state is opaque or not.
- * @param[in] window The window to get a state
- * @return True if the window's visual state is opaque, false otherwise.
- * @remarks The return value has no meaning on an opaque window.
- */
-DALI_IMPORT_API bool IsOpaqueState( Window window );
-
-/**
- * @brief Sets a window's screen mode.
- * @details This API is useful when the application needs to keep the display turned on.
- * If the application sets the screen mode to #ScreenMode::ALWAYS_ON to its window and the window is shown,
- * the window manager requests the display system to keep the display on as long as the window is shown.
- * If the window is no longer shown, then the window manager requests the display system to go back to normal operation.
- * @param[in] window The window to set a screen mode
- * @param[in] screenMode The screen mode.
- * @return True if no error occurred, false otherwise.
- * @PRIVLEVEL_PUBLIC
- * @PRIVILEGE_DISPLAY
- */
-DALI_IMPORT_API bool SetScreenMode( Window window, ScreenMode::Type screenMode );
-
-/**
- * @brief Gets a screen mode of the window.
- * @param[in] window The window to get a screen mode
- * @return The screen mode.
- */
-DALI_IMPORT_API ScreenMode::Type GetScreenMode( Window window );
-
-/**
- * @brief Sets preferred brightness of the window.
- * @details This API is useful when the application needs to change the brightness of the screen when it is appeared on the screen.
- * If the brightness has been set and the window is shown, the window manager requests the display system to change the brightness to the provided value.
- * If the window is no longer shown, then the window manager requests the display system to go back to default brightness.
- * A value less than 0 results in default brightness and a value greater than 100 results in maximum brightness.
- * @param[in] window The window to set a brightness
- * @param[in] brightness The preferred brightness (0 to 100).
- * @return True if no error occurred, false otherwise.
- * @PRIVLEVEL_PUBLIC
- * @PRIVILEGE_DISPLAY
- */
-DALI_IMPORT_API bool SetBrightness( Window window, int brightness );
-
-/**
- * @brief Gets preffered brightness of the window.
- * @param[in] window The window to get brightness
- * @return The preffered brightness.
- */
-DALI_IMPORT_API int GetBrightness( Window window );
-
-/**
- * @brief This signal is emitted when the window is resized.
- *
- * A callback of the following type may be connected:
- * @code
- * void YourCallbackName( int width, int height );
- * @endcode
- * The parameters are the resized width and height.
- *
- * @param[in] window The window to get a signal
- * @return The signal to connect to
- */
-DALI_IMPORT_API ResizedSignalType& ResizedSignal( Window window );
-
-/**
- * @brief Sets a size of the window.
- *
- * @param[in] window The window to set a size
- * @param[in] size The new window size
- */
-DALI_IMPORT_API void SetSize( Window window, WindowSize size );
-
-/**
- * @brief Gets a size of the window.
- *
- * @param[in] window The window to get a size
- * @return The size of the window
- */
-DALI_IMPORT_API WindowSize GetSize( Window window );
-
-/**
- * @brief Sets a position of the window.
- *
- * @param[in] window The window to set a position
- * @param[in] position The new window position
- */
-DALI_IMPORT_API void SetPosition( Window window, WindowPosition position );
-
-/**
- * @brief Gets a position of the window.
- *
- * @param[in] window The window to get a position
- * @return The position of the window
- */
-DALI_IMPORT_API WindowPosition GetPosition( Window window );
-
-/**
- * @brief Sets whether the window is transparent or not.
- *
- * @param[in] window The window to set transparency
- * @param[in] transparent Whether the window is transparent
- */
-DALI_IMPORT_API void SetTransparency( Window window, bool transparent );
-
-} // namespace DevelWindow
-
-} // namespace Dali
-
-#endif // DALI_WINDOW_DEVEL_H
$(adaptor_devel_api_dir)/adaptor-framework/tilt-sensor.cpp \
$(adaptor_devel_api_dir)/adaptor-framework/lifecycle-controller.cpp \
$(adaptor_devel_api_dir)/adaptor-framework/video-player.cpp \
- $(adaptor_devel_api_dir)/adaptor-framework/virtual-keyboard.cpp \
- $(adaptor_devel_api_dir)/adaptor-framework/window-devel.cpp
+ $(adaptor_devel_api_dir)/adaptor-framework/virtual-keyboard.cpp
devel_api_adaptor_framework_header_files = \
$(adaptor_devel_api_dir)/adaptor-framework/video-player-plugin.h \
$(adaptor_devel_api_dir)/adaptor-framework/key-extension-plugin.h \
$(adaptor_devel_api_dir)/adaptor-framework/virtual-keyboard.h \
- $(adaptor_devel_api_dir)/adaptor-framework/physical-keyboard.h \
- $(adaptor_devel_api_dir)/adaptor-framework/window-devel.h
+ $(adaptor_devel_api_dir)/adaptor-framework/physical-keyboard.h
+
return imfManager.StatusChangedSignal();
}
-Dali::VirtualKeyboard::VoidSignalType& ResizedSignal()
+Dali::VirtualKeyboard::KeyboardResizedSignalType& ResizedSignal()
{
DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: ResizedSignal() is deprecated and will be removed from next release. Use ImfManager.ResizedSignal() instead.\n" );
return imfManager.ResizedSignal();
}
-Dali::VirtualKeyboard::VoidSignalType& LanguageChangedSignal()
+Dali::VirtualKeyboard::LanguageChangedSignalType& LanguageChangedSignal()
{
DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: LanguageChangedSignal() is deprecated and will be removed from next release. Use ImfManager.LanguageChangedSignal() instead.\n" );
#endif // DALI_ELDBUS_AVAILABLE
#include <dali/public-api/common/vector-wrapper.h>
+#include <dali/public-api/events/device.h>
#include <dali/public-api/events/touch-point.h>
#include <dali/public-api/events/key-event.h>
#include <dali/public-api/events/wheel-event.h>
#include <dali/integration-api/events/touch-event-integ.h>
#include <dali/integration-api/events/hover-event-integ.h>
#include <dali/integration-api/events/wheel-event-integ.h>
-#include <dali/devel-api/events/device.h>
// INTERNAL INCLUDES
#include <events/gesture-manager.h>
/**
* Get the device class from the provided ecore event
*/
-void GetDeviceClass( Ecore_Device_Class ecoreDeviceClass, DevelDevice::Class::Type& deviceClass )
+void GetDeviceClass( Ecore_Device_Class ecoreDeviceClass, Device::Class::Type& deviceClass )
{
switch( ecoreDeviceClass )
{
case ECORE_DEVICE_CLASS_SEAT:
{
- deviceClass = DevelDevice::Class::USER;
+ deviceClass = Device::Class::USER;
break;
}
case ECORE_DEVICE_CLASS_KEYBOARD:
{
- deviceClass = DevelDevice::Class::KEYBOARD;
+ deviceClass = Device::Class::KEYBOARD;
break;
}
case ECORE_DEVICE_CLASS_MOUSE:
{
- deviceClass = DevelDevice::Class::MOUSE;
+ deviceClass = Device::Class::MOUSE;
break;
}
case ECORE_DEVICE_CLASS_TOUCH:
{
- deviceClass = DevelDevice::Class::TOUCH;
+ deviceClass = Device::Class::TOUCH;
break;
}
case ECORE_DEVICE_CLASS_PEN:
{
- deviceClass = DevelDevice::Class::PEN;
+ deviceClass = Device::Class::PEN;
break;
}
case ECORE_DEVICE_CLASS_POINTER:
{
- deviceClass = DevelDevice::Class::POINTER;
+ deviceClass = Device::Class::POINTER;
break;
}
case ECORE_DEVICE_CLASS_GAMEPAD:
{
- deviceClass = DevelDevice::Class::GAMEPAD;
+ deviceClass = Device::Class::GAMEPAD;
break;
}
default:
{
- deviceClass = DevelDevice::Class::NONE;
+ deviceClass = Device::Class::NONE;
break;
}
}
}
-void GetDeviceSubclass( Ecore_Device_Subclass ecoreDeviceSubclass, DevelDevice::Subclass::Type& deviceSubclass )
+void GetDeviceSubclass( Ecore_Device_Subclass ecoreDeviceSubclass, Device::Subclass::Type& deviceSubclass )
{
switch( ecoreDeviceSubclass )
{
case ECORE_DEVICE_SUBCLASS_FINGER:
{
- deviceSubclass = DevelDevice::Subclass::FINGER;
+ deviceSubclass = Device::Subclass::FINGER;
break;
}
case ECORE_DEVICE_SUBCLASS_FINGERNAIL:
{
- deviceSubclass = DevelDevice::Subclass::FINGERNAIL;
+ deviceSubclass = Device::Subclass::FINGERNAIL;
break;
}
case ECORE_DEVICE_SUBCLASS_KNUCKLE:
{
- deviceSubclass = DevelDevice::Subclass::KNUCKLE;
+ deviceSubclass = Device::Subclass::KNUCKLE;
break;
}
case ECORE_DEVICE_SUBCLASS_PALM:
{
- deviceSubclass = DevelDevice::Subclass::PALM;
+ deviceSubclass = Device::Subclass::PALM;
break;
}
case ECORE_DEVICE_SUBCLASS_HAND_SIZE:
{
- deviceSubclass = DevelDevice::Subclass::HAND_SIDE;
+ deviceSubclass = Device::Subclass::HAND_SIDE;
break;
}
case ECORE_DEVICE_SUBCLASS_HAND_FLAT:
{
- deviceSubclass = DevelDevice::Subclass::HAND_FLAT;
+ deviceSubclass = Device::Subclass::HAND_FLAT;
break;
}
case ECORE_DEVICE_SUBCLASS_PEN_TIP:
{
- deviceSubclass = DevelDevice::Subclass::PEN_TIP;
+ deviceSubclass = Device::Subclass::PEN_TIP;
break;
}
case ECORE_DEVICE_SUBCLASS_TRACKPAD:
{
- deviceSubclass = DevelDevice::Subclass::TRACKPAD;
+ deviceSubclass = Device::Subclass::TRACKPAD;
break;
}
case ECORE_DEVICE_SUBCLASS_TRACKPOINT:
{
- deviceSubclass = DevelDevice::Subclass::TRACKPOINT;
+ deviceSubclass = Device::Subclass::TRACKPOINT;
break;
}
case ECORE_DEVICE_SUBCLASS_TRACKBALL:
{
- deviceSubclass = DevelDevice::Subclass::TRACKBALL;
+ deviceSubclass = Device::Subclass::TRACKBALL;
break;
}
+#ifdef OVER_TIZEN_VERSION_4
+ case ECORE_DEVICE_SUBCLASS_REMOCON:
+ {
+ deviceSubclass = Device::Subclass::REMOCON;
+ break;
+ }
+ case ECORE_DEVICE_SUBCLASS_VIRTUAL_KEYBOARD:
+ {
+ deviceSubclass = Device::Subclass::VIRTUAL_KEYBOARD;
+ break;
+ }
+#endif
default:
{
- deviceSubclass = DevelDevice::Subclass::NONE;
+ deviceSubclass = Device::Subclass::NONE;
break;
}
}
state = PointState::INTERRUPTED;
}
- DevelDevice::Class::Type deviceClass;
- DevelDevice::Subclass::Type deviceSubclass;
+ Device::Class::Type deviceClass;
+ Device::Subclass::Type deviceSubclass;
GetDeviceClass( ecore_device_class_get( touchEvent->dev ), deviceClass );
GetDeviceSubclass( ecore_device_subclass_get( touchEvent->dev ), deviceSubclass );
if ( touchEvent->window == (unsigned int)ecore_wl_window_id_get(handler->mImpl->mWindow) )
{
- DevelDevice::Class::Type deviceClass;
- DevelDevice::Subclass::Type deviceSubclass;
+ Device::Class::Type deviceClass;
+ Device::Subclass::Type deviceSubclass;
GetDeviceClass( ecore_device_class_get( touchEvent->dev ), deviceClass );
GetDeviceSubclass( ecore_device_subclass_get( touchEvent->dev ), deviceSubclass );
if ( touchEvent->window == (unsigned int)ecore_wl_window_id_get(handler->mImpl->mWindow) )
{
- DevelDevice::Class::Type deviceClass;
- DevelDevice::Subclass::Type deviceSubclass;
+ Device::Class::Type deviceClass;
+ Device::Subclass::Type deviceSubclass;
GetDeviceClass( ecore_device_class_get( touchEvent->dev ), deviceClass );
GetDeviceSubclass( ecore_device_subclass_get( touchEvent->dev ), deviceSubclass );
}
std::string deviceName;
- DevelDevice::Class::Type deviceClass;
- DevelDevice::Subclass::Type deviceSubclass;
+ Device::Class::Type deviceClass;
+ Device::Subclass::Type deviceSubclass;
GetDeviceName( keyEvent, deviceName );
GetDeviceClass( ecore_device_class_get( keyEvent->dev ), deviceClass );
}
std::string deviceName;
- DevelDevice::Class::Type deviceClass;
- DevelDevice::Subclass::Type deviceSubclass;
+ Device::Class::Type deviceClass;
+ Device::Subclass::Type deviceSubclass;
GetDeviceName( keyEvent, deviceName );
GetDeviceClass( ecore_device_class_get( keyEvent->dev ), deviceClass );
}
ImfManager* imfManager = reinterpret_cast< ImfManager* > ( data );
// Emit the signal that the language has changed
- imfManager->LanguageChangedSignal().Emit();
+ imfManager->LanguageChangedSignal().Emit( value );
}
void InputPanelGeometryChangedCallback ( void *data, Ecore_IMF_Context *context, int value )
}
ImfManager* imfManager = reinterpret_cast< ImfManager* > ( data );
// Emit signal that the keyboard is resized
- imfManager->ResizedSignal().Emit();
+ imfManager->ResizedSignal().Emit( value );
}
void InputPanelKeyboardTypeChangedCallback( void *data, Ecore_IMF_Context *context, int value )
Dali::ImfManager::ImfEventData imfData( Dali::ImfManager::GETSURROUNDING, std::string(), 0, 0 );
Dali::ImfManager handle( this );
- mEventSignal.Emit( handle, imfData );
+ Dali::ImfManager::ImfCallbackData callbackData = mEventSignal.Emit( handle, imfData );
- if( text )
+ if( callbackData.update )
{
- *text = strdup( mSurroundingText.c_str() );
- }
+ if( text )
+ {
+ // The memory allocated by strdup() can be freed by ecore_imf_context_surrounding_get() internally.
+ *text = strdup( callbackData.currentText.c_str() );
+ }
- if( cursorPosition )
- {
- *cursorPosition = mIMFCursorPosition;
+ if( cursorPosition )
+ {
+ mIMFCursorPosition = static_cast<int>( callbackData.cursorPosition );
+ *cursorPosition = mIMFCursorPosition;
+ }
}
return EINA_TRUE;
}
}
-void ImfManager::SetInputPanelUserData( const std::string& data )
+void ImfManager::SetInputPanelData( const std::string& data )
{
- DALI_LOG_INFO( gLogFilter, Debug::General, "ImfManager::SetInputPanelUserData\n" );
+ DALI_LOG_INFO( gLogFilter, Debug::General, "ImfManager::SetInputPanelData\n" );
if( mIMFContext )
{
int length = data.length();
- ecore_imf_context_input_panel_imdata_set( mIMFContext, &data, length );
+ ecore_imf_context_input_panel_imdata_set( mIMFContext, data.c_str(), length );
}
}
-void ImfManager::GetInputPanelUserData( std::string& data )
+void ImfManager::GetInputPanelData( std::string& data )
{
- DALI_LOG_INFO( gLogFilter, Debug::General, "ImfManager::GetInputPanelUserData\n" );
+ DALI_LOG_INFO( gLogFilter, Debug::General, "ImfManager::GetInputPanelData\n" );
if( mIMFContext )
{
- int* length = NULL;
- ecore_imf_context_input_panel_imdata_get( mIMFContext, &data, length );
+ int length = 4096; // The max length is 4096 bytes
+ Dali::Vector< char > buffer;
+ buffer.Resize( length );
+ ecore_imf_context_input_panel_imdata_get( mIMFContext, &buffer[0], &length );
+ data = std::string( buffer.Begin(), buffer.End() );
}
}
typedef Dali::ImfManager::StatusSignalType ImfStatusSignalType;
typedef Dali::ImfManager::VoidSignalType ImfVoidSignalType;
typedef Dali::ImfManager::KeyboardTypeSignalType ImfKeyboardTypeSignalType;
+ typedef Dali::ImfManager::KeyboardResizedSignalType KeyboardResizedSignalType;
+ typedef Dali::ImfManager::LanguageChangedSignalType LanguageChangedSignalType;
public:
void ApplyOptions( const InputMethodOptions& options );
/**
- * @copydoc Dali::ImfManager::SetInputPanelUserData()
+ * @copydoc Dali::ImfManager::SetInputPanelData()
*/
- void SetInputPanelUserData( const std::string& data );
+ void SetInputPanelData( const std::string& data );
/**
- * @copydoc Dali::ImfManager::GetInputPanelUserData()
+ * @copydoc Dali::ImfManager::GetInputPanelData()
*/
- void GetInputPanelUserData( std::string& data );
+ void GetInputPanelData( std::string& data );
/**
* @copydoc Dali::ImfManager::GetInputPanelState()
/**
* @copydoc Dali::ImfManager::ResizedSignal()
*/
- ImfVoidSignalType& ResizedSignal() { return mKeyboardResizeSignal; }
+ KeyboardResizedSignalType& ResizedSignal() { return mKeyboardResizeSignal; }
/**
* @copydoc Dali::ImfManager::LanguageChangedSignal()
*/
- ImfVoidSignalType& LanguageChangedSignal() { return mKeyboardLanguageChangedSignal; }
+ LanguageChangedSignalType& LanguageChangedSignal() { return mKeyboardLanguageChangedSignal; }
/**
* @copydoc Dali::ImfManager::KeyboardTypeChangedSignal()
ImfManagerSignalType mActivatedSignal;
ImfEventSignalType mEventSignal;
ImfStatusSignalType mKeyboardStatusSignal;
- ImfVoidSignalType mKeyboardResizeSignal;
- ImfVoidSignalType mKeyboardLanguageChangedSignal;
+ KeyboardResizedSignalType mKeyboardResizeSignal;
+ LanguageChangedSignalType mKeyboardLanguageChangedSignal;
ImfKeyboardTypeSignalType mKeyboardTypeChangedSignal;
public:
mNotificationLevel( -1 ),
mNotificationChangeState( 0 ),
mNotificationLevelChangeDone( true ),
- mScreenMode( 0 ),
- mScreenModeChangeState( 0 ),
- mScreenModeChangeDone( true ),
+ mScreenOffMode( 0 ),
+ mScreenOffModeChangeState( 0 ),
+ mScreenOffModeChangeDone( true ),
mBrightness( 0 ),
mBrightnessChangeState( 0 ),
mBrightnessChangeDone( true )
{
if( iconifyChangedEvent->iconified == EINA_TRUE )
{
- observer->OnWindowHidden();
+ handler->mWindow->mIconified = true;
+ if( handler->mWindow->mVisible )
+ {
+ observer->OnWindowHidden();
+ }
DALI_LOG_INFO( gWindowLogFilter, Debug::General, "Window (%d) Iconfied\n", handler->mEcoreWindow );
}
else
{
- observer->OnWindowShown();
+ handler->mWindow->mIconified = false;
+ if( handler->mWindow->mVisible )
+ {
+ observer->OnWindowShown();
+ }
DALI_LOG_INFO( gWindowLogFilter, Debug::General, "Window (%d) Shown\n", handler->mEcoreWindow );
}
handled = ECORE_CALLBACK_DONE;
if ( handler && handler->mWindow && transformEvent->output == ecore_wl_window_output_find( handler->mEcoreWindow ) )
{
+ DALI_LOG_INFO( gWindowLogFilter, Debug::General, "Window (%d) EcoreEventOutputTransform\n", handler->mEcoreWindow );
+
ECore::WindowRenderSurface* wlSurface( dynamic_cast< ECore::WindowRenderSurface * >( handler->mWindow->mSurface ) );
- wlSurface->OutputTransformed();
+ if( wlSurface )
+ {
+ wlSurface->OutputTransformed();
+
+ PositionSize positionSize = wlSurface->GetPositionSize();
+ handler->mWindow->mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
+ handler->mWindow->mAdaptor->SurfaceResizeComplete( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
+ }
}
return ECORE_CALLBACK_PASS_ON;
if ( handler && handler->mWindow && ignoreTransformEvent->win == handler->mEcoreWindow )
{
+ DALI_LOG_INFO( gWindowLogFilter, Debug::General, "Window (%d) EcoreEventIgnoreOutputTransform\n", handler->mEcoreWindow );
+
ECore::WindowRenderSurface* wlSurface( dynamic_cast< ECore::WindowRenderSurface * >( handler->mWindow->mSurface ) );
- wlSurface->OutputTransformed();
+ if( wlSurface )
+ {
+ wlSurface->OutputTransformed();
+
+ PositionSize positionSize = wlSurface->GetPositionSize();
+ handler->mWindow->mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
+ handler->mWindow->mAdaptor->SurfaceResizeComplete( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
+ }
}
return ECORE_CALLBACK_PASS_ON;
{
Window::EventHandler* eventHandler = static_cast< Window::EventHandler* >( data );
- eventHandler->mScreenMode = mode;
- eventHandler->mScreenModeChangeState = state;
- eventHandler->mScreenModeChangeDone = true;
+ eventHandler->mScreenOffMode = mode;
+ eventHandler->mScreenOffModeChangeState = state;
+ eventHandler->mScreenOffModeChangeDone = true;
DALI_LOG_INFO( gWindowLogFilter, Debug::General, "Window::EventHandler::TizenPolicyScreenModeChangeDone: mode = %d, state = %d\n", mode, state );
}
uint32_t mNotificationChangeState;
bool mNotificationLevelChangeDone;
- int mScreenMode;
- uint32_t mScreenModeChangeState;
- bool mScreenModeChangeDone;
+ int mScreenOffMode;
+ uint32_t mScreenOffModeChangeState;
+ bool mScreenOffModeChangeDone;
int mBrightness;
uint32_t mBrightnessChangeState;
mEcoreEventHander( true ),
mIsFocusAcceptable( true ),
mVisible( true ),
+ mIconified( false ),
mOpaqueState( false ),
mResizeEnabled( false ),
mIndicator( NULL ),
mIndicatorOpacityMode( Dali::Window::OPAQUE ),
mOverlay( NULL ),
mAdaptor( NULL ),
- mType( Dali::DevelWindow::NORMAL ),
+ mType( Dali::Window::NORMAL ),
mEventHandler( NULL ),
mPreferredOrientation( Dali::Window::PORTRAIT ),
mSupportedAuxiliaryHints(),
void Window::Raise()
{
- ecore_wl_window_raise( mEventHandler->mEcoreWindow );
+ // Use ecore_wl_window_activate to prevent the window shown without rendering
+ ecore_wl_window_activate( mEventHandler->mEcoreWindow );
}
void Window::Lower()
ecore_wl_window_focus_skip_set( mEventHandler->mEcoreWindow, !accept );
}
-bool Window::IsFocusAcceptable()
+bool Window::IsFocusAcceptable() const
{
return mIsFocusAcceptable;
}
mVisible = true;
ecore_wl_window_show( mEventHandler->mEcoreWindow );
- // Need an update request
- if( mAdaptor )
+ if( !mIconified )
{
- mAdaptor->RequestUpdateOnce();
+ if( mAdaptor )
+ {
+ WindowVisibilityObserver* observer( mAdaptor );
+ observer->OnWindowShown();
+ }
}
}
{
mVisible = false;
ecore_wl_window_hide( mEventHandler->mEcoreWindow );
+
+ if( !mIconified )
+ {
+ if( mAdaptor )
+ {
+ WindowVisibilityObserver* observer( mAdaptor );
+ observer->OnWindowHidden();
+ }
+ }
}
bool Window::IsVisible() const
void Window::RotationDone( int orientation, int width, int height )
{
ECore::WindowRenderSurface* wlSurface( dynamic_cast< ECore::WindowRenderSurface * >( mSurface ) );
- wlSurface->RequestRotation( orientation, width, height );
+ if( wlSurface )
+ {
+ wlSurface->RequestRotation( orientation, width, height );
+ }
- mAdaptor->SurfaceResizePrepare( Dali::Adaptor::SurfaceSize( width, height ) );
+ mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( width, height ) );
// Emit signal
- mResizedSignal.Emit( Dali::DevelWindow::WindowSize( width, height ) );
+ mResizedSignal.Emit( Dali::Window::WindowSize( width, height ) );
- mAdaptor->SurfaceResizeComplete( Dali::Adaptor::SurfaceSize( width, height ) );
+ mAdaptor->SurfaceResizeComplete( Adaptor::SurfaceSize( width, height ) );
}
-unsigned int Window::GetSupportedAuxiliaryHintCount()
+void Window::SetIndicatorVisibleMode( Dali::Window::IndicatorVisibleMode mode )
+{
+ mIndicatorVisible = mode;
+}
+
+unsigned int Window::GetSupportedAuxiliaryHintCount() const
{
return mSupportedAuxiliaryHints.size();
}
-std::string Window::GetSupportedAuxiliaryHint( unsigned int index )
+std::string Window::GetSupportedAuxiliaryHint( unsigned int index ) const
{
if( index >= GetSupportedAuxiliaryHintCount() )
{
DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetInputRegion: x = %d, y = %d, w = %d, h = %d\n", inputRegion.x, inputRegion.y, inputRegion.width, inputRegion.height );
}
-void Window::SetType( Dali::DevelWindow::Type type )
+void Window::SetType( Dali::Window::Type type )
{
Ecore_Wl_Window_Type windowType;
{
switch( type )
{
- case Dali::DevelWindow::NORMAL:
+ case Dali::Window::NORMAL:
{
windowType = ECORE_WL_WINDOW_TYPE_TOPLEVEL;
break;
}
- case Dali::DevelWindow::NOTIFICATION:
+ case Dali::Window::NOTIFICATION:
{
windowType = ECORE_WL_WINDOW_TYPE_NOTIFICATION;
break;
}
- case Dali::DevelWindow::UTILITY:
+ case Dali::Window::UTILITY:
{
windowType = ECORE_WL_WINDOW_TYPE_UTILITY;
break;
}
- case Dali::DevelWindow::DIALOG:
+ case Dali::Window::DIALOG:
{
windowType = ECORE_WL_WINDOW_TYPE_DIALOG;
break;
mType = type;
}
-Dali::DevelWindow::Type Window::GetType() const
+Dali::Window::Type Window::GetType() const
{
return mType;
}
-bool Window::SetNotificationLevel( Dali::DevelWindow::NotificationLevel::Type level )
+bool Window::SetNotificationLevel( Dali::Window::NotificationLevel::Type level )
{
- if( mType != Dali::DevelWindow::NOTIFICATION )
+ if( mType != Dali::Window::NOTIFICATION )
{
DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetNotificationLevel: Not supported window type [%d]\n", mType );
return false;
switch( level )
{
- case Dali::DevelWindow::NotificationLevel::NONE:
+ case Dali::Window::NotificationLevel::NONE:
{
notificationLevel = TIZEN_POLICY_LEVEL_NONE;
break;
}
- case Dali::DevelWindow::NotificationLevel::BASE:
+ case Dali::Window::NotificationLevel::BASE:
{
notificationLevel = TIZEN_POLICY_LEVEL_DEFAULT;
break;
}
- case Dali::DevelWindow::NotificationLevel::MEDIUM:
+ case Dali::Window::NotificationLevel::MEDIUM:
{
notificationLevel = TIZEN_POLICY_LEVEL_MEDIUM;
break;
}
- case Dali::DevelWindow::NotificationLevel::HIGH:
+ case Dali::Window::NotificationLevel::HIGH:
{
notificationLevel = TIZEN_POLICY_LEVEL_HIGH;
break;
}
- case Dali::DevelWindow::NotificationLevel::TOP:
+ case Dali::Window::NotificationLevel::TOP:
{
notificationLevel = TIZEN_POLICY_LEVEL_TOP;
break;
return true;
}
-Dali::DevelWindow::NotificationLevel::Type Window::GetNotificationLevel()
+Dali::Window::NotificationLevel::Type Window::GetNotificationLevel() const
{
- if( mType != Dali::DevelWindow::NOTIFICATION )
+ if( mType != Dali::Window::NOTIFICATION )
{
DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::GetNotificationLevel: Not supported window type [%d]\n", mType );
- return Dali::DevelWindow::NotificationLevel::NONE;
+ return Dali::Window::NotificationLevel::NONE;
}
while( !mEventHandler->mTizenPolicy )
if( !mEventHandler->mNotificationLevelChangeDone )
{
DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::GetNotificationLevel: Error! [%d]\n", mEventHandler->mNotificationChangeState );
- return Dali::DevelWindow::NotificationLevel::NONE;
+ return Dali::Window::NotificationLevel::NONE;
}
- Dali::DevelWindow::NotificationLevel::Type level;
+ Dali::Window::NotificationLevel::Type level;
switch( mEventHandler->mNotificationLevel )
{
case TIZEN_POLICY_LEVEL_NONE:
{
- level = Dali::DevelWindow::NotificationLevel::NONE;
+ level = Dali::Window::NotificationLevel::NONE;
break;
}
case TIZEN_POLICY_LEVEL_DEFAULT:
{
- level = Dali::DevelWindow::NotificationLevel::BASE;
+ level = Dali::Window::NotificationLevel::BASE;
break;
}
case TIZEN_POLICY_LEVEL_MEDIUM:
{
- level = Dali::DevelWindow::NotificationLevel::MEDIUM;
+ level = Dali::Window::NotificationLevel::MEDIUM;
break;
}
case TIZEN_POLICY_LEVEL_HIGH:
{
- level = Dali::DevelWindow::NotificationLevel::HIGH;
+ level = Dali::Window::NotificationLevel::HIGH;
break;
}
case TIZEN_POLICY_LEVEL_TOP:
{
- level = Dali::DevelWindow::NotificationLevel::TOP;
+ level = Dali::Window::NotificationLevel::TOP;
break;
}
default:
{
DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::GetNotificationLevel: invalid level [%d]\n", mEventHandler->mNotificationLevel );
- level = Dali::DevelWindow::NotificationLevel::NONE;
+ level = Dali::Window::NotificationLevel::NONE;
break;
}
}
DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetOpaqueState: opaque = %d\n", opaque );
}
-bool Window::IsOpaqueState()
+bool Window::IsOpaqueState() const
{
return mOpaqueState;
}
-bool Window::SetScreenMode( Dali::DevelWindow::ScreenMode::Type screenMode )
+bool Window::SetScreenOffMode(Dali::Window::ScreenOffMode::Type screenOffMode)
{
while( !mEventHandler->mTizenPolicy )
{
wl_display_dispatch_queue( mEventHandler->mDisplay, mEventHandler->mEventQueue );
}
- mEventHandler->mScreenModeChangeDone = false;
- mEventHandler->mScreenModeChangeState = TIZEN_POLICY_ERROR_STATE_NONE;
+ mEventHandler->mScreenOffModeChangeDone = false;
+ mEventHandler->mScreenOffModeChangeState = TIZEN_POLICY_ERROR_STATE_NONE;
unsigned int mode = 0;
- switch( screenMode )
+ switch( screenOffMode )
{
- case Dali::DevelWindow::ScreenMode::DEFAULT:
+ case Dali::Window::ScreenOffMode::TIMEOUT:
{
mode = 0;
break;
}
- case Dali::DevelWindow::ScreenMode::ALWAYS_ON:
+ case Dali::Window::ScreenOffMode::NEVER:
{
mode = 1;
break;
int count = 0;
- while( !mEventHandler->mScreenModeChangeDone && count < 3 )
+ while( !mEventHandler->mScreenOffModeChangeDone && count < 3 )
{
ecore_wl_flush();
wl_display_dispatch_queue( mEventHandler->mDisplay, mEventHandler->mEventQueue );
count++;
}
- if( !mEventHandler->mScreenModeChangeDone )
+ if( !mEventHandler->mScreenOffModeChangeDone )
{
- DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetScreenMode: Screen mode change is failed [%d, %d]\n", screenMode, mEventHandler->mScreenModeChangeState );
+ DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetScreenOffMode: Screen mode change is failed [%d, %d]\n", screenOffMode, mEventHandler->mScreenOffModeChangeState );
return false;
}
- else if( mEventHandler->mScreenModeChangeState == TIZEN_POLICY_ERROR_STATE_PERMISSION_DENIED )
+ else if( mEventHandler->mScreenOffModeChangeState == TIZEN_POLICY_ERROR_STATE_PERMISSION_DENIED )
{
- DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetScreenMode: Permission denied! [%d]\n", screenMode );
+ DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetScreenOffMode: Permission denied! [%d]\n", screenOffMode );
return false;
}
- DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetScreenMode: Screen mode is changed [%d]\n", mEventHandler->mScreenMode );
+ DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetScreenOffMode: Screen mode is changed [%d]\n", mEventHandler->mScreenOffMode );
return true;
}
-Dali::DevelWindow::ScreenMode::Type Window::GetScreenMode()
+Dali::Window::ScreenOffMode::Type Window::GetScreenOffMode() const
{
while( !mEventHandler->mTizenPolicy )
{
int count = 0;
- while( !mEventHandler->mScreenModeChangeDone && count < 3 )
+ while( !mEventHandler->mScreenOffModeChangeDone && count < 3 )
{
ecore_wl_flush();
wl_display_dispatch_queue( mEventHandler->mDisplay, mEventHandler->mEventQueue );
count++;
}
- if( !mEventHandler->mScreenModeChangeDone )
+ if( !mEventHandler->mScreenOffModeChangeDone )
{
- DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::GetScreenMode: Error! [%d]\n", mEventHandler->mScreenModeChangeState );
- return Dali::DevelWindow::ScreenMode::DEFAULT;
+ DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::GetScreenOffMode: Error! [%d]\n", mEventHandler->mScreenOffModeChangeState );
+ return Dali::Window::ScreenOffMode::TIMEOUT;
}
- Dali::DevelWindow::ScreenMode::Type screenMode = Dali::DevelWindow::ScreenMode::DEFAULT;
+ Dali::Window::ScreenOffMode::Type screenMode = Dali::Window::ScreenOffMode::TIMEOUT;
- switch( mEventHandler->mScreenMode )
+ switch( mEventHandler->mScreenOffMode )
{
case 0:
{
- screenMode = Dali::DevelWindow::ScreenMode::DEFAULT;
+ screenMode = Dali::Window::ScreenOffMode::TIMEOUT;
break;
}
case 1:
{
- screenMode = Dali::DevelWindow::ScreenMode::ALWAYS_ON;
+ screenMode = Dali::Window::ScreenOffMode::NEVER;
break;
}
}
- DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::GetScreenMode: screen mode [%d]\n", mEventHandler->mScreenMode );
+ DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::GetScreenOffMode: screen mode [%d]\n", mEventHandler->mScreenOffMode );
return screenMode;
}
return true;
}
-int Window::GetBrightness()
+int Window::GetBrightness() const
{
while( !mEventHandler->mTizenDisplayPolicy )
{
return mEventHandler->mBrightness;
}
-void Window::SetSize( Dali::DevelWindow::WindowSize size )
+void Window::SetSize( Dali::Window::WindowSize size )
{
if( !mResizeEnabled )
{
mSurface->MoveResize( positionSize );
- mAdaptor->SurfaceResizePrepare( Dali::Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
+ mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
// Emit signal
- mResizedSignal.Emit( Dali::DevelWindow::WindowSize( positionSize.width, positionSize.height ) );
+ mResizedSignal.Emit( Dali::Window::WindowSize( positionSize.width, positionSize.height ) );
- mAdaptor->SurfaceResizeComplete( Dali::Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
+ mAdaptor->SurfaceResizeComplete( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
}
}
-Dali::DevelWindow::WindowSize Window::GetSize()
+Dali::Window::WindowSize Window::GetSize() const
{
PositionSize positionSize = mSurface->GetPositionSize();
- return Dali::DevelWindow::WindowSize( positionSize.width, positionSize.height );
+ return Dali::Window::WindowSize( positionSize.width, positionSize.height );
}
-void Window::SetPosition( Dali::DevelWindow::WindowPosition position )
+void Window::SetPosition( Dali::Window::WindowPosition position )
{
if( !mResizeEnabled )
{
}
}
-Dali::DevelWindow::WindowPosition Window::GetPosition()
+Dali::Window::WindowPosition Window::GetPosition() const
{
PositionSize positionSize = mSurface->GetPositionSize();
- return Dali::DevelWindow::WindowPosition( positionSize.x, positionSize.y );
+ return Dali::Window::WindowPosition( positionSize.x, positionSize.y );
}
void Window::SetTransparency( bool transparent )
{
ECore::WindowRenderSurface* wlSurface( dynamic_cast< ECore::WindowRenderSurface * >( mSurface ) );
- wlSurface->SetTransparency( transparent );
+ if( wlSurface )
+ {
+ wlSurface->SetTransparency( transparent );
+ }
}
} // Adaptor
#include <window-render-surface.h>
// EXTERNAL INCLUDES
-#include <dlfcn.h>
#include <dali/integration-api/gl-abstraction.h>
#include <dali/integration-api/debug.h>
-#include <dali/integration-api/gl-defines.h>
// INTERNAL INCLUDES
#include <wl-types.h>
transform = ecore_wl_output_transform_get( ecore_wl_window_output_find( mWlWindow ) );
}
- ecore_wl_window_buffer_transform_set( mWlWindow, transform );
-
mScreenRotationAngle = transform * 90;
mScreenRotationFinished = false;
Ecore_Wl_Output* output = ecore_wl_window_output_find( mWlWindow );
int transform = ecore_wl_output_transform_get( output );
- ecore_wl_window_buffer_transform_set( mWlWindow, transform );
mScreenRotationAngle = transform * 90;
mScreenRotationFinished = false;
#include <dali/public-api/math/rect.h>
#include <dali/public-api/events/touch-event.h>
#include <dali/public-api/common/view-mode.h>
-#include <dali/public-api/math/uint-16-pair.h>
// INTERNAL INCLUDES
typedef Signal< void (Adaptor&) > AdaptorSignalType; ///< Generic Type for adaptor signals
- typedef Uint16Pair SurfaceSize; ///< Surface size type
-
public:
/**
* @brief Create a new adaptor using the window.
typedef Dali::ImfManager::StatusSignalType ImfStatusSignalType;
typedef Dali::ImfManager::VoidSignalType ImfVoidSignalType;
typedef Dali::ImfManager::KeyboardTypeSignalType ImfKeyboardTypeSignalType;
+ typedef Dali::ImfManager::KeyboardResizedSignalType KeyboardResizedSignalType;
+ typedef Dali::ImfManager::LanguageChangedSignalType LanguageChangedSignalType;
public:
void ApplyOptions( const InputMethodOptions& options );
/**
- * @copydoc Dali::ImfManager::SetInputPanelUserData()
+ * @copydoc Dali::ImfManager::SetInputPanelData()
*/
- void SetInputPanelUserData( const std::string& data );
+ void SetInputPanelData( const std::string& data );
/**
- * @copydoc Dali::ImfManager::GetInputPanelUserData()
+ * @copydoc Dali::ImfManager::GetInputPanelData()
*/
- void GetInputPanelUserData( std::string& data );
+ void GetInputPanelData( std::string& data );
/**
* @copydoc Dali::ImfManager::GetInputPanelState()
/**
* @copydoc Dali::ImfManager::ResizedSignal()
*/
- ImfVoidSignalType& ResizedSignal() { return mKeyboardResizeSignal; }
+ KeyboardResizedSignalType& ResizedSignal() { return mKeyboardResizeSignal; }
/**
* @copydoc Dali::ImfManager::LanguageChangedSignal()
*/
- ImfVoidSignalType& LanguageChangedSignal() { return mKeyboardLanguageChangedSignal; }
+ LanguageChangedSignalType& LanguageChangedSignal() { return mKeyboardLanguageChangedSignal; }
/**
* @copydoc Dali::ImfManager::KeyboardTypeChangedSignal()
ImfManagerSignalType mActivatedSignal;
ImfEventSignalType mEventSignal;
ImfStatusSignalType mKeyboardStatusSignal;
- ImfVoidSignalType mKeyboardResizeSignal;
- ImfVoidSignalType mKeyboardLanguageChangedSignal;
+ KeyboardResizedSignalType mKeyboardResizeSignal;
+ LanguageChangedSignalType mKeyboardLanguageChangedSignal;
ImfKeyboardTypeSignalType mKeyboardTypeChangedSignal;
public:
}
internal->SetStyleSheet( stylesheet );
- DevelWindow::SetTransparency( internal->GetWindow(), ( windowMode == Application::OPAQUE ? false : true ) );
+ internal->GetWindow().SetTransparency( ( windowMode == Application::OPAQUE ? false : true ) );
return Application( internal.Get() );
}
}
}
+Application Application::New( int* argc, char **argv[], const std::string& stylesheet, Application::WINDOW_MODE windowMode, PositionSize positionSize )
+{
+ Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::GetPreInitializedApplication();
+ if( internal )
+ {
+ if( argc && ( *argc > 0 ) )
+ {
+ internal->GetWindow().SetClass( (*argv)[0], "" );
+ }
+ internal->SetStyleSheet( stylesheet );
+
+ internal->GetWindow().SetTransparency( ( windowMode == Application::OPAQUE ? false : true ) );
+ internal->GetWindow().SetSize( Window::WindowSize( positionSize.width, positionSize.height ) );
+ internal->GetWindow().SetPosition( Window::WindowPosition( positionSize.x, positionSize.y ) );
+
+ return Application( internal.Get() );
+ }
+ else
+ {
+ internal = Internal::Adaptor::Application::New( argc, argv, stylesheet, windowMode, positionSize, Internal::Adaptor::Framework::NORMAL );
+ return Application( internal.Get() );
+ }
+}
+
Application::~Application()
{
}
return Internal::Adaptor::Application::GetResourcePath();
}
+std::string Application::GetRegion() const
+{
+ return Internal::Adaptor::GetImplementation(*this).GetRegion();
+}
+
+std::string Application::GetLanguage() const
+{
+ return Internal::Adaptor::GetImplementation(*this).GetLanguage();
+}
+
void Application::SetViewMode( ViewMode viewMode )
{
Internal::Adaptor::GetImplementation(*this).SetViewMode( viewMode );
Application::AppSignalType& Application::BatteryLowSignal()
{
+ DALI_LOG_WARNING_NOFN( "DEPRECATION WARNING: BatteryLowSignal() is deprecated and will be removed from next release. Use Application::LowBatterySignal() instead.\n" );
return Internal::Adaptor::GetImplementation(*this).BatteryLowSignal();
}
Application::AppSignalType& Application::MemoryLowSignal()
{
+ DALI_LOG_WARNING_NOFN( "DEPRECATION WARNING: MemoryLowSignal() is deprecated and will be removed from next release. Use Application::LowMemorySignal() instead.\n" );
return Internal::Adaptor::GetImplementation(*this).MemoryLowSignal();
}
+Application::LowBatterySignalType& Application::LowBatterySignal()
+{
+ return Internal::Adaptor::GetImplementation(*this).LowBatterySignal();
+}
+
+Application::LowMemorySignalType& Application::LowMemorySignal()
+{
+ return Internal::Adaptor::GetImplementation(*this).LowMemorySignal();
+}
+
Application::Application(Internal::Adaptor::Application* application)
: BaseHandle(application)
{
#include <dali/public-api/object/base-handle.h>
#include <dali/public-api/signals/callback.h>
-
// INTERNAL INCLUDES
#include "application-configuration.h"
+#include "device-status.h"
#include "window.h"
namespace Dali
{
public:
+ typedef Signal< void (DeviceStatus::Battery::Status) > LowBatterySignalType; ///< Application device signal type @SINCE_1_2.62
+ typedef Signal< void (DeviceStatus::Memory::Status) > LowMemorySignalType; ///< Application device signal type @SINCE_1_2.62
typedef Signal< void (Application&) > AppSignalType; ///< Application lifecycle signal and system signal callback type @SINCE_1_0.0
typedef Signal< void (Application&, void *) > AppControlSignalType; ///< Application control signal callback type @SINCE_1_0.0
static Application New( int* argc, char **argv[], const std::string& stylesheet, WINDOW_MODE windowMode );
/**
+ * @brief This is the constructor for applications.
+ *
+ * @SINCE_1_2.60
+ * @PRIVLEVEL_PUBLIC
+ * @PRIVILEGE_DISPLAY
+ * @param[in,out] argc A pointer to the number of arguments
+ * @param[in,out] argv A pointer to the argument list
+ * @param[in] stylesheet The path to user defined theme file
+ * @param[in] windowMode A member of WINDOW_MODE
+ * @param[in] positionSize A position and a size of the window
+ * @return A handle to the Application
+ * @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, Application::WINDOW_MODE windowMode, PositionSize positionSize );
+
+ /**
* @brief Constructs an empty handle.
* @SINCE_1_0.0
*/
*/
static std::string GetResourcePath();
+ /**
+ * @brief This is used to get region information from device.
+ *
+ * @SINCE_1_2.62
+ * @return Region information
+ */
+ std::string GetRegion() const;
+
+ /**
+ * @brief This is used to get language information from device.
+ *
+ * @SINCE_1_2.62
+ * @return Language information
+ */
+ std::string GetLanguage() const;
public: // Stereoscopy
* @SINCE_1_0.0
* @return The signal to connect to
*/
- AppSignalType& ResizeSignal();
+ AppSignalType& ResizeSignal() DALI_DEPRECATED_API;
/**
* @brief This signal is emitted when another application sends a launch request to the application.
AppSignalType& RegionChangedSignal();
/**
+ * @DEPRECATED_1_2.62 Use LowBatterySignal() instead.
* @brief This signal is emitted when the battery level of the device is low.
* @SINCE_1_0.0
* @return The signal to connect to
*/
- AppSignalType& BatteryLowSignal();
+ AppSignalType& BatteryLowSignal() DALI_DEPRECATED_API;
/**
+ * @DEPRECATED_1_2.62 Use LowMemorySignal() instead.
* @brief This signal is emitted when the memory level of the device is low.
* @SINCE_1_0.0
* @return The signal to connect to
*/
- AppSignalType& MemoryLowSignal();
+ AppSignalType& MemoryLowSignal() DALI_DEPRECATED_API;
+
+ /**
+ * @brief This signal is emitted when the battery level of the device is low.
+ * @SINCE_1_2.62
+ * @return The signal to connect to
+ */
+ LowBatterySignalType& LowBatterySignal();
+
+ /**
+ * @brief This signal is emitted when the memory level of the device is low.
+ * @SINCE_1_2.62
+ * @return The signal to connect to
+ */
+ LowMemorySignalType& LowMemorySignal();
public: // Not intended for application developers
/// @cond internal
--- /dev/null
+#ifndef __DALI_DEVICE_STATUS_H__
+#define __DALI_DEVICE_STATUS_H__
+
+/*
+ * Copyright (c) 2017 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.
+ *
+ */
+
+namespace Dali
+{
+/**
+ * @addtogroup dali_adaptor_framework
+ * @{
+ */
+
+namespace DeviceStatus
+{
+/**
+ * @brief Struct for battery of the device.
+ * @SINCE_1_2.62
+ */
+struct Battery
+{
+ /**
+ * @brief Enumeration for battery status.
+ * @SINCE_1_2.62
+ */
+ enum Status
+ {
+ NORMAL, ///< Battery is over 5% @SINCE_1_2.62
+ CRITICALLY_LOW, ///< Battery is under 5% @SINCE_1_2.62
+ POWER_OFF ///< Battery is under 1% @SINCE_1_2.62
+ };
+};
+
+/**
+ * @brief Struct for memory of the device.
+ * @SINCE_1_2.62
+ */
+struct Memory
+{
+ /**
+ * @brief Enumeration for memory status.
+ * @SINCE_1_2.62
+ */
+ enum Status
+ {
+ NORMAL, ///< Normal Status @SINCE_1_2.62
+ LOW, ///< Memory is low but not critical @SINCE_1_2.62
+ CRITICALLY_LOW ///< Memory is critically low @SINCE_1_2.62
+ };
+};
+
+}// namespace DeviceStatus
+
+/**
+ * @}
+ */
+} // namespace Dali
+
+#endif // __DALI_DEVICE_STATUS_H__
return GetImplementation(*this).GetNativeHandle();
}
+Window::FocusSignalType& Window::FocusChangedSignal()
+{
+ return GetImplementation(*this).FocusChangedSignal();
+}
+
+void Window::SetAcceptFocus( bool accept )
+{
+ GetImplementation(*this).SetAcceptFocus( accept );
+}
+
+bool Window::IsFocusAcceptable() const
+{
+ return GetImplementation(*this).IsFocusAcceptable();
+}
+
+void Window::Show()
+{
+ GetImplementation(*this).Show();
+}
+
+void Window::Hide()
+{
+ GetImplementation(*this).Hide();
+}
+
+bool Window::IsVisible() const
+{
+ return GetImplementation(*this).IsVisible();
+}
+
+unsigned int Window::GetSupportedAuxiliaryHintCount() const
+{
+ return GetImplementation(*this).GetSupportedAuxiliaryHintCount();
+}
+
+std::string Window::GetSupportedAuxiliaryHint( unsigned int index ) const
+{
+ return GetImplementation(*this).GetSupportedAuxiliaryHint( index );
+}
+
+unsigned int Window::AddAuxiliaryHint( const std::string& hint, const std::string& value )
+{
+ return GetImplementation(*this).AddAuxiliaryHint( hint, value );
+}
+
+bool Window::RemoveAuxiliaryHint( unsigned int id )
+{
+ return GetImplementation(*this).RemoveAuxiliaryHint( id );
+}
+
+bool Window::SetAuxiliaryHintValue( unsigned int id, const std::string& value )
+{
+ return GetImplementation(*this).SetAuxiliaryHintValue( id, value );
+}
+
+std::string Window::GetAuxiliaryHintValue( unsigned int id ) const
+{
+ return GetImplementation(*this).GetAuxiliaryHintValue( id );
+}
+
+unsigned int Window::GetAuxiliaryHintId( const std::string& hint ) const
+{
+ return GetImplementation(*this).GetAuxiliaryHintId( hint );
+}
+
+void Window::SetInputRegion( const Rect< int >& inputRegion )
+{
+ return GetImplementation(*this).SetInputRegion( inputRegion );
+}
+
+void Window::SetType( Window::Type type )
+{
+ GetImplementation(*this).SetType( type );
+}
+
+Window::Type Window::GetType() const
+{
+ return GetImplementation(*this).GetType();
+}
+
+bool Window::SetNotificationLevel( Window::NotificationLevel::Type level )
+{
+ return GetImplementation(*this).SetNotificationLevel( level );
+}
+
+Window::NotificationLevel::Type Window::GetNotificationLevel() const
+{
+ return GetImplementation(*this).GetNotificationLevel();
+}
+
+void Window::SetOpaqueState( bool opaque )
+{
+ GetImplementation(*this).SetOpaqueState( opaque );
+}
+
+bool Window::IsOpaqueState() const
+{
+ return GetImplementation(*this).IsOpaqueState();
+}
+
+bool Window::SetScreenOffMode(Window::ScreenOffMode::Type screenMode)
+{
+ return GetImplementation(*this).SetScreenOffMode(screenMode);
+}
+
+Window::ScreenOffMode::Type Window::GetScreenOffMode() const
+{
+ return GetImplementation(*this).GetScreenOffMode();
+}
+
+bool Window::SetBrightness( int brightness )
+{
+ return GetImplementation(*this).SetBrightness( brightness );
+}
+
+int Window::GetBrightness() const
+{
+ return GetImplementation(*this).GetBrightness();
+}
+
+Window::ResizedSignalType& Window::ResizedSignal()
+{
+ return GetImplementation(*this).ResizedSignal();
+}
+
+void Window::SetSize( Window::WindowSize size )
+{
+ GetImplementation(*this).SetSize( size );
+}
+
+Window::WindowSize Window::GetSize() const
+{
+ return GetImplementation(*this).GetSize();
+}
+
+void Window::SetPosition( Window::WindowPosition position )
+{
+ GetImplementation(*this).SetPosition( position );
+}
+
+Window::WindowPosition Window::GetPosition() const
+{
+ return GetImplementation(*this).GetPosition();
+}
+
+void Window::SetTransparency( bool transparent )
+{
+ GetImplementation(*this).SetTransparency( transparent );
+}
+
Window::Window( Internal::Adaptor::Window* window )
: BaseHandle( window )
{
// EXTERNAL INCLUDES
#include <string>
#include <dali/public-api/math/rect.h>
+#include <dali/public-api/math/uint-16-pair.h>
#include <dali/public-api/math/vector2.h>
#include <dali/public-api/object/base-handle.h>
#include <dali/public-api/object/any.h>
class DALI_IMPORT_API Window : public BaseHandle
{
public:
+
+ typedef Uint16Pair WindowSize; ///< Window size type @SINCE_1_2.60
+ typedef Uint16Pair WindowPosition; ///< Window position type @SINCE_1_2.60
+
typedef Signal< void (bool) > IndicatorSignalType; ///< Indicator state signal type @SINCE_1_0.0
+ typedef Signal< void (bool) > FocusSignalType; ///< Window focus signal type @SINCE_1_2.60
+ typedef Signal< void (WindowSize) > ResizedSignalType; ///< Window resized signal type @SINCE_1_2.60
public:
AUTO = 2 ///< Hide in default, will show when necessary @SINCE_1_0.0
};
+ /**
+ * @brief An enum of Window types.
+ * @SINCE_1_2.60
+ */
+ enum Type
+ {
+ NORMAL, ///< A default window type. Indicates a normal, top-level window. Almost every window will be created with this type. @SINCE_1_2.60
+ NOTIFICATION, ///< A notification window, like a warning about battery life or a new E-Mail received. @SINCE_1_2.60
+ UTILITY, ///< A persistent utility window, like a toolbox or palette. @SINCE_1_2.60
+ DIALOG ///< Used for simple dialog windows. @SINCE_1_2.60
+ };
+
+ /**
+ * @brief An enum of screen mode.
+ * @SINCE_1_2.60
+ */
+ struct NotificationLevel
+ {
+ /**
+ * @brief An enum of screen mode.
+ * @SINCE_1_2.60
+ */
+ enum Type
+ {
+ NONE = -1, ///< No notification level. Default level. This value makes the notification window place in the layer of the normal window. @SINCE_1_2.60
+ BASE = 10, ///< Base notification level. @SINCE_1_2.60
+ MEDIUM = 20, ///< Higher notification level than base. @SINCE_1_2.60
+ HIGH = 30, ///< Higher notification level than medium. @SINCE_1_2.60
+ TOP = 40 ///< The highest notification level. @SINCE_1_2.60
+ };
+ };
+
+ /**
+ * @brief An enum of screen mode.
+ * @SINCE_1_2.60
+ */
+ struct ScreenOffMode
+ {
+ /**
+ * @brief An enum of screen mode.
+ * @SINCE_1_2.60
+ */
+ enum Type
+ {
+ TIMEOUT, ///< The mode which turns the screen off after a timeout. @SINCE_1_2.60
+ NEVER, ///< The mode which keeps the screen turned on. @SINCE_1_2.60
+ };
+
+ static constexpr Type DEFAULT { TIMEOUT }; ///< The default mode. @SINCE_1_2.60
+ };
+
// Methods
/**
*/
Any GetNativeHandle() const;
+ /**
+ * @brief Sets whether window accepts focus or not.
+ *
+ * @SINCE_1_2.60
+ * @param[in] accept If focus is accepted or not. Default is true.
+ */
+ void SetAcceptFocus( bool accept );
+
+ /**
+ * @brief Returns whether window accepts focus or not.
+ *
+ * @SINCE_1_2.60
+ * @return True if the window accept focus, false otherwise
+ */
+ bool IsFocusAcceptable() const;
+
+ /**
+ * @brief Shows the window if it is hidden.
+ * @SINCE_1_2.60
+ */
+ void Show();
+
+ /**
+ * @brief Hides the window if it is showing.
+ * @SINCE_1_2.60
+ */
+ void Hide();
+
+ /**
+ * @brief Returns whether the window is visible or not.
+ * @SINCE_1_2.60
+ * @return True if the window is visible, false otherwise.
+ */
+ bool IsVisible() const;
+
+ /**
+ * @brief Gets the count of supported auxiliary hints of the window.
+ * @SINCE_1_2.60
+ * @return The number of supported auxiliary hints.
+ *
+ * @note The window auxiliary hint is the value which is used to decide which actions should be made available to the user by the window manager.
+ * If you want to set specific hint to your window, then you should check whether it exists in the supported auxiliary hints.
+ */
+ unsigned int GetSupportedAuxiliaryHintCount() const;
+
+ /**
+ * @brief Gets the supported auxiliary hint string of the window.
+ * @SINCE_1_2.60
+ * @param[in] index The index of the supported auxiliary hint lists
+ * @return The auxiliary hint string of the index.
+ *
+ * @note The window auxiliary hint is the value which is used to decide which actions should be made available to the user by the window manager.
+ * If you want to set specific hint to your window, then you should check whether it exists in the supported auxiliary hints.
+ */
+ std::string GetSupportedAuxiliaryHint( unsigned int index ) const;
+
+ /**
+ * @brief Creates an auxiliary hint of the window.
+ * @SINCE_1_2.60
+ * @param[in] hint The auxiliary hint string.
+ * @param[in] value The value string.
+ * @return The ID of created auxiliary hint, or @c 0 on failure.
+ */
+ unsigned int AddAuxiliaryHint( const std::string& hint, const std::string& value );
+
+ /**
+ * @brief Removes an auxiliary hint of the window.
+ * @SINCE_1_2.60
+ * @param[in] id The ID of the auxiliary hint.
+ * @return True if no error occurred, false otherwise.
+ */
+ bool RemoveAuxiliaryHint( unsigned int id );
+
+ /**
+ * @brief Changes a value of the auxiliary hint.
+ * @SINCE_1_2.60
+ * @param[in] id The auxiliary hint ID.
+ * @param[in] value The value string to be set.
+ * @return True if no error occurred, false otherwise.
+ */
+ bool SetAuxiliaryHintValue( unsigned int id, const std::string& value );
+
+ /**
+ * @brief Gets a value of the auxiliary hint.
+ * @SINCE_1_2.60
+ * @param[in] id The auxiliary hint ID.
+ * @return The string value of the auxiliary hint ID, or an empty string if none exists.
+ */
+ std::string GetAuxiliaryHintValue( unsigned int id ) const;
+
+ /**
+ * @brief Gets a ID of the auxiliary hint string.
+ * @SINCE_1_2.60
+ * @param[in] hint The auxiliary hint string.
+ * @return The ID of the auxiliary hint string, or @c 0 if none exists.
+ */
+ unsigned int GetAuxiliaryHintId( const std::string& hint ) const;
+
+ /**
+ * @brief Sets a region to accept input events.
+ * @SINCE_1_2.60
+ * @param[in] inputRegion The region to accept input events.
+ */
+ void SetInputRegion( const Rect< int >& inputRegion );
+
+ /**
+ * @brief Sets a window type.
+ * @SINCE_1_2.60
+ * @param[in] type The window type.
+ * @remarks The default window type is NORMAL.
+ */
+ void SetType( Type type );
+
+ /**
+ * @brief Gets a window type.
+ * @SINCE_1_2.60
+ * @return A window type.
+ */
+ Type GetType() const;
+
+ /**
+ * @brief Sets a priority level for the specified notification window.
+ * @SINCE_1_2.60
+ * @param[in] level The notification window level.
+ * @return True if no error occurred, false otherwise.
+ * @PRIVLEVEL_PUBLIC
+ * @PRIVILEGE_WINDOW_PRIORITY
+ * @remarks This can be used for a notification type window only. The default level is NotificationLevel::NONE.
+ */
+ bool SetNotificationLevel( NotificationLevel::Type level );
+
+ /**
+ * @brief Gets a priority level for the specified notification window.
+ * @SINCE_1_2.60
+ * @return The notification window level.
+ * @remarks This can be used for a notification type window only.
+ */
+ NotificationLevel::Type GetNotificationLevel() const;
+
+ /**
+ * @brief Sets a transparent window's visual state to opaque.
+ * @details If a visual state of a transparent window is opaque,
+ * then the window manager could handle it as an opaque window when calculating visibility.
+ * @SINCE_1_2.60
+ * @param[in] opaque Whether the window's visual state is opaque.
+ * @remarks This will have no effect on an opaque window.
+ * It doesn't change transparent window to opaque window but lets the window manager know the visual state of the window.
+ */
+ void SetOpaqueState( bool opaque );
+
+ /**
+ * @brief Returns whether a transparent window's visual state is opaque or not.
+ * @SINCE_1_2.60
+ * @return True if the window's visual state is opaque, false otherwise.
+ * @remarks The return value has no meaning on an opaque window.
+ */
+ bool IsOpaqueState() const;
+
+ /**
+ * @brief Sets a window's screen off mode.
+ * @details This API is useful when the application needs to keep the display turned on.
+ * If the application sets the screen mode to #::Dali::Window::ScreenOffMode::NEVER to its window and the window is shown,
+ * the window manager requests the display system to keep the display on as long as the window is shown.
+ * If the window is no longer shown, then the window manager requests the display system to go back to normal operation.
+ * @SINCE_1_2.60
+ * @param[in] screenOffMode The screen mode.
+ * @return True if no error occurred, false otherwise.
+ * @PRIVLEVEL_PUBLIC
+ * @PRIVILEGE_DISPLAY
+ */
+ bool SetScreenOffMode(ScreenOffMode::Type screenOffMode);
+
+ /**
+ * @brief Gets a screen off mode of the window.
+ * @SINCE_1_2.60
+ * @return The screen off mode.
+ */
+ ScreenOffMode::Type GetScreenOffMode() const;
+
+ /**
+ * @brief Sets preferred brightness of the window.
+ * @details This API is useful when the application needs to change the brightness of the screen when it is appeared on the screen.
+ * If the brightness has been set and the window is shown, the window manager requests the display system to change the brightness to the provided value.
+ * If the window is no longer shown, then the window manager requests the display system to go back to default brightness.
+ * A value less than 0 results in default brightness and a value greater than 100 results in maximum brightness.
+ * @SINCE_1_2.60
+ * @param[in] brightness The preferred brightness (0 to 100).
+ * @return True if no error occurred, false otherwise.
+ * @PRIVLEVEL_PUBLIC
+ * @PRIVILEGE_DISPLAY
+ */
+ bool SetBrightness( int brightness );
+
+ /**
+ * @brief Gets preffered brightness of the window.
+ * @return The preffered brightness.
+ */
+ int GetBrightness() const;
+
+ /**
+ * @brief Sets a size of the window.
+ *
+ * @SINCE_1_2.60
+ * @param[in] size The new window size
+ */
+ void SetSize( WindowSize size );
+
+ /**
+ * @brief Gets a size of the window.
+ *
+ * @SINCE_1_2.60
+ * @return The size of the window
+ */
+ WindowSize GetSize() const;
+
+ /**
+ * @brief Sets a position of the window.
+ *
+ * @SINCE_1_2.60
+ * @param[in] position The new window position
+ */
+ void SetPosition( WindowPosition position );
+
+ /**
+ * @brief Gets a position of the window.
+ *
+ * @SINCE_1_2.60
+ * @return The position of the window
+ */
+ WindowPosition GetPosition() const;
+
+ /**
+ * @brief Sets whether the window is transparent or not.
+ *
+ * @SINCE_1_2.60
+ * @param[in] transparent Whether the window is transparent
+ */
+ void SetTransparency( bool transparent );
+
public: // Signals
/**
* @brief The user should connect to this signal to get a timing when indicator was shown / hidden.
*/
IndicatorSignalType& IndicatorVisibilityChangedSignal();
+ /**
+ * @brief The user should connect to this signal to get a timing when window gains focus or loses focus.
+ *
+ * A callback of the following type may be connected:
+ * @code
+ * void YourCallbackName( bool focusIn );
+ * @endcode
+ * The parameter is true if window gains focus, otherwise false.
+ *
+ * @SINCE_1_2.60
+ * @return The signal to connect to
+ */
+ FocusSignalType& FocusChangedSignal();
+
+ /**
+ * @brief This signal is emitted when the window is resized.
+ *
+ * A callback of the following type may be connected:
+ * @code
+ * void YourCallbackName( int width, int height );
+ * @endcode
+ * The parameters are the resized width and height.
+ *
+ * @SINCE_1_2.60
+ * @return The signal to connect to
+ */
+ ResizedSignalType& ResizedSignal();
+
public: // Not intended for application developers
/// @cond internal
/**
const unsigned int ADAPTOR_MAJOR_VERSION = 1;
const unsigned int ADAPTOR_MINOR_VERSION = 2;
-const unsigned int ADAPTOR_MICRO_VERSION = 56;
+const unsigned int ADAPTOR_MICRO_VERSION = 65;
const char * const ADAPTOR_BUILD_DATE = __DATE__ " " __TIME__;
#ifdef DEBUG_ENABLED
// Application / UI Framework adaption
#include <dali/public-api/adaptor-framework/application.h>
+#include <dali/public-api/adaptor-framework/device-status.h>
#include <dali/public-api/adaptor-framework/input-method.h>
#include <dali/public-api/adaptor-framework/key.h>
#include <dali/public-api/adaptor-framework/timer.h>
public_api_adaptor_framework_header_files = \
$(adaptor_public_api_dir)/adaptor-framework/application.h \
$(adaptor_public_api_dir)/adaptor-framework/application-configuration.h \
+ $(adaptor_public_api_dir)/adaptor-framework/device-status.h \
$(adaptor_public_api_dir)/adaptor-framework/input-method.h \
$(adaptor_public_api_dir)/adaptor-framework/key.h \
$(adaptor_public_api_dir)/adaptor-framework/style-change.h \
#include <Ecore.h>
#include <system_info.h>
+#include <system_settings.h>
#include <app_control_internal.h>
#include <bundle_internal.h>
#endif
mApplicationType = type;
mCallbackManager = CallbackManager::New();
+
+ char* region;
+ char* language;
+ system_settings_get_value_string( SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY, ®ion );
+ system_settings_get_value_string( SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &language );
+ mRegion = std::string( region );
+ mLanguage = std::string( language );
}
~Impl()
}
}
+ std::string GetLanguage() const
+ {
+ return mLanguage;
+ }
+
+ std::string GetRegion() const
+ {
+ return mRegion;
+ }
// Data
Type mApplicationType;
CallbackBase* mAbortCallBack;
CallbackManager *mCallbackManager;
+ std::string mLanguage;
+ std::string mRegion;
Framework* mFramework;
app_event_handler_h handlers[5];
static void AppLanguageChanged(app_event_info_h event, void *data)
{
Observer *observer = &static_cast<Framework*>(data)->mObserver;
-
observer->OnLanguageChanged();
}
static void AppRegionChanged(app_event_info_h event, void *data)
{
Observer *observer = &static_cast<Framework*>(data)->mObserver;
-
observer->OnRegionChanged();
}
static void AppBatteryLow(app_event_info_h event, void *data)
{
Observer *observer = &static_cast<Framework*>(data)->mObserver;
-
- observer->OnBatteryLow();
+ observer->OnBatteryLow(Dali::DeviceStatus::Battery::NORMAL);
}
static void AppMemoryLow(app_event_info_h event, void *data)
{
Observer *observer = &static_cast<Framework*>(data)->mObserver;
-
- observer->OnMemoryLow();
+ observer->OnMemoryLow(Dali::DeviceStatus::Memory::NORMAL);
}
private:
}
}
+std::string Framework::GetLanguage() const
+{
+ return mImpl->GetLanguage();
+}
+
+std::string Framework::GetRegion() const
+{
+ return mImpl->GetRegion();
+}
+
} // namespace Adaptor
} // namespace Internal
#include <Ecore.h>
#include <system_info.h>
+#include <system_settings.h>
#include <bundle_internal.h>
// CONDITIONAL INCLUDES
#endif
mApplicationType = type;
mCallbackManager = CallbackManager::New();
+
+ char* region;
+ char* language;
+ system_settings_get_value_string( SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY, ®ion );
+ system_settings_get_value_string( SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &language );
+ mRegion = std::string( region );
+ mLanguage = std::string( language );
}
~Impl()
}
}
+ void SetLanguage( const std::string& language )
+ {
+ mLanguage = language;
+ }
+
+ void SetRegion( const std::string& region )
+ {
+ mRegion = region;
+ }
+
+ std::string GetLanguage() const
+ {
+ return mLanguage;
+ }
+
+ std::string GetRegion() const
+ {
+ return mRegion;
+ }
// Data
Type mApplicationType;
CallbackBase* mAbortCallBack;
CallbackManager *mCallbackManager;
+ std::string mLanguage;
+ std::string mRegion;
Framework* mFramework;
AppCore::AppEventHandlerPtr handlers[5];
return 0;
}
- static int AppInit(int argc, char **argv, void *data)
+ static void AppInit(int argc, char **argv, void *data)
{
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wold-style-cast"
ecore_app_args_set( argc, (const char **)argv );
#pragma GCC diagnostic pop
- return 0;
}
static void AppFinish(void)
static void AppLanguageChanged(AppCore::AppEventInfoPtr event, void *data)
{
- Observer *observer = &static_cast<Framework*>(data)->mObserver;
-
+ Framework* framework = static_cast<Framework*>(data);
+ Observer *observer = &framework->mObserver;
+ framework->SetLanguage( std::string( static_cast<const char *>(event->value) ) );
observer->OnLanguageChanged();
}
static void AppRegionChanged(AppCore::AppEventInfoPtr event, void *data)
{
- Observer *observer = &static_cast<Framework*>(data)->mObserver;
-
+ Framework* framework = static_cast<Framework*>(data);
+ Observer *observer = &framework->mObserver;
+ framework->SetRegion( std::string( static_cast<const char *>(event->value) ) );
observer->OnRegionChanged();
}
static void AppBatteryLow(AppCore::AppEventInfoPtr event, void *data)
{
Observer *observer = &static_cast<Framework*>(data)->mObserver;
+ int status = *static_cast<int *>(event->value);
+ Dali::DeviceStatus::Battery::Status result = Dali::DeviceStatus::Battery::NORMAL;
- observer->OnBatteryLow();
+ // convert to dali battery status
+ switch( status )
+ {
+ case 1:
+ {
+ result = Dali::DeviceStatus::Battery::POWER_OFF;
+ break;
+ }
+ case 2:
+ {
+ result = Dali::DeviceStatus::Battery::CRITICALLY_LOW;
+ break;
+ }
+ default :
+ break;
+ }
+ observer->OnBatteryLow(result);
}
static void AppMemoryLow(AppCore::AppEventInfoPtr event, void *data)
{
Observer *observer = &static_cast<Framework*>(data)->mObserver;
+ int status = *static_cast<int *>(event->value);
+ Dali::DeviceStatus::Memory::Status result = Dali::DeviceStatus::Memory::NORMAL;
- observer->OnMemoryLow();
+ // convert to dali memmory status
+ switch( status )
+ {
+ case 1:
+ {
+ result = Dali::DeviceStatus::Memory::NORMAL;
+ break;
+ }
+ case 2:
+ {
+ result = Dali::DeviceStatus::Memory::LOW;
+ break;
+ }
+ case 4:
+ {
+ result = Dali::DeviceStatus::Memory::CRITICALLY_LOW;
+ break;
+ }
+ default :
+ break;
+ }
+ observer->OnMemoryLow(result);
}
observer->OnAmbientChanged(ambient);
}
- static void WatchAppLanguageChanged(app_event_info_h event, void *data)
- {
- Observer *observer = &static_cast<Framework*>(data)->mObserver;
-
- observer->OnLanguageChanged();
- }
-
- static void WatchAppRegionChanged(app_event_info_h event, void *data)
- {
- Observer *observer = &static_cast<Framework*>(data)->mObserver;
-
- observer->OnRegionChanged();
- }
-
- static void WatchAppBatteryLow(app_event_info_h event, void *data)
- {
- Observer *observer = &static_cast<Framework*>(data)->mObserver;
-
- observer->OnBatteryLow();
- }
-
- static void WatchAppMemoryLow(app_event_info_h event, void *data)
- {
- Observer *observer = &static_cast<Framework*>(data)->mObserver;
-
- observer->OnMemoryLow();
- }
-
static void WatchAppControl(app_control_h app_control, void *data)
{
Framework* framework = static_cast<Framework*>(data);
mWatchCallback.ambient_tick = WatchAppAmbientTick;
mWatchCallback.ambient_changed = WatchAppAmbientChanged;
- watch_app_add_event_handler(&watchHandlers[APP_EVENT_LOW_BATTERY], APP_EVENT_LOW_BATTERY, WatchAppBatteryLow, mFramework);
- watch_app_add_event_handler(&watchHandlers[APP_EVENT_LOW_MEMORY], APP_EVENT_LOW_MEMORY, WatchAppMemoryLow, mFramework);
- watch_app_add_event_handler(&watchHandlers[APP_EVENT_LANGUAGE_CHANGED], APP_EVENT_LANGUAGE_CHANGED, WatchAppLanguageChanged, mFramework);
- watch_app_add_event_handler(&watchHandlers[APP_EVENT_REGION_FORMAT_CHANGED], APP_EVENT_REGION_FORMAT_CHANGED, WatchAppRegionChanged, mFramework);
+ AppCore::AppAddEventHandler(&handlers[AppCore::LOW_BATTERY], AppCore::LOW_BATTERY, AppBatteryLow, mFramework);
+ AppCore::AppAddEventHandler(&handlers[AppCore::LOW_MEMORY], AppCore::LOW_MEMORY, AppMemoryLow, mFramework);
+ AppCore::AppAddEventHandler(&handlers[AppCore::LANGUAGE_CHANGED], AppCore::LANGUAGE_CHANGED, AppLanguageChanged, mFramework);
+ AppCore::AppAddEventHandler(&handlers[AppCore::REGION_FORMAT_CHANGED], AppCore::REGION_FORMAT_CHANGED, AppRegionChanged, mFramework);
ret = watch_app_main(*mFramework->mArgc, *mFramework->mArgv, &mWatchCallback, mFramework);
#endif
#endif
}
-
private:
// Undefined
Impl( const Impl& impl );
}
}
+void Framework::SetLanguage( const std::string& language )
+{
+ mImpl->SetLanguage( language );
+}
+
+void Framework::SetRegion( const std::string& region )
+{
+ mImpl->SetRegion( region );
+}
+
+std::string Framework::GetLanguage() const
+{
+ return mImpl->GetLanguage();
+}
+
+std::string Framework::GetRegion() const
+{
+ return mImpl->GetRegion();
+}
+
} // namespace Adaptor
} // namespace Internal
Impl(void* data)
: mAbortCallBack( NULL ),
- mCallbackManager( CallbackManager::New() )
+ mCallbackManager( CallbackManager::New() ),
+ mLanguage( "NOT_SUPPORTED" ),
+ mRegion( "NOT_SUPPORTED" )
{
}
delete mCallbackManager;
}
- // Data
+ std::string GetLanguage() const
+ {
+ return mLanguage;
+ }
+ std::string GetRegion() const
+ {
+ return mRegion;
+ }
+
+ // Data
CallbackBase* mAbortCallBack;
CallbackManager *mCallbackManager;
+ std::string mLanguage;
+ std::string mRegion;
+
// Static methods
/**
XInitThreads();
}
+std::string Framework::GetLanguage() const
+{
+ return mImpl->GetLanguage();
+}
+
+std::string Framework::GetRegion() const
+{
+ return mImpl->GetRegion();
+}
+
} // namespace Adaptor
} // namespace Internal
{
}
-void ImfManager::SetInputPanelUserData( const std::string& data )
+void ImfManager::SetInputPanelData( const std::string& data )
{
}
-void ImfManager::GetInputPanelUserData( std::string& data )
+void ImfManager::GetInputPanelData( std::string& data )
{
}
typedef Dali::ImfManager::StatusSignalType ImfStatusSignalType;
typedef Dali::ImfManager::VoidSignalType ImfVoidSignalType;
typedef Dali::ImfManager::KeyboardTypeSignalType ImfKeyboardTypeSignalType;
+ typedef Dali::ImfManager::KeyboardResizedSignalType KeyboardResizedSignalType;
+ typedef Dali::ImfManager::LanguageChangedSignalType LanguageChangedSignalType;
public:
void ApplyOptions( const InputMethodOptions& options );
/**
- * @copydoc Dali::ImfManager::SetInputPanelUserData()
+ * @copydoc Dali::ImfManager::SetInputPanelData()
*/
- void SetInputPanelUserData( const std::string& data );
+ void SetInputPanelData( const std::string& data );
/**
- * @copydoc Dali::ImfManager::GetInputPanelUserData()
+ * @copydoc Dali::ImfManager::GetInputPanelData()
*/
- void GetInputPanelUserData( std::string& data );
+ void GetInputPanelData( std::string& data );
/**
* @copydoc Dali::ImfManager::GetInputPanelState()
/**
* @copydoc Dali::ImfManager::ResizedSignal()
*/
- ImfVoidSignalType& ResizedSignal() { return mKeyboardResizeSignal; }
+ KeyboardResizedSignalType& ResizedSignal() { return mKeyboardResizeSignal; }
/**
* @copydoc Dali::ImfManager::LanguageChangedSignal()
*/
- ImfVoidSignalType& LanguageChangedSignal() { return mKeyboardLanguageChangedSignal; }
+ LanguageChangedSignalType& LanguageChangedSignal() { return mKeyboardLanguageChangedSignal; }
/**
* @copydoc Dali::ImfManager::KeyboardTypeChangedSignal()
ImfManagerSignalType mActivatedSignal;
ImfEventSignalType mEventSignal;
ImfStatusSignalType mKeyboardStatusSignal;
- ImfVoidSignalType mKeyboardResizeSignal;
- ImfVoidSignalType mKeyboardLanguageChangedSignal;
+ KeyboardResizedSignalType mKeyboardResizeSignal;
+ LanguageChangedSignalType mKeyboardLanguageChangedSignal;
ImfKeyboardTypeSignalType mKeyboardTypeChangedSignal;
// Undefined
mWMRotationAppSet( false ),
mIsFocusAcceptable( true ),
mVisible( true ),
+ mIconified( false ),
mOpaqueState( false ),
mResizeEnabled( true ),
mIndicator( NULL ),
mIndicatorOpacityMode( Dali::Window::OPAQUE ),
mOverlay( NULL ),
mAdaptor( NULL ),
- mType( Dali::DevelWindow::NORMAL ),
+ mType( Dali::Window::NORMAL ),
mPreferredOrientation( Dali::Window::PORTRAIT ),
mSupportedAuxiliaryHints(),
mAuxiliaryHints(),
mIsFocusAcceptable = accept;
}
-bool Window::IsFocusAcceptable()
+bool Window::IsFocusAcceptable() const
{
return mIsFocusAcceptable;
}
{
}
-unsigned int Window::GetSupportedAuxiliaryHintCount()
+void Window::SetIndicatorVisibleMode( Dali::Window::IndicatorVisibleMode mode )
+{
+ mIndicatorVisible = mode;
+}
+
+unsigned int Window::GetSupportedAuxiliaryHintCount() const
{
return 0;
}
-std::string Window::GetSupportedAuxiliaryHint( unsigned int index )
+std::string Window::GetSupportedAuxiliaryHint( unsigned int index ) const
{
return std::string();
}
{
}
-void Window::SetType( Dali::DevelWindow::Type type )
+void Window::SetType( Dali::Window::Type type )
{
mType = type;
}
-Dali::DevelWindow::Type Window::GetType() const
+Dali::Window::Type Window::GetType() const
{
return mType;
}
-bool Window::SetNotificationLevel( Dali::DevelWindow::NotificationLevel::Type level )
+bool Window::SetNotificationLevel( Dali::Window::NotificationLevel::Type level )
{
return false;
}
-Dali::DevelWindow::NotificationLevel::Type Window::GetNotificationLevel()
+Dali::Window::NotificationLevel::Type Window::GetNotificationLevel() const
{
- return Dali::DevelWindow::NotificationLevel::NONE;
+ return Dali::Window::NotificationLevel::NONE;
}
void Window::SetOpaqueState( bool opaque )
mOpaqueState = opaque;
}
-bool Window::IsOpaqueState()
+bool Window::IsOpaqueState() const
{
return mOpaqueState;
}
-bool Window::SetScreenMode( Dali::DevelWindow::ScreenMode::Type screenMode )
+bool Window::SetScreenOffMode(Dali::Window::ScreenOffMode::Type screenOffMode)
{
return false;
}
-Dali::DevelWindow::ScreenMode::Type Window::GetScreenMode()
+Dali::Window::ScreenOffMode::Type Window::GetScreenOffMode() const
{
- return Dali::DevelWindow::ScreenMode::DEFAULT;
+ return Dali::Window::ScreenOffMode::TIMEOUT;
}
bool Window::SetBrightness( int brightness )
return false;
}
-int Window::GetBrightness()
+int Window::GetBrightness() const
{
return 0;
}
-void Window::SetSize( Dali::DevelWindow::WindowSize size )
+void Window::SetSize( Dali::Window::WindowSize size )
{
PositionSize positionSize = mSurface->GetPositionSize();
mSurface->MoveResize( positionSize );
- mAdaptor->SurfaceResizePrepare( Dali::Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
+ mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
// Emit signal
- mResizedSignal.Emit( Dali::DevelWindow::WindowSize( positionSize.width, positionSize.height ) );
+ mResizedSignal.Emit( Dali::Window::WindowSize( positionSize.width, positionSize.height ) );
- mAdaptor->SurfaceResizeComplete( Dali::Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
+ mAdaptor->SurfaceResizeComplete( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
}
}
-Dali::DevelWindow::WindowSize Window::GetSize()
+Dali::Window::WindowSize Window::GetSize() const
{
PositionSize positionSize = mSurface->GetPositionSize();
- return Dali::DevelWindow::WindowSize( positionSize.width, positionSize.height );
+ return Dali::Window::WindowSize( positionSize.width, positionSize.height );
}
-void Window::SetPosition( Dali::DevelWindow::WindowPosition position )
+void Window::SetPosition( Dali::Window::WindowPosition position )
{
PositionSize positionSize = mSurface->GetPositionSize();
}
}
-Dali::DevelWindow::WindowPosition Window::GetPosition()
+Dali::Window::WindowPosition Window::GetPosition() const
{
PositionSize positionSize = mSurface->GetPositionSize();
- return Dali::DevelWindow::WindowPosition( positionSize.x, positionSize.y );
+ return Dali::Window::WindowPosition( positionSize.x, positionSize.y );
}
void Window::SetTransparency( bool transparent )
#include <dali/integration-api/events/touch-event-integ.h>
#include <dali/integration-api/events/hover-event-integ.h>
#include <dali/integration-api/events/wheel-event-integ.h>
-#include <dali/devel-api/events/key-event-devel.h>
// INTERNAL INCLUDES
#include <events/gesture-manager.h>
const char * DETENT_DEVICE_NAME = "tizen_detent";
const std::string DEFAULT_DEVICE_NAME = "";
-const DevelDevice::Class::Type DEFAULT_DEVICE_CLASS = DevelDevice::Class::NONE;
-const DevelDevice::Subclass::Type DEFAULT_DEVICE_SUBCLASS = DevelDevice::Subclass::NONE;
+const Device::Class::Type DEFAULT_DEVICE_CLASS = Device::Class::NONE;
+const Device::Subclass::Type DEFAULT_DEVICE_SUBCLASS = Device::Subclass::NONE;
// DBUS accessibility
#define A11Y_BUS "org.a11y.Bus"
{
if( text )
{
+ // The memory allocated by strdup() can be freed by ecore_imf_context_surrounding_get() internally.
*text = strdup( callbackData.currentText.c_str() );
}
}
}
-void ImfManager::SetInputPanelUserData( const std::string& data )
+void ImfManager::SetInputPanelData( const std::string& data )
{
- DALI_LOG_INFO( gLogFilter, Debug::General, "ImfManager::SetInputPanelUserData\n" );
+ DALI_LOG_INFO( gLogFilter, Debug::General, "ImfManager::SetInputPanelData\n" );
if( mIMFContext )
{
int length = data.length();
- ecore_imf_context_input_panel_imdata_set( mIMFContext, &data, length );
+ ecore_imf_context_input_panel_imdata_set( mIMFContext, data.c_str(), length );
}
}
-void ImfManager::GetInputPanelUserData( std::string& data )
+void ImfManager::GetInputPanelData( std::string& data )
{
- DALI_LOG_INFO( gLogFilter, Debug::General, "ImfManager::GetInputPanelUserData\n" );
+ DALI_LOG_INFO( gLogFilter, Debug::General, "ImfManager::GetInputPanelData\n" );
if( mIMFContext )
{
- int* length = NULL;
- ecore_imf_context_input_panel_imdata_get( mIMFContext, &data, length );
+ int length = 4096; // The max length is 4096 bytes
+ Dali::Vector< char > buffer;
+ buffer.Resize( length );
+ ecore_imf_context_input_panel_imdata_get( mIMFContext, &buffer[0], &length );
+ data = std::string( buffer.Begin(), buffer.End() );
}
}
mEcoreEventHander( true ),
mIsFocusAcceptable( true ),
mVisible( true ),
+ mIconified( false ),
mOpaqueState( false ),
mResizeEnabled( true ),
mIndicator( NULL ),
mIndicatorOpacityMode( Dali::Window::OPAQUE ),
mOverlay( NULL ),
mAdaptor( NULL ),
- mType( Dali::DevelWindow::NORMAL ),
+ mType( Dali::Window::NORMAL ),
mEventHandler( NULL ),
mPreferredOrientation( Dali::Window::PORTRAIT ),
mSupportedAuxiliaryHints(),
mIsFocusAcceptable = accept;
}
-bool Window::IsFocusAcceptable()
+bool Window::IsFocusAcceptable() const
{
return mIsFocusAcceptable;
}
ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE,
ECORE_X_ATOM_CARDINAL, 32, &angles, 2 );
- mAdaptor->SurfaceResizePrepare( Dali::Adaptor::SurfaceSize( width, height ) );
+ mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( width, height ) );
// Emit signal
- mResizedSignal.Emit( Dali::DevelWindow::WindowSize( width, height ) );
+ mResizedSignal.Emit( Dali::Window::WindowSize( width, height ) );
- mAdaptor->SurfaceResizeComplete( Dali::Adaptor::SurfaceSize( width, height ) );
+ mAdaptor->SurfaceResizeComplete( Adaptor::SurfaceSize( width, height ) );
#endif // DALI_PROFILE_UBUNTU
}
}
-unsigned int Window::GetSupportedAuxiliaryHintCount()
+void Window::SetIndicatorVisibleMode( Dali::Window::IndicatorVisibleMode mode )
+{
+ mIndicatorVisible = mode;
+}
+
+unsigned int Window::GetSupportedAuxiliaryHintCount() const
{
return 0;
}
-std::string Window::GetSupportedAuxiliaryHint( unsigned int index )
+std::string Window::GetSupportedAuxiliaryHint( unsigned int index ) const
{
return std::string();
}
{
}
-void Window::SetType( Dali::DevelWindow::Type type )
+void Window::SetType( Dali::Window::Type type )
{
mType = type;
}
-Dali::DevelWindow::Type Window::GetType() const
+Dali::Window::Type Window::GetType() const
{
return mType;
}
-bool Window::SetNotificationLevel( Dali::DevelWindow::NotificationLevel::Type level )
+bool Window::SetNotificationLevel( Dali::Window::NotificationLevel::Type level )
{
return false;
}
-Dali::DevelWindow::NotificationLevel::Type Window::GetNotificationLevel()
+Dali::Window::NotificationLevel::Type Window::GetNotificationLevel() const
{
- return Dali::DevelWindow::NotificationLevel::NONE;
+ return Dali::Window::NotificationLevel::NONE;
}
void Window::SetOpaqueState( bool opaque )
mOpaqueState = opaque;
}
-bool Window::IsOpaqueState()
+bool Window::IsOpaqueState() const
{
return mOpaqueState;
}
-bool Window::SetScreenMode( Dali::DevelWindow::ScreenMode::Type screenMode )
+bool Window::SetScreenOffMode(Dali::Window::ScreenOffMode::Type screenOffMode)
{
return false;
}
-Dali::DevelWindow::ScreenMode::Type Window::GetScreenMode()
+Dali::Window::ScreenOffMode::Type Window::GetScreenOffMode() const
{
- return Dali::DevelWindow::ScreenMode::DEFAULT;
+ return Dali::Window::ScreenOffMode::TIMEOUT;
}
bool Window::SetBrightness( int brightness )
return false;
}
-int Window::GetBrightness()
+int Window::GetBrightness() const
{
return 0;
}
-void Window::SetSize( Dali::DevelWindow::WindowSize size )
+void Window::SetSize( Dali::Window::WindowSize size )
{
PositionSize positionSize = mSurface->GetPositionSize();
mSurface->MoveResize( positionSize );
- mAdaptor->SurfaceResizePrepare( Dali::Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
+ mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
// Emit signal
- mResizedSignal.Emit( Dali::DevelWindow::WindowSize( positionSize.width, positionSize.height ) );
+ mResizedSignal.Emit( Dali::Window::WindowSize( positionSize.width, positionSize.height ) );
- mAdaptor->SurfaceResizeComplete( Dali::Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
+ mAdaptor->SurfaceResizeComplete( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
}
}
-Dali::DevelWindow::WindowSize Window::GetSize()
+Dali::Window::WindowSize Window::GetSize() const
{
PositionSize positionSize = mSurface->GetPositionSize();
- return Dali::DevelWindow::WindowSize( positionSize.width, positionSize.height );
+ return Dali::Window::WindowSize( positionSize.width, positionSize.height );
}
-void Window::SetPosition( Dali::DevelWindow::WindowPosition position )
+void Window::SetPosition( Dali::Window::WindowPosition position )
{
PositionSize positionSize = mSurface->GetPositionSize();
}
}
-Dali::DevelWindow::WindowPosition Window::GetPosition()
+Dali::Window::WindowPosition Window::GetPosition() const
{
PositionSize positionSize = mSurface->GetPositionSize();
- return Dali::DevelWindow::WindowPosition( positionSize.x, positionSize.y );
+ return Dali::Window::WindowPosition( positionSize.x, positionSize.y );
}
void Window::SetTransparency( bool transparent )
../dali-adaptor/dali-test-suite-utils/test-platform-abstraction.cpp
../dali-adaptor/dali-test-suite-utils/test-render-controller.cpp
../dali-adaptor/dali-test-suite-utils/test-trace-call-stack.cpp
+ ../dali-adaptor/dali-test-suite-utils/adaptor-test-adaptor-impl.cpp
)
PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED
)
ADD_COMPILE_OPTIONS( -O0 -ggdb --coverage -Wall -Werror )
+ADD_COMPILE_OPTIONS( ${${CAPI_LIB}_CFLAGS_OTHER} )
# Shouldn't have to do this!
# But CMake's new auto-escape quote policy doesn't work right.
#include <Ecore.h>
#include <dali/dali.h>
#include <dali-test-suite-utils.h>
+#include <adaptor-test-application.h>
#include <tilt-sensor-impl.h>
using namespace Dali;
int UtcDaliTiltSensorStart(void)
{
- TestApplication application;
+ AdaptorTestApplication application;
tet_infoline("UtcDaliTiltSensorStart");
int UtcDaliTiltSensorStop(void)
{
- TestApplication application;
+ AdaptorTestApplication application;
tet_infoline("UtcDaliTiltSensorStop");
int UtcDaliTiltSensorIsStarted(void)
{
- TestApplication application;
+ AdaptorTestApplication application;
tet_infoline("UtcDaliTiltSensorIsStarted");
int UtcDaliTiltSensorGetRoll(void)
{
- TestApplication application;
+ AdaptorTestApplication application;
tet_infoline("UtcDaliTiltSensorGetRoll");
int UtcDaliTiltSensorGetPitch(void)
{
- TestApplication application;
+ AdaptorTestApplication application;
tet_infoline("UtcDaliTiltSensorGetPitch");
int UtcDaliTiltSensorGetRotation(void)
{
- TestApplication application;
+ AdaptorTestApplication application;
tet_infoline("UtcDaliTiltSensorGetRotation");
int UtcDaliTiltSensorSignalTilted(void)
{
- TestApplication application;
+ AdaptorTestApplication application;
tet_infoline("UtcDaliTiltSensorSignalTilted");
int UtcDaliTiltSensorSetUpdateFrequency(void)
{
- TestApplication application;
+ AdaptorTestApplication application;
tet_infoline("UtcDaliTiltSensorSetUpdateFrequency");
int UtcDaliTiltSensorSetRotationThreshold01(void)
{
- TestApplication application;
+ AdaptorTestApplication application;
tet_infoline("UtcDaliTiltSensorSetRotationThreshold01");
dali-test-suite-utils/test-platform-abstraction.cpp
dali-test-suite-utils/test-render-controller.cpp
dali-test-suite-utils/test-trace-call-stack.cpp
+ dali-test-suite-utils/adaptor-test-adaptor-impl.cpp
)
PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED
--- /dev/null
+/*
+ * Copyright (c) 2017 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.
+ *
+ */
+
+#include "adaptor-test-adaptor-impl.h"
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+bool Adaptor::mAvailable = false;
+
+bool Adaptor::IsAvailable()
+{
+ return mAvailable;
+}
+
+void Adaptor::SetAvailable()
+{
+ mAvailable = true;
+}
+
+} // namespace Adaptor
+
+} // namespace Internal
+
+} // namespace Dali
--- /dev/null
+#ifndef __DALI_ADAPTOR_TEST_ADAPTOR_IMPL_H__
+#define __DALI_ADAPTOR_TEST_ADAPTOR_IMPL_H__
+
+/*
+ * Copyright (c) 2017 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.
+ *
+ */
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+class Adaptor
+{
+public:
+ static bool IsAvailable();
+ static void SetAvailable();
+
+ Adaptor() {}
+ ~Adaptor() {}
+
+public:
+ static bool mAvailable;
+};
+
+} // Adaptor
+
+} // Internal
+
+} // Dali
+
+#endif // __DALI_ADAPTOR_TEST_ADAPTOR_IMPL_H__
--- /dev/null
+#ifndef __DALI_ADAPTOR_TEST_APPLICATION_H__
+#define __DALI_ADAPTOR_TEST_APPLICATION_H__
+
+/*
+ * Copyright (c) 2017 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 "test-application.h"
+#include "adaptor-test-adaptor-impl.h"
+
+namespace Dali
+{
+
+/**
+ * Adds some functionality on top of TestApplication that is required by the Adaptor.
+ */
+class AdaptorTestApplication : public TestApplication
+{
+public:
+
+ AdaptorTestApplication( size_t surfaceWidth = DEFAULT_SURFACE_WIDTH,
+ size_t surfaceHeight = DEFAULT_SURFACE_HEIGHT,
+ float horizontalDpi = DEFAULT_HORIZONTAL_DPI,
+ float verticalDpi = DEFAULT_VERTICAL_DPI )
+ : TestApplication( false, surfaceWidth, surfaceHeight, horizontalDpi, verticalDpi )
+ {
+ Initialize();
+
+ Internal::Adaptor::Adaptor::SetAvailable();
+ }
+
+ ~AdaptorTestApplication()
+ {
+ }
+};
+
+} // namespace Dali
+
+#endif // __DALI_ADAPTOR_TEST_APPLICATION_H__
m1[6], m1[7], m1[8], m2[6], m2[7], m2[8]);
tet_result(TET_FAIL);
+ throw("TET_FAIL");
}
else
{
m1[6], m1[7], m1[8], m2[6], m2[7], m2[8]);
tet_result(TET_FAIL);
+ throw("TET_FAIL");
}
else
{
m1[12], m1[13], m1[14], m1[15], m2[12], m2[13], m2[14], m2[15]);
tet_result(TET_FAIL);
+ throw("TET_FAIL");
}
else
{
m1[12], m1[13], m1[14], m1[15], m2[12], m2[13], m2[14], m2[15]);
tet_result(TET_FAIL);
+ throw("TET_FAIL");
}
else
{
else
{
tet_result(TET_FAIL);
+ throw("TET_FAIL");
}
}
{
fprintf(stderr, "Expected substring '%s' : actual exception string '%s' : location %s\n", conditionSubString.c_str(), e.condition, location );
tet_result(TET_FAIL);
+ throw("TET_FAIL");
}
else
{
{
fprintf(stderr, "Expected Applied signal was not received\n" );
tet_result( TET_FAIL );
+ throw("TET_FAIL");
}
else
{
{
fprintf(stderr, "Unexpected Applied signal was received\n" );
tet_result( TET_FAIL );
+ throw("TET_FAIL");
}
else
{
#define STRINGIZE_I(text) #text
#define STRINGIZE(text) STRINGIZE_I(text)
-// the following is the other compilers way of token pasting, gcc seems to just concatenate strings automatically
-//#define TOKENPASTE(x,y) x ## y
-#define TOKENPASTE(x,y) x y
-#define TOKENPASTE2(x,y) TOKENPASTE( x, y )
-#define TEST_LOCATION TOKENPASTE2( "Test failed in ", TOKENPASTE2( __FILE__, TOKENPASTE2( ", line ", STRINGIZE(__LINE__) ) ) )
+/**
+ * Inspired by https://stackoverflow.com/questions/1706346/file-macro-manipulation-handling-at-compile-time
+ * answer by Chetan Reddy
+ */
+constexpr int32_t basenameIndex( const char * const path, const int32_t index = 0, const int32_t slashIndex = -1 )
+{
+ return path[ index ]
+ ? ( path[ index ] == '/'
+ ? basenameIndex( path, index + 1, index )
+ : basenameIndex( path, index + 1, slashIndex ) )
+ : ( slashIndex + 1 );
+}
+
+#define __FILELINE__ ( { static const int32_t basenameIdx = basenameIndex( __FILE__ ); \
+ static_assert (basenameIdx >= 0, "compile-time basename" ); \
+ __FILE__ ":" STRINGIZE(__LINE__) + basenameIdx ; } )
+
+#define TEST_LOCATION __FILELINE__
#define TEST_INNER_LOCATION(x) ( std::string(x) + " (" + STRINGIZE(__LINE__) + ")" ).c_str()
#define TET_UNDEF 2
} \
else \
{ \
- fprintf(stderr, "%s Failed in %s at line %d\n", __PRETTY_FUNCTION__, __FILE__, __LINE__); \
+ fprintf(stderr, "Test failed in %s, condition: %s\n", __FILELINE__, #condition ); \
tet_result(TET_FAIL); \
throw("TET_FAIL"); \
}
{
std::ostringstream o;
o << value1 << " == " << value2 << std::endl;
- fprintf(stderr, "%s, checking %s", location, o.str().c_str());
+ fprintf(stderr, "Test failed in %s, checking %s", location, o.str().c_str());
tet_result(TET_FAIL);
+ throw("TET_FAIL"); \
}
else
{
}
}
+/**
+ * Test whether two values are equal.
+ * @param[in] value1 The first value
+ * @param[in] value2 The second value
+ */
+#define DALI_TEST_EQUAL( v1, v2 ) DALI_TEST_EQUALS( v1, v2, __FILELINE__ )
+
template<typename Type>
inline void DALI_TEST_EQUALS(Type value1, Type value2, float epsilon, const char* location)
{
{
std::ostringstream o;
o << value1 << " == " << value2 << std::endl;
- fprintf(stderr, "%s, checking %s", location, o.str().c_str());
+ fprintf(stderr, "Test failed in %s, checking %s", location, o.str().c_str());
tet_result(TET_FAIL);
+ throw("TET_FAIL"); \
}
else
{
{
std::ostringstream o;
o << value1 << " != " << value2 << std::endl;
- fprintf(stderr, "%s, checking %s", location, o.str().c_str());
+ fprintf(stderr, "Test failed in %s, checking %s", location, o.str().c_str());
tet_result(TET_FAIL);
+ throw("TET_FAIL"); \
}
else
{
{
if ((fabs(value1.durationSeconds - value2.durationSeconds) > epsilon))
{
- fprintf(stderr, "%s, checking durations %f == %f, epsilon %f\n", location, value1.durationSeconds, value2.durationSeconds, epsilon);
+ fprintf(stderr, "Test failed in %s, checking durations %f == %f, epsilon %f\n", location, value1.durationSeconds, value2.durationSeconds, epsilon);
tet_result(TET_FAIL);
+ throw("TET_FAIL"); \
}
else if ((fabs(value1.delaySeconds - value2.delaySeconds) > epsilon))
{
- fprintf(stderr, "%s, checking delays %f == %f, epsilon %f\n", location, value1.delaySeconds, value2.delaySeconds, epsilon);
+ fprintf(stderr, "Test failed in %s, checking delays %f == %f, epsilon %f\n", location, value1.delaySeconds, value2.delaySeconds, epsilon);
tet_result(TET_FAIL);
+ throw("TET_FAIL"); \
}
else
{
{
if (strcmp(str1, str2))
{
- fprintf(stderr, "%s, checking '%s' == '%s'\n", location, str1, str2);
+ fprintf(stderr, "Test failed in %s, checking '%s' == '%s'\n", location, str1, str2);
tet_result(TET_FAIL);
+ throw("TET_FAIL"); \
}
else
{
{
if (!(value1 > value2))
{
- std::cerr << location << ", checking " << value1 <<" > " << value2 << "\n";
+ std::cerr << "Test failed in " << location << ", checking " << value1 <<" > " << value2 << "\n";
tet_result(TET_FAIL);
+ throw("TET_FAIL"); \
}
else
{
// We always need the first update!
mStatus.keepUpdating = Integration::KeepUpdating::STAGE_KEEP_RENDERING;
- mCore = Dali::Integration::Core::New(
- mRenderController,
- mPlatformAbstraction,
- mGlAbstraction,
- mGlSyncAbstraction,
- mGestureManager,
- mDataRetentionPolicy);
+ mCore = Dali::Integration::Core::New( mRenderController,
+ mPlatformAbstraction,
+ mGlAbstraction,
+ mGlSyncAbstraction,
+ mGestureManager,
+ mDataRetentionPolicy,
+ false );
mCore->ContextCreated();
mCore->SurfaceResized( mSurfaceWidth, mSurfaceHeight );
unsigned int nextVSyncTime = mLastVSyncTime + intervalMilliseconds;
float elapsedSeconds = intervalMilliseconds / 1e3f;
- mCore->Update( elapsedSeconds, mLastVSyncTime, nextVSyncTime, mStatus );
+ mCore->Update( elapsedSeconds, mLastVSyncTime, nextVSyncTime, mStatus, false, false );
GetRenderController().Initialize();
}
template <>
+inline bool CompareType<Extents>(Extents extents1, Extents extents2, float epsilon)
+{
+ return (extents1.start == extents2.start) &&
+ (extents1.end == extents2.end) &&
+ (extents1.top == extents2.top) &&
+ (extents1.bottom == extents2.bottom);
+}
+
+template <>
inline bool CompareType<Property::Value>(Property::Value q1, Property::Value q2, float epsilon)
{
Property::Type type = q1.GetType();
result = false;
break;
}
+ case Property::EXTENTS:
+ {
+ Extents a, b;
+ q1.Get(a);
+ q2.Get(b);
+ result = CompareType<Extents>( a, b, epsilon );
+ break;
+ }
case Property::NONE:
{
result = false;
mEnableDisableTrace.Reset();
mShaderTrace.Reset();
mStencilFunctionTrace.Reset();
+ mScissorTrace.Reset();
mTextureTrace.Reset();
mTexParamaterTrace.Reset();
mDrawTrace.Reset();
mScissorParams.y = y;
mScissorParams.width = width;
mScissorParams.height = height;
+
+ std::stringstream out;
+ out << x << ", " << y << ", " << width << ", " << height;
+ TraceCallStack::NamedParams namedParams;
+ namedParams["x"] = ToString( x );
+ namedParams["y"] = ToString( y );
+ namedParams["width"] = ToString( width );
+ namedParams["height"] = ToString( height );
+ mScissorTrace.PushCall( "Scissor", out.str(), namedParams );
}
inline void ShaderBinary(GLsizei n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLsizei length)
inline void ResetStencilFunctionCallStack() { mStencilFunctionTrace.Reset(); }
inline TraceCallStack& GetStencilFunctionTrace() { return mStencilFunctionTrace; }
+ //Methods for Scissor verification
+ inline void EnableScissorCallTrace(bool enable) { mScissorTrace.Enable(enable); }
+ inline void ResetScissorCallStack() { mScissorTrace.Reset(); }
+ inline TraceCallStack& GetScissorTrace() { return mScissorTrace; }
+
//Methods for Uniform function verification
inline void EnableSetUniformCallTrace(bool enable) { mSetUniformTrace.Enable(enable); }
inline void ResetSetUniformCallStack() { mSetUniformTrace.Reset(); }
TraceCallStack mDrawTrace;
TraceCallStack mDepthFunctionTrace;
TraceCallStack mStencilFunctionTrace;
+ TraceCallStack mScissorTrace;
TraceCallStack mSetUniformTrace;
// Shaders & Uniforms
{
testCase.startup();
}
- result = testCase.function();
+ try
+ {
+ result = testCase.function();
+ }
+ catch( const char* )
+ {
+ // just catch test fail exception, return is already set to EXIT_STATUS_TESTCASE_FAILED
+ }
if( testCase.cleanup )
{
testCase.cleanup();
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
{
}
-void TestRenderController::RequestUpdate()
+void TestRenderController::RequestUpdate( bool forceUpdate )
{
mRequestUpdateCalled = true;
}
-void TestRenderController::RequestProcessEventsOnIdle()
+void TestRenderController::RequestProcessEventsOnIdle( bool forceProcess )
{
mRequestProcessEventsOnIdleCalled = true;
}
#define __TEST_RENDER_CONTROLLER_H__
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
TestRenderController();
~TestRenderController();
- virtual void RequestUpdate();
- virtual void RequestProcessEventsOnIdle();
+ virtual void RequestUpdate( bool forceUpdate );
+ virtual void RequestProcessEventsOnIdle( bool forceProcess );
typedef enum
{
} // unnamed namespace
+void LowBatterySignalCallback( Dali::DeviceStatus::Battery::Status status )
+{
+}
+
+void LowMemorySignalCallback( Dali::DeviceStatus::Memory::Status status )
+{
+}
+
int UtcDaliApplicationNew01(void)
{
Application application = Application::New();
END_TEST;
}
+int UtcDaliApplicationLowBatterySignalP(void)
+{
+ Application application = Application::New();
+ application.LowBatterySignal().Connect( &LowBatterySignalCallback );
+ DALI_TEST_CHECK( application );
+
+ END_TEST;
+}
+
+int UtcDaliApplicationLowBatterySignalN(void)
+{
+ Application application;
+
+ try
+ {
+ application.LowBatterySignal().Connect( &LowBatterySignalCallback );
+ DALI_TEST_CHECK( false ); // Should not get here
+ }
+ catch( ... )
+ {
+ DALI_TEST_CHECK( true );
+ }
+
+ END_TEST;
+}
+
+int UtcDaliApplicationLowMemorySignalP(void)
+{
+ Application application = Application::New();
+ application.LowMemorySignal().Connect( &LowMemorySignalCallback );
+ DALI_TEST_CHECK( application );
+
+ END_TEST;
+}
+
+int UtcDaliApplicationLowMemorySignalN(void)
+{
+ Application application;
+
+ try
+ {
+ application.LowMemorySignal().Connect( &LowMemorySignalCallback );
+ DALI_TEST_CHECK( false ); // Should not get here
+ }
+ catch( ... )
+ {
+ DALI_TEST_CHECK( true );
+ }
+
+ END_TEST;
+}
+
int UtcDaliApplicationGetResourcePathP(void)
{
Application application = Application::New();
END_TEST;
}
+int UtcDaliApplicationGetRegionP(void)
+{
+ Application application = Application::New();
+ std::string result;
+ result = application.GetRegion();
+ DALI_TEST_CHECK( result == "NOT_SUPPORTED" ); // Not supported in UBUNTU
+
+ END_TEST;
+}
+
+int UtcDaliApplicationGetLanguageP(void)
+{
+ Application application = Application::New();
+ std::string result;
+ result = application.GetLanguage();
+ DALI_TEST_CHECK( result == "NOT_SUPPORTED" ); // Not supported in UBUNTU
+
+ END_TEST;
+}
END_TEST;
}
+
+int UtcDaliPixelBufferGaussianBlur(void)
+{
+ TestApplication application;
+
+ Devel::PixelBuffer imageData = Devel::PixelBuffer::New( 10, 10, Pixel::RGBA8888 );
+ FillCheckerboard(imageData);
+
+ DALI_TEST_EQUALS( imageData.GetWidth(), 10, TEST_LOCATION ) ;
+ DALI_TEST_EQUALS( imageData.GetHeight(), 10, TEST_LOCATION ) ;
+
+ unsigned char* buffer = imageData.GetBuffer();
+
+ // Test that an even pixel in the odd row has full alpha value
+ DALI_TEST_EQUALS( buffer[43], 0xffu, TEST_LOCATION );
+
+ // Test that an even pixel in the even row has no alpha value
+ DALI_TEST_EQUALS( buffer[55], 0x00u, TEST_LOCATION );
+
+ imageData.ApplyGaussianBlur( 0.0f );
+
+ // Test that the pixels' alpha values are not changed because there is no blur
+ DALI_TEST_EQUALS( buffer[43], 0xffu, TEST_LOCATION );
+ DALI_TEST_EQUALS( buffer[55], 0x00u, TEST_LOCATION );
+
+ imageData.ApplyGaussianBlur( 1.0f );
+
+ // Test that the pixels' alpha values are changed after applying gaussian blur
+ DALI_TEST_EQUALS( buffer[43], 0x7Au, TEST_LOCATION );
+ DALI_TEST_EQUALS( buffer[55], 0x7Eu, TEST_LOCATION );
+
+ END_TEST;
+}
#include <dali/dali.h>
#include <Ecore.h>
#include <dali-test-suite-utils.h>
+#include <adaptor-test-application.h>
using namespace Dali;
// Positive test case for a method
int UtcDaliTimerCreation(void)
{
- // TestApplication application;
+ AdaptorTestApplication application;
+
tet_printf("timer creation \n");
Timer timer = Timer::New(300);
int UtcDaliTimerUnitializedStart(void)
{
+ AdaptorTestApplication application;
+
tet_printf("unintialized timer start \n");
Timer *timer = new Timer;
int UtcDaliTimerUnitializedStop(void)
{
+ AdaptorTestApplication application;
+
tet_printf("unintialized timer stop \n");
Timer *timer = new Timer;
int UtcDaliTimerUnitializedGetInterval(void)
{
+ AdaptorTestApplication application;
+
tet_printf("unintialized get interval \n");
Timer *timer = new Timer;
int UtcDaliTimerUnitializedSetInterval(void)
{
+ AdaptorTestApplication application;
+
tet_printf("unintialized set interval \n");
Timer *timer = new Timer;
int UtcDaliTimerUnitializedIsRunning(void)
{
+ AdaptorTestApplication application;
+
tet_printf("unintialized is running \n");
Timer *timer = new Timer;
int UtcDaliTimerUnitializedSignalTick(void)
{
+ AdaptorTestApplication application;
+
tet_printf("unintialized SignalTick \n");
Timer *timer = new Timer;
int UtcDaliTimerSetInterval(void)
{
+ AdaptorTestApplication application;
+
tet_printf("timer set interval \n");
Timer timer = Timer::New(10);
int UtcDaliTimerCopyConstructor(void)
{
+ AdaptorTestApplication application;
+
tet_printf("timer copy constructor \n");
Timer timer = Timer::New(10);
int UtcDaliTimerAssignmentOperator(void)
{
+ AdaptorTestApplication application;
+
tet_printf("assignmnet constructor \n");
Timer timer = Timer::New(10);
int UtcDaliTimerIsRunning(void)
{
+ AdaptorTestApplication application;
+
tet_printf("timer is running \n");
Timer timer = Timer::New(100);
int UtcDaliTimerSignalTickContinue(void)
{
+ AdaptorTestApplication application;
+
tet_printf("timer call back\n");
Timer timer = Timer::New(100);
int UtcDaliTimerSignalTickStop(void)
{
+ AdaptorTestApplication application;
+
Timer timer = Timer::New(100);
TimerTestClass testClass(false);
int UtcDaliTimerReset(void)
{
+ AdaptorTestApplication application;
+
Timer timer = Timer::New(100);
DALI_TEST_CHECK(timer);
int UtcDaliTimerDownCastP(void)
{
+ AdaptorTestApplication application;
+
Timer timer = Timer::New(100);
Timer cast = Timer::DownCast( timer );
int UtcDaliTimerDownCastN(void)
{
+ AdaptorTestApplication application;
+
Timer timer;
Timer cast = Timer::DownCast( timer );
#include <dali/dali.h>
#include <Ecore_X.h>
#include <devel-api/adaptor-framework/drag-and-drop-detector.h>
-#include <devel-api/adaptor-framework/window-devel.h>
#include <dali-test-suite-utils.h>
using namespace Dali;
Dali::Window window;
try
{
- DevelWindow::SetAcceptFocus( window, true );
+ window.SetAcceptFocus( true );
DALI_TEST_CHECK( false ); // Should not reach here!
}
catch( ... )
Dali::Window window;
try
{
- DevelWindow::IsFocusAcceptable( window );
+ window.IsFocusAcceptable();
DALI_TEST_CHECK( false ); // Should not reach here!
}
catch( ... )
Dali::Window window;
try
{
- DevelWindow::FocusChangedSignal( window );
+ window.FocusChangedSignal();
DALI_TEST_CHECK( false ); // Should not reach here!
}
catch( ... )
../dali-adaptor/dali-test-suite-utils/test-platform-abstraction.cpp
../dali-adaptor/dali-test-suite-utils/test-render-controller.cpp
../dali-adaptor/dali-test-suite-utils/test-trace-call-stack.cpp
+ ../dali-adaptor/dali-test-suite-utils/adaptor-test-adaptor-impl.cpp
tct-dali-platform-abstraction-core.cpp
utc-image-loading-common.cpp
)
)
ADD_COMPILE_OPTIONS(-O0 -ggdb --coverage -Wall -Werror)
-
+ADD_COMPILE_OPTIONS( ${${CAPI_LIB}_CFLAGS_OTHER} )
# Shouldn't have to do this!
# But CMake's new auto-escape quote policy doesn't work right.
[enable_feedback=yes],
[enable_feedback=no])
-AC_ARG_ENABLE([videoplayer],
- [AC_HELP_STRING([ --enable-videoplayer],
- [Enable video player plugin])],
- [enable_videoplayer=yes],
- [enable_videoplayer=no])
-
AC_CONFIG_SUBDIRS(adaptor)
-if test "x$enable_feedback" = "xyes" || test "x$enable_videoplayer" = "xyes"; then
+if test "x$enable_feedback" = "xyes"; then
# build dali-adaptor & plugins
AC_CONFIG_SUBDIRS(plugins)
fi
lib_LTLIBRARIES += libdali-feedback-plugin.la
endif
-if WAYLAND
-if USE_VIDEOPLAYER
-lib_LTLIBRARIES += libdali-video-player-plugin.la
-endif
-endif
-
-else
+else # ENABLE_CXX03_ABI
if USE_FEEDBACK
lib_LTLIBRARIES += libdali-feedback-plugin-cxx11.la
endif
-if WAYLAND
-
-if USE_VIDEOPLAYER
-lib_LTLIBRARIES += libdali-video-player-plugin-cxx11.la
-endif
-endif
-endif
+endif # ENABLE_CXX03_ABI
if USE_FEEDBACK
dalisounddir = ${dataReadOnlyDir}/plugins/sounds/
endif
-# VideoPlayer
-if WAYLAND
-if USE_VIDEOPLAYER
-
-LIBDALI_VIDEO_PLAYER_PLUGIN_LA_SOURCES = \
- $(video_player_plugin_src_files)
-
-libdali_video_player_plugin_la__DEPENDENCIES =
-
-LIBDALI_VIDEO_PLAYER_PLUGIN_LA_CXXFLAGS = -DDALI_COMPILATION \
- -DDALI_ADAPTOR_COMPILATION \
- $(DLOG_CFLAGS) \
- $(DALICORE_CFLAGS) \
- $(ECORE_WAYLAND_CFLAGS) \
- $(CAPI_MEDIA_PLAYER_CFLAGS) \
- $(DALI_PROFILE_CFLAGS) \
- $(DALI_ADAPTOR_CFLAGS) \
- -I../../../adaptors/public-api \
- -I../../../adaptors/devel-api \
- -I../../../adaptors/devel-api/adaptor-framework \
- -I../../../adaptors/integration-api \
- -I../../../adaptors/public-api/adaptor-framework \
- -I../../../plugins/video-player \
- -Werror -Wall
-
-LIBDALI_VIDEO_PLAYER_PLUGIN_LA_LIBADD = \
- $(DLOG_LIBS) \
- $(ECORE_WAYLAND_LIBS) \
- $(CAPI_MEDIA_PLAYER_LIBS)
-
-LIBDALI_VIDEO_PLAYER_PLUGIN_LA_LDFLAGS = \
- -rdynamic
-
-endif # USE_VIDEOPLAYER
-endif # WAYLAND
-
if ENABLE_CXX03_ABI
if USE_FEEDBACK
endif
endif
-if WAYLAND
-if USE_VIDEOPLAYER
-libdali_video_player_plugin_la_SOURCES = $(LIBDALI_VIDEO_PLAYER_PLUGIN_LA_SOURCES)
-libdali_video_player_plugin_la_CXXFLAGS = $(LIBDALI_VIDEO_PLAYER_PLUGIN_LA_CXXFLAGS)
-libdali_video_player_plygin_la_LIBADD = $(LIBDALI_VIDEO_PLAYER_PLUGIN_LA_LIBADD)
-libdali_video_player_plugin_la_LDFLAGS = $(LIBDALI_VIDEO_PLAYER_PLUGIN_LA_LDFLAGS)
-
-if ENABLE_RENAME_SO
-#rename
-install: install-am
- rm -rf $(libdir)/libdali_video_player_plugin.so
- rm -rf $(libdir)/libdali_video_player_plugin-cxx03.so
- ln -s $(libdir)/libdali_video_player_plugin.so.0.0.* $(libdir)/libdali_video_player_plugin-cxx03.so
-endif
-endif
-endif
-
else # CXX03
if USE_FEEDBACK
endif
endif
-if WAYLAND
-if USE_VIDEOPLAYER
-libdali_video_player_plugin_cxx11_la_SOURCES = $(LIBDALI_VIDEO_PLAYER_PLUGIN_LA_SOURCES)
-libdali_video_player_plugin_cxx11_la_CXXFLAGS = $(LIBDALI_VIDEO_PLAYER_PLUGIN_LA_CXXFLAGS)
-libdali_video_player_plygin_cxx11_la_LIBADD = $(LIBDALI_VIDEO_PLAYER_PLUGIN_LA_LIBADD)
-libdali_video_player_plugin_cxx11_la_LDFLAGS = $(LIBDALI_VIDEO_PLAYER_PLUGIN_LA_LDFLAGS)
-
-if ENABLE_RENAME_SO
-#rename
-install: install-am
- rm -rf $(libdir)/libdali_video_player_plugin-cxx11.so
- rm -rf $(libdir)/libdali_video_player_plugin.so
- ln -s $(libdir)/libdali_video_player_plugin-cxx11.so.0.0.* $(libdir)/libdali_video_player_plugin.so
-endif
-endif
-endif
-
endif # CXX03
AM_CONDITIONAL([WAYLAND], [test x$enable_wayland = xyes])
AM_CONDITIONAL([USE_FEEDBACK], [test x$enable_feedback = xyes])
-AM_CONDITIONAL([USE_VIDEOPLAYER], [test x$enable_videoplayer = xyes])
AM_CONDITIONAL([ENABLE_CXX03_ABI], [test x$enable_cxx03_abi = xyes])
AM_CONDITIONAL([ENABLE_RENAME_SO], [test x$enable_rename_so = xyes])
DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -D_GLIBCXX_USE_CXX11_ABI=0"
fi
-if test "x$enable_wayland" = "xyes"; then
-if test "x$enable_videoplayer" = "xyes"; then
-if test "x$enable_profile" != "xUBUNTU"; then
-PKG_CHECK_MODULES(CAPI_MEDIA_PLAYER, capi-media-player)
-PKG_CHECK_MODULES(ECORE_WAYLAND, ecore-wayland)
-fi
-fi # enable_videoplayer
-fi # enable_wayland
-
if test "x$enable_feedback" = "xyes"; then
if test "x$enable_profile" != "xUBUNTU"; then
Name: dali-adaptor
Summary: The DALi Tizen Adaptor
-Version: 1.2.56
+Version: 1.2.65
Release: 1
Group: System/Libraries
License: Apache-2.0 and BSD-3-Clause and MIT
%endif
# for dali-adaptor
-BuildRequires: pkgconfig(evas)
-
%if 0%{?tizen_version_major} == 3
BuildRequires: pkgconfig(capi-appfw-application)
BuildRequires: pkgconfig(elementary)
BuildRequires: pkgconfig(feedback)
%endif
-# for videoplayer Plugin
-BuildRequires: pkgconfig(capi-media-player)
-
-
# for multiprofile
Requires: %{name}-compat = %{version}-%{release}
Recommends: %{name}-profile_common = %{version}-%{release}
%description dali-feedback-plugin
Feedback plugin to play haptic and audio feedback for Dali
-##############################
-# Dali VideoPlayer Plugin
-##############################
-%if %{with wayland}
-
-%package dali-video-player-plugin
-Summary: Plugin to play a video file for Dali
-Group: System/Libraries
-%description dali-video-player-plugin
-VideoPlayer plugin to play a video file for Dali
-%endif
-
%if !0%{?disable_cxx03_build}
##############################
# Dali Feedback Plugin cxx03
%description dali-feedback-plugin-cxx03
Feedback plugin to play haptic and audio feedback for Dali
-##############################
-# Dali VideoPlayer Plugin
-##############################
-%if %{with wayland}
-
-%package dali-video-player-plugin-cxx03
-Summary: Plugin to play a video file for Dali with cxx03 abi
-Group: System/Libraries
-%description dali-video-player-plugin-cxx03
-VideoPlayer plugin to play a video file for Dali
-%endif
%endif
##############################
%if 0%{?tizen_version_major} >= 3
--enable-feedback \
%endif
- --enable-videoplayer \
%if 0%{?tizen_2_2_compatibility}
--with-tizen-2-2-compatibility \
%endif
%if 0%{?tizen_version_major} >= 3
--enable-feedback \
%endif
- --enable-videoplayer \
%if 0%{?tizen_2_2_compatibility}
--with-tizen-2-2-compatibility \
%endif
%if 0%{?tizen_version_major} >= 3
--enable-feedback \
%endif
- --enable-videoplayer \
%if 0%{?tizen_2_2_compatibility}
--with-tizen-2-2-compatibility \
%endif
%if 0%{?tizen_version_major} >= 3
--enable-feedback \
%endif
- --enable-videoplayer \
%if 0%{?tizen_2_2_compatibility}
--with-tizen-2-2-compatibility \
%endif
%endif
#######################################################################
-# common ( build dali_videoplayer_plugin for common uses )
+# common
# This is for backward-compatibility. This does not deteriorate 4.0 Configurability
# if common ||"undefined"
%if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
%if 0%{?tizen_version_major} >= 3
--enable-feedback \
%endif
- --enable-videoplayer \
%if 0%{?tizen_2_2_compatibility}
--with-tizen-2-2-compatibility \
%endif
%if 0%{?tizen_version_major} >= 3
--enable-feedback \
%endif
- --enable-videoplayer \
--enable-cxx03-abi=yes \
%if 0%{?tizen_2_2_compatibility}
--with-tizen-2-2-compatibility \
%if 0%{?tizen_version_major} >= 3
--enable-feedback \
%endif
- --enable-videoplayer \
--enable-cxx03-abi=yes \
%if 0%{?tizen_2_2_compatibility}
--with-tizen-2-2-compatibility \
%if 0%{?tizen_version_major} >= 3
--enable-feedback \
%endif
- --enable-videoplayer \
--enable-cxx03-abi=yes \
%if 0%{?tizen_2_2_compatibility}
--with-tizen-2-2-compatibility \
%if 0%{?tizen_version_major} >= 3
--enable-feedback \
%endif
- --enable-videoplayer \
--enable-cxx03-abi=yes \
%if 0%{?tizen_2_2_compatibility}
--with-tizen-2-2-compatibility \
%endif
#######################################################################
-# common ( build dali_videoplayer_plugin for common uses )
+# common
# This is for backward-compatibility. This does not deteriorate 4.0 Configurability
# if common ||"undefined"
%if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
%if 0%{?tizen_version_major} >= 3
--enable-feedback \
%endif
- --enable-videoplayer \
--enable-cxx03-abi=yes \
%if 0%{?tizen_2_2_compatibility}
--with-tizen-2-2-compatibility \
/sbin/ldconfig
exit 0
-%if %{with wayland}
-%post dali-video-player-plugin
-/sbin/ldconfig
-exit 0
-%endif
-
-%if %{with wayland}
-%postun dali-video-player-plugin
-/sbin/ldconfig
-exit 0
-%endif
-
-
##############################
# This is for backward-compatibility. This does not deteriorate 4.0 Configurability
%license LICENSE
# This is for backward-compatibility. This does not deteriorate 4.0 Configurability
# if common ||"undefined"
-%if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
+#%if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
%defattr(-,root,root,-)
%{_libdir}/libdali-adaptor.so.0*
%{_libdir}/libdali-adaptor-cxx03.so
%exclude %{_libdir}/libdali-adap*.so*.wearable
%exclude %{_libdir}/libdali-adap*.so*.tv
%exclude %{_libdir}/libdali-adap*.so*.ivi
-%endif
-
-%if %{with wayland}
-%files dali-video-player-plugin-cxx03
-%manifest dali-adaptor.manifest
-%defattr(-,root,root,-)
-%{_libdir}/libdali-video-player-plugin.so*
-%license LICENSE
-%endif
+#%endif
%if 0%{?tizen_version_major} >= 3
%files dali-feedback-plugin-cxx03
#################################################
-%if %{with wayland}
-%files dali-video-player-plugin
-%manifest dali-adaptor.manifest
-%defattr(-,root,root,-)
-%{_libdir}/libdali-video-player-plugin-cxx11.so*
-%license LICENSE
-%endif
-
%if 0%{?tizen_version_major} >= 3
%files dali-feedback-plugin
%manifest dali-adaptor.manifest
--- /dev/null
+/*
+ * Copyright (c) 2017 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 <memory.h>
+
+// INTERNAL INCLUDES
+#include "gaussian-blur.h"
+#include "pixel-buffer-impl.h"
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+
+
+void ConvoluteAndTranspose( unsigned char* inBuffer,
+ unsigned char* outBuffer,
+ const unsigned int bufferWidth,
+ const unsigned int bufferHeight,
+ const float blurRadius )
+{
+ // Calculate the weights for gaussian blur
+ int radius = static_cast<int>( std::ceil( blurRadius ) );
+ int rows = radius * 2 + 1;
+
+ float sigma = ( blurRadius < Math::MACHINE_EPSILON_1 ) ? 0.0f : blurRadius * 0.4f + 0.6f; // The same equation used by Android
+ float sigma22 = 2.0f * sigma * sigma;
+ float sqrtSigmaPi2 = std::sqrt( 2.0f * Math::PI ) * sigma;
+ float radius2 = radius * radius;
+ float normalizeFactor = 0.0f;
+
+ float* weightMatrix = new float[rows];
+ int index = 0;
+
+ for ( int row = -radius; row <= radius; row++ )
+ {
+ float distance = row * row;
+ if ( distance > radius2 )
+ {
+ weightMatrix[index] = 0.0f;
+ }
+ else
+ {
+ weightMatrix[index] = static_cast<float>( std::exp( -( distance ) / sigma22 ) / sqrtSigmaPi2 );
+ }
+ normalizeFactor += weightMatrix[index];
+ index++;
+ }
+
+ for ( int i = 0; i < rows; i++ )
+ {
+ weightMatrix[i] /= normalizeFactor;
+ }
+
+ // Perform the convolution and transposition using the weights
+ int columns = rows;
+ int columns2 = columns / 2;
+ for ( unsigned int y = 0; y < bufferHeight; y++ )
+ {
+ unsigned int targetPixelIndex = y;
+ unsigned int ioffset = y * bufferWidth;
+ for ( unsigned int x = 0; x < bufferWidth; x++ )
+ {
+ float r = 0.0f, g = 0.0f, b = 0.0f, a = 0.0f;
+ int weightColumnOffset = columns2;
+ for ( int column = -columns2; column <= columns2; column++ )
+ {
+ float weight = weightMatrix[weightColumnOffset + column];
+ if ( fabsf( weight ) > Math::MACHINE_EPSILON_1 )
+ {
+ int ix = x + column;
+ ix = std::max( 0, std::min( ix, static_cast<int>( bufferWidth - 1 ) ) );
+ unsigned int sourcePixelIndex = ioffset + ix;
+ r += weight * inBuffer[sourcePixelIndex*4];
+ g += weight * inBuffer[sourcePixelIndex*4+1];
+ b += weight * inBuffer[sourcePixelIndex*4+2];
+ a += weight * inBuffer[sourcePixelIndex*4+3];
+ }
+ }
+
+ outBuffer[targetPixelIndex*4] = std::max( 0, std::min( static_cast<int>( r + 0.5f ), 255 ) );
+ outBuffer[targetPixelIndex*4+1] = std::max( 0, std::min( static_cast<int>( g + 0.5f ), 255 ) );
+ outBuffer[targetPixelIndex*4+2] = std::max( 0, std::min( static_cast<int>( b + 0.5f ), 255 ) );
+ outBuffer[targetPixelIndex*4+3] = std::max( 0, std::min( static_cast<int>( a + 0.5f ), 255 ) );
+
+ targetPixelIndex += bufferHeight;
+ }
+ }
+
+ delete [] weightMatrix;
+}
+
+void PerformGaussianBlurRGBA( PixelBuffer& buffer, const float blurRadius )
+{
+ unsigned int bufferWidth = buffer.GetWidth();
+ unsigned int bufferHeight = buffer.GetHeight();
+
+ // Create a temporary buffer for the two-pass blur
+ PixelBufferPtr softShadowImageBuffer = PixelBuffer::New( bufferWidth, bufferHeight, Pixel::RGBA8888 );
+ memcpy( softShadowImageBuffer->GetBuffer(), buffer.GetBuffer(), 4u * bufferWidth * bufferHeight );
+
+ // We perform the blur first but write its output image buffer transposed, so that we
+ // can just do it in two passes. The first pass blurs horizontally and transposes, the
+ // second pass does the same, but as the image is now transposed, it's really doing a
+ // vertical blur. The second transposition makes the image the right way up again. This
+ // is much faster than doing a 2D convolution.
+ ConvoluteAndTranspose( buffer.GetBuffer(), softShadowImageBuffer->GetBuffer(), bufferWidth, bufferHeight, blurRadius );
+ ConvoluteAndTranspose( softShadowImageBuffer->GetBuffer(), buffer.GetBuffer(), bufferHeight, bufferWidth, blurRadius );
+
+ // On leaving scope, softShadowImageBuffer will get destroyed.
+}
+
+} //namespace Adaptor
+
+}// namespace Internal
+
+}// namespace Dali
--- /dev/null
+#ifndef DALI_INTERNAL_ADAPTOR_GAUSSIAN_BLUR_H
+#define DALI_INTERNAL_ADAPTOR_GAUSSIAN_BLUR_H
+
+/*
+ * Copyright (c) 2017 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.
+ */
+
+#include "pixel-buffer-impl.h"
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+/**
+ * Perform a one dimension Gaussian blur convolution and write its output buffer transposed.
+ *
+ * @param[in] inBuffer The input buffer with the source image
+ * @param[in] outBuffer The output buffer with the Gaussian blur applied and transposed
+ * @param[in] bufferWidth The width of the buffer
+ * @param[in] bufferHeight The height of the buffer
+ * @param[in] blurRadius The radius for Gaussian blur
+ */
+void ConvoluteAndTranspose( unsigned char* inBuffer, unsigned char* outBuffer, const unsigned int bufferWidth, const unsigned int bufferHeight, const float blurRadius );
+
+/**
+ * Perform Gaussian blur on a buffer.
+ *
+ * A Gaussian blur is generated by replacing each pixel’s color values with the average of the surrounding pixels’
+ * colors. This region is a circle with the given radius. Thus, a bigger radius yields a blurrier image.
+ *
+ * @note The pixel format of the buffer must be RGBA8888
+ *
+ * @param[in] buffer The buffer to apply the Gaussian blur to
+ * @param[in] blurRadius The radius for Gaussian blur
+ */
+void PerformGaussianBlurRGBA( PixelBuffer& buffer, const float blurRadius );
+
+} //namespace Adaptor
+
+} //namespace Internal
+
+} //namespace Dali
+
+#endif // DALI_INTERNAL_ADAPTOR_GAUSSIAN_BLUR_H
// If both dimensions have values requested, use them both:
if( requestedWidth != 0 && requestedHeight != 0 )
{
- if( requestedWidth <= maxSize && requestedWidth <= maxSize )
+ if( requestedWidth <= maxSize && requestedHeight <= maxSize )
{
return ImageDimensions( requestedWidth, requestedHeight );
}
case Dali::Pixel::RGB888:
case Dali::Pixel::RGB8888:
case Dali::Pixel::BGR8888:
+ case Dali::Pixel::RGB16F:
+ case Dali::Pixel::RGB32F:
{
return ( channel == RED || channel == GREEN || channel == BLUE );
}
\
$(portable_platform_abstraction_src_dir)/image-operations.cpp \
$(portable_platform_abstraction_src_dir)/pixel-manipulation.cpp \
- $(portable_platform_abstraction_src_dir)/alpha-mask.cpp
+ $(portable_platform_abstraction_src_dir)/alpha-mask.cpp \
+ $(portable_platform_abstraction_src_dir)/gaussian-blur.cpp
# Add public headers here:
png_byte colortype = png_get_color_type(png, info);
- if(colortype == PNG_COLOR_TYPE_GRAY)
+ if( colortype == PNG_COLOR_TYPE_GRAY ||
+ colortype == PNG_COLOR_TYPE_GRAY_ALPHA )
{
- switch( colordepth )
+ if( colortype == PNG_COLOR_TYPE_GRAY )
{
- case 8:
- {
- pixelFormat = Pixel::L8;
- valid = true;
- break;
- }
- default:
+ pixelFormat = Pixel::L8;
+ if( png_get_valid(png, info, PNG_INFO_tRNS) )
{
- break;
+ colortype = PNG_COLOR_TYPE_GRAY_ALPHA;
+ /* expand transparency entry -> alpha channel if present */
+ png_set_tRNS_to_alpha(png);
+ pixelFormat = Pixel::LA88;
}
}
- }
- else if(colortype == PNG_COLOR_TYPE_GRAY_ALPHA)
- {
- switch(colordepth)
+ else
{
- case 8:
- {
- pixelFormat = Pixel::LA88;
- valid = true;
- break;
- }
- default:
- {
- break;
- }
+ pixelFormat = Pixel::LA88;
+ }
+
+ if( colordepth < 8 )
+ {
+ /* expand gray (w/reduced bits) -> 8-bit RGB if necessary */
+ png_set_expand_gray_1_2_4_to_8(png);
+ /* pack all pixels to byte boundaries */
+ png_set_packing(png);
}
+ valid = true;
}
else if(colortype == PNG_COLOR_TYPE_RGB )
{
feedback_plugin_src_files = \
$(plugin_src_dir)/dali-feedback.cpp
-
-video_player_plugin_src_files = \
- $(plugin_src_dir)/video-player/tizen-video-player.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.
- *
- */
-
-// CLASS HEADER
-#include <tizen-video-player.h>
-
-// EXTERNAL INCLUDES
-#include <dali/public-api/common/stage.h>
-#include <dali/devel-api/threading/mutex.h>
-#include <dali/integration-api/debug.h>
-
-// INTERNAL INCLUDES
-
-// The plugin factories
-extern "C" DALI_EXPORT_API Dali::VideoPlayerPlugin* CreateVideoPlayerPlugin( void )
-{
- return new Dali::Plugin::TizenVideoPlayer;
-}
-
-extern "C" DALI_EXPORT_API void DestroyVideoPlayerPlugin( Dali::VideoPlayerPlugin* plugin )
-{
- if( plugin != NULL )
- {
- delete plugin;
- }
-}
-
-namespace Dali
-{
-
-namespace Plugin
-{
-
-namespace
-{
-
-const int TIMER_INTERVAL( 20 );
-
-static void MediaPacketVideoDecodedCb( media_packet_h packet, void* user_data )
-{
- TizenVideoPlayer* player = static_cast< TizenVideoPlayer* >( user_data );
-
- if( player == NULL )
- {
- DALI_LOG_ERROR( "Decoded callback got Null pointer as user_data.\n" );
- return;
- }
-
- player->PushPacket( packet );
-}
-
-static void EmitPlaybackFinishedSignal( void* user_data )
-{
- TizenVideoPlayer* player = static_cast< TizenVideoPlayer* >( user_data );
- DALI_LOG_ERROR( "EmitPlaybackFinishedSignal.\n" );
-
- if( player == NULL )
- {
- DALI_LOG_ERROR( "Decoded callback got Null pointer as user_data.\n" );
- return;
- }
-
- DALI_LOG_ERROR( "EmitPlaybackFinishedSignal.\n" );
-
- if( !player->mFinishedSignal.Empty() )
- {
- DALI_LOG_ERROR( "EmitPlaybackFinishedSignal.3\n" );
- player->mFinishedSignal.Emit();
- }
-
- player->Stop();
-}
-
-// ToDo: VD player_set_play_position() doesn't work when callback pointer is NULL.
-// We should check whether this callback is needed in platform.
-static void PlayerSeekCompletedCb( void* data )
-{
-}
-
-void LogPlayerError( int error )
-{
- if( error != PLAYER_ERROR_NONE )
- {
- switch( error )
- {
- case PLAYER_ERROR_OUT_OF_MEMORY:
- {
- DALI_LOG_ERROR( "Player error: Out of memory\n" );
- return;
- }
- case PLAYER_ERROR_INVALID_PARAMETER:
- {
- DALI_LOG_ERROR( "Player error: Invalid parameter\n" );
- return;
- }
- case PLAYER_ERROR_NO_SUCH_FILE:
- {
- DALI_LOG_ERROR( "Player error: No such file\n" );
- return;
- }
- case PLAYER_ERROR_INVALID_OPERATION:
- {
- DALI_LOG_ERROR( "Player error: Invalid operation\n" );
- return;
- }
- case PLAYER_ERROR_FILE_NO_SPACE_ON_DEVICE:
- {
- DALI_LOG_ERROR( "Player error: No space on device\n" );
- return;
- }
- case PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE:
- {
- DALI_LOG_ERROR( "Player error: Not supported feature on device\n" );
- return;
- }
- case PLAYER_ERROR_SEEK_FAILED:
- {
- DALI_LOG_ERROR( "Player error: Seek failed\n" );
- return;
- }
- case PLAYER_ERROR_INVALID_STATE:
- {
- DALI_LOG_ERROR( "Player error: Invalid state\n" );
- return;
- }
- case PLAYER_ERROR_NOT_SUPPORTED_FILE:
- {
- DALI_LOG_ERROR( "Player error: Not supported file\n" );
- return;
- }
- case PLAYER_ERROR_INVALID_URI:
- {
- DALI_LOG_ERROR( "Player error: Invalid uri\n" );
- return;
- }
- case PLAYER_ERROR_SOUND_POLICY:
- {
- DALI_LOG_ERROR( "Player error: Sound policy\n" );
- return;
- }
- case PLAYER_ERROR_CONNECTION_FAILED:
- {
- DALI_LOG_ERROR( "Player error: Connection failed\n" );
- return;
- }
- case PLAYER_ERROR_VIDEO_CAPTURE_FAILED:
- {
- DALI_LOG_ERROR( "Player error: Video capture failed\n" );
- return;
- }
- case PLAYER_ERROR_DRM_EXPIRED:
- {
- DALI_LOG_ERROR( "Player error: DRM expired\n" );
- return;
- }
- case PLAYER_ERROR_DRM_NO_LICENSE:
- {
- DALI_LOG_ERROR( "Player error: No license\n" );
- return;
- }
- case PLAYER_ERROR_DRM_FUTURE_USE:
- {
- DALI_LOG_ERROR( "Player error: License for future use\n" );
- return;
- }
- case PLAYER_ERROR_DRM_NOT_PERMITTED:
- {
- DALI_LOG_ERROR( "Player error: Format not permitted\n" );
- return;
- }
- case PLAYER_ERROR_RESOURCE_LIMIT:
- {
- DALI_LOG_ERROR( "Player error: Resource limit\n" );
- return;
- }
- case PLAYER_ERROR_PERMISSION_DENIED:
- {
- DALI_LOG_ERROR( "Player error: Permission denied\n" );
- return;
- }
- case PLAYER_ERROR_SERVICE_DISCONNECTED:
- {
- DALI_LOG_ERROR( "Player error: Service disconnected\n" );
- return;
- }
- case PLAYER_ERROR_BUFFER_SPACE:
- {
- DALI_LOG_ERROR( "Player error: Buffer space\n" );
- return;
- }
- }
- }
-}
-
-} // unnamed namespace
-
-TizenVideoPlayer::TizenVideoPlayer()
-: mPlayer( NULL ),
- mPlayerState( PLAYER_STATE_NONE ),
- mTbmSurface( NULL ),
- mPacket( NULL ),
- mTargetType( NativeImage ),
- mAlphaBitChanged( false )
-{
-}
-
-TizenVideoPlayer::~TizenVideoPlayer()
-{
-}
-
-void TizenVideoPlayer::GetPlayerState( player_state_e* state )
-{
- if( mPlayer != NULL && player_get_state( mPlayer, state ) != PLAYER_ERROR_NONE )
- {
- DALI_LOG_ERROR( "player_get_state error: Invalid parameter\n" );
- *state = PLAYER_STATE_NONE;
- }
-}
-
-void TizenVideoPlayer::SetUrl( const std::string& url )
-{
- if( mUrl != url )
- {
- mUrl = url;
-
- GetPlayerState( &mPlayerState );
-
- if( mPlayerState != PLAYER_STATE_NONE && mPlayerState != PLAYER_STATE_IDLE )
- {
- Stop();
- int error = player_unprepare( mPlayer );
- LogPlayerError( error );
- }
-
- if( mPlayerState == PLAYER_STATE_IDLE )
- {
- int error = player_set_uri( mPlayer, mUrl.c_str() );
- LogPlayerError( error );
-
- error = player_prepare( mPlayer );
- LogPlayerError( error );
- }
- }
-}
-
-std::string TizenVideoPlayer::GetUrl()
-{
- return mUrl;
-}
-
-void TizenVideoPlayer::SetRenderingTarget( Any target )
-{
- int error;
- if( mPlayerState != PLAYER_STATE_NONE )
- {
- GetPlayerState( &mPlayerState );
-
- if( mPlayerState != PLAYER_STATE_IDLE )
- {
- Stop();
- error = player_unprepare( mPlayer );
- LogPlayerError( error );
- }
-
- error = player_destroy( mPlayer );
- LogPlayerError( error );
- mPlayerState = PLAYER_STATE_NONE;
- mPlayer = NULL;
- mUrl = "";
- }
-
- mNativeImageSourcePtr = NULL;
- mEcoreWlWindow = NULL;
-
- if( target.GetType() == typeid( Dali::NativeImageSourcePtr ) )
- {
- mTargetType = TizenVideoPlayer::NativeImage;
-
- Dali::NativeImageSourcePtr nativeImageSourcePtr = AnyCast< Dali::NativeImageSourcePtr >( target );
-
- InitializeTextureStreamMode( nativeImageSourcePtr );
- }
- else if( target.GetType() == typeid( Ecore_Wl_Window* ) )
- {
- mTargetType = TizenVideoPlayer::WindowSurface;
-
- Ecore_Wl_Window* nativeWindow = Dali::AnyCast< Ecore_Wl_Window* >( target );
- InitializeUnderlayMode( nativeWindow );
- }
- else
- {
- DALI_LOG_ERROR( "Video rendering target is unknown\n" );
- }
-}
-
-void TizenVideoPlayer::SetLooping( bool looping )
-{
- GetPlayerState( &mPlayerState );
-
- if( mPlayerState != PLAYER_STATE_NONE )
- {
- int error = player_set_looping( mPlayer, looping );
- LogPlayerError( error );
- }
-}
-
-bool TizenVideoPlayer::IsLooping()
-{
- GetPlayerState( &mPlayerState );
-
- bool looping = false;
- if( mPlayerState != PLAYER_STATE_NONE )
- {
- int error = player_is_looping( mPlayer, &looping );
- LogPlayerError( error );
- }
-
- return looping;
-}
-
-void TizenVideoPlayer::Play()
-{
- GetPlayerState( &mPlayerState );
-
- if( mPlayerState == PLAYER_STATE_READY || mPlayerState == PLAYER_STATE_PAUSED )
- {
- if( mNativeImageSourcePtr != NULL && mTimer )
- {
- mTimer.Start();
- }
-
- int error = player_start( mPlayer );
- LogPlayerError( error );
- }
-}
-
-void TizenVideoPlayer::Pause()
-{
- GetPlayerState( &mPlayerState );
-
- if( mPlayerState == PLAYER_STATE_PLAYING )
- {
- int error = player_pause( mPlayer );
- LogPlayerError( error );
-
- if( mNativeImageSourcePtr != NULL && mTimer )
- {
- mTimer.Stop();
- DestroyPackets();
- }
- }
-}
-
-void TizenVideoPlayer::Stop()
-{
- GetPlayerState( &mPlayerState );
-
- if( mPlayerState == PLAYER_STATE_PLAYING || mPlayerState == PLAYER_STATE_PAUSED )
- {
- int error = player_stop( mPlayer );
- LogPlayerError( error );
- }
-
- if( mNativeImageSourcePtr != NULL && mTimer )
- {
- mTimer.Stop();
- DestroyPackets();
- }
-}
-
-void TizenVideoPlayer::SetMute( bool muted )
-{
- GetPlayerState( &mPlayerState );
-
- if( mPlayerState == PLAYER_STATE_IDLE ||
- mPlayerState == PLAYER_STATE_READY ||
- mPlayerState == PLAYER_STATE_PLAYING ||
- mPlayerState == PLAYER_STATE_PAUSED
- )
- {
- int error = player_set_mute( mPlayer, muted );
- LogPlayerError( error );
- }
-}
-
-bool TizenVideoPlayer::IsMuted()
-{
- GetPlayerState( &mPlayerState );
- bool muted = false;
-
- if( mPlayerState == PLAYER_STATE_IDLE ||
- mPlayerState == PLAYER_STATE_READY ||
- mPlayerState == PLAYER_STATE_PLAYING ||
- mPlayerState == PLAYER_STATE_PAUSED
- )
- {
- int error = player_is_muted( mPlayer, &muted );
- LogPlayerError( error );
- }
-
- return muted;
-}
-
-void TizenVideoPlayer::SetVolume( float left, float right )
-{
- GetPlayerState( &mPlayerState );
-
- int error = player_set_volume( mPlayer, left, right );
- LogPlayerError( error );
-}
-
-void TizenVideoPlayer::GetVolume( float& left, float& right )
-{
- GetPlayerState( &mPlayerState );
-
- int error = player_get_volume( mPlayer, &left, &right );
- LogPlayerError( error );
-}
-
-void TizenVideoPlayer::SetPlayPosition( int millisecond )
-{
- int error;
-
- GetPlayerState( &mPlayerState );
-
- if( mPlayerState == PLAYER_STATE_READY ||
- mPlayerState == PLAYER_STATE_PLAYING ||
- mPlayerState == PLAYER_STATE_PAUSED
- )
- {
- error = player_set_play_position( mPlayer, millisecond, false, PlayerSeekCompletedCb, NULL );
- LogPlayerError( error );
- }
-}
-
-int TizenVideoPlayer::GetPlayPosition()
-{
- int error;
- int millisecond = 0;
-
- GetPlayerState( &mPlayerState );
-
- if( mPlayerState == PLAYER_STATE_IDLE ||
- mPlayerState == PLAYER_STATE_READY ||
- mPlayerState == PLAYER_STATE_PLAYING ||
- mPlayerState == PLAYER_STATE_PAUSED
- )
- {
- error = player_get_play_position( mPlayer, &millisecond );
- LogPlayerError( error );
- }
-
- return millisecond;
-}
-
-void TizenVideoPlayer::SetDisplayRotation( Dali::VideoPlayerPlugin::DisplayRotation rotation )
-{
- if( mNativeImageSourcePtr != NULL )
- {
- DALI_LOG_ERROR( "SetDisplayRotation is only for window rendering target.\n" );
- return;
- }
-
- int error;
- if( mPlayerState != PLAYER_STATE_NONE )
- {
- error = player_set_display_rotation( mPlayer, static_cast< player_display_rotation_e >( rotation ) );
- LogPlayerError( error );
- }
-}
-
-Dali::VideoPlayerPlugin::DisplayRotation TizenVideoPlayer::GetDisplayRotation()
-{
- if( mNativeImageSourcePtr != NULL )
- {
- DALI_LOG_ERROR( "GetDisplayRotation is only for window rendering target.\n" );
- return Dali::VideoPlayerPlugin::ROTATION_NONE;
- }
-
- int error;
- player_display_rotation_e rotation = PLAYER_DISPLAY_ROTATION_NONE;
- if( mPlayerState != PLAYER_STATE_NONE )
- {
- error = player_get_display_rotation( mPlayer, &rotation );
- LogPlayerError( error );
- }
- return static_cast< Dali::VideoPlayerPlugin::DisplayRotation >( rotation );
-}
-
-Dali::VideoPlayerPlugin::VideoPlayerSignalType& TizenVideoPlayer::FinishedSignal()
-{
- return mFinishedSignal;
-}
-
-void TizenVideoPlayer::InitializeTextureStreamMode( Dali::NativeImageSourcePtr nativeImageSourcePtr )
-{
- int error;
-
- mNativeImageSourcePtr = nativeImageSourcePtr;
-
- if( mAlphaBitChanged )
- {
- ecore_wl_window_alpha_set( mEcoreWlWindow, false );
- mAlphaBitChanged = false;
- }
-
- if( mPlayerState == PLAYER_STATE_NONE )
- {
- error = player_create( &mPlayer );
- LogPlayerError( error );
- }
-
- GetPlayerState( &mPlayerState );
-
- if( mPlayerState == PLAYER_STATE_IDLE )
- {
- error = player_set_completed_cb( mPlayer, EmitPlaybackFinishedSignal, this );
- LogPlayerError( error );
-
- error = player_set_media_packet_video_frame_decoded_cb( mPlayer, MediaPacketVideoDecodedCb, this );
- LogPlayerError( error );
-
- error = player_set_sound_type( mPlayer, SOUND_TYPE_MEDIA );
- LogPlayerError( error );
-
- error = player_set_display_mode( mPlayer, PLAYER_DISPLAY_MODE_FULL_SCREEN );
- LogPlayerError( error );
-
- error = player_set_display( mPlayer, PLAYER_DISPLAY_TYPE_NONE, NULL );
- LogPlayerError( error );
-
- error = player_set_display_visible( mPlayer, true );
- LogPlayerError( error );
-
- mTimer = Dali::Timer::New( TIMER_INTERVAL );
- mTimer.TickSignal().Connect( this, &TizenVideoPlayer::Update );
- }
-}
-
-void TizenVideoPlayer::InitializeUnderlayMode( Ecore_Wl_Window* ecoreWlWindow )
-{
- int error;
- if( mPlayerState == PLAYER_STATE_NONE )
- {
- error = player_create( &mPlayer );
- LogPlayerError( error );
- }
-
- GetPlayerState( &mPlayerState );
- mEcoreWlWindow = ecoreWlWindow;
-
- if( mPlayerState == PLAYER_STATE_IDLE )
- {
- error = player_set_completed_cb( mPlayer, EmitPlaybackFinishedSignal, this );
- LogPlayerError( error );
-
- error = player_set_sound_type( mPlayer, SOUND_TYPE_MEDIA );
- LogPlayerError( error );
-
- error = player_set_display_mode( mPlayer, PLAYER_DISPLAY_MODE_DST_ROI );
- LogPlayerError( error );
-
- error = player_set_display_roi_area( mPlayer, 0, 0, 1, 1 );
-
- int width, height;
- mAlphaBitChanged = ( ecore_wl_window_alpha_get( mEcoreWlWindow ) )? false: true;
- ecore_wl_screen_size_get( &width, &height );
-
- if( mAlphaBitChanged )
- {
- ecore_wl_window_alpha_set( mEcoreWlWindow, true );
- }
- error = player_set_ecore_wl_display( mPlayer, PLAYER_DISPLAY_TYPE_OVERLAY, mEcoreWlWindow, 0, 0, width, height );
- LogPlayerError( error );
-
- error = player_set_display_visible( mPlayer, true );
- LogPlayerError( error );
- }
-}
-
-bool TizenVideoPlayer::Update()
-{
- Dali::Mutex::ScopedLock lock( mPacketMutex );
-
- int error;
-
- if( mPacket != NULL )
- {
- error = media_packet_destroy( mPacket );
- if( error != MEDIA_PACKET_ERROR_NONE )
- {
- DALI_LOG_ERROR( "Media packet destroy error: %d\n", error );
- }
- mPacket = NULL;
- }
-
- if( !mPacketVector.Empty() )
- {
- mPacket = static_cast< media_packet_h >( mPacketVector[0] );
- mPacketVector.Remove( mPacketVector.Begin() );
- }
-
- if( mPacket == NULL )
- {
- return true;
- }
-
- error = media_packet_get_tbm_surface( mPacket, &mTbmSurface );
- if( error != MEDIA_PACKET_ERROR_NONE )
- {
- media_packet_destroy( mPacket );
- mPacket = NULL;
- DALI_LOG_ERROR( " error: %d\n", error );
- return true;
- }
-
- Any source( mTbmSurface );
- mNativeImageSourcePtr->SetSource( source );
- Dali::Stage::GetCurrent().KeepRendering( 0.0f );
-
- return true;
-}
-
-void TizenVideoPlayer::DestroyPackets()
-{
- int error;
- if( mPacket != NULL )
- {
- error = media_packet_destroy( mPacket );
- DALI_LOG_ERROR( "Media packet destroy error: %d\n", error );
- mPacket = NULL;
- }
-
- for(unsigned int i = 0; i < mPacketVector.Size(); ++i)
- {
- mPacket = static_cast< media_packet_h >( mPacketVector[i] );
- error = media_packet_destroy( mPacket );
- DALI_LOG_ERROR( "Media packet destroy error: %d\n", error );
- mPacket = NULL;
- }
- mPacketVector.Clear();
-}
-
-void TizenVideoPlayer::PushPacket( media_packet_h packet )
-{
- Dali::Mutex::ScopedLock lock( mPacketMutex );
- mPacketVector.PushBack( packet );
-}
-
-void TizenVideoPlayer::SetDisplayArea( DisplayArea area )
-{
- GetPlayerState( &mPlayerState );
-
- if( mNativeImageSourcePtr != NULL )
- {
- DALI_LOG_ERROR( "SetDisplayArea is only for window surface target.\n" );
- return;
- }
-
- if( mPlayerState == PLAYER_STATE_IDLE ||
- mPlayerState == PLAYER_STATE_READY ||
- mPlayerState == PLAYER_STATE_PLAYING ||
- mPlayerState == PLAYER_STATE_PAUSED
-
- )
- {
- int error = player_set_display_roi_area( mPlayer, area.x, area.y, area.width, area.height );
- LogPlayerError( error );
- }
-}
-
-void TizenVideoPlayer::Forward( int millisecond )
-{
- int error;
-
- GetPlayerState( &mPlayerState );
-
- if( mPlayerState == PLAYER_STATE_READY ||
- mPlayerState == PLAYER_STATE_PLAYING ||
- mPlayerState == PLAYER_STATE_PAUSED
- )
- {
- int currentPosition = 0;
- int nextPosition = 0;
-
- error = player_get_play_position( mPlayer, ¤tPosition );
- LogPlayerError( error );
-
- nextPosition = currentPosition + millisecond;
-
- error = player_set_play_position( mPlayer, nextPosition, false, PlayerSeekCompletedCb, NULL );
- LogPlayerError( error );
- }
-}
-
-void TizenVideoPlayer::Backward( int millisecond )
-{
- int error;
-
- GetPlayerState( &mPlayerState );
-
- if( mPlayerState == PLAYER_STATE_READY ||
- mPlayerState == PLAYER_STATE_PLAYING ||
- mPlayerState == PLAYER_STATE_PAUSED
- )
- {
- int currentPosition = 0;
- int nextPosition = 0;
-
- error = player_get_play_position( mPlayer, ¤tPosition );
- LogPlayerError( error );
-
- nextPosition = currentPosition - millisecond;
- nextPosition = ( nextPosition < 0 )? 0 : nextPosition;
-
- error = player_set_play_position( mPlayer, nextPosition, false, PlayerSeekCompletedCb, NULL );
- LogPlayerError( error );
- }
-}
-
-} // namespace Plugin
-} // namespace Dali;
+++ /dev/null
-#ifndef __DALI_TIZEN_VIDEO_PLAYER_PLUGIN_H__
-#define __DALI_TIZEN_VIDEO_PLAYER_PLUGIN_H__
-
-/*
- * 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.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <dali/devel-api/threading/mutex.h>
-#include <player.h>
-#include <string>
-
-#ifndef HAVE_WAYLAND
-#define HAVE_WAYLAND
-#endif
-#include <player_internal.h>
-
-// INTERNAL INCLUDES
-#include <native-image-source.h>
-#include <video-player-plugin.h>
-#include <timer.h>
-
-namespace Dali
-{
-
-namespace Plugin
-{
-
-/**
- * @brief Implementation of the Tizen video player class which has Tizen platform dependency.
- * @SINCE_1_1.38
- */
-class TizenVideoPlayer : public Dali::VideoPlayerPlugin, public Dali::ConnectionTracker
-{
-public:
-
- /**
- * @brief Video rendering target type
- * @SINCE_1_1.38
- */
- enum RenderingTargetType
- {
- WindowSurface, ///< HW underlay
- NativeImage ///< texture stream
- };
-
- /**
- * @brief Constructor.
- * @SINCE_1_1.38
- */
- TizenVideoPlayer();
-
- /**
- * @brief Destructor.
- * @SINCE_1_1.38
- */
- virtual ~TizenVideoPlayer();
-
- /**
- * @copydoc Dali::VideoPlayerPlugin::SetUrl()
- */
- virtual void SetUrl( const std::string& url );
-
- /**
- * @copydoc Dali::VideoPlayerPlugin::GetUrl()
- */
- virtual std::string GetUrl();
-
- /**
- * @copydoc Dali::VideoPlayerPlugin::SetLooping()
- */
- virtual void SetLooping(bool looping);
-
- /**
- * @copydoc Dali::VideoPlayerPlugin::IsLooping()
- */
- virtual bool IsLooping();
-
- /**
- * @copydoc Dali::VideoPlayerPlugin::Play()
- */
- virtual void Play();
-
- /**
- * @copydoc Dali::VideoPlayerPlugin::Pause()
- */
- virtual void Pause();
-
- /**
- * @copydoc Dali::VideoPlayerPlugin::Stop()
- */
- virtual void Stop();
-
- /**
- * @copydoc Dali::VideoPlayerPlugin::SetMute()
- */
- virtual void SetMute( bool mute );
-
- /**
- * @copydoc Dali::VideoPlayerPlugin::IsMute()
- */
- virtual bool IsMuted();
-
- /**
- * @copydoc Dali::VideoPlayerPlugin::SetVolume()
- */
- virtual void SetVolume( float left, float right );
-
- /**
- * @copydoc Dali::VideoPlayerPlugin::GetVolume()
- */
- virtual void GetVolume( float& left, float& right );
-
- /**
- * @copydoc Dali::VideoPlayerPlugin::SetRenderingTarget()
- */
- void SetRenderingTarget( Any target );
-
- /**
- * @copydoc Dali::VideoPlayerPlugin::SetPlayPosition()
- */
- virtual void SetPlayPosition( int millisecond );
-
- /**
- * @copydoc Dali::VideoPlayerPlugin::GetPlayPosition()
- */
- virtual int GetPlayPosition();
-
- /**
- * @copydoc Dali::VideoPlayerPlugin::SetDisplayArea()
- */
- virtual void SetDisplayArea( DisplayArea area );
-
- /**
- * @copydoc Dali::VideoPlayerPlugin::SetDisplayRotation()
- */
- virtual void SetDisplayRotation( Dali::VideoPlayerPlugin::DisplayRotation rotation );
-
- /**
- * @copydoc Dali::VideoPlayerPlugin::GetDisplayRotation()
- */
- virtual Dali::VideoPlayerPlugin::DisplayRotation GetDisplayRotation();
-
- /**
- * @copydoc Dali::VideoPlayerPlugin::FinishedSignal()
- */
- virtual Dali::VideoPlayerPlugin::VideoPlayerSignalType& FinishedSignal();
-
- /**
- * @brief Push media packet with video frame image
- */
- void PushPacket( media_packet_h packet );
-
- /**
- * @brief Dali::VideoPlayer::Forward()
- */
- void Forward( int millisecond );
-
- /**
- * @brief Dali::VideoPlayer::Backward()
- */
- void Backward( int millisecond );
-
-private:
-
- /**
- * @brief Updates video frame image by timer if rendering targe is native image source
- */
- bool Update();
-
- /**
- * @brief Gets current player state
- */
- void GetPlayerState( player_state_e* state );
-
- /**
- * @brief Destroy all packests, which this plugin stores
- */
- void DestroyPackets();
-
- /**
- * @brief Initializes player for video rendering using native image source
- */
- void InitializeTextureStreamMode( Dali::NativeImageSourcePtr nativeImageSourcePtr );
-
- /**
- * @brief Initializes player for video rendering using wayland window surface
- */
- void InitializeUnderlayMode( Ecore_Wl_Window* ecoreWlWindow );
-
-private:
-
- std::string mUrl; ///< The video file path
- player_h mPlayer; ///< Tizen player handle
- player_state_e mPlayerState; ///< Tizen player state
- tbm_surface_h mTbmSurface; ///< tbm surface handle
- media_packet_h mPacket; ///< Media packet handle with tbm surface of current video frame image
- Dali::NativeImageSourcePtr mNativeImageSourcePtr; ///< native image source for video rendering
- Dali::Timer mTimer; ///< Timer for texture streaming rendering
- Dali::Vector4 mBackgroundColor; ///< Current background color, which texturestream mode needs.
- RenderingTargetType mTargetType; ///< Current rendering target type
-
- Dali::Mutex mPacketMutex;
- Dali::Vector< media_packet_h > mPacketVector; ///< Container for media packet handle from Tizen player callback
-
- Ecore_Wl_Window* mEcoreWlWindow;
-
- bool mAlphaBitChanged; ///< True if underlay rendering initialization changes window alpha
-
-public:
-
- Dali::VideoPlayerPlugin::VideoPlayerSignalType mFinishedSignal;
-};
-
-} // namespace Plugin
-} // namespace Dali;
-
-#endif
return GetImplementation(*this).GetGlyphMetrics( array, size, type, horizontal );
}
-void FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex, GlyphBufferData& data )
+void FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex, GlyphBufferData& data, int outlineWidth )
{
- GetImplementation(*this).CreateBitmap( fontId, glyphIndex, data );
+ GetImplementation(*this).CreateBitmap( fontId, glyphIndex, data, outlineWidth );
}
-PixelData FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex )
+PixelData FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex, int outlineWidth )
{
- return GetImplementation(*this).CreateBitmap( fontId, glyphIndex );
+ return GetImplementation(*this).CreateBitmap( fontId, glyphIndex, outlineWidth );
}
void FontClient::CreateVectorBlob( FontId fontId, GlyphIndex glyphIndex, VectorBlob*& blob, unsigned int& blobLength, unsigned int& nominalWidth, unsigned int& nominalHeight )
* @param[in] fontId The identifier of the font.
* @param[in] glyphIndex The index of a glyph within the specified font.
* @param[out] data The bitmap data.
+ * @param[in] outlineWidth The width of the glyph outline in pixels.
*/
- void CreateBitmap( FontId fontId, GlyphIndex glyphIndex, GlyphBufferData& data );
+ void CreateBitmap( FontId fontId, GlyphIndex glyphIndex, GlyphBufferData& data, int outlineWidth );
/**
* @brief Create a bitmap representation of a glyph.
*
* @param[in] fontId The identifier of the font.
* @param[in] glyphIndex The index of a glyph within the specified font.
+ * @param[in] outlineWidth The width of the glyph outline in pixels.
*
* @return A valid BufferImage, or an empty handle if the glyph could not be rendered.
*/
- PixelData CreateBitmap( FontId fontId, GlyphIndex glyphIndex );
+ PixelData CreateBitmap( FontId fontId, GlyphIndex glyphIndex, int outlineWidth );
/**
* @brief Create a vector representation of a glyph.
return mPlugin->GetGlyphMetrics( array, size, type, horizontal );
}
-void FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex, Dali::TextAbstraction::FontClient::GlyphBufferData& data )
+void FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex, Dali::TextAbstraction::FontClient::GlyphBufferData& data, int outlineWidth )
{
CreatePlugin();
- mPlugin->CreateBitmap( fontId, glyphIndex, data );
+ mPlugin->CreateBitmap( fontId, glyphIndex, data, outlineWidth );
}
-PixelData FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex )
+PixelData FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex, int outlineWidth )
{
CreatePlugin();
- return mPlugin->CreateBitmap( fontId, glyphIndex );
+ return mPlugin->CreateBitmap( fontId, glyphIndex, outlineWidth );
}
void FontClient::CreateVectorBlob( FontId fontId, GlyphIndex glyphIndex, VectorBlob*& blob, unsigned int& blobLength, unsigned int& nominalWidth, unsigned int& nominalHeight )
bool GetGlyphMetrics( GlyphInfo* array, uint32_t size, GlyphType type, bool horizontal );
/**
- * @copydoc Dali::TextAbstraction::FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex, Dali::TextAbstraction::FontClient::GlyphBufferData& data )
+ * @copydoc Dali::TextAbstraction::FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex, Dali::TextAbstraction::FontClient::GlyphBufferData& data, int outlineWidth )
*/
- void CreateBitmap( FontId fontId, GlyphIndex glyphIndex, Dali::TextAbstraction::FontClient::GlyphBufferData& data );
+ void CreateBitmap( FontId fontId, GlyphIndex glyphIndex, Dali::TextAbstraction::FontClient::GlyphBufferData& data, int outlineWidth );
/**
- * @copydoc Dali::TextAbstraction::FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex )
+ * @copydoc Dali::TextAbstraction::FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex, int outlineWidth )
*/
- PixelData CreateBitmap( FontId fontId, GlyphIndex glyphIndex );
+ PixelData CreateBitmap( FontId fontId, GlyphIndex glyphIndex, int outlineWidth );
/**
* @copydoc Dali::TextAbstraction::FontClient::CreateVectorBlob()
#endif
}
-void FontClient::Plugin::CreateBitmap( FontId fontId, GlyphIndex glyphIndex, Dali::TextAbstraction::FontClient::GlyphBufferData& data )
+void FontClient::Plugin::CreateBitmap( FontId fontId, GlyphIndex glyphIndex, Dali::TextAbstraction::FontClient::GlyphBufferData& data, int outlineWidth )
{
if( ( fontId > 0 ) &&
( fontId - 1u < mFontCache.size() ) )
{
if( glyph->format != FT_GLYPH_FORMAT_BITMAP )
{
+ // Check whether we should create a bitmap for the outline
+ if( glyph->format == FT_GLYPH_FORMAT_OUTLINE && outlineWidth > 0 )
+ {
+ // Set up a stroker
+ FT_Stroker stroker;
+ error = FT_Stroker_New(mFreeTypeLibrary, &stroker );
+
+ if ( FT_Err_Ok == error )
+ {
+ FT_Stroker_Set( stroker, outlineWidth * 64, FT_STROKER_LINECAP_ROUND, FT_STROKER_LINEJOIN_ROUND, 0 );
+ error = FT_Glyph_StrokeBorder( &glyph, stroker, 0, 1 );
+
+ if ( FT_Err_Ok == error )
+ {
+ FT_Stroker_Done( stroker );
+ }
+ else
+ {
+ DALI_LOG_ERROR( "FT_Glyph_StrokeBorder Failed with error: %d\n", error );
+ }
+ }
+ else
+ {
+ DALI_LOG_ERROR( "FT_Stroker_New Failed with error: %d\n", error );
+ }
+ }
+
error = FT_Glyph_To_Bitmap( &glyph, FT_RENDER_MODE_NORMAL, 0, 1 );
if ( FT_Err_Ok == error )
{
}
}
-PixelData FontClient::Plugin::CreateBitmap( FontId fontId,
- GlyphIndex glyphIndex )
+PixelData FontClient::Plugin::CreateBitmap( FontId fontId, GlyphIndex glyphIndex, int outlineWidth )
{
TextAbstraction::FontClient::GlyphBufferData data;
- CreateBitmap( fontId, glyphIndex, data );
+ CreateBitmap( fontId, glyphIndex, data, outlineWidth );
return PixelData::New( data.buffer,
data.width * data.height * Pixel::GetBytesPerPixel( data.format ),
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_GLYPH_H
+#include FT_OUTLINE_H
+#include FT_STROKER_H
// forward declarations of font config types.
struct _FcCharSet;
bool GetVectorMetrics( GlyphInfo* array, uint32_t size, bool horizontal );
/**
- * @copydoc Dali::TextAbstraction::FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex, Dali::TextAbstraction::FontClient::GlyphBufferData& data )
+ * @copydoc Dali::TextAbstraction::FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex, Dali::TextAbstraction::FontClient::GlyphBufferData& data, int outlineWidth )
*/
- void CreateBitmap( FontId fontId, GlyphIndex glyphIndex, Dali::TextAbstraction::FontClient::GlyphBufferData& data );
+ void CreateBitmap( FontId fontId, GlyphIndex glyphIndex, Dali::TextAbstraction::FontClient::GlyphBufferData& data, int outlineWidth );
/**
- * @copydoc Dali::TextAbstraction::FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex )
+ * @copydoc Dali::TextAbstraction::FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex, int outlineWidth )
*/
- PixelData CreateBitmap( FontId fontId, GlyphIndex glyphIndex );
+ PixelData CreateBitmap( FontId fontId, GlyphIndex glyphIndex, int outlineWidth );
/**
* @copydoc Dali::TextAbstraction::FontClient::CreateVectorBlob()