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>
|
2020-10-21 11:43:18 +08:00
|
|
|
#include<hgl/type/Map.h>
|
|
|
|
#include<hgl/gui/ThemeForm.h>
|
2020-10-14 22:05:24 +08:00
|
|
|
namespace hgl
|
|
|
|
{
|
|
|
|
namespace gui
|
|
|
|
{
|
2020-10-21 11:43:18 +08:00
|
|
|
namespace vulkan
|
|
|
|
{
|
2020-10-21 12:39:22 +08:00
|
|
|
class GPUDevice;
|
2020-10-21 11:43:18 +08:00
|
|
|
}//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
|
2020-10-21 11:43:18 +08:00
|
|
|
{
|
|
|
|
protected:
|
|
|
|
|
2020-10-21 12:47:06 +08:00
|
|
|
GPUDevice *device;
|
2020-10-21 11:43:18 +08:00
|
|
|
|
|
|
|
MapObject<Form *,ThemeForm> form_list;
|
|
|
|
|
2020-10-26 21:51:51 +08:00
|
|
|
RenderTarget *CreateRenderTarget(const uint32_t,const uint32_t,const VkFormat);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
2020-11-09 15:37:00 +08:00
|
|
|
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;}
|
2020-10-21 11:43:18 +08:00
|
|
|
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
|