static const char *vg_key = "_tizen_vg";
+/*
+ This api is required for tizen2.3 compatibility.
+ As elm_app_base_scale_set() in introduced in tizen 2.4 and
+ used in the calculation of scaling. For appliaction's thats
+ written on tizen2.3 the default value is 1 , but we need 1.7
+ for qHD display hence the hack.
+ From tizen2.4 onwards its the application responsibility to set
+ the base scale properly.
+*/
+static double
+ELM_VG_SCALE_SIZE(double x)
+{
+ if (elm_app_base_scale_get() > 1)
+ return ELM_SCALE_SIZE(x);
+ else
+ return (((x) / 1.7) * elm_config_scale_get());
+}
/////////////////////////////////////////////////////////////////////////
/* Radio */
/////////////////////////////////////////////////////////////////////////
if (elm_radio_selected_object_get(vd->obj) != vd->obj)
progress = 1 - progress;
- double radius =
- ELM_SCALE_SIZE((center_x > center_y ? center_x : center_y) - 2);
+ double radius = (center_x > center_y ? center_x : center_y)
+ - (2 * ELM_VG_SCALE_SIZE(1.5));
//Iconic Circle (Outline)
evas_vg_shape_stroke_width_set(vd->shape[2],
- (1 + progress * ELM_SCALE_SIZE(1.5)));
+ (1 + progress * ELM_VG_SCALE_SIZE(1.5)));
//Iconic Circle (Outline)
evas_vg_shape_shape_reset(vd->shape[2]);
evas_vg_shape_shape_append_circle(vd->shape[2], center_x, center_y,
//Outline Shape
vd->shape[0] = evas_vg_shape_add(evas_object_vg_root_node_get(vd->vg[0]));
evas_vg_shape_stroke_color_set(vd->shape[0], 255, 255, 255, 255);
- evas_vg_shape_stroke_width_set(vd->shape[0], ELM_SCALE_SIZE(1));
+ evas_vg_shape_stroke_width_set(vd->shape[0], ELM_VG_SCALE_SIZE(1));
//Center Circle
vd->shape[1] = evas_vg_shape_add(evas_object_vg_root_node_get(vd->vg[1]));
//Iconic Circle (Outline)
vd->shape[2] = evas_vg_shape_add(evas_object_vg_root_node_get(vd->vg[2]));
evas_vg_shape_stroke_color_set(vd->shape[2], 255, 255, 255, 255);
- evas_vg_shape_stroke_width_set(vd->shape[2], ELM_SCALE_SIZE(1.5));
+ evas_vg_shape_stroke_width_set(vd->shape[2], ELM_VG_SCALE_SIZE(1.5));
//Iconic Circle (Center Point)
vd->shape[3] = evas_vg_shape_add(evas_object_vg_root_node_get(vd->vg[2]));
Evas_Coord center_x = (w / 2);
Evas_Coord center_y = (h / 2);
- double radius =
- ELM_SCALE_SIZE((center_x > center_y ? center_x : center_y) - 2);
+ double radius = (center_x > center_y ? center_x : center_y)
+ -(2 * ELM_VG_SCALE_SIZE(1.5));
//Outline
evas_vg_shape_shape_reset(vd->shape[0]);
//Outline Star
vd->shape[0] = evas_vg_shape_add(evas_object_vg_root_node_get(vd->vg[0]));
evas_vg_shape_stroke_color_set(vd->shape[0], 255, 255, 255, 255);
- evas_vg_shape_stroke_width_set(vd->shape[0], ELM_SCALE_SIZE(1.5));
+ evas_vg_shape_stroke_width_set(vd->shape[0], ELM_VG_SCALE_SIZE(1.5));
evas_vg_shape_stroke_join_set(vd->shape[0], EFL_GFX_JOIN_ROUND);
//Inner Body Star
//Inner Star Body
evas_vg_shape_shape_reset(vd->shape[idx]);
evas_vg_shape_shape_append_move_to(vd->shape[idx],
- center_x + ELM_SCALE_SIZE(STAR_PT[0][0]),
- center_y + ELM_SCALE_SIZE(STAR_PT[0][1]));
+ center_x + ELM_VG_SCALE_SIZE(STAR_PT[0][0]),
+ center_y + ELM_VG_SCALE_SIZE(STAR_PT[0][1]));
int i;
for (i = 1; i < PT_CNT; i++)
{
evas_vg_shape_shape_append_line_to(vd->shape[idx],
- center_x + ELM_SCALE_SIZE(STAR_PT[i][0]),
- center_y + ELM_SCALE_SIZE(STAR_PT[i][1]));
+ center_x + ELM_VG_SCALE_SIZE(STAR_PT[i][0]),
+ center_y + ELM_VG_SCALE_SIZE(STAR_PT[i][1]));
}
evas_vg_shape_shape_append_close(vd->shape[idx]);
//Line Shape
vd->shape[2] = evas_vg_shape_add(evas_object_vg_root_node_get(vd->vg[2]));
evas_vg_shape_stroke_color_set(vd->shape[2], 255, 255, 255, 255);
- evas_vg_shape_stroke_width_set(vd->shape[2], ELM_SCALE_SIZE(2));
+ evas_vg_shape_stroke_width_set(vd->shape[2], ELM_VG_SCALE_SIZE(2));
evas_vg_shape_stroke_cap_set(vd->shape[2], EFL_GFX_CAP_ROUND);
//Circle Shape
vd->shape[3] = evas_vg_shape_add(evas_object_vg_root_node_get(vd->vg[2]));
evas_vg_shape_stroke_color_set(vd->shape[3], 255, 255, 255, 255);
- evas_vg_shape_stroke_width_set(vd->shape[3], ELM_SCALE_SIZE(2));
+ evas_vg_shape_stroke_width_set(vd->shape[3], ELM_VG_SCALE_SIZE(2));
}
static void
evas_vg_shape_shape_reset(vd->shape[3]);
- double radius =
- ELM_SCALE_SIZE((center_x > center_y ? center_x : center_y) - 2);
+ double radius = (center_x > center_y ? center_x : center_y) -
+ (2 * ELM_VG_SCALE_SIZE(2));
evas_vg_shape_shape_append_circle(vd->shape[3], center_x, center_y,
radius);
if (!elm_check_state_get(vd->obj)) progress = 1 - progress;
- double diff = ELM_SCALE_SIZE(center_y - 2);
+ double diff = center_y - ELM_VG_SCALE_SIZE(2);
evas_vg_shape_shape_append_move_to(vd->shape[2], center_x,
(center_y - (diff * progress)));
//Line
if (elm_check_state_get(vd->obj))
{
- double diff = ELM_SCALE_SIZE(2);
+ double diff = ELM_VG_SCALE_SIZE(2);
evas_vg_shape_shape_append_move_to(vd->shape[2], center_x, diff);
evas_vg_shape_shape_append_line_to(vd->shape[2], center_x, h - diff);
//Circle
else
{
- double radius = ELM_SCALE_SIZE(center_x - 2);
+ double radius = center_x - (2 * ELM_VG_SCALE_SIZE(2));
evas_vg_shape_shape_append_circle(vd->shape[3],
center_x, center_y, radius);
}
//Outline Shape
vd->shape[0] = evas_vg_shape_add(base_root);
evas_vg_shape_stroke_color_set(vd->shape[0], 255, 255, 255, 255);
- evas_vg_shape_stroke_width_set(vd->shape[0], ELM_SCALE_SIZE(1.25));
+ evas_vg_shape_stroke_width_set(vd->shape[0], ELM_VG_SCALE_SIZE(1.25));
//BG Shape
vd->shape[1] = evas_vg_shape_add(base_root);
//Left Line Shape
vd->shape[2] = evas_vg_shape_add(line_root);
- evas_vg_shape_stroke_width_set(vd->shape[2], ELM_SCALE_SIZE(1.75));
+ evas_vg_shape_stroke_width_set(vd->shape[2], ELM_VG_SCALE_SIZE(1.75));
evas_vg_shape_stroke_color_set(vd->shape[2], 255, 255, 255, 255);
evas_vg_shape_stroke_cap_set(vd->shape[2], EFL_GFX_CAP_ROUND);
//Right Line Shape
vd->shape[3] = evas_vg_shape_add(line_root);
- evas_vg_shape_stroke_width_set(vd->shape[3], ELM_SCALE_SIZE(1.75));
+ evas_vg_shape_stroke_width_set(vd->shape[3], ELM_VG_SCALE_SIZE(1.75));
evas_vg_shape_stroke_color_set(vd->shape[3], 255, 255, 255, 255);
evas_vg_shape_stroke_cap_set(vd->shape[3], EFL_GFX_CAP_ROUND);
- vd->left_move_to[0] = ELM_SCALE_SIZE(-5);
- vd->left_move_to[1] = ELM_SCALE_SIZE(10);
- vd->left_line_to[0] = ELM_SCALE_SIZE(-8);
- vd->left_line_to[1] = ELM_SCALE_SIZE(-8);
+ vd->left_move_to[0] = ELM_VG_SCALE_SIZE(-5);
+ vd->left_move_to[1] = ELM_VG_SCALE_SIZE(10);
+ vd->left_line_to[0] = ELM_VG_SCALE_SIZE(-8);
+ vd->left_line_to[1] = ELM_VG_SCALE_SIZE(-8);
- vd->right_move_to[0] = ELM_SCALE_SIZE(-5);
- vd->right_move_to[1] = ELM_SCALE_SIZE(10);
- vd->right_line_to[0] = ELM_SCALE_SIZE(18);
- vd->right_line_to[1] = ELM_SCALE_SIZE(-18);
+ vd->right_move_to[0] = ELM_VG_SCALE_SIZE(-5);
+ vd->right_move_to[1] = ELM_VG_SCALE_SIZE(10);
+ vd->right_line_to[0] = ELM_VG_SCALE_SIZE(18);
+ vd->right_line_to[1] = ELM_VG_SCALE_SIZE(-18);
}
static void
//Update Outline Shape
evas_vg_shape_shape_reset(vd->shape[0]);
- evas_vg_shape_shape_append_rect(vd->shape[0], 1, 1, w - 2, h -2, 5, 5);
+ evas_vg_shape_shape_append_rect(vd->shape[0], 1, 1,
+ w - 2, h - 2,
+ ELM_VG_SCALE_SIZE(5),
+ ELM_VG_SCALE_SIZE(5));
//Update BG Shape
evas_vg_shape_shape_reset(vd->shape[1]);
- evas_vg_shape_shape_append_rect(vd->shape[1], 0, 0, w, h, 5, 5);
+ evas_vg_shape_shape_append_rect(vd->shape[1], 0, 0, w, h,
+ ELM_VG_SCALE_SIZE(5),
+ ELM_VG_SCALE_SIZE(5));
if (elm_check_state_get(vd->obj))
evas_vg_node_color_set(vd->shape[1], 255, 255, 255, 255);
else
Evas_Coord x, y, w, h;
evas_object_geometry_get(vd->vg[1], &x, &y, &w, &h);
evas_vg_shape_shape_reset(vd->shape[1]);
- evas_vg_shape_shape_append_rect(vd->shape[1], 0, 0, w, h, 35, 100);
+ evas_vg_shape_shape_append_rect(vd->shape[1], 0, 0, w, h, ELM_VG_SCALE_SIZE(35),
+ 100);
}
static void
Evas_Coord w, h;
evas_object_geometry_get(vd->vg[0], NULL, NULL, &w, &h);
evas_vg_shape_shape_reset(vd->shape[0]);
- evas_vg_shape_shape_append_rect(vd->shape[0], 0, 0, w, h, 35, 100);
+ evas_vg_shape_shape_append_rect(vd->shape[0], 0, 0, w, h, ELM_VG_SCALE_SIZE(35),
+ 100);
}
static void
!strcmp(str, "process_medium") ||
!strcmp(str, "process_small"))
{
- vd->stroke_width = ELM_SCALE_SIZE(3);
+ vd->stroke_width = ELM_VG_SCALE_SIZE(3);
if (!strcmp(str, "process_medium"))
{
- vd->stroke_width = ELM_SCALE_SIZE(2);
+ vd->stroke_width = ELM_VG_SCALE_SIZE(2);
}
if (!strcmp(str, "process_small"))
{
- vd->stroke_width = ELM_SCALE_SIZE(1.5);
+ vd->stroke_width = ELM_VG_SCALE_SIZE(1.5);
}
vd->shrink = 2 * vd->stroke_width;
vd->shift = vd->stroke_width + 0.5;