summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHwankyu Jhun <h.jhun@samsung.com>2016-12-20 14:01:54 +0900
committerHwankyu Jhun <h.jhun@samsung.com>2016-12-20 14:02:47 +0900
commit4b6bb12caf18806f949d8d1814607de22e536031 (patch)
tree603bcb144f2fd760de79ca2f37f422a33ba38c79
parent22997e40e765466572e97942b1b13c7c37626f03 (diff)
downloadscreen-connector-4b6bb12caf18806f949d8d1814607de22e536031.tar.gz
screen-connector-4b6bb12caf18806f949d8d1814607de22e536031.tar.bz2
screen-connector-4b6bb12caf18806f949d8d1814607de22e536031.zip
Adjust coding style
Change-Id: Ia8eae134aac2f04a82e8402f93b194bfbe43b932 Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
-rw-r--r--screen_connector_provider/include/screen_connector_provider.h6
-rw-r--r--screen_connector_provider/src/screen_connector_provider.c24
-rw-r--r--screen_connector_watcher/include/screen_connector_watcher.h8
-rw-r--r--screen_connector_watcher/src/screen_connector_watcher.c59
-rw-r--r--screen_connector_watcher_evas/include/screen_connector_watcher_evas.h25
-rw-r--r--screen_connector_watcher_evas/src/screen_connector_watcher_evas.c123
6 files changed, 109 insertions, 136 deletions
diff --git a/screen_connector_provider/include/screen_connector_provider.h b/screen_connector_provider/include/screen_connector_provider.h
index f937c50..05d20ed 100644
--- a/screen_connector_provider/include/screen_connector_provider.h
+++ b/screen_connector_provider/include/screen_connector_provider.h
@@ -22,11 +22,11 @@
extern "C" {
#endif
int screen_connector_provider_remote_enable(const char *id, struct wl_surface *surface);
-int screen_connector_provider_init();
-int screen_connector_provider_fini();
+int screen_connector_provider_init(void);
+int screen_connector_provider_fini(void);
#ifdef __cplusplus
}
#endif
-#endif
+#endif /* __SCREEN_CONNECTOR_PROVIDER_H__ */
diff --git a/screen_connector_provider/src/screen_connector_provider.c b/screen_connector_provider/src/screen_connector_provider.c
index 7834f69..288804b 100644
--- a/screen_connector_provider/src/screen_connector_provider.c
+++ b/screen_connector_provider/src/screen_connector_provider.c
@@ -1,5 +1,4 @@
/*
- * Screen Connector Watcher
* Copyright (c) 2016 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the License);
@@ -14,11 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
#include <stdio.h>
#include <errno.h>
#include <glib.h>
#include <sys/mman.h>
-
#include <tizen.h>
#include <dlog.h>
#include <wayland-client.h>
@@ -28,7 +27,6 @@
#include <tizen-remote-surface-client-protocol.h>
#include <aul_screen_connector.h>
-
#include "screen_connector_provider.h"
#ifdef LOG_TAG
@@ -49,7 +47,6 @@ struct __remote_surface_s {
static void __rsp_resource_id_cb(void *data, struct tizen_remote_surface_provider *provider, uint32_t res_id)
{
-
LOGE("add app screen : %d", res_id);
aul_screen_connector_add_app_screen(res_id);
}
@@ -139,16 +136,15 @@ EXPORT_API int screen_connector_provider_remote_enable(const char *id, struct wl
return 0;
}
-EXPORT_API int screen_connector_provider_init()
+EXPORT_API int screen_connector_provider_init(void)
{
- int ret = 0;
struct wl_registry *registry;
Ecore_Wl_Global *global;
Eina_Inlist *globals;
- if (__init_count > 0) {
+ if (__init_count > 0)
return 0;
- }
+
ecore_wl_init(NULL);
registry = ecore_wl_registry_get();
@@ -156,14 +152,14 @@ EXPORT_API int screen_connector_provider_init()
if (!registry || !globals) {
LOGE("could not get registry(%p) or global list(%p)", registry,
- globals);
+ globals);
return -1;
}
EINA_INLIST_FOREACH(globals, global) {
if (!strcmp(global->interface, "tizen_remote_surface_manager")) {
__rsm = wl_registry_bind(registry, global->id,
- &tizen_remote_surface_manager_interface, 1);
+ &tizen_remote_surface_manager_interface, 1);
}
}
@@ -173,13 +169,11 @@ EXPORT_API int screen_connector_provider_init()
}
__init_count++;
- return ret;
+ return 0;
}
-EXPORT_API int screen_connector_provider_fini()
+EXPORT_API int screen_connector_provider_fini(void)
{
- int ret = 0;
-
if (__init_count > 1)
return 0;
@@ -189,5 +183,5 @@ EXPORT_API int screen_connector_provider_fini()
ecore_wl_shutdown();
__init_count--;
- return ret;
+ return 0;
}
diff --git a/screen_connector_watcher/include/screen_connector_watcher.h b/screen_connector_watcher/include/screen_connector_watcher.h
index 0bfde94..b1cfed7 100644
--- a/screen_connector_watcher/include/screen_connector_watcher.h
+++ b/screen_connector_watcher/include/screen_connector_watcher.h
@@ -26,7 +26,7 @@ extern "C" {
typedef void (*screen_connector_watcher_update_cb)(struct tizen_remote_surface *trs, struct wl_buffer *buffer, uint32_t time, void *data);
typedef void (*screen_connector_watcher_missing_cb)(struct tizen_remote_surface *trs, void *data);
typedef void (*screen_connector_watcher_change_cb)(struct tizen_remote_surface *trs, uint32_t type, struct wl_buffer *tbm,
- int32_t img_file_fd, uint32_t img_file_size, uint32_t time, struct wl_array *keys, void *data);
+ int32_t img_file_fd, uint32_t img_file_size, uint32_t time, struct wl_array *keys, void *data);
typedef struct _screen_connector_watcher_ops {
screen_connector_watcher_update_cb update_cb;
@@ -36,8 +36,8 @@ typedef struct _screen_connector_watcher_ops {
typedef struct _screen_connector_watcher_h *screen_connector_watcher_h;
-int screen_connector_watcher_init();
-int screen_connector_watcher_fini();
+int screen_connector_watcher_init(void);
+int screen_connector_watcher_fini(void);
screen_connector_watcher_h screen_connector_watcher_add(screen_connector_watcher_ops *ops, char *id, void *data);
int screen_connector_watcher_remove(screen_connector_watcher_h h);
int screen_connector_watcher_update(const char *appid);
@@ -52,4 +52,4 @@ void screen_connector_watcher_redirect_surface(screen_connector_watcher_h watche
}
#endif
-#endif
+#endif /* __SCREEN_CONNECTOR_WATCHER_H__ */
diff --git a/screen_connector_watcher/src/screen_connector_watcher.c b/screen_connector_watcher/src/screen_connector_watcher.c
index acf1e07..c1bcfb1 100644
--- a/screen_connector_watcher/src/screen_connector_watcher.c
+++ b/screen_connector_watcher/src/screen_connector_watcher.c
@@ -1,5 +1,4 @@
/*
- * Screen Connector Watcher
* Copyright (c) 2016 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the License);
@@ -14,10 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
#include <stdio.h>
#include <errno.h>
#include <glib.h>
-
#include <dlog.h>
#include <wayland-client.h>
#include <Ecore_Wayland.h>
@@ -40,7 +39,7 @@ struct _screen_connector_watcher_h {
void (*update_cb)(struct tizen_remote_surface *trs, struct wl_buffer *buffer, uint32_t time, void *data);
void (*missing_cb)(struct tizen_remote_surface *trs, void *data);
void (*change_cb)(struct tizen_remote_surface *trs, uint32_t type, struct wl_buffer *tbm,
- int32_t img_file_fd, uint32_t img_file_size, uint32_t time, struct wl_array *keys, void *data);
+ int32_t img_file_fd, uint32_t img_file_size, uint32_t time, struct wl_array *keys, void *data);
void *data;
struct tizen_remote_surface *surface;
int resource_id;
@@ -51,7 +50,7 @@ typedef struct _screen_connector_watcher_h *screen_connector_watcher_h;
static struct tizen_remote_surface_manager *__rsm;
static struct wayland_tbm_client *__tbm_client;
static struct wl_tbm *__tbm;
-static bool __is_init = false;
+static bool __is_init;
static GList *__watcher_list;
static GList *__pending_watcher_list;
static aul_screen_viewer_handler __aul_cbs;
@@ -59,6 +58,7 @@ static aul_screen_viewer_handler __aul_cbs;
static void __buffer_updated(void *data, struct tizen_remote_surface *trs, struct wl_buffer *buffer, uint32_t time)
{
screen_connector_watcher_h watcher_h = (screen_connector_watcher_h)data;
+
if (watcher_h)
watcher_h->update_cb(trs, buffer, time, watcher_h->data);
}
@@ -66,15 +66,17 @@ static void __buffer_updated(void *data, struct tizen_remote_surface *trs, struc
static void __buffer_missing(void *data, struct tizen_remote_surface *trs)
{
screen_connector_watcher_h watcher_h = (screen_connector_watcher_h)data;
+
if (watcher_h)
watcher_h->missing_cb(trs, watcher_h->data);
}
#if 0
static void __buffer_changed(void *data, struct tizen_remote_surface *trs, uint32_t type, struct wl_buffer *tbm,
- int32_t img_file_fd, uint32_t img_file_size, uint32_t time, struct wl_array *keys)
+ int32_t img_file_fd, uint32_t img_file_size, uint32_t time, struct wl_array *keys)
{
screen_connector_watcher_h watcher_h = (screen_connector_watcher_h)data;
+
if (watcher_h)
watcher_h->change_cb(trs, type, tbm, img_file_fd, img_file_size, time, keys, watcher_h->data);
}
@@ -97,35 +99,43 @@ static void __app_removed(const char *appid, const int pid, void *data)
EXPORT_API void screen_connector_watcher_redirect_surface(screen_connector_watcher_h watcher_h)
{
- watcher_h->surface =
- tizen_remote_surface_manager_create_surface(__rsm, (uint32_t)watcher_h->resource_id, __tbm);
+ if (watcher_h == NULL)
+ return;
+
+ watcher_h->surface = tizen_remote_surface_manager_create_surface(__rsm, (uint32_t)watcher_h->resource_id, __tbm);
LOGD("resource_id : %d, (%p)", watcher_h->resource_id, watcher_h->surface);
- tizen_remote_surface_add_listener(watcher_h->surface, &__rs_listener,
- watcher_h);
+ tizen_remote_surface_add_listener(watcher_h->surface, &__rs_listener, watcher_h);
tizen_remote_surface_redirect(watcher_h->surface);
}
static screen_connector_watcher_h __create_watcher_handle_info(char *appid)
{
- screen_connector_watcher_h watcher_h = NULL;
+ screen_connector_watcher_h watcher_h;
+
watcher_h = (screen_connector_watcher_h)calloc(1, sizeof(struct _screen_connector_watcher_h));
if (watcher_h == NULL) {
LOGE("watcher_h calloc fail");
return NULL;
}
+
watcher_h->appid = strdup(appid);
+ if (watcher_h->appid == NULL) {
+ LOGE("out of memory");
+ free(watcher_h);
+ return NULL;
+ }
return watcher_h;
}
static void __app_added(const char *appid, const int pid, const unsigned int resource_id, void *data)
{
- LOGD("__app_added pid: %d, resource_id: %d, appid: %s", pid, resource_id, appid);
screen_connector_watcher_h watcher_h = NULL;
- screen_connector_watcher_h cur_h = NULL;
+ screen_connector_watcher_h cur_h;
GList *watcher_list = __watcher_list;
+ LOGD("__app_added pid: %d, resource_id: %d, appid: %s", pid, resource_id, appid);
for (; watcher_list != NULL; watcher_list = watcher_list->next) {
cur_h = (screen_connector_watcher_h)watcher_list->data;
if (strcmp(cur_h->appid, appid) == 0) {
@@ -151,10 +161,9 @@ static void __app_added(const char *appid, const int pid, const unsigned int res
screen_connector_watcher_redirect_surface(watcher_h);
else
LOGE("bad tbm message received. missing arguments");
-
}
-EXPORT_API int screen_connector_watcher_init()
+EXPORT_API int screen_connector_watcher_init(void)
{
int ret = 0;
struct wl_registry *registry;
@@ -171,15 +180,15 @@ EXPORT_API int screen_connector_watcher_init()
if (!registry || !globals) {
LOGE("could not get registry(%p) or global list(%p)", registry,
- globals);
+ globals);
return -1;
}
EINA_INLIST_FOREACH(globals, global) {
if (!strcmp(global->interface, "tizen_remote_surface_manager")) {
__rsm = wl_registry_bind(registry, global->id,
- &tizen_remote_surface_manager_interface,
- global->version < 2 ? global->version : 2);
+ &tizen_remote_surface_manager_interface,
+ global->version < 2 ? global->version : 2);
}
}
@@ -209,7 +218,7 @@ EXPORT_API int screen_connector_watcher_init()
return ret;
}
-EXPORT_API int screen_connector_watcher_fini()
+EXPORT_API int screen_connector_watcher_fini(void)
{
if (!__is_init)
return 0;
@@ -245,6 +254,9 @@ EXPORT_API screen_connector_watcher_h screen_connector_watcher_create_handle(cha
screen_connector_watcher_h watcher_h = NULL;
watcher_h = __create_watcher_handle_info(id);
+ if (watcher_h == NULL)
+ return NULL;
+
watcher_h->update_cb = ops->update_cb;
watcher_h->change_cb = ops->change_cb;
watcher_h->missing_cb = ops->missing_cb;
@@ -256,9 +268,8 @@ EXPORT_API screen_connector_watcher_h screen_connector_watcher_create_handle(cha
EXPORT_API screen_connector_watcher_h screen_connector_watcher_add(screen_connector_watcher_ops *ops, char *id, void *data)
{
-
screen_connector_watcher_h watcher_h = NULL;
- screen_connector_watcher_h cur_h = NULL;
+ screen_connector_watcher_h cur_h;
GList *watcher_list = __pending_watcher_list;
for (; watcher_list != NULL; watcher_list = watcher_list->next) {
@@ -290,16 +301,14 @@ EXPORT_API screen_connector_watcher_h screen_connector_watcher_add(screen_connec
EXPORT_API int screen_connector_watcher_remove(screen_connector_watcher_h h)
{
- int ret = 0;
__destroy_watcher_h(h);
- return ret;
+
+ return 0;
}
EXPORT_API int screen_connector_watcher_update(const char *appid)
{
- int ret = 0;
- ret = aul_screen_connector_update_app_screen(appid);
- return ret;
+ return aul_screen_connector_update_app_screen(appid);
}
EXPORT_API char *screen_connector_watcher_get_appid(screen_connector_watcher_h h)
diff --git a/screen_connector_watcher_evas/include/screen_connector_watcher_evas.h b/screen_connector_watcher_evas/include/screen_connector_watcher_evas.h
index efbe06a..117fea5 100644
--- a/screen_connector_watcher_evas/include/screen_connector_watcher_evas.h
+++ b/screen_connector_watcher_evas/include/screen_connector_watcher_evas.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef __SCREEN_CONNECTOR_WATCHER_EVAS_H
-#define __SCREEN_CONNECTOR_WATCHER_EVAS_H
+#ifndef __SCREEN_CONNECTOR_WATCHER_EVAS_H__
+#define __SCREEN_CONNECTOR_WATCHER_EVAS_H__
#include <Evas.h>
#include <tizen.h>
@@ -37,7 +37,7 @@ extern "C" {
*/
typedef enum {
- VISIBILITY_TYPE_UNOBSCURED = 0,
+ VISIBILITY_TYPE_UNOBSCURED,
VISIBILITY_TYPE_PARTIALLY_OBSCURED,
VISIBILITY_TYPE_FULLY_OBSCURED,
} visibility_type;
@@ -47,21 +47,20 @@ typedef void (*screen_connector_watcher_evas_removed_cb)(const char *appid, Evas
typedef void (*screen_connector_watcher_evas_updated_cb)(const char *appid, Evas_Object *image, void *data);
typedef struct _screen_connector_watcher_evas_ops {
- screen_connector_watcher_evas_added_cb added;
- screen_connector_watcher_evas_removed_cb removed;
- screen_connector_watcher_evas_updated_cb updated;
-}screen_connector_watcher_evas_ops;
+ screen_connector_watcher_evas_added_cb added;
+ screen_connector_watcher_evas_removed_cb removed;
+ screen_connector_watcher_evas_updated_cb updated;
+} screen_connector_watcher_evas_ops;
typedef struct _screen_connector_watcher_evas_h *screen_connector_watcher_evas_h;
int screen_connector_watcher_evas_init(Evas_Object *win);
-int screen_connector_watcher_evas_fini();
+int screen_connector_watcher_evas_fini(void);
screen_connector_watcher_evas_h screen_connector_watcher_evas_add(screen_connector_watcher_evas_ops *ops, char *id, void *data);
int screen_connector_watcher_evas_remove(screen_connector_watcher_evas_h handle);
int screen_connector_watcher_evas_update(const char *appid);
-
-int screen_connector_watcher_evas_start_visibility_notify();
-int screen_connector_watcher_evas_stop_visibility_notify();
+int screen_connector_watcher_evas_start_visibility_notify(void);
+int screen_connector_watcher_evas_stop_visibility_notify(void);
int screen_connector_watcher_evas_freeze_visibility(Evas_Object *obj, visibility_type type);
int screen_connector_watcher_evas_thaw_visibility(Evas_Object *obj);
int screen_connector_watcher_evas_send_mouse_up(Evas_Object *obj);
@@ -78,6 +77,4 @@ int screen_connector_watcher_evas_get_rid(Evas_Object *obj, int *resource_id);
}
#endif
-#endif
-
-/* End of a file */
+#endif /* __SCREEN_CONNECTOR_WATCHER_EVAS_H__ */
diff --git a/screen_connector_watcher_evas/src/screen_connector_watcher_evas.c b/screen_connector_watcher_evas/src/screen_connector_watcher_evas.c
index 3bfebd0..9152610 100644
--- a/screen_connector_watcher_evas/src/screen_connector_watcher_evas.c
+++ b/screen_connector_watcher_evas/src/screen_connector_watcher_evas.c
@@ -1,5 +1,4 @@
/*
- * Screen Connector Watcher Evas
* Copyright (c) 2016 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the License);
@@ -19,7 +18,6 @@
#include <errno.h>
#include <glib.h>
#include <sys/mman.h>
-
#include <dlog.h>
#include <Elementary.h>
#include <Ecore_Wayland.h>
@@ -46,6 +44,7 @@ struct _screen_connector_watcher_evas_h {
struct wl_buffer *pre_buffer;
void *data;
};
+
static Evas_Object *__viewer_win;
static Ecore_Event_Handler *__visibility_listener;
static GHashTable *__watcher_tbl;
@@ -60,7 +59,6 @@ static void __destroy_watcher_evas_handle(screen_connector_watcher_evas_h h)
EXPORT_API int screen_connector_watcher_evas_init(Evas_Object *win)
{
- int ret = 0;
__viewer_win = win;
__watcher_tbl = g_hash_table_new(g_direct_hash, g_direct_equal);
@@ -69,19 +67,15 @@ EXPORT_API int screen_connector_watcher_evas_init(Evas_Object *win)
return -1;
}
- ret = screen_connector_watcher_init();
- return ret;
+ return screen_connector_watcher_init();
}
-EXPORT_API int screen_connector_watcher_evas_fini()
+EXPORT_API int screen_connector_watcher_evas_fini(void)
{
- int ret = 0;
-
if (__watcher_tbl)
g_hash_table_destroy(__watcher_tbl);
- ret = screen_connector_watcher_fini();
- return ret;
+ return screen_connector_watcher_fini();
}
static bool __obj_is_visible(Evas_Object *obj)
@@ -100,15 +94,16 @@ static bool __obj_is_visible(Evas_Object *obj)
y >= 0 && y < window_h &&
(rotation == 0 || rotation == 180)) {
LOGD("x %d, y %d w %d h %d, window_w %d window_h %d rotation %d",
- x, y, w, h, window_w, window_h, rotation);
+ x, y, w, h, window_w, window_h, rotation);
return true;
} else if (x >= 0 && x < window_h &&
y >= 0 && y < window_w &&
(rotation == 90 || rotation == 270)) {
LOGD("x %d, y %d w %d h %d, window_w %d window_h %d rotation %d",
- x, y, w, h, window_w, window_h, rotation);
+ x, y, w, h, window_w, window_h, rotation);
return true;
}
+
return false;
}
@@ -224,7 +219,6 @@ static void __rs_cb_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_
evas_device_subclass_get(ev->dev),
desc,
ev->timestamp);
-
}
static void __rs_cb_mouse_move(void *data, Evas *e, Evas_Object *obj, void *event_info)
@@ -260,7 +254,6 @@ static void __rs_cb_mouse_move(void *data, Evas *e, Evas_Object *obj, void *even
evas_device_subclass_get(ev->dev),
desc,
ev->timestamp);
-
}
static void __rs_cb_mouse_wheel(void *data, Evas *e, Evas_Object *obj, void *event_info)
@@ -283,7 +276,6 @@ static void __rs_cb_mouse_wheel(void *data, Evas *e, Evas_Object *obj, void *eve
evas_device_subclass_get(ev->dev),
desc,
ev->timestamp);
-
}
static void __rs_cb_show(void *data, Evas *e, Evas_Object *obj, void *event_info)
@@ -297,9 +289,8 @@ static void __rs_cb_hide(void *data, Evas *e, Evas_Object *obj, void *event_info
}
static void __watcher_change_cb(struct tizen_remote_surface *trs, uint32_t type, struct wl_buffer *tbm,
- int32_t img_file_fd, uint32_t img_file_size, uint32_t time, struct wl_array *keys, void *data)
+ int32_t img_file_fd, uint32_t img_file_size, uint32_t time, struct wl_array *keys, void *data)
{
-
bool is_added = false;
Evas_Native_Surface ns;
tbm_surface_h tbm_surface;
@@ -316,32 +307,31 @@ static void __watcher_change_cb(struct tizen_remote_surface *trs, uint32_t type,
pid = screen_connector_watcher_get_pid(watcher_evas_h->watcher_h);
if (watcher_evas_h->img_tbm == NULL) {
-
LOGD("first added !!!! %d, %d %s", (watcher_evas_h->img_tbm == NULL), type, appid);
watcher_evas_h->img_tbm = evas_object_image_filled_add(
- evas_object_evas_get(__viewer_win));
+ evas_object_evas_get(__viewer_win));
/* Image alpha set */
evas_object_image_alpha_set(watcher_evas_h->img_tbm, 1);
evas_object_event_callback_add(watcher_evas_h->img_tbm,
- EVAS_CALLBACK_MOUSE_DOWN,
- __rs_cb_mouse_down, watcher_evas_h);
+ EVAS_CALLBACK_MOUSE_DOWN,
+ __rs_cb_mouse_down, watcher_evas_h);
evas_object_event_callback_add(watcher_evas_h->img_tbm,
- EVAS_CALLBACK_MOUSE_UP,
- __rs_cb_mouse_up, watcher_evas_h);
+ EVAS_CALLBACK_MOUSE_UP,
+ __rs_cb_mouse_up, watcher_evas_h);
evas_object_event_callback_add(watcher_evas_h->img_tbm,
- EVAS_CALLBACK_MOUSE_MOVE,
- __rs_cb_mouse_move, watcher_evas_h);
+ EVAS_CALLBACK_MOUSE_MOVE,
+ __rs_cb_mouse_move, watcher_evas_h);
evas_object_event_callback_add(watcher_evas_h->img_tbm,
- EVAS_CALLBACK_MOUSE_WHEEL,
- __rs_cb_mouse_wheel, watcher_evas_h);
+ EVAS_CALLBACK_MOUSE_WHEEL,
+ __rs_cb_mouse_wheel, watcher_evas_h);
evas_object_event_callback_add(watcher_evas_h->img_tbm,
- EVAS_CALLBACK_SHOW,
- __rs_cb_show, watcher_evas_h);
+ EVAS_CALLBACK_SHOW,
+ __rs_cb_show, watcher_evas_h);
evas_object_event_callback_add(watcher_evas_h->img_tbm,
- EVAS_CALLBACK_HIDE,
- __rs_cb_hide, watcher_evas_h);
+ EVAS_CALLBACK_HIDE,
+ __rs_cb_hide, watcher_evas_h);
/* Store watcher_evas_h */
g_hash_table_insert(__watcher_tbl, watcher_evas_h->img_tbm, watcher_evas_h);
@@ -350,14 +340,13 @@ static void __watcher_change_cb(struct tizen_remote_surface *trs, uint32_t type,
snprintf(plug_id, sizeof(plug_id), "%s:%d", appid, pid);
evas_object_data_set(watcher_evas_h->img_tbm, "___PLUGID", strdup(plug_id));
evas_object_event_callback_add(watcher_evas_h->img_tbm,
- EVAS_CALLBACK_MOVE, __obj_move_cb, watcher_evas_h);
+ EVAS_CALLBACK_MOVE, __obj_move_cb, watcher_evas_h);
is_added = true;
}
/* check type of given buffer */
- if (type == 0) {//if (type == TIZEN_REMOTE_SURFACE_BUFFER_TYPE_TBM) {
-
+ if (type == 0) {
/* get tbm surface from buffer */
tbm_surface = wl_buffer_get_user_data(tbm);
width = tbm_surface_get_width(tbm_surface);
@@ -372,15 +361,9 @@ static void __watcher_change_cb(struct tizen_remote_surface *trs, uint32_t type,
evas_object_image_size_set(watcher_evas_h->img_tbm, width, height);
evas_object_image_native_surface_set(watcher_evas_h->img_tbm, &ns); /* set native surface */
evas_object_image_pixels_dirty_set(watcher_evas_h->img_tbm, EINA_TRUE); /* set dirty for image updating */
-
- //evas_object_del(watcher_evas_h->img_file); /* delete previous object for the image file type */
-
- } else if (type == 1) {//} else if (type == TIZEN_REMOTE_SURFACE_BUFFER_TYPE_IMAGE_FILE) {
-
- if (!watcher_evas_h->img_file) {
- watcher_evas_h->img_file = evas_object_image_filled_add(
- evas_object_evas_get(__viewer_win));
- }
+ } else if (type == 1) {
+ if (!watcher_evas_h->img_file)
+ watcher_evas_h->img_file = evas_object_image_filled_add(evas_object_evas_get(__viewer_win));
map = mmap(NULL, img_file_size, PROT_READ, MAP_SHARED, img_file_fd, 0);
evas_object_image_memfile_set(watcher_evas_h->img_file, map, img_file_size, format, NULL);
@@ -399,7 +382,6 @@ static void __watcher_change_cb(struct tizen_remote_surface *trs, uint32_t type,
}
watcher_evas_h->pre_buffer = tbm;
-
if (is_added) {
LOGD("call added !!!! %s", appid);
watcher_evas_h->ops->added(appid, watcher_evas_h->img_tbm,
@@ -409,7 +391,6 @@ static void __watcher_change_cb(struct tizen_remote_surface *trs, uint32_t type,
watcher_evas_h->ops->updated(appid, watcher_evas_h->img_tbm,
watcher_evas_h->data);
}
-
}
static void __watcher_update_cb(struct tizen_remote_surface *trs, struct wl_buffer *buffer, uint32_t time, void *data)
@@ -460,7 +441,6 @@ static void __watcher_missing_cb(struct tizen_remote_surface *trs, void *data)
__free_watcher_evas_h(watcher_evas_h);
}
-
EXPORT_API screen_connector_watcher_evas_h screen_connector_watcher_evas_add(screen_connector_watcher_evas_ops *ops, char *id, void *data)
{
screen_connector_watcher_evas_h handle;
@@ -492,7 +472,8 @@ EXPORT_API screen_connector_watcher_evas_h screen_connector_watcher_evas_add(scr
EXPORT_API int screen_connector_watcher_evas_remove(screen_connector_watcher_evas_h handle)
{
- int ret = 0;
+ int ret;
+
ret = screen_connector_watcher_remove(handle->watcher_h);
__destroy_watcher_evas_handle(handle);
return ret;
@@ -500,12 +481,9 @@ EXPORT_API int screen_connector_watcher_evas_remove(screen_connector_watcher_eva
EXPORT_API int screen_connector_watcher_evas_update(const char *appid)
{
- int ret = 0;
- ret = screen_connector_watcher_update(appid);
- return ret;
+ return screen_connector_watcher_update(appid);
}
-
static void __send_visibility(gpointer key, gpointer value, gpointer user_data)
{
screen_connector_watcher_evas_h watcher_evas_h = (screen_connector_watcher_evas_h)value;
@@ -535,30 +513,28 @@ static Eina_Bool __visibility_cb(void *data, int type, void *event)
Ecore_Wl_Event_Window_Visibility_Change *ev = event;
LOGD("visibility change: %d %d", (unsigned int)ev->win,
- (unsigned int)ev->fully_obscured);
+ (unsigned int)ev->fully_obscured);
if (!__watcher_tbl)
return ECORE_CALLBACK_RENEW;
g_hash_table_foreach(__watcher_tbl, __send_visibility,
- GINT_TO_POINTER(ev->fully_obscured));
+ GINT_TO_POINTER(ev->fully_obscured));
return ECORE_CALLBACK_RENEW;
}
-EXPORT_API int screen_connector_watcher_evas_start_visibility_notify()
+EXPORT_API int screen_connector_watcher_evas_start_visibility_notify(void)
{
if (__visibility_listener)
return 0;
- __visibility_listener = ecore_event_handler_add(
- ECORE_WL_EVENT_WINDOW_VISIBILITY_CHANGE, __visibility_cb, NULL);
+ __visibility_listener = ecore_event_handler_add(ECORE_WL_EVENT_WINDOW_VISIBILITY_CHANGE, __visibility_cb, NULL);
return 0;
}
-
-EXPORT_API int screen_connector_watcher_evas_stop_visibility_notify()
+EXPORT_API int screen_connector_watcher_evas_stop_visibility_notify(void)
{
if (!__visibility_listener)
return 0;
@@ -622,19 +598,19 @@ EXPORT_API int screen_connector_watcher_evas_send_mouse_up(Evas_Object *obj)
evas_object_geometry_get(obj, &x, &y, &w, &h);
timestamp = (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff);
tizen_remote_surface_transfer_mouse_event(surface,
- TIZEN_REMOTE_SURFACE_EVENT_TYPE_MOUSE_UP,
- 0,
- 1,
- w / 2,
- h / 2,
- 0,
- 0,
- 0,
- 0,
- TIZEN_INPUT_DEVICE_CLAS_MOUSE,
- TIZEN_INPUT_DEVICE_SUBCLAS_NONE,
- "",
- timestamp);
+ TIZEN_REMOTE_SURFACE_EVENT_TYPE_MOUSE_UP,
+ 0,
+ 1,
+ w / 2,
+ h / 2,
+ 0,
+ 0,
+ 0,
+ 0,
+ TIZEN_INPUT_DEVICE_CLAS_MOUSE,
+ TIZEN_INPUT_DEVICE_SUBCLAS_NONE,
+ "",
+ timestamp);
return 0;
}
@@ -703,12 +679,12 @@ EXPORT_API int screen_connector_watcher_evas_add_by_rid(screen_connector_watcher
watcher_evas_h->data = data;
watcher_evas_h->watcher_h = screen_connector_watcher_create_handle(appid, pid, &watcher_ops, watcher_evas_h);
screen_connector_watcher_redirect_surface(watcher_evas_h->watcher_h);
+
return 0;
}
EXPORT_API int screen_connector_watcher_evas_get_rid(Evas_Object *obj, int *resource_id)
{
-
screen_connector_watcher_evas_h watcher_evas_h;
watcher_evas_h = (screen_connector_watcher_evas_h)g_hash_table_lookup(__watcher_tbl, obj);
@@ -720,7 +696,6 @@ EXPORT_API int screen_connector_watcher_evas_get_rid(Evas_Object *obj, int *reso
return screen_connector_watcher_get_resource_id(watcher_evas_h->watcher_h);
}
-
EXPORT_API int screen_connector_watcher_evas_get_pid(Evas_Object *obj, int *pid)
{
screen_connector_watcher_evas_h watcher_evas_h;
@@ -733,5 +708,3 @@ EXPORT_API int screen_connector_watcher_evas_get_pid(Evas_Object *obj, int *pid)
return screen_connector_watcher_get_pid(watcher_evas_h->watcher_h);
}
-
-/* End of a file */