To support dali application, the functions are changed.
Modifies:
- frame_type_e
- frame_broker_create()
- frame_provider_create()
Adds:
- frame_get_native_buffer()
- frame_get_image_file()
- frame_get_file_path()
- frame_get_file_group()
- frame_native_buffer_get_raw()
- frame_native_buffer_get_width()
- frame_native_buffer_get_height()
- frame_native_buffer_get_bpp()
Removes:
- frame_get_raw()
Change-Id: Ie43cb401a006ddceb82a16ab710873a2c681bc7c
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
aul
capi-appfw-app-control
dlog
- elementary
+ ecore-wl2
glib-2.0
- screen_connector_launcher_service_evas
+ screen_connector_launcher_service
uuid
bundle
)
Name: launcher-service
Description: Support development of the launcher
Version: @VERSION@
-Requires: screen_connector_launcher_service_evas elementary capi-appfw-app-control
+Requires: screen_connector_launcher_service ecore-wl2 capi-appfw-app-control
Libs: -L${libdir} -lframe-broker
Cflags: -I${includedir}
cppflags: -I${includedir}
#include <stdint.h>
-#include <Elementary.h>
#include <bundle.h>
#include <frame_types.h>
typedef struct frame_s *frame_h;
/**
+ * @brief The native buffer handle.
+ * @since_tizen 5.5
+ */
+typedef void *frame_native_buffer_h;
+
+/**
* @brief Enumeration for the frame type.
* @since_tizen 5.5
*/
typedef enum {
- FRAME_TYPE_REMOTE_SURFACE, /**< The remote surface */
- FRAME_TYPE_SPLASH_SCREEN, /**< The splash screen */
+ FRAME_TYPE_REMOTE_SURFACE_NATIVE_BUFFER, /**< The remote surface: The native buffer */
+ FRAME_TYPE_REMOTE_SURFACE_IMAGE_FILE, /**< The remote surface: The image file */
+ FRAME_TYPE_SPLASH_SCREEN_IMAGE, /**< The splash screen: The image */
+ FRAME_TYPE_SPLASH_SCREEN_EDJE, /**< The splash screen: The EDJE */
} frame_type_e;
/**
} frame_direction_e;
/**
- * @brief Gets the raw handle of the frame.
+ * @brief Gets the native buffer.
+ * @since_tizen 5.5
+ * @detils If the type of the frame is not FRAME_TYPE_REMOTE_SURFACE_NATIVE_BUFFER,
+ * this function returns a negative error value that is FRAME_BROKER_ERROR_INVALID_PARAMETER.
+ * @remarks The @a buffer should not be released.
+ *
+ * @param[in] handle The frame handle
+ * @param[out] buffer The native buffer
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #FRAME_BROKER_ERROR_NONE Successful
+ * @retval #FRAME_BROKER_ERROR_INVALID_PARAMETER Invalid parameter
+ *
+ * @see frame_native_buffer_get_raw()
+ * @see frame_native_buffer_get_width()
+ * @see frame_native_buffer_get_height()
+ * @see frame_native_buffer_get_bbp()
+ */
+int frame_get_native_buffer(frame_h handle, frame_native_buffer_h *buffer);
+
+/**
+ * @brief Gets the image file information.
* @since_tizen 5.5
- * @remarks Ths @a raw should not be released.
+ * @detils If the type of the frame is not FRAME_TYPE_REMOTE_SURFACE_IMAGE_FILE,
+ * this function returns a negative error value that is FRAME_BROKER_ERROR_INVALID_PARAMETER.
+ * @remarks The @a fd should not be released using close().
*
* @param[in] handle The frame handle
- * @param[out] raw The evas object
+ * @param[out] fd The file descriptor
+ * @param[out] size The size of the frame buffer
* @return @c 0 on success,
* otherwise a negative error value
*
* @retval #FRAME_BROKER_ERROR_NONE Successful
* @retval #FRAME_BROKER_ERROR_INVALID_PARAMETER Invalid parameter
*/
-int frame_get_raw(frame_h handle, Evas_Object **raw);
+int frame_get_image_file(frame_h handle,
+ int32_t *fd, uint32_t* size);
+
+/**
+ * @brief Gets the file path of the splash screen.
+ * @since_tizen 5.5
+ * @detils To use this function, the type of the frame has to be FRAME_TYPE_SPLASH_SCREEN_IMAGE or FRAME_TYPE_SPLASH_SCREEN_EDJE.
+ * If it's not, this function returns a negative error value that is FRAME_BROKER_ERROR_INVALID_PARAMETER.
+ * @remarks The @a file_path should be released using free()
+ *
+ * @param[in] handle The frame handle
+ * @param[out] file_path The file path
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #FRAME_BROKER_ERROR_NONE Successful
+ * @retval #FRAME_BROKER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #FRAME_BROKER_ERROR_OUT_OF_MEMORY Out of memory
+ */
+int frame_get_file_path(frame_h handle,
+ char **file_path);
+
+/**
+ * @brief Gets the file group of the splash screen.
+ * @since_tizen 5.5
+ * @detils To use this function, the type of the frame has to be FRAME_TYPE_SPLASH_SCREEN_EDJE.
+ * If it's not, this function returns a negative error value that is FRAME_BROKER_ERROR_INVALID_PARAMETER.
+ * @remarks The @a file_group should be released using free()
+ *
+ * @param[in] handle The frame handle
+ * @param[out] file_group The file group
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #FRAME_BROKER_ERROR_NONE Successful
+ * @retval #FRAME_BROKER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #FRAME_BROKER_ERROR_OUT_OF_MEMORY Out of memory
+ */
+int frame_get_file_group(frame_h handle,
+ char **file_group);
/**
* @brief Gets the type of the frame.
*/
int frame_get_extra_data(frame_h handle, bundle **extra_data);
+/**
+ * @brief Gets the raw data of the native buffer.
+ * @since_tizen 5.5
+ *
+ * @param[in] handle The native buffer handle
+ * @param[out] raw The raw data
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #FRAME_BROKER_ERROR_NONE Successful
+ * @retval #FRAME_BROKER_ERROR_INVALID_PARAMETER Invalid parameter
+ */
+int frame_native_buffer_get_raw(frame_native_buffer_h handle, void **raw);
+
+/**
+ * @brief Gets the width of the native buffer.
+ * @since_tizen 5.5
+ *
+ * @param[in] handle The native buffer handle
+ * @param[out] width The width of the native buffer
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #FRAME_BROKER_ERROR_NONE Successful
+ * @retval #FRAME_BROKER_ERROR_INVALID_PARAMETER Invalid parameter
+ */
+int frame_native_buffer_get_width(frame_native_buffer_h handle,
+ uint32_t *width);
+
+/**
+ * @brief Gets the height of the native buffer.
+ * @since_tizen 5.5
+ *
+ * @param[in] handle The native buffer handle
+ * @param[out] height The height of the native buffer
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #FRAME_BROKER_ERROR_NONE Successful
+ * @retval #FRAME_BROKER_ERROR_INVALID_PARAMETER Invalid parameter
+ */
+int frame_native_buffer_get_height(frame_native_buffer_h handle,
+ uint32_t *height);
+/**
+ * @brief Gets the bpp of the native buffer.
+ * @since_tizen 5.5
+ *
+ * @param[in] handle The native buffer handle
+ * @param[out] bpp The bpp of the native buffer
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #FRAME_BROKER_ERROR_NONE Successful
+ * @retval #FRAME_BROKER_ERROR_INVALID_PARAMETER Invalid parameter
+ */
+int frame_native_buffer_get_bbp(frame_native_buffer_h handle,
+ uint32_t *bpp);
+
#ifdef __cplusplus
}
#endif
#ifndef __FRAME_BROKER_H__
#define __FRAME_BROKER_H__
-#include <Elementary.h>
+#include <Ecore_Wl2.h>
#include <app_control.h>
#include <frame.h>
#include <frame_context.h>
* @since_tizen 5.5
* @remarks The @a handle should be release using frame_broker_destroy() function.
*
- * @param[in] win The evas object
+ * @param[in] wl2_win The Ecore Wl2 Window
* @param[in] callback The set of callback functions to handle frame context lifecycle events
* @param[in] user_data The user data to be passed to the callback functions
* @param[out] handle The frame broker handle
*
* @see frame_broker_destroy()
*/
-int frame_broker_create(Evas_Object *win,
+int frame_broker_create(Ecore_Wl2_Window *wl2_win,
frame_context_lifecycle_callback_s *callback,
void *user_data,
frame_broker_h *handle);
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <screen_connector_launcher_service_evas.h>
+#include <screen_connector_launcher_service.h>
#include "frame.h"
#include "frame_private.h"
#include "private.h"
struct frame_s {
- Evas_Object *raw;
- frame_type_e type;
- frame_direction_e direction;
- int32_t x;
- int32_t y;
+ screen_connector_launcher_service_image_h image;
bundle *extra_data;
};
static frame_type_e __convert_type(
- screen_connector_launcher_service_evas_image_type_e type)
+ screen_connector_launcher_service_image_type_e type)
{
switch (type) {
- case SCREEN_CONNECTOR_LAUNCHER_SERVICE_EVAS_IMAGE_TYPE_REMOTE_SURFACE_TBM:
- case SCREEN_CONNECTOR_LAUNCHER_SERVICE_EVAS_IMAGE_TYPE_REMOTE_SURFACE_IMAGE_FILE:
- return FRAME_TYPE_REMOTE_SURFACE;
+ case SCREEN_CONNECTOR_LAUNCHER_SERVICE_IMAGE_TYPE_REMOTE_SURFACE_TBM:
+ return FRAME_TYPE_REMOTE_SURFACE_NATIVE_BUFFER;
+ case SCREEN_CONNECTOR_LAUNCHER_SERVICE_IMAGE_TYPE_REMOTE_SURFACE_IMAGE_FILE:
+ return FRAME_TYPE_REMOTE_SURFACE_IMAGE_FILE;
+ case SCREEN_CONNECTOR_LAUNCHER_SERVICE_IMAGE_TYPE_SPLASH_SCREEN_IMAGE:
+ return FRAME_TYPE_SPLASH_SCREEN_IMAGE;
default:
- return FRAME_TYPE_SPLASH_SCREEN;
+ return FRAME_TYPE_SPLASH_SCREEN_EDJE;
}
}
static frame_direction_e __convert_direction(
- screen_connector_launcher_service_evas_direction_e direction)
+ screen_connector_launcher_service_direction_e direction)
{
- if (direction == SCREEN_CONNECTOR_LAUNCHER_SERVICE_EVAS_DIRECTION_FORWARD)
+ if (direction == SCREEN_CONNECTOR_LAUNCHER_SERVICE_DIRECTION_FORWARD)
return FRAME_DIRECTION_FORWARD;
return FRAME_DIRECTION_BACKWARD;
}
-int frame_create(Evas_Object *image,
- screen_connector_launcher_service_evas_image_type_e type,
- screen_connector_launcher_service_evas_direction_e direction,
- int32_t x,
- int32_t y,
- const char *shared_widget_info,
+int frame_create(screen_connector_launcher_service_image_h image,
frame_h *handle)
{
struct frame_s *frame;
+ char *shared_widget_info = NULL;
if (!image || !handle) {
_E("Invalid parameter");
return FRAME_BROKER_ERROR_OUT_OF_MEMORY;
}
+ screen_connector_launcher_service_image_get_shared_widget_info(image,
+ &shared_widget_info);
_D("shared_widget_info(%s)", shared_widget_info);
if (shared_widget_info && shared_widget_info[0] != '\0' &&
strcmp(shared_widget_info, "None") != 0) {
} else {
frame->extra_data = bundle_create();
}
+ free(shared_widget_info);
if (!frame->extra_data) {
_E("Failed to create extra data");
return FRAME_BROKER_ERROR_OUT_OF_MEMORY;
}
- frame->raw = image;
- frame->type = __convert_type(type);
- frame->direction = __convert_direction(direction);
- frame->x = x;
- frame->y = y;
+ frame->image = image;
*handle = frame;
return FRAME_BROKER_ERROR_NONE;
}
-API int frame_get_raw(frame_h handle, Evas_Object **raw)
+API int frame_get_native_buffer(frame_h handle, frame_native_buffer_h *buffer)
{
- if (!handle || !raw) {
+ tbm_surface_info_s *surface_info = NULL;
+ frame_type_e type;
+ int ret;
+
+ if (!handle || !buffer) {
_E("Invalid parameter");
return FRAME_BROKER_ERROR_INVALID_PARAMETER;
}
- *raw = handle->raw;
+ frame_get_type(handle, &type);
+ if (type != FRAME_TYPE_REMOTE_SURFACE_NATIVE_BUFFER) {
+ _E("Invalid parameter. type(%d)", type);
+ return FRAME_BROKER_ERROR_INVALID_PARAMETER;
+ }
- return FRAME_BROKER_ERROR_NONE;
+ ret = screen_connector_launcher_service_image_get_tbm_surface_info(
+ handle->image, &surface_info);
+ if (ret != 0) {
+ _E("Failed to get tbm surface info. error(%d)", ret);
+ return FRAME_BROKER_ERROR_INVALID_PARAMETER;
+ }
+
+ *buffer = (frame_native_buffer_h)surface_info;
+
+ return ret;
+}
+
+API int frame_get_image_file(frame_h handle,
+ int32_t *fd, uint32_t *size)
+{
+ frame_type_e type;
+ int ret;
+
+ if (!handle || !fd || !size) {
+ _E("Invalid parameter");
+ return FRAME_BROKER_ERROR_INVALID_PARAMETER;
+ }
+
+ frame_get_type(handle, &type);
+ if (type != FRAME_TYPE_REMOTE_SURFACE_IMAGE_FILE) {
+ _E("Invalid parameter. type(%d)", type);
+ return FRAME_BROKER_ERROR_INVALID_PARAMETER;
+ }
+
+ ret = screen_connector_launcher_service_image_get_image_file(
+ handle->image, fd, size);
+ return ret;
+}
+
+API int frame_get_file_path(frame_h handle, char **file_path)
+{
+ frame_type_e type;
+ int ret;
+
+ if (!handle || !file_path) {
+ _E("Invalid parameter");
+ return FRAME_BROKER_ERROR_INVALID_PARAMETER;
+ }
+
+ frame_get_type(handle, &type);
+ if (type != FRAME_TYPE_SPLASH_SCREEN_IMAGE &&
+ type != FRAME_TYPE_SPLASH_SCREEN_EDJE) {
+ _E("Invalid parameter. type(%d)", type);
+ return FRAME_BROKER_ERROR_INVALID_PARAMETER;
+ }
+
+ ret = screen_connector_launcher_service_image_get_file_path(
+ handle->image, file_path);
+ return ret;
+}
+
+API int frame_get_file_group(frame_h handle, char **file_group)
+{
+ frame_type_e type;
+ int ret;
+
+ if (!handle || !file_group) {
+ _E("Invalid parameter");
+ return FRAME_BROKER_ERROR_INVALID_PARAMETER;
+ }
+
+ frame_get_type(handle, &type);
+ if (type != FRAME_TYPE_SPLASH_SCREEN_EDJE) {
+ _E("Invalid parameter. type(%d)", type);
+ return FRAME_BROKER_ERROR_INVALID_PARAMETER;
+ }
+
+ ret = screen_connector_launcher_service_image_get_file_group(
+ handle->image, file_group);
+ return ret;
}
API int frame_get_type(frame_h handle, frame_type_e *type)
{
+ screen_connector_launcher_service_image_type_e image_type;
+ int ret;
+
if (!handle || !type) {
_E("Invalid parameter");
return FRAME_BROKER_ERROR_INVALID_PARAMETER;
}
- *type = handle->type;
+ ret = screen_connector_launcher_service_image_get_type(handle->image,
+ &image_type);
+ if (ret != 0)
+ return FRAME_BROKER_ERROR_INVALID_PARAMETER;
+
+ *type = __convert_type(image_type);
return FRAME_BROKER_ERROR_NONE;
}
API int frame_get_direction(frame_h handle, frame_direction_e *direction)
{
+ screen_connector_launcher_service_direction_e scls_direction;
+ int ret;
+
if (!handle || !direction) {
_E("Invalid parameter");
return FRAME_BROKER_ERROR_INVALID_PARAMETER;
}
- *direction = handle->direction;
+ ret = screen_connector_launcher_service_image_get_direction(
+ handle->image, &scls_direction);
+ if (ret != 0)
+ return FRAME_BROKER_ERROR_INVALID_PARAMETER;
+
+ *direction = __convert_direction(scls_direction);
return FRAME_BROKER_ERROR_NONE;
}
API int frame_get_position_x(frame_h handle, int32_t *x)
{
+ int ret;
+
if (!handle || !x) {
_E("Invalid parameter");
return FRAME_BROKER_ERROR_INVALID_PARAMETER;
}
- *x = handle->x;
+ ret = screen_connector_launcher_service_image_get_position_x(
+ handle->image, x);
+ if (ret != 0)
+ return FRAME_BROKER_ERROR_INVALID_PARAMETER;
return FRAME_BROKER_ERROR_NONE;
}
API int frame_get_position_y(frame_h handle, int32_t *y)
{
+ int ret;
+
if (!handle || !y) {
_E("Invalid parameter");
return FRAME_BROKER_ERROR_INVALID_PARAMETER;
}
- *y = handle->y;
+ ret = screen_connector_launcher_service_image_get_position_y(
+ handle->image, y);
+ if (ret != 0)
+ return FRAME_BROKER_ERROR_INVALID_PARAMETER;
return FRAME_BROKER_ERROR_NONE;
}
return FRAME_BROKER_ERROR_NONE;
}
+
+API int frame_native_buffer_get_raw(frame_native_buffer_h handle,
+ void **raw)
+{
+ tbm_surface_info_s *info;
+
+ if (!handle || !raw) {
+ _E("Invalid parameter");
+ return FRAME_BROKER_ERROR_INVALID_PARAMETER;
+ }
+
+ info = (tbm_surface_info_s *)handle;
+ *raw = info->planes[0].ptr;
+
+ return FRAME_BROKER_ERROR_NONE;
+}
+
+API int frame_native_buffer_get_width(frame_native_buffer_h handle,
+ uint32_t *width)
+{
+ tbm_surface_info_s *info;
+
+ if (!handle || !width) {
+ _E("Invalid parameter");
+ return FRAME_BROKER_ERROR_INVALID_PARAMETER;
+ }
+
+ info = (tbm_surface_info_s *)handle;
+ *width = info->width;
+
+ return FRAME_BROKER_ERROR_NONE;
+}
+
+API int frame_native_buffer_get_height(frame_native_buffer_h handle,
+ uint32_t *height)
+{
+ tbm_surface_info_s *info;
+
+ if (!handle || !height) {
+ _E("Invalid parameter");
+ return FRAME_BROKER_ERROR_INVALID_PARAMETER;
+ }
+
+ info = (tbm_surface_info_s *)handle;
+ *height = info->height;
+
+ return FRAME_BROKER_ERROR_NONE;
+}
+
+API int frame_native_buffer_get_bbp(frame_native_buffer_h handle,
+ uint32_t *bpp)
+{
+ tbm_surface_info_s *info;
+
+ if (!handle || !bpp) {
+ _E("Invalid parameter");
+ return FRAME_BROKER_ERROR_INVALID_PARAMETER;
+ }
+
+ info = (tbm_surface_info_s *)handle;
+ *bpp = info->bpp;
+
+ return FRAME_BROKER_ERROR_NONE;
+}
#include <app_control_internal.h>
#include <aul_launcher_service.h>
#include <aul_running_context.h>
-#include <screen_connector_launcher_service_evas.h>
+#include <screen_connector_launcher_service.h>
#include <uuid/uuid.h>
#include "frame_broker.h"
struct frame_broker_s {
char *name;
- Evas_Object *win;
+ Ecore_Wl2_Window *wl2_win;
frame_context_lifecycle_callback_s callback;
void *user_data;
aul_launcher_service_h als;
- screen_connector_launcher_service_evas_h scls_evas;
+ screen_connector_launcher_service_h scls;
frame_context_h context;
frame_context_h pre_context;
};
static gint __compare_win(gconstpointer a, gconstpointer b)
{
- Evas_Object *win_a = (Evas_Object *)a;
- Evas_Object *win_b = (Evas_Object *)b;
+ Ecore_Wl2_Window *win_a = (Ecore_Wl2_Window *)a;
+ Ecore_Wl2_Window *win_b = (Ecore_Wl2_Window *)b;
return win_a != win_b;
}
-static bool __exist_win(Evas_Object *win)
+static bool __exist_win(Ecore_Wl2_Window *win)
{
GList *found;
return false;
}
-static void __add_win(Evas_Object *win)
+static void __add_win(Ecore_Wl2_Window *win)
{
__win_list = g_list_append(__win_list, win);
}
-static void __remove_win(Evas_Object *win)
+static void __remove_win(Ecore_Wl2_Window *win)
{
__win_list = g_list_remove(__win_list, win);
}
frame_context_on_create(context);
}
-static void __scls_evas_prepare_cb(Evas_Object *image,
- screen_connector_launcher_service_evas_image_type_e type,
- screen_connector_launcher_service_evas_direction_e direction,
- int32_t x,
- int32_t y,
- const char *shared_widget_info,
+static void __scls_prepare_cb(screen_connector_launcher_service_image_h image,
uint32_t serial,
void *user_data)
{
frame_h frame;
int ret;
- _D("[__SCLS_EVAS__] Prepare");
+ _D("[__SCLS__] Prepare");
if (context == NULL) {
if (broker->pre_context) {
__check_pre_context(broker);
frame_context_set_serial(context, serial);
- ret = frame_create(image, type, direction, x, y,
- shared_widget_info, &frame);
+ ret = frame_create(image, &frame);
if (ret != FRAME_BROKER_ERROR_NONE) {
_E("Failed to create frame. error(%d)", ret);
frame_context_on_error(context,
frame_context_on_resume(context, frame);
}
-static void __scls_evas_stop_cb(uint32_t serial, void *user_data)
+static void __scls_stop_cb(uint32_t serial, void *user_data)
{
frame_broker_h broker = user_data;
frame_context_h context = broker->context;
- _D("[__SCLS_EVAS__] Stop");
+ _D("[__SCLS__] Stop");
if (context == NULL) {
if (broker->pre_context) {
__check_pre_context(broker);
}
static frame_context_error_e __convert_error(
- screen_connector_launcher_service_evas_error_e error)
+ screen_connector_launcher_service_error_e error)
{
switch (error) {
- case SCREEN_CONNECTOR_LAUNCHER_SERVICE_EVAS_ERROR_DISQUALIFIED:
+ case SCREEN_CONNECTOR_LAUNCHER_SERVICE_ERROR_DISQUALIFIED:
return FRAME_CONTEXT_ERROR_DISQUALIFIED;
- case SCREEN_CONNECTOR_LAUNCHER_SERVICE_EVAS_ERROR_WRONG_REQUEST:
+ case SCREEN_CONNECTOR_LAUNCHER_SERVICE_ERROR_WRONG_REQUEST:
return FRAME_CONTEXT_ERROR_WRONG_REQUEST;
default:
return FRAME_CONTEXT_ERROR_NONE;
}
}
-static void __scls_evas_error_cb(
- screen_connector_launcher_service_evas_error_e error,
+static void __scls_error_cb(screen_connector_launcher_service_error_e error,
uint32_t serial,
void *user_data)
{
frame_broker_h broker = user_data;
frame_context_h context = broker->context;
- _D("[__SCLS_EVAS__] Error");
+ _D("[__SCLS__] Error");
if (context == NULL) {
if (broker->pre_context) {
__check_pre_context(broker);
frame_context_on_error(context, __convert_error(error));
}
-static void __scls_evas_cleanup_cb(uint32_t serial, void *user_data)
+static void __scls_cleanup_cb(uint32_t serial, void *user_data)
{
frame_broker_h broker = user_data;
frame_context_h context = broker->context;
frame_h frame;
int ret;
- _D("[__SCLS_EVAS__] Clean up");
+ _D("[__SCLS__] Clean up");
if (context == NULL) {
_E("Invalid context");
return;
}
}
-API int frame_broker_create(Evas_Object *win,
+static void __scls_reset_cb(uint32_t serial, void *user_data)
+{
+ frame_broker_h broker = user_data;
+ frame_context_h context = broker->context;
+
+ _W("[__SCLS__] Reset");
+ frame_context_set_frame(context, NULL);
+}
+
+API int frame_broker_create(Ecore_Wl2_Window *wl2_win,
frame_context_lifecycle_callback_s *callback,
void *user_data,
frame_broker_h *handle)
{
- screen_connector_launcher_service_evas_h scls_evas;
- screen_connector_launcher_service_evas_ops ops = {
- .prepare = __scls_evas_prepare_cb,
- .stop = __scls_evas_stop_cb,
- .error = __scls_evas_error_cb,
- .cleanup = __scls_evas_cleanup_cb
+ screen_connector_launcher_service_h scls;
+ screen_connector_launcher_service_ops ops = {
+ .prepare = __scls_prepare_cb,
+ .stop = __scls_stop_cb,
+ .error = __scls_error_cb,
+ .cleanup = __scls_cleanup_cb,
+ .reset = __scls_reset_cb
};
struct frame_broker_s *broker;
int ret;
- if (!win || !callback || !handle) {
+ if (!wl2_win || !callback || !handle) {
_E("Invalid parameter");
return FRAME_BROKER_ERROR_INVALID_PARAMETER;
}
return FRAME_BROKER_ERROR_INVALID_PARAMETER;
}
- if (__exist_win(win)) {
- _E("Already exists. win(%p)", win);
+ if (__exist_win(wl2_win)) {
+ _E("Already exists. wl2_win(%p)", wl2_win);
return FRAME_BROKER_ERROR_INVALID_PARAMETER;
}
return FRAME_BROKER_ERROR_IO_ERROR;
}
- ret = screen_connector_launcher_service_evas_create(win, &scls_evas);
+ ret = screen_connector_launcher_service_create(wl2_win, &scls);
if (ret != 0) {
_E("Failed to create scls evas. error(%d)", ret);
frame_broker_destroy(broker);
return FRAME_BROKER_ERROR_IO_ERROR;
}
- screen_connector_launcher_service_evas_set_ops(scls_evas, &ops,
- broker);
+ screen_connector_launcher_service_set_ops(scls, &ops, broker);
- broker->scls_evas = scls_evas;
- broker->win = win;
+ broker->scls = scls;
+ broker->wl2_win = wl2_win;
broker->callback = *callback;
broker->user_data = user_data;
- __add_win(win);
+ __add_win(wl2_win);
*handle = broker;
return FRAME_BROKER_ERROR_INVALID_PARAMETER;
}
- __remove_win(handle->win);
+ __remove_win(handle->wl2_win);
if (handle->context)
frame_context_destroy(handle->context);
- screen_connector_launcher_service_evas_destroy(handle->scls_evas);
+ screen_connector_launcher_service_destroy(handle->scls);
aul_launcher_service_destroy(handle->als);
free(handle->name);
free(handle);
}
*serial = __generate_serial();
- ret = screen_connector_launcher_service_evas_launch(handle->scls_evas,
+ ret = screen_connector_launcher_service_launch(handle->scls,
app_id, inst_id ? inst_id : "", pid, *serial);
if (ret != 0) {
_E("Failed to launch scls evas. error(%d)", ret);
}
*serial = __generate_serial();
- ret = screen_connector_launcher_service_evas_launch_with_shared_widget(
- handle->scls_evas, app_id,
+ ret = screen_connector_launcher_service_launch_with_shared_widget(
+ handle->scls, app_id,
inst_id ? inst_id : "", pid, *serial);
if (ret != 0) {
_E("Failed to launch scls evas with shared widget. error(%d)",
return FRAME_BROKER_ERROR_INVALID_PARAMETER;
}
- ret = screen_connector_launcher_service_evas_launching(
- handle->scls_evas, serial);
+ ret = screen_connector_launcher_service_launching(
+ handle->scls, serial);
if (ret != 0) {
_E("Failed to notify that the animation has been started");
return FRAME_BROKER_ERROR_IO_ERROR;
return FRAME_BROKER_ERROR_INVALID_PARAMETER;
}
- ret = screen_connector_launcher_service_evas_launch_cancel(
- handle->scls_evas, serial);
+ ret = screen_connector_launcher_service_launch_cancel(
+ handle->scls, serial);
if (ret != 0) {
_E("Failed to notify that the animation has been canceled.");
return FRAME_BROKER_ERROR_IO_ERROR;
return FRAME_BROKER_ERROR_INVALID_PARAMETER;
}
- ret = screen_connector_launcher_service_evas_launch_done(
- handle->scls_evas, serial);
+ ret = screen_connector_launcher_service_launch_done(
+ handle->scls, serial);
if (ret != 0) {
_E("Failed to notify that the animation has been finished.");
return FRAME_BROKER_ERROR_IO_ERROR;
#include <string.h>
#include <stdbool.h>
#include <glib.h>
-#include <screen_connector_launcher_service_evas.h>
#include "frame_broker.h"
#include "frame_broker_private.h"
int pid;
bool started;
uint32_t serial;
- frame_h prev_frame;
- frame_h curr_frame;
+ frame_h frame;
};
int frame_context_create(frame_broker_h broker,
frame_context_on_pause(handle);
frame_context_on_destroy(handle);
- if (handle->prev_frame)
- frame_destroy(handle->prev_frame);
-
- if (handle->curr_frame)
- frame_destroy(handle->curr_frame);
+ if (handle->frame)
+ frame_destroy(handle->frame);
free(handle->inst_id);
free(handle->app_id);
context->idle_tag = 0;
frame_context_on_pause(context);
- frame_get_direction(context->curr_frame, &direction);
+ _W("frame(%p)", context->frame);
+ frame_get_direction(context->frame, &direction);
if (direction == FRAME_DIRECTION_BACKWARD) {
_D("frame_context_destroy()");
frame_context_destroy(context);
int frame_context_set_frame(frame_context_h handle, frame_h frame)
{
- if (!handle || !frame) {
+ if (!handle) {
_E("Invalid parameter");
return FRAME_BROKER_ERROR_INVALID_PARAMETER;
}
- if (handle->prev_frame)
- frame_destroy(handle->prev_frame);
+ if (handle->frame)
+ frame_destroy(handle->frame);
+
+ _W("prev frame(%p), new frame(%p)", handle->frame, frame);
- handle->prev_frame = handle->curr_frame;
- handle->curr_frame = frame;
+ handle->frame = frame;
return FRAME_BROKER_ERROR_NONE;
}
return FRAME_BROKER_ERROR_INVALID_PARAMETER;
}
- *frame = handle->curr_frame;
+ *frame = handle->frame;
return FRAME_BROKER_ERROR_NONE;
}
#ifndef __FRAME_PRIVATE_H__
#define __FRAME_PRIVATE_H__
-#include <screen_connector_launcher_service_evas.h>
+#include <screen_connector_launcher_service.h>
#include "frame.h"
-int frame_create(Evas_Object *image,
- screen_connector_launcher_service_evas_image_type_e type,
- screen_connector_launcher_service_evas_direction_e direction,
- int32_t x,
- int32_t y,
- const char *shared_widget_info,
+int frame_create(screen_connector_launcher_service_image_h image,
frame_h *handle);
int frame_destroy(frame_h handle);
#include <stdint.h>
-#include <Elementary.h>
+#include <Ecore_Wl2.h>
#include <bundle.h>
#include <frame_provider_types.h>
* @since_tizen 5.5
* @remarks The @a handle should be released using frame_provider_destroy().
*
- * @param[in] win The evas object
+ * @param[in] wl2_win The Ecore Wl2 Window
* @param[in] callback The set of callback functions to handle frame provider events
* @param[in] user_data The user data to be passed to the callback functions
* @param[out] handle The frame provider handle
* @see frame_provider_destroy()
* @see frame_provider_event_callback_s
*/
-int frame_provider_create(Evas_Object *win,
+int frame_provider_create(Ecore_Wl2_Window *wl2_win,
frame_provider_event_callback_s *callback,
void *user_data,
frame_provider_h *handle);
#include "private.h"
struct frame_provider_s {
- Evas_Object *win;
+ Ecore_Wl2_Window *wl2_win;
screen_connector_shared_widget_launch_h scswl;
screen_connector_shared_widget_launch_prepare_state_e state;
uint32_t serial;
static gint __compare_win(gconstpointer a, gconstpointer b)
{
- Evas_Object *win_a = (Evas_Object *)a;
- Evas_Object *win_b = (Evas_Object *)b;
+ Ecore_Wl2_Window *win_a = (Ecore_Wl2_Window *)a;
+ Ecore_Wl2_Window *win_b = (Ecore_Wl2_Window *)b;
return win_a != win_b;
}
-static bool __exist_win(Evas_Object *win)
+static bool __exist_win(Ecore_Wl2_Window *win)
{
GList *found;
return false;
}
-static void __add_win(Evas_Object *win)
+static void __add_win(Ecore_Wl2_Window *win)
{
__win_list = g_list_append(__win_list, win);
}
-static void __remove_win(Evas_Object *win)
+static void __remove_win(Ecore_Wl2_Window *win)
{
__win_list = g_list_remove(__win_list, win);
}
provider->callback.hide(provider, provider->user_data);
}
-API int frame_provider_create(Evas_Object *win,
+API int frame_provider_create(Ecore_Wl2_Window *wl2_win,
frame_provider_event_callback_s *callback,
void *user_data,
frame_provider_h *handle)
{
struct frame_provider_s *provider;
- Ecore_Wl2_Window *wl2_win;
int ret;
- if (!win || !callback || !handle) {
+ if (!wl2_win || !callback || !handle) {
_E("Invalid parameter");
return FRAME_PROVIDER_ERROR_INVALID_PARAMETER;
}
- if (__exist_win(win)) {
- _E("Already exists. win(%p)", win);
+ if (__exist_win(wl2_win)) {
+ _E("Already exists. wl2_win(%p)", wl2_win);
return FRAME_PROVIDER_ERROR_INVALID_PARAMETER;
}
return FRAME_PROVIDER_ERROR_OUT_OF_MEMORY;
}
- wl2_win = (Ecore_Wl2_Window *)elm_win_wl_window_get(win);
ret = screen_connector_shared_widget_launch_create(wl2_win,
&provider->scswl);
if (ret != 0) {
screen_connector_shared_widget_launch_prepare_cb_set(provider->scswl,
__scswl_prepare_cb, provider);
- provider->win = win;
+ provider->wl2_win = wl2_win;
provider->callback = *callback;
provider->user_data = user_data;
- __add_win(win);
+ __add_win(wl2_win);
*handle = provider;
return FRAME_PROVIDER_ERROR_NONE;
}
- __remove_win(handle->win);
+ __remove_win(handle->wl2_win);
screen_connector_shared_widget_launch_destroy(handle->scswl);
free(handle);
BuildRequires: pkgconfig(screen_connector_watcher_evas)
BuildRequires: pkgconfig(capi-system-device)
BuildRequires: pkgconfig(gmock)
-BuildRequires: pkgconfig(screen_connector_launcher_service_evas)
+BuildRequires: pkgconfig(screen_connector_launcher_service)
BuildRequires: pkgconfig(screen_connector_shared_widget_launch)
%if 0%{?gcov:1}
BuildRequires: lcov