class RenderSurface;
-struct StyleChange;
-
namespace Internal
{
* Send a style change event to the style monitor.
* @param[in] styleChange The style that has changed.
*/
- void SendEvent(StyleChange styleChange);
+ void SendEvent( StyleChange::Type styleChange );
/**
* Send a window damage event to the observer.
}
}
-void FeedbackController::StyleChangedCallback( Dali::StyleMonitor styleMonitor, Dali::StyleChange styleChange )
+void FeedbackController::StyleChangedCallback( Dali::StyleMonitor styleMonitor, Dali::StyleChange::Type styleChange )
{
- if( styleChange.themeChange )
+ if( StyleChange::THEME_CHANGE )
{
- const string& userDefinedThemePath = styleChange.themeFilePath;
+ const string& userDefinedThemePath = styleMonitor.GetTheme();
const string& userDefinedTheme = LoadFile( userDefinedThemePath );
if( !LoadTheme( userDefinedTheme ) )
* Callback function for Dali::ObjectRegistry::SignalObjectCreated signal
* @param [in] object Handle to the newly created object
*/
- void StyleChangedCallback(Dali::StyleMonitor styleMonitor, StyleChange styleChange);
+ void StyleChangedCallback(Dali::StyleMonitor styleMonitor, StyleChange::Type styleChange);
/**
* Callback function for Dali::Toolkit::PushButton::SignalPressed signal
{
}
-void StyleMonitor::StyleChanged(StyleChange styleChange)
+void StyleMonitor::StyleChanged( StyleChange::Type styleChange )
{
- if ( styleChange.defaultFontChange )
+ switch ( styleChange )
{
- mPlatformAbstraction.GetDefaultFontDescription( mDefaultFontFamily, mDefaultFontStyle );
- }
- if ( styleChange.defaultFontSizeChange )
- {
- mDefaultFontSize = mPlatformAbstraction.GetDefaultFontSize();
+ case StyleChange::DEFAULT_FONT_CHANGE:
+ {
+ mPlatformAbstraction.GetDefaultFontDescription( mDefaultFontFamily, mDefaultFontStyle );
+ break;
+ }
+
+ case StyleChange::DEFAULT_FONT_SIZE_CHANGE:
+ {
+ mDefaultFontSize = mPlatformAbstraction.GetDefaultFontSize();
+ break;
+ }
+
+ case StyleChange::THEME_CHANGE:
+ {
+ break;
+ }
}
EmitStyleChangeSignal(styleChange);
void StyleMonitor::SetTheme(const std::string& path)
{
- StyleChange styleChange;
- styleChange.themeChange = true;
- styleChange.themeFilePath = path;
mUserDefinedThemeFilePath = path;
-
- EmitStyleChangeSignal(styleChange);
+ EmitStyleChangeSignal( StyleChange::THEME_CHANGE );
}
bool StyleMonitor::LoadThemeFile( const std::string& filename, std::string& output )
return mStyleChangeSignal;
}
-void StyleMonitor::EmitStyleChangeSignal(StyleChange styleChange)
+void StyleMonitor::EmitStyleChangeSignal( StyleChange::Type styleChange )
{
if( !mStyleChangeSignal.Empty() )
{
* Informs the Style Monitor that the style has changed.
* @param[in] styleChange The details of the change.
*/
- void StyleChanged(StyleChange styleChange);
+ void StyleChanged( StyleChange::Type styleChange );
// Style Information
* Emit the style change signal.
* @param[in] styleChange The details of the style change
*/
- inline void EmitStyleChangeSignal(StyleChange styleChange);
+ inline void EmitStyleChangeSignal( StyleChange::Type styleChange );
private:
{
public: // Typedefs
- typedef Signal< void (StyleMonitor, StyleChange) > StyleChangeSignalType; ///< StyleChange Signal type
+ typedef Signal< void ( StyleMonitor, StyleChange::Type ) > StyleChangeSignalType; ///< StyleChange Signal type
public: // Creation & Destruction
namespace Dali
{
-/**
- * @brief Used to describe what style information has changed.
- *
- * This structure is used when any style changes occur and contains information about what exactly
- * has changed.
- */
-struct DALI_IMPORT_API StyleChange
+namespace StyleChange
{
- // Construction
-
- /**
- * @brief Default Constructor.
- */
- StyleChange()
- : defaultFontChange(false),
- defaultFontSizeChange(false),
- themeChange(false)
- {
- }
-
- // Data
-
- bool defaultFontChange:1; ///< Denotes that the default font has changed.
- bool defaultFontSizeChange:1; ///< Denotes that the default font size has changed.
- bool themeChange:1; ///< Denotes that the theme has changed.
- std::string themeFilePath; ///< Contains the path to the new theme file.
+
+enum Type
+{
+ DEFAULT_FONT_CHANGE, ///< Denotes that the default font has changed.
+ DEFAULT_FONT_SIZE_CHANGE, ///< Denotes that the default font size has changed.
+ THEME_CHANGE ///< Denotes that the theme has changed.
};
+} // namespace StyleChange
+
} // namespace Dali
#endif // __DALI_STYLE_CHANGE_H__
static void VconfNotifyFontNameChanged( keynode_t* node, void* data )
{
EventHandler* handler = static_cast<EventHandler*>( data );
-
- StyleChange fontChange;
- fontChange.defaultFontChange = true;
-
- handler->SendEvent( fontChange );
+ handler->SendEvent( StyleChange::DEFAULT_FONT_CHANGE );
}
/**
static void VconfNotifyFontSizeChanged( keynode_t* node, void* data )
{
EventHandler* handler = static_cast<EventHandler*>( data );
-
- StyleChange fontChange;
- fontChange.defaultFontSizeChange = true;
-
- handler->SendEvent( fontChange );
+ handler->SendEvent( StyleChange::DEFAULT_FONT_SIZE_CHANGE );
}
// Data
mCoreEventInterface.ProcessCoreEvents();
}
-void EventHandler::SendEvent(StyleChange styleChange)
+void EventHandler::SendEvent( StyleChange::Type styleChange )
{
DALI_ASSERT_DEBUG( mStyleMonitor && "StyleMonitor Not Available" );
GetImplementation( mStyleMonitor ).StyleChanged(styleChange);
static void VconfNotifyFontNameChanged( keynode_t* node, void* data )
{
EventHandler* handler = static_cast<EventHandler*>( data );
-
- StyleChange fontChange;
- fontChange.defaultFontChange = true;
-
- handler->SendEvent( fontChange );
+ handler->SendEvent( StyleChange::DEFAULT_FONT_CHANGE );
}
/**
static void VconfNotifyFontSizeChanged( keynode_t* node, void* data )
{
EventHandler* handler = static_cast<EventHandler*>( data );
-
- StyleChange fontChange;
- fontChange.defaultFontSizeChange = true;
-
- handler->SendEvent( fontChange );
+ handler->SendEvent( StyleChange::DEFAULT_FONT_SIZE_CHANGE );
}
#endif // DALI_PROFILE_UBUNTU
mCoreEventInterface.ProcessCoreEvents();
}
-void EventHandler::SendEvent(StyleChange styleChange)
+void EventHandler::SendEvent( StyleChange::Type styleChange )
{
DALI_ASSERT_DEBUG( mStyleMonitor && "StyleMonitor Not Available" );
GetImplementation( mStyleMonitor ).StyleChanged(styleChange);