summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHwankyu Jhun <h.jhun@samsung.com>2021-07-19 11:19:24 +0900
committerHwanKyu Jhun <h.jhun@samsung.com>2021-07-21 05:37:11 +0000
commit4a62936a7434cc2450b4d46bbcda4fe5f8807e99 (patch)
tree8ff0d37e0876c8dc1fdfa0246b1da5829021fa76
parente2004809f8be5ebaf8c1a1063f053d554e0bde98 (diff)
downloadaul-1-4a62936a7434cc2450b4d46bbcda4fe5f8807e99.tar.gz
aul-1-4a62936a7434cc2450b4d46bbcda4fe5f8807e99.tar.bz2
aul-1-4a62936a7434cc2450b4d46bbcda4fe5f8807e99.zip
Add a new API to attach window below parent window
The function attaches the child window below the parent window. Adds: - aul_window_attach_window_below(); Change-Id: Ib3c2bc624617eda94d272b81e5aad07fe64f17e9 Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
-rw-r--r--include/aul_cmd.h1
-rw-r--r--include/aul_window.h13
-rw-r--r--src/aul_cmd.c1
-rw-r--r--src/aul_window.cc22
-rw-r--r--tool/aul_window/aul_window.cc14
5 files changed, 51 insertions, 0 deletions
diff --git a/include/aul_cmd.h b/include/aul_cmd.h
index 305c4feb..f9bbaddc 100644
--- a/include/aul_cmd.h
+++ b/include/aul_cmd.h
@@ -209,6 +209,7 @@ enum app_cmd {
RPC_PORT_DESTROY = 166,
RPC_PORT_EXIST = 167,
+ APP_WINDOW_ATTACH_BELOW = 168,
APP_CMD_MAX
};
diff --git a/include/aul_window.h b/include/aul_window.h
index 561e0055..5012ef88 100644
--- a/include/aul_window.h
+++ b/include/aul_window.h
@@ -229,6 +229,19 @@ int aul_window_detach(const char *child_appid);
*/
int aul_window_info_get_opaque(aul_window_info_h info, bool *opaque);
+/**
+ * @brief Attach the window below the window of the parent application.
+ * @since_tizen 6.5
+ * @remarks This function is only available for platform level signed applications.
+ *
+ * @param[in] parent_appid The application ID of the parent
+ * @param[in] child_appid The application ID of the child
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @remarks This function is only for App Framework internally.
+ */
+int aul_window_attach_below(const char *parent_appid, const char *child_appid);
+
#ifdef __cplusplus
}
#endif
diff --git a/src/aul_cmd.c b/src/aul_cmd.c
index 2c9a1c27..540881fb 100644
--- a/src/aul_cmd.c
+++ b/src/aul_cmd.c
@@ -211,6 +211,7 @@ API const char *aul_cmd_convert_to_string(int cmd)
"RPC_PORT_DESTROY",
"RPC_PORT_EXIST",
+ "APP_WINDOW_ATTACH_BELOW",
"CUSTOM_COMMAND"
};
diff --git a/src/aul_window.cc b/src/aul_window.cc
index ec5c2249..aa09949d 100644
--- a/src/aul_window.cc
+++ b/src/aul_window.cc
@@ -477,3 +477,25 @@ extern "C" API int aul_window_detach(const char* child_appid) {
return AUL_R_OK;
}
+
+extern "C" API int aul_window_attach_below(const char* parent_appid,
+ const char* child_appid) {
+ if (parent_appid == nullptr || child_appid == nullptr) {
+ _E("Invalid parameter");
+ return AUL_R_EINVAL;
+ }
+
+ tizen_base::Bundle b {
+ { AUL_K_PARENT_APPID, parent_appid },
+ { AUL_K_CHILD_APPID, child_appid }
+ };
+ int ret = AppRequest(APP_WINDOW_ATTACH_BELOW, getuid())
+ .With(b)
+ .SendSimply();
+ if (ret < 0) {
+ _E("Failed to send request. error(%d)", ret);
+ return ret;
+ }
+
+ return AUL_R_OK;
+}
diff --git a/tool/aul_window/aul_window.cc b/tool/aul_window/aul_window.cc
index 38fea00c..a3c9cad7 100644
--- a/tool/aul_window/aul_window.cc
+++ b/tool/aul_window/aul_window.cc
@@ -33,6 +33,7 @@ void PrintUsage(const char* cmdline) {
printf(" get_focused_pid\n");
printf(" attach_window <parent_appid> <child_appid>\n");
printf(" detach_window <child_appid>\n");
+ printf(" attach_window_below <parent_appid> <child_appid>\n");
}
const char* GetNotificationLevelString(aul_window_notification_level_e level) {
@@ -138,11 +139,24 @@ int HandleDetachWindow(int argc, char** argv) {
return ret;
}
+int HandleAttachWindowBelow(int argc, char** argv) {
+ if (argc < 4) {
+ PrintUsage(argv[0]);
+ return -1;
+ }
+
+ printf("[%s] parent_appid(%s), child_appid(%s)\n", argv[1], argv[2], argv[3]);
+ int ret = aul_window_attach_below(argv[2], argv[3]);
+ printf("[%s] result: %d\n", argv[1], ret);
+ return ret;
+}
+
std::map<std::string, HandleFunc> handlers = {
{ "foreach_window_stack", HandleForeachWindowStack },
{ "get_focused_pid", HandleGetFocusedPid },
{ "attach_window", HandleAttachWindow },
{ "detach_window", HandleDetachWindow },
+ { "attach_window_below", HandleAttachWindowBelow },
};
} // namespace