-/*\r
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-\r
-#include "watch.hh"\r
-\r
-using namespace std;\r
-using namespace screen_connector;\r
-namespace watch_holder {\r
-\r
-Watch::Watch(string appid, Evas_Object* viewer_win, IWatchEventListener* holder)\r
- : RemoteSurfaceEvas(appid, RemoteSurface::WATCH,\r
- make_shared<screen_connector::EvasObject>(viewer_win, false)),\r
- appid_(appid), holder_(holder) {\r
-}\r
-\r
-void Watch::Resume() {\r
-\r
-}\r
-\r
-void Watch::Pause() {\r
-\r
-}\r
-\r
-void Watch::Terminate() {\r
-\r
-}\r
-\r
-void Watch::Bind(Evas_Object* win) {\r
-\r
-}\r
-\r
-void Watch::Unbind() {\r
-\r
-}\r
-\r
-Evas_Object* Watch::GetCurrentImage() {\r
- return nullptr;\r
-}\r
-\r
-void Watch::OnAdded(Evas_Object* image) {\r
-}\r
-\r
-void Watch::OnUpdated(Evas_Object* image) {\r
-}\r
-\r
-void Watch::OnRemoved(Evas_Object* image) {\r
-}\r
-\r
-void Watch::OnEvasAdded(const std::string& appId, const std::string& instId,\r
- int pid, const screen_connector::EvasObject& image) {\r
- holder_->OnWatchAdded(*this, image.GetRaw());\r
-}\r
-\r
-void Watch::OnEvasRemoved(const std::string& appId, const std::string& instId,\r
- int pid, const screen_connector::EvasObject& image) {\r
- holder_->OnWatchRemoved(*this, image.GetRaw());\r
-}\r
-\r
-void Watch::OnEvasChanged(const std::string& appId, const std::string& instId,\r
- int pid, const screen_connector::EvasObject& image) {\r
- holder_->OnWatchUpdated(*this, image.GetRaw());\r
-}\r
-\r
-float Watch::GetOpr() {\r
- return 0.0f;\r
-}\r
-\r
-} // namspace watch_holder\r
+/*
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "watch.hh"
+
+using namespace std;
+using namespace screen_connector;
+namespace watch_holder {
+
+Watch::Watch(string appid, Evas_Object* viewer_win, IWatchEventListener* holder)
+ : RemoteSurfaceEvas(appid, RemoteSurface::WATCH,
+ make_shared<screen_connector::EvasObject>(viewer_win, false)),
+ appid_(appid), holder_(holder) {
+}
+
+void Watch::Resume() {
+
+}
+
+void Watch::Pause() {
+
+}
+
+void Watch::Terminate() {
+
+}
+
+void Watch::Bind(Evas_Object* win) {
+
+}
+
+void Watch::Unbind() {
+
+}
+
+Evas_Object* Watch::GetCurrentImage() {
+ return nullptr;
+}
+
+void Watch::OnAdded(Evas_Object* image) {
+}
+
+void Watch::OnUpdated(Evas_Object* image) {
+}
+
+void Watch::OnRemoved(Evas_Object* image) {
+}
+
+void Watch::OnEvasAdded(const std::string& appId, const std::string& instId,
+ int pid, const screen_connector::EvasObject& image) {
+ holder_->OnWatchAdded(*this, image.GetRaw());
+}
+
+void Watch::OnEvasRemoved(const std::string& appId, const std::string& instId,
+ int pid, const screen_connector::EvasObject& image) {
+ holder_->OnWatchRemoved(*this, image.GetRaw());
+}
+
+void Watch::OnEvasChanged(const std::string& appId, const std::string& instId,
+ int pid, const screen_connector::EvasObject& image) {
+ holder_->OnWatchUpdated(*this, image.GetRaw());
+}
+
+float Watch::GetOpr() {
+ return 0.0f;
+}
+
+} // namspace watch_holder
-/*\r
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-\r
-#ifndef __WATCH_HOLDER_WATCH_HH__\r
-#define __WATCH_HOLDER_WATCH_HH__\r
-\r
-#include <Evas.h>\r
-\r
-#include <string>\r
-#include <screen_connector_remote_surface_evas/remote_surface_evas.h>\r
-\r
-#include "common.hh"\r
-\r
-namespace watch_holder {\r
-\r
-class EXPORT_API Watch : private screen_connector::RemoteSurfaceEvas {\r
- public:\r
- class IWatchEventListener {\r
- public:\r
- virtual void OnWatchAdded(Watch& watch, Evas_Object* image) = 0;\r
- virtual void OnWatchUpdated(Watch& watch, Evas_Object* image) = 0;\r
- virtual void OnWatchRemoved(Watch& watch, Evas_Object* image) = 0;\r
- };\r
- Watch(std::string appid, Evas_Object* viewer_win, IWatchEventListener* listener);\r
- void Resume();\r
- void Pause();\r
- void Terminate();\r
- void Bind(Evas_Object* win);\r
- void Unbind();\r
- Evas_Object* GetCurrentImage();\r
- void OnAdded(Evas_Object* image);\r
- void OnUpdated(Evas_Object* image);\r
- void OnRemoved(Evas_Object* image);\r
- float GetOpr();\r
- private:\r
- void OnEvasAdded(const std::string& appId, const std::string& instId,\r
- int pid, const screen_connector::EvasObject& image) override;\r
- void OnEvasRemoved(const std::string& appId, const std::string& instId,\r
- int pid, const screen_connector::EvasObject& image) override;\r
- void OnEvasChanged(const std::string& appId, const std::string& instId,\r
- int pid, const screen_connector::EvasObject& image) override;\r
-\r
- private:\r
- std::string appid_;\r
- IWatchEventListener* holder_;\r
-};\r
-\r
-} // namespace watch_holder\r
-\r
-#endif // __WATCH_HOLDER_WATCH_HH__\r
-\r
+/*
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __WATCH_HOLDER_WATCH_HH__
+#define __WATCH_HOLDER_WATCH_HH__
+
+#include <Evas.h>
+
+#include <string>
+#include <screen_connector_remote_surface_evas/remote_surface_evas.h>
+
+#include "common.hh"
+
+namespace watch_holder {
+
+class EXPORT_API Watch : private screen_connector::RemoteSurfaceEvas {
+ public:
+ class IWatchEventListener {
+ public:
+ virtual void OnWatchAdded(Watch& watch, Evas_Object* image) = 0;
+ virtual void OnWatchUpdated(Watch& watch, Evas_Object* image) = 0;
+ virtual void OnWatchRemoved(Watch& watch, Evas_Object* image) = 0;
+ };
+ Watch(std::string appid, Evas_Object* viewer_win, IWatchEventListener* listener);
+ void Resume();
+ void Pause();
+ void Terminate();
+ void Bind(Evas_Object* win);
+ void Unbind();
+ Evas_Object* GetCurrentImage();
+ void OnAdded(Evas_Object* image);
+ void OnUpdated(Evas_Object* image);
+ void OnRemoved(Evas_Object* image);
+ float GetOpr();
+ private:
+ void OnEvasAdded(const std::string& appId, const std::string& instId,
+ int pid, const screen_connector::EvasObject& image) override;
+ void OnEvasRemoved(const std::string& appId, const std::string& instId,
+ int pid, const screen_connector::EvasObject& image) override;
+ void OnEvasChanged(const std::string& appId, const std::string& instId,
+ int pid, const screen_connector::EvasObject& image) override;
+
+ private:
+ std::string appid_;
+ IWatchEventListener* holder_;
+};
+
+} // namespace watch_holder
+
+#endif // __WATCH_HOLDER_WATCH_HH__
+
-/*\r
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-#include <aul.h>\r
-#include <dlog.h>\r
-#include <app_control_internal.h>\r
-#include <appsvc.h>\r
-\r
-#include "watch_holder.hh"\r
-#include "bundle_cpp.h"\r
-\r
-#ifdef LOG_TAG\r
-#undef LOG_TAG\r
-#endif\r
-\r
-#define LOG_TAG "WATCH_HOLDER"\r
-\r
-using namespace tizen_base;\r
-using namespace std;\r
-namespace watch_holder {\r
-\r
-WatchHolder::WatchHolder(Evas_Object* win) : win_(win) {\r
- if (aul_app_com_create("watch.dead", nullptr,\r
- OnDeadSignal, this, &dead_signal_conn_) != AUL_R_OK) {\r
- LOGE("failed to create status");\r
- }\r
-\r
- if (aul_app_com_create("watch.launch", nullptr, OnLaunchSignal,\r
- this, &launch_signal_conn_) != AUL_R_OK) {\r
- LOGE("Failed to listen watch.launch signal");\r
- }\r
-\r
- char appid_buf[512] = {0, };\r
- if (aul_app_get_appid_bypid(\r
- getpid(), appid_buf, sizeof(appid_buf)) != AUL_R_OK) {\r
- LOGE("Failed to get appid (%d)", getpid());\r
- }\r
- appid_ = appid_buf;\r
-}\r
-\r
-int WatchHolder::Launch(\r
- app_control_h control, bool background, bundle* extra) {\r
- Evas_Coord x, y, w, h;\r
- evas_object_geometry_get(win_, &x, &y, &w, &h);\r
- app_control_add_extra_data(control, "WATCH_WIDTH", std::to_string(w).c_str());\r
- app_control_add_extra_data(control, "WATCH_HEIGHT", std::to_string(h).c_str());\r
-\r
- bundle* data;\r
- app_control_to_bundle(control, &data);\r
- bundle_add_str(data, AUL_K_WIDGET_VIEWER, appid_.c_str());\r
- int pid = appsvc_run_service(data, 0, nullptr, nullptr);\r
- if (pid < 0) {\r
- LOGE("Fail to run watch (%d)", pid);\r
- return -1;\r
- }\r
- return 0;\r
-}\r
-\r
-void WatchHolder::EnableRendering() {\r
-\r
-}\r
-\r
-void WatchHolder::DisableRendering(int timeout) {\r
-\r
-}\r
-\r
-const std::list<std::shared_ptr<Watch>>& WatchHolder::GetStack() {\r
- return stack_;\r
-}\r
-\r
-Watch* WatchHolder::GetCurrent() {\r
- return nullptr;\r
-}\r
-\r
-void WatchHolder::OnWatchDead(Watch& watch) {\r
-\r
-}\r
-\r
-void WatchHolder::OnWatchLaunched(Watch& watch) {\r
-\r
-}\r
-\r
-void WatchHolder::OnWatchBound(Watch& watch) {\r
-}\r
-\r
-void WatchHolder::OnWatchAdded(Watch& watch, Evas_Object* image) {\r
-}\r
-\r
-void WatchHolder::OnWatchUpdated(Watch& watch, Evas_Object* image) {\r
-}\r
-\r
-void WatchHolder::OnWatchRemoved(Watch& watch, Evas_Object* image) {\r
-}\r
-\r
-int WatchHolder::OnDeadSignal(const char *endpoint, aul_app_com_result_e e,\r
- bundle *envelope, void *user_data) {\r
- return 0;\r
-}\r
-\r
-int WatchHolder::OnLaunchSignal(const char *endpoint,\r
- aul_app_com_result_e res, bundle *envelope, void *user_data) {\r
- Bundle launch_data(envelope, false, false);\r
- WatchHolder* holder = (WatchHolder*)user_data;\r
-\r
- string viewer_appid = launch_data.GetString(AUL_K_WIDGET_VIEWER);\r
- if (viewer_appid != holder->appid_) {\r
- LOGE("It's not mine (%s)", viewer_appid.c_str());\r
- return 0;\r
- }\r
-\r
- string watch_appid = launch_data.GetString(AUL_K_APPID);\r
- holder->stack_.push_back(make_shared<Watch>(watch_appid, holder->win_, holder));\r
- holder->OnWatchLaunched(*holder->stack_.back());\r
- return 0;\r
-}\r
-\r
-}\r
+/*
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include <aul.h>
+#include <dlog.h>
+#include <app_control_internal.h>
+#include <appsvc.h>
+
+#include "watch_holder.hh"
+#include "bundle_cpp.h"
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+
+#define LOG_TAG "WATCH_HOLDER"
+
+using namespace tizen_base;
+using namespace std;
+namespace watch_holder {
+
+WatchHolder::WatchHolder(Evas_Object* win) : win_(win) {
+ if (aul_app_com_create("watch.dead", nullptr,
+ OnDeadSignal, this, &dead_signal_conn_) != AUL_R_OK) {
+ LOGE("failed to create status");
+ }
+
+ if (aul_app_com_create("watch.launch", nullptr, OnLaunchSignal,
+ this, &launch_signal_conn_) != AUL_R_OK) {
+ LOGE("Failed to listen watch.launch signal");
+ }
+
+ char appid_buf[512] = {0, };
+ if (aul_app_get_appid_bypid(
+ getpid(), appid_buf, sizeof(appid_buf)) != AUL_R_OK) {
+ LOGE("Failed to get appid (%d)", getpid());
+ }
+ appid_ = appid_buf;
+}
+
+int WatchHolder::Launch(
+ app_control_h control, bool background, bundle* extra) {
+ Evas_Coord x, y, w, h;
+ evas_object_geometry_get(win_, &x, &y, &w, &h);
+ app_control_add_extra_data(control, "WATCH_WIDTH", std::to_string(w).c_str());
+ app_control_add_extra_data(control, "WATCH_HEIGHT", std::to_string(h).c_str());
+
+ bundle* data;
+ app_control_to_bundle(control, &data);
+ bundle_add_str(data, AUL_K_WIDGET_VIEWER, appid_.c_str());
+ int pid = appsvc_run_service(data, 0, nullptr, nullptr);
+ if (pid < 0) {
+ LOGE("Fail to run watch (%d)", pid);
+ return -1;
+ }
+ return 0;
+}
+
+void WatchHolder::EnableRendering() {
+
+}
+
+void WatchHolder::DisableRendering(int timeout) {
+
+}
+
+const std::list<std::shared_ptr<Watch>>& WatchHolder::GetStack() {
+ return stack_;
+}
+
+Watch* WatchHolder::GetCurrent() {
+ return nullptr;
+}
+
+void WatchHolder::OnWatchDead(Watch& watch) {
+
+}
+
+void WatchHolder::OnWatchLaunched(Watch& watch) {
+
+}
+
+void WatchHolder::OnWatchBound(Watch& watch) {
+}
+
+void WatchHolder::OnWatchAdded(Watch& watch, Evas_Object* image) {
+}
+
+void WatchHolder::OnWatchUpdated(Watch& watch, Evas_Object* image) {
+}
+
+void WatchHolder::OnWatchRemoved(Watch& watch, Evas_Object* image) {
+}
+
+int WatchHolder::OnDeadSignal(const char *endpoint, aul_app_com_result_e e,
+ bundle *envelope, void *user_data) {
+ return 0;
+}
+
+int WatchHolder::OnLaunchSignal(const char *endpoint,
+ aul_app_com_result_e res, bundle *envelope, void *user_data) {
+ Bundle launch_data(envelope, false, false);
+ WatchHolder* holder = (WatchHolder*)user_data;
+
+ string viewer_appid = launch_data.GetString(AUL_K_WIDGET_VIEWER);
+ if (viewer_appid != holder->appid_) {
+ LOGE("It's not mine (%s)", viewer_appid.c_str());
+ return 0;
+ }
+
+ string watch_appid = launch_data.GetString(AUL_K_APPID);
+ holder->stack_.push_back(make_shared<Watch>(watch_appid, holder->win_, holder));
+ holder->OnWatchLaunched(*holder->stack_.back());
+ return 0;
+}
+
+}
-/*\r
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-\r
-#ifndef __WATCH_HOLDER_WATCH_HOLDER_HH__\r
-#define __WATCH_HOLDER_WATCH_HOLDER_HH__\r
-\r
-#include <string>\r
-#include <list>\r
-#include <memory>\r
-\r
-#include <Evas.h>\r
-#include <bundle.h>\r
-#include <app_control.h>\r
-#include <aul_app_com.h>\r
-\r
-#include "watch.hh"\r
-#include "common.hh"\r
-\r
-namespace watch_holder {\r
-\r
-class EXPORT_API WatchHolder : public Watch::IWatchEventListener {\r
- public:\r
- WatchHolder(Evas_Object* win);\r
- int Launch(app_control_h control, bool background, bundle* extra);\r
- void EnableRendering();\r
- void DisableRendering(int timeout);\r
- const std::list<std::shared_ptr<Watch>>& GetStack();\r
- Watch* GetCurrent();\r
- void OnWatchDead(Watch& watch);\r
- void OnWatchLaunched(Watch& watch);\r
- void OnWatchBound(Watch& watch);\r
- void OnWatchAdded(Watch& watch, Evas_Object* image) override;\r
- void OnWatchUpdated(Watch& watch, Evas_Object* image) override;\r
- void OnWatchRemoved(Watch& watch, Evas_Object* image) override;\r
-\r
- private:\r
- static int OnDeadSignal(const char *endpoint, aul_app_com_result_e e,\r
- bundle *envelope, void *user_data);\r
- static int OnLaunchSignal(const char *endpoint,\r
- aul_app_com_result_e res, bundle *envelope, void *user_data);\r
-\r
- private:\r
- std::string appid_;\r
- Evas_Object* win_;\r
- std::list<std::shared_ptr<Watch>> stack_;\r
- aul_app_com_connection_h launch_signal_conn_;\r
- aul_app_com_connection_h dead_signal_conn_;\r
-};\r
-\r
-} // namespace watch_holder\r
-\r
-#endif // __WATCH_HOLDER_WATCH_HOLDER_HH__\r
-\r
+/*
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __WATCH_HOLDER_WATCH_HOLDER_HH__
+#define __WATCH_HOLDER_WATCH_HOLDER_HH__
+
+#include <string>
+#include <list>
+#include <memory>
+
+#include <Evas.h>
+#include <bundle.h>
+#include <app_control.h>
+#include <aul_app_com.h>
+
+#include "watch.hh"
+#include "common.hh"
+
+namespace watch_holder {
+
+class EXPORT_API WatchHolder : public Watch::IWatchEventListener {
+ public:
+ WatchHolder(Evas_Object* win);
+ int Launch(app_control_h control, bool background, bundle* extra);
+ void EnableRendering();
+ void DisableRendering(int timeout);
+ const std::list<std::shared_ptr<Watch>>& GetStack();
+ Watch* GetCurrent();
+ void OnWatchDead(Watch& watch);
+ void OnWatchLaunched(Watch& watch);
+ void OnWatchBound(Watch& watch);
+ void OnWatchAdded(Watch& watch, Evas_Object* image) override;
+ void OnWatchUpdated(Watch& watch, Evas_Object* image) override;
+ void OnWatchRemoved(Watch& watch, Evas_Object* image) override;
+
+ private:
+ static int OnDeadSignal(const char *endpoint, aul_app_com_result_e e,
+ bundle *envelope, void *user_data);
+ static int OnLaunchSignal(const char *endpoint,
+ aul_app_com_result_e res, bundle *envelope, void *user_data);
+
+ private:
+ std::string appid_;
+ Evas_Object* win_;
+ std::list<std::shared_ptr<Watch>> stack_;
+ aul_app_com_connection_h launch_signal_conn_;
+ aul_app_com_connection_h dead_signal_conn_;
+};
+
+} // namespace watch_holder
+
+#endif // __WATCH_HOLDER_WATCH_HOLDER_HH__
+