{
double ratio_x, ratio_y;
int cord_x, cord_y;
+ double prev_ratio_x, prev_ratio_y;
+ int prev_cord_x, prev_cord_y;
Eina_Bool enabled;
+ Ecore_Animator *animator;
} zoom;
};
e_comp_render_queue();
}
+static Eina_Bool
+_animator_cb(void *data, double pos)
+{
+ E_Desk *desk;
+ E_Client *ec;
+ Eina_List *l;
+ int cx, cy;
+ double zoomx, zoomy;
+ double progress;
+ double diff_x, diff_y;
+ double cBez[4] = {0.3, 0.0, 0.15, 1.0};
+
+ desk = (E_Desk*)data;
+ if (!desk) return ECORE_CALLBACK_CANCEL;
+
+ E_DESK_SMART_DATA_GET_OR_RETURN(desk->smart_obj, sd) ECORE_CALLBACK_CANCEL;
+
+ progress = ecore_animator_pos_map_n(pos, ECORE_POS_MAP_CUBIC_BEZIER, 4, cBez);
+
+ diff_x = sd->zoom.prev_ratio_x - sd->zoom.ratio_x;
+ diff_y = sd->zoom.prev_ratio_y - sd->zoom.ratio_y;
+
+ zoomx = sd->zoom.ratio_x + (diff_x * (1-progress));
+ zoomy = sd->zoom.ratio_y + (diff_y * (1-progress));
+ cx = sd->zoom.cord_x;
+ cy = sd->zoom.cord_y;
+
+ EINA_LIST_FOREACH(sd->clients, l, ec)
+ {
+ if (ec->visibility.obscured == E_VISIBILITY_UNOBSCURED)
+ _e_desk_client_zoom(ec, zoomx, zoomy, cx, cy);
+ }
+
+ if (pos >= 1.0)
+ {
+ EINA_LIST_FOREACH(sd->clients, l, ec)
+ {
+ _e_desk_client_zoom(ec, zoomx, zoomy, cx, cy);
+ }
+
+ if ((sd->zoom.ratio_x != 1.0) ||
+ (sd->zoom.ratio_y != 1.0))
+ {
+ // Zoom enable done
+ sd->zoom.enabled = EINA_TRUE;
+ }
+ else
+ {
+ // Zoom disable done
+ _e_desk_util_comp_hwc_disable_set(EINA_FALSE);
+ }
+
+ sd->zoom.animator = NULL;
+ }
+
+ return ECORE_CALLBACK_PASS_ON;
+}
+
E_API void
e_desk_zoom_set(E_Desk *desk, double zoomx, double zoomy, int cx, int cy)
{
if ((sd->zoom.ratio_x != zoomx) || (sd->zoom.ratio_y != zoomy) ||
(sd->zoom.cord_x != cx) || (sd->zoom.cord_y != cy))
{
+ sd->zoom.prev_ratio_x = sd->zoom.ratio_x;
+ sd->zoom.prev_ratio_y = sd->zoom.ratio_y;
+ sd->zoom.prev_cord_x = sd->zoom.cord_x;
+ sd->zoom.prev_cord_y = sd->zoom.cord_y;
+
sd->zoom.ratio_x = zoomx;
sd->zoom.ratio_y = zoomy;
sd->zoom.cord_x = cx;
sd->zoom.cord_y = cy;
- _e_desk_object_zoom(desk->smart_obj, zoomx, zoomy, cx, cy);
- EINA_LIST_FOREACH(sd->clients, l, ec)
- _e_desk_client_zoom(ec, zoomx, zoomy, cx, cy);
+ if (e_config->desk_zoom_effect.enable)
+ {
+ sd->zoom.animator = ecore_animator_timeline_add(e_config->desk_zoom_effect.duration,
+ _animator_cb, desk);
+ _e_desk_object_zoom(desk->smart_obj, zoomx, zoomy, cx, cy);
+ }
+ else
+ {
+ _e_desk_object_zoom(desk->smart_obj, zoomx, zoomy, cx, cy);
+ EINA_LIST_FOREACH(sd->clients, l, ec)
+ {
+ _e_desk_client_zoom(ec, zoomx, zoomy, cx, cy);
+ }
+ }
}
if (!sd->zoom.enabled)
{
- sd->zoom.enabled = EINA_TRUE;
+ /* if desk_zoom_effect is enabled,
+ then sd->zoom.enabled will be set after finishing effect */
+ if (!e_config->desk_zoom_effect.enable)
+ sd->zoom.enabled = EINA_TRUE;
/*
* NOTE: evas_object_map_enable_set is called in _e_desk_client_zoom()
if (!sd->zoom.enabled)
goto end;
+ sd->zoom.prev_ratio_x = sd->zoom.ratio_x;
+ sd->zoom.prev_ratio_y = sd->zoom.ratio_y;
+ sd->zoom.prev_cord_x = sd->zoom.cord_x;
+ sd->zoom.prev_cord_y = sd->zoom.cord_y;
+
sd->zoom.ratio_x = 1.0;
sd->zoom.ratio_y = 1.0;
sd->zoom.cord_x = 0;
sd->zoom.cord_y = 0;
sd->zoom.enabled = EINA_FALSE;
- _e_desk_object_zoom(desk->smart_obj, sd->zoom.ratio_x, sd->zoom.ratio_y,
- sd->zoom.cord_x, sd->zoom.cord_y);
- /*
- * NOTE: evas_object_map_enable_set is called in _e_desk_client_zoom()
- */
- /*
- * evas_object_map_enable_set(desk->smart_obj, EINA_FALSE);
- */
- EINA_LIST_FOREACH(sd->clients, l, ec)
+ if (e_config->desk_zoom_effect.enable)
{
- /* NOTE Is it really necessary?
- * Why isn't it enough to just call evas_object_map_enable_set(false)? */
- _e_desk_client_zoom(ec, sd->zoom.ratio_x, sd->zoom.ratio_y,
+ sd->zoom.animator = ecore_animator_timeline_add(e_config->desk_zoom_effect.duration,
+ _animator_cb, desk);
+ _e_desk_object_zoom(desk->smart_obj, sd->zoom.ratio_x, sd->zoom.ratio_y,
sd->zoom.cord_x, sd->zoom.cord_y);
- //evas_object_map_enable_set(ec->frame, EINA_FALSE);
}
+ else
+ {
+ _e_desk_object_zoom(desk->smart_obj, sd->zoom.ratio_x, sd->zoom.ratio_y,
+ sd->zoom.cord_x, sd->zoom.cord_y);
+ /*
+ * NOTE: evas_object_map_enable_set is called in _e_desk_client_zoom()
+ */
+ /*
+ * evas_object_map_enable_set(desk->smart_obj, EINA_FALSE);
+ */
+ EINA_LIST_FOREACH(sd->clients, l, ec)
+ {
+ /* NOTE Is it really necessary?
+ * Why isn't it enough to just call evas_object_map_enable_set(false)? */
+ _e_desk_client_zoom(ec, sd->zoom.ratio_x, sd->zoom.ratio_y,
+ sd->zoom.cord_x, sd->zoom.cord_y);
+ //evas_object_map_enable_set(ec->frame, EINA_FALSE);
+ }
- /* FIXME TEMP enable hwc */
- _e_desk_util_comp_hwc_disable_set(EINA_FALSE);
+ /* FIXME TEMP enable hwc */
+ _e_desk_util_comp_hwc_disable_set(EINA_FALSE);
+ }
}
end:
if (!eina_list_data_find(sd->clients, ec))
goto end;
+ if (sd->zoom.animator)
+ goto end;
+
if (sd->zoom.enabled)
_e_desk_client_zoom(ec,
sd->zoom.ratio_x, sd->zoom.ratio_y,