[E_POINTER_HOOK_HIDE] = NULL,
};
+static void
+_e_pointer_configured_output_resolution_ratio_get(E_Client *ec, double *ratio_w, double *ratio_h)
+{
+ E_Output *output;
+
+ if (ratio_w) *ratio_w = 1.0;
+ if (ratio_h) *ratio_h = 1.0;
+
+ if (!e_config->cursor_configured_output_resolution.use) return;
+ if (e_config->cursor_configured_output_resolution.w == 0) return;
+ if (e_config->cursor_configured_output_resolution.h == 0) return;
+
+ if (!ec) return;
+ if (!ec->zone) return;
+
+ output = e_output_find(ec->zone->output_id);
+ if (!output) return;
+ if (output->config.geom.w == 0) return;
+ if (output->config.geom.h == 0) return;
+
+ if (ratio_w)
+ *ratio_w = (double)output->config.geom.w /
+ (double)e_config->cursor_configured_output_resolution.w;
+ if (ratio_h)
+ *ratio_h = (double)output->config.geom.h /
+ (double)e_config->cursor_configured_output_resolution.h;
+}
+
/* move the cursor image with the calcaultion of the hot spot */
static void
_e_pointer_position_update(E_Pointer *ptr)
int rotation;
int cursor_w, cursor_h;
E_Client *ec;
+ double ratio_w = 1.0, ratio_h = 1.0;
+ int hot_x = 0, hot_y = 0;
if (!ptr->o_ptr) return;
rotation = ptr->rotation;
evas_object_geometry_get(ec->frame, NULL, NULL, &cursor_w, &cursor_h);
+ _e_pointer_configured_output_resolution_ratio_get(ec, &ratio_w, &ratio_h);
+
+ if ((ratio_w != 1.0) || (ratio_h != 1.0))
+ {
+ hot_x = (int)((double)ptr->hot.x * ratio_w);
+ hot_y = (int)((double)ptr->hot.y * ratio_h);
+ }
+ else
+ {
+ hot_x = ptr->hot.x;
+ hot_y = ptr->hot.y;
+ }
switch (rotation)
{
case 0:
- nx = ptr->x - ptr->hot.x;
- ny = ptr->y - ptr->hot.y;
+ nx = ptr->x - hot_x;
+ ny = ptr->y - hot_y;
break;
case 90:
- nx = ptr->x - ptr->hot.y;
- ny = ptr->y + ptr->hot.x;
+ nx = ptr->x - hot_y;
+ ny = ptr->y + hot_x;
break;
case 180:
- nx = ptr->x + ptr->hot.x;
- ny = ptr->y + ptr->hot.y;
+ nx = ptr->x + hot_x;
+ ny = ptr->y + hot_y;
break;
case 270:
- nx = ptr->x + ptr->hot.y;
- ny = ptr->y - ptr->hot.x;
+ nx = ptr->x + hot_y;
+ ny = ptr->y - hot_x;
break;
default:
- nx = ptr->x - ptr->hot.x;
- ny = ptr->y - ptr->hot.y;
+ nx = ptr->x - hot_x;
+ ny = ptr->y - hot_y;
break;
}
}
static void
-_e_pointer_object_rotation(E_Pointer *ptr)
+_e_pointer_object_map_update(E_Pointer *ptr)
{
E_Map *map;
int x, y, w, h;
E_Client *ec;
- int rotation;
+ int rotation = 0;
+ double ratio_w = 1.0, ratio_h = 1.0;
EINA_SAFETY_ON_NULL_RETURN(ptr);
if (!ptr->o_ptr) return;
ec = e_comp_object_client_get(ptr->o_ptr);
EINA_SAFETY_ON_NULL_RETURN(ec);
+ _e_pointer_configured_output_resolution_ratio_get(ec, &ratio_w, &ratio_h);
rotation = ptr->rotation;
- evas_object_geometry_get(ec->frame, &x, &y, &w, &h);
-
- if ((rotation == 0) || (rotation % 90 != 0) || (rotation / 90 > 3))
+ if (((ratio_w == 1.0) && (ratio_h == 1.0)) &&
+ ((rotation == 0) || (rotation % 90 != 0) || (rotation / 90 > 3)))
{
e_client_map_enable_set(ec, EINA_FALSE);
e_client_map_set(ec, NULL);
return;
}
+ evas_object_geometry_get(ec->frame, &x, &y, &w, &h);
+
map = e_map_new();
+ EINA_SAFETY_ON_NULL_RETURN(map);
+
e_map_util_points_populate_from_object_full(map, ec->frame, 0);
- e_map_util_points_color_set(map, 255, 255, 255, 255);
- if (rotation == 90)
- rotation = 270;
- else if (rotation == 270)
- rotation = 90;
- e_map_util_rotate(map, rotation, x, y);
+ if ((ratio_w != 1.0) || (ratio_h != 1.0))
+ {
+ e_map_point_coord_set(map, 1, x + (int)((double)w * ratio_w), y, 0);
+ e_map_point_coord_set(map, 2, x + (int)((double)w * ratio_w),
+ y + (int)((double)h * ratio_h), 0);
+ e_map_point_coord_set(map, 3, x, y + (int)((double)h * ratio_h), 0);
+ }
+
+ if (rotation)
+ {
+ if (rotation == 90)
+ rotation = 270;
+ else if (rotation == 270)
+ rotation = 90;
+
+ e_map_util_rotate(map, rotation, x, y);
+ }
+
+ e_map_util_points_color_set(map, 255, 255, 255, 255);
e_map_util_object_move_sync_set(map, EINA_TRUE);
e_client_map_set(ec, map);
// TODO: transform the cursor position with hot spot...!!!!!!
static void
-_e_pointer_rotation_apply(E_Pointer *ptr)
+_e_pointer_map_apply(E_Pointer *ptr)
{
EINA_SAFETY_ON_NULL_RETURN(ptr);
if (ptr->hwc)
e_comp_object_hwc_update_set(ptr->o_ptr, EINA_TRUE);
else
- _e_pointer_object_rotation(ptr);
+ _e_pointer_object_map_update(ptr);
}
static void
/* move the pointer to the current position */
_e_pointer_position_update(ptr);
- /* apply the cursor obj rotation */
- _e_pointer_rotation_apply(ptr);
+ /* apply the cursor obj map */
+ _e_pointer_map_apply(ptr);
}
if (need_call_hide)
ptr->rotation = rotation;
_e_pointer_position_update(ptr);
- _e_pointer_rotation_apply(ptr);
+ _e_pointer_map_apply(ptr);
EINA_LIST_FOREACH(e_input_devices_get(), l, dev)
e_input_device_pointer_rotation_set(dev, rotation);
else
{
_e_pointer_position_update(ptr);
- _e_pointer_rotation_apply(ptr);
+ _e_pointer_map_apply(ptr);
}
return EINA_TRUE;