ULRE/inc/hgl/gui/ThemeEngine.h

52 lines
1.5 KiB
C
Raw Normal View History

2020-10-14 22:05:24 +08:00
#ifndef HGL_GUI_THEME_ENGINE_INCLUDE
#define HGL_GUI_THEME_ENGINE_INCLUDE
#include<hgl/type/RectScope.h>
#include<hgl/type/Map.h>
#include<hgl/gui/ThemeForm.h>
2020-10-14 22:05:24 +08:00
namespace hgl
{
namespace gui
{
namespace vulkan
{
2020-10-21 12:39:22 +08:00
class GPUDevice;
}//namespace vulkan
2020-10-14 22:05:24 +08:00
2021-06-24 19:25:43 +08:00
constexpr VkFormat DefaultRenderTargetFormat=UPF_ABGR8; ///<缺省窗体绘图表面格式
2020-10-26 21:51:51 +08:00
2020-10-14 22:05:24 +08:00
class ThemeEngine
{
protected:
2020-10-21 12:47:06 +08:00
GPUDevice *device;
ObjectMap<Form *,ThemeForm> form_list;
2023-03-18 17:58:57 +08:00
RenderTarget *CreateRT(const uint32_t,const uint32_t,const VkFormat);
2020-10-26 21:51:51 +08:00
protected:
virtual ThemeForm *CreateForm(Form *,RenderTarget *,RenderCmdBuffer *)=0;
2020-10-26 21:51:51 +08:00
2020-11-03 22:29:32 +08:00
virtual bool Render(ThemeForm *);
2020-10-14 22:05:24 +08:00
public:
2020-10-21 12:47:06 +08:00
ThemeEngine(GPUDevice *dev){device=dev;}
virtual ~ThemeEngine()=default;
2020-10-14 22:05:24 +08:00
virtual bool Init()=0;
virtual void Clear()=0;
2020-10-26 21:51:51 +08:00
virtual bool Registry(Form *,const VkFormat format=DefaultRenderTargetFormat);
virtual void Unregistry(Form *);
virtual bool Resize(Form *,const uint32_t,const uint32_t,const VkFormat format=DefaultRenderTargetFormat);
2020-10-29 22:15:59 +08:00
virtual bool Render(Form *);
2020-10-14 22:05:24 +08:00
};//class ThemeEngine
// ThemeEngine *CreateThemeEngine();
ThemeEngine *GetDefaultThemeEngine(); ///<获取缺省主题引擎
}//namespace gui
}//namespace hgl
#endif//HGL_GUI_THEME_ENGINE_INCLUDE