WatchBase::Impl::~Impl() = default;
-
void WatchBase::Resume() {
RemoteSurface::SendVisibility(true);
}
bool IsFaulted() const override;
void BlockUpdate(bool enable) override;
IEvent* GetListener();
+
+ protected:
+ friend class WatchHolderBase;
virtual void OnAdded(const std::string& appId, const std::string& instId,
int pid, std::shared_ptr<screen_connector::WlBuffer> tbm);
virtual void OnRemoved(const std::string& appId, const std::string& instId,
int pid, std::shared_ptr<screen_connector::WlBuffer> tbm);
virtual void OnChanged(const std::string& appId, const std::string& instId,
int pid, std::shared_ptr<screen_connector::WlBuffer> tbm);
-
- protected:
- friend class WatchHolderBase;
void OnBufferAdded(const std::string& appId,
- const std::string& instId, int pid) override;
+ const std::string& instId, int pid) final;
void OnBufferRemoved(const std::string& appId,
- const std::string& instId, int pid) override;
+ const std::string& instId, int pid) final;
void OnBufferChanged(int type,
std::shared_ptr<screen_connector::WlBuffer> tbm,
- int fd, uint32_t size, uint32_t time) override;
+ int fd, uint32_t size, uint32_t time) final;
void SetFaulted(bool is_faulted);
private:
WatchHolderBase::~WatchHolderBase() {
if (impl_->launch_signal_conn_)
aul_app_com_leave(impl_->launch_signal_conn_);
- if (impl_->launch_signal_conn_)
- aul_app_com_leave(impl_->launch_signal_conn_);
+ if (impl_->dead_signal_conn_)
+ aul_app_com_leave(impl_->dead_signal_conn_);
}
WatchHolderBase::WatchHolderBase(int w, int h)
}
if (aul_app_com_create("watch.launch", nullptr, impl_->OnLaunchSignal,
- this, &impl_->launch_signal_conn_) != AUL_R_OK) {
+ this, &impl_->dead_signal_conn_) != AUL_R_OK) {
LOGE("Failed to listen watch.launch signal");
}
int Launch(std::string appid, bool background, bundle* extra);
const std::list<std::shared_ptr<WatchBase>>& GetStack() const;
std::shared_ptr<WatchBase> GetCurrent() const;
- void AddWatch(std::shared_ptr<WatchBase> watch);
virtual void OnLaunched(const WatchBase& watch) = 0;
virtual void OnDead(const WatchBase& watch) = 0;
void OnAmbientChanged(bool enter,
std::list<std::shared_ptr<WatchBase>> stack_;
aul_app_com_connection_h launch_signal_conn_ = nullptr;
aul_app_com_connection_h dead_signal_conn_ = nullptr;
- aul_app_com_connection_h ambient_changed_signal_conn_ = nullptr;
int w_;
int h_;
};
return impl_->stack_.back();
}
-void WatchMirrorBase::AddWatch(shared_ptr<WatchBase> watch) {
- impl_->stack_.push_back(watch);
-}
-
void WatchMirrorBase::OnAmbientChanged(bool enter, const Bundle& extra) {
}
const tizen_base::Bundle& extra) override;
void OnAmbientEvent(EventType ev, std::string sender,
tizen_base::Bundle extra) override;
- void AddWatch(std::shared_ptr<WatchBase> watch);
protected:
virtual std::shared_ptr<WatchBase> CreateWatch(int rid, std::string id,
}
void WatchMirror::OnChanged(int rid, std::string inst_id, std::string appid) {
- WatchMirrorBase::AddWatch(make_shared<Watch>(
- rid, inst_id, appid, impl_->viewer_win_, nullptr, this));
shared_ptr<ISharableWatchBase> cur = WatchMirrorBase::GetCurrent();
OnChanged(*cur.get());
}