summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorBruno Dilly <bdilly@profusion.mobi>2012-10-04 22:38:58 +0000
committerBruno Dilly <bdilly@profusion.mobi>2012-10-04 22:38:58 +0000
commit7b7bef60879a813f453b6d4ee031cd7aa9a1579a (patch)
tree89defc6ab136804922598f7227f0b0b83d26280d /legacy
parent6181303ab5e37458a0595102c6b5869a22ef1f4a (diff)
ephysics: delete all worlds on exit
sure, it won't work until externals init / shutdown mess is fixed. SVN revision: 77458
Diffstat (limited to 'legacy')
-rw-r--r--legacy/ephysics/src/bin/test.c7
-rw-r--r--legacy/ephysics/src/bin/test_camera.c4
-rw-r--r--legacy/ephysics/src/bin/test_camera_track.c6
-rw-r--r--legacy/ephysics/src/bin/test_collision_detection.c6
-rw-r--r--legacy/ephysics/src/bin/test_collision_speed.c6
-rw-r--r--legacy/ephysics/src/bin/test_delete.c6
-rw-r--r--legacy/ephysics/src/bin/test_growing_balls.c6
-rw-r--r--legacy/ephysics/src/bin/test_velocity.c7
-rw-r--r--legacy/ephysics/src/bin/test_win_resize.c6
9 files changed, 28 insertions, 26 deletions
diff --git a/legacy/ephysics/src/bin/test.c b/legacy/ephysics/src/bin/test.c
index fb19fed..03b680b 100644
--- a/legacy/ephysics/src/bin/test.c
+++ b/legacy/ephysics/src/bin/test.c
@@ -72,7 +72,7 @@ _win_del(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __
72} 72}
73 73
74static void 74static void
75_subwin_del(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) 75_subwin_del_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
76{ 76{
77 test_data_del(data); 77 test_data_del(data);
78 ephysics_shutdown(); 78 ephysics_shutdown();
@@ -157,8 +157,8 @@ test_win_add(Test_Data *test_data, const char *title, Eina_Bool autodel)
157 evas_object_show(win); 157 evas_object_show(win);
158 test_data->win = win; 158 test_data->win = win;
159 if (autodel) 159 if (autodel)
160 evas_object_smart_callback_add(win, "delete,request", _subwin_del, 160 evas_object_event_callback_add(win, EVAS_CALLBACK_DEL,
161 test_data); 161 _subwin_del_cb, test_data);
162 162
163 ly = elm_layout_add(win); 163 ly = elm_layout_add(win);
164 elm_win_resize_object_add(win, ly); 164 elm_win_resize_object_add(win, ly);
@@ -196,6 +196,7 @@ _main_win_add(char *autorun)
196 win = elm_win_add(NULL, "main", ELM_WIN_BASIC); 196 win = elm_win_add(NULL, "main", ELM_WIN_BASIC);
197 elm_win_title_set(win, "EPhysics Tests"); 197 elm_win_title_set(win, "EPhysics Tests");
198 evas_object_smart_callback_add(win, "delete,request", _win_del, NULL); 198 evas_object_smart_callback_add(win, "delete,request", _win_del, NULL);
199 elm_win_autodel_set(win, EINA_TRUE);
199 evas_object_resize(win, 460, 560); 200 evas_object_resize(win, 460, 560);
200 evas_object_show(win); 201 evas_object_show(win);
201 202
diff --git a/legacy/ephysics/src/bin/test_camera.c b/legacy/ephysics/src/bin/test_camera.c
index b7b4475..98bb04c 100644
--- a/legacy/ephysics/src/bin/test_camera.c
+++ b/legacy/ephysics/src/bin/test_camera.c
@@ -137,7 +137,7 @@ _world_populate(Camera_Data *camera_data)
137} 137}
138 138
139static void 139static void
140_win_del(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) 140_win_del(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
141{ 141{
142 Camera_Data *camera_data = data; 142 Camera_Data *camera_data = data;
143 143
@@ -196,7 +196,7 @@ test_camera(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
196 } 196 }
197 197
198 test_win_add((Test_Data *)camera_data, "Camera", EINA_FALSE); 198 test_win_add((Test_Data *)camera_data, "Camera", EINA_FALSE);
199 evas_object_smart_callback_add(camera_data->base.win, "delete,request", 199 evas_object_event_callback_add(camera_data->base.win, EVAS_CALLBACK_DEL,
200 _win_del, camera_data); 200 _win_del, camera_data);
201 201
202 elm_layout_signal_callback_add(camera_data->base.layout, "restart", 202 elm_layout_signal_callback_add(camera_data->base.layout, "restart",
diff --git a/legacy/ephysics/src/bin/test_camera_track.c b/legacy/ephysics/src/bin/test_camera_track.c
index c785f4b..594ad0d 100644
--- a/legacy/ephysics/src/bin/test_camera_track.c
+++ b/legacy/ephysics/src/bin/test_camera_track.c
@@ -161,7 +161,7 @@ _restart(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED_
161} 161}
162 162
163static void 163static void
164_win_del(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) 164_win_del(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
165{ 165{
166 Track_Data *track_data = data; 166 Track_Data *track_data = data;
167 167
@@ -192,8 +192,8 @@ test_camera_track(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *even
192 } 192 }
193 193
194 test_win_add((Test_Data *) track_data, "Camera Track", EINA_FALSE); 194 test_win_add((Test_Data *) track_data, "Camera Track", EINA_FALSE);
195 evas_object_smart_callback_add(track_data->base.win, 195 evas_object_event_callback_add(track_data->base.win, EVAS_CALLBACK_DEL,
196 "delete,request", _win_del, track_data); 196 _win_del, track_data);
197 197
198 elm_layout_signal_callback_add(track_data->base.layout, "restart", 198 elm_layout_signal_callback_add(track_data->base.layout, "restart",
199 "test-theme", _restart, track_data); 199 "test-theme", _restart, track_data);
diff --git a/legacy/ephysics/src/bin/test_collision_detection.c b/legacy/ephysics/src/bin/test_collision_detection.c
index 4b23a01..31409db 100644
--- a/legacy/ephysics/src/bin/test_collision_detection.c
+++ b/legacy/ephysics/src/bin/test_collision_detection.c
@@ -127,7 +127,7 @@ _restart(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED_
127} 127}
128 128
129static void 129static void
130_win_del(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) 130_win_del(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
131{ 131{
132 Collision_Data *collision_data = data; 132 Collision_Data *collision_data = data;
133 133
@@ -159,8 +159,8 @@ test_collision(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_i
159 test_win_add((Test_Data *)collision_data, "Collision Detection", EINA_FALSE); 159 test_win_add((Test_Data *)collision_data, "Collision Detection", EINA_FALSE);
160 elm_object_signal_emit(collision_data->base.layout, "borders,show", 160 elm_object_signal_emit(collision_data->base.layout, "borders,show",
161 "ephysics_test"); 161 "ephysics_test");
162 evas_object_smart_callback_add(collision_data->base.win, 162 evas_object_event_callback_add(collision_data->base.win, EVAS_CALLBACK_DEL,
163 "delete,request", _win_del, collision_data); 163 _win_del, collision_data);
164 elm_layout_signal_callback_add(collision_data->base.layout, "restart", 164 elm_layout_signal_callback_add(collision_data->base.layout, "restart",
165 "test-theme", _restart, collision_data); 165 "test-theme", _restart, collision_data);
166 166
diff --git a/legacy/ephysics/src/bin/test_collision_speed.c b/legacy/ephysics/src/bin/test_collision_speed.c
index 2efd3f0..42f5c23 100644
--- a/legacy/ephysics/src/bin/test_collision_speed.c
+++ b/legacy/ephysics/src/bin/test_collision_speed.c
@@ -72,7 +72,7 @@ _restart(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED_
72} 72}
73 73
74static void 74static void
75_win_del(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) 75_win_del(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
76{ 76{
77 Speed_Data *speed_data = data; 77 Speed_Data *speed_data = data;
78 78
@@ -106,8 +106,8 @@ test_collision_speed(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *e
106 EINA_FALSE); 106 EINA_FALSE);
107 elm_object_signal_emit(speed_data->base.layout, "borders,show", 107 elm_object_signal_emit(speed_data->base.layout, "borders,show",
108 "ephysics_test"); 108 "ephysics_test");
109 evas_object_smart_callback_add(speed_data->base.win, 109 evas_object_event_callback_add(speed_data->base.win, EVAS_CALLBACK_DEL,
110 "delete,request", _win_del, speed_data); 110 _win_del, speed_data);
111 elm_layout_signal_callback_add(speed_data->base.layout, "restart", 111 elm_layout_signal_callback_add(speed_data->base.layout, "restart",
112 "test-theme", _restart, speed_data); 112 "test-theme", _restart, speed_data);
113 113
diff --git a/legacy/ephysics/src/bin/test_delete.c b/legacy/ephysics/src/bin/test_delete.c
index debfe5a..84a85f1 100644
--- a/legacy/ephysics/src/bin/test_delete.c
+++ b/legacy/ephysics/src/bin/test_delete.c
@@ -135,7 +135,7 @@ _restart(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED_
135} 135}
136 136
137static void 137static void
138_win_del(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) 138_win_del(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
139{ 139{
140 Collision_Data *collision_data = data; 140 Collision_Data *collision_data = data;
141 141
@@ -165,8 +165,8 @@ test_delete(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
165 } 165 }
166 166
167 test_win_add((Test_Data *)collision_data, "Delete Body", EINA_FALSE); 167 test_win_add((Test_Data *)collision_data, "Delete Body", EINA_FALSE);
168 evas_object_smart_callback_add(collision_data->base.win, 168 evas_object_event_callback_add(collision_data->base.win, EVAS_CALLBACK_DEL,
169 "delete,request", _win_del, collision_data); 169 _win_del, collision_data);
170 elm_object_signal_emit(collision_data->base.layout, "borders,show", 170 elm_object_signal_emit(collision_data->base.layout, "borders,show",
171 "ephysics_test"); 171 "ephysics_test");
172 elm_layout_signal_callback_add(collision_data->base.layout, "restart", 172 elm_layout_signal_callback_add(collision_data->base.layout, "restart",
diff --git a/legacy/ephysics/src/bin/test_growing_balls.c b/legacy/ephysics/src/bin/test_growing_balls.c
index 0a3531e..8770f91 100644
--- a/legacy/ephysics/src/bin/test_growing_balls.c
+++ b/legacy/ephysics/src/bin/test_growing_balls.c
@@ -58,7 +58,7 @@ _world_populate(Test_Data *test_data)
58} 58}
59 59
60static void 60static void
61_win_del(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) 61_win_del(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
62{ 62{
63 Test_Data *test_data = data; 63 Test_Data *test_data = data;
64 Ecore_Timer *timer = test_data->data; 64 Ecore_Timer *timer = test_data->data;
@@ -96,8 +96,8 @@ test_growing_balls(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *eve
96 96
97 test_data = test_data_new(); 97 test_data = test_data_new();
98 test_win_add(test_data, "Growing Balls", EINA_FALSE); 98 test_win_add(test_data, "Growing Balls", EINA_FALSE);
99 evas_object_smart_callback_add(test_data->win, "delete,request", _win_del, 99 evas_object_event_callback_add(test_data->win, EVAS_CALLBACK_DEL,
100 test_data); 100 _win_del, test_data);
101 101
102 elm_object_signal_emit(test_data->layout, "borders,show", "ephysics_test"); 102 elm_object_signal_emit(test_data->layout, "borders,show", "ephysics_test");
103 elm_layout_signal_callback_add(test_data->layout, "restart", "test-theme", 103 elm_layout_signal_callback_add(test_data->layout, "restart", "test-theme",
diff --git a/legacy/ephysics/src/bin/test_velocity.c b/legacy/ephysics/src/bin/test_velocity.c
index ba2ffc4..ed53d3a 100644
--- a/legacy/ephysics/src/bin/test_velocity.c
+++ b/legacy/ephysics/src/bin/test_velocity.c
@@ -138,7 +138,7 @@ _restart(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED_
138} 138}
139 139
140static void 140static void
141_win_del(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) 141_win_del(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
142{ 142{
143 Velocity_Data *velocity_data = data; 143 Velocity_Data *velocity_data = data;
144 144
@@ -148,6 +148,7 @@ _win_del(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
148 free(velocity_data); 148 free(velocity_data);
149 ephysics_shutdown(); 149 ephysics_shutdown();
150} 150}
151
151void 152void
152test_velocity(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) 153test_velocity(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
153{ 154{
@@ -167,8 +168,8 @@ test_velocity(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_in
167 } 168 }
168 169
169 test_win_add((Test_Data *)velocity_data, "Velocity Getters", EINA_FALSE); 170 test_win_add((Test_Data *)velocity_data, "Velocity Getters", EINA_FALSE);
170 evas_object_smart_callback_add(velocity_data->base.win, 171 evas_object_event_callback_add(velocity_data->base.win, EVAS_CALLBACK_DEL,
171 "delete,request", _win_del, velocity_data); 172 _win_del, velocity_data);
172 elm_layout_signal_callback_add(velocity_data->base.layout, "restart", 173 elm_layout_signal_callback_add(velocity_data->base.layout, "restart",
173 "test-theme", _restart, velocity_data); 174 "test-theme", _restart, velocity_data);
174 175
diff --git a/legacy/ephysics/src/bin/test_win_resize.c b/legacy/ephysics/src/bin/test_win_resize.c
index 620b130..f5bc037 100644
--- a/legacy/ephysics/src/bin/test_win_resize.c
+++ b/legacy/ephysics/src/bin/test_win_resize.c
@@ -12,7 +12,7 @@ struct _Old_Rate {
12}; 12};
13 13
14static void 14static void
15_del_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) 15_win_del(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
16{ 16{
17 free(data); 17 free(data);
18} 18}
@@ -175,8 +175,8 @@ test_win_resize(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_
175 evas_object_size_hint_weight_set(test_data->layout, EVAS_HINT_EXPAND, 175 evas_object_size_hint_weight_set(test_data->layout, EVAS_HINT_EXPAND,
176 EVAS_HINT_EXPAND); 176 EVAS_HINT_EXPAND);
177 elm_win_aspect_set(test_data->win, (double) WIDTH / HEIGHT); 177 elm_win_aspect_set(test_data->win, (double) WIDTH / HEIGHT);
178 evas_object_smart_callback_add(test_data->win, "delete,request", _del_cb, 178 evas_object_event_callback_add(test_data->win, EVAS_CALLBACK_DEL,
179 test_data->data); 179 _win_del, test_data->data);
180 180
181 world = ephysics_world_new(); 181 world = ephysics_world_new();
182 ephysics_world_render_geometry_set(world, 50, 40, WIDTH - 100, FLOOR_Y - 40); 182 ephysics_world_render_geometry_set(world, 50, 40, WIDTH - 100, FLOOR_Y - 40);