void *data;
Evas_Object *evas_obj;
int freeze;
- bool is_init;
+
struct tizen_remote_surface *surface;
bool cancel_touch;
- bool visible;
};
struct compositor_h {
static struct compositor_h *__comp;
static int __init_count;
-static bool __obj_is_visible(struct compositor_handler *handler)
+static bool __obj_is_visible(Evas_Object *obj)
{
int x, y, w, h;
Ecore_Wl_Window *window = NULL;
window = elm_win_wl_window_get(__comp->win);
ecore_wl_window_geometry_get(window, &window_x, &window_y, &window_w, &window_h);
- evas_object_geometry_get(handler->evas_obj, &x, &y, &w, &h);
+ evas_object_geometry_get(obj, &x, &y, &w, &h);
rotation = ecore_wl_window_rotation_get(window);
if (x >= -w && x < window_w &&
y >= - h && y < window_h &&
- (rotation == 0 || rotation == 180)) {
- handler->visible = true;
+ (rotation == 0 || rotation == 180))
return true;
- } else if (x >= - w && x < window_h &&
+ else if (x >= - w && x < window_h &&
y >= - h && y < window_w &&
- (rotation == 90 || rotation == 270)) {
- handler->visible = true;
+ (rotation == 90 || rotation == 270))
return true;
- }
- handler->visible = false;
return false;
}
-static void __obj_move_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
-{
- struct compositor_handler *handler = (struct compositor_handler *)data;
-
- if (handler->cancel_touch)
- return;
-
- if (!handler->is_init) {
- handler->is_init = true;
- return;
- }
-
- if (__obj_is_visible(handler))
- _compositor_set_visibility(obj, VISIBILITY_TYPE_UNOBSCURED);
- else
- _compositor_set_visibility(obj, VISIBILITY_TYPE_FULLY_OBSCURED);
-}
-
static void __rs_cb_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
struct compositor_handler *handler = (struct compositor_handler *)data;
evas_object_geometry_get(obj, &x, &y, &w, &h);
_D("mouse down: %d %d", ev->canvas.x - x, ev->canvas.y - y);
- if (!handler->visible) {
+ if (!__obj_is_visible(handler->evas_obj)) {
_D("object is invisible ignore event");
return;
}
evas_object_geometry_get(obj, &x, &y, &w, &h);
_D("mouse up: %d %d", ev->canvas.x - x, ev->canvas.y - y);
- if (!handler->visible) {
+ if (!__obj_is_visible(handler->evas_obj)) {
_D("object is invisible ignore event");
return;
}
evas_object_geometry_get(obj, &x, &y, &w, &h);
_D("mouse move: %d %d", ev->cur.canvas.x - x, ev->cur.canvas.y - y);
- if (!handler->visible) {
+ if (!__obj_is_visible(handler->evas_obj)) {
_D("object is invisible ignore event");
return;
}
_D("mouse wheel");
- if (!handler->visible) {
+ if (!__obj_is_visible(handler->evas_obj)) {
_D("object is invisible ignore event");
return;
}
handler->data);
}
- evas_object_event_callback_add(handler->evas_obj,
- EVAS_CALLBACK_MOVE, __obj_move_cb, handler);
+ if (__obj_is_visible(handler->evas_obj))
+ _compositor_set_visibility(handler->evas_obj, VISIBILITY_TYPE_UNOBSCURED);
+ else
+ _compositor_set_visibility(handler->evas_obj, VISIBILITY_TYPE_FULLY_OBSCURED);
+
}
tbm_surface = wl_buffer_get_user_data(buffer);
handler->cb = cb;
handler->data = data;
handler->freeze = 0;
- handler->is_init = false;
handler->cancel_touch = false;
- handler->visible = true;
/*
* handler will be freed in __rs_cb_missing callabck
handler->cb = cb;
handler->data = data;
handler->freeze = 0;
- handler->is_init = false;
aul_rsm_viewer_set_surface_handler_by_rid(resource_id, &__rs_listener,
handler);
if (handler->freeze)
return;
- if (!__obj_is_visible(handler))
+ if (!__obj_is_visible(handler->evas_obj))
return;
if (event)