#include <aul_svc.h>
#include <bundle_internal.h>
#include <app_control_internal.h>
-#include <screen_connector_watcher_evas.h>
+#include <wayland-extension/tizen-remote-surface-client-protocol.h>
+#include <tbm_surface.h>
+#include <screen_connector_toolkit_evas.h>
#include <dlog.h>
#include <unistd.h>
#include "watch_control.h"
}
__win = win;
- screen_connector_watcher_evas_init(__win);
- screen_connector_watcher_evas_start_visibility_notify();
+ screen_connector_toolkit_evas_init(__win, SCREEN_CONNECTOR_SCREEEN_TYPE_WATCH);
+ screen_connector_toolkit_evas_start_visibility_notify();
__win_resized(NULL, NULL, win, NULL); /* init */
evas_object_event_callback_add(win, EVAS_CALLBACK_RESIZE, __win_resized, NULL);
if (__win)
evas_object_event_callback_del(__win, EVAS_CALLBACK_RESIZE, __win_resized);
- screen_connector_watcher_evas_stop_visibility_notify();
- screen_connector_watcher_evas_fini();
+ screen_connector_toolkit_evas_stop_visibility_notify();
+ screen_connector_toolkit_evas_fini(SCREEN_CONNECTOR_SCREEEN_TYPE_WATCH);
}
API int watch_manager_init(Evas_Object *win)
return 0;
}
-static void __screen_connector_watcher_evas_added_cb(const char *appid, Evas_Object *image, void *data)
+static void __screen_connector_toolkit_evas_added_cb(const char *appid, const char *instance_id, int pid,
+ Evas_Object *image, void *data)
{
int w, h, x, y;
evas_object_geometry_get(image, &x, &y, &w, &h);
evas_object_smart_callback_call(__win, WATCH_SMART_SIGNAL_ADDED, image);
}
-static void __screen_connector_watcher_evas_removed_cb(const char *appid, Evas_Object *image, void *data)
+static void __screen_connector_toolkit_evas_removed_cb(const char *appid, const char *instance_id, int pid,
+ Evas_Object *image, void *data)
{
_D("obj removed");
evas_object_smart_callback_call(__win, WATCH_SMART_SIGNAL_REMOVED, image);
}
-static void __screen_connector_watcher_evas_updated_cb(const char *appid, Evas_Object *image, void *data)
+static void __screen_connector_toolkit_evas_updated_cb(const char *appid, const char *instance_id, int pid,
+ Evas_Object *image, void *data)
{
evas_object_smart_callback_call(__win, WATCH_SMART_SIGNAL_UPDATED, image);
}
API int watch_manager_set_resource_id(int resource_id)
{
- screen_connector_watcher_evas_ops ops;
- screen_connector_watcher_evas_h handle;
+ screen_connector_toolkit_evas_ops ops;
+ screen_connector_toolkit_evas_h handle;
- ops.added = __screen_connector_watcher_evas_added_cb;
- ops.removed = __screen_connector_watcher_evas_removed_cb;
- ops.updated = __screen_connector_watcher_evas_updated_cb;
- handle = screen_connector_watcher_evas_add_by_rid(&ops, resource_id, NULL);
+ ops.added_cb = __screen_connector_toolkit_evas_added_cb;
+ ops.removed_cb = __screen_connector_toolkit_evas_removed_cb;
+ ops.updated_cb = __screen_connector_toolkit_evas_updated_cb;
+ handle = screen_connector_toolkit_evas_add_by_rid(&ops, resource_id, SCREEN_CONNECTOR_SCREEEN_TYPE_WATCH, NULL);
if (handle == NULL) {
- _E("Fail screen_connector_watcher_evas_add_by_rid");
+ _E("Fail screen_connector_toolkit_evas_add_by_rid");
return -1;
}
API int watch_manager_get_resource_id(Evas_Object *watch, int *resource_id)
{
- return screen_connector_watcher_evas_get_rid(watch, resource_id);
+ return screen_connector_toolkit_evas_get_rid(watch, resource_id);
}
API int watch_manager_send_terminate(Evas_Object *watch)
int pid;
int r;
- screen_connector_watcher_evas_get_pid(watch, &pid);
+ screen_connector_toolkit_evas_get_pid(watch, &pid);
_D("watch_manager_send_terminate %d", pid);
if (pid < 1) {
_E("failed to get pid from %p", watch);
{
char buf[10];
bundle *b = NULL;
- screen_connector_watcher_evas_ops ops;
+ screen_connector_toolkit_evas_ops ops;
app_control_create(app_control);
app_control_set_app_id(*app_control, app_id);
app_control_set_operation(*app_control, APP_CONTROL_OPERATION_MAIN);
- ops.added = __screen_connector_watcher_evas_added_cb;
- ops.removed = __screen_connector_watcher_evas_removed_cb;
- ops.updated = __screen_connector_watcher_evas_updated_cb;
- screen_connector_watcher_evas_add(&ops, (char *)app_id, NULL);
+ ops.added_cb = __screen_connector_toolkit_evas_added_cb;
+ ops.removed_cb = __screen_connector_toolkit_evas_removed_cb;
+ ops.updated_cb = __screen_connector_toolkit_evas_updated_cb;
+ screen_connector_toolkit_evas_add(&ops, (char *)app_id, SCREEN_CONNECTOR_SCREEEN_TYPE_WATCH, NULL);
app_control_to_bundle(*app_control, &b);
if (b) {
struct wl_buffer* preBuffer;
-static void OnBufferChanged( struct tizen_remote_surface *surface, uint32_t type, struct wl_buffer *buffer,
- int32_t img_file_fd, uint32_t img_file_size, uint32_t time, struct wl_array *keys, void *data)
+static void OnBufferUpdated( struct tizen_remote_surface *surface, uint32_t type, struct wl_buffer *buffer,
+ int32_t img_file_fd, uint32_t img_file_size, uint32_t time, struct wl_array *keys,
+ const char *appid, const char *instance_id, const int pid, void *data)
{
Dali::WidgetView::Internal::WidgetView* widgetView = static_cast< Dali::WidgetView::Internal::WidgetView* >( data );
close( img_file_fd );
}
-static void OnBufferUpdated( struct tizen_remote_surface* surface, wl_buffer* buffer, uint32_t time, void* data )
+static void OnBufferAdded( const char *appid, const char *instance_id, const int pid, void *data )
{
- Dali::WidgetView::Internal::WidgetView* widgetView = static_cast< Dali::WidgetView::Internal::WidgetView* >( data );
-
- if( widgetView )
- {
- if( !widgetView->IsWidgetImageView() )
- {
- tizen_remote_surface_transfer_visibility( surface, TIZEN_REMOTE_SURFACE_VISIBILITY_TYPE_VISIBLE);
-
- widgetView->CreateWidgetImageView();
- widgetView->ConnectSignal( surface );
- }
-
- //get tbm surface from buffer
- tbm_surface_h tbmSurface = static_cast< tbm_surface_h >( wl_buffer_get_user_data( buffer ) );
- widgetView->UpdateImageSource( tbmSurface );
- }
-
- if( preBuffer != NULL && tizen_remote_surface_get_version( surface ) >= TIZEN_REMOTE_SURFACE_RELEASE_SINCE_VERSION )
- {
- tizen_remote_surface_release( surface, preBuffer );
- }
-
- preBuffer = buffer;
}
-static void OnSurfaceMissing( struct tizen_remote_surface* surface, void* data )
+static void OnSurfaceRemoved( const char *appid, const char *instance_id, const int pid, void *data )
{
Dali::WidgetView::Internal::WidgetView* widgetView = static_cast< Dali::WidgetView::Internal::WidgetView* >( data );
char* previewPath = NULL;
std::string previewImage;
widget_size_type_e sizeType;
- screen_connector_watcher_ops ops;
+ screen_connector_toolkit_ops ops;
int ret = widget_instance_create( mWidgetId.c_str(), &instanceId );
if( ret < 0 || !instanceId )
return;
}
- ops.change_cb = OnBufferChanged;
- ops.missing_cb = OnSurfaceMissing;
- ops.update_cb = OnBufferUpdated;
- mWatcherHandle = screen_connector_watcher_add(&ops, (char *)mWidgetId.c_str(), this);
+ ops.updated_cb = OnBufferUpdated;
+ ops.removed_cb = OnSurfaceRemoved;
+ ops.added_cb = OnBufferAdded;
+ mWatcherHandle = screen_connector_toolkit_add(&ops, (char *)instanceId, SCREEN_CONNECTOR_SCREEEN_TYPE_WIDGET, this);
DALI_LOG_INFO( gWidgetViewLogging, Debug::Verbose, "WidgetView::OnInitialize: widget_instance_launch is called. [%s, mPid = %d]\n", mWidgetId.c_str(), mPid );
}
void WidgetView::CloseRemoteSurface()
{
- screen_connector_watcher_remove( mWatcherHandle );
+ screen_connector_toolkit_remove( mWatcherHandle );
mRemoteSurface = NULL;
}
#include <dali-toolkit/public-api/controls/image-view/image-view.h>
#include <wayland-extension/tizen-remote-surface-client-protocol.h>
#include <tbm_surface.h>
-#include <screen_connector_watcher.h>
+#include <screen_connector_toolkit.h>
namespace Dali
{
bool mPreviewVisible;
bool mStateTextVisible;
bool mPermanentDelete;
- screen_connector_watcher_h mWatcherHandle;
+ screen_connector_toolkit_h mWatcherHandle;
tizen_remote_surface* mRemoteSurface;
// Signals
#include <unistd.h>
#include <widget_errno.h>
#include <widget_instance.h>
-#include <screen_connector_watcher.h>
+#include <screen_connector_toolkit.h>
namespace Dali
{
WidgetViewManager::~WidgetViewManager()
{
- screen_connector_watcher_fini();
+ screen_connector_toolkit_fini(SCREEN_CONNECTOR_SCREEEN_TYPE_WIDGET);
widget_instance_unlisten_event( WidgetViewManager::WidgetEventCallback );
widget_instance_fini();
}
}
// Binds tizen remote surface manager & connects callback
- if( screen_connector_watcher_init() < 0 )
+ if( screen_connector_toolkit_init(SCREEN_CONNECTOR_SCREEEN_TYPE_WIDGET) < 0 )
{
return WIDGET_ERROR_FAULT;
}
#include <widget_instance.h>
#include <widget_viewer.h>
#include <aul_app_com.h>
-#include <screen_connector_watcher_evas.h>
+#include <wayland-extension/tizen-remote-surface-client-protocol.h>
+#include <tbm_surface.h>
+#include <screen_connector_toolkit_evas.h>
#if defined(LOG_TAG)
GQueue *event_queue;
Evas_Object *layout;
- screen_connector_watcher_evas_h watcher_h;
};
static void __flush_event_queue(struct widget_info *info);
evas_object_smart_callback_call(obj, signal, cbdata);
}
-static const char *__to_appid(const char *widget_id)
-{
- const char *appid;
-
- appid = g_strstr_len(widget_id, strlen(widget_id), "@");
- if (appid != NULL) {
- if (strlen(appid) == 1)
- return widget_id;
-
- /* skip @ */
- appid++;
- } else {
- appid = (char *)widget_id;
- }
- return appid;
-}
-
static void __destroy_widget_info(gpointer data)
{
struct widget_info *info = (struct widget_info *)data;
LOGD("__destroy_widget_info widget_id: %s instance_id %s", info->widget_id, info->instance_id);
- if (info->watcher_h) {
- screen_connector_watcher_evas_remove(info->watcher_h);
- info->watcher_h = NULL;
- }
-
if (info->widget_id)
free(info->widget_id);
if (info->instance_id)
free(info);
}
-static void __screen_connector_watcher_evas_added_cb(const char *appid, Evas_Object *image, void *data)
+static void __screen_connector_toolkit_evas_added_cb(const char *appid, const char *instance_id, int pid,
+ Evas_Object *image, void *data)
{
struct widget_info *info;
int x, y, w, h;
return;
}
- if (info->restart || (info->widget_id == NULL) || (strcmp(appid, __to_appid(info->widget_id)) != 0)) {
+ if (info->restart || (info->instance_id == NULL) || (strcmp(info->instance_id, instance_id) != 0)) {
ErrPrint("Wrong added info, %s %s", appid, info->widget_id);
return;
}
*/
}
-static void __screen_connector_watcher_evas_removed_cb(const char *appid, Evas_Object *image, void *data)
+static void __screen_connector_toolkit_evas_removed_cb(const char *appid, const char *instance_id, int pid,
+ Evas_Object *image, void *data)
{
struct widget_evas_event_info event_info;
struct widget_info *info;
smart_callback_call(info->layout, WIDGET_SMART_SIGNAL_WIDGET_DELETED, &event_info);
}
-static void __screen_connector_watcher_evas_updated_cb(const char *appid, Evas_Object *image, void *data)
+static void __screen_connector_toolkit_evas_updated_cb(const char *appid, const char *instance_id, int pid,
+ Evas_Object *image, void *data)
{
}
GHashTableIter iter;
gpointer key, value;
- screen_connector_watcher_evas_ops ops;
+ screen_connector_toolkit_evas_ops ops;
struct widget_info *widget_instance_info;
int w, h;
int target_pid = 0;
evas_object_geometry_get(widget_instance_info->layout, NULL, NULL, &w, &h);
DbgPrint("Widget launch %s, %d, %d", widget_instance_info->instance_id, w, h);
- ops.added = __screen_connector_watcher_evas_added_cb;
- ops.removed = __screen_connector_watcher_evas_removed_cb;
- ops.updated = __screen_connector_watcher_evas_updated_cb;
+ ops.added_cb = __screen_connector_toolkit_evas_added_cb;
+ ops.removed_cb = __screen_connector_toolkit_evas_removed_cb;
+ ops.updated_cb = __screen_connector_toolkit_evas_updated_cb;
- widget_instance_info->watcher_h =
- screen_connector_watcher_evas_add(&ops, (char *)__to_appid(widget_instance_info->widget_id), widget_instance_info);
+ screen_connector_toolkit_evas_add(&ops, widget_instance_info->instance_id,
+ SCREEN_CONNECTOR_SCREEEN_TYPE_WIDGET, widget_instance_info);
widget_instance_info->pid = widget_instance_launch(widget_instance_info->instance_id, widget_instance_info->content_info, w, h);
widget_instance_info->restart = false;
}
}
s_info.win = win;
- screen_connector_watcher_evas_init(win);
- screen_connector_watcher_evas_start_visibility_notify();
+ screen_connector_toolkit_evas_init(win, SCREEN_CONNECTOR_SCREEEN_TYPE_WIDGET);
+ screen_connector_toolkit_evas_start_visibility_notify();
if (aul_app_get_appid_bypid(getpid(), app_id, sizeof(app_id)) != AUL_R_OK) {
ErrPrint("failed to get appid of pid:%d", getpid());
if (s_info.widget_table)
g_hash_table_destroy(s_info.widget_table);
- screen_connector_watcher_evas_fini();
+ screen_connector_toolkit_evas_fini(SCREEN_CONNECTOR_SCREEEN_TYPE_WIDGET);
widget_instance_unlisten_event(__instance_event_cb);
widget_instance_fini();
char *preview_path = NULL;
int x, y, w, h;
widget_size_type_e size_type;
- screen_connector_watcher_evas_ops ops;
+ screen_connector_toolkit_evas_ops ops;
if (!info || !layout) {
ErrPrint("Failed to load the info(%p) or layout(%p)", info, layout);
elm_object_part_text_set(layout, "text", T_("IDS_ST_POP_LOADING_ING"));
}
- ops.added = __screen_connector_watcher_evas_added_cb;
- ops.removed = __screen_connector_watcher_evas_removed_cb;
- ops.updated = __screen_connector_watcher_evas_updated_cb;
- info->watcher_h = screen_connector_watcher_evas_add(&ops, (char *)__to_appid(info->widget_id), info);
+ ops.added_cb = __screen_connector_toolkit_evas_added_cb;
+ ops.removed_cb = __screen_connector_toolkit_evas_removed_cb;
+ ops.updated_cb = __screen_connector_toolkit_evas_updated_cb;
+ screen_connector_toolkit_evas_add(&ops, info->instance_id, SCREEN_CONNECTOR_SCREEEN_TYPE_WIDGET, info);
info->pid = widget_instance_launch(info->instance_id, info->content_info, w, h);
if (info->pid < 0) {
if (type == WIDGET_VIEWER_EVAS_MANUAL_PAUSE_RESUME) {
if (value)
- screen_connector_watcher_evas_stop_visibility_notify();
+ screen_connector_toolkit_evas_stop_visibility_notify();
else
- screen_connector_watcher_evas_start_visibility_notify();
+ screen_connector_toolkit_evas_start_visibility_notify();
}
return WIDGET_ERROR_NONE;
return;
}
- screen_connector_watcher_evas_send_touch_cancel(remote_obj);
+ screen_connector_toolkit_evas_send_touch_cancel(remote_obj);
return;
}
return WIDGET_ERROR_INVALID_PARAMETER;
}
- screen_connector_watcher_evas_send_mouse_up(remote_obj);
+ screen_connector_toolkit_evas_send_mouse_up(remote_obj);
return WIDGET_ERROR_NONE;
}
EAPI void widget_viewer_evas_activate_faulted_widget(Evas_Object *widget)
{
struct widget_info *info;
- screen_connector_watcher_evas_ops ops;
+ screen_connector_toolkit_evas_ops ops;
if (!is_widget_feature_enabled()) {
set_last_result(WIDGET_ERROR_NOT_SUPPORTED);
elm_object_signal_emit(info->layout, "enable", "text");
}
- ops.added = __screen_connector_watcher_evas_added_cb;
- ops.removed = __screen_connector_watcher_evas_removed_cb;
- ops.updated = __screen_connector_watcher_evas_updated_cb;
- info->watcher_h = screen_connector_watcher_evas_add(&ops, (char *)__to_appid(info->widget_id), info);
+ ops.added_cb = __screen_connector_toolkit_evas_added_cb;
+ ops.removed_cb = __screen_connector_toolkit_evas_removed_cb;
+ ops.updated_cb = __screen_connector_toolkit_evas_updated_cb;
+ screen_connector_toolkit_evas_add(&ops, info->instance_id, SCREEN_CONNECTOR_SCREEEN_TYPE_WIDGET, info);
info->pid = widget_instance_launch(info->instance_id, info->content_info, w, h);
if (info->pid < 0) {
ErrPrint("Failed to launch an widget");
}
if (status == WIDGET_VISIBILITY_STATUS_SHOW_FIXED) {
- ret = screen_connector_watcher_evas_freeze_visibility(tbm_obj, VISIBILITY_TYPE_UNOBSCURED);
+ ret = screen_connector_toolkit_evas_freeze_visibility(tbm_obj, VISIBILITY_TYPE_UNOBSCURED);
if (ret < 0) {
ErrPrint("Fail to resume the widget(%p):(%d)", widget, ret);
return ret;
}
info->visibility_freeze = status;
} else if (status == WIDGET_VISIBILITY_STATUS_HIDE_FIXED) {
- ret = screen_connector_watcher_evas_freeze_visibility(tbm_obj, VISIBILITY_TYPE_FULLY_OBSCURED);
+ ret = screen_connector_toolkit_evas_freeze_visibility(tbm_obj, VISIBILITY_TYPE_FULLY_OBSCURED);
if (ret < 0) {
ErrPrint("Fail to pause the widget(%p):(%d)", widget, ret);
return ret;
return WIDGET_ERROR_INVALID_PARAMETER;
}
- screen_connector_watcher_evas_thaw_visibility(tbm_obj);
+ screen_connector_toolkit_evas_thaw_visibility(tbm_obj);
info->visibility_freeze = 0;
return WIDGET_ERROR_NONE;