#include "wrt/src/browser/wrt_native_window.h"
#if BUILDFLAG(IS_TIZEN_TV)
+#include <display-rotator-api.h>
+#include <vconf.h>
+
#include "wrt/src/browser/tv/video_splash_screen.h"
#endif
std::unique_ptr<SplashScreen> splash_screen_;
+#if BUILDFLAG(IS_TIZEN_TV)
+const char* kSharePath = "/opt/usr/home/owner/share";
+const char* kVconfRotationState = "db/sysman/rotation_state";
+#endif
+
enum class BorderOption { REPEAT = 1, STRETCH, ROUND };
bool ParseImageBorder(const std::vector<std::string>& borders,
splash_screen_.reset(new SplashScreen);
auto orientation = wgt::parse::ScreenOrientation::AUTO;
+#if BUILDFLAG(IS_TIZEN_TV)
+ int rotation_state = DISPLAY_ROTATOR_ORIENTATION_LANDSCAPE;
+ vconf_get_int(kVconfRotationState, &rotation_state);
+ if (rotation_state == DISPLAY_ROTATOR_ORIENTATION_PORTRAIT ||
+ rotation_state == DISPLAY_ROTATOR_ORIENTATION_PORTRAIT_R)
+ orientation = wgt::parse::ScreenOrientation::PORTRAIT;
+ else
+ orientation = wgt::parse::ScreenOrientation::LANDSCAPE;
+#endif
+
auto* screen_data = screen_info.GetLaunchScreenData(orientation);
+ // get default images if fail to get LANDSCAPE/PORTRAIT images
+ if (!screen_data || screen_data->images.empty())
+ screen_data =
+ screen_info.GetLaunchScreenData(wgt::parse::ScreenOrientation::AUTO);
+
auto* window = WRTNativeWindow::GetTopWindow();
auto dimensions = splash_screen_->GetDimensions(window);
int location_y = (window_h - image_h) / 2;
evas_object_geometry_set(image_, location_x, location_y, image_w, image_h);
#else
- const std::string& image_path = splash_data->images.front().first;
- elm_image_file_set(image_, (app_path + image_path).c_str(), nullptr);
+ std::string image_path = splash_data->images.front().first;
+#if BUILDFLAG(IS_TIZEN_TV)
+ if (image_path.find("$SHARE") != std::string::npos)
+ image_path.replace(0, strlen("$SHARE"), kSharePath);
+ else
+ image_path = app_path + image_path;
+#else
+ image_path = app_path + image_path;
+#endif // IS_TIZEN_TV
+
+ LOG(INFO) << "image_path: " << image_path;
+ elm_image_file_set(image_, image_path.c_str(), nullptr);
evas_object_resize(image_, bound.first, bound.second);
#endif
evas_object_show(image_);