*/
/**
- * @enum _EPhysics_Callback_Type
- * @typedef EPhysics_Callback_Type
- *
- * Identifier of callbacks to be set for EPhysics bodies and worlds.
- *
- * @see ephysics_body_event_callback_add()
- * @see ephysics_world_event_callback_add()
- *
- * @ingroup EPhysics
- */
-typedef enum _EPhysics_Callback_Type
-{
- /*
- * The following events are only for use with EPhysics world objects, with
- * @ref ephysics_world_event_callback_add():
- */
- EPHYSICS_CALLBACK_WORLD_FIRST, /**< kept as sentinel, not really an event */
- EPHYSICS_CALLBACK_WORLD_DEL, /**< World being deleted (called before free) */
- EPHYSICS_CALLBACK_WORLD_STOPPED, /**< no objects are moving any more */
- EPHYSICS_CALLBACK_WORLD_LAST, /**< kept as sentinel, not really an event */
-
- /*
- * The following events are only for use with EPhysics body objects, with
- * @ref ephysics_body_event_callback_add():
- */
- EPHYSICS_CALLBACK_BODY_FIRST, /**< kept as sentinel, not really an event */
- EPHYSICS_CALLBACK_BODY_UPDATE, /**< Body being updated */
- EPHYSICS_CALLBACK_BODY_COLLISION, /**< Body collided with other body */
- EPHYSICS_CALLBACK_BODY_DEL, /**< Body being deleted (called before free) */
- EPHYSICS_CALLBACK_BODY_STOPPED, /**< Body is not moving any more */
- EPHYSICS_CALLBACK_BODY_LAST, /**< kept as sentinel, not really an event */
-
- EPHYSICS_CALLBACK_LAST /**< kept as sentinel, not really an event */
-} EPhysics_Callback_Type; /**< The types of events triggering a callback */
-
-/**
* Initialize EPhysics
*
* Initializes Bullet physics engine.
typedef struct _EPhysics_World EPhysics_World; /**< World handle, most basic type of EPhysics. Created with @ref ephysics_world_new() and deleted with @ref ephysics_world_del(). */
/**
+ * @enum _EPhysics_Callback_World_Type
+ * @typedef EPhysics_Callback_World_Type
+ *
+ * Identifier of callbacks to be set for EPhysics worlds.
+ *
+ * @see ephysics_world_event_callback_add()
+ * @see ephysics_world_event_callback_del()
+ * @see ephysics_world_event_callback_del_full()
+ *
+ * @ingroup EPhysics_World
+ */
+typedef enum _EPhysics_Callback_World_Type
+{
+ EPHYSICS_CALLBACK_WORLD_DEL, /**< World being deleted (called before free) */
+ EPHYSICS_CALLBACK_WORLD_STOPPED, /**< no objects are moving any more */
+ EPHYSICS_CALLBACK_WORLD_LAST, /**< kept as sentinel, not really an event */
+} EPhysics_Callback_World_Type;
+
+/**
* @typedef EPhysics_World_Event_Cb
*
* EPhysics world event callback function signature.
*
* @ingroup EPhysics_World
*/
-EAPI void ephysics_world_event_callback_add(EPhysics_World *world, EPhysics_Callback_Type type, EPhysics_World_Event_Cb func, const void *data);
+EAPI void ephysics_world_event_callback_add(EPhysics_World *world, EPhysics_Callback_World_Type type, EPhysics_World_Event_Cb func, const void *data);
/**
* @brief
*
* @ingroup EPhysics_World
*/
-EAPI void *ephysics_world_event_callback_del(EPhysics_World *world, EPhysics_Callback_Type type, EPhysics_World_Event_Cb func);
+EAPI void *ephysics_world_event_callback_del(EPhysics_World *world, EPhysics_Callback_World_Type type, EPhysics_World_Event_Cb func);
/**
* @brief
*
* @ingroup EPhysics_World
*/
-EAPI void *ephysics_world_event_callback_del_full(EPhysics_World *world, EPhysics_Callback_Type type, EPhysics_World_Event_Cb func, void *data);
+EAPI void *ephysics_world_event_callback_del_full(EPhysics_World *world, EPhysics_Callback_World_Type type, EPhysics_World_Event_Cb func, void *data);
/**
* @brief
typedef struct _EPhysics_Body EPhysics_Body; /**< Body handle, represents an object on EPhysics world. Created with @ref ephysics_body_circle_add() or @ref ephysics_body_box_add() and deleted with @ref ephysics_body_del(). */
/**
+ * @enum _EPhysics_Callback_Body_Type
+ * @typedef EPhysics_Callback_Body_Type
+ *
+ * Identifier of callbacks to be set for EPhysics bodies.
+ *
+ * @see ephysics_body_event_callback_add()
+ * @see ephysics_body_event_callback_del()
+ * @see ephysics_body_event_callback_del_full()
+ *
+ * @ingroup EPhysics_Body
+ */
+typedef enum _EPhysics_Callback_Body_Type
+{
+ EPHYSICS_CALLBACK_BODY_UPDATE, /**< Body being updated */
+ EPHYSICS_CALLBACK_BODY_COLLISION, /**< Body collided with other body */
+ EPHYSICS_CALLBACK_BODY_DEL, /**< Body being deleted (called before free) */
+ EPHYSICS_CALLBACK_BODY_STOPPED, /**< Body is not moving any more */
+ EPHYSICS_CALLBACK_BODY_LAST, /**< kept as sentinel, not really an event */
+} EPhysics_Callback_Body_Type; /**< The types of events triggering a callback */
+
+
+/**
* @typedef EPhysics_Body_Event_Cb
*
* EPhysics bode event callback function signature.
*
* @ingroup EPhysics_Body
*/
-EAPI void ephysics_body_event_callback_add(EPhysics_Body *body, EPhysics_Callback_Type type, EPhysics_Body_Event_Cb func, const void *data);
+EAPI void ephysics_body_event_callback_add(EPhysics_Body *body, EPhysics_Callback_Body_Type type, EPhysics_Body_Event_Cb func, const void *data);
/**
* @brief
*
* @ingroup EPhysics_Body
*/
-EAPI void *ephysics_body_event_callback_del(EPhysics_Body *body, EPhysics_Callback_Type type, EPhysics_Body_Event_Cb func);
+EAPI void *ephysics_body_event_callback_del(EPhysics_Body *body, EPhysics_Callback_Body_Type type, EPhysics_Body_Event_Cb func);
/**
* @brief
*
* @ingroup EPhysics_Body
*/
-EAPI void *ephysics_body_event_callback_del_full(EPhysics_Body *body, EPhysics_Callback_Type type, EPhysics_Body_Event_Cb func, void *data);
+EAPI void *ephysics_body_event_callback_del_full(EPhysics_Body *body, EPhysics_Callback_Body_Type type, EPhysics_Body_Event_Cb func, void *data);
/**
* @brief
EINA_INLIST;
void (*func) (void *data, EPhysics_Body *body, void *event_info);
void *data;
- EPhysics_Callback_Type type;
+ EPhysics_Callback_Body_Type type;
};
struct _EPhysics_Body {
}
EAPI void
-ephysics_body_event_callback_add(EPhysics_Body *body, EPhysics_Callback_Type type, EPhysics_Body_Event_Cb func, const void *data)
+ephysics_body_event_callback_add(EPhysics_Body *body, EPhysics_Callback_Body_Type type, EPhysics_Body_Event_Cb func, const void *data)
{
EPhysics_Body_Callback *cb;
return;
}
- if ((type <= EPHYSICS_CALLBACK_BODY_FIRST) ||
- (type >= EPHYSICS_CALLBACK_BODY_LAST))
+ if ((type < 0) || (type >= EPHYSICS_CALLBACK_BODY_LAST))
{
ERR("Can't set body event callback, callback type is wrong.");
return;
}
EAPI void *
-ephysics_body_event_callback_del(EPhysics_Body *body, EPhysics_Callback_Type type, EPhysics_Body_Event_Cb func)
+ephysics_body_event_callback_del(EPhysics_Body *body, EPhysics_Callback_Body_Type type, EPhysics_Body_Event_Cb func)
{
EPhysics_Body_Callback *cb;
void *cb_data;
}
EAPI void *
-ephysics_body_event_callback_del_full(EPhysics_Body *body, EPhysics_Callback_Type type, EPhysics_Body_Event_Cb func, void *data)
+ephysics_body_event_callback_del_full(EPhysics_Body *body, EPhysics_Callback_Body_Type type, EPhysics_Body_Event_Cb func, void *data)
{
EPhysics_Body_Callback *cb;
void *cb_data;
EINA_INLIST;
void (*func) (void *data, EPhysics_World *world, void *event_info);
void *data;
- EPhysics_Callback_Type type;
+ EPhysics_Callback_World_Type type;
};
struct _EPhysics_World {
}
EAPI void
-ephysics_world_event_callback_add(EPhysics_World *world, EPhysics_Callback_Type type, EPhysics_World_Event_Cb func, const void *data)
+ephysics_world_event_callback_add(EPhysics_World *world, EPhysics_Callback_World_Type type, EPhysics_World_Event_Cb func, const void *data)
{
EPhysics_World_Callback *cb;
return;
}
- if ((type <= EPHYSICS_CALLBACK_WORLD_FIRST) ||
- (type >= EPHYSICS_CALLBACK_WORLD_LAST))
+ if ((type < 0) || (type >= EPHYSICS_CALLBACK_WORLD_LAST))
{
ERR("Can't set world event callback, callback type is wrong.");
return;
}
EAPI void *
-ephysics_world_event_callback_del(EPhysics_World *world, EPhysics_Callback_Type type, EPhysics_World_Event_Cb func)
+ephysics_world_event_callback_del(EPhysics_World *world, EPhysics_Callback_World_Type type, EPhysics_World_Event_Cb func)
{
EPhysics_World_Callback *cb;
void *cb_data;
}
EAPI void *
-ephysics_world_event_callback_del_full(EPhysics_World *world, EPhysics_Callback_Type type, EPhysics_World_Event_Cb func, void *data)
+ephysics_world_event_callback_del_full(EPhysics_World *world, EPhysics_Callback_World_Type type, EPhysics_World_Event_Cb func, void *data)
{
EPhysics_World_Callback *cb;
void *cb_data;