Eo *texture = NULL;
Eo *light = NULL;
-
static Eina_Bool
_redraw_aabb();
evas_canvas3d_mesh_vertex_assembly_set(mesh_box, EVAS_CANVAS3D_VERTEX_ASSEMBLY_LINES);
evas_canvas3d_mesh_shader_mode_set(mesh_box, EVAS_CANVAS3D_SHADER_MODE_VERTEX_COLOR);
evas_canvas3d_mesh_frame_material_set(mesh_box, 0, material_box);
- _redraw_aabb();
+ _redraw_aabb();
evas_canvas3d_node_member_add(root_node, mesh_box_node);
evas_canvas3d_node_mesh_add(mesh_box_node, mesh_box);
printf("sfactor = %s, dfactor = %s\n", blend_func_names[func1], blend_func_names[func2]);
}
-
static void
_on_delete(Ecore_Evas *ee EINA_UNUSED)
{
evas_canvas3d_camera_projection_perspective_set(data->camera, 60.0, 1.0, 2.0, 50.0);
- data->camera_node =
+ data->camera_node =
efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
- evas_canvas3d_node_camera_set(data->camera_node, data->camera);
- evas_canvas3d_node_position_set(data->camera_node, 0.0, 0.0, 10.0);
- evas_canvas3d_node_look_at_set(data->camera_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
+ evas_canvas3d_node_camera_set(data->camera_node, data->camera);
+ evas_canvas3d_node_position_set(data->camera_node, 0.0, 0.0, 10.0);
+ evas_canvas3d_node_look_at_set(data->camera_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
- evas_canvas3d_node_member_add(data->root_node, data->camera_node);
+ evas_canvas3d_node_member_add(data->root_node, data->camera_node);
}
static void
/* Set the image object as render target for 3D scene. */
efl_canvas_scene3d_set(image, data.scene);
-
/* Add animation timer callback. */
ecore_animator_frametime_set(0.008);
anim = ecore_animator_add(_animate_scene, &data);
}
};
- typedef struct _Object
- {
+typedef struct _Object
+{
Eo *primitive;
Eo *node;
Eo *mesh;
Eina_Bool (*sphere_init)(void *sphere, const char *texture);
Eina_Bool (*sphere_animate)(void *data);
- } Test_object;
+} Test_object;
typedef struct _Scene
{
}
eina_list_free(globalscene.spheres);
-
ecore_main_loop_quit();
}
+
static void
_on_canvas_resize(Ecore_Evas *ee)
{
static int angle = 0.0;
Eo *n = (Eo*)(((Test_object *)data)->node);
Evas_Real s = ((Test_object *)data)->speed;
+
evas_canvas3d_node_orientation_angle_axis_set(n, angle, s, s - 1, s + 1);
angle++;
if (angle > 360) angle = 0.0;
+
return EINA_TRUE;
}
}
}
}
+
static void
_on_key_down(void *data EINA_UNUSED, Evas *e EINA_UNUSED,
Evas_Object *eo EINA_UNUSED, void *event_info)
Evas_Real x, y, z;
Eina_List *l;
Test_object * item;
+
if (!strcmp(ev->key, "Down"))
{
evas_canvas3d_node_position_get(globalscene.camera_node, EVAS_CANVAS3D_SPACE_PARENT, &x, &y, &z);
else
printf("Down, Up for position of camera; Left, Right for scale of each node");
}
+
static void
_on_mouse_down(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *eo EINA_UNUSED, void *event_info)
{
_init_sphere(void *this, const char *texture)
{
Test_object *sphere = (Test_object *)this;
+
sphere->primitive = efl_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas);
sphere->mesh = efl_add(EVAS_CANVAS3D_MESH_CLASS, evas);
sphere->material = efl_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
evas_canvas3d_material_color_set(sphere->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 1.0, 1.0, 1.0, 1.0);
evas_canvas3d_material_color_set(sphere->material, EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0);
evas_canvas3d_material_shininess_set(sphere->material, 50.0);
+
return EINA_TRUE;
}
-
Eina_Bool
_init_scene(const char *texture)
{
for (i = 0; i < globalscene.col * globalscene.row; i++)
{
Test_object *spheretmp;
+
m = malloc(sizeof(Test_object));
m->sphere_init = _init_sphere;
if (!i)
evas_canvas3d_scene_root_node_set(globalscene.scene, globalscene.root_node);
evas_canvas3d_scene_camera_node_set(globalscene.scene, globalscene.camera_node);
evas_canvas3d_scene_size_set(globalscene.scene, WIDTH, HEIGHT);
+
return EINA_TRUE;
}
if (!texture) texture = (char *)image_path;
printf("row - %d, col - %d, precision of spheres - %d, texture - %s\n",
- row, col, precision, texture);
+ row, col, precision, texture);
ecore_evas = ecore_evas_new("opengl_x11", 10, 10, WIDTH, HEIGHT, NULL);
_continue_scene(void *data)
{
Scene_Data *d = (Scene_Data *)data;
+
if (d->mouse_indicator == 1)
{
evas_event_feed_mouse_down(evas, 1, EVAS_BUTTON_NONE, 0, &data);
}
+
return EINA_TRUE;
}
-
static void
_rotate_x_reload(Evas_Canvas3D_Scene *eo_scene, Evas_Event_Mouse_Down *ev, Evas_Canvas3D_Node *node, Evas_Canvas3D_Mesh *mesh,
float *angle_diff, Evas_Coord *mouse_coord)
_stop_scene(void *data, Evas *_evas EINA_UNUSED, Evas_Object *eo EINA_UNUSED, void *event_info EINA_UNUSED)
{
Scene_Data *d = (Scene_Data *)data;
+
d->angle = 0.0;
d->mouse_indicator = 2;
}
Evas *evas = NULL;
Eo *background = NULL;
Eo *image = NULL;
-
Eo *scene = NULL;
Eo *root_node = NULL;
Eo *camera_node = NULL;
evas_canvas3d_camera_projection_perspective_set(data->camera, 60.0, 1.0, 2.0, 50.0);
- data->camera_node =
+ data->camera_node =
efl_add(EVAS_CANVAS3D_NODE_CLASS, evas, evas_canvas3d_node_constructor(efl_added, EVAS_CANVAS3D_NODE_TYPE_CAMERA));
- evas_canvas3d_node_camera_set(data->camera_node, data->camera);
- evas_canvas3d_node_position_set(data->camera_node, 0.0, 0.0, 7.0);
- evas_canvas3d_node_look_at_set(data->camera_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
+ evas_canvas3d_node_camera_set(data->camera_node, data->camera);
+ evas_canvas3d_node_position_set(data->camera_node, 0.0, 0.0, 7.0);
+ evas_canvas3d_node_look_at_set(data->camera_node, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_CANVAS3D_SPACE_PARENT, 0.0, 1.0, 0.0);
- evas_canvas3d_node_member_add(data->root_node, data->camera_node);
+ evas_canvas3d_node_member_add(data->root_node, data->camera_node);
}
static void
evas_canvas3d_mesh_frame_material_set(mesh, 0, material);
}
-
static void
_mesh_setup(Scene_Data *data)
{
v_count = evas_canvas3d_mesh_vertex_count_get(mesh);
printf("Vertex count is %d for convex hull\n",
- v_count);
+ v_count);
v_count = evas_canvas3d_mesh_vertex_count_get(convex_mesh);
printf("Vertex count is %d for blender convex hull\n\n",
- v_count);
+ v_count);
return;
}
{
int i;
char buffer[PATH_MAX], full_file_path[PATH_MAX];
+
// Unless Evas 3D supports Software renderer, we set gl backend forcely.
setenv("ECORE_EVAS_ENGINE", "opengl_x11", 1);
evas_canvas3d_scene_pick(d->scene, ev->canvas.x, ev->canvas.y, &n, &m, &s, &t);
}
+
int
main(void)
{
Scene_Data data;
Ecore_Animator *anim;
Eina_List *nodes1 = NULL, *nodes2 = NULL;
+
// Unless Evas 3D supports Software renderer, we set gl backend forcely.
setenv("ECORE_EVAS_ENGINE", "opengl_x11", 1);
if (!ecore_evas_init()) return 0;
evas_canvas3d_scene_root_node_set(data->scene, data->root_node);
evas_canvas3d_scene_camera_node_set(data->scene, data->camera_node);
}
+
static void
_on_key_down(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *eo EINA_UNUSED,
void *event_info)
else if(!strcmp("Down", ev->key))
animation_type = EINA_TRUE;
}
+
int
main(void)
{
strcmp(ev->key, "h") == 0) /* print help */
{
printf("commands are:\n"
- "\tc - cycle aspect control on object\n"
- "\th - change horizontal aspect component\n"
- "\tv - change vertical aspect component\n"
- "\ts - print current object's status\n"
- "\tH - print help\n");
+ "\tc - cycle aspect control on object\n"
+ "\th - change horizontal aspect component\n"
+ "\tv - change vertical aspect component\n"
+ "\ts - print current object's status\n"
+ "\tH - print help\n");
return;
}
evas_object_size_hint_aspect_get(d.rect, &aspect, &w, &h);
printf("Object has aspect %s, with horizontal compontent %d"
- " and vertical component %d\n",
- _get_aspect_name(aspect), w, h);
+ " and vertical component %d\n",
+ _get_aspect_name(aspect), w, h);
return;
}
evas_object_size_hint_aspect_set(d.rect, aspect, w, h);
printf("Changing aspect control to %s\n",
- _get_aspect_name(aspect));
+ _get_aspect_name(aspect));
return;
}
evas_object_box_align_set(d.box, h, v);
- printf("Applying new alignment values (%.1f, %.1f)"
- " on the box\n", h, v);
+ printf("Applying new alignment values (%.1f, %.1f) on the box\n",
+ h, v);
return;
}
evas_object_box_padding_set(d.box, h, v);
- printf("Applying new padding values (%d, %d)"
- " on the box\n", h, v);
+ printf("Applying new padding values (%d, %d) on the box\n",
+ h, v);
return;
}
evas_object_box_layout_set(
d.box, evas_object_box_layout_horizontal, NULL, NULL);
- printf("Applying '%s' layout on the box\n", "horizontal");
+ printf("Applying '%s' layout on the box\n",
+ "horizontal");
return;
}
evas_object_box_layout_set(
d.box, evas_object_box_layout_vertical, NULL, NULL);
- printf("Applying '%s' layout on the box\n", "vertical");
+ printf("Applying '%s' layout on the box\n",
+ "vertical");
return;
}
NULL);
printf("Applying '%s' layout on the box\n",
- "horizontal homogeneous");
+ "horizontal homogeneous");
return;
}
d.box, evas_object_box_layout_homogeneous_vertical, NULL, NULL);
printf("Applying '%s' layout on the box\n",
- "vertical homogeneous");
+ "vertical homogeneous");
return;
}
NULL, NULL);
printf("Applying '%s' layout on the box\n",
- "horizontal maximum size homogeneous");
+ "horizontal maximum size homogeneous");
return;
}
NULL, NULL);
printf("Applying '%s' layout on the box\n",
- "vertical maximum size homogeneous");
+ "vertical maximum size homogeneous");
return;
}
evas_object_box_layout_set(
d.box, evas_object_box_layout_flow_horizontal, NULL, NULL);
- printf("Applying '%s' layout on the box\n", "horizontal flow");
+ printf("Applying '%s' layout on the box\n",
+ "horizontal flow");
return;
}
evas_object_box_layout_set(
d.box, evas_object_box_layout_flow_vertical, NULL, NULL);
- printf("Applying '%s' layout on the box\n", "vertical flow");
+ printf("Applying '%s' layout on the box\n",
+ "vertical flow");
return;
}
evas_object_box_layout_set(
d.box, evas_object_box_layout_stack, NULL, NULL);
- printf("Applying '%s' layout on the box\n", "stack");
+ printf("Applying '%s' layout on the box\n",
+ "stack");
return;
}
{
evas_object_box_layout_set(d.box, _custom_layout, NULL, NULL);
- printf("Applying '%s' layout on the box\n", "CUSTOM");
+ printf("Applying '%s' layout on the box\n",
+ "CUSTOM");
return;
}
}
ecore_evas_shutdown();
return EXIT_FAILURE;
}
-
void *event_info)
{
printf("An object got focused: %s\n",
- evas_object_name_get(event_info));
+ evas_object_name_get(event_info));
printf("Let's recheck it: %s\n",
- evas_object_name_get(evas_focus_get(e)));
+ evas_object_name_get(evas_focus_get(e)));
printf("And again: %s\n", evas_object_focus_get(event_info) ?
- "OK!" : "Oops, something is bad.");
+ "OK!" : "Oops, something is bad.");
}
/* render flush callback */
_thaw_cb(void *data EINA_UNUSED)
{
printf("Canvas was frozen %d times, now thawing.\n",
- evas_event_freeze_get(d.canvas));
+ evas_event_freeze_get(d.canvas));
evas_event_thaw(d.canvas);
return EINA_FALSE; /* do not re-issue the timer */
}
Evas_Event_Key_Down *ev = einfo;
printf("We've got key input: %s\n", ev->key);
- printf("It actually came from %s\n", d.focus ?
- "focus" : "key grab");
+ printf("It actually came from %s\n",
+ d.focus ? "focus" : "key grab");
if (strcmp(ev->key, "h") == 0) /* print help */
{
Evas_Modifier_Mask mask =
evas_key_modifier_mask_get(d.canvas, "Control");
- printf("Switching to %s for key input\n", d.focus ?
- "key grabs" : "focus");
+ printf("Switching to %s for key input\n",
+ d.focus ? "key grabs" : "focus");
if (d.focus)
{
evas_object_focus_set(d.bg, EINA_FALSE);
printf("Focused object is now %s\n",
- evas_focus_get(d.canvas) ?
- "still valid! Something went wrong." : "none.");
+ evas_focus_get(d.canvas) ?
+ "still valid! Something went wrong." : "none.");
ret = evas_object_key_grab(d.bg, "a", 0, 0, EINA_TRUE);
if (!ret)
{
Eina_Bool precise = evas_object_precise_is_inside_get(d.img);
- printf("Toggling precise point collision detection %s on"
- " Enlightenment logo\n", precise ? "off" : "on");
+ printf("Toggling precise point collision detection %s on Enlightenment logo\n",
+ precise ? "off" : "on");
evas_object_precise_is_inside_set(d.img, !precise);
return;
float model[16], mvp[16];
GLData *gl_data = data;
Evas_GL_API *glapi = gl_data->glapi;
-
Evas_Coord w, h;
+
evas_object_image_size_get(obj, &w, &h);
//Set up the context and surface as the current one
{
float aspect;
Evas_Coord w,h;
+
evas_object_geometry_get( obj, NULL, NULL, &w, &h);
GLData *gl_data = data;
double x, y;
evas_object_size_hint_align_get(rect, &x, &y);
- printf("\talign hints: h(%f), v(%f)\n", x, y);
+ printf("\talign hints: h(%f), v(%f)\n",
+ x, y);
efl_gfx_size_hint_combined_min_get(rect, &w, &h);
- printf("\tmin. size hints: h(%d), v(%d)\n", w, h);
+ printf("\tmin. size hints: h(%d), v(%d)\n",
+ w, h);
evas_object_size_hint_max_get(rect, &w, &h);
- printf("\tmax. size hints: h(%d), v(%d)\n", w, h);
+ printf("\tmax. size hints: h(%d), v(%d)\n",
+ w, h);
evas_object_size_hint_padding_get(rect, &l, &r, &t, &b);
printf("\tpadding hints: l(%d), r(%d), t(%d), b(%d)\n",
- l, r, t, b);
+ l, r, t, b);
evas_object_size_hint_weight_get(rect, &x, &y);
- printf("\tweight hints: h(%f), v(%f)\n", x, y);
+ printf("\tweight hints: h(%f), v(%f)\n",
+ x, y);
}
/* use the following commands to interact with this example - 'h' is
rect, r_data->align_ptr->x, r_data->align_ptr->y);
printf("Changing align hints for %s rect. to (%f, %f)\n",
- name, r_data->align_ptr->x, r_data->align_ptr->y);
+ name, r_data->align_ptr->x, r_data->align_ptr->y);
return;
}
rect, r_data->min_ptr->w, r_data->min_ptr->h);
printf("Changing min. size hints for %s rect. to (%d, %d)\n",
- name, r_data->min_ptr->w, r_data->min_ptr->h);
+ name, r_data->min_ptr->w, r_data->min_ptr->h);
return;
}
rect, r_data->max_ptr->w, r_data->max_ptr->h);
printf("Changing max. size hints for %s rect. to (%d, %d)\n",
- name, r_data->max_ptr->w, r_data->max_ptr->h);
+ name, r_data->max_ptr->w, r_data->max_ptr->h);
return;
}
rect, r_data->padding_ptr->l, r_data->padding_ptr->r,
r_data->padding_ptr->t, r_data->padding_ptr->b);
- printf("Changing padding size hints for %s rect."
- " to (%d, %d, %d, %d)\n",
- name, r_data->padding_ptr->l, r_data->padding_ptr->r,
- r_data->padding_ptr->t, r_data->padding_ptr->b);
+ printf("Changing padding size hints for %s rect. to (%d, %d, %d, %d)\n",
+ name, r_data->padding_ptr->l, r_data->padding_ptr->r,
+ r_data->padding_ptr->t, r_data->padding_ptr->b);
return;
}
rect, r_data->weight_ptr->x, r_data->weight_ptr->y);
printf("Changing weight hints for %s rect. to (%f, %f)\n",
- name, r_data->weight_ptr->x, r_data->weight_ptr->y);
+ name, r_data->weight_ptr->x, r_data->weight_ptr->y);
return;
}
}
" up to ecore-evas for this example to run properly.\n");
return -1;
}
-
evas_object_image_smooth_scale_set(d.border, !smooth_scale);
printf("Image's border is now %s smooth scaling\n",
- smooth_scale ? "without" : "with");
+ smooth_scale ? "without" : "with");
return;
}
evas_object_image_border_center_fill_set(d.border, fill);
printf("Image's border center region aspect is now \"%s\"\n",
- _border_fill_mode_to_str(fill));
+ _border_fill_mode_to_str(fill));
return;
}
evas_object_image_alpha_set(d.img1, !alpha);
printf("Image's alpha channel is now %s\n",
- alpha ? "off" : "on");
+ alpha ? "off" : "on");
return;
}
evas_object_image_filled_set(d.img1, !filled);
printf("Image's x filled property is now %s\n",
- filled ? "off" : "on");
+ filled ? "off" : "on");
return;
}
evas_object_image_fill_get(d.img1, &x, &y, &w, &h);
printf("Image has fill properties set to: %d, %d, %d, %d\n",
- x, y, w, h);
+ x, y, w, h);
return;
}
}
else
{
- printf(
- "loaded image '%s' with succes! error string is \"%s\"\n",
- valid_path, evas_load_error_str(err));
+ printf("loaded image '%s' with succes! error string is \"%s\"\n",
+ valid_path, evas_load_error_str(err));
evas_object_move(d.img1, 3, 3);
evas_object_image_fill_set(d.img1, 0, 0, WIDTH / 2, HEIGHT / 2);
void *event_info)
{
Evas_Event_Mouse_Down *ev = event_info;
- printf("Mouse Down - obj(%p), coords(%d %d)\n", obj, ev->canvas.x,
- ev->canvas.y);
+ printf("Mouse Down - obj(%p), coords(%d %d)\n",
+ obj, ev->canvas.x, ev->canvas.y);
}
static void
void *event_info)
{
Evas_Event_Mouse_Move *ev = event_info;
- printf("Mouse Move - obj(%p), coords(%d %d)\n", obj, ev->cur.canvas.x,
- ev->cur.canvas.y);
+ printf("Mouse Move - obj(%p), coords(%d %d)\n",
+ obj, ev->cur.canvas.x, ev->cur.canvas.y);
}
static void
void *event_info)
{
Evas_Event_Mouse_Up *ev = event_info;
- printf("Mouse Up - obj(%p), coords(%d %d)\n", obj, ev->canvas.x,
- ev->canvas.y);
+ printf("Mouse Up - obj(%p), coords(%d %d)\n",
+ obj, ev->canvas.x, ev->canvas.y);
}
static void
void *event_info)
{
Evas_Event_Multi_Down *ev = event_info;
- printf("Multi Down - obj(%p), coords(%d %d)\n", obj, ev->canvas.x,
- ev->canvas.y);
+ printf("Multi Down - obj(%p), coords(%d %d)\n",
+ obj, ev->canvas.x, ev->canvas.y);
}
static void
void *event_info)
{
Evas_Event_Multi_Move *ev = event_info;
- printf("Multi Move - obj(%p), coords(%d %d)\n", obj, ev->cur.canvas.x,
- ev->cur.canvas.y);
+ printf("Multi Move - obj(%p), coords(%d %d)\n",
+ obj, ev->cur.canvas.x, ev->cur.canvas.y);
}
static void
void *event_info)
{
Evas_Event_Multi_Up *ev = event_info;
- printf("Multi Up - obj(%p), coords(%d %d)\n", obj, ev->canvas.x,
- ev->canvas.y);
+ printf("Multi Up - obj(%p), coords(%d %d)\n",
+ obj, ev->canvas.x, ev->canvas.y);
}
static void
void *event_info)
{
Evas_Event_Mouse_In *ev = event_info;
- printf("Mouse In - obj(%p), coords(%d %d)\n", obj, ev->canvas.x,
- ev->canvas.y);
+ printf("Mouse In - obj(%p), coords(%d %d)\n",
+ obj, ev->canvas.x, ev->canvas.y);
}
static void
void *event_info)
{
Evas_Event_Mouse_Out *ev = event_info;
- printf("Mouse Out - obj(%p), coords(%d %d)\n", obj, ev->canvas.x,
- ev->canvas.y);
+ printf("Mouse Out - obj(%p), coords(%d %d)\n",
+ obj, ev->canvas.x, ev->canvas.y);
}
static void
int stride = evas_object_image_stride_get(d.noise_img);
printf("Image has row stride value of %d, which accounts"
- " for %d pixels\n", stride, stride / 4);
+ " for %d pixels\n", stride, stride / 4);
return;
}
file_path, quality_str);
else
printf("Image saved to '%s' (flags '%s'), check it out with "
- "an image viewer\n", file_path, quality_str);
+ "an image viewer\n", file_path, quality_str);
return;
}
evas_object_resize(d.noise_img, WIDTH / 4, HEIGHT / 4);
evas_object_show(d.noise_img);
printf("Creating noise image with size %d, %d\n",
- WIDTH / 4, HEIGHT / 4);
+ WIDTH / 4, HEIGHT / 4);
d.text_obj = evas_object_textblock_add(d.evas);
evas_object_textblock_text_markup_set(d.text_obj, "Hello world! :)");
file_path, quality_str);
else
printf("Image saved to '%s' (flags '%s'), check it out with "
- "an image viewer\n", file_path, quality_str);
+ "an image viewer\n", file_path, quality_str);
return;
}
{
evas_object_image_orient_set(d.img, key_val);
printf("Set %i and got %i\n", key_val,
- evas_object_image_orient_get(d.img));
+ evas_object_image_orient_get(d.img));
return;
}
}
else
{
- printf(
- "loaded image '%s' with success! error string is \"%s\"\n",
- img_path, evas_load_error_str(err));
+ printf("loaded image '%s' with success! error string is \"%s\"\n",
+ img_path, evas_load_error_str(err));
evas_object_move(d.img, WIDTH / 2, HEIGHT / 2);
evas_object_image_fill_set(d.img, 0, 0, WIDTH / 2, HEIGHT / 2);
file_path, quality_str);
else
printf("Image saved to '%s' (flags '%s'), check it out with "
- "an image viewer\n", file_path, quality_str);
+ "an image viewer\n", file_path, quality_str);
return;
}
}
else
{
- printf(
- "loaded image '%s' with success! error string is \"%s\"\n",
- img_path, evas_load_error_str(err));
+ printf("loaded image '%s' with success! error string is \"%s\"\n",
+ img_path, evas_load_error_str(err));
evas_object_move(d.img, WIDTH / 2, HEIGHT / 2);
evas_object_image_fill_set(d.img, 0, 0, WIDTH / 2, HEIGHT / 2);
evas_shutdown();
return 0;
- }
-
+}
" up to ecore-evas for this example to run properly.\n");
return -2;
}
-
}
printf("distance %.2f, pressure %.2f, twist %.2f, azimuth %.2f, tilt %.2f\n",
- distance, pressure, twist, azimuth, tilt);
+ distance, pressure, twist, azimuth, tilt);
_mouse_update_handle(ev->toolid, azimuth, tilt, twist, pressure);
}
ecore_evas_shutdown();
return -1;
}
-
focused = efl_input_focus_object_get(ev);
printf("Object %s was focused by seat %s\n",
- evas_object_name_get(focused),
- efl_input_device_name_get(seat));
+ evas_object_name_get(focused),
+ efl_input_device_name_get(seat));
}
static void
seat = efl_input_device_seat_get(efl_input_device_get(ev));
printf("Hold %s at object %s from seat %s\n",
- efl_input_hold_get(ev) ? "on" : "off",
- evas_object_name_get(event->object),
- efl_input_device_name_get(seat));
+ efl_input_hold_get(ev) ? "on" : "off",
+ evas_object_name_get(event->object),
+ efl_input_device_name_get(seat));
}
static void
seat = efl_input_device_get(ev);
printf("Focus %s at object %s from seat %s\n",
- event->desc == EFL_EVENT_FOCUS_IN ? "in" : "out",
- evas_object_name_get(event->object),
- efl_input_device_name_get(seat));
+ event->desc == EFL_EVENT_FOCUS_IN ? "in" : "out",
+ evas_object_name_get(event->object),
+ efl_input_device_name_get(seat));
}
static void
seat = efl_input_device_seat_get(efl_input_device_get(ev));
printf("Pointer %s at object %s from seat %s\n",
- event->desc == EFL_EVENT_POINTER_IN ? "in" : "out",
- evas_object_name_get(event->object),
- efl_input_device_name_get(seat));
+ event->desc == EFL_EVENT_POINTER_IN ? "in" : "out",
+ evas_object_name_get(event->object),
+ efl_input_device_name_get(seat));
}
static void
}
printf("%s at object %s from seat %s\n", buf,
- evas_object_name_get(event->object),
- efl_input_device_name_get(seat));
+ evas_object_name_get(event->object),
+ efl_input_device_name_get(seat));
}
static void
seat = efl_input_device_seat_get(efl_input_device_get(ev));
printf("Pointer button %i up at object %s from seat %s\n",
- efl_input_pointer_button_get(ev),
- evas_object_name_get(event->object),
- efl_input_device_name_get(seat));
+ efl_input_pointer_button_get(ev),
+ evas_object_name_get(event->object),
+ efl_input_device_name_get(seat));
}
static void
seat = efl_input_device_seat_get(efl_input_device_get(ev));
printf("Pointer moved to %1.f,%1.f at object %s from seat %s\n",
- efl_input_pointer_value_get(ev, EFL_INPUT_VALUE_X),
- efl_input_pointer_value_get(ev, EFL_INPUT_VALUE_Y),
- evas_object_name_get(event->object),
- efl_input_device_name_get(seat));
+ efl_input_pointer_value_get(ev, EFL_INPUT_VALUE_X),
+ efl_input_pointer_value_get(ev, EFL_INPUT_VALUE_Y),
+ evas_object_name_get(event->object),
+ efl_input_device_name_get(seat));
}
static void
seat = efl_input_device_seat_get(efl_input_device_get(ev));
printf("Wheel: '%i,%i' on object %s from seat %s\n",
- efl_input_pointer_wheel_direction_get(ev),
- efl_input_pointer_wheel_delta_get(ev),
- evas_object_name_get(event->object),
- efl_input_device_name_get(seat));
+ efl_input_pointer_wheel_direction_get(ev),
+ efl_input_pointer_wheel_delta_get(ev),
+ evas_object_name_get(event->object),
+ efl_input_device_name_get(seat));
}
static void
seat = efl_input_device_seat_get(efl_input_device_get(ev));
printf("Key down: '%s' on object %s from seat %s\n",
- efl_input_key_name_get(ev),
- evas_object_name_get(event->object),
- efl_input_device_name_get(seat));
+ efl_input_key_name_get(ev),
+ evas_object_name_get(event->object),
+ efl_input_device_name_get(seat));
if (evas_seat_key_modifier_is_set(mods, "Control", seat))
printf("Ctrl is pressed by seat %s\n",
- efl_input_device_name_get(seat));
+ efl_input_device_name_get(seat));
}
static void
seat = efl_input_device_seat_get(efl_input_device_get(ev));
printf("Key up: '%s' on object %s from seat %s\n",
- efl_input_key_name_get(ev),
- evas_object_name_get(event->object),
- efl_input_device_name_get(seat));
+ efl_input_key_name_get(ev),
+ evas_object_name_get(event->object),
+ efl_input_device_name_get(seat));
}
static void
return;
printf("The seat '%s' - description: '%s' was '%s'\n",
- efl_input_device_name_get(dev),
- efl_input_device_description_get(dev),
- event->desc == EFL_CANVAS_EVENT_DEVICE_ADDED ? "added" : "removed");
+ efl_input_device_name_get(dev),
+ efl_input_device_description_get(dev),
+ event->desc == EFL_CANVAS_EVENT_DEVICE_ADDED ? "added" : "removed");
}
EFL_CALLBACKS_ARRAY_DEFINE(canvas_callbacks,
{
if (efl_input_device_type_get(dev) == EFL_INPUT_DEVICE_CLASS_SEAT)
printf("The seat '%s' - description: '%s' was 'added'\n",
- efl_input_device_name_get(dev),
- efl_input_device_description_get(dev));
+ efl_input_device_name_get(dev),
+ efl_input_device_description_get(dev));
}
ecore_evas_show(ee);
efl_gfx_color_set(d.clipper, r, g, b, alpha);
printf("Changing clipper's opacity: %d%%\n",
- (int)((alpha / 255.0) * 100));
+ (int)((alpha / 255.0) * 100));
return;
}
* Object must be deleted explicitly at the end of program.*/
d.bg = efl_add(EFL_CANVAS_RECTANGLE_CLASS, d.canvas);
- /* Eo-styled way to perform actions on an object*/
+ /* Eo-styled way to perform actions on an object */
evas_object_name_set(d.bg, "background rectangle");
efl_gfx_color_set(d.bg, 255, 255, 255, 255);
/* white bg */
- efl_gfx_position_set(d.bg, 0, 0);
+ efl_gfx_position_set(d.bg, 0, 0);
/* at canvas' origin */
- efl_gfx_size_set(d.bg, WIDTH, HEIGHT);
+ efl_gfx_size_set(d.bg, WIDTH, HEIGHT);
/* covers full canvas */
- efl_gfx_visible_set(d.bg, EINA_TRUE);
+ efl_gfx_visible_set(d.bg, EINA_TRUE);
evas_object_focus_set(d.bg, EINA_TRUE);
evas_object_event_callback_add(
efl_gfx_size_set(d.img, WIDTH, HEIGHT);
efl_gfx_visible_set(d.img, EINA_TRUE);
printf("Image object added, class name is: %s\n",
- efl_class_name_get(d.img));
+ efl_class_name_get(d.img));
}
/* border on the image's clipper, here just to emphasize its position */
efl_gfx_size_set(d.clipper_border, (WIDTH / 2) + 6, (HEIGHT / 2) + 6);
efl_gfx_visible_set(d.clipper_border, EINA_TRUE);
}
+
/* solid white clipper (note that it's the default color for a
* rectangle) - it won't change clippees' colors, then (multiplying
* by 255) */
if (strcmp(ev->key, "h") == 0) /* print help */
{
printf("commands are:\n"
- "\to - change clipper's opacity\n"
- "\tr - toggle clipper's color between red and white\n"
- "\tc - toggle clipper's clipping function\n"
- "\tv - toggle clipper's visibility\n");
+ "\to - change clipper's opacity\n"
+ "\tr - toggle clipper's color between red and white\n"
+ "\tc - toggle clipper's clipping function\n"
+ "\tv - toggle clipper's visibility\n");
return;
}
{
int r, g, b, a;
} clipper_colors[4] = {WHITE, RED, GREEN, BLUE};
+
int cur_color = 0;
static const char *
{
printf("iface1's del()! Data is %s\n",
(char *)evas_object_smart_interface_data_get
- (obj, (Evas_Smart_Interface *)&iface1));
+ (obj, (Evas_Smart_Interface *)&iface1));
}
static void
d.rects[0] = rect;
printf("Setting smart object's left spot with a new"
- " rectangle.\n");
+ " rectangle.\n");
printf("Checking its new smart object parent: %s\n",
- evas_object_smart_parent_get(rect) == d.smt ? "OK!" :
- "Failure!");
+ evas_object_smart_parent_get(rect) == d.smt ? "OK!" :
+ "Failure!");
if (prev)
{
int r, g, b;
evas_object_color_get(prev, &r, &g, &b, NULL);
printf("Deleting previous left child,"
- " which had colors (%d, %d, %d)\n", r, g, b);
+ " which had colors (%d, %d, %d)\n", r, g, b);
evas_object_del(prev);
}
d.rects[1] = rect;
printf("Setting smart object's right spot with a new"
- " rectangle.\n");
+ " rectangle.\n");
printf("Checking its new smart object parent: %s\n",
- evas_object_smart_parent_get(rect) == d.smt ? "OK!" :
- "Failure!");
+ evas_object_smart_parent_get(rect) == d.smt ? "OK!" :
+ "Failure!");
if (prev)
{
int r, g, b;
evas_object_color_get(prev, &r, &g, &b, NULL);
printf("Deleting previous right child,"
- " which had colors (%d, %d, %d)\n", r, g, b);
+ " which had colors (%d, %d, %d)\n", r, g, b);
evas_object_del(prev);
}
void *event_info)
{
printf("Number of child members on our example smart"
- " object changed to %llu\n", (unsigned long long)(uintptr_t)event_info);
+ " object changed to %llu\n", (unsigned long long)(uintptr_t)event_info);
}
int
d.clipper = evas_object_smart_clipped_clipper_get(d.smt);
printf("Checking if clipped smart object's clipper is a "
- "\"static\" one: %s\n", evas_object_static_clip_get(
- d.clipper) ? "yes" : "no");
+ "\"static\" one: %s\n",
+ evas_object_static_clip_get(d.clipper) ? "yes" : "no");
evas_object_color_set(
d.clipper, clipper_colors[cur_color].r, clipper_colors[cur_color].g,
for (; *descriptions; descriptions++)
{
printf("We've found a smart callback on the smart object!"
- "\n\tname: %s\n\ttype: %s\n", (*descriptions)->name,
- (*descriptions)->type);
+ "\n\tname: %s\n\ttype: %s\n", (*descriptions)->name,
+ (*descriptions)->type);
if (strcmp((*descriptions)->type, "i")) continue;
/* we know we don't have other types of smart callbacks
char *data;
printf("We've found a smart interface on the smart object!"
- "\n\tname: %s\n", iface->base.name);
+ "\n\tname: %s\n", iface->base.name);
printf("Setting its interface data...\n");
data = evas_object_smart_interface_data_get
{
int r, g, b, a;
} clipper_colors[4] = {WHITE, RED, GREEN, BLUE};
+
int cur_color = 0;
int cur_angle = 0;
};
typedef struct _Evas_Smart_Example_Data Evas_Smart_Example_Data;
+
/*
* This structure augments clipped smart object's instance data,
* providing extra members required by our example smart object's
prev = evas_smart_example_set_left(d.smt, rect);
d.rects[0] = rect;
- printf("Setting smart object's left spot with a new"
- " rectangle.\n");
+ printf("Setting smart object's left spot with a new rectangle.\n");
printf("Checking its new smart object parent: %s\n",
- evas_object_smart_parent_get(rect) == d.smt ? "OK!" :
- "Failure!");
+ evas_object_smart_parent_get(rect) == d.smt ? "OK!" :
+ "Failure!");
if (prev)
{
int r, g, b;
evas_object_color_get(prev, &r, &g, &b, NULL);
printf("Deleting previous left child,"
- " which had colors (%d, %d, %d)\n", r, g, b);
+ " which had colors (%d, %d, %d)\n", r, g, b);
evas_object_del(prev);
}
prev = evas_smart_example_set_right(d.smt, rect);
d.rects[1] = rect;
- printf("Setting smart object's right spot with a new"
- " rectangle.\n");
+ printf("Setting smart object's right spot with a new rectangle.\n");
printf("Checking its new smart object parent: %s\n",
- evas_object_smart_parent_get(rect) == d.smt ? "OK!" :
- "Failure!");
+ evas_object_smart_parent_get(rect) == d.smt ? "OK!" :
+ "Failure!");
if (prev)
{
int r, g, b;
evas_object_color_get(prev, &r, &g, &b, NULL);
printf("Deleting previous right child,"
- " which had colors (%d, %d, %d)\n", r, g, b);
+ " which had colors (%d, %d, %d)\n", r, g, b);
evas_object_del(prev);
}
void *event_info)
{
printf("Number of child members on our example smart"
- " object changed to %llu\n", (unsigned long long)(uintptr_t)event_info);
+ " object changed to %llu\n", (unsigned long long)(uintptr_t)event_info);
}
int
ret = evas_object_smart_type_check(d.smt, _evas_smart_example_type);
printf("Adding smart object of type \"%s\" to the canvas: %s.\n",
- _evas_smart_example_type, ret ? "success" : "failure");
+ _evas_smart_example_type, ret ? "success" : "failure");
d.clipper = evas_object_smart_clipped_clipper_get(d.smt);
printf("Checking if clipped smart object's clipper is a "
- "\"static\" one: %s\n", evas_object_static_clip_get(
- d.clipper) ? "yes" : "no");
+ "\"static\" one: %s\n",
+ evas_object_static_clip_get(d.clipper) ? "yes" : "no");
evas_object_color_set(
d.clipper, clipper_colors[cur_color].r, clipper_colors[cur_color].g,
for (; *descriptions; descriptions++)
{
printf("We've found a smart callback on the smart object!"
- "\n\tname: %s\n\ttype: %s\n", (*descriptions)->name,
- (*descriptions)->type);
+ "\n\tname: %s\n\ttype: %s\n", (*descriptions)->name,
+ (*descriptions)->type);
if (strcmp((*descriptions)->type, "i")) continue;
/* we know we don't have other types of smart callbacks
printf(".\n");
printf("Current target rectangle is %s\n",
- _name_get(d.rects[d.cur_rect]));
+ _name_get(d.rects[d.cur_rect]));
printf("Background rectangle's layer is %d\n",
- evas_object_layer_get(d.bg));
+ evas_object_layer_get(d.bg));
return;
}
evas_object_layer_set(d.bg, d.layers[d.cur_layer]);
printf("Changing background rectangle's layer to %d\n",
- d.layers[d.cur_layer]);
+ d.layers[d.cur_layer]);
return;
}
d.cur_rect = (d.cur_rect + 1) % 3;
printf("Changing target rectangle to the %s one\n",
- _name_get(d.rects[d.cur_rect]));
+ _name_get(d.rects[d.cur_rect]));
return;
}
evas_object_raise(d.rects[d.cur_rect]);
printf("%s rectangle was re-stacked to the top if its layer\n",
- name);
+ name);
neighbour = evas_object_below_get(d.rects[d.cur_rect]);
printf("Below of %s rect is %s\n", name,
- neighbour ? _name_get(neighbour) : "no object");
+ neighbour ? _name_get(neighbour) : "no object");
return;
}
evas_object_lower(d.rects[d.cur_rect]);
- printf(
- "%s rectangle was re-stacked to the bottom if its layer\n",
- name);
+ printf("%s rectangle was re-stacked to the bottom if its layer\n",
+ name);
neighbour = evas_object_below_get(d.rects[d.cur_rect]);
printf("Below of %s rect is %s\n", name,
- neighbour ? _name_get(neighbour) : "no object");
+ neighbour ? _name_get(neighbour) : "no object");
return;
}
evas_object_pass_events_set(d.rects[d.cur_rect], !pass);
printf("%s rectangle is now set to%s pass (ignore) events\n",
- name, pass ? " NOT" : "");
+ name, pass ? " NOT" : "");
return;
}
evas_object_repeat_events_set(d.rects[d.cur_rect], !repeat);
printf("%s rectangle is now set to%s repeat events\n",
- name, repeat ? " NOT" : "");
+ name, repeat ? " NOT" : "");
return;
}
neighbour = evas_object_above_get(d.rects[d.cur_rect]);
printf("Above of %s rect is %s\n", name,
- neighbour ? _name_get(neighbour) : "no object");
+ neighbour ? _name_get(neighbour) : "no object");
neighbour = evas_object_below_get(d.rects[d.cur_rect]);
printf("Below of %s rect is %s\n", name,
- neighbour ? _name_get(neighbour) : "no object");
+ neighbour ? _name_get(neighbour) : "no object");
return;
}
neighbour = evas_object_above_get(d.rects[d.cur_rect]);
printf("Above of %s rect is %s\n", name,
- neighbour ? _name_get(neighbour) : "no object");
+ neighbour ? _name_get(neighbour) : "no object");
neighbour = evas_object_below_get(d.rects[d.cur_rect]);
printf("Below of %s rect is %s\n", name,
- neighbour ? _name_get(neighbour) : "no object");
+ neighbour ? _name_get(neighbour) : "no object");
return;
}
}
evas_object_text_style_set(d.text, type);
printf("Changing text's style to \'%s\'\n",
- _text_style_type_to_str(type));
+ _text_style_type_to_str(type));
return;
}
evas_object_text_font_set(d.text, *d.t_data.font_ptr, sz);
- printf("Changing text's font to %s\n", *d.t_data.font_ptr);
+ printf("Changing text's font to %s\n",
+ *d.t_data.font_ptr);
return;
}
d.t_data.text_ptr->b, d.t_data.text_ptr->a);
printf("Changing base color for text to (%d, %d, %d, %d)\n",
- d.t_data.text_ptr->r, d.t_data.text_ptr->g,
- d.t_data.text_ptr->b, d.t_data.text_ptr->a);
+ d.t_data.text_ptr->r, d.t_data.text_ptr->g,
+ d.t_data.text_ptr->b, d.t_data.text_ptr->a);
return;
}
d.t_data.glow2_ptr->b, d.t_data.glow2_ptr->a);
printf("Changing glow 2 color for text to (%d, %d, %d, %d)\n",
- d.t_data.glow2_ptr->r, d.t_data.glow2_ptr->g,
- d.t_data.glow2_ptr->b, d.t_data.glow2_ptr->a);
+ d.t_data.glow2_ptr->r, d.t_data.glow2_ptr->g,
+ d.t_data.glow2_ptr->b, d.t_data.glow2_ptr->a);
return;
}
d.t_data.glow_ptr->b, d.t_data.glow_ptr->a);
printf("Changing glow color for text to (%d, %d, %d, %d)\n",
- d.t_data.glow_ptr->r, d.t_data.glow_ptr->g,
- d.t_data.glow_ptr->b, d.t_data.glow_ptr->a);
+ d.t_data.glow_ptr->r, d.t_data.glow_ptr->g,
+ d.t_data.glow_ptr->b, d.t_data.glow_ptr->a);
return;
}
d.t_data.outline_ptr->b, d.t_data.outline_ptr->a);
printf("Changing outline color for text to (%d, %d, %d, %d)\n",
- d.t_data.outline_ptr->r, d.t_data.outline_ptr->g,
- d.t_data.outline_ptr->b, d.t_data.outline_ptr->a);
+ d.t_data.outline_ptr->r, d.t_data.outline_ptr->g,
+ d.t_data.outline_ptr->b, d.t_data.outline_ptr->a);
return;
}
d.t_data.shadow_ptr->b, d.t_data.shadow_ptr->a);
printf("Changing shadow color for text to (%d, %d, %d, %d)\n",
- d.t_data.shadow_ptr->r, d.t_data.shadow_ptr->g,
- d.t_data.shadow_ptr->b, d.t_data.shadow_ptr->a);
+ d.t_data.shadow_ptr->r, d.t_data.shadow_ptr->g,
+ d.t_data.shadow_ptr->b, d.t_data.shadow_ptr->a);
return;
}
ecore_evas_shutdown();
return -1;
}
-
else
evas_object_show(obj);
printf("Show/hide toggle for obstacle %p\n",
- *d.t_data.obs_ptr);
+ *d.t_data.obs_ptr);
evas_object_textblock_obstacles_update(d.text);
return;
evas_object_textblock_obstacles_update(d.text);
- printf("Changing obstacle size to: %d,%d\n", *d.t_data.obs_size_ptr, *d.t_data.obs_size_ptr);
+ printf("Changing obstacle size to: %d,%d\n",
+ *d.t_data.obs_size_ptr, *d.t_data.obs_size_ptr);
return;
}
+
if (strcmp(ev->key, "p") == 0) /* change obstacle position */
{
Evas_Coord x, y;
return;
}
+
if (strcmp(ev->key, "w") == 0) /* change obstacle position */
{
(d.t_data.wrap_ptr)++;
POINTER_CYCLE(d.t_data.wrap_ptr, d.t_data.wrap);
- printf("Changing wrap mode to: %s\n", *d.t_data.wrap_ptr);
+ printf("Changing wrap mode to: %s\n",
+ *d.t_data.wrap_ptr);
_style_set(*d.t_data.wrap_ptr);
evas_object_textblock_obstacles_update(d.text);
ecore_evas_shutdown();
return -1;
}
-
" up to ecore-evas for this example to run properly.\n");
return -2;
}
-
{
int next = (animation_position + 1) % (sizeof (batmans_path) / sizeof (batmans_path[0]));
- evas_vg_shape_interpolate(batman,
+ evas_vg_shape_interpolate(batman,
batmans_vg[animation_position],
batmans_vg[next],
ecore_animator_pos_map(pos, ECORE_POS_MAP_SINUSOIDAL, 0.0, 0.0));
#define EFL_BETA_API_SUPPORT 1
#endif
+#include <math.h>
+
#include <Eo.h>
#include <Efl.h>
#include <Evas.h>
#include <Ecore.h>
#include <Ecore_Evas.h>
-
-
-#include <math.h>
#include <Eina.h>
#define PATH_KAPPA 0.5522847498
#define PI 3.1415926535
-
static Efl_VG *beginning = NULL;
static Efl_VG *end = NULL;
static Efl_VG *root = NULL;