stefan pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=c6212e6e67af4e48e90fe9ddea64774e82b908d8
commit c6212e6e67af4e48e90fe9ddea64774e82b908d8 Author: Bryce Harrington <[email protected]> Date: Wed May 10 11:03:37 2017 +0200 examples/evas: Improve linespacing consistency Summary: Also fixes a handful of obvious indentation irregularities, including some reformatting of some printf() multi-line indents that commit a71b770b did not properly adjust. No functional code changes. Reviewers: cedric Subscribers: jpeg Differential Revision: https://phab.enlightenment.org/D4864 --- src/examples/evas/evas-3d-aabb.c | 3 +- src/examples/evas/evas-3d-blending.c | 12 ++--- src/examples/evas/evas-3d-colorpick.c | 20 ++++--- src/examples/evas/evas-3d-cube-rotate.c | 4 +- src/examples/evas/evas-3d-eet.c | 1 - src/examples/evas/evas-3d-fog.c | 11 ++-- src/examples/evas/evas-3d-hull.c | 4 +- src/examples/evas/evas-3d-obj.c | 1 + src/examples/evas/evas-3d-shadows.c | 2 + src/examples/evas/evas-3d-static-lod.c | 2 + src/examples/evas/evas-aspect-hints.c | 16 +++--- src/examples/evas/evas-box.c | 34 +++++++----- src/examples/evas/evas-event-filter.c | 1 - src/examples/evas/evas-events.c | 24 ++++----- src/examples/evas/evas-gl.c | 3 +- src/examples/evas/evas-hints.c | 30 ++++++----- src/examples/evas/evas-images.c | 15 +++--- src/examples/evas/evas-images2.c | 38 ++++++------- src/examples/evas/evas-images4.c | 9 ++-- src/examples/evas/evas-images5.c | 7 ++- src/examples/evas/evas-init-shutdown.c | 3 +- src/examples/evas/evas-map-aa.c | 1 - src/examples/evas/evas-multi-touch.c | 3 +- src/examples/evas/evas-multiseat-events.c | 72 ++++++++++++------------- src/examples/evas/evas-object-manipulation-eo.c | 13 ++--- src/examples/evas/evas-object-manipulation.c | 8 +-- src/examples/evas/evas-smart-interface.c | 31 +++++------ src/examples/evas/evas-smart-object.c | 32 +++++------ src/examples/evas/evas-stacking.c | 31 ++++++----- src/examples/evas/evas-text.c | 26 ++++----- src/examples/evas/evas-textblock-obstacles.c | 11 ++-- src/examples/evas/evas-transparent.c | 1 - src/examples/evas/evas-vg-batman.c | 2 +- src/examples/evas/evas-vg-simple.c | 6 +-- 34 files changed, 245 insertions(+), 232 deletions(-) diff --git a/src/examples/evas/evas-3d-aabb.c b/src/examples/evas/evas-3d-aabb.c index 3b91bff..37f954d 100644 --- a/src/examples/evas/evas-3d-aabb.c +++ b/src/examples/evas/evas-3d-aabb.c @@ -48,7 +48,6 @@ Eo *material = NULL; Eo *texture = NULL; Eo *light = NULL; - static Eina_Bool _redraw_aabb(); @@ -203,7 +202,7 @@ main(void) 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); diff --git a/src/examples/evas/evas-3d-blending.c b/src/examples/evas/evas-3d-blending.c index 1c03cf2..8409efa 100644 --- a/src/examples/evas/evas-3d-blending.c +++ b/src/examples/evas/evas-3d-blending.c @@ -112,7 +112,6 @@ _on_key_down(void *data, Evas *e EINA_UNUSED, Evas_Object *eo EINA_UNUSED, void printf("sfactor = %s, dfactor = %s\n", blend_func_names[func1], blend_func_names[func2]); } - static void _on_delete(Ecore_Evas *ee EINA_UNUSED) { @@ -153,14 +152,14 @@ _camera_setup(Scene_Data *data) 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 @@ -298,7 +297,6 @@ main(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); diff --git a/src/examples/evas/evas-3d-colorpick.c b/src/examples/evas/evas-3d-colorpick.c index 83dd623..447ae0c 100644 --- a/src/examples/evas/evas-3d-colorpick.c +++ b/src/examples/evas/evas-3d-colorpick.c @@ -64,8 +64,8 @@ Ecore_Getopt optdesc = { } }; - typedef struct _Object - { +typedef struct _Object +{ Eo *primitive; Eo *node; Eo *mesh; @@ -77,7 +77,7 @@ Ecore_Getopt optdesc = { Eina_Bool (*sphere_init)(void *sphere, const char *texture); Eina_Bool (*sphere_animate)(void *data); - } Test_object; +} Test_object; typedef struct _Scene { @@ -111,9 +111,9 @@ _on_delete(Ecore_Evas *ee EINA_UNUSED) } eina_list_free(globalscene.spheres); - ecore_main_loop_quit(); } + static void _on_canvas_resize(Ecore_Evas *ee) { @@ -130,9 +130,11 @@ _animate_sphere(void *data) 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; } @@ -157,6 +159,7 @@ void _recalculate_position() } } } + static void _on_key_down(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *eo EINA_UNUSED, void *event_info) @@ -165,6 +168,7 @@ _on_key_down(void *data EINA_UNUSED, Evas *e EINA_UNUSED, 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); @@ -196,6 +200,7 @@ _on_key_down(void *data EINA_UNUSED, Evas *e EINA_UNUSED, 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) { @@ -238,6 +243,7 @@ Eina_Bool _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); @@ -262,10 +268,10 @@ _init_sphere(void *this, const char *texture) 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) { @@ -303,6 +309,7 @@ _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) @@ -330,6 +337,7 @@ _init_scene(const char *texture) 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; } @@ -358,7 +366,7 @@ int main(int argc, char **argv) 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); diff --git a/src/examples/evas/evas-3d-cube-rotate.c b/src/examples/evas/evas-3d-cube-rotate.c index e2946e9..79ff793 100644 --- a/src/examples/evas/evas-3d-cube-rotate.c +++ b/src/examples/evas/evas-3d-cube-rotate.c @@ -76,14 +76,15 @@ static Eina_Bool _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) @@ -133,6 +134,7 @@ static void _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; } diff --git a/src/examples/evas/evas-3d-eet.c b/src/examples/evas/evas-3d-eet.c index b99b2ce..2619bb1 100644 --- a/src/examples/evas/evas-3d-eet.c +++ b/src/examples/evas/evas-3d-eet.c @@ -38,7 +38,6 @@ Ecore_Evas *ecore_evas = NULL; Evas *evas = NULL; Eo *background = NULL; Eo *image = NULL; - Eo *scene = NULL; Eo *root_node = NULL; Eo *camera_node = NULL; diff --git a/src/examples/evas/evas-3d-fog.c b/src/examples/evas/evas-3d-fog.c index f675638..1ae330a 100644 --- a/src/examples/evas/evas-3d-fog.c +++ b/src/examples/evas/evas-3d-fog.c @@ -87,14 +87,14 @@ _camera_setup(Scene_Data *data) 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 @@ -121,7 +121,6 @@ _set_ball(Eo *mesh, Eo *sphere, Evas_Canvas3D_Material *material) evas_canvas3d_mesh_frame_material_set(mesh, 0, material); } - static void _mesh_setup(Scene_Data *data) { diff --git a/src/examples/evas/evas-3d-hull.c b/src/examples/evas/evas-3d-hull.c index b741599..0813163 100644 --- a/src/examples/evas/evas-3d-hull.c +++ b/src/examples/evas/evas-3d-hull.c @@ -173,12 +173,12 @@ _print_result(Evas_Canvas3D_Mesh *mesh, Evas_Canvas3D_Mesh *convex_mesh) 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; } diff --git a/src/examples/evas/evas-3d-obj.c b/src/examples/evas/evas-3d-obj.c index 3b96e22..c9a67f6 100644 --- a/src/examples/evas/evas-3d-obj.c +++ b/src/examples/evas/evas-3d-obj.c @@ -142,6 +142,7 @@ main(void) { 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); diff --git a/src/examples/evas/evas-3d-shadows.c b/src/examples/evas/evas-3d-shadows.c index e145404..216557f 100644 --- a/src/examples/evas/evas-3d-shadows.c +++ b/src/examples/evas/evas-3d-shadows.c @@ -616,12 +616,14 @@ _on_mouse_down(void *data, Evas *e EINA_UNUSED, Evas_Object *eo EINA_UNUSED, voi 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; diff --git a/src/examples/evas/evas-3d-static-lod.c b/src/examples/evas/evas-3d-static-lod.c index 81dc993..85bb71b 100644 --- a/src/examples/evas/evas-3d-static-lod.c +++ b/src/examples/evas/evas-3d-static-lod.c @@ -219,6 +219,7 @@ _scene_setup(Scene_Data *data) 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) @@ -230,6 +231,7 @@ _on_key_down(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *eo EINA_U else if(!strcmp("Down", ev->key)) animation_type = EINA_TRUE; } + int main(void) { diff --git a/src/examples/evas/evas-aspect-hints.c b/src/examples/evas/evas-aspect-hints.c index f05a932..9698d5b 100644 --- a/src/examples/evas/evas-aspect-hints.c +++ b/src/examples/evas/evas-aspect-hints.c @@ -93,11 +93,11 @@ _on_keydown(void *data EINA_UNUSED, 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; } @@ -109,8 +109,8 @@ _on_keydown(void *data EINA_UNUSED, 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; } @@ -127,7 +127,7 @@ _on_keydown(void *data EINA_UNUSED, 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; } diff --git a/src/examples/evas/evas-box.c b/src/examples/evas/evas-box.c index 0193c6d..22d445f 100644 --- a/src/examples/evas/evas-box.c +++ b/src/examples/evas/evas-box.c @@ -161,8 +161,8 @@ list_free: 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; } @@ -179,8 +179,8 @@ list_free: 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; } @@ -189,7 +189,8 @@ list_free: 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; } @@ -198,7 +199,8 @@ list_free: 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; } @@ -209,7 +211,7 @@ list_free: NULL); printf("Applying '%s' layout on the box\n", - "horizontal homogeneous"); + "horizontal homogeneous"); return; } @@ -219,7 +221,7 @@ list_free: d.box, evas_object_box_layout_homogeneous_vertical, NULL, NULL); printf("Applying '%s' layout on the box\n", - "vertical homogeneous"); + "vertical homogeneous"); return; } @@ -230,7 +232,7 @@ list_free: NULL, NULL); printf("Applying '%s' layout on the box\n", - "horizontal maximum size homogeneous"); + "horizontal maximum size homogeneous"); return; } @@ -241,7 +243,7 @@ list_free: NULL, NULL); printf("Applying '%s' layout on the box\n", - "vertical maximum size homogeneous"); + "vertical maximum size homogeneous"); return; } @@ -250,7 +252,8 @@ list_free: 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; } @@ -259,7 +262,8 @@ list_free: 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; } @@ -268,7 +272,8 @@ list_free: 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; } @@ -276,7 +281,8 @@ list_free: { 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; } } diff --git a/src/examples/evas/evas-event-filter.c b/src/examples/evas/evas-event-filter.c index aa41d8e..0b95a87 100644 --- a/src/examples/evas/evas-event-filter.c +++ b/src/examples/evas/evas-event-filter.c @@ -274,4 +274,3 @@ main(int argc EINA_UNUSED, char *argv[] EINA_UNUSED) ecore_evas_shutdown(); return EXIT_FAILURE; } - diff --git a/src/examples/evas/evas-events.c b/src/examples/evas/evas-events.c index 5c4bae2..7838ce9 100644 --- a/src/examples/evas/evas-events.c +++ b/src/examples/evas/evas-events.c @@ -66,13 +66,13 @@ _object_focus_in_cb(void *data EINA_UNUSED, 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 */ @@ -106,7 +106,7 @@ static Eina_Bool _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 */ } @@ -141,8 +141,8 @@ _on_keydown(void *data EINA_UNUSED, 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 */ { @@ -173,15 +173,15 @@ _on_keydown(void *data EINA_UNUSED, 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) @@ -269,8 +269,8 @@ c_end: { 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; diff --git a/src/examples/evas/evas-gl.c b/src/examples/evas/evas-gl.c index 9bcfdca..81601dc 100644 --- a/src/examples/evas/evas-gl.c +++ b/src/examples/evas/evas-gl.c @@ -256,8 +256,8 @@ img_pixel_cb(void *data, Evas_Object *obj) 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 @@ -377,6 +377,7 @@ _win_resize_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_in { float aspect; Evas_Coord w,h; + evas_object_geometry_get( obj, NULL, NULL, &w, &h); GLData *gl_data = data; diff --git a/src/examples/evas/evas-hints.c b/src/examples/evas/evas-hints.c index 1dfb35f..5ac91f5 100644 --- a/src/examples/evas/evas-hints.c +++ b/src/examples/evas/evas-hints.c @@ -116,20 +116,24 @@ _print_rect_stats(Evas_Object *rect) 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 @@ -192,7 +196,7 @@ _on_keydown(void *data EINA_UNUSED, 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; } @@ -209,7 +213,7 @@ _on_keydown(void *data EINA_UNUSED, 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; } @@ -226,7 +230,7 @@ _on_keydown(void *data EINA_UNUSED, 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; } @@ -243,10 +247,9 @@ _on_keydown(void *data EINA_UNUSED, 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; } @@ -266,7 +269,7 @@ _on_keydown(void *data EINA_UNUSED, 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; } } @@ -376,4 +379,3 @@ error: " up to ecore-evas for this example to run properly.\n"); return -1; } - diff --git a/src/examples/evas/evas-images.c b/src/examples/evas/evas-images.c index 8b9bfca..2cda226 100644 --- a/src/examples/evas/evas-images.c +++ b/src/examples/evas/evas-images.c @@ -109,7 +109,7 @@ _on_keydown(void *data EINA_UNUSED, 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; } @@ -157,7 +157,7 @@ _on_keydown(void *data EINA_UNUSED, 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; } @@ -169,7 +169,7 @@ _on_keydown(void *data EINA_UNUSED, evas_object_image_alpha_set(d.img1, !alpha); printf("Image's alpha channel is now %s\n", - alpha ? "off" : "on"); + alpha ? "off" : "on"); return; } @@ -181,7 +181,7 @@ _on_keydown(void *data EINA_UNUSED, 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; } @@ -249,7 +249,7 @@ _on_keydown(void *data EINA_UNUSED, 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; } @@ -292,9 +292,8 @@ main(void) } 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); diff --git a/src/examples/evas/evas-images2.c b/src/examples/evas/evas-images2.c index 60f0563..ab1e598 100644 --- a/src/examples/evas/evas-images2.c +++ b/src/examples/evas/evas-images2.c @@ -52,8 +52,8 @@ _mouse_down(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, 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 @@ -61,8 +61,8 @@ _mouse_move(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, 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 @@ -70,8 +70,8 @@ _mouse_up(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, 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 @@ -79,8 +79,8 @@ _multi_down(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, 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 @@ -88,8 +88,8 @@ _multi_move(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, 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 @@ -97,8 +97,8 @@ _multi_up(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, 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 @@ -106,8 +106,8 @@ _mouse_in(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, 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 @@ -115,8 +115,8 @@ _mouse_out(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, 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 @@ -172,7 +172,7 @@ _on_keydown(void *data EINA_UNUSED, 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; } @@ -199,7 +199,7 @@ _on_keydown(void *data EINA_UNUSED, 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; } @@ -287,7 +287,7 @@ main(void) 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! :)"); diff --git a/src/examples/evas/evas-images4.c b/src/examples/evas/evas-images4.c index 94b2eeb..1dd0faa 100644 --- a/src/examples/evas/evas-images4.c +++ b/src/examples/evas/evas-images4.c @@ -90,7 +90,7 @@ _on_keydown(void *data EINA_UNUSED, 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; } @@ -109,7 +109,7 @@ _on_keydown(void *data EINA_UNUSED, { 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; } @@ -152,9 +152,8 @@ main(void) } 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); diff --git a/src/examples/evas/evas-images5.c b/src/examples/evas/evas-images5.c index 51b67f2..2178c82 100644 --- a/src/examples/evas/evas-images5.c +++ b/src/examples/evas/evas-images5.c @@ -91,7 +91,7 @@ _on_keydown(void *data EINA_UNUSED, 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; } @@ -170,9 +170,8 @@ main(void) } 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); diff --git a/src/examples/evas/evas-init-shutdown.c b/src/examples/evas/evas-init-shutdown.c index 40263ce..b3df2e6 100644 --- a/src/examples/evas/evas-init-shutdown.c +++ b/src/examples/evas/evas-init-shutdown.c @@ -41,5 +41,4 @@ main(void) evas_shutdown(); return 0; - } - +} diff --git a/src/examples/evas/evas-map-aa.c b/src/examples/evas/evas-map-aa.c index 3e65606..a3619f0 100644 --- a/src/examples/evas/evas-map-aa.c +++ b/src/examples/evas/evas-map-aa.c @@ -352,4 +352,3 @@ panic: " up to ecore-evas for this example to run properly.\n"); return -2; } - diff --git a/src/examples/evas/evas-multi-touch.c b/src/examples/evas/evas-multi-touch.c index 51543ce..22b907e 100644 --- a/src/examples/evas/evas-multi-touch.c +++ b/src/examples/evas/evas-multi-touch.c @@ -280,7 +280,7 @@ _axis_update_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj EI } 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); } @@ -344,4 +344,3 @@ error: ecore_evas_shutdown(); return -1; } - diff --git a/src/examples/evas/evas-multiseat-events.c b/src/examples/evas/evas-multiseat-events.c index 260730a..1a206b3 100644 --- a/src/examples/evas/evas-multiseat-events.c +++ b/src/examples/evas/evas-multiseat-events.c @@ -39,8 +39,8 @@ _canvas_focus_in_cb(void *data EINA_UNUSED, const Efl_Event *event) 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 @@ -53,9 +53,9 @@ _hold_cb(void *data EINA_UNUSED, const Efl_Event *event) 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 @@ -68,9 +68,9 @@ _focus_cb(void *data EINA_UNUSED, const Efl_Event *event) 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 @@ -83,9 +83,9 @@ _pointer_in_out_cb(void *data EINA_UNUSED, const Efl_Event *event) 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 @@ -114,8 +114,8 @@ _pointer_down_cb(void *data EINA_UNUSED, const Efl_Event *event) } 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 @@ -128,9 +128,9 @@ _pointer_up_cb(void *data EINA_UNUSED, const Efl_Event *event) 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 @@ -143,10 +143,10 @@ _pointer_move_cb(void *data EINA_UNUSED, const Efl_Event *event) 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 @@ -159,10 +159,10 @@ _pointer_wheel_cb(void *data EINA_UNUSED, const Efl_Event *event) 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 @@ -177,13 +177,13 @@ _key_down_cb(void *data EINA_UNUSED, const Efl_Event *event) 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 @@ -196,9 +196,9 @@ _key_up_cb(void *data EINA_UNUSED, const Efl_Event *event) 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 @@ -210,9 +210,9 @@ _dev_added_or_removed(void *data EINA_UNUSED, const Efl_Event *event) 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, @@ -283,8 +283,8 @@ main(void) { 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); diff --git a/src/examples/evas/evas-object-manipulation-eo.c b/src/examples/evas/evas-object-manipulation-eo.c index a8dc9eb..c64101a 100644 --- a/src/examples/evas/evas-object-manipulation-eo.c +++ b/src/examples/evas/evas-object-manipulation-eo.c @@ -88,7 +88,7 @@ _on_keydown(void *data EINA_UNUSED, 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; } @@ -173,15 +173,15 @@ main(void) * 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( @@ -207,7 +207,7 @@ main(void) 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 */ @@ -227,6 +227,7 @@ main(void) 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) */ diff --git a/src/examples/evas/evas-object-manipulation.c b/src/examples/evas/evas-object-manipulation.c index 9f37467..f9e6af3 100644 --- a/src/examples/evas/evas-object-manipulation.c +++ b/src/examples/evas/evas-object-manipulation.c @@ -59,10 +59,10 @@ _on_keydown(void *data EINA_UNUSED, 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; } diff --git a/src/examples/evas/evas-smart-interface.c b/src/examples/evas/evas-smart-interface.c index b6669c9..2f0d119 100644 --- a/src/examples/evas/evas-smart-interface.c +++ b/src/examples/evas/evas-smart-interface.c @@ -55,6 +55,7 @@ struct color_tuple { int r, g, b, a; } clipper_colors[4] = {WHITE, RED, GREEN, BLUE}; + int cur_color = 0; static const char * @@ -113,7 +114,7 @@ _iface1_del(Evas_Object *obj) { 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 @@ -536,17 +537,17 @@ _on_keydown(void *data EINA_UNUSED, 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); } @@ -565,17 +566,17 @@ _on_keydown(void *data EINA_UNUSED, 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); } @@ -667,7 +668,7 @@ _on_example_smart_object_child_num_change(void *data EINA_UNUSED, 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 @@ -721,8 +722,8 @@ main(void) 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, @@ -734,8 +735,8 @@ main(void) 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 @@ -760,7 +761,7 @@ main(void) 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 diff --git a/src/examples/evas/evas-smart-object.c b/src/examples/evas/evas-smart-object.c index 94f2188..12306de 100644 --- a/src/examples/evas/evas-smart-object.c +++ b/src/examples/evas/evas-smart-object.c @@ -58,6 +58,7 @@ struct color_tuple { int r, g, b, a; } clipper_colors[4] = {WHITE, RED, GREEN, BLUE}; + int cur_color = 0; int cur_angle = 0; @@ -96,6 +97,7 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = }; 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 @@ -487,18 +489,17 @@ _on_keydown(void *data EINA_UNUSED, 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); } @@ -516,18 +517,17 @@ _on_keydown(void *data EINA_UNUSED, 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); } @@ -639,7 +639,7 @@ _on_example_smart_object_child_num_change(void *data EINA_UNUSED, 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 @@ -680,12 +680,12 @@ main(void) 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, @@ -697,8 +697,8 @@ main(void) 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 diff --git a/src/examples/evas/evas-stacking.c b/src/examples/evas/evas-stacking.c index 523d44e..50df01d 100644 --- a/src/examples/evas/evas-stacking.c +++ b/src/examples/evas/evas-stacking.c @@ -117,10 +117,10 @@ _on_keydown(void *data EINA_UNUSED, 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; } @@ -131,7 +131,7 @@ _on_keydown(void *data EINA_UNUSED, 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; } @@ -140,7 +140,7 @@ _on_keydown(void *data EINA_UNUSED, 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; } @@ -151,11 +151,11 @@ _on_keydown(void *data EINA_UNUSED, 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; } @@ -165,13 +165,12 @@ _on_keydown(void *data EINA_UNUSED, 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; } @@ -182,7 +181,7 @@ _on_keydown(void *data EINA_UNUSED, 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; } @@ -194,7 +193,7 @@ _on_keydown(void *data EINA_UNUSED, 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; } @@ -213,11 +212,11 @@ _on_keydown(void *data EINA_UNUSED, 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; } @@ -235,12 +234,12 @@ _on_keydown(void *data EINA_UNUSED, 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; } } diff --git a/src/examples/evas/evas-text.c b/src/examples/evas/evas-text.c index e88070c..659d5f4 100644 --- a/src/examples/evas/evas-text.c +++ b/src/examples/evas/evas-text.c @@ -169,7 +169,7 @@ _on_keydown(void *data EINA_UNUSED, 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; } @@ -186,7 +186,8 @@ _on_keydown(void *data EINA_UNUSED, 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; } @@ -202,8 +203,8 @@ _on_keydown(void *data EINA_UNUSED, 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; } @@ -219,8 +220,8 @@ _on_keydown(void *data EINA_UNUSED, 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; } @@ -236,8 +237,8 @@ _on_keydown(void *data EINA_UNUSED, 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; } @@ -253,8 +254,8 @@ _on_keydown(void *data EINA_UNUSED, 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; } @@ -270,8 +271,8 @@ _on_keydown(void *data EINA_UNUSED, 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; } @@ -404,4 +405,3 @@ error: ecore_evas_shutdown(); return -1; } - diff --git a/src/examples/evas/evas-textblock-obstacles.c b/src/examples/evas/evas-textblock-obstacles.c index fa60e0f..9d6e4bf 100644 --- a/src/examples/evas/evas-textblock-obstacles.c +++ b/src/examples/evas/evas-textblock-obstacles.c @@ -147,7 +147,7 @@ _on_keydown(void *data EINA_UNUSED, 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; @@ -164,10 +164,12 @@ _on_keydown(void *data EINA_UNUSED, 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; @@ -186,11 +188,13 @@ _on_keydown(void *data EINA_UNUSED, 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); @@ -308,4 +312,3 @@ error: ecore_evas_shutdown(); return -1; } - diff --git a/src/examples/evas/evas-transparent.c b/src/examples/evas/evas-transparent.c index fccecc2..4ea7486 100644 --- a/src/examples/evas/evas-transparent.c +++ b/src/examples/evas/evas-transparent.c @@ -105,4 +105,3 @@ panic: " up to ecore-evas for this example to run properly.\n"); return -2; } - diff --git a/src/examples/evas/evas-vg-batman.c b/src/examples/evas/evas-vg-batman.c index b9990a7..105f4aa 100644 --- a/src/examples/evas/evas-vg-batman.c +++ b/src/examples/evas/evas-vg-batman.c @@ -79,7 +79,7 @@ _animator(void *data EINA_UNUSED, double pos) { 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)); diff --git a/src/examples/evas/evas-vg-simple.c b/src/examples/evas/evas-vg-simple.c index da02ec5..55f9e13 100644 --- a/src/examples/evas/evas-vg-simple.c +++ b/src/examples/evas/evas-vg-simple.c @@ -22,20 +22,18 @@ #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; --
