X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fevent%2Fcommon%2Fevent-thread-services.h;h=f2c6ae7092d66b2f6aa3d8a50f2aba435e341ba9;hb=refs%2Fchanges%2F77%2F286077%2F4;hp=eb2d3450f35cee120a677c9dfef783916865c3db;hpb=c6b1508769b8710d7dce5241aa18c83b25d6fa3f;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/event/common/event-thread-services.h b/dali/internal/event/common/event-thread-services.h index eb2d345..f2c6ae7 100644 --- a/dali/internal/event/common/event-thread-services.h +++ b/dali/internal/event/common/event-thread-services.h @@ -1,8 +1,8 @@ -#ifndef __DALI_INTERNAL_EVENT_THREAD_SERVICES_H__ -#define __DALI_INTERNAL_EVENT_THREAD_SERVICES_H__ +#ifndef DALI_INTERNAL_EVENT_THREAD_SERVICES_H +#define DALI_INTERNAL_EVENT_THREAD_SERVICES_H /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -26,12 +26,15 @@ namespace Dali { - class BaseObject; -namespace Internal +namespace Integration { +class RenderController; +} +namespace Internal +{ namespace SceneGraph { class UpdateManager; @@ -45,26 +48,30 @@ class UpdateManager; class EventThreadServices { public: - /** * Virtual destructor */ - virtual ~EventThreadServices() - { } + virtual ~EventThreadServices() = default; + + /** + * Get the EventThreadServices + * @return reference to the EventThreadServices + */ + static EventThreadServices& Get(); /** * @brief Registers the object as created with the Object registry. * * @param[in] object to register */ - virtual void RegisterObject( BaseObject* object) = 0; + virtual void RegisterObject(BaseObject* object) = 0; /** * @brief Unregisters the object from Object registry. * * @param[in] object to unregister */ - virtual void UnregisterObject( BaseObject* object) = 0; + virtual void UnregisterObject(BaseObject* object) = 0; /** * @brief Get a reference to the UpdateManager @@ -74,6 +81,13 @@ public: virtual SceneGraph::UpdateManager& GetUpdateManager() = 0; /** + * @brief Get a reference to the RenderController + * + * @return the render controller + */ + virtual Integration::RenderController& GetRenderController() = 0; + + /** * Reserve space for another message in the queue; this must then be initialized by the caller. * The message will be read from the update-thread after the next FlushMessages is called. * @post Calling this method may invalidate any previously returned slots. @@ -81,21 +95,42 @@ public: * @param[in] updateScene A flag, when true denotes that the message will cause the scene-graph node tree to require an update. * @return A pointer to the first char allocated for the message. */ - virtual unsigned int* ReserveMessageSlot( std::size_t size, bool updateScene = true ) = 0; + virtual uint32_t* ReserveMessageSlot(uint32_t size, bool updateScene = true) = 0; /** * @return the current event-buffer index. */ - virtual BufferIndex GetEventBufferIndex() const = 0; + virtual BufferIndex GetEventBufferIndex() const = 0; + + /** + * @brief Indicate that the next rendering is really required. + */ + virtual void ForceNextUpdate() = 0; + + /** + * @brief Check if the next rendering is really required. + * + * @return true if the next rendering is really required. + */ + virtual bool IsNextUpdateForced() = 0; /** * @return true if core is still running and we can send messages + * @note It returns false if it is called from a thread other than the main thread. */ static bool IsCoreRunning(); + + /** + * @brief Check if the event thread service is shutting down. + * + * @return true if the event thread service is shutting down. + * @note It returns false if the core hasn't been initialised yet. + */ + static bool IsShuttingDown(); }; } // namespace Internal } // namespace Dali -#endif // __DALI_INTERNAL_EVENT_THREAD_SERVICES_H__ +#endif // DALI_INTERNAL_EVENT_THREAD_SERVICES_H