diff --git a/legacy/ephysics/data/themes/Makefile.am b/legacy/ephysics/data/themes/Makefile.am index 0973a55d1f..87fd0499be 100644 --- a/legacy/ephysics/data/themes/Makefile.am +++ b/legacy/ephysics/data/themes/Makefile.am @@ -19,6 +19,7 @@ EXTRA_DIST = \ ephysics_test.edc \ frame.edc \ list.edc \ + loading_bar.edc \ shadows.edc \ shapes.edc \ spinner.edc \ @@ -47,6 +48,8 @@ EXTRA_DIST = \ images/list-item-corner.png \ images/list-item-corner-pressed.png \ images/list-item-pressed.png \ + images/loading_bar.png \ + images/loading_knob.png \ images/pentagon.png \ images/shadow-ball.png \ images/shadow-cube.png \ diff --git a/legacy/ephysics/data/themes/ephysics_test.edc b/legacy/ephysics/data/themes/ephysics_test.edc index 2e1f427604..f0bec3e4ac 100644 --- a/legacy/ephysics/data/themes/ephysics_test.edc +++ b/legacy/ephysics/data/themes/ephysics_test.edc @@ -9,6 +9,7 @@ collections { #include "effects.edc" #include "frame.edc" #include "list.edc" +#include "loading_bar.edc" #include "shadows.edc" #include "shapes.edc" #include "spinner.edc" diff --git a/legacy/ephysics/data/themes/frame.edc b/legacy/ephysics/data/themes/frame.edc index 67e647be1b..6bbd23cb6e 100644 --- a/legacy/ephysics/data/themes/frame.edc +++ b/legacy/ephysics/data/themes/frame.edc @@ -229,6 +229,24 @@ } } + part { + name: "loading_bar"; + type: GROUP; + source: "loading_bar"; + mouse_events: 0; + description { + state: "default" 0.0; + align: 0.5 1; + visible: 0; + rel2.offset: -1 -5; + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + } programs { @@ -268,6 +286,14 @@ target: "angular_acc"; } + program { + name: "loading_bar,show"; + source: "ephysics_test"; + signal: "loading_bar,show"; + action: STATE_SET "visible" 0.0; + target: "loading_bar"; + } + } } diff --git a/legacy/ephysics/data/themes/images/loading_bar.png b/legacy/ephysics/data/themes/images/loading_bar.png new file mode 100644 index 0000000000..59d23ca3ff Binary files /dev/null and b/legacy/ephysics/data/themes/images/loading_bar.png differ diff --git a/legacy/ephysics/data/themes/images/loading_knob.png b/legacy/ephysics/data/themes/images/loading_knob.png new file mode 100644 index 0000000000..a40872bf0f Binary files /dev/null and b/legacy/ephysics/data/themes/images/loading_knob.png differ diff --git a/legacy/ephysics/data/themes/loading_bar.edc b/legacy/ephysics/data/themes/loading_bar.edc new file mode 100644 index 0000000000..0b962d9589 --- /dev/null +++ b/legacy/ephysics/data/themes/loading_bar.edc @@ -0,0 +1,69 @@ + group { + name: "loading_bar"; + min: 440 16; + max: 440 16; + + images { + image: "loading_bar.png" COMP; + image: "loading_knob.png" COMP; + } + + parts { + + part { + name: "bar"; + type: IMAGE; + mouse_events: 0; + description { + state: "default" 0.0; + min: 440 8; + max: 440 8; + image.normal: "loading_bar.png"; + } + } + + part { + name: "knob"; + type: IMAGE; + mouse_events: 0; + description { + state: "default" 0.0; + min: 56 16; + max: 56 16; + rel1.to: "bar"; + rel2.to: "bar"; + align: 0 0.5; + image.normal: "loading_knob.png"; + } + description { + state: "end" 0.0; + inherit: "default" 0.0; + align: 1 0.5; + } + } + + } + + programs { + + program { + name: "loading_bar,show"; + source: "ephysics_test"; + signal: "loading_bar,show"; + action: STATE_SET "end" 0.0; + transition: LINEAR 1.5; + target: "knob"; + after: "knob,restart"; + } + + program { + name: "knob,restart"; + action: STATE_SET "default" 0.0; + transition: LINEAR 1.5; + target: "knob"; + after: "loading_bar,show"; + } + + } + + } diff --git a/legacy/ephysics/src/bin/Makefile.am b/legacy/ephysics/src/bin/Makefile.am index 9bd4eb9876..8cb344701e 100644 --- a/legacy/ephysics/src/bin/Makefile.am +++ b/legacy/ephysics/src/bin/Makefile.am @@ -29,6 +29,7 @@ test_delete.c \ test_falling_letters.c \ test_forces.c \ test_growing_balls.c \ +test_heavy.c \ test_jumping_balls.c \ test_material.c \ test_no_gravity.c \ diff --git a/legacy/ephysics/src/bin/test.c b/legacy/ephysics/src/bin/test.c index f512356254..ce1f7f60b7 100644 --- a/legacy/ephysics/src/bin/test.c +++ b/legacy/ephysics/src/bin/test.c @@ -29,6 +29,7 @@ void test_falling_letters(void *data, Evas_Object *obj, void *event_info); void test_flag(void *data, Evas_Object *obj, void *event_info); void test_forces(void *data, Evas_Object *obj, void *event_info); void test_growing_balls(void *data, Evas_Object *obj, void *event_info); +void test_heavy(void *data, Evas_Object *obj, void *event_info); void test_jumping_balls(void *data, Evas_Object *obj, void *event_info); void test_material(void *data, Evas_Object *obj, void *event_info); void test_no_gravity(void *data, Evas_Object *obj, void *event_info); @@ -56,6 +57,7 @@ static const EPhysics_Test tests[] = { {"Flag - Cloth", test_flag}, {"Forces", test_forces}, {"Growing Balls", test_growing_balls}, + {"Heavy", test_heavy}, {"Jumping Balls", test_jumping_balls}, {"Material", test_material}, {"No Gravity", test_no_gravity}, diff --git a/legacy/ephysics/src/bin/test_heavy.c b/legacy/ephysics/src/bin/test_heavy.c new file mode 100644 index 0000000000..ad90b9fd1f --- /dev/null +++ b/legacy/ephysics/src/bin/test_heavy.c @@ -0,0 +1,73 @@ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include "ephysics_test.h" + +static void +_add_sphere(Test_Data *test_data, int i) +{ + EPhysics_Body *body; + Evas_Object *sphere; + static const char *colors[] = {"blue-ball", "red-ball", "green-ball"}; + + sphere = elm_image_add(test_data->win); + elm_image_file_set( + sphere, PACKAGE_DATA_DIR "/" EPHYSICS_TEST_THEME ".edj", colors[i % 3]); + evas_object_move(sphere, 50 + (i % 34) * 12, 40 + i / 34 * 12); + evas_object_resize(sphere, 10, 10); + evas_object_show(sphere); + test_data->evas_objs = eina_list_append(test_data->evas_objs, sphere); + + body = ephysics_body_circle_add(test_data->world); + ephysics_body_restitution_set(body, 0.85); + ephysics_body_evas_object_set(body, sphere, EINA_TRUE); + test_data->bodies = eina_list_append(test_data->bodies, body); +} + +static void +_world_populate(Test_Data *test_data) +{ + int i; + for (i = 0; i < 612; i++) + _add_sphere(test_data, i); +} + +static void +_restart(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__) +{ + test_clean(data); + _world_populate(data); +} + +void +test_heavy(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +{ + EPhysics_Body *boundary; + EPhysics_World *world; + Test_Data *test_data; + + if (!ephysics_init()) + return; + + test_data = test_data_new(); + test_win_add(test_data, "Heavy", EINA_TRUE); + elm_object_signal_emit(test_data->layout, "borders,show", "ephysics_test"); + elm_layout_signal_callback_add(test_data->layout, "restart", "test-theme", + _restart, test_data); + elm_layout_signal_emit(test_data->layout, "loading_bar,show", + "ephysics_test"); + + world = ephysics_world_new(); + ephysics_world_render_geometry_set(world, 50, 40, WIDTH - 100, FLOOR_Y - 40); + test_data->world = world; + + boundary = ephysics_body_bottom_boundary_add(test_data->world); + ephysics_body_restitution_set(boundary, 1); + + ephysics_body_top_boundary_add(test_data->world); + ephysics_body_left_boundary_add(test_data->world); + ephysics_body_right_boundary_add(test_data->world); + + _world_populate(test_data); +}