*/
void RotationDone( int orientation, int width, int height );
+ /**
+ * @brief Gets the count of supported auxiliary hints of the window.
+ * @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();
+
+ /**
+ * @brief Gets the supported auxiliary hint string of the window.
+ * @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 );
+
+ /**
+ * @brief Creates an auxiliary hint of the window.
+ * @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.
+ * @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.
+ * @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.
+ * @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.
+ * @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 get input events.
+ * @param[in] inputRegion The rectangle region to get input events.
+ * @note To set an empty region, pass width and height as 0. An empty input region means the entire window will accept input events.
+ */
+ void SetInputRegion( const Rect< int >& inputRegion );
+
private:
/**
* Private constructor.
private:
- typedef std::vector< IndicatorInterface * > DiscardedIndicators;
+ typedef std::vector< std::pair< std::string, std::string > > AuxiliaryHints;
RenderSurface* mSurface;
Dali::Window::IndicatorVisibleMode mIndicatorVisible; ///< public state
std::vector<Dali::Window::WindowOrientation> mAvailableOrientations;
Dali::Window::WindowOrientation mPreferredOrientation;
+ std::vector< std::string > mSupportedAuxiliaryHints;
+ AuxiliaryHints mAuxiliaryHints;
+
// Signals
IndicatorSignalType mIndicatorVisibilityChangedSignal;
FocusSignalType mFocusChangedSignal;
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 );
+}
+
} // namespace DevelWindow
} // namespace Dali
*
*/
+// EXTERNAL INCLUDES
+#include <string>
+#include <dali/public-api/math/rect.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>
*/
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 );
+
} // namespace DevelWindow
} // namespace Dali
namespace Adaptor
{
#if defined(DEBUG_ENABLED)
-Debug::Filter* gWindowLogFilter = Debug::Filter::New(Debug::Concise, false, "LOG_WINDOW");
+Debug::Filter* gWindowLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_WINDOW");
#endif
/**
mOverlay( NULL ),
mAdaptor( NULL ),
mEventHandler( NULL ),
- mPreferredOrientation( Dali::Window::PORTRAIT )
+ mPreferredOrientation( Dali::Window::PORTRAIT ),
+ mSupportedAuxiliaryHints(),
+ mAuxiliaryHints()
{
}
}
delete mSurface;
+
+ mSupportedAuxiliaryHints.clear();
+ mAuxiliaryHints.clear();
}
void Window::Initialize(const PositionSize& windowPosition, const std::string& name, const std::string& className)
// create event handler for Wayland window
mEventHandler = new EventHandler( this );
+
+ // get auxiliary hint
+ Eina_List* hints = ecore_wl_window_aux_hints_supported_get( mEventHandler->mEcoreWindow );
+ if( hints )
+ {
+ Eina_List* l = NULL;
+ char* hint = NULL;
+
+ for( l = hints, ( hint = static_cast< char* >( eina_list_data_get(l) ) ); l; l = eina_list_next(l), ( hint = static_cast< char* >( eina_list_data_get(l) ) ) )
+ {
+ mSupportedAuxiliaryHints.push_back( hint );
+
+ DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::Initialize: %s\n", hint );
+ }
+ }
}
void Window::DoShowIndicator( Dali::Window::WindowOrientation lastOrientation )
ecore_wl_window_rotation_change_done_send( mEventHandler->mEcoreWindow );
}
+unsigned int Window::GetSupportedAuxiliaryHintCount()
+{
+ return mSupportedAuxiliaryHints.size();
+}
+
+std::string Window::GetSupportedAuxiliaryHint( unsigned int index )
+{
+ if( index >= GetSupportedAuxiliaryHintCount() )
+ {
+ DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::GetSupportedAuxiliaryHint: Invalid index! [%d]\n", index );
+ }
+
+ return mSupportedAuxiliaryHints[index];
+}
+
+unsigned int Window::AddAuxiliaryHint( const std::string& hint, const std::string& value )
+{
+ bool supported = false;
+
+ // Check if the hint is suppported
+ for( std::vector< std::string >::iterator iter = mSupportedAuxiliaryHints.begin(); iter != mSupportedAuxiliaryHints.end(); ++iter )
+ {
+ if( *iter == hint )
+ {
+ supported = true;
+ break;
+ }
+ }
+
+ if( !supported )
+ {
+ DALI_LOG_INFO( gWindowLogFilter, Debug::Concise, "Window::AddAuxiliaryHint: Not supported auxiliary hint [%s]\n", hint.c_str() );
+ return 0;
+ }
+
+ // Check if the hint is already added
+ for( unsigned int i = 0; i < mAuxiliaryHints.size(); i++ )
+ {
+ if( mAuxiliaryHints[i].first == hint )
+ {
+ // Just change the value
+ mAuxiliaryHints[i].second = value;
+
+ DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::AddAuxiliaryHint: Change! hint = %s, value = %s, id = %d\n", hint.c_str(), value.c_str(), i + 1 );
+
+ return i + 1; // id is index + 1
+ }
+ }
+
+ // Add the hint
+ mAuxiliaryHints.push_back( std::pair< std::string, std::string >( hint, value ) );
+
+ unsigned int id = mAuxiliaryHints.size();
+
+ ecore_wl_window_aux_hint_add( mEventHandler->mEcoreWindow, static_cast< int >( id ), hint.c_str(), value.c_str() );
+
+ DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::AddAuxiliaryHint: hint = %s, value = %s, id = %d\n", hint.c_str(), value.c_str(), id );
+
+ return id;
+}
+
+bool Window::RemoveAuxiliaryHint( unsigned int id )
+{
+ if( id == 0 || id > mAuxiliaryHints.size() )
+ {
+ DALI_LOG_INFO( gWindowLogFilter, Debug::Concise, "Window::RemoveAuxiliaryHint: Invalid id [%d]\n", id );
+ return false;
+ }
+
+ mAuxiliaryHints[id - 1].second = std::string();
+
+ ecore_wl_window_aux_hint_del( mEventHandler->mEcoreWindow, static_cast< int >( id ) );
+
+ DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::RemoveAuxiliaryHint: id = %d, hint = %s\n", id, mAuxiliaryHints[id - 1].first.c_str() );
+
+ return true;
+}
+
+bool Window::SetAuxiliaryHintValue( unsigned int id, const std::string& value )
+{
+ if( id == 0 || id > mAuxiliaryHints.size() )
+ {
+ DALI_LOG_INFO( gWindowLogFilter, Debug::Concise, "Window::SetAuxiliaryHintValue: Invalid id [%d]\n", id );
+ return false;
+ }
+
+ mAuxiliaryHints[id - 1].second = value;
+
+ ecore_wl_window_aux_hint_change( mEventHandler->mEcoreWindow, static_cast< int >( id ), value.c_str() );
+
+ DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetAuxiliaryHintValue: id = %d, hint = %s, value = %s\n", id, mAuxiliaryHints[id - 1].first.c_str(), mAuxiliaryHints[id - 1].second.c_str() );
+
+ return true;
+}
+
+std::string Window::GetAuxiliaryHintValue( unsigned int id ) const
+{
+ if( id == 0 || id > mAuxiliaryHints.size() )
+ {
+ DALI_LOG_INFO( gWindowLogFilter, Debug::Concise, "Window::GetAuxiliaryHintValue: Invalid id [%d]\n", id );
+ return std::string();
+ }
+
+ DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::GetAuxiliaryHintValue: id = %d, hint = %s, value = %s\n", id, mAuxiliaryHints[id - 1].first.c_str(), mAuxiliaryHints[id - 1].second.c_str() );
+
+ return mAuxiliaryHints[id - 1].second;
+}
+
+unsigned int Window::GetAuxiliaryHintId( const std::string& hint ) const
+{
+ for( unsigned int i = 0; i < mAuxiliaryHints.size(); i++ )
+ {
+ if( mAuxiliaryHints[i].first == hint )
+ {
+ DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::GetAuxiliaryHintId: hint = %s, id = %d\n", hint.c_str(), i + 1 );
+ return i + 1;
+ }
+ }
+
+ DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::GetAuxiliaryHintId: Invalid hint! [%s]\n", hint.c_str() );
+
+ return 0;
+}
+
+void Window::SetInputRegion( const Rect< int >& inputRegion )
+{
+ ecore_wl_window_input_region_set( mEventHandler->mEcoreWindow, inputRegion.x, inputRegion.y, inputRegion.width, inputRegion.height );
+
+ 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 );
+}
+
} // Adaptor
} // Internal
} // Dali
mIndicatorOpacityMode( Dali::Window::OPAQUE ),
mOverlay( NULL ),
mAdaptor( NULL ),
- mPreferredOrientation( Dali::Window::PORTRAIT )
+ mPreferredOrientation( Dali::Window::PORTRAIT ),
+ mSupportedAuxiliaryHints(),
+ mAuxiliaryHints()
{
mEventHandler = NULL;
}
{
}
+unsigned int Window::GetSupportedAuxiliaryHintCount()
+{
+ return 0;
+}
+
+std::string Window::GetSupportedAuxiliaryHint( unsigned int index )
+{
+ return std::string();
+}
+
+unsigned int Window::AddAuxiliaryHint( const std::string& hint, const std::string& value )
+{
+ return -1;
+}
+
+bool Window::RemoveAuxiliaryHint( unsigned int id )
+{
+ return false;
+}
+
+bool Window::SetAuxiliaryHintValue( unsigned int id, const std::string& value )
+{
+ return false;
+}
+
+std::string Window::GetAuxiliaryHintValue( unsigned int id ) const
+{
+ return std::string();
+}
+
+unsigned int Window::GetAuxiliaryHintId( const std::string& hint ) const
+{
+ return -1;
+}
+
+void Window::SetInputRegion( const Rect< int >& inputRegion )
+{
+}
+
} // Adaptor
} // Internal
} // Dali
mOverlay( NULL ),
mAdaptor( NULL ),
mEventHandler( NULL ),
- mPreferredOrientation( Dali::Window::PORTRAIT )
+ mPreferredOrientation( Dali::Window::PORTRAIT ),
+ mSupportedAuxiliaryHints(),
+ mAuxiliaryHints()
{
// Detect if we're not running in a ecore main loop (e.g. libuv).
}
}
+unsigned int Window::GetSupportedAuxiliaryHintCount()
+{
+ return 0;
+}
+
+std::string Window::GetSupportedAuxiliaryHint( unsigned int index )
+{
+ return std::string();
+}
+
+unsigned int Window::AddAuxiliaryHint( const std::string& hint, const std::string& value )
+{
+ return -1;
+}
+
+bool Window::RemoveAuxiliaryHint( unsigned int id )
+{
+ return false;
+}
+
+bool Window::SetAuxiliaryHintValue( unsigned int id, const std::string& value )
+{
+ return false;
+}
+
+std::string Window::GetAuxiliaryHintValue( unsigned int id ) const
+{
+ return std::string();
+}
+
+unsigned int Window::GetAuxiliaryHintId( const std::string& hint ) const
+{
+ return -1;
+}
+
+void Window::SetInputRegion( const Rect< int >& inputRegion )
+{
+}
} // Adaptor
} // Internal