#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "ephysics_test.h"
static void
_world_populate(Test_Data *test_data)
{
int x, y, w;
evas_object_text_text_set(text, "EPHYSICS");
evas_object_text_font_set(text, "Sans", 54);
evas_object_move(text, WIDTH / 4, HEIGHT / 8);
}
static void
_restart(
void *data,
Evas_Object *obj __UNUSED__,
const char *emission __UNUSED__,
const char *source __UNUSED__)
{
Test_Data *test_data = data;
test_clean(test_data);
_world_populate(test_data);
}
void
test_bouncing_text(
void *data __UNUSED__,
Evas_Object *obj __UNUSED__,
void *event_info __UNUSED__)
{
Test_Data *test_data;
return;
test_data = test_data_new();
test_win_add(test_data,
"Bouncing Text",
EINA_TRUE);
_restart, test_data);
WIDTH - 100, FLOOR_Y - 40, 100);
test_data->world = world;
_world_populate(test_data);
}
EAPI EPhysics_World * ephysics_world_new(void)
Create a new physics world.
EAPI Eina_List * eina_list_append(Eina_List *list, const void *data)
Appends the given data to the given linked list.
Definition: eina_list.c:584
struct _EPhysics_Body EPhysics_Body
Definition: EPhysics.h:655
EAPI void ephysics_body_friction_set(EPhysics_Body *body, double friction)
Set body's friction.
EAPI EPhysics_Body * ephysics_body_box_add(EPhysics_World *world)
Create a new box physics body.
#define EINA_FALSE
Definition: eina_types.h:502
Efl_Canvas_Object Evas_Object
Definition: Evas_Common.h:180
EAPI EPhysics_Body * ephysics_body_bottom_boundary_add(EPhysics_World *world)
Create a physic bottom boundary.
#define DBG(...)
Macro for logging Eina debug messages.
Definition: eina_file_common.h:176
void evas_object_geometry_get(const Evas_Object *eo_obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
Retrieves the position and (rectangular) size of the given Evas object.
Definition: evas_object_main.c:1374
EAPI int ephysics_init(void)
Initialize EPhysics.
void evas_object_show(Evas_Object *eo_obj)
Makes the given Evas object visible.
Definition: evas_object_main.c:1853
struct _EPhysics_World EPhysics_World
World handle, most basic type of EPhysics.
Definition: EPhysics.h:901
#define EINA_TRUE
Definition: eina_types.h:508
Evas_Object * evas_object_text_add(Evas *e)
Creates a new text object on the provided canvas.
Definition: evas_object_text.c:366
EAPI void ephysics_world_render_geometry_set(EPhysics_World *world, Evas_Coord x, Evas_Coord y, Evas_Coord z, Evas_Coord w, Evas_Coord h, Evas_Coord d)
Set dimensions of rendered area to be take on account by default updates.
EAPI void ephysics_body_evas_object_set(EPhysics_Body *body, Evas_Object *evas_obj, Eina_Bool use_obj_pos)
Set an evas object to a physics body.
void elm_object_signal_emit(Evas_Object *obj, const char *emission, const char *source)
Send a signal to the widget edje object.
Definition: elm_main.c:1881
EAPI void ephysics_body_geometry_set(EPhysics_Body *body, Evas_Coord x, Evas_Coord y, Evas_Coord z, Evas_Coord w, Evas_Coord h, Evas_Coord d)
Set physics body geometry.
void evas_object_color_set(Evas_Object *obj, int r, int g, int b, int a)
Sets the general/main color of the given Evas object to the given one.
Definition: evas_object_main.c:2063
EAPI void elm_layout_signal_callback_add(Eo *obj, const char *emission, const char *source, Edje_Signal_Cb func, void *data)
Add a callback for a (Edje) signal emitted by a layout widget's underlying Edje object.
Definition: efl_ui_layout.c:3218
EAPI void ephysics_body_restitution_set(EPhysics_Body *body, double restitution)
Set body's coefficient of restitution.