1 #ifndef __DALI_TOOLKIT_INTERNAL_UTIL_H__
2 #define __DALI_TOOLKIT_INTERNAL_UTIL_H__
5 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
11 // http://www.apache.org/licenses/LICENSE-2.0
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an "AS IS" BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
24 #include <dali/dali.h>
25 #include <dali-toolkit/internal/styling/style-manager-impl.h>
40 * @brief Callback that the EventProcessingFinishedSignal signal calls
42 * Priorities calls to managers
44 inline void EventProcessingFinishedSignalPrioritizer()
46 // Priority 0: Set all styles
47 Toolkit::StyleManager styleManager = Toolkit::StyleManager::Get();
48 if( GetImpl(styleManager).IsThemeRequestPending() )
50 GetImpl(styleManager).SetTheme();
53 // Todo: Priority 1: Do relayout after styles have been set
57 * @brief Connect to the EventProcessingFinishedSignal
59 * Needs to be called only once, but will still operate successfully if called multiple times.
60 * Makes the assumption that this is the only thing connecting to the EventProcessingFinishedSignal.
62 inline void ConnectEventProcessingFinishedSignal()
64 Stage stage = Stage::GetCurrent();
66 // This is only intended for one purpose!
67 if( stage.EventProcessingFinishedSignal().GetConnectionCount() == 0 )
69 stage.EventProcessingFinishedSignal().Connect( &EventProcessingFinishedSignalPrioritizer );
75 } // namespace Internal
77 } // namespace Toolkit
81 #endif // __DALI_TOOLKIT_INTERNAL_STYLE_MANAGER_H__