launch: merge header files in one (launch.h)
[platform/core/uifw/libds-tizen.git] / src / launch / appinfo.c
index 0b6c8c2..b079836 100644 (file)
@@ -4,11 +4,11 @@
 #include <libds/log.h>
 
 #include "util.h"
-#include <libds-tizen/launch/appinfo.h>
+#include <libds-tizen/launch.h>
 
 #define TIZEN_APPINFO_VERSION 1
 
-struct ds_tizen_appinfo_mgr
+struct ds_tizen_launch_appinfo_mgr
 {
     struct wl_global *global;
 
@@ -27,34 +27,34 @@ struct ds_tizen_appinfo_mgr
     struct wl_resource *resource; //for gtest
 };
 
-struct ds_tizen_appinfo_client
+struct ds_tizen_launch_appinfo_client
 {
-    struct ds_tizen_appinfo_mgr *appinfo_mgr;
+    struct ds_tizen_launch_appinfo_mgr *appinfo_mgr;
 
     struct wl_resource *resource;
     struct wl_client *wl_client;
 
-    struct wl_list link; // ds_tizen_appinfo_mgr::clients
+    struct wl_list link; // ds_tizen_launch_appinfo_mgr::clients
 };
 
-enum ds_tizen_appinfo_owner
+enum ds_tizen_launch_appinfo_owner
 {
-    DS_TIZEN_APPINFO_OWNER_SERVER,
-    DS_TIZEN_APPINFO_OWNER_CLIENT,
+    DS_TIZEN_LAUNCH_APPINFO_OWNER_SERVER,
+    DS_TIZEN_LAUNCH_APPINFO_OWNER_CLIENT,
 };
 
-struct ds_tizen_appinfo
+struct ds_tizen_launch_appinfo
 {
-    struct ds_tizen_appinfo_mgr *appinfo_mgr;
+    struct ds_tizen_launch_appinfo_mgr *appinfo_mgr;
 
     pid_t pid;
     char *appid;
     bool base_output_available;
     int base_output_width;
     int base_output_height;
-    enum ds_tizen_appinfo_owner owner;
+    enum ds_tizen_launch_appinfo_owner owner;
 
-    struct wl_list link; //ds_tizen_appinfo_mgr::infos;
+    struct wl_list link; //ds_tizen_launch_appinfo_mgr::infos;
 };
 
 static void appinfo_mgr_handle_display_destroy(struct wl_listener *listener,
@@ -63,10 +63,10 @@ static void appinfo_mgr_handle_display_destroy(struct wl_listener *listener,
 static void appinfo_mgr_bind(struct wl_client *wl_client, void *data,
         uint32_t version, uint32_t id);
 
-WL_EXPORT struct ds_tizen_appinfo_mgr *
-ds_tizen_appinfo_mgr_create(struct wl_display *display)
+WL_EXPORT struct ds_tizen_launch_appinfo_mgr *
+ds_tizen_launch_appinfo_mgr_create(struct wl_display *display)
 {
-    struct ds_tizen_appinfo_mgr *appinfo_mgr;
+    struct ds_tizen_launch_appinfo_mgr *appinfo_mgr;
 
     appinfo_mgr = calloc(1, sizeof *appinfo_mgr);
     if (!appinfo_mgr) {
@@ -99,29 +99,29 @@ ds_tizen_appinfo_mgr_create(struct wl_display *display)
 }
 
 WL_EXPORT void
-ds_tizen_appinfo_mgr_add_destroy_listener(
-    struct ds_tizen_appinfo_mgr *appinfo_mgr, struct wl_listener *listener)
+ds_tizen_launch_appinfo_mgr_add_destroy_listener(
+    struct ds_tizen_launch_appinfo_mgr *appinfo_mgr, struct wl_listener *listener)
 {
     wl_signal_add(&appinfo_mgr->events.destroy, listener);
 }
 
 WL_EXPORT void
-ds_tizen_appinfo_mgr_add_set_pid_listener(
-    struct ds_tizen_appinfo_mgr *appinfo_mgr, struct wl_listener *listener)
+ds_tizen_launch_appinfo_mgr_add_set_pid_listener(
+    struct ds_tizen_launch_appinfo_mgr *appinfo_mgr, struct wl_listener *listener)
 {
     wl_signal_add(&appinfo_mgr->events.set_pid, listener);
 }
 
 WL_EXPORT void
-ds_tizen_appinfo_mgr_add_set_appid_listener(
-    struct ds_tizen_appinfo_mgr *appinfo_mgr, struct wl_listener *listener)
+ds_tizen_launch_appinfo_mgr_add_set_appid_listener(
+    struct ds_tizen_launch_appinfo_mgr *appinfo_mgr, struct wl_listener *listener)
 {
     wl_signal_add(&appinfo_mgr->events.set_appid, listener);
 }
 
 WL_EXPORT void
-ds_tizen_appinfo_mgr_add_metadata_ready_listener(
-    struct ds_tizen_appinfo_mgr *appinfo_mgr, struct wl_listener *listener)
+ds_tizen_launch_appinfo_mgr_add_metadata_ready_listener(
+    struct ds_tizen_launch_appinfo_mgr *appinfo_mgr, struct wl_listener *listener)
 {
     wl_signal_add(&appinfo_mgr->events.metadata_ready, listener);
 }
@@ -129,9 +129,9 @@ ds_tizen_appinfo_mgr_add_metadata_ready_listener(
 static void
 appinfo_mgr_handle_display_destroy(struct wl_listener *listener, void *data)
 {
-    struct ds_tizen_appinfo_mgr *appinfo_mgr;
-    struct ds_tizen_appinfo_client *client, *tmp_client;
-    struct ds_tizen_appinfo *info, *tmp_info;
+    struct ds_tizen_launch_appinfo_mgr *appinfo_mgr;
+    struct ds_tizen_launch_appinfo_client *client, *tmp_client;
+    struct ds_tizen_launch_appinfo *info, *tmp_info;
 
     appinfo_mgr = wl_container_of(listener, appinfo_mgr, destroy);
 
@@ -161,11 +161,11 @@ appinfo_handle_destroy(struct wl_client *wl_client, struct wl_resource *resource
     wl_resource_destroy(resource);
 }
 
-static struct ds_tizen_appinfo *
-appinfo_mgr_find_with_pid(struct ds_tizen_appinfo_mgr *appinfo_mgr,
+static struct ds_tizen_launch_appinfo *
+appinfo_mgr_find_with_pid(struct ds_tizen_launch_appinfo_mgr *appinfo_mgr,
     pid_t pid)
 {
-    struct ds_tizen_appinfo *info;
+    struct ds_tizen_launch_appinfo *info;
 
     wl_list_for_each(info, &appinfo_mgr->infos, link) {
         if (pid == info->pid)
@@ -175,11 +175,11 @@ appinfo_mgr_find_with_pid(struct ds_tizen_appinfo_mgr *appinfo_mgr,
     return NULL;
 }
 
-static struct ds_tizen_appinfo *
-appinfo_mgr_find_with_appid(struct ds_tizen_appinfo_mgr *appinfo_mgr,
+static struct ds_tizen_launch_appinfo *
+appinfo_mgr_find_with_appid(struct ds_tizen_launch_appinfo_mgr *appinfo_mgr,
     const char *appid)
 {
-    struct ds_tizen_appinfo *info;
+    struct ds_tizen_launch_appinfo *info;
 
     wl_list_for_each(info, &appinfo_mgr->infos, link) {
         if (appid && !strcmp(appid, info->appid))
@@ -188,11 +188,11 @@ appinfo_mgr_find_with_appid(struct ds_tizen_appinfo_mgr *appinfo_mgr,
 
     return NULL;
 }
-static struct ds_tizen_appinfo *
-appinfo_mgr_get_info(struct ds_tizen_appinfo_mgr *appinfo_mgr,
+static struct ds_tizen_launch_appinfo *
+appinfo_mgr_get_info(struct ds_tizen_launch_appinfo_mgr *appinfo_mgr,
     pid_t pid, const char *appid)
 {
-    struct ds_tizen_appinfo *info = NULL;
+    struct ds_tizen_launch_appinfo *info = NULL;
 
     if (pid > 0)
         info = appinfo_mgr_find_with_pid(appinfo_mgr, pid);
@@ -222,7 +222,7 @@ appinfo_mgr_get_info(struct ds_tizen_appinfo_mgr *appinfo_mgr,
 }
 
 static void
-appinfo_destroy(struct ds_tizen_appinfo *info)
+appinfo_destroy(struct ds_tizen_launch_appinfo *info)
 {
     wl_list_remove(&info->link);
     free(info->appid);
@@ -230,10 +230,10 @@ appinfo_destroy(struct ds_tizen_appinfo *info)
 }
 
 static bool
-appinfo_set_pid(struct ds_tizen_appinfo *info, pid_t pid)
+appinfo_set_pid(struct ds_tizen_launch_appinfo *info, pid_t pid)
 {
-    struct ds_tizen_appinfo_mgr *appinfo_mgr;
-    struct ds_tizen_appinfo *info2, *tmp;
+    struct ds_tizen_launch_appinfo_mgr *appinfo_mgr;
+    struct ds_tizen_launch_appinfo *info2, *tmp;
 
     if (!info) return false;
     if (pid < 0) return false;
@@ -264,10 +264,10 @@ appinfo_set_pid(struct ds_tizen_appinfo *info, pid_t pid)
 }
 
 static bool
-appinfo_set_appid(struct ds_tizen_appinfo *info, const char *appid)
+appinfo_set_appid(struct ds_tizen_launch_appinfo *info, const char *appid)
 {
-    struct ds_tizen_appinfo_mgr *appinfo_mgr;
-    struct ds_tizen_appinfo *info2, *tmp;
+    struct ds_tizen_launch_appinfo_mgr *appinfo_mgr;
+    struct ds_tizen_launch_appinfo *info2, *tmp;
 
     if (!info) return false;
     if (!appid) return false;
@@ -301,7 +301,7 @@ appinfo_set_appid(struct ds_tizen_appinfo *info, const char *appid)
 }
 
 static bool
-appinfo_get_base_output_resolution(struct ds_tizen_appinfo *info, int *width, int *height)
+appinfo_get_base_output_resolution(struct ds_tizen_launch_appinfo *info, int *width, int *height)
 {
     if (!info) return false;
     if (!width) return false;
@@ -319,7 +319,7 @@ appinfo_get_base_output_resolution(struct ds_tizen_appinfo *info, int *width, in
 }
 
 static void
-appinfo_set_owner(struct ds_tizen_appinfo *info, enum ds_tizen_appinfo_owner owner)
+appinfo_set_owner(struct ds_tizen_launch_appinfo *info, enum ds_tizen_launch_appinfo_owner owner)
 {
     if (!info) return;
 
@@ -330,8 +330,8 @@ static void
 appinfo_handle_register_pid(struct wl_client *wl_client,
     struct wl_resource *resource, uint32_t pid)
 {
-    struct ds_tizen_appinfo_client *client;
-    struct ds_tizen_appinfo *info;
+    struct ds_tizen_launch_appinfo_client *client;
+    struct ds_tizen_launch_appinfo *info;
 
     client = wl_resource_get_user_data(resource);
 
@@ -348,7 +348,7 @@ appinfo_handle_register_pid(struct wl_client *wl_client,
     }
 
     appinfo_set_pid(info, pid);
-    appinfo_set_owner(info, DS_TIZEN_APPINFO_OWNER_CLIENT);
+    appinfo_set_owner(info, DS_TIZEN_LAUNCH_APPINFO_OWNER_CLIENT);
 }
 
 
@@ -356,8 +356,8 @@ static void
 appinfo_handle_deregister_pid(struct wl_client *wl_client,
     struct wl_resource *resource, uint32_t pid)
 {
-    struct ds_tizen_appinfo_client *client;
-    struct ds_tizen_appinfo *info;
+    struct ds_tizen_launch_appinfo_client *client;
+    struct ds_tizen_launch_appinfo *info;
 
     client = wl_resource_get_user_data(resource);
 
@@ -374,8 +374,8 @@ static void
 appinfo_handle_set_appid(struct wl_client *wl_client,
     struct wl_resource *resource, uint32_t pid, const char *appid)
 {
-    struct ds_tizen_appinfo_client *client;
-    struct ds_tizen_appinfo *info;
+    struct ds_tizen_launch_appinfo_client *client;
+    struct ds_tizen_launch_appinfo *info;
 
     client = wl_resource_get_user_data(resource);
 
@@ -397,8 +397,8 @@ appinfo_handle_set_appid(struct wl_client *wl_client,
 
 //for gtest
 WL_EXPORT struct wl_resource *
-ds_tizen_appinfo_mgr_get_appinfo_resource(
-        struct ds_tizen_appinfo_mgr *appinfo_mgr)
+ds_tizen_launch_appinfo_mgr_get_appinfo_resource(
+        struct ds_tizen_launch_appinfo_mgr *appinfo_mgr)
 {
     return appinfo_mgr->resource;
 }
@@ -407,8 +407,8 @@ static void
 appinfo_handle_get_base_output_resolution(struct wl_client *wl_client,
     struct wl_resource *resource, uint32_t pid)
 {
-    struct ds_tizen_appinfo_client *client;
-    struct ds_tizen_appinfo *info;
+    struct ds_tizen_launch_appinfo_client *client;
+    struct ds_tizen_launch_appinfo *info;
     int width = 0, height = 0;
 
     client = wl_resource_get_user_data(resource);
@@ -442,8 +442,8 @@ static void
 appinfo_handle_register_appid(struct wl_client *wl_client, struct wl_resource *resource,
     const char *appid)
 {
-    struct ds_tizen_appinfo_client *client;
-    struct ds_tizen_appinfo *info;
+    struct ds_tizen_launch_appinfo_client *client;
+    struct ds_tizen_launch_appinfo *info;
 
     client = wl_resource_get_user_data(resource);
 
@@ -455,15 +455,15 @@ appinfo_handle_register_appid(struct wl_client *wl_client, struct wl_resource *r
     }
 
     appinfo_set_appid(info, appid);
-    appinfo_set_owner(info, DS_TIZEN_APPINFO_OWNER_CLIENT);
+    appinfo_set_owner(info, DS_TIZEN_LAUNCH_APPINFO_OWNER_CLIENT);
 }
 
 static void
 appinfo_handle_deregister_appid(struct wl_client *wl_client,
     struct wl_resource *resource, const char *appid)
 {
-    struct ds_tizen_appinfo_client *client;
-    struct ds_tizen_appinfo *info;
+    struct ds_tizen_launch_appinfo_client *client;
+    struct ds_tizen_launch_appinfo *info;
 
     client = wl_resource_get_user_data(resource);
 
@@ -480,8 +480,8 @@ static void
 appinfo_handle_set_pid(struct wl_client *wl_client,
     struct wl_resource *resource, const char *appid, uint32_t pid)
 {
-    struct ds_tizen_appinfo_client *client;
-    struct ds_tizen_appinfo *info;
+    struct ds_tizen_launch_appinfo_client *client;
+    struct ds_tizen_launch_appinfo *info;
 
     client = wl_resource_get_user_data(resource);
 
@@ -498,8 +498,8 @@ static void
 appinfo_handle_ready_metadata(struct wl_client *wl_client,
     struct wl_resource *resource, const char *appid, uint32_t pid)
 {
-    struct ds_tizen_appinfo_client *client;
-    struct ds_tizen_appinfo *info;
+    struct ds_tizen_launch_appinfo_client *client;
+    struct ds_tizen_launch_appinfo *info;
 
     client = wl_resource_get_user_data(resource);
 
@@ -533,7 +533,7 @@ static const struct tizen_launch_appinfo_interface appinfo_impl =
 static void
 _tizen_appinfo_client_handle_destroy(struct wl_resource *resource)
 {
-    struct ds_tizen_appinfo_client *client;
+    struct ds_tizen_launch_appinfo_client *client;
 
     client = wl_resource_get_user_data(resource);
 
@@ -546,8 +546,8 @@ _tizen_appinfo_client_handle_destroy(struct wl_resource *resource)
 static void appinfo_mgr_bind(struct wl_client *wl_client, void *data,
         uint32_t version, uint32_t id)
 {
-    struct ds_tizen_appinfo_mgr *appinfo_mgr = data;
-    struct ds_tizen_appinfo_client *client;
+    struct ds_tizen_launch_appinfo_mgr *appinfo_mgr = data;
+    struct ds_tizen_launch_appinfo_client *client;
 
     client = calloc(1, sizeof *client);
     if (client == NULL) {