#define AUL_K_SCREEN_TYPE "__AUL_SCREEN_TYPE__"
/** AUL internal private key */
#define AUL_K_VIEWER_REF "__AUL_VIEWER_REF__"
+/** AUL internal private key */
+#define AUL_K_PARENT_APPID "__AUL_PARENT_APPID__"
+/** AUL internal private key */
+#define AUL_K_CHILD_APPID "__AUL_CHILD_APPID__"
+
/**
* @brief This is callback function for aul_launch_init
APP_INVALIDATE_CACHE = 90,
APP_STARTUP_SIGNAL = 91,
+ APP_WINDOW_ATTACH = 92,
+ APP_WINDOW_DETACH = 93,
APP_CMD_MAX
};
*/
int aul_window_get_focused_pid(pid_t *pid);
+/*
+ * This API is only for Appfw internally.
+ */
+int aul_window_attach(const char *parent_appid, const char *child_appid);
+
+/*
+ * This API is only for Appfw internally.
+ */
+int aul_window_detach(const char *child_appid);
#ifdef __cplusplus
}
#include <glib.h>
#include <malloc.h>
+#include "aul.h"
+#include "launch.h"
#include "aul_api.h"
#include "aul_util.h"
#include "aul_window.h"
+#include "aul_cmd.h"
static GDBusConnection *system_conn;
return res;
}
+API int aul_window_attach(const char *parent_appid, const char *child_appid)
+{
+ bundle *b;
+ int ret;
+
+ if (parent_appid == NULL || child_appid == NULL)
+ return -1;
+
+ b = bundle_create();
+ if (!b) {
+ _E("out of memory");
+ return -1;
+ }
+
+ bundle_add_str(b, AUL_K_PARENT_APPID, parent_appid);
+ bundle_add_str(b, AUL_K_CHILD_APPID, child_appid);
+ ret = app_send_cmd(AUL_UTIL_PID, APP_WINDOW_ATTACH, b);
+ bundle_free(b);
+ return ret;
+}
+
+API int aul_window_detach(const char *child_appid)
+{
+ bundle *b;
+ int ret;
+
+ if (child_appid == NULL)
+ return -1;
+
+ b = bundle_create();
+ if (!b) {
+ _E("out of memory");
+ return -1;
+ }
+
+ bundle_add_str(b, AUL_K_CHILD_APPID, child_appid);
+
+ ret = app_send_cmd(AUL_UTIL_PID, APP_WINDOW_DETACH, b);
+ bundle_free(b);
+
+ return ret;
+}