int i;
int x, y;
+ /* 맵 객체 생성 및 초기화 */
map = e_map_new();
if (!map) return NULL;
+ /* 기본 맵 설정 */
e_map_util_points_populate_from_object_full(map, obj, 0);
e_map_util_points_color_set(map, 255, 255, 255, 255);
- for (i = 0 ; i < 4 ; ++i)
+ /* 각 꼭지점에 대한 변환 적용 */
+ for (i = 0; i < 4; ++i)
{
- x = 0;
- y = 0;
-
+ x = y = 0;
e_util_transform_vertices_pos_round_get(vertices, i, &x, &y, 0, 0);
e_map_point_coord_set(map, i, x, y, 1.0);
}
}
static void
-_e_comp_object_map_transform_rect(E_Client *ec, int sx, int sy, int sw, int sh, int *dx, int *dy, int *dw, int *dh)
+_e_comp_object_map_transform_rect(E_Client *ec, int sx, int sy, int sw, int sh,
+ int *dx, int *dy, int *dw, int *dh)
{
+ /* 시작점과 끝점 계산 */
int x1 = sx;
int y1 = sy;
int x2 = sx + sw;
int y2 = sy + sh;
- int mx, my;
+ /* 좌표 변환 */
_e_comp_object_map_transform_pos(ec, x1, y1, &x1, &y1);
_e_comp_object_map_transform_pos(ec, x2, y2, &x2, &y2);
- mx = MIN(x1, x2);
- my = MIN(y1, y2);
+ /* 최소/최대 좌표 계산 */
+ int min_x = MIN(x1, x2);
+ int min_y = MIN(y1, y2);
+ int max_x = MAX(x1, x2);
+ int max_y = MAX(y1, y2);
- if (dx) *dx = mx;
- if (dy) *dy = my;
- if (dw) *dw = MAX(x1, x2) - mx;
- if (dh) *dh = MAX(y1, y2) - my;
+ /* 결과값 설정 */
+ if (dx) *dx = min_x;
+ if (dy) *dy = min_y;
+ if (dw) *dw = max_x - min_x;
+ if (dh) *dh = max_y - min_y;
}
static void
_e_comp_intercept_move(void *data, Evas_Object *obj, int x, int y)
{
E_Comp_Object *cw = data;
- int ix, iy;
+ int ix = x, iy = y;
+ E_Zone *zone;
+ /* Handle render update lock */
if (cw->render_update_lock.lock)
{
cw->render_update_lock.pending_move_x = x;
return;
}
+ /* Handle external content */
if ((e_pixmap_type_get(cw->ec->pixmap) != E_PIXMAP_TYPE_EXT_OBJECT) &&
(e_pixmap_usable_get(cw->ec->pixmap)) &&
(cw->external_content))
{
- /* delay to move until the external content is unset */
cw->ec->changes.pos = 1;
EC_CHANGED(cw->ec);
return;
}
+ /* Handle move after resize */
if (cw->ec->move_after_resize)
{
if ((x != cw->ec->x) || (y != cw->ec->y))
{
if (!cw->ec->is_cursor)
- ELOGF("COMP", "Set Pos to (%d,%d). current ec_pos(%d,%d)", cw->ec, x, y, cw->ec->x, cw->ec->y);
+ ELOGF("COMP", "Set Pos to (%d,%d). current ec_pos(%d,%d)",
+ cw->ec, x, y, cw->ec->x, cw->ec->y);
e_client_pos_set(cw->ec, x, y);
cw->ec->changes.pos = 1;
EC_CHANGED(cw->ec);
return;
}
+ /* Handle resize mode */
if ((cw->ec->resize_mode == E_POINTER_RESIZE_NONE) &&
(cw->ec->manage_resize.resize_obj))
{
return;
}
- /* if frame_object does not exist, client_inset indicates CSD.
- * this means that ec->client matches cw->x/y, the opposite
- * of SSD.
- */
+ /* Handle move to same position */
if ((cw->x == x) && (cw->y == y))
{
if ((cw->ec->x != x) || (cw->ec->y != y))
{
- /* handle case where client tries to move to position and back very quickly */
e_client_pos_set(cw->ec, x, y);
cw->ec->client.x = x;
cw->ec->client.y = y;
}
return;
}
+
+ /* Position restriction based on maximize state */
if (!cw->ec->maximize_override)
{
- /* prevent moving in some directions while directionally maximized */
if ((cw->ec->maximized & E_MAXIMIZE_DIRECTION) == E_MAXIMIZE_VERTICAL)
y = cw->y;
if ((cw->ec->maximized & E_MAXIMIZE_DIRECTION) == E_MAXIMIZE_HORIZONTAL)
x = cw->x;
}
- ix = x;
- iy = y;
- if (cw->ec->maximized && (!cw->ec->maximize_override) && ((cw->ec->x != x) || (cw->ec->y != y)) &&
+
+ /* Handle move in maximized state */
+ if (cw->ec->maximized && (!cw->ec->maximize_override) &&
+ ((cw->ec->x != x) || (cw->ec->y != y)) &&
((cw->ec->maximized & E_MAXIMIZE_DIRECTION) != E_MAXIMIZE_VERTICAL) &&
((cw->ec->maximized & E_MAXIMIZE_DIRECTION) != E_MAXIMIZE_HORIZONTAL))
{
- /* prevent moving at all if move isn't allowed in current maximize state */
- if ((!e_config->allow_manip) && ((cw->ec->maximized & E_MAXIMIZE_DIRECTION) == E_MAXIMIZE_BOTH)) return;
- /* queue unmaximize if we are allowing move and update unmaximize geometry */
+ if ((!e_config->allow_manip) &&
+ ((cw->ec->maximized & E_MAXIMIZE_DIRECTION) == E_MAXIMIZE_BOTH))
+ return;
- E_Zone *zone;
zone = e_comp_zone_find_by_ec(cw->ec);
if (!zone) return;
EC_CHANGED(cw->ec);
return;
}
- /* only update during resize if triggered by resize */
- if (e_client_util_resizing_get(cw->ec) && (!cw->force_move)) return;
- /* delay to move while surface waits paired commit serial*/
+
+ /* Handle during resize or waiting for geometry commit */
+ if (e_client_util_resizing_get(cw->ec) && (!cw->force_move))
+ return;
if (e_client_pending_geometry_has(cw->ec))
- {
- /* do nothing while waiting paired commit serial*/
return;
+ return;
+ }
+ return;
}
+ /* Set client position */
e_client_pos_set(cw->ec, x, y);
if (cw->ec->new_client)
{
- /* don't actually do anything until first client idler loop */
cw->ec->placed = ((!cw->ec->dialog) && (!cw->ec->parent));
cw->ec->changes.pos = 1;
EC_CHANGED(cw->ec);
}
else
{
- /* only update xy position of client to avoid invalid
- * first damage region if it is not a new_client. */
cw->ec->client.x = ix;
cw->ec->client.y = iy;
-
- x = ix, y = iy;
- evas_object_move(obj, x, y);
+ evas_object_move(obj, ix, iy);
}
}
_e_comp_intercept_resize(void *data, Evas_Object *obj, int w, int h)
{
E_Comp_Object *cw = data;
- int pw = 0, ph = 0, iw, ih, prev_w, prev_h, x, y;
E_Zone *zone;
+ int pw = 0, ph = 0;
+ int iw = w, ih = h;
+ int prev_w = cw->w, prev_h = cw->h;
+ int x = cw->ec->x, y = cw->ec->y;
+ /* Handle render update lock */
if (cw->render_update_lock.lock)
{
cw->render_update_lock.pending_resize_w = w;
return;
}
- /* if frame_object does not exist, client_inset indicates CSD.
- * this means that ec->client matches cw->w/h, the opposite
- * of SSD.
- */
+ /* Handle resize to same size */
if ((cw->w == w) && (cw->h == h))
{
if (((cw->ec->w != w) || (cw->ec->h != h)) ||
(cw->ec->client.w != w) ||
(cw->ec->client.h != h))
{
- /* handle case where client tries to resize itself and back very quickly */
e_client_size_set(cw->ec, w, h);
cw->ec->client.w = w;
cw->ec->client.h = h;
return;
}
- /* guarantee that fullscreen is fullscreen */
+ /* Validate fullscreen size */
zone = e_comp_zone_find_by_ec(cw->ec);
if (!zone) return;
if (cw->ec->fullscreen && ((w != zone->w) || (h != zone->h)))
if (!e_client_transform_core_enable_get(cw->ec))
return;
}
- /* calculate client size */
- iw = w;
- ih = h;
- if (cw->ec->maximized && (!cw->ec->maximize_override) && ((cw->ec->w != w) || (cw->ec->h != h)))
+
+ /* Handle maximized state */
+ if (cw->ec->maximized && (!cw->ec->maximize_override) &&
+ ((cw->ec->w != w) || (cw->ec->h != h)))
{
- /* prevent resizing while maximized depending on direction and config */
- if ((!e_config->allow_manip) && ((cw->ec->maximized & E_MAXIMIZE_DIRECTION) == E_MAXIMIZE_BOTH)) return;
+ if ((!e_config->allow_manip) &&
+ ((cw->ec->maximized & E_MAXIMIZE_DIRECTION) == E_MAXIMIZE_BOTH))
+ return;
Eina_Bool reject = EINA_FALSE;
if (cw->ec->maximized & E_MAXIMIZE_VERTICAL)
return;
}
}
+
+ /* Handle new client or hidden state */
if (cw->ec->new_client || (!cw->ec->visible) || (!cw->effect_obj))
{
- /* do nothing until client idler loops */
if ((cw->ec->w != w) || (cw->ec->h != h))
{
e_client_size_set(cw->ec, w, h);
return;
}
+
+ /* Handle waiting for geometry commit */
if (e_client_pending_geometry_has(cw->ec))
- {
- /* do nothing while waiting paired commit serial*/
return;
- }
+ /* Set client size */
e_client_size_set(cw->ec, w, h);
-
cw->ec->client.w = iw;
cw->ec->client.h = ih;
- if ((cw->ec->client.w < 0) || (cw->ec->client.h < 0)) CRI("WTF. ec:%p", cw->ec);
+ if ((cw->ec->client.w < 0) || (cw->ec->client.h < 0))
+ CRI("WTF. ec:%p", cw->ec);
- /* The size of non-compositing window can be changed, so there is a
- * need to check that cw is H/W composited if cw is not redirected.
- * And of course we have to change size of evas object of H/W composited cw,
- * otherwise cw can't receive input events even if it is shown on the screen.
- */
+ /* Check redirection state */
Eina_Bool redirected = cw->redirected;
if (!redirected)
redirected = e_comp_is_on_overlay(cw->ec);
+ /* Validate pixmap size */
if ((!cw->ec->input_only) && (redirected) &&
(cw->content_type != E_COMP_OBJECT_CONTENT_TYPE_EXT_IMAGE) &&
(cw->content_type != E_COMP_OBJECT_CONTENT_TYPE_EXT_EDJE) &&
(!e_pixmap_size_get(cw->ec->pixmap, &pw, &ph))))
return;
+ /* Handle external content type */
if (cw->content_type == E_COMP_OBJECT_CONTENT_TYPE_EXT_IMAGE ||
cw->content_type == E_COMP_OBJECT_CONTENT_TYPE_EXT_EDJE)
pw = w, ph = h;
- prev_w = cw->w, prev_h = cw->h;
- /* check shading and clamp to pixmap size for regular clients */
+ /* Resize regular client */
if ((!cw->ec->input_only) && (!cw->ec->override) &&
(((w != pw) || (h != ph))))
{
wl_signal_emit(&cw->events.resize, NULL);
-
w = pw, h = ph;
+
if ((cw->w == w) && (cw->h == h))
{
- /* going to be a noop resize which won't trigger smart resize */
RENDER_DEBUG("DAMAGE RESIZE(%p): %dx%d", cw->ec, cw->ec->client.w, cw->ec->client.h);
- if (cw->updates) eina_tiler_area_size_set(cw->updates, cw->ec->client.w, cw->ec->client.h);
+ if (cw->updates)
+ eina_tiler_area_size_set(cw->updates, cw->ec->client.w, cw->ec->client.h);
}
evas_object_resize(obj, w, h);
}
else
{
- /* flip for CSD */
if (!cw->ec->input_only)
w = pw, h = ph;
wl_signal_emit(&cw->events.resize, NULL);
- /* "just do it" for overrides */
evas_object_resize(obj, w, h);
}
+
+ /* Handle shape change */
if (!cw->ec->override)
{
- /* shape probably changed for non-overrides */
if (cw->ec->shaped)
EC_CHANGED(cw->ec);
}
- /* this fixes positioning jiggles when using a resize mode
- * which also changes the client's position
- */
+ /* Handle resize mode */
cw->force_move = 1;
-
- x = cw->ec->x, y = cw->ec->y;
-
switch (cw->ec->resize_mode)
{
case E_POINTER_RESIZE_BL:
}
}
-EINTERN void
-e_comp_object_raise(Evas_Object *obj)
-{
- evas_object_raise(obj);
-
- if (evas_object_smart_smart_get(obj))
- {
- E_Client *ec = e_comp_object_client_get(obj);
- if (ec)
- _e_comp_object_hook_call(E_COMP_OBJECT_HOOK_RESTACK, ec);
- }
-}
-
-EINTERN void
-e_comp_object_lower(E_Comp_Object *cw, Evas_Object *obj)
-{
- evas_object_lower(obj);
-
- if (evas_object_smart_smart_get(obj))
- {
- E_Client *ec = e_comp_object_client_get(obj);
- if (ec)
- {
- _e_comp_object_hook_call(E_COMP_OBJECT_HOOK_RESTACK, ec);
- wl_signal_emit(&cw->events.lower_done, NULL);
- }
- }
-}
-
-EINTERN void
-e_comp_object_stack_above(Evas_Object *obj, Evas_Object *target)
-{
- evas_object_stack_above(obj, target);
-
- if (evas_object_smart_smart_get(obj))
- {
- E_Client *ec = e_comp_object_client_get(obj);
- if (ec)
- _e_comp_object_hook_call(E_COMP_OBJECT_HOOK_RESTACK, ec);
- }
-}
-
-EINTERN void
-e_comp_object_stack_below(Evas_Object *obj, Evas_Object *target)
-{
- evas_object_stack_below(obj, target);
-
- if (evas_object_smart_smart_get(obj))
- {
- E_Client *ec = e_comp_object_client_get(obj);
- if (ec)
- _e_comp_object_hook_call(E_COMP_OBJECT_HOOK_RESTACK, ec);
- }
-}
-
-EINTERN void
-e_comp_object_layer_set(Evas_Object *obj, short layer)
-{
- evas_object_layer_set(obj, layer);
-
- if (evas_object_smart_smart_get(obj))
- {
- E_Client *ec = e_comp_object_client_get(obj);
- if (ec)
- _e_comp_object_hook_call(E_COMP_OBJECT_HOOK_LAYER_SET, ec);
- }
-}
-
-static void
-_e_comp_intercept_stack_above(void *data, Evas_Object *obj, Evas_Object *above)
-{
- EINA_SAFETY_ON_TRUE_RETURN(obj == above);
-
- TRACE_DS_BEGIN(COMP:INTERCEPT STACK ABOVE);
-
- E_Comp_Object *cw = data;
- E_Comp_Object_Data_Stack_Above stack_above_data;
-
- stack_above_data.cw = cw;
- stack_above_data.above_obj = above;
-
- wl_signal_emit(&cw->events.stack_above, &stack_above_data);
-
- TRACE_DS_END();
-}
-
+/* Intercept callback function to raise object to top */
static void
-_e_comp_intercept_stack_below(void *data, Evas_Object *obj, Evas_Object *below)
+_e_comp_intercept_raise(void *data, Evas_Object *obj)
{
- EINA_SAFETY_ON_TRUE_RETURN(obj == below);
-
- TRACE_DS_BEGIN(COMP:INTERCEPT STACK BELOW);
-
E_Comp_Object *cw = data;
- E_Comp_Object_Data_Stack_Below stack_below_data;
- stack_below_data.cw = cw;
- stack_below_data.below_obj = below;
-
- wl_signal_emit(&cw->events.stack_below, &stack_below_data);
+ /* Start debug trace */
+ TRACE_DS_BEGIN(COMP:INTERCEPT RAISE);
- if (!cw->visible)
- e_comp_render_queue();
+ /* Emit raise event */
+ wl_signal_emit(&cw->events.raise, cw);
+ /* End debug trace */
TRACE_DS_END();
}
+/* Intercept callback function to lower object to bottom */
static void
_e_comp_intercept_lower(void *data, Evas_Object *obj)
{
E_Comp_Object *cw = data;
+ /* Start debug trace */
TRACE_DS_BEGIN(COMP:INTERCEPT LOWER);
+ /* Emit lower event */
wl_signal_emit(&cw->events.lower, cw);
- TRACE_DS_END();
-}
-
-static void
-_e_comp_intercept_raise(void *data, Evas_Object *obj)
-{
- E_Comp_Object *cw = data;
-
- TRACE_DS_BEGIN(COMP:INTERCEPT RAISE);
-
- wl_signal_emit(&cw->events.raise, cw);
+ /* End debug trace */
TRACE_DS_END();
}
_e_comp_intercept_hide(void *data, Evas_Object *obj)
{
E_Comp_Object *cw = data;
+ E_Client *ec = cw->ec;
- if( !_e_comp_object_intercept_hook_call(E_COMP_OBJECT_INTERCEPT_HOOK_HIDE, cw->ec))
+ /* 1. Call and validate intercept hook */
+ if (!_e_comp_object_intercept_hook_call(E_COMP_OBJECT_INTERCEPT_HOOK_HIDE, ec))
{
- ELOGF("COMP", "Hide. intercepted", cw->ec);
+ ELOGF("COMP", "Hide. intercepted", ec);
return;
}
- if (cw->ec->launching == EINA_TRUE)
+ /* 2. Handle running client */
+ if (ec->launching == EINA_TRUE)
{
- ELOGF("COMP", "Hide. Cancel launching flag", cw->ec);
- cw->ec->launching = EINA_FALSE;
- e_comp_object_signal_emit(cw->ec->frame, "e,action,launch,cancel", "e");
+ ELOGF("COMP", "Hide. Cancel launching flag", ec);
+ ec->launching = EINA_FALSE;
+ e_comp_object_signal_emit(ec->frame, "e,action,launch,cancel", "e");
}
- if (cw->ec->hidden)
+ /* 3. Handle special cases */
+ if (ec->hidden)
{
- /* hidden flag = just do it */
- ELOGF("COMP", "Hide hidden evas_object:%p", cw->ec, obj);
+ /* Handle already hidden object immediately */
+ ELOGF("COMP", "Hide hidden evas_object:%p", ec, obj);
evas_object_hide(obj);
-
wl_signal_emit(&cw->events.hide, NULL);
-
return;
}
- if (cw->ec->input_only)
+ if (ec->input_only)
{
- /* input_only = who cares */
- ELOGF("COMP", "Hide input_only evas_object:%p", cw->ec, obj);
+ /* Handle input-only object immediately */
+ ELOGF("COMP", "Hide input_only evas_object:%p", ec, obj);
evas_object_hide(obj);
-
wl_signal_emit(&cw->events.hide, NULL);
-
return;
}
- /* already hidden or currently animating */
- if ((!cw->visible) || (cw->animating && cw->hiding && (!cw->ec->iconic)))
+
+ /* 4. Validate hidden state */
+ if ((!cw->visible) || (cw->animating && cw->hiding && (!ec->iconic)))
{
- ELOGF("COMP", "Hide. but already hidden or currently animating", cw->ec);
+ ELOGF("COMP", "Hide. but already hidden or currently animating", ec);
return;
}
- /* don't try hiding during shutdown */
+ /* 5. Handle during shutdown */
cw->defer_hide |= stopping;
if (!cw->defer_hide)
{
- if ((!cw->ec->iconic) && (!cw->ec->override))
- /* unset delete requested so the client doesn't break */
- cw->ec->delete_requested = 0;
- if ((!cw->animating) || (!cw->hiding) || cw->ec->iconic)
+ /* 5.1 Handle delete request */
+ if ((!ec->iconic) && (!ec->override))
+ ec->delete_requested = 0;
+
+ /* 5.2 Handle based on animation state */
+ if ((!cw->animating) || (!cw->hiding) || ec->iconic)
{
ELOGF("COMP", "Hide. but after iconify or hide animation, cw->animating:%d, cw->hiding:%d, iconic:%d",
- cw->ec, cw->animating, cw->hiding, cw->ec->iconic);
+ ec, cw->animating, cw->hiding, ec->iconic);
- if (cw->ec->iconic)
+ /* Handle iconify or hidden state */
+ if (ec->iconic)
e_comp_object_signal_emit(obj, "e,action,iconify", "e");
else
{
wl_signal_emit(&cw->events.hiding, NULL);
+ /* Update animation state */
cw->defer_hide = !!cw->animating;
if (!cw->animating)
e_comp_object_effect_set(obj, NULL);
}
}
+
+ /* 6. Exit if animation is in progress */
if (cw->animating) return;
- /* if we have no animations running, go ahead and hide */
+
+ /* 7. Final hide processing */
cw->defer_hide = 0;
- ELOGF("COMP", "Hide normal object:%p", cw->ec, obj);
+ ELOGF("COMP", "Hide normal object:%p", ec, obj);
evas_object_hide(obj);
-
wl_signal_emit(&cw->events.hide, NULL);
}
_e_comp_intercept_show_helper(E_Comp_Object *cw, E_Comp *comp)
{
E_Client *ec = cw->ec;
- int w = 0, h = 0;
E_Comp_Wl_Data *comp_wl;
+ int w = 0, h = 0;
- EINA_SAFETY_ON_NULL_RETURN(ec);
-
+ /* Basic validation */
+ if (!ec) return;
if (ec->show_pending.count > 0)
{
- ELOGF("COMP", "show_helper. Show PENDING!!! show_pending:%d", ec, ec->show_pending.count);
ec->show_pending.running = EINA_TRUE;
+ ELOGF("COMP", "show_helper. Show PENDING!!! show_pending:%d", ec, ec->show_pending.count);
return;
}
-
if (!_e_comp_object_intercept_hook_call(E_COMP_OBJECT_INTERCEPT_HOOK_SHOW_HELPER, ec))
{
ELOGF("COMP", "show_helper. intercepted", cw->ec);
return;
}
+ /* Debug logging */
ELOGF("COMP", "show_helper. cw(v:%d,a:%d,dh:%d,ct:%d,u:%p,s(%d,%d)), ec(i:%d(%d,%d),o:%d,g:%d,n:%d)", ec,
cw->visible, cw->animating, cw->defer_hide, cw->content_type, cw->updates, cw->w, cw->h,
ec->iconic, ec->exp_iconify.by_client, ec->exp_iconify.type, ec->input_only, ec->ignored, ec->new_client);
+ /* Handle already visible state */
if (cw->visible)
{
if (ec->iconic && cw->animating)
{
- /* triggered during iconify animation */
e_comp_object_signal_emit(cw->smart_obj, "e,action,uniconify", "e");
cw->defer_hide = 0;
}
ELOGF("COMP", "show_helper. return. already cw->visible", ec);
return;
}
+
+ /* Handle external image/edje content type */
if (cw->content_type == E_COMP_OBJECT_CONTENT_TYPE_EXT_IMAGE ||
cw->content_type == E_COMP_OBJECT_CONTENT_TYPE_EXT_EDJE)
{
if (!ec->iconic)
e_client_focus_defer_set(ec);
-
return;
}
+
+ /* Initialize update tiler */
if ((!cw->updates) && (!ec->input_only) && (!ec->ignored))
{
int pw, ph;
+ pw = ec->client.w;
+ ph = ec->client.h;
- pw = ec->client.w, ph = ec->client.h;
if ((!pw) || (!ph))
if (!e_pixmap_size_get(ec->pixmap, &pw, &ph))
{
return;
}
}
+
+ /* Tile tiler setup and special cases handling */
if (cw->updates)
eina_tiler_tile_size_set(cw->updates, 1, 1);
+
if (ec->new_client)
{
- /* ignore until client idler first run */
ec->changes.visible = !ec->hidden;
ec->visible = 1;
EC_CHANGED(ec);
ELOGF("COMP", "show_helper. return. new_client", ec);
return;
}
+
if (ec->input_only)
{
- /* who cares */
cw->real_hid = 0;
evas_object_move(cw->smart_obj, ec->x, ec->y);
evas_object_resize(cw->smart_obj, ec->w, ec->h);
evas_object_show(cw->smart_obj);
return;
}
+
+ /* DnD related handling */
comp_wl = e_comp_wl_get();
if (ec->netwm.type == E_WINDOW_TYPE_DND && !comp_wl->drag_client)
{
- /* start_drag not received */
ec->changes.visible = 1;
ec->visible = 1;
EC_CHANGED(ec);
ELOGF("COMP", "show_helper. return. start_drag not received yet", ec);
return;
}
- /* re-set geometry */
+
+ /* Set object geometry */
evas_object_move(cw->smart_obj, ec->x, ec->y);
- /* force resize in case it hasn't happened yet, or just to update size */
evas_object_resize(cw->smart_obj, ec->w, ec->h);
+
if ((cw->w < 1) || (cw->h < 1))
{
- /* if resize didn't go through, try again */
ec->visible = ec->changes.visible = 1;
EC_CHANGED(ec);
ELOGF("COMP", "show_helper. return. cw_size(%d,%d)", ec, cw->w, cw->h);
return;
}
- /* if pixmap not available, clear pixmap since we're going to fetch it again */
+
+ /* Handle pixmap */
if (!e_pixmap_size_get(ec->pixmap, &w, &h))
e_pixmap_clear(ec->pixmap);
+ /* Handle object display */
if (cw->real_hid && w && h)
{
cw->real_hid = 0;
- /* force comp theming in case it didn't happen already */
e_comp_object_frame_theme_set(cw->smart_obj, E_COMP_OBJECT_FRAME_RESHADOW);
if (comp->image_filter != E_COMP_IMAGE_FILTER_NONE)
e_comp_object_image_filter_set(cw->smart_obj, comp->image_filter);
}
- /* only do the show if show is allowed */
+ /* Execute object display */
if (!cw->real_hid)
{
- if (ec->internal) //internal clients render when they feel like it
+ if (ec->internal)
e_comp_object_damage(cw->smart_obj, 0, 0, cw->w, cw->h);
- if (!e_client_is_iconified_by_client(ec)||
+ if (!e_client_is_iconified_by_client(ec) ||
e_policy_visibility_client_is_uniconic(ec))
{
if (e_comp->image_filter != E_COMP_IMAGE_FILTER_NONE)
e_comp_canvas_render_delayed_unset(e_comp_get());
- /* if comp object is shown in idle enterer before(E_CLIENT_HOOK_EVAL_FETCH),
- it is rendered in idle callback without native surface and
- compositor shows an empty frame if other objects aren't shown
- because job callback of e_comp called at the next loop.
- it causes a visual defect when windows are switched.
- */
if (cw->redirected)
{
e_comp_object_damage(cw->smart_obj, 0, 0, cw->w, cw->h);
E_Input_Rect_Smart_Data *input_rect_sd;
int tw, th;
- if (ec->ignored) return;
-
+ /* Basic validation */
+ if (!ec || ec->ignored) return;
comp = e_comp_get();
+
+ /* Handle already existing effect object */
if (cw->effect_obj)
{
- //INF("SHOW2 %p", ec);
_e_comp_intercept_show_helper(cw, comp);
return;
}
- //INF("SHOW %p", ec);
+
+ /* Handle input-only object */
if (ec->input_only)
{
cw->effect_obj = evas_object_rectangle_add(comp->evas);
evas_object_smart_member_add(cw->effect_obj, cw->smart_obj);
evas_object_name_set(cw->effect_obj, "cw->effect_obj::input_only");
}
+ /* General object handling */
else
{
+ /* Verify external content object */
if ((!cw->obj) && (cw->external_content))
{
ERR("cw->obj for external content is not created! ec:%p", cw->ec);
return;
}
+ /* Set up object */
_e_comp_object_setup(cw, comp);
+
+ /* Create image object and set it */
if (!cw->obj)
{
cw->content_type = E_COMP_OBJECT_CONTENT_TYPE_INT_IMAGE;
evas_object_intercept_color_set_callback_add(cw->obj, _e_comp_intercept_obj_color_set, cw);
evas_object_pass_events_set(cw->obj, EINA_TRUE);
}
- _e_comp_object_alpha_set(cw);
+ /* Set alpha value and redirection settings */
+ _e_comp_object_alpha_set(cw);
cw->redirected = 1;
- evas_object_color_set(cw->clip, ec->netwm.opacity, ec->netwm.opacity, ec->netwm.opacity, ec->netwm.opacity);
+ evas_object_color_set(cw->clip, ec->netwm.opacity, ec->netwm.opacity,
+ ec->netwm.opacity, ec->netwm.opacity);
}
+ /* Set effect object geometry */
_e_comp_object_map_transform_rect(cw->ec, 0, 0, cw->w, cw->h, NULL, NULL, &tw, &th);
evas_object_geometry_set(cw->effect_obj, cw->x, cw->y, tw, th);
+
+ /* Handle input area object */
if (cw->input_obj)
{
input_rect_sd = evas_object_smart_data_get(cw->input_obj);
if (input_rect_data->obj)
{
evas_object_geometry_set(input_rect_data->obj,
- cw->x + input_rect_data->rect.x,
- cw->y + input_rect_data->rect.y,
- input_rect_data->rect.w, input_rect_data->rect.h);
+ cw->x + input_rect_data->rect.x,
+ cw->y + input_rect_data->rect.y,
+ input_rect_data->rect.w,
+ input_rect_data->rect.h);
}
}
}
}
+ /* Resize mask object */
if (cw->mask.obj)
evas_object_resize(cw->mask.obj, cw->w, cw->h);
+ /* Execute object display */
_e_comp_intercept_show_helper(cw, comp);
}
_e_comp_intercept_focus(void *data, Evas_Object *obj, Eina_Bool focus)
{
E_Comp_Object *cw = data;
- E_Client *ec;
- E_Zone *zone;
+ E_Client *ec = cw->ec;
+ E_Zone *zone = e_comp_zone_find_by_ec(ec);
- ec = cw->ec;
- zone = e_comp_zone_find_by_ec(ec);
+ /* Basic validation */
if (!zone)
{
ERR("intercept_focus:: zone is NULL");
zone = e_zone_current_get();
}
- /* note: this is here as it seems there are enough apps that do not even
- * expect us to emulate a look of focus but not actually set x input
- * focus as we do - so simply abort any focus set on such windows */
- /* be strict about accepting focus hint */
- /* be strict about accepting focus hint */
- if ((!ec->icccm.accepts_focus) &&
- (!ec->icccm.take_focus))
+
+ /* Check focus acceptance */
+ if ((!ec->icccm.accepts_focus) && (!ec->icccm.take_focus))
{
if (!focus)
{
}
return;
}
- if (focus && ec->lock_focus_out) return;
- if (e_object_is_del(E_OBJECT(ec)) && focus)
- CRI("CAN'T FOCUS DELETED CLIENT! ec:%p", ec);
- /* filter focus setting based on current state */
+ /* Check focus lock and deleted object */
+ if (focus)
+ {
+ if (ec->lock_focus_out) return;
+ if (e_object_is_del(E_OBJECT(ec)))
+ CRI("CAN'T FOCUS DELETED CLIENT! ec:%p", ec);
+ }
+
+ /* Filter focus state */
if (focus)
{
+ /* Already focused */
if (ec->focused)
{
ELOGF("FOCUS", "FOCUS SET | evas_object(%p) (frame:%p)", ec, obj, ec->frame);
evas_object_focus_set(obj, focus);
return;
}
+
+ /* Iconified */
if ((ec->iconic) && (!ec->deskshow))
{
if (!e_policy_visibility_client_is_uniconify_render_running(ec))
{
- /* don't focus an iconified window. that's silly! */
ELOGF("FOCUS", "Do uniconify to set focus", ec);
e_client_uniconify(ec);
e_client_focus_latest_set(ec);
return;
}
}
- if (!ec->visible)
- {
- return;
- }
+
+ /* Not visible */
+ if (!ec->visible) return;
}
+ /* Set focus settings */
if (focus)
{
- /* check for modal child and set focus to modal child */
+ /* Handle modal child window */
E_Client *modal_child = e_client_modal_child_get(ec);
if ((modal_child) && (modal_child != ec) &&
(!e_client_is_iconified_by_client(modal_child)) &&
(modal_child->visible) && (!e_object_is_del(E_OBJECT(modal_child))))
{
- // add ec to latest focus stack
e_client_focus_latest_set(ec);
-
- ELOGF("FOCUS", "FOCUS SET to MODAL (ec:%p, win:0x%08zx, frame:%p)", ec, modal_child, e_client_util_win_get(modal_child), modal_child->frame);
- // FIXME : check why the modal_child should use evas_object_focus_set
- //e_client_focused_set(modal_child);
+ ELOGF("FOCUS", "FOCUS SET to MODAL (ec:%p, win:0x%08zx, frame:%p)",
+ ec, modal_child, e_client_util_win_get(modal_child), modal_child->frame);
evas_object_focus_set(modal_child->frame, focus);
return;
}
+
+ /* Not yet visible */
if (!cw->visible)
{
- /* not yet visible, wait till the next time... */
ec->want_focus = !ec->hidden;
if (ec->want_focus)
EC_CHANGED(ec);
return;
}
+
+ /* Set focus */
e_zone_focused_client_set(zone, ec);
}
else
{
+ /* Release focus */
if (e_zone_focused_client_get(zone) == ec)
e_zone_focused_client_set(zone, NULL);
}
+ /* Log and set focus */
if (focus)
ELOGF("FOCUS", "FOCUS SET | evas_object(%p) (frame:%p)", ec, obj, ec->frame);
else
ELOGF("FOCUS", "FOCUS UNSET | evas_object(%p) (frame:%p)", ec, obj, ec->frame);
+ /* Default zone check */
if (e_comp_default_zone_get(e_comp_get()) != zone)
{
- // FIXME: in evas_focus, the seat accepts only one focused eo.
- // please find other way to set focus to evas object
ELOGF("FOCUS", "FOCUS SKIP | Did not set focus because zone isn't default zone.", ec);
return;
}
_e_comp_input_obj_smart_add(Evas_Object *obj)
{
E_Input_Rect_Smart_Data *input_rect_sd;
- input_rect_sd = E_NEW(E_Input_Rect_Smart_Data, 1);
+ /* 1. Allocate smart data */
+ input_rect_sd = E_NEW(E_Input_Rect_Smart_Data, 1);
if (!input_rect_sd) return;
+
+ /* 2. Set smart data */
evas_object_smart_data_set(obj, input_rect_sd);
}
E_Input_Rect_Smart_Data *input_rect_sd;
E_Input_Rect_Data *input_rect_data;
+ /* 1. Verify smart data validity */
input_rect_sd = evas_object_smart_data_get(obj);
if (!input_rect_sd) return;
+ /* 2. Clean up input area data list */
EINA_LIST_FREE(input_rect_sd->input_rect_data_list, input_rect_data)
{
- if (input_rect_data->obj)
- {
- evas_object_smart_member_del(input_rect_data->obj);
- E_FREE_FUNC(input_rect_data->obj, evas_object_del);
- }
+ if (!input_rect_data->obj) goto free_data;
+
+ /* 2.1 Clean up input area object */
+ evas_object_smart_member_del(input_rect_data->obj);
+ E_FREE_FUNC(input_rect_data->obj, evas_object_del);
+
+free_data:
+ /* 2.2 Free input area data memory */
E_FREE(input_rect_data);
}
+
+ /* 3. Free smart data memory */
E_FREE(input_rect_sd);
}
E_Input_Rect_Data *input_rect_data;
Eina_List *l;
+ /* 1. Verify smart data validity */
input_rect_sd = evas_object_smart_data_get(obj);
if (!input_rect_sd) return;
+ /* 2. Update input area object position */
EINA_LIST_FOREACH(input_rect_sd->input_rect_data_list, l, input_rect_data)
{
- if (input_rect_data->obj)
- {
- evas_object_geometry_set(input_rect_data->obj,
- x + input_rect_data->rect.x,
- y + input_rect_data->rect.y,
- input_rect_data->rect.w, input_rect_data->rect.h);
- }
+ if (!input_rect_data->obj) continue;
+
+ /* 2.1 Set input area object geometry */
+ evas_object_geometry_set(input_rect_data->obj,
+ x + input_rect_data->rect.x,
+ y + input_rect_data->rect.y,
+ input_rect_data->rect.w,
+ input_rect_data->rect.h);
}
}
Eina_List *l;
E_Comp_Object *cw;
+ /* 1. Verify smart data validity */
input_rect_sd = evas_object_smart_data_get(obj);
if (!input_rect_sd) return;
+ /* 2. Reference composite object */
cw = input_rect_sd->cw;
+ if (!cw) return;
+
+ /* 3. Resize input area object */
EINA_LIST_FOREACH(input_rect_sd->input_rect_data_list, l, input_rect_data)
{
- if (input_rect_data->obj)
- {
- evas_object_geometry_set(input_rect_data->obj,
- cw->x + input_rect_data->rect.x,
- cw->y + input_rect_data->rect.y,
- input_rect_data->rect.w, input_rect_data->rect.h);
- }
+ if (!input_rect_data->obj) continue;
+
+ /* 3.1 Set input area object geometry */
+ evas_object_geometry_set(input_rect_data->obj,
+ cw->x + input_rect_data->rect.x,
+ cw->y + input_rect_data->rect.y,
+ input_rect_data->rect.w,
+ input_rect_data->rect.h);
}
}
E_Input_Rect_Data *input_rect_data;
Eina_List *l;
+ /* 1. Verify smart data validity */
input_rect_sd = evas_object_smart_data_get(obj);
if (!input_rect_sd) return;
+ /* 2. Handle input area object display */
EINA_LIST_FOREACH(input_rect_sd->input_rect_data_list, l, input_rect_data)
{
- if (input_rect_data->obj)
- {
- evas_object_show(input_rect_data->obj);
- }
+ /* 2.1 Verify input area object validity */
+ if (!input_rect_data->obj) continue;
+
+ /* 2.2 Display input area object */
+ evas_object_show(input_rect_data->obj);
}
}
E_Input_Rect_Data *input_rect_data;
Eina_List *l;
+ /* 1. Verify smart data validity */
input_rect_sd = evas_object_smart_data_get(obj);
if (!input_rect_sd) return;
+ /* 2. Hide input area object */
EINA_LIST_FOREACH(input_rect_sd->input_rect_data_list, l, input_rect_data)
{
- if (input_rect_data->obj)
- {
- evas_object_hide(input_rect_data->obj);
- }
+ /* 2.1 Verify input area object validity */
+ if (!input_rect_data->obj) continue;
+
+ /* 2.2 Hide input area object */
+ evas_object_hide(input_rect_data->obj);
}
}
TRACE_DS_BEGIN(COMP:SMART HIDE);
INTERNAL_ENTRY;
+
+ /* 1. Set default state */
cw->visible = 0;
cw->hiding = 0;
+
+ /* 2. Hide object */
evas_object_hide(cw->clip);
if (cw->input_obj) evas_object_hide(cw->input_obj);
evas_object_hide(cw->effect_obj);
if (cw->default_input_obj) evas_object_hide(cw->default_input_obj);
if (cw->transform_bg_obj) evas_object_hide(cw->transform_bg_obj);
if (cw->transform_tranp_obj) evas_object_hide(cw->transform_tranp_obj);
+
+ /* 3. Handle shutdown */
if (stopping)
{
TRACE_DS_END();
return;
}
- /* unset native surface if current displaying buffer was destroyed */
+ /* 4. Handle native surface */
if (!cw->buffer_destroy_listener.notify)
{
Evas_Native_Surface *ns;
_e_comp_object_native_surface_set(cw, NULL, EINA_TRUE);
}
+ /* 5. Handle effect object */
if (!cw->ec->input_only)
{
edje_object_freeze(cw->effect_obj);
edje_object_play_set(cw->shobj, 0);
}
+ /* 6. Update render queue */
e_comp_render_queue(); //force nocomp recheck
TRACE_DS_END();
_e_comp_smart_show(Evas_Object *obj)
{
INTERNAL_ENTRY;
+
+ /* 1. Set default state */
cw->defer_hide = 0;
cw->visible = 1;
+
+ /* 2. Verify size validity */
if ((cw->w < 0) || (cw->h < 0))
- CRI("ACK! ec:%p", cw->ec);
+ {
+ CRI("ACK! ec:%p", cw->ec);
+ return;
+ }
TRACE_DS_BEGIN(COMP:SMART SHOW);
+ /* 3. Update map */
e_comp_object_map_update(obj);
+ /* 4. Handle object display */
evas_object_show(cw->clip);
if (cw->input_obj) evas_object_show(cw->input_obj);
if (!cw->ec->input_only)
if (cw->transform_bg_obj) evas_object_show(cw->transform_bg_obj);
if (cw->transform_tranp_obj) evas_object_show(cw->transform_tranp_obj);
if (cw->default_input_obj) evas_object_show(cw->default_input_obj);
+
+ /* 5. Update rendering queue */
e_comp_render_queue();
+
+ /* 6. Handle input-only object */
if (cw->ec->input_only)
{
TRACE_DS_END();
return;
}
+
+ /* 7. Handle iconified object */
if (cw->ec->iconic && (!cw->ec->new_client))
{
if (e_client_is_iconified_by_client(cw->ec))
e_comp_object_signal_emit(cw->smart_obj, "e,action,uniconify", "e");
}
+ /* 8. Handle normal object */
else if (!cw->showing) /* if set, client was ec->hidden during show animation */
{
cw->showing = 1;
_e_comp_object_animating_begin(cw);
}
- /* ensure some random effect doesn't lock the client offscreen */
+ /* 9. Check animation state */
if (!cw->animating)
{
cw->showing = 0;
e_comp_object_effect_set(obj, NULL);
}
+ /* 10. Update dimensions */
_e_comp_object_dim_update(cw);
TRACE_DS_END();
_e_comp_smart_del(Evas_Object *obj)
{
Eina_List *l;
+ E_Comp *comp;
INTERNAL_ENTRY;
+ /* 1. Clean up buffer listener */
if (cw->buffer_destroy_listener.notify)
{
wl_list_remove(&cw->buffer_destroy_listener.link);
cw->buffer_destroy_listener.notify = NULL;
}
+ /* 2. Clean up TBM surface */
if (cw->tbm_surface)
{
tbm_surface_internal_unref(cw->tbm_surface);
cw->tbm_surface = NULL;
}
+ /* 3. Clean up render update lock */
if (cw->render_update_lock.buffer_ref.buffer)
{
ELOGF("COMP", "Clear buffer_ref of render_update_lock:%d",
e_comp_wl_buffer_reference(&cw->render_update_lock.buffer_ref, NULL);
}
+ /* 4. Clean up update related resources */
e_comp_object_render_update_del(cw->smart_obj);
E_FREE_FUNC(cw->updates, eina_tiler_free);
E_FREE_FUNC(cw->pending_updates, eina_tiler_free);
free(cw->ns);
+ /* 5. Clean up mirror objects */
if (cw->obj_mirror)
{
Evas_Object *o;
-
EINA_LIST_FREE(cw->obj_mirror, o)
{
evas_object_image_data_set(o, NULL);
evas_object_del(o);
}
}
+
+ /* 6. Clean up pending delete objects */
l = evas_object_data_get(obj, "comp_object-to_del");
E_FREE_LIST(l, evas_object_del);
+
+ /* 7. Clean up event callbacks */
_e_comp_object_mouse_event_callback_unset(cw);
+
+ /* 8. Clean up Evas objects */
evas_object_del(cw->clip);
evas_object_del(cw->obj);
evas_object_del(cw->shobj);
evas_object_del(cw->transform_bg_obj);
evas_object_del(cw->transform_tranp_obj);
evas_object_del(cw->default_input_obj);
+
+ /* 9. Clean up string shared resources */
eina_stringshare_del(cw->frame_theme);
eina_stringshare_del(cw->frame_name);
+
+ /* 10. Clean up animation state */
if (cw->animating)
{
- E_Comp *comp = e_comp_get();
-
+ comp = e_comp_get();
cw->animating = 0;
comp->animating--;
UNREFD(cw->ec, 2);
e_object_unref(E_OBJECT(cw->ec));
}
+
+ /* 11. Clean up client frame */
cw->ec->frame = NULL;
+
+ /* 12. Handle input thread */
if (e_input_thread_check_client_cloning_needed())
{
E_Input_Thread_Request_EClient_Data ec_data;
e_input_backend_thread_safe_call(_e_comp_object_input_thread_frame_set, &ec_data, sizeof(E_Input_Thread_Request_EClient_Data));
}
+ /* 13. Free memory */
free(cw);
}
static void
_e_comp_smart_resize(Evas_Object *obj, int w, int h)
{
- Eina_Bool first = EINA_FALSE;
- int tw, th;
+ Eina_Bool first;
+ int tw, th, ww, hh, pw, ph;
INTERNAL_ENTRY;
- if (!cw->effect_obj) CRI("ACK! ec:%p", cw->ec);
+ /* 1. Basic validation */
+ if (!cw->effect_obj)
+ {
+ CRI("ACK! ec:%p", cw->ec);
+ return;
+ }
TRACE_DS_BEGIN(COMP:SMART RESIZE);
+ /* 2. Calculate size transformation */
_e_comp_object_map_transform_rect(cw->ec, 0, 0, w, h, NULL, NULL, &tw, &th);
+ /* 3. Update map */
if (cw->w != w || cw->h != h)
e_comp_object_map_update(obj);
+ /* 4. Check and update size state */
first = ((cw->w < 1) || (cw->h < 1));
- cw->w = w, cw->h = h;
-
- int ww, hh, pw, ph;
-
- ww = w, hh = h;
+ cw->w = w;
+ cw->h = h;
+ ww = w;
+ hh = h;
- /* verify pixmap:object size */
+ /* 5. Validate pixmap size */
if (e_pixmap_size_get(cw->ec->pixmap, &pw, &ph) && (!cw->ec->override))
{
if ((ww != pw) || (hh != ph))
ELOGF("COMP", "CW RSZ: %dx%d || PX: %dx%d.", cw->ec, ww, hh, pw, ph);
}
+
+ /* 6. Resize objects */
evas_object_resize(cw->effect_obj, tw, th);
evas_object_resize(cw->default_input_obj, w, h);
if (cw->input_obj)
evas_object_resize(cw->input_obj, w, h);
if (cw->mask.obj)
evas_object_resize(cw->mask.obj, w, h);
- /* resize render update tiler */
+
+ /* 7. Handle render update tiler */
if (!first)
{
RENDER_DEBUG("DAMAGE UNFULL: %p", cw->ec);
if (cw->updates) eina_tiler_area_size_set(cw->updates, cw->ec->client.w, cw->ec->client.h);
}
+ /* 8. Check visibility and update render queue */
if (!cw->visible)
{
TRACE_DS_END();
{
Evas_Object *o;
E_Comp_Object *cw;
+ E_Input_Thread_Request_EClient_Data ec_data;
+ /* 1. Basic validation */
EINA_SAFETY_ON_NULL_RETURN_VAL(ec, NULL);
if (ec->frame) return NULL;
+
+ /* 2. Smart object initialization and creation */
_e_comp_smart_init();
o = evas_object_smart_add(e_comp_evas_get(), _e_comp_smart);
+ if (!o) return NULL;
+
+ /* 3. Verify smart data */
cw = evas_object_smart_data_get(o);
if (!cw)
{
evas_object_del(o);
return NULL;
}
+
+ /* 4. Set object data */
evas_object_data_set(o, "E_Client", ec);
cw->ec = ec;
ec->frame = o;
evas_object_data_set(o, "comp_object", (void*)1);
+ /* 5. Set event handlers */
_e_comp_object_event_add(o);
+ /* 6. Handle input thread */
if (e_input_thread_check_client_cloning_needed())
{
- E_Input_Thread_Request_EClient_Data ec_data;
memset(&ec_data, 0, sizeof(E_Input_Thread_Request_EClient_Data));
ec_data.ec = ec;
ec_data.frame = ec->frame;
Evas_Object *o;
SOFT_ENTRY(NULL);
- /* FIXME: remove this when eo is used */
+
+ /* 1. Verify smart object */
o = evas_object_data_get(obj, "comp_smart_obj");
if (o)
return e_comp_object_client_get(o);
+
+ /* 2. Return client */
return cw ? cw->ec : NULL;
}
E_Input_Rect_Data *input_rect_data;
E_Input_Rect_Smart_Data *input_rect_sd;
+ /* 1. Verify input object validity */
if (!cw->input_obj)
return;
+ /* 2. Verify smart data validity */
input_rect_sd = evas_object_smart_data_get(cw->input_obj);
- if (!input_rect_sd) return;
+ if (!input_rect_sd)
+ return;
+ /* 3. Clean up input area data list */
EINA_LIST_FREE(input_rect_sd->input_rect_data_list, input_rect_data)
{
if (input_rect_data->obj)
E_Input_Rect_Smart_Data *input_rect_sd;
int client_w, client_h;
- if (cw->ec->client.w)
- client_w = cw->ec->client.w;
- else
- client_w = cw->ec->w;
-
- if (cw->ec->client.h)
- client_h = cw->ec->client.h;
- else
- client_h = cw->ec->h;
+ /* 1. Calculate client size */
+ client_w = cw->ec->client.w ? cw->ec->client.w : cw->ec->w;
+ client_h = cw->ec->client.h ? cw->ec->client.h : cw->ec->h;
+ /* 2. Clip input area */
E_RECTS_CLIP_TO_RECT(x, y, w, h, 0, 0, client_w, client_h);
+ /* 3. Initialize input object */
if (!cw->input_obj)
{
_e_comp_input_obj_smart_init();
cw->input_obj = evas_object_smart_add(e_comp_evas_get(), _e_comp_input_obj_smart);
evas_object_smart_member_add(cw->input_obj, cw->smart_obj);
input_rect_sd = evas_object_smart_data_get(cw->input_obj);
-
- if (input_rect_sd)
- input_rect_sd->cw = cw;
+ if (!input_rect_sd)
+ return;
+ input_rect_sd->cw = cw;
}
+ /* 4. Verify smart data */
input_rect_sd = evas_object_smart_data_get(cw->input_obj);
- if (input_rect_sd)
- {
- input_rect_data = E_NEW(E_Input_Rect_Data, 1);
- if (input_rect_data)
- {
- EINA_RECTANGLE_SET(&input_rect_data->rect, x, y, w, h);
- input_rect_sd->input_rect_data_list = eina_list_append(input_rect_sd->input_rect_data_list, input_rect_data);
- }
- }
+ if (!input_rect_sd)
+ return;
+
+ /* 5. Create input area data */
+ input_rect_data = E_NEW(E_Input_Rect_Data, 1);
+ if (!input_rect_data)
+ return;
+
+ /* 6. Set input area data */
+ EINA_RECTANGLE_SET(&input_rect_data->rect, x, y, w, h);
+ input_rect_sd->input_rect_data_list = eina_list_append(input_rect_sd->input_rect_data_list, input_rect_data);
- if ((input_rect_data) &&
- (x || y || (w != cw->ec->client.w) || (h != cw->ec->client.h)))
+ /* 7. Create input area object and set it */
+ /* 7. 입력 영역 객체 생성 및 설정 */
+ if (x || y || (w != cw->ec->client.w) || (h != cw->ec->client.h))
{
input_rect_data->obj = evas_object_rectangle_add(e_comp_evas_get());
evas_object_name_set(input_rect_data->obj, "cw->input_obj");
E_Input_Rect_Data *input_rect_data;
Eina_List *l;
- if (!cw->input_obj) return;
+ /* 1. 입력 객체 유효성 검사 */
+ if (!cw->input_obj)
+ return;
+ /* 2. 스마트 데이터 유효성 검사 */
input_rect_sd = evas_object_smart_data_get(cw->input_obj);
- if (input_rect_sd)
+ if (!input_rect_sd)
+ return;
+
+ /* 3. 입력 영역 데이터 리스트 처리 */
+ EINA_LIST_FOREACH(input_rect_sd->input_rect_data_list, l, input_rect_data)
{
- EINA_LIST_FOREACH(input_rect_sd->input_rect_data_list, l, input_rect_data)
- {
- *list = eina_list_append(*list, &input_rect_data->rect);
- }
+ *list = eina_list_append(*list, &input_rect_data->rect);
}
}
int tw, th;
API_ENTRY;
- if (cw->ec->input_only || (!cw->updates)) return;
+ /* 1. 기본 유효성 검사 */
+ if (cw->ec->input_only || (!cw->updates))
+ return;
+ /* 2. 오버레이 상태 확인 및 HWC 업데이트 처리 */
if (e_comp_is_on_overlay(cw->ec))
{
- /* It will not set hwc_need_update value if E modules already cleanup pixmap
- * resource on the E_COMP_WL_HOOK_BUFFER_CHANGE hook function. It means that
- * E module attempts to block screen update due to the particular policy.
- */
if (e_pixmap_resource_get(cw->ec->pixmap))
cw->hwc_need_update = EINA_TRUE;
}
- /* ignore overdraw */
+ /* 3. 전체 업데이트 상태 확인 */
if (cw->updates_full)
{
RENDER_DEBUG("IGNORED %p: %d,%d %dx%d", cw->ec, x, y, w, h);
e_comp_object_render_update_add(obj);
-
if ((cw->ec->visible) && (!evas_object_visible_get(cw->smart_obj)) && (!cw->ec->iconic))
evas_object_show(cw->smart_obj);
-
return;
}
- /* clip rect to client surface */
+
+ /* 4. 클라이언트 영역에 맞게 클리핑 */
RENDER_DEBUG("DAMAGE(%d,%d %dx%d) CLIP(%dx%d)", x, y, w, h, cw->ec->client.w, cw->ec->client.h);
E_RECTS_CLIP_TO_RECT(x, y, w, h, 0, 0, cw->ec->client.w, cw->ec->client.h);
- /* if rect is the total size of the client after clip, clear the updates
- * since this is guaranteed to be the whole region anyway
- */
+
+ /* 5. 타일러 영역 크기 조정 */
eina_tiler_area_size_get(cw->updates, &tw, &th);
if ((w > tw) || (h > th))
{
{
API_ENTRY;
- if (cw->ec->input_only || (!cw->updates) || (!cw->redirected)) return;
- if (cw->render_update_lock.lock) return;
- if (!e_pixmap_usable_get(cw->ec->pixmap)) return;
+ /* 1. 기본 유효성 검사 */
+ if (cw->ec->input_only || (!cw->updates) || (!cw->redirected))
+ return;
+
+ /* 2. 렌더 업데이트 잠금 상태 확인 */
+ if (cw->render_update_lock.lock)
+ return;
+
+ /* 3. 픽스맵 사용 가능 여부 확인 */
+ if (!e_pixmap_usable_get(cw->ec->pixmap))
+ return;
+
+ /* 4. 업데이트 상태 확인 및 처리 */
if (!cw->update)
{
E_Comp *comp = e_comp_get();
-
cw->update = 1;
comp->updates = eina_list_append(comp->updates, cw->ec);
}
+
+ /* 5. 렌더링 큐에 추가 */
e_comp_render_queue();
}
E_Comp *comp;
API_ENTRY;
- if (cw->ec->input_only || (!cw->updates)) return;
- if (!cw->update) return;
+ /* 1. 기본 유효성 검사 */
+ if (cw->ec->input_only || (!cw->updates))
+ return;
+
+ /* 2. 업데이트 상태 검사 */
+ if (!cw->update)
+ return;
+
+ /* 3. 업데이트 플래그 초기화 */
cw->update = 0;
comp = e_comp_get();
- /* this gets called during comp animating to clear the update flag */
- if (comp->grabbed) return;
+
+ /* 4. 컴포지터 그랩 상태 검사 */
+ if (comp->grabbed)
+ return;
+
+ /* 5. 업데이트 리스트 처리 */
comp->updates = eina_list_remove(comp->updates, cw->ec);
if (!comp->updates)
{
+ /* 6. 업데이트 작업 정리 */
E_FREE_FUNC(comp->update_job, ecore_job_del);
if (comp->render_animator)
ecore_animator_freeze(comp->render_animator);
int w, h, px, py;
API_ENTRY;
- if (!cw->ec) return; //NYI
- if (cw->external_content) return;
+
+ /* 1. 기본 유효성 검사 */
+ if (!cw->ec)
+ return;
+
+ if (cw->external_content)
+ return;
+
+ /* 2. 형상 검사 */
if (cw->ec->shaped)
{
if ((cw->ec->shape_rects_num >= 1) &&
(!_e_comp_shaped_check(cw->ec->client.w, cw->ec->client.h, cw->ec->shape_rects, cw->ec->shape_rects_num)))
- return;
+ return;
}
+
+ /* 3. 네이티브 서피스 검사 */
if (cw->native)
{
ERR("BUGGER: shape with native surface? cw=%p", cw);
return;
}
+
+ /* 4. 크기 유효성 검사 */
evas_object_image_size_get(cw->obj, &w, &h);
- if ((w < 1) || (h < 1)) return;
+ if ((w < 1) || (h < 1))
+ return;
+ /* 5. 형상이 있는 경우 네이티브 서피스 설정 */
if (cw->ec->shaped)
_e_comp_object_native_surface_set(cw, NULL, EINA_TRUE);
+
+ /* 6. 알파 설정 */
_e_comp_object_alpha_set(cw);
EINA_LIST_FOREACH(cw->obj_mirror, l, o)
- evas_object_image_alpha_set(o, 1);
+ evas_object_image_alpha_set(o, 1);
+ /* 7. 픽셀 데이터 가져오기 */
p = pix = evas_object_image_data_get(cw->obj, 1);
if (!pix)
{
evas_object_image_data_set(cw->obj, pix);
return;
}
+
+ /* 8. 형상 처리 */
if (cw->ec->shaped)
{
unsigned char *spix, *sp;
spix = calloc(w * h, sizeof(unsigned char));
- if (!spix) return;
+ if (!spix)
+ return;
+
+ /* 8-1. 형상 영역 채우기 */
for (i = 0; i < cw->ec->shape_rects_num; i++)
{
int rx, ry, rw, rh;
- rx = cw->ec->shape_rects[i].x; ry = cw->ec->shape_rects[i].y;
- rw = cw->ec->shape_rects[i].w; rh = cw->ec->shape_rects[i].h;
+ rx = cw->ec->shape_rects[i].x;
+ ry = cw->ec->shape_rects[i].y;
+ rw = cw->ec->shape_rects[i].w;
+ rh = cw->ec->shape_rects[i].h;
E_RECTS_CLIP_TO_RECT(rx, ry, rw, rh, 0, 0, w, h);
sp = spix + (w * ry) + rx;
for (py = 0; py < rh; py++)
{
for (px = 0; px < rw; px++)
{
- *sp = 0xff; sp++;
+ *sp = 0xff;
+ sp++;
}
sp += w - rw;
}
}
+
+ /* 8-2. 마스크 적용 */
sp = spix;
for (py = 0; py < h; py++)
{
imask |= imask >> 8;
imask |= imask >> 8;
*p = mask | (*p & imask);
- //if (*sp) *p = 0xff000000 | *p;
- //else *p = 0x00000000;
sp++;
p++;
}
}
free(spix);
}
- else
- {
- for (py = 0; py < h; py++)
- {
- for (px = 0; px < w; px++)
- *p |= 0xff000000;
- }
- }
- evas_object_image_data_set(cw->obj, pix);
- evas_object_image_data_update_add(cw->obj, 0, 0, w, h);
- EINA_LIST_FOREACH(cw->obj_mirror, l, o)
- {
- evas_object_image_data_set(o, pix);
- evas_object_image_data_update_add(o, 0, 0, w, h);
- }
-// don't need to fix alpha chanel as blending
-// should be totally off here regardless of
-// alpha channel content
-}
-
-static void
-_e_comp_object_clear(E_Comp_Object *cw)
-{
- Eina_List *l;
- Evas_Object *o;
-
- EINA_SAFETY_ON_NULL_RETURN(cw->ec);
-
- if (cw->render_update_lock.lock) return;
-
- if (cw->ec->pixmap)
- e_pixmap_clear(cw->ec->pixmap);
- if (cw->native)
- _e_comp_object_native_surface_set(cw, NULL, EINA_TRUE);
- evas_object_image_size_set(cw->obj, 1, 1);
- evas_object_image_data_set(cw->obj, NULL);
- EINA_LIST_FOREACH(cw->obj_mirror, l, o)
- {
- evas_object_image_size_set(o, 1, 1);
- evas_object_image_data_set(o, NULL);
- }
- cw->native = 0;
- e_comp_object_render_update_del(cw->smart_obj);
-}
-
-static Eina_Bool
-_e_comp_object_transparent_set(Evas_Object *obj, Eina_Bool set)
-{
- int r, g, b, a;
-
- API_ENTRY EINA_FALSE;
-
- if (cw->transparent.set == set)
- return EINA_TRUE;
-
- if (set)
- {
- evas_object_color_get(obj, &r, &g, &b, &a);
-
- cw->transparent.user_r = r;
- cw->transparent.user_g = g;
- cw->transparent.user_b = b;
- cw->transparent.user_a = a;
-
- cw->transparent.setting = EINA_TRUE;
- evas_object_color_set(obj, 0, 0, 0, 0);
- cw->transparent.setting = EINA_FALSE;
-
- ELOGF("COMP", "Transparent enabled user_color(%d,%d,%d,%d)",
- cw->ec,
- cw->transparent.user_r,
- cw->transparent.user_g,
- cw->transparent.user_b,
- cw->transparent.user_a);
-
- cw->transparent.set = EINA_TRUE;
- }
- else
- {
- cw->transparent.set = EINA_FALSE;
-
- evas_object_color_set(obj,
- cw->transparent.user_r,
- cw->transparent.user_g,
- cw->transparent.user_b,
- cw->transparent.user_a);
-
- ELOGF("COMP", "Transparent disabled user_color(%d,%d,%d,%d)",
- cw->ec,
- cw->transparent.user_r,
- cw->transparent.user_g,
- cw->transparent.user_b,
- cw->transparent.user_a);
- }
-
- return EINA_TRUE;
-}
-
-/* helper function to simplify toggling of redirection for display servers which support it */
-EINTERN void
-e_comp_object_redirected_set(Evas_Object *obj, Eina_Bool set)
-{
- API_ENTRY;
-
- set = !!set;
- if (cw->redirected == set) return;
- cw->redirected = set;
- if (cw->external_content) return;
-
- e_comp_object_map_update(obj);
-
- if (set)
- {
- if (cw->updates_exist)
- e_comp_object_render_update_add(obj);
- else
- e_comp_object_damage(obj, 0, 0, cw->w, cw->h);
-
- _e_comp_object_transparent_set(obj, EINA_FALSE);
- }
- else
- {
- _e_comp_object_clear(cw);
- _e_comp_object_transparent_set(obj, EINA_TRUE);
- }
-}
-
-static void
-_e_comp_object_cb_buffer_destroy(struct wl_listener *listener, void *data EINA_UNUSED)
-{
- E_Comp_Object *cw;
- cw = container_of(listener, E_Comp_Object, buffer_destroy_listener);
-
- if (cw->buffer_destroy_listener.notify)
- {
- cw->buffer_destroy_listener.notify = NULL;
- wl_list_remove(&cw->buffer_destroy_listener.link);
- }
-
- if (e_object_is_del(E_OBJECT(cw->ec)))
- {
- if (!e_object_delay_del_ref_get(E_OBJECT(cw->ec)))
- return;
- }
- else
- {
- /* if it's current displaying buffer, do not remove its content */
- if (!evas_object_visible_get(cw->ec->frame))
- _e_comp_object_native_surface_set(cw, NULL, EINA_TRUE);
- }
-}
-
-static void
-_e_comp_object_native_surface_set(E_Comp_Object *cw, Evas_Native_Surface *ns, Eina_Bool with_mirror)
-{
- Eina_List *l;
- Evas_Object *o;
-
- if (cw->buffer_destroy_listener.notify)
- {
- wl_list_remove(&cw->buffer_destroy_listener.link);
- cw->buffer_destroy_listener.notify = NULL;
- }
-
- if (cw->tbm_surface)
- {
- tbm_surface_internal_unref(cw->tbm_surface);
- cw->tbm_surface = NULL;
- }
-
- if (ns)
- {
- if ((ns->type == EVAS_NATIVE_SURFACE_WL) && (ns->data.wl.legacy_buffer))
- {
- cw->buffer_destroy_listener.notify = _e_comp_object_cb_buffer_destroy;
- wl_resource_add_destroy_listener((struct wl_resource *)ns->data.wl.legacy_buffer, &cw->buffer_destroy_listener);
- }
- else if ((ns->type == EVAS_NATIVE_SURFACE_TBM) && (ns->data.tbm.buffer))
- {
- tbm_surface_internal_ref(ns->data.tbm.buffer);
- cw->tbm_surface = ns->data.tbm.buffer;
- }
- }
-
- TRACE_DS_BEGIN(NATIVE_SURFACE_SET);
- evas_object_image_native_surface_set(cw->obj, ns);
- TRACE_DS_END();
- if (with_mirror)
- {
- EINA_LIST_FOREACH(cw->obj_mirror, l, o)
- {
- evas_object_image_alpha_set(o, !!cw->ns ? 1 : cw->ec->argb);
- TRACE_DS_BEGIN(NATIVE_SURFACE_SET);
- evas_object_image_native_surface_set(o, ns);
- TRACE_DS_END();
- }
- }
-}
-
-EINTERN void
-e_comp_object_native_surface_set(Evas_Object *obj, Eina_Bool set)
-{
- Evas_Native_Surface ns;
-
- API_ENTRY;
- EINA_SAFETY_ON_NULL_RETURN(cw->ec);
- if (cw->ec->input_only) return;
- if (cw->external_content) return;
- if (cw->render_update_lock.lock) return;
- set = !!set;
-
- memset(&ns, 0, sizeof(Evas_Native_Surface));
-
- if (set)
- {
- /* native requires gl enabled, texture from pixmap enabled, and a non-shaped client */
- set = (!cw->ec->shaped);
- if (set)
- set = (!!cw->ns) || e_pixmap_native_surface_init(cw->ec->pixmap, &ns);
- }
- cw->native = set;
-
- _e_comp_object_native_surface_set(cw, set && (!cw->blanked) ? (cw->ns ? cw->ns : &ns) : NULL, EINA_TRUE);
-}
-
-EINTERN void
-e_comp_object_native_surface_override(Evas_Object *obj, Evas_Native_Surface *ns)
-{
- API_ENTRY;
- if (cw->ec->input_only) return;
- E_FREE(cw->ns);
- if (ns)
- cw->ns = (Evas_Native_Surface*)eina_memdup((unsigned char*)ns, sizeof(Evas_Native_Surface), 0);
- _e_comp_object_alpha_set(cw);
- if (cw->native)
- e_comp_object_native_surface_set(obj, cw->native);
- e_comp_object_damage(obj, 0, 0, cw->w, cw->h);
-}
-
-EINTERN void
-e_comp_object_blank(Evas_Object *obj, Eina_Bool set)
-{
- API_ENTRY;
-
- set = !!set;
-
- if (cw->blanked == set) return;
- cw->blanked = set;
- _e_comp_object_alpha_set(cw);
- if (set)
- {
- _e_comp_object_native_surface_set(cw, NULL, EINA_FALSE);
- evas_object_image_data_set(cw->obj, NULL);
- return;
- }
- if (cw->native)
- e_comp_object_native_surface_set(obj, 1);
- e_comp_object_damage(obj, 0, 0, cw->w, cw->h);
-}
-
-static void
-_e_comp_object_damage_trace_rect_set(Evas_Object *obj, Eina_Rectangle *origin, int dmg_x, int dmg_y, int dmg_w, int dmg_h)
-{
- Evas_Object *o;
- int obj_x, obj_y;
-
- if (!_damage_trace) return;
-
- API_ENTRY;
-
- if (!evas_object_visible_get(cw->obj)) return;
-
- evas_object_geometry_get(cw->obj, &obj_x, &obj_y, NULL, NULL);
-
- o = evas_object_rectangle_add(e_comp_evas_get());
- evas_object_layer_set(o, E_LAYER_MAX);
- evas_object_name_set(o, "damage_trace");
- evas_object_move(o, dmg_x + obj_x, dmg_y + obj_y);
- evas_object_resize(o, dmg_w, dmg_h);
- evas_object_color_set(o, 0, 128, 0, 128);
- evas_object_render_op_set(o, EVAS_RENDER_BLEND);
- evas_object_pass_events_set(o, EINA_TRUE);
- evas_object_show(o);
-
- ELOGF("COMP", "add damage(%dx%d+%d+%d) origin(%dx%d+%d+%d)",
- cw->ec,
- dmg_w, dmg_h, dmg_x, dmg_y,
- origin->w, origin->h, origin->x, origin->y);
-
- _damage_trace_objs = eina_list_append(_damage_trace_objs, o);
-}
-
-/* mark an object as dirty and setup damages */
-E_API void
-e_comp_object_dirty(Evas_Object *obj)
-{
- Eina_Iterator *it;
- Eina_Rectangle *rect;
- Eina_List *ll;
- Evas_Object *o;
- int w, h, tw, th;
- Eina_Bool dirty, visible;
- E_Map *m = NULL;
-
- API_ENTRY;
- if (cw->external_content) return;
- if (!cw->redirected) return;
- if (cw->render_update_lock.lock)
- {
- ELOGF("COMP", "Render update locked:%d", cw->ec, cw->render_update_lock.lock);
- return;
- }
- /* only actually dirty if pixmap is available */
- if (!e_pixmap_resource_get(cw->ec->pixmap))
- {
- // e_pixmap_size_get returns last attached buffer size
- // eventhough it is destroyed
- ERR("ERROR NO PIXMAP FOR ec:%p", cw->ec);
- return;
- }
- dirty = e_pixmap_size_get(cw->ec->pixmap, &w, &h);
- visible = cw->visible;
- if (!dirty) w = h = 1;
- evas_object_image_pixels_dirty_set(cw->obj, cw->blanked ? 0 : dirty);
- if (!dirty)
- evas_object_image_data_set(cw->obj, NULL);
- _e_comp_object_map_transform_rect(cw->ec, 0, 0, w, h, NULL, NULL, &tw, &th);
- evas_object_image_size_set(cw->obj, tw, th);
- if (cw->mask.obj) evas_object_resize(cw->mask.obj, w, h);
- if (cw->pending_updates)
- eina_tiler_area_size_set(cw->pending_updates, w, h);
- EINA_LIST_FOREACH(cw->obj_mirror, ll, o)
- {
- evas_object_image_pixels_dirty_set(o, dirty);
- if (!dirty)
- evas_object_image_data_set(o, NULL);
- evas_object_image_size_set(o, tw, th);
- visible |= evas_object_visible_get(o);
- }
- if (!dirty)
- {
- ERR("ERROR FETCHING PIXMAP FOR %p", cw->ec);
- return;
- }
-
- e_comp_object_native_surface_set(obj, 1);
-
- m = _e_comp_object_map_damage_transform_get(cw->ec);
- it = eina_tiler_iterator_new(cw->updates);
- EINA_ITERATOR_FOREACH(it, rect)
- {
- /* evas converts damage according to rotation of ecore_evas in damage_region_set
- * of evas engine and doesn't convert damage according to evas_map.
- * so damage of evas_object_image use surface coordinate.
- */
- if (m)
- {
- int damage_x, damage_y, damage_w, damage_h;
-
- _e_comp_object_map_damage_transform_rect(cw->ec, m, rect->x, rect->y, rect->w, rect->h,
- &damage_x, &damage_y, &damage_w, &damage_h);
- evas_object_image_data_update_add(cw->obj, damage_x, damage_y, damage_w, damage_h);
- _e_comp_object_damage_trace_rect_set(obj, rect, damage_x, damage_y, damage_w, damage_h);
- }
- else
- {
- evas_object_image_data_update_add(cw->obj, rect->x, rect->y, rect->w, rect->h);
- _e_comp_object_damage_trace_rect_set(obj, rect, rect->x, rect->y, rect->w, rect->h);
- }
-
- EINA_LIST_FOREACH(cw->obj_mirror, ll, o)
- evas_object_image_data_update_add(o, rect->x, rect->y, rect->w, rect->h);
- if (cw->pending_updates)
- eina_tiler_rect_add(cw->pending_updates, rect);
- }
- eina_iterator_free(it);
- if (m) e_map_free(m);
- if (cw->pending_updates)
- eina_tiler_clear(cw->updates);
else
{
- cw->pending_updates = cw->updates;
- cw->updates = eina_tiler_new(w, h);
- eina_tiler_tile_size_set(cw->updates, 1, 1);
- }
- cw->update_count = cw->updates_full = cw->updates_exist = 0;
- if (cw->visible || (!visible) || (!cw->pending_updates) || cw->native) return;
- /* force render if main object is hidden but mirrors are visible */
- RENDER_DEBUG("FORCING RENDER %p", cw->ec);
- e_comp_object_render(obj);
-}
-
-E_API Eina_Bool
-e_comp_object_render(Evas_Object *obj)
-{
- Eina_List *l;
- Evas_Object *o;
- int pw, ph;
- unsigned int *pix;
-
- API_ENTRY EINA_FALSE;
-
- EINA_SAFETY_ON_NULL_RETURN_VAL(cw->ec, EINA_FALSE);
- if (cw->ec->input_only) return EINA_TRUE;
- if (cw->external_content) return EINA_TRUE;
- if (cw->native) return EINA_FALSE;
- /* if comp object is not redirected state, comp object should not be set by newly committed data
- because image size of comp object is 1x1 and it should not be shown on canvas */
- if (!cw->redirected) return EINA_TRUE;
- if (cw->render_update_lock.lock)
- {
- ELOGF("COMP", "Render update locked:%d", cw->ec, cw->render_update_lock.lock);
- return EINA_TRUE;
- }
- e_comp_object_render_update_del(obj);
- if (!e_pixmap_size_get(cw->ec->pixmap, &pw, &ph)) return EINA_FALSE;
-
- if (!cw->pending_updates)
- {
- WRN("RENDER [%p]: NO RECTS!", cw->ec);
- evas_object_image_data_set(cw->obj, NULL);
- EINA_LIST_FOREACH(cw->obj_mirror, l, o)
- evas_object_image_data_set(o, NULL);
- return EINA_FALSE;
- }
-
- evas_object_image_pixels_dirty_set(cw->obj, EINA_FALSE);
-
- RENDER_DEBUG("RENDER SIZE: %dx%d", pw, ph);
-
- pix = e_pixmap_image_data_get(cw->ec->pixmap);
- if (!pix)
- {
- e_pixmap_image_refresh(cw->ec->pixmap);
- pix = e_pixmap_image_data_get(cw->ec->pixmap);
- }
-
- if ((pix) && ((!cw->blanked) || (cw->obj_mirror)))
- e_pixmap_image_data_ref(cw->ec->pixmap);
-
- /* set pixel data */
- evas_object_image_data_set(cw->obj, cw->blanked ? NULL : pix);
- _e_comp_object_alpha_set(cw);
- EINA_LIST_FOREACH(cw->obj_mirror, l, o)
- {
- evas_object_image_data_set(o, pix);
- evas_object_image_alpha_set(o, evas_object_image_alpha_get(cw->obj));
- evas_object_image_pixels_dirty_set(o, EINA_FALSE);
- }
-
- E_FREE_FUNC(cw->pending_updates, eina_tiler_free);
-
- e_comp_client_post_update_add(cw->ec);
-
- return EINA_TRUE;
-}
-
-/* create a duplicate of an evas object */
-E_API Evas_Object *
-e_comp_object_util_mirror_add(Evas_Object *obj)
-{
- Evas_Object *o;
- int w, h, tw, th;
- unsigned int *pix = NULL;
- Eina_Bool argb = EINA_FALSE;
-
- SOFT_ENTRY(NULL);
-
- if (!cw)
- cw = evas_object_data_get(obj, "comp_mirror");
- if (!cw)
- {
- o = evas_object_image_filled_add(evas_object_evas_get(obj));
- evas_object_image_colorspace_set(o, EVAS_COLORSPACE_ARGB8888);
- evas_object_image_smooth_scale_set(o, e_comp_config_get()->smooth_windows);
- evas_object_image_alpha_set(o, 1);
- evas_object_image_source_set(o, obj);
- return o;
- }
- if ((!cw->ec) || (!e_pixmap_size_get(cw->ec->pixmap, &w, &h))) return NULL;
- if (cw->external_content)
- {
- ERR("%p of client %p is external content.", obj, cw->ec);
- return NULL;
- }
- o = evas_object_image_filled_add(evas_object_evas_get(obj));
- evas_object_image_colorspace_set(o, EVAS_COLORSPACE_ARGB8888);
- evas_object_image_smooth_scale_set(o, e_comp_config_get()->smooth_windows);
- cw->obj_mirror = eina_list_append(cw->obj_mirror, o);
- evas_object_event_callback_add(o, EVAS_CALLBACK_DEL, _e_comp_object_cb_mirror_del, cw);
- evas_object_event_callback_add(o, EVAS_CALLBACK_SHOW, _e_comp_object_cb_mirror_show, cw);
- evas_object_event_callback_add(o, EVAS_CALLBACK_HIDE, _e_comp_object_cb_mirror_hide, cw);
- evas_object_data_set(o, "E_Client_Mirror", cw->ec);
- evas_object_data_set(o, "comp_mirror", cw);
-
- evas_object_image_alpha_set(o, evas_object_image_alpha_get(cw->obj));
- _e_comp_object_map_transform_rect(cw->ec, 0, 0, w, h, NULL, NULL, &tw, &th);
-
- evas_object_image_size_set(o, tw, th);
-
- if (cw->ec->shaped)
- pix = evas_object_image_data_get(cw->obj, 0);
- else
- {
- if (cw->native)
- {
- if (cw->ns)
- evas_object_image_native_surface_set(o, cw->ns);
- else
- {
- Evas_Native_Surface ns;
- memset(&ns, 0, sizeof(Evas_Native_Surface));
- if (e_pixmap_native_surface_init(cw->ec->pixmap, &ns))
- evas_object_image_native_surface_set(o, &ns);
- }
- }
- else
+ /* 8-3. 전체 영역 알파 채우기 */
+ for (py = 0; py < h; py++)
{
- /* FIXME: legacy code, please refer to commit 5e6831187a1 */
- argb = e_pixmap_image_is_argb(cw->ec->pixmap);
- if ((argb) &&
- (e_pixmap_image_exists(cw->ec->pixmap)))
- pix = e_pixmap_image_data_get(cw->ec->pixmap);
- else
- pix = evas_object_image_data_get(cw->obj, EINA_FALSE);
+ for (px = 0; px < w; px++)
+ *p++ |= 0xff000000;
}
}
- if (pix)
- {
- Eina_Bool dirty;
- dirty = evas_object_image_pixels_dirty_get(cw->obj);
- evas_object_image_pixels_dirty_set(o, dirty);
- evas_object_image_data_set(o, pix);
- evas_object_image_data_set(cw->obj, pix);
+ /* 9. 이미지 데이터 업데이트 */
+ evas_object_image_data_set(cw->obj, pix);
+ evas_object_image_data_update_add(cw->obj, 0, 0, w, h);
if (dirty)
evas_object_image_data_update_add(o, 0, 0, tw, th);
}
Eina_Bool loaded = EINA_FALSE;
API_ENTRY EINA_FALSE;
- if (!cw->shobj) return EINA_FALSE; //input window
- if (!effect) effect = "none";
+ /* 1. 기본 유효성 검사 */
+ if (!cw->shobj)
+ return EINA_FALSE;
+
+ /* 2. 이펙트 이름 설정 */
+ if (!effect)
+ effect = "none";
snprintf(buf, sizeof(buf), "e/comp/effects/%s", effect);
+ /* 3. 설정 파일에서 이펙트 로드 시도 */
config = e_comp_config_get();
if ((config) && (config->effect_file))
{
}
}
+ /* 4. 기본 테마에서 이펙트 로드 */
if (!loaded)
{
edje_object_file_get(cw->effect_obj, NULL, &grp);
cw->effect_set = !eina_streq(effect, "none");
- if (!e_util_strcmp(buf, grp)) return cw->effect_set;
+
+ if (!e_util_strcmp(buf, grp))
+ return cw->effect_set;
+
+ /* 4-1. 기본 테마에서 이펙트 로드 시도 */
if (!e_theme_edje_object_set(cw->effect_obj, "base/theme/comp", buf))
{
+ /* 4-2. 자동 이펙트 로드 시도 */
snprintf(buf, sizeof(buf), "e/comp/effects/auto/%s", effect);
if (!e_theme_edje_object_set(cw->effect_obj, "base/theme/comp", buf))
- if (!e_theme_edje_object_set(cw->effect_obj, "base/theme/comp", "e/comp/effects/none"))
- {
- if (cw->effect_running)
- {
- if (!e_comp_object_effect_stop(obj, evas_object_data_get(cw->effect_obj, "_e_comp.end_cb")))
- return EINA_FALSE;
- }
- cw->effect_set = EINA_FALSE;
- return cw->effect_set;
- }
+ {
+ /* 4-3. 기본 이펙트(none) 로드 시도 */
+ if (!e_theme_edje_object_set(cw->effect_obj, "base/theme/comp", "e/comp/effects/none"))
+ {
+ if (cw->effect_running)
+ {
+ if (!e_comp_object_effect_stop(obj, evas_object_data_get(cw->effect_obj, "_e_comp.end_cb")))
+ return EINA_FALSE;
+ }
+ cw->effect_set = EINA_FALSE;
+ return cw->effect_set;
+ }
+ }
}
}
+
+ /* 5. 실행 중인 이펙트 정리 */
if (cw->effect_running)
{
if (!e_comp_object_effect_stop(obj, evas_object_data_get(cw->effect_obj, "_e_comp.end_cb")))
return EINA_FALSE;
}
+
+ /* 6. 새 이펙트 설정 */
ELOGF("COMP", "EFFECT Set GROUP[%s]", cw->ec, buf);
edje_object_part_swallow(cw->effect_obj, "e.swallow.content", cw->shobj);
+
+ /* 7. 이펙트 클립 처리 */
if (cw->effect_clip)
{
evas_object_clip_unset(cw->clip);
}
cw->effect_clip_able = !edje_object_data_get(cw->effect_obj, "noclip");
+ /* 8. 디밍 업데이트 */
_e_comp_object_dim_update(cw);
return cw->effect_set;
void *end_data;
E_Comp_Object *cw = data;
+ /* 1. 기본 정리 작업 */
edje_object_signal_callback_del_full(obj, "e,action,done", "e", _e_comp_object_effect_end_cb, NULL);
cw->effect_running = 0;
e_comp_object_effect_unclip(cw->smart_obj);
- if (!_e_comp_object_animating_end(cw)) return;
+ /* 2. 애니메이션 종료 처리 */
+ if (!_e_comp_object_animating_end(cw))
+ return;
+ /* 3. 이펙트 실행 상태 정리 */
if (evas_object_data_get(cw->smart_obj, "effect_running"))
{
evas_object_data_del(cw->smart_obj, "effect_running");
e_comp_visibility_calculation_set(EINA_TRUE);
}
+ /* 4. 종료 콜백 처리 */
end_cb = evas_object_data_get(obj, "_e_comp.end_cb");
- if (!end_cb) return;
+ if (!end_cb)
+ return;
+
end_data = evas_object_data_get(obj, "_e_comp.end_data");
_e_comp_object_hook_call(E_COMP_OBJECT_HOOK_EFFECT_END, cw->ec);
end_cb(end_data, cw->smart_obj, emission, source);
e_comp_object_effect_start(Evas_Object *obj, Edje_Signal_Cb end_cb, const void *end_data)
{
API_ENTRY EINA_FALSE;
- EINA_SAFETY_ON_NULL_RETURN_VAL(cw->ec, EINA_FALSE); //NYI
- if (!cw->effect_set) return EINA_FALSE;
+ /* 1. 기본 유효성 검사 */
+ EINA_SAFETY_ON_NULL_RETURN_VAL(cw->ec, EINA_FALSE);
+ if (!cw->effect_set)
+ return EINA_FALSE;
+
+ /* 2. 실행 중인 이펙트 정리 */
if (cw->effect_running)
{
e_comp_object_effect_stop(obj, evas_object_data_get(cw->effect_obj, "_e_comp.end_cb"));
}
+ /* 3. 이펙트 클립 설정 */
e_comp_object_effect_clip(obj);
- edje_object_signal_callback_del(cw->effect_obj, "e,action,done", "e", _e_comp_object_effect_end_cb);
+ /* 4. 시그널 콜백 설정 */
+ edje_object_signal_callback_del(cw->effect_obj, "e,action,done", "e", _e_comp_object_effect_end_cb);
edje_object_signal_callback_add(cw->effect_obj, "e,action,done", "e", _e_comp_object_effect_end_cb, cw);
+
+ /* 5. 이펙트 데이터 설정 */
evas_object_data_set(cw->effect_obj, "_e_comp.end_cb", end_cb);
evas_object_data_set(cw->effect_obj, "_e_comp.end_data", end_data);
evas_object_data_set(cw->smart_obj, "effect_running", (void*)1);
+ /* 6. 이펙트 시작 이벤트 발생 */
_e_comp_object_hook_call(E_COMP_OBJECT_HOOK_EFFECT_START, cw->ec);
_e_comp_object_event_simple(obj, E_EVENT_COMP_OBJECT_EFFECT_START);
+ /* 7. 이펙트 실행 */
edje_object_signal_emit(cw->effect_obj, "e,action,go", "e");
_e_comp_object_animating_begin(cw);
cw->effect_running = 1;
+
return EINA_TRUE;
}
E_API Eina_Bool
e_comp_object_effect_stop(Evas_Object *obj, Edje_Signal_Cb end_cb)
{
- int ret = 0;
- Edje_Signal_Cb end_cb_before = NULL;
- void *end_data_before = NULL;
API_ENTRY EINA_FALSE;
- end_cb_before = evas_object_data_get(cw->effect_obj, "_e_comp.end_cb");
- end_data_before = evas_object_data_get(cw->effect_obj, "_e_comp.end_data");
+ /* 이전 콜백 정보 가져오기 */
+ Edje_Signal_Cb end_cb_before = evas_object_data_get(cw->effect_obj, "_e_comp.end_cb");
+ void *end_data_before = evas_object_data_get(cw->effect_obj, "_e_comp.end_data");
- if (end_cb_before != end_cb) return EINA_TRUE;
+ /* 이전 콜백과 현재 콜백이 다른 경우 early return */
+ if (end_cb_before != end_cb)
+ return EINA_TRUE;
+
+ /* 클리핑 해제 */
e_comp_object_effect_unclip(obj);
if (cw->effect_clip)
{
evas_object_clip_unset(cw->effect_obj);
cw->effect_clip = 0;
}
+
+ /* 이펙트 정지 시그널 발생 및 콜백 제거 */
edje_object_signal_emit(cw->effect_obj, "e,action,stop", "e");
- edje_object_signal_callback_del_full(cw->effect_obj, "e,action,done", "e", _e_comp_object_effect_end_cb, cw);
+ edje_object_signal_callback_del_full(cw->effect_obj, "e,action,done", "e",
+ _e_comp_object_effect_end_cb, cw);
+ /* 이펙트 실행 상태 정리 */
if (evas_object_data_get(cw->smart_obj, "effect_running"))
{
evas_object_data_del(cw->smart_obj, "effect_running");
}
cw->effect_running = 0;
- ret = _e_comp_object_animating_end(cw);
+ int ret = _e_comp_object_animating_end(cw);
- if ((ret) && (end_cb_before))
+ /* 이펙트 종료 후 처리 */
+ if (ret && end_cb_before)
{
_e_comp_object_hook_call(E_COMP_OBJECT_HOOK_EFFECT_END, cw->ec);
end_cb_before(end_data_before, cw->smart_obj, "e,action,done", "e");
{
API_ENTRY;
- if ((cw->external_content) &&
- (cw->content_type != E_COMP_OBJECT_CONTENT_TYPE_EXT_IMAGE))
+ /* 외부 컨텐츠 타입 검증 */
+ if (cw->external_content &&
+ cw->content_type != E_COMP_OBJECT_CONTENT_TYPE_EXT_IMAGE)
{
WRN("Can set up alpha value to ONLY evas \"image\" object. "
"But current external content is %d object for %p.",
return;
}
- cw->user_alpha_set = EINA_TRUE;
- cw->user_alpha = alpha;
-
- if (!cw->obj) return;
+ /* 객체 존재 여부 확인 */
+ if (!cw->obj)
+ return;
- if (alpha == evas_object_image_alpha_get(cw->obj)) return;
+ /* 현재 알파값과 동일한 경우 early return */
+ if (alpha == evas_object_image_alpha_get(cw->obj))
+ return;
+ /* 알파값 설정 */
+ cw->user_alpha_set = EINA_TRUE;
+ cw->user_alpha = alpha;
evas_object_image_alpha_set(cw->obj, alpha);
- if ((!cw->native) && (!cw->external_content))
+ /* 네이티브나 외부 컨텐츠가 아닌 경우 이미지 데이터 초기화 */
+ if (!cw->native && !cw->external_content)
evas_object_image_data_set(cw->obj, NULL);
}
E_API void
e_comp_object_mask_set(Evas_Object *obj, Eina_Bool set)
{
- Eina_Bool mask_set = EINA_FALSE;
- Evas_Object *o;
-
API_ENTRY;
EINA_SAFETY_ON_NULL_RETURN(cw->ec);
- if (cw->ec->input_only) return;
- mask_set = !!set;
+
+ /* 입력 전용 객체인 경우 early return */
+ if (cw->ec->input_only)
+ return;
+
+ Eina_Bool mask_set = !!set;
- if (mask_set)
+ /* 마스크 해제 */
+ if (!mask_set)
{
if (!cw->mask.obj)
- {
- o = evas_object_rectangle_add(e_comp_evas_get());
- evas_object_color_set(o, 0, 0, 0, 0);
- evas_object_clip_set(o, cw->clip);
- evas_object_smart_member_add(o, obj);
- evas_object_move(o, 0, 0);
- evas_object_resize(o, cw->w, cw->h);
- /* save render op value to restore when clear a mask.
- *
- * NOTE: DO NOT change the render op on ec->frame while mask object
- * is set. it will overwrite the changed op value. */
- cw->mask.saved_render_op = evas_object_render_op_get(obj);
- evas_object_render_op_set(obj, EVAS_RENDER_COPY);
- evas_object_render_op_set(o, EVAS_RENDER_COPY);
- if (cw->visible) evas_object_show(o);
-
- cw->mask.obj = o;
- evas_object_name_set(cw->mask.obj, "cw->mask_obj");
- ELOGF("COMP", " |mask_obj", cw->ec);
- _e_comp_object_hook_call(E_COMP_OBJECT_HOOK_MASK_OBJECT_SET, cw->ec);
- }
- }
- else
- {
- if (cw->mask.obj)
- {
- evas_object_smart_member_del(cw->mask.obj);
- E_FREE_FUNC(cw->mask.obj, evas_object_del);
+ return;
- evas_object_render_op_set(obj, cw->mask.saved_render_op);
- _e_comp_object_hook_call(E_COMP_OBJECT_HOOK_MASK_OBJECT_UNSET, cw->ec);
- }
+ evas_object_smart_member_del(cw->mask.obj);
+ E_FREE_FUNC(cw->mask.obj, evas_object_del);
+
+ evas_object_render_op_set(obj, cw->mask.saved_render_op);
+ _e_comp_object_hook_call(E_COMP_OBJECT_HOOK_MASK_OBJECT_UNSET, cw->ec);
+ return;
}
+
+ /* 마스크 설정 */
+ if (cw->mask.obj)
+ return;
+
+ /* 새로운 마스크 객체 생성 및 설정 */
+ Evas_Object *o = evas_object_rectangle_add(e_comp_evas_get());
+ evas_object_color_set(o, 0, 0, 0, 0);
+ evas_object_clip_set(o, cw->clip);
+ evas_object_smart_member_add(o, obj);
+ evas_object_move(o, 0, 0);
+ evas_object_resize(o, cw->w, cw->h);
+
+ /* 렌더링 옵션 저장 및 설정 */
+ cw->mask.saved_render_op = evas_object_render_op_get(obj);
+ evas_object_render_op_set(obj, EVAS_RENDER_COPY);
+ evas_object_render_op_set(o, EVAS_RENDER_COPY);
+
+ if (cw->visible)
+ evas_object_show(o);
+
+ cw->mask.obj = o;
+ evas_object_name_set(cw->mask.obj, "cw->mask_obj");
+ ELOGF("COMP", " |mask_obj", cw->ec);
+ _e_comp_object_hook_call(E_COMP_OBJECT_HOOK_MASK_OBJECT_SET, cw->ec);
}
E_API Eina_Bool
E_API void
e_comp_object_transform_bg_set(Evas_Object *obj, Eina_Bool set)
{
- Eina_Bool transform_set = EINA_FALSE;
API_ENTRY;
EINA_SAFETY_ON_NULL_RETURN(cw->ec);
- if (cw->ec->input_only) return;
+
+ /* 입력 전용 객체인 경우 early return */
+ if (cw->ec->input_only)
+ return;
- transform_set = !!set;
+ Eina_Bool transform_set = !!set;
- if (transform_set)
+ /* 변환 배경 해제 */
+ if (!transform_set)
{
if (!cw->transform_bg_obj)
- {
- Evas_Object *o = evas_object_rectangle_add(e_comp_evas_get());
- evas_object_move(o, 0, 0);
- evas_object_resize(o, 1, 1);
- if (cw->transform_bg_color.a >= 255)
- evas_object_render_op_set(o, EVAS_RENDER_COPY);
- else
- evas_object_render_op_set(o, EVAS_RENDER_BLEND);
- evas_object_color_set(o,
- cw->transform_bg_color.r,
- cw->transform_bg_color.g,
- cw->transform_bg_color.b,
- cw->transform_bg_color.a);
- if (cw->visible) evas_object_show(o);
-
- cw->transform_bg_obj = o;
- evas_object_name_set(cw->transform_bg_obj, "cw->transform_bg_obj");
- }
- e_comp_object_transform_obj_stack_update(obj);
+ return;
+
+ evas_object_smart_member_del(cw->transform_bg_obj);
+ E_FREE_FUNC(cw->transform_bg_obj, evas_object_del);
+ return;
}
- else
+
+ /* 변환 배경이 이미 존재하는 경우 early return */
+ if (cw->transform_bg_obj)
{
- if (cw->transform_bg_obj)
- {
- evas_object_smart_member_del(cw->transform_bg_obj);
- E_FREE_FUNC(cw->transform_bg_obj, evas_object_del);
- }
+ e_comp_object_transform_obj_stack_update(obj);
+ return;
}
+
+ /* 새로운 변환 배경 객체 생성 및 설정 */
+ Evas_Object *o = evas_object_rectangle_add(e_comp_evas_get());
+ evas_object_move(o, 0, 0);
+ evas_object_resize(o, 1, 1);
+
+ /* 렌더링 옵션 설정 */
+ if (cw->transform_bg_color.a >= 255)
+ evas_object_render_op_set(o, EVAS_RENDER_COPY);
+ else
+ evas_object_render_op_set(o, EVAS_RENDER_BLEND);
+
+ /* 색상 설정 */
+ evas_object_color_set(o,
+ cw->transform_bg_color.r,
+ cw->transform_bg_color.g,
+ cw->transform_bg_color.b,
+ cw->transform_bg_color.a);
+
+ if (cw->visible)
+ evas_object_show(o);
+
+ cw->transform_bg_obj = o;
+ evas_object_name_set(cw->transform_bg_obj, "cw->transform_bg_obj");
+ e_comp_object_transform_obj_stack_update(obj);
}
E_API void
{
API_ENTRY;
+ /* 배경 색상 정보 업데이트 */
cw->transform_bg_color.r = r;
cw->transform_bg_color.g = g;
cw->transform_bg_color.b = b;
cw->transform_bg_color.a = a;
- if (cw->transform_bg_obj)
- {
- evas_object_color_set(cw->transform_bg_obj,
- cw->transform_bg_color.r,
- cw->transform_bg_color.g,
- cw->transform_bg_color.b,
- cw->transform_bg_color.a);
- }
+ /* 변환 배경 객체가 없는 경우 early return */
+ if (!cw->transform_bg_obj)
+ return;
+
+ /* 변환 배경 객체의 색상 설정 */
+ evas_object_color_set(cw->transform_bg_obj,
+ cw->transform_bg_color.r,
+ cw->transform_bg_color.g,
+ cw->transform_bg_color.b,
+ cw->transform_bg_color.a);
}
EINTERN void
{
API_ENTRY;
EINA_SAFETY_ON_NULL_RETURN(cw->ec);
- if (cw->ec->input_only) return;
- if (!cw->transform_bg_obj) return;
+
+ /* 입력 전용 객체인 경우 early return */
+ if (cw->ec->input_only)
+ return;
+ /* 변환 배경 객체가 없는 경우 early return */
+ if (!cw->transform_bg_obj)
+ return;
+
+ /* 변환 배경 객체의 버텍스 설정 */
_e_comp_object_transform_obj_map_set(cw->transform_bg_obj, vertices);
}
{
API_ENTRY;
EINA_SAFETY_ON_NULL_RETURN(cw->ec);
- if (cw->ec->input_only) return;
- if (!cw->transform_bg_obj) return;
+
+ /* 입력 전용 객체인 경우 early return */
+ if (cw->ec->input_only)
+ return;
+
+ /* 변환 배경 객체가 없는 경우 early return */
+ if (!cw->transform_bg_obj)
+ return;
+ /* 변환 배경 객체의 버텍스와 줌 설정 */
_e_comp_object_transform_obj_map_set_with_zoom(cw->transform_bg_obj, vertices, zoom);
}
E_API void
e_comp_object_transform_transp_set(Evas_Object *obj, Eina_Bool set)
{
- Eina_Bool transform_set = EINA_FALSE;
API_ENTRY;
EINA_SAFETY_ON_NULL_RETURN(cw->ec);
- if (cw->ec->input_only) return;
+
+ /* 입력 전용 객체인 경우 early return */
+ if (cw->ec->input_only)
+ return;
- transform_set = !!set;
+ Eina_Bool transform_set = !!set;
- if (transform_set)
+ /* 변환 투명도 해제 */
+ if (!transform_set)
{
if (!cw->transform_tranp_obj)
- {
- Evas_Object *o = evas_object_rectangle_add(e_comp_evas_get());
- evas_object_move(o, 0, 0);
- evas_object_resize(o, 1, 1);
- evas_object_render_op_set(o, EVAS_RENDER_COPY);
- evas_object_color_set(o, 0, 0, 0, 0);
- if (cw->visible) evas_object_show(o);
-
- cw->transform_tranp_obj = o;
- evas_object_pass_events_set(cw->transform_tranp_obj, EINA_TRUE);
- ELOGF("TRANSFORM","transform set: TRUE", cw->ec);
- evas_object_name_set(cw->transform_tranp_obj, "cw->transform_trasp_obj");
- }
- e_comp_object_transform_obj_stack_update(obj);
+ return;
+
+ ELOGF("TRANSFORM", "transform set: FALSE", cw->ec);
+ evas_object_smart_member_del(cw->transform_tranp_obj);
+ E_FREE_FUNC(cw->transform_tranp_obj, evas_object_del);
+ return;
}
- else
+
+ /* 변환 투명도 객체가 이미 존재하는 경우 early return */
+ if (cw->transform_tranp_obj)
{
- if (cw->transform_tranp_obj)
- {
- ELOGF("TRANSFORM","transform set: FALSE", cw->ec);
- evas_object_smart_member_del(cw->transform_tranp_obj);
- E_FREE_FUNC(cw->transform_tranp_obj, evas_object_del);
- }
+ e_comp_object_transform_obj_stack_update(obj);
+ return;
}
+
+ /* 새로운 변환 투명도 객체 생성 및 설정 */
+ Evas_Object *o = evas_object_rectangle_add(e_comp_evas_get());
+ evas_object_move(o, 0, 0);
+ evas_object_resize(o, 1, 1);
+ evas_object_render_op_set(o, EVAS_RENDER_COPY);
+ evas_object_color_set(o, 0, 0, 0, 0);
+
+ if (cw->visible)
+ evas_object_show(o);
+
+ cw->transform_tranp_obj = o;
+ evas_object_pass_events_set(cw->transform_tranp_obj, EINA_TRUE);
+ ELOGF("TRANSFORM", "transform set: TRUE", cw->ec);
+ evas_object_name_set(cw->transform_tranp_obj, "cw->transform_trasp_obj");
+ e_comp_object_transform_obj_stack_update(obj);
}
EINTERN void
{
API_ENTRY;
EINA_SAFETY_ON_NULL_RETURN(cw->ec);
- if (cw->ec->input_only) return;
- if (!cw->transform_tranp_obj) return;
+
+ /* 입력 전용 객체인 경우 early return */
+ if (cw->ec->input_only)
+ return;
+
+ /* 변환 투명도 객체가 없는 경우 early return */
+ if (!cw->transform_tranp_obj)
+ return;
+ /* 변환 투명도 객체의 버텍스 설정 */
_e_comp_object_transform_obj_map_set(cw->transform_tranp_obj, vertices);
}
{
API_ENTRY;
EINA_SAFETY_ON_NULL_RETURN(cw->ec);
- if (cw->ec->input_only) return;
- if (!cw->transform_tranp_obj) return;
+
+ /* 입력 전용 객체인 경우 early return */
+ if (cw->ec->input_only)
+ return;
+
+ /* 변환 투명도 객체가 없는 경우 early return */
+ if (!cw->transform_tranp_obj)
+ return;
+ /* 변환 투명도 객체의 버텍스와 줌 설정 */
_e_comp_object_transform_obj_map_set_with_zoom(cw->transform_tranp_obj, vertices, zoom);
}
{
API_ENTRY EINA_FALSE;
+ /* 필수 객체 존재 여부 검사 */
EINA_SAFETY_ON_NULL_RETURN_VAL(cw->ec, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(cw->ec->pixmap, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(content, EINA_FALSE);
+ /* 이전 객체가 존재하는 경우 early return */
if (cw->obj)
{
ERR("Can't set e.swallow.content to requested content. "
return EINA_FALSE;
}
- if (e_pixmap_usable_get(cw->ec->pixmap)) return EINA_FALSE;
+ /* 픽스맵이 사용 가능한 경우 early return */
+ if (e_pixmap_usable_get(cw->ec->pixmap))
+ return EINA_FALSE;
+ /* 지원하지 않는 컨텐츠 타입인 경우 early return */
if ((type != E_COMP_OBJECT_CONTENT_TYPE_EXT_IMAGE) &&
(type != E_COMP_OBJECT_CONTENT_TYPE_EXT_EDJE))
{
return EINA_FALSE;
}
+ /* 컨텐츠 객체 설정 */
cw->external_content = EINA_TRUE;
-
cw->obj = content;
cw->content_type = type;
+
+ /* 객체 속성 설정 */
evas_object_name_set(cw->obj, "cw->obj");
evas_object_pass_events_set(cw->obj, EINA_TRUE);
_e_comp_object_alpha_set(cw);
+ /* 그림자 객체가 있는 경우 설정 */
if (cw->shobj)
_e_comp_object_shadow_setup(cw);
+ /* 컨텐츠 타입 설정 이벤트 발생 */
wl_signal_emit(&cw->events.content_type_set, NULL);
return EINA_TRUE;
{
API_ENTRY EINA_FALSE;
+ /* 필수 객체 존재 여부 검사 */
EINA_SAFETY_ON_NULL_RETURN_VAL(cw->ec, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(cw->ec->pixmap, EINA_FALSE);
-
+ /* 객체가 없고 클라이언트가 보이지 않는 경우 early return */
if (!cw->obj && !cw->ec->visible)
{
ELOGF("COMP", "is not visible yet. no need to unset", cw->ec);
return EINA_TRUE;
}
+ /* 내부 이미지 객체인 경우 early return */
if (cw->content_type == E_COMP_OBJECT_CONTENT_TYPE_INT_IMAGE)
{
ELOGF("COMP", "has been set to internal image object already", cw->ec);
return EINA_TRUE;
}
+ /* 외부 객체 제거 */
if (cw->obj)
{
if (cw->shobj)
}
cw->external_content = EINA_FALSE;
+
+ /* 커서 서피스인 경우 특별 처리 */
if (cw->ec->is_cursor)
{
int pw, ph;
return EINA_TRUE;
}
+ /* 내부 이미지 객체 생성 및 설정 */
cw->content_type = E_COMP_OBJECT_CONTENT_TYPE_INT_IMAGE;
cw->obj = evas_object_image_filled_add(e_comp_evas_get());
evas_object_image_border_center_fill_set(cw->obj, EVAS_BORDER_FILL_SOLID);
evas_object_pass_events_set(cw->obj, EINA_TRUE);
_e_comp_object_alpha_set(cw);
+ /* 그림자 객체가 있는 경우 설정 */
if (cw->shobj)
_e_comp_object_shadow_setup(cw);
+ /* 객체가 보이는 경우 표시 상태 업데이트 */
if (cw->visible)
{
cw->visible = 0;
cw->visible = 1;
}
+ /* 렌더링 업데이트 */
e_comp_object_damage(cw->smart_obj, 0, 0, cw->w, cw->h);
e_comp_object_dirty(cw->smart_obj);
e_comp_object_render(cw->smart_obj);
e_comp_object_render_update_add(obj);
+ /* 컨텐츠 타입 설정 이벤트 발생 */
wl_signal_emit(&cw->events.content_type_set, NULL);
return EINA_TRUE;
{
API_ENTRY NULL;
+ /* 필수 객체 존재 여부 검사 */
EINA_SAFETY_ON_NULL_RETURN_VAL(cw->ec, NULL);
+ /* 내부 이미지 객체인 경우 early return */
if (cw->content_type == E_COMP_OBJECT_CONTENT_TYPE_INT_IMAGE)
{
ELOGF("COMP", "has been set to internal image object. couldn't return internal image object", cw->ec);
{
API_ENTRY;
EINA_SAFETY_ON_NULL_RETURN(cw->ec);
+
+ /* 입력 전용 객체인 경우 early return */
+ if (cw->ec->input_only)
+ return;
+
+ /* 설정 가져오기 및 검증 */
E_Comp_Config *conf = e_comp_config_get();
- if (cw->ec->input_only) return;
- if (!conf->dim_rect_enable) return;
+ if (!conf->dim_rect_enable)
+ return;
+ /* 마스크 정보 업데이트 */
cw->dim.mask_set = mask_set;
cw->dim.mask_x = x;
cw->dim.mask_y = y;
cw->dim.mask_w = w;
cw->dim.mask_h = h;
- if (!cw->dim.enable) return;
+ /* dim이 비활성화된 경우 early return */
+ if (!cw->dim.enable)
+ return;
+
+ /* 프레임에 마스크 설정 적용 */
e_comp_object_dim_mask_set(cw->ec->frame, mask_set);
}
EINTERN void
e_comp_object_dim_mask_set(Evas_Object *obj, Eina_Bool set)
{
- Eina_Bool mask_set = EINA_FALSE;
- Evas_Object *o;
-
API_ENTRY;
EINA_SAFETY_ON_NULL_RETURN(cw->ec);
+
+ /* 입력 전용 객체인 경우 early return */
+ if (cw->ec->input_only)
+ return;
+
+ /* 설정 가져오기 및 검증 */
E_Comp_Config *conf = e_comp_config_get();
- if (cw->ec->input_only) return;
- if (!conf->dim_rect_enable) return;
+ if (!conf->dim_rect_enable)
+ return;
- mask_set = !!set;
+ Eina_Bool mask_set = !!set;
- if (mask_set)
+ /* 마스크 해제 */
+ if (!mask_set)
{
- if (cw->dim.mask_obj)
- {
- evas_object_smart_member_del(cw->dim.mask_obj);
- E_FREE_FUNC(cw->dim.mask_obj, evas_object_del);
- }
-
- ELOGF("COMP", "DIM |Mask applied on Dim rect mask_rect[%d %d %d %d]", cw->ec, cw->dim.mask_x, cw->dim.mask_y, cw->dim.mask_w, cw->dim.mask_h);
- o = evas_object_rectangle_add(e_comp_evas_get());
- evas_object_color_set(o, 0, 0, 0, 0);
- evas_object_smart_member_add(o, obj);
- evas_object_resize(o, cw->dim.mask_w, cw->dim.mask_h);
- evas_object_move(o, cw->dim.mask_x, cw->dim.mask_y);
-
- evas_object_render_op_set(o, EVAS_RENDER_COPY);
- if (cw->visible) evas_object_show(o);
-
- cw->dim.mask_obj = o;
- evas_object_name_set(cw->dim.mask_obj, "cw->dim_mask_obj");
+ if (!cw->dim.mask_obj)
+ return;
- evas_object_layer_set(cw->dim.mask_obj, 9998);
+ ELOGF("COMP", "DIM |Mask on Dim rect Removed", cw->ec);
+ evas_object_smart_member_del(cw->dim.mask_obj);
+ E_FREE_FUNC(cw->dim.mask_obj, evas_object_del);
+ return;
}
- else
+
+ /* 기존 마스크 객체 제거 */
+ if (cw->dim.mask_obj)
{
- if (cw->dim.mask_obj)
- {
- ELOGF("COMP", "DIM |Mask on Dim rect Removed", cw->ec);
- evas_object_smart_member_del(cw->dim.mask_obj);
- E_FREE_FUNC(cw->dim.mask_obj, evas_object_del);
- }
+ evas_object_smart_member_del(cw->dim.mask_obj);
+ E_FREE_FUNC(cw->dim.mask_obj, evas_object_del);
}
+
+ /* 새로운 마스크 객체 생성 및 설정 */
+ ELOGF("COMP", "DIM |Mask applied on Dim rect mask_rect[%d %d %d %d]",
+ cw->ec, cw->dim.mask_x, cw->dim.mask_y, cw->dim.mask_w, cw->dim.mask_h);
+
+ Evas_Object *o = evas_object_rectangle_add(e_comp_evas_get());
+ evas_object_color_set(o, 0, 0, 0, 0);
+ evas_object_smart_member_add(o, obj);
+ evas_object_resize(o, cw->dim.mask_w, cw->dim.mask_h);
+ evas_object_move(o, cw->dim.mask_x, cw->dim.mask_y);
+ evas_object_render_op_set(o, EVAS_RENDER_COPY);
+
+ if (cw->visible)
+ evas_object_show(o);
+
+ cw->dim.mask_obj = o;
+ evas_object_name_set(cw->dim.mask_obj, "cw->dim_mask_obj");
+ evas_object_layer_set(cw->dim.mask_obj, 9998);
}
E_API void
e_comp_object_dim_client_set(E_Client *ec)
{
+ /* 설정 가져오기 및 검증 */
E_Comp_Config *conf = e_comp_config_get();
+ if (!conf->dim_rect_enable)
+ return;
- if (!conf->dim_rect_enable) return ;
- if (dim_client == ec) return;
+ /* 현재 클라이언트와 동일한 경우 early return */
+ if (dim_client == ec)
+ return;
+ /* 이전 dim 상태 확인 */
Eina_Bool prev_dim = EINA_FALSE;
- ELOGF("COMP", "DIM |Client Set %p -> %p", ec, dim_client, ec);
-
if (dim_client && _e_comp_object_dim_enable_get(dim_client, dim_client->frame))
- prev_dim = EINA_TRUE;
+ prev_dim = EINA_TRUE;
+
+ ELOGF("COMP", "DIM |Client Set %p -> %p", ec, dim_client, ec);
+ /* 이전 dim이 활성화되고 현재 클라이언트가 보이는 경우 */
if (prev_dim && dim_client->visible && ec)
{
_e_comp_object_dim_enable_set(dim_client, dim_client->frame, EINA_FALSE, EINA_TRUE);
_e_comp_object_dim_enable_set(ec, ec->frame, EINA_TRUE, EINA_TRUE);
}
+ /* 그 외의 경우 */
else
{
- if (prev_dim) _e_comp_object_dim_enable_set(dim_client, dim_client->frame, EINA_FALSE, EINA_FALSE);
- if (ec) _e_comp_object_dim_enable_set(ec, ec->frame, EINA_TRUE, EINA_FALSE);
+ if (prev_dim)
+ _e_comp_object_dim_enable_set(dim_client, dim_client->frame, EINA_FALSE, EINA_FALSE);
+ if (ec)
+ _e_comp_object_dim_enable_set(ec, ec->frame, EINA_TRUE, EINA_FALSE);
}
+
+ /* 현재 클라이언트 업데이트 */
dim_client = ec;
}
_e_comp_object_dim_enable_set(E_Client *ec, Evas_Object *obj, Eina_Bool enable, Eina_Bool noeffect)
{
API_ENTRY;
- char emit[32] = "\0";
- E_Comp_Config *conf = e_comp_config_get();
+
+ /* 필수 객체 존재 여부 검사 */
+ if (!ec)
+ return;
+ if (!conf->dim_rect_enable)
+ return;
+ if (!cw->effect_obj)
+ return;
- if (!ec) return;
- if (!conf->dim_rect_enable) return;
- if (!cw->effect_obj) return;
- if (enable == cw->dim.enable) return;
+ /* 현재 상태와 동일한 경우 early return */
+ if (enable == cw->dim.enable)
+ return;
+ /* 로그 출력 */
ELOGF("COMP", "DIM |set on Client [%d]", ec, enable);
+
+ /* 이펙트 시그널 문자열 설정 */
+ char emit[32] = "\0";
+ E_Comp_Config *conf = e_comp_config_get();
if (noeffect || !conf->dim_rect_effect)
- {
- strncpy(emit, (enable ? "e,state,dim,on,noeffect" : "e,state,dim,off,noeffect"), sizeof(emit) - 1);
- }
+ strncpy(emit, (enable ? "e,state,dim,on,noeffect" : "e,state,dim,off,noeffect"), sizeof(emit) - 1);
else
- {
- strncpy(emit, (enable ? "e,state,dim,on" : "e,state,dim,off"), sizeof(emit) - 1);
- }
+ strncpy(emit, (enable ? "e,state,dim,on" : "e,state,dim,off"), sizeof(emit) - 1);
+ /* dim 상태 업데이트 */
cw->dim.enable = enable;
- if (cw->dim.mask_set && !enable)
+ /* 마스크 설정에 따른 시그널 발생 및 마스크 설정 */
+ if (cw->dim.mask_set)
{
- e_comp_object_dim_mask_set(cw->ec->frame, enable);
- edje_object_signal_emit(cw->effect_obj, emit, "e");
- }
- else if (cw->dim.mask_set && enable)
- {
- edje_object_signal_emit(cw->effect_obj, emit, "e");
- e_comp_object_dim_mask_set(cw->ec->frame, enable);
+ if (!enable)
+ {
+ e_comp_object_dim_mask_set(cw->ec->frame, enable);
+ edje_object_signal_emit(cw->effect_obj, emit, "e");
+ }
+ else
+ {
+ edje_object_signal_emit(cw->effect_obj, emit, "e");
+ e_comp_object_dim_mask_set(cw->ec->frame, enable);
+ }
}
else
{
static void
_e_comp_object_dim_update(E_Comp_Object *cw)
{
+ /* 필수 객체 존재 여부 검사 */
+ if (!cw)
+ return;
+ if (!cw->effect_obj)
+ return;
+
+ /* 설정 검사 */
E_Comp_Config *conf = e_comp_config_get();
+ if (!conf->dim_rect_enable)
+ return;
- if (!cw) return;
- if (!conf->dim_rect_enable) return;
- if (!cw->effect_obj) return;
- if (cw->dim.enable)
- {
- edje_object_signal_emit(cw->effect_obj, (cw->dim.enable ? "e,state,dim,on,noeffect" : "e,state,dim,off,noeffect"), "e");
- ELOGF("COMP", "DIM |Applied on Client dim.enable[%d]", cw->ec, cw->dim.enable);
+ /* dim이 비활성화된 경우 early return */
+ if (!cw->dim.enable)
+ return;
- if (cw->dim.mask_set)
- {
- e_comp_object_dim_mask_set(cw->ec->frame, cw->dim.mask_set);
- }
- }
+ /* dim 상태에 따른 시그널 발생 */
+ const char *signal = cw->dim.enable ? "e,state,dim,on,noeffect" : "e,state,dim,off,noeffect";
+ edje_object_signal_emit(cw->effect_obj, signal, "e");
+
+ /* 로그 출력 */
+ ELOGF("COMP", "DIM |Applied on Client dim.enable[%d]", cw->ec, cw->dim.enable);
+
+ /* 마스크 설정이 있는 경우 마스크 적용 */
+ if (cw->dim.mask_set)
+ e_comp_object_dim_mask_set(cw->ec->frame, cw->dim.mask_set);
}
EINTERN void
char *p = buffer;
int l, remain = sizeof buffer;
- if (!ec) return;
- if (e_object_is_del(E_OBJECT(ec))) return;
+ /* 필수 객체 존재 여부 검사 */
+ if (!ec)
+ return;
+ if (e_object_is_del(E_OBJECT(ec)))
+ return;
+ /* 서페이스 검사 */
surface = e_surface_try_from_ec(ec);
- if (!surface) return;
-
- /* if buffer had been flushed, buffer could be NULL. Then map will be applied
- * when new buffer is attached.
- */
- if (!e_surface_has_buffer(surface)) return;
+ if (!surface)
+ return;
+ if (!e_surface_has_buffer(surface))
+ return;
+ /* 맵 변환이 필요없는 경우 early return */
if ((!cw->redirected) ||
(e_client_video_hw_composition_check(ec)) ||
(!e_surface_buffer_transform_get(surface) &&
_e_comp_object_map_transform_rect(cw->ec, 0, 0, cw->w, cw->h, NULL, NULL, &tw, &th);
evas_object_resize(cw->effect_obj, tw, th);
}
-
return;
}
+ /* 맵 객체 생성 */
map = e_map_new();
- EINA_SAFETY_ON_NULL_RETURN(map);
+ if (!map)
+ return;
+ /* 버퍼 크기 가져오기 */
e_pixmap_size_get(ec->pixmap, &bw, &bh);
+ /* 맵 포인트 초기화 */
x1 = y1 = 0;
x2 = bw;
y2 = bh;
+ /* 맵 유틸리티 포인트 설정 */
e_map_util_points_populate_from_geometry(map, ec->x, ec->y, bw, bh, 0);
+ /* 맵 포인트 UV 좌표 설정 */
_e_comp_object_map_transform_pos(ec, x1, y1, &x, &y);
e_map_point_image_uv_set(map, 0, x, y);
l = snprintf(p, remain, "%d,%d", x, y);
l = snprintf(p, remain, " %d,%d", x, y);
p += l, remain -= l;
+ /* 로그 출력 */
ELOGF("TRANSFORM", "map: point(%d,%d %dx%d) uv(%d,%d %d,%d %d,%d %d,%d=>%s)",
cw->ec,
ec->x, ec->y, bw, bh, x1, y1, x2, y1, x2, y2, x1, y2, buffer);
+ /* 맵 적용 및 활성화 */
e_comp_object_map_set(cw->effect_obj, map);
e_comp_object_map_enable_set(cw->effect_obj, EINA_TRUE);
+ /* 맵 객체 해제 */
e_map_free(map);
- /* if there's screen rotation with comp mode, then ec->effect_obj and
- * ec->obj should rotate. if not, in evas_map, update region is clipped.
- */
+ /* 화면 회전 시 effect_obj와 obj 크기 조정 */
_e_comp_object_map_transform_rect(cw->ec, 0, 0, bw, bh, NULL, NULL, &tw, &th);
evas_object_resize(cw->effect_obj, tw, th);
}
API_ENTRY EINA_FALSE;
EINA_SAFETY_ON_NULL_RETURN_VAL(cw->ec, EINA_FALSE);
- if (cw->ec->input_only) return EINA_FALSE;
- if (cw->external_content) return EINA_FALSE;
- if (e_comp_object_content_type_get(cw->ec->frame) != E_COMP_OBJECT_CONTENT_TYPE_INT_IMAGE) return EINA_FALSE;
+ /* 입력 전용 객체인 경우 early return */
+ if (cw->ec->input_only)
+ return EINA_FALSE;
+
+ /* 외부 컨텐츠인 경우 early return */
+ if (cw->external_content)
+ return EINA_FALSE;
- /* just return true value, if it is normal case */
- if (e_pixmap_usable_get(cw->ec->pixmap)) return EINA_TRUE;
+ /* 내부 이미지 컨텐츠 타입이 아닌 경우 early return */
+ if (e_comp_object_content_type_get(cw->ec->frame) != E_COMP_OBJECT_CONTENT_TYPE_INT_IMAGE)
+ return EINA_FALSE;
- /* abnormal case */
- Evas_Native_Surface *ns;
- ns = evas_object_image_native_surface_get(cw->obj);
+ /* 일반적인 경우: pixmap이 사용 가능한 경우 */
+ if (e_pixmap_usable_get(cw->ec->pixmap))
+ return EINA_TRUE;
- /* client pixmap is not usable but cw->obj is drawable due to it holds valid native surface*/
+ /* 비정상적인 경우: native surface 확인 */
+ Evas_Native_Surface *ns = evas_object_image_native_surface_get(cw->obj);
if (ns)
{
ELOGF("COMP", "Client pixmap is Not usable but still holds valid native surface", cw->ec);
EINTERN Eina_Bool
e_comp_object_image_filter_set(Evas_Object *obj, E_Comp_Image_Filter filter)
{
- char efl_gfx_code[64] = "";
-
API_ENTRY EINA_FALSE;
+
+ /* 필수 객체 존재 여부 검사 */
EINA_SAFETY_ON_NULL_RETURN_VAL(cw->ec, EINA_FALSE);
- if (e_object_is_del(E_OBJECT(cw->ec))) return EINA_FALSE;
- if (!e_client_cdata_get(cw->ec)) return EINA_FALSE;
+ if (e_object_is_del(E_OBJECT(cw->ec)))
+ return EINA_FALSE;
+ if (!e_client_cdata_get(cw->ec))
+ return EINA_FALSE;
+ /* 필터 프로그램 설정 */
+ char efl_gfx_code[64] = "";
switch (filter)
{
case E_COMP_IMAGE_FILTER_BLUR:
break;
}
+ /* 필터 상태 업데이트 및 시그널 발생 */
cw->image_filter = filter;
-
wl_signal_emit(&cw->events.image_filter_set, NULL);
return EINA_TRUE;
EINTERN void
e_comp_object_damage_trace_debug(Eina_Bool onoff)
{
- Evas *evas;
+ /* Early return if current state is the same */
+ if (_damage_trace == onoff)
+ return;
- if (_damage_trace == onoff) return;
+ /* Get Evas object */
+ Evas *evas = e_comp_evas_get();
- evas = e_comp_evas_get();
+ /* Enable damage trace */
if (onoff)
{
+ /* Register rendering callbacks */
evas_event_callback_add(evas,
- EVAS_CALLBACK_RENDER_PRE,
- _e_comp_object_damage_trace_render_pre_cb,
- NULL);
+ EVAS_CALLBACK_RENDER_PRE,
+ _e_comp_object_damage_trace_render_pre_cb,
+ NULL);
evas_event_callback_add(evas,
- EVAS_CALLBACK_RENDER_POST,
- _e_comp_object_damage_trace_render_post_cb,
- NULL);
+ EVAS_CALLBACK_RENDER_POST,
+ _e_comp_object_damage_trace_render_post_cb,
+ NULL);
}
+ /* Disable damage trace */
else
{
+ /* Clean up trace objects */
Evas_Object *obj;
-
EINA_LIST_FREE(_damage_trace_objs, obj)
evas_object_del(obj);
-
_damage_trace_objs = NULL;
EINA_LIST_FREE(_damage_trace_post_objs, obj)
evas_object_del(obj);
-
_damage_trace_post_objs = NULL;
+ /* Remove rendering callbacks */
evas_event_callback_del(evas,
- EVAS_CALLBACK_RENDER_PRE,
- _e_comp_object_damage_trace_render_pre_cb);
+ EVAS_CALLBACK_RENDER_PRE,
+ _e_comp_object_damage_trace_render_pre_cb);
evas_event_callback_del(evas,
- EVAS_CALLBACK_RENDER_POST,
- _e_comp_object_damage_trace_render_post_cb);
+ EVAS_CALLBACK_RENDER_POST,
+ _e_comp_object_damage_trace_render_post_cb);
}
+ /* Update state */
_damage_trace = onoff;
}
E_API Eina_Bool
e_comp_object_render_update_lock(Evas_Object *obj)
{
- E_Comp_Wl_Buffer *buffer;
- struct wayland_tbm_client_queue *cqueue;
-
API_ENTRY EINA_FALSE;
+ /* Initialize when first lock is set */
if (cw->render_update_lock.lock == 0)
{
+ E_Comp_Wl_Buffer *buffer;
+
+ /* Call lock setting hook */
_e_comp_object_hook_call(E_COMP_OBJECT_HOOK_RENDER_UPDATE_LOCK_SET, cw->ec);
+ /* Process buffer resource */
buffer = e_pixmap_resource_get(cw->ec->pixmap);
- if ((buffer) && (buffer->resource))
+ if (buffer && buffer->resource)
{
- cqueue = e_comp_wl_tbm_client_queue_get(cw->ec);
+ struct wayland_tbm_client_queue *cqueue = e_comp_wl_tbm_client_queue_get(cw->ec);
if (cqueue)
wayland_tbm_server_client_queue_flush(cqueue);
}
+ /* Handle buffer reference and update */
e_comp_wl_buffer_reference(&cw->render_update_lock.buffer_ref, buffer);
e_comp_object_render_update_del(obj);
+ /* Log output */
ELOGF("COMP", "Render update lock enabled", cw->ec);
}
+ /* Increment lock counter */
cw->render_update_lock.lock++;
return EINA_TRUE;
{
API_ENTRY;
+ /* Early return if no lock exists */
if (cw->render_update_lock.lock == 0)
return;
+ /* Decrement lock counter */
cw->render_update_lock.lock--;
- if (cw->render_update_lock.lock == 0)
- {
-
- if (cw->render_update_lock.pending_move_set)
- {
- evas_object_move(obj,
- cw->render_update_lock.pending_move_x,
- cw->render_update_lock.pending_move_y);
- cw->render_update_lock.pending_move_x = 0;
- cw->render_update_lock.pending_move_y = 0;
- cw->render_update_lock.pending_move_set = EINA_FALSE;
- }
-
- if (cw->render_update_lock.pending_resize_set)
- {
- evas_object_resize(obj,
- cw->render_update_lock.pending_resize_w,
- cw->render_update_lock.pending_resize_h);
- cw->render_update_lock.pending_resize_w = 0;
- cw->render_update_lock.pending_resize_h = 0;
- cw->render_update_lock.pending_resize_set = EINA_FALSE;
- }
+ /* Early return if lock is not fully released */
+ if (cw->render_update_lock.lock > 0)
+ return;
- e_comp_wl_buffer_reference(&cw->render_update_lock.buffer_ref, NULL);
+ /* Process pending move operation */
+ if (cw->render_update_lock.pending_move_set)
+ {
+ evas_object_move(obj,
+ cw->render_update_lock.pending_move_x,
+ cw->render_update_lock.pending_move_y);
+ cw->render_update_lock.pending_move_x = 0;
+ cw->render_update_lock.pending_move_y = 0;
+ cw->render_update_lock.pending_move_set = EINA_FALSE;
+ }
- if ((cw->ec->exp_iconify.buffer_flush) &&
- (e_policy_visibility_client_is_iconic(cw->ec)) &&
- (cw->ec->comp_data) && (!cw->ec->comp_data->buffer_ref.buffer))
- e_comp_object_clear(obj);
- else
- {
- e_pixmap_image_refresh(cw->ec->pixmap);
- e_comp_object_damage(cw->ec->frame, 0, 0, cw->ec->w, cw->ec->h);
- e_comp_object_dirty(cw->ec->frame);
- e_comp_object_render(cw->ec->frame);
- }
+ /* Process pending resize operation */
+ if (cw->render_update_lock.pending_resize_set)
+ {
+ evas_object_resize(obj,
+ cw->render_update_lock.pending_resize_w,
+ cw->render_update_lock.pending_resize_h);
+ cw->render_update_lock.pending_resize_w = 0;
+ cw->render_update_lock.pending_resize_h = 0;
+ cw->render_update_lock.pending_resize_set = EINA_FALSE;
+ }
- _e_comp_object_hook_call(E_COMP_OBJECT_HOOK_RENDER_UPDATE_LOCK_UNSET, cw->ec);
+ /* Release buffer reference */
+ e_comp_wl_buffer_reference(&cw->render_update_lock.buffer_ref, NULL);
- ELOGF("COMP", "Render update lock disabled", cw->ec);
+ /* Handle iconified client */
+ if ((cw->ec->exp_iconify.buffer_flush) &&
+ (e_policy_visibility_client_is_iconic(cw->ec)) &&
+ (cw->ec->comp_data) && (!cw->ec->comp_data->buffer_ref.buffer))
+ {
+ e_comp_object_clear(obj);
+ }
+ else
+ {
+ /* Process normal rendering update */
+ e_pixmap_image_refresh(cw->ec->pixmap);
+ e_comp_object_damage(cw->ec->frame, 0, 0, cw->ec->w, cw->ec->h);
+ e_comp_object_dirty(cw->ec->frame);
+ e_comp_object_render(cw->ec->frame);
}
+
+ /* Call unlock hook and log output */
+ _e_comp_object_hook_call(E_COMP_OBJECT_HOOK_RENDER_UPDATE_LOCK_UNSET, cw->ec);
+ ELOGF("COMP", "Render update lock disabled", cw->ec);
}
E_API Eina_Bool
{
API_ENTRY;
+ /* Return user-defined color if transparency is set */
if ((cw->transparent.set) || (cw->transparent.setting))
{
+ /* Set values after NULL check for each color channel */
if (r) *r = cw->transparent.user_r;
if (g) *g = cw->transparent.user_g;
if (b) *b = cw->transparent.user_b;
if (a) *a = cw->transparent.user_a;
+ return;
}
- else
- {
- evas_object_color_get(obj, r, g, b, a);
- }
+
+ /* Return default object color */
+ evas_object_color_get(obj, r, g, b, a);
}
EINTERN void