int base_frame_create_window(frame_window_h *handle, int id, void *raw);
int base_frame_window_get_id(frame_window_h handle, int *id);
int base_frame_window_get_raw(frame_window_h handle, void **raw);
+int base_frame_get_display_status(
+ component_h context, component_display_status_e *display_status);
typedef frame_window_h (*base_frame_component_create_cb)(
component_h context,
return COMPONENT_ERROR_NONE;
}
+extern "C" EXPORT_API int base_frame_get_display_status(
+ component_h context, component_display_status_e* display_status) {
+ if (context == nullptr || display_status == nullptr) {
+ LOGE("Invalid parameter");
+ return COMPONENT_ERROR_INVALID_PARAMETER;
+ }
+
+ component_based::Component* component =
+ static_cast<component_based::Component*>(context);
+ if (component->GetType() != component_based::Component::Type::Frame) {
+ LOGE("Invalid parameter");
+ return COMPONENT_ERROR_INVALID_PARAMETER;
+ }
+
+ ::StubFrameComponent* frame_component =
+ dynamic_cast<::StubFrameComponent*>(component);
+ if (frame_component == nullptr) {
+ LOGE("Invalid parameter");
+ return COMPONENT_ERROR_INVALID_PARAMETER;
+ }
+
+ auto status = frame_component->GetDisplayStatus();
+ if (status == component_based::FrameComponent::DisplayStatus::Unknown) {
+ LOGE("Invalid context");
+ return COMPONENT_ERROR_INVALID_CONTEXT;
+ }
+
+ *display_status = static_cast<component_display_status_e>(status);
+
+ return COMPONENT_ERROR_NONE;
+}
+
extern "C" EXPORT_API int component_based_app_base_main(int argc, char** argv,
component_based_app_base_lifecycle_callback_s *callback, void* user_data) {
if (argc < 1 || argv == nullptr || !callback || !callback->create) {