summaryrefslogtreecommitdiff
path: root/src/lib/edje/edje_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/edje/edje_main.c')
-rw-r--r--src/lib/edje/edje_main.c137
1 files changed, 137 insertions, 0 deletions
diff --git a/src/lib/edje/edje_main.c b/src/lib/edje/edje_main.c
index 13809e6..ee7ecd2 100644
--- a/src/lib/edje/edje_main.c
+++ b/src/lib/edje/edje_main.c
@@ -21,6 +21,11 @@ static const Edje_Calc_Params_Physics default_calc_physics = {
21 0.0, 0.0, 0.0, 0.0, 0.0, { 0.0, 0.0 }, { 0.0, 0.0 }, 0, 0, { { 0, 0, 0 }, { 0, 0, 0 } }, 0, 0, 0, 0 21 0.0, 0.0, 0.0, 0.0, 0.0, { 0.0, 0.0 }, { 0.0, 0.0 }, 0, 0, { { 0, 0, 0 }, { 0, 0, 0 } }, 0, 0, 0, 0
22}; 22};
23 23
24#ifdef HAVE_EPHYSICS
25static void _edje_ephysics_clear(void);
26#endif
27
28
24/*============================================================================* 29/*============================================================================*
25* API * 30* API *
26*============================================================================*/ 31*============================================================================*/
@@ -199,6 +204,10 @@ _edje_shutdown_core(void)
199 ecore_imf_shutdown(); 204 ecore_imf_shutdown();
200#endif 205#endif
201 206
207#ifdef HAVE_EPHYSICS
208 _edje_ephysics_clear();
209#endif
210
202 efreet_shutdown(); 211 efreet_shutdown();
203 evas_shutdown(); 212 evas_shutdown();
204 eet_shutdown(); 213 eet_shutdown();
@@ -315,3 +324,131 @@ _edje_need_imf(void)
315#endif 324#endif
316} 325}
317 326
327#ifdef HAVE_EPHYSICS
328Edje_Ephysics *_edje_ephysics = NULL;
329
330Eina_Bool
331_edje_ephysics_load(void)
332{
333 if (_edje_ephysics)
334 {
335 if (!_edje_ephysics->mod)
336 {
337 ERR("Cannot find libpulse!");
338 return EINA_FALSE;
339 }
340 return EINA_TRUE;
341 }
342 ERR("PHYYYYYYYYYYYYYYZIKS");
343 _edje_ephysics = calloc(1, sizeof(Edje_Ephysics));
344 if (!_edje_ephysics) return EINA_FALSE;
345# define LOAD(x) \
346 if (!_edje_ephysics->mod) { \
347 if ((_edje_ephysics->mod = eina_module_new(x))) { \
348 if (!eina_module_load(_edje_ephysics->mod)) { \
349 eina_module_free(_edje_ephysics->mod); \
350 _edje_ephysics->mod = NULL; \
351 } \
352 } \
353 }
354# if defined(_WIN32) || defined(__CYGWIN__)
355 LOAD("libephysics-1.dll");
356 LOAD("libephysics.dll");
357# elif defined(__APPLE__) && defined(__MACH__)
358 LOAD("libephysics.1.dylib");
359 LOAD("libephysics.1.so");
360 LOAD("libephysics.so.1");
361# else
362 LOAD("libephysics.so.1");
363# endif
364# undef LOAD
365 if (!_edje_ephysics->mod) return EINA_FALSE;
366# define SYM(x) \
367 if (!(_edje_ephysics->x = eina_module_symbol_get(_edje_ephysics->mod, #x))) { \
368 ERR("libpulse - cannot find %s", #x); \
369 goto err; \
370 }
371 SYM(ephysics_init);
372 SYM(ephysics_shutdown);
373 SYM(ephysics_world_new);
374 SYM(ephysics_world_del);
375 SYM(ephysics_world_event_callback_add)
376 SYM(ephysics_world_rate_set)
377 SYM(ephysics_world_gravity_set)
378 SYM(ephysics_world_render_geometry_set);
379 SYM(ephysics_world_render_geometry_get);
380 SYM(ephysics_quaternion_set)
381 SYM(ephysics_quaternion_get)
382 SYM(ephysics_quaternion_normalize)
383 SYM(ephysics_body_box_add)
384 SYM(ephysics_body_sphere_add)
385 SYM(ephysics_body_cylinder_add)
386 SYM(ephysics_body_soft_box_add)
387 SYM(ephysics_body_soft_sphere_add)
388 SYM(ephysics_body_soft_cylinder_add)
389 SYM(ephysics_body_cloth_add)
390 SYM(ephysics_body_top_boundary_add)
391 SYM(ephysics_body_bottom_boundary_add)
392 SYM(ephysics_body_right_boundary_add)
393 SYM(ephysics_body_left_boundary_add)
394 SYM(ephysics_body_front_boundary_add)
395 SYM(ephysics_body_back_boundary_add)
396 SYM(ephysics_body_central_impulse_apply)
397 SYM(ephysics_body_torque_impulse_apply)
398 SYM(ephysics_body_central_force_apply)
399 SYM(ephysics_body_torque_apply)
400 SYM(ephysics_body_forces_clear)
401 SYM(ephysics_body_linear_velocity_set)
402 SYM(ephysics_body_angular_velocity_set)
403 SYM(ephysics_body_stop)
404 SYM(ephysics_body_rotation_set)
405 SYM(ephysics_body_forces_get)
406 SYM(ephysics_body_torques_get)
407 SYM(ephysics_body_linear_velocity_get)
408 SYM(ephysics_body_angular_velocity_get)
409 SYM(ephysics_body_linear_movement_enable_set)
410 SYM(ephysics_body_angular_movement_enable_set)
411 SYM(ephysics_body_move)
412 SYM(ephysics_body_geometry_get)
413 SYM(ephysics_body_resize)
414 SYM(ephysics_body_material_set)
415 SYM(ephysics_body_density_set)
416 SYM(ephysics_body_mass_set)
417 SYM(ephysics_body_soft_body_hardness_set)
418 SYM(ephysics_body_restitution_set)
419 SYM(ephysics_body_friction_set)
420 SYM(ephysics_body_damping_set)
421 SYM(ephysics_body_sleeping_threshold_set)
422 SYM(ephysics_body_light_set)
423 SYM(ephysics_body_back_face_culling_set)
424 SYM(ephysics_body_evas_object_update)
425 SYM(ephysics_body_face_evas_object_set)
426 SYM(ephysics_body_evas_object_set)
427 SYM(ephysics_body_event_callback_add)
428 SYM(ephysics_body_data_set)
429 SYM(ephysics_body_data_get)
430 SYM(ephysics_body_rotation_get)
431#undef SYM
432 return EINA_TRUE;
433err:
434 if (_edje_ephysics->mod)
435 {
436 eina_module_free(_edje_ephysics->mod);
437 _edje_ephysics->mod = NULL;
438 }
439 return EINA_FALSE;
440}
441
442static void
443_edje_ephysics_clear(void)
444{
445 if (_edje_ephysics)
446 {
447 if (_edje_ephysics->mod)
448 eina_module_free(_edje_ephysics->mod);
449 free(_edje_ephysics);
450 _edje_ephysics = NULL;
451 }
452}
453#endif
454