EPhysics: use elm_layout instead of edje to add cbs

Oh, I love when weird things got duplicated over all the project.
Use elm_layout_signal_callback_add instead of
edje_object_signal_callback_add.



SVN revision: 73248
This commit is contained in:
Bruno Dilly 2012-07-03 23:23:53 +00:00
parent caa0fcf36b
commit dc3455c888
9 changed files with 19 additions and 44 deletions

View File

@ -75,7 +75,6 @@ test_bouncing_ball(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *eve
EPhysics_Body *boundary;
EPhysics_World *world;
Test_Data *test_data;
Evas_Object *edje;
if (!ephysics_init())
return;
@ -83,9 +82,8 @@ test_bouncing_ball(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *eve
test_data = test_data_new();
test_win_add(test_data, "Bouncing Ball", EINA_TRUE);
edje = elm_layout_edje_get(test_data->layout);
edje_object_signal_callback_add(edje, "restart", "test-theme", _restart,
test_data);
elm_layout_signal_callback_add(test_data->layout, "restart", "test-theme",
_restart, test_data);
elm_object_signal_emit(test_data->layout, "arrows,show", "ephysics_test");
world = ephysics_world_new();

View File

@ -44,17 +44,14 @@ test_bouncing_text(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *eve
EPhysics_Body *boundary;
EPhysics_World *world;
Test_Data *test_data;
Evas_Object *edje;
if (!ephysics_init())
return;
test_data = test_data_new();
test_win_add(test_data, "Bouncing Text", EINA_TRUE);
edje = elm_layout_edje_get(test_data->layout);
edje_object_signal_callback_add(edje, "restart", "test-theme", _restart,
test_data);
elm_layout_signal_callback_add(test_data->layout, "restart", "test-theme",
_restart, test_data);
world = ephysics_world_new();
ephysics_world_render_geometry_set(world, 50, 40, WIDTH - 100, FLOOR_Y - 40);

View File

@ -63,17 +63,14 @@ test_colliding_balls(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *e
EPhysics_Body *boundary;
EPhysics_World *world;
Test_Data *test_data;
Evas_Object *edje;
if (!ephysics_init())
return;
test_data = test_data_new();
test_win_add(test_data, "Colliding Balls", EINA_TRUE);
edje = elm_layout_edje_get(test_data->layout);
edje_object_signal_callback_add(edje, "restart", "test-theme", _restart,
test_data);
elm_layout_signal_callback_add(test_data->layout, "restart", "test-theme",
_restart, test_data);
world = ephysics_world_new();
ephysics_world_render_geometry_set(world, 50, 40, WIDTH - 100, FLOOR_Y - 40);

View File

@ -142,7 +142,6 @@ test_collision(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_i
Collision_Data *collision_data;
EPhysics_Body *boundary;
EPhysics_World *world;
Evas_Object *edje;
if (!ephysics_init())
return;
@ -158,10 +157,8 @@ test_collision(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_i
test_win_add((Test_Data *)collision_data, "Collision Detection", EINA_FALSE);
evas_object_smart_callback_add(collision_data->base.win,
"delete,request", _win_del, collision_data);
edje = elm_layout_edje_get(collision_data->base.layout);
edje_object_signal_callback_add(edje, "restart", "test-theme", _restart,
collision_data);
elm_layout_signal_callback_add(collision_data->base.layout, "restart",
"test-theme", _restart, collision_data);
world = ephysics_world_new();
ephysics_world_render_geometry_set(world, 50, 40, WIDTH - 100, FLOOR_Y - 40);

View File

@ -81,17 +81,14 @@ test_constraint(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_
EPhysics_Body *boundary;
EPhysics_World *world;
Test_Data *test_data;
Evas_Object *edje;
if (!ephysics_init())
return;
test_data = test_data_new();
test_win_add(test_data, "Constraint", EINA_TRUE);
edje = elm_layout_edje_get(test_data->layout);
edje_object_signal_callback_add(edje, "restart", "test-theme", _restart,
test_data);
elm_layout_signal_callback_add(test_data->layout, "restart", "test-theme",
_restart, test_data);
world = ephysics_world_new();
ephysics_world_render_geometry_set(world, 50, 40, WIDTH - 100, FLOOR_Y - 40);

View File

@ -53,17 +53,14 @@ test_falling_letters(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *e
EPhysics_Body *boundary;
EPhysics_World *world;
Test_Data *test_data;
Evas_Object *edje;
if (!ephysics_init())
return;
test_data = test_data_new();
test_win_add(test_data, "Falling Letters", EINA_TRUE);
edje = elm_layout_edje_get(test_data->layout);
edje_object_signal_callback_add(edje, "restart", "test-theme", _restart,
test_data);
elm_layout_signal_callback_add(test_data->layout, "restart", "test-theme",
_restart, test_data);
world = ephysics_world_new();
ephysics_world_render_geometry_set(world, 50, 40, WIDTH - 100, FLOOR_Y - 40);

View File

@ -102,19 +102,17 @@ void
test_jumping_balls(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
EPhysics_Body *boundary;
Evas_Object *bt, *edje;
EPhysics_World *world;
Test_Data *test_data;
Evas_Object *bt;
if (!ephysics_init())
return;
test_data = test_data_new();
test_win_add(test_data, "Jumping Balls", EINA_TRUE);
edje = elm_layout_edje_get(test_data->layout);
edje_object_signal_callback_add(edje, "restart", "test-theme", _restart,
test_data);
elm_layout_signal_callback_add(test_data->layout, "restart", "test-theme",
_restart, test_data);
world = ephysics_world_new();
ephysics_world_render_geometry_set(world, 50, 40, WIDTH - 100, FLOOR_Y - 40);

View File

@ -76,17 +76,14 @@ test_rotate(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
EPhysics_Body *boundary;
EPhysics_World *world;
Test_Data *test_data;
Evas_Object *edje;
if (!ephysics_init())
return;
test_data = test_data_new();
test_win_add(test_data, "Rotate", EINA_TRUE);
edje = elm_layout_edje_get(test_data->layout);
edje_object_signal_callback_add(edje, "restart", "test-theme", _restart,
test_data);
elm_layout_signal_callback_add(test_data->layout, "restart", "test-theme",
_restart, test_data);
world = ephysics_world_new();
ephysics_world_render_geometry_set(world, 50, 40, WIDTH - 100, FLOOR_Y - 40);

View File

@ -100,7 +100,6 @@ test_velocity(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_in
EPhysics_Body *boundary;
EPhysics_World *world;
Test_Data *test_data;
Evas_Object *edje;
if (!ephysics_init())
return;
@ -108,10 +107,8 @@ test_velocity(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_in
test_data = test_data_new();
test_win_add(test_data, "Velocity Getters", EINA_TRUE);
edje = elm_layout_edje_get(test_data->layout);
edje_object_signal_callback_add(edje, "restart", "test-theme", _restart,
test_data);
elm_layout_signal_callback_add(test_data->layout, "restart", "test-theme",
_restart, test_data);
elm_layout_text_set(test_data->layout, "linear_vel",
"Linear velocity: 0, 0");
elm_layout_text_set(test_data->layout, "angular_vel", "Angular velocity: 0");