static void add_ellipse(CrItem *group) { double x, y, width, height, orientation, tmp1, tmp2; GArray *array; CrItem *item; guint color; x = g_random_double_range(0, 360); y = g_random_double_range(0, 360); tmp1 = g_random_double_range(10, 200); tmp2 = g_random_double_range(10, 200); width = MAX(tmp1, tmp2); height = MIN(tmp1, tmp2); orientation = g_random_double_range(0, G_PI); color = g_random_int_range(0,255) << 24 | g_random_int_range(0,255) << 16 | g_random_int_range(0,255) << 8 | 0xff; item = cr_ellipse_new(group, x, y, width, height, orientation, "outline_color_rgba", 0x000000ff, "line_scaleable", FALSE, "line_width", 2.0, "fill_color_rgba", color, NULL); g_signal_connect(item, "event", (GCallback) item_event, NULL); }
void add_circle(CrItem *group, struct point p) { CrItem *circle; cr_ellipse_new(group, p.x , p.y,CIRCLE_RADIUS,CIRCLE_RADIUS, 0, "outline_color_rgba", CIRCLE_COLOR, "line_width", 1.5, NULL); }