}
};
+ class WindowPosition {
+ public:
+ WindowPosition(int x, int y, int w, int h)
+ : x_(x), y_(y), w_(w), h_(h){
+ }
+
+ int GetPositionX() const { return x_; }
+ int GetPositionY() const { return y_; }
+ int GetScreenWidth() const { return w_; }
+ int GetScreenHeight() const { return h_; }
+
+ private:
+ int x_;
+ int y_;
+ int w_;
+ int h_;
+ };
+
void ExitFromSuspend();
void PrepareToSuspend();
void DoStart(tizen_base::Bundle b);
std::unique_ptr<AppCoreTaskBase> service_;
GMainContext* context_ = nullptr;
std::thread thread_;
+ std::unique_ptr<WindowPosition> position_;
};
AppCoreUiBase::AppCoreUiBase(unsigned int hint)
impl_->w_status_ = Impl::WS_NONE;
impl_->appid_ = std::string(appid);
LOG(LOG_DEBUG, "LAUNCH", "[%s:Application:main:done]", appid);
- if (impl_->hint_ & HINT_BG_LAUNCH_CONTROL) {
- tizen_base::Bundle b(bundle_import_from_argv(argc, argv), false, true);
- if (!b.IsEmpty()) {
+
+ tizen_base::Bundle b(bundle_import_from_argv(argc, argv), false, true);
+ if (!b.IsEmpty()) {
+ if (impl_->hint_ & HINT_BG_LAUNCH_CONTROL) {
std::string bg_launch = b.GetString(AUL_SVC_K_BG_LAUNCH);
if (bg_launch.compare("enable") == 0)
impl_->ApplyBgState(true);
}
+
+ std::string x_str = b.GetString(AUL_K_HINT_SCREEN_POS_X);
+ if (!x_str.empty()) {
+ std::string y_str = b.GetString(AUL_K_HINT_SCREEN_POS_Y);
+ std::string w_str = b.GetString(AUL_K_HINT_SCREEN_WIDTH);
+ std::string h_str = b.GetString(AUL_K_HINT_SCREEN_HEIGHT);
+ if (!y_str.empty() && !w_str.empty() && !h_str.empty()) {
+ int x = atoi(x_str.c_str());
+ int y = atoi(y_str.c_str());
+ int w = atoi(w_str.c_str());
+ int h = atoi(h_str.c_str());
+
+ impl_->position_ =
+ std::make_unique<AppCoreUiBase::Impl::WindowPosition>(x, y, w, h);
+ }
+ }
}
if (impl_->hint_ & HINT_WINDOW_ID_CONTROL)
impl_->resource_reclaiming_ = enable;
}
+int AppCoreUiBase::GetWindowPosition(int* x, int* y, int* w, int* h) {
+ if (!impl_->position_ ||
+ x == nullptr ||
+ y == nullptr ||
+ w == nullptr ||
+ h == nullptr)
+ return -1;
+
+ *x = impl_->position_->GetPositionX();
+ *y = impl_->position_->GetPositionY();
+ *w = impl_->position_->GetScreenWidth();
+ *h = impl_->position_->GetScreenHeight();
+
+ return 0;
+}
+
} // namespace tizen_cpp