static void display_hint(double scroll_amount) { if(!scroll_hint) { Ewl_Embed *emb = ewl_embed_widget_find(pdfwidget); scroll_hint = evas_object_line_add(emb->canvas); evas_object_color_set(scroll_hint, 0, 200, 0, 255); } int y_coord = round(scroll_amount); if(y_coord < 0) { y_coord += CURRENT_H(scrollpane); } evas_object_line_xy_set(scroll_hint, 0, y_coord, CURRENT_W(scrollpane), y_coord); evas_object_show(scroll_hint); if(hint_timer) { // previously set, did not fire ecore_timer_del(hint_timer); } hint_timer = ecore_timer_add(2.0, hide_hint, NULL); }
void ghost_line_redraw(Eina_List *data, double x, double y) { XY *xy; Evas *e; Drawing *d; double x1, y1, x2, y2; if (!data) return; e = shell->evas; d = drawing; if (!d) return; xy = (XY *) eina_list_last(data)->data; x1 = w2s_x(xy->x); y1 = w2s_y(xy->y); x2 = w2s_x(x); y2 = w2s_y(y); evas_object_show(o_line); evas_object_line_xy_set(o_line, x1, y1, x2, y2); }
void _line_item_xy(Evas *e, Evas_Object *o, double x1, double y1, double x2, double y2, double w) { int sn; int i; int is_poly = 0; if ((x1 == x2) && (y1 == y2)) { evas_object_hide(o); return; } is_poly = (w > 1); sn = shell->segnum; sn = (w < sn) ? w / 2 : sn; if (!sn) sn = 1; if (is_poly) { double xx1, yy1, xx2, yy2, an, x, y; if (x2 > x1) { xx1 = x1; yy1 = y1; xx2 = x2; yy2 = y2; } else { xx1 = x2; yy1 = y2; xx2 = x1; yy2 = y1; } if (x2 - x1 != 0.0) { an = atan((y2 - y1) / (x2 - x1)) + M_PI / 2; } else { if (y2 - y1 <= 0) { an = M_PI; } else { an = 0; } } evas_object_polygon_points_clear(o); for (i = 0; i < sn + 1; i++) { x = xx1 + w / 2 * cos(an + i * M_PI / sn); y = yy1 + w / 2 * sin(an + i * M_PI / sn); evas_object_polygon_point_add(o, x, y); } for (i = sn; i >= 0; i--) { x = xx2 + w / 2 * cos(an - i * M_PI / sn); y = yy2 + w / 2 * sin(an - i * M_PI / sn); evas_object_polygon_point_add(o, x, y); } } else { evas_object_line_xy_set(o, x1, y1, x2, y2); } }