#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;
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,
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) {
}
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);
}
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);
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)
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))
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);
}
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);
}
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;
}
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;
}
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;
}
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;
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);
}
appinfo_set_pid(info, pid);
- appinfo_set_owner(info, DS_TIZEN_APPINFO_OWNER_CLIENT);
+ appinfo_set_owner(info, DS_TIZEN_LAUNCH_APPINFO_OWNER_CLIENT);
}
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);
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);
//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;
}
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);
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);
}
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);
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);
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);
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);
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) {