|
|
|
|
|
|
namespace uiwidgets { |
|
|
|
|
|
|
|
fml::RefPtr<UIWidgetsPanel> UIWidgetsPanel::Create( |
|
|
|
Mono_Handle handle, EntrypointCallback entrypoint_callback) { |
|
|
|
return fml::MakeRefCounted<UIWidgetsPanel>(handle, entrypoint_callback); |
|
|
|
Mono_Handle handle, UIWidgetsWindowType window_type, EntrypointCallback entrypoint_callback) { |
|
|
|
return fml::MakeRefCounted<UIWidgetsPanel>(handle, window_type, entrypoint_callback); |
|
|
|
UIWidgetsWindowType window_type, |
|
|
|
: handle_(handle), entrypoint_callback_(entrypoint_callback) {} |
|
|
|
: handle_(handle), window_type_(window_type), entrypoint_callback_(entrypoint_callback) {} |
|
|
|
|
|
|
|
bool UIWidgetsPanel::NeedUpdateByPlayerLoop() { |
|
|
|
return window_type_ == GameObjectPanel; |
|
|
|
} |
|
|
|
|
|
|
|
bool UIWidgetsPanel::NeedUpdateByEditorLoop() { |
|
|
|
return window_type_ == EditorWindowPanel; |
|
|
|
} |
|
|
|
|
|
|
|
void* UIWidgetsPanel::OnEnable(size_t width, size_t height, float device_pixel_ratio, |
|
|
|
const char* streaming_assets_path, const char* settings) |
|
|
|
|
|
|
|
|
|
|
UIWIDGETS_API(UIWidgetsPanel*) |
|
|
|
UIWidgetsPanel_constructor( |
|
|
|
Mono_Handle handle, |
|
|
|
Mono_Handle handle, int windowType, |
|
|
|
const auto panel = UIWidgetsPanel::Create(handle, entrypoint_callback); |
|
|
|
UIWidgetsWindowType window_type = static_cast<UIWidgetsWindowType>(windowType); |
|
|
|
const auto panel = UIWidgetsPanel::Create(handle, window_type, entrypoint_callback); |
|
|
|
panel->AddRef(); |
|
|
|
return panel.get(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
UIWIDGETS_API(void) |
|
|
|
UIWidgetsPanel_onMouseLeave(UIWidgetsPanel* panel) { panel->OnMouseLeave(); } |
|
|
|
|
|
|
|
UIWIDGETS_API(void) |
|
|
|
UIWidgetsPanel_onEditorUpdate(UIWidgetsPanel* panel) { |
|
|
|
if (!panel->NeedUpdateByEditorLoop()) { |
|
|
|
std::cerr << "only EditorWindowPanel can be updated using onEditorUpdate" << std::endl; |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
//_Update |
|
|
|
panel->ProcessMessages(); |
|
|
|
|
|
|
|
//_ProcessVSync |
|
|
|
panel->ProcessVSync(); |
|
|
|
|
|
|
|
//_Wait |
|
|
|
panel->ProcessMessages(); |
|
|
|
} |
|
|
|
|
|
|
|
} // namespace uiwidgets |