Data Structures

struct  _Eo_Op_Func_Description
 Used to associate an Op with a func. More...
 
struct  _Eo_Op_Description
 This struct holds the description of a specific op. More...
 
struct  _Eo_Class_Description
 This struct holds the description of a class. More...
 

Macros

#define EO_DEFINE_CLASS(class_get_func_name, class_desc, parent_class,...)
 A convenience macro to be used for creating the class_get function.
 
#define EO_OP_FUNC(op, func)   { op, EO_TYPECHECK(eo_op_func_type, func), EO_OP_TYPE_REGULAR }
 A convenience macro to be used when populating the Eo_Op_Func_Description array.
 
#define EO_OP_FUNC_CLASS(op, func)   { op, (eo_op_func_type) EO_TYPECHECK(eo_op_func_type_class, func), EO_OP_TYPE_CLASS }
 A convenience macro to be used when populating the Eo_Op_Func_Description array.
 
#define EO_OP_FUNC_SENTINEL   { 0, NULL, EO_OP_TYPE_INVALID }
 A convenience macro to be used when populating the Eo_Op_Func_Description array.
 
#define EO_VERSION   1
 The current version of EO.
 
#define EO_CLASS_DESCRIPTION_OPS(base_op_id, op_descs, count)   { base_op_id, op_descs, count }
 An helper macro to help populating Eo_Class_Description.
 
#define EO_OP_DESCRIPTION(sub_id, doc)   { sub_id, #sub_id, doc, EO_OP_TYPE_REGULAR }
 An helper macro to help populating Eo_Op_Description.
 
#define EO_OP_DESCRIPTION_CLASS(sub_id, doc)   { sub_id, #sub_id, doc, EO_OP_TYPE_CLASS }
 An helper macro to help populating Eo_Op_Description This macro is the same as EO_OP_DESCRIPTION but indicates that the op's implementation is of type CLASS.
 
#define EO_OP_DESCRIPTION_SENTINEL   { 0, NULL, NULL, EO_OP_TYPE_INVALID }
 An helper macro to help populating Eo_Op_Description Should be placed at the end of the array.
 

Typedefs

typedef enum _Eo_Class_Type Eo_Class_Type
 A convenience typedef for _Eo_Class_Type.
 
typedef struct
_Eo_Op_Func_Description 
Eo_Op_Func_Description
 A convenience typedef for _Eo_Op_Func_Description.
 
typedef struct _Eo_Op_Description Eo_Op_Description
 A convenience typedef for _Eo_Op_Description.
 
typedef struct
_Eo_Class_Description 
Eo_Class_Description
 A convenience typedef for _Eo_Class_Description.
 
typedef struct _Eo_Class Eo_Class
 The basic Object class type.
 
typedef size_t Eo_Class_Id
 An Id of a class.
 

Enumerations

enum  _Eo_Class_Type {
  EO_CLASS_TYPE_REGULAR = 0,
  EO_CLASS_TYPE_REGULAR_NO_INSTANT,
  EO_CLASS_TYPE_INTERFACE,
  EO_CLASS_TYPE_MIXIN
}
 An enum representing the possible types of an Eo class. More...
 

Functions

const Eo_Classeo_class_new (const Eo_Class_Description *desc, const Eo_Class *parent,...)
 Create a new class.
 
Eina_Bool eo_isa (const Eo *obj, const Eo_Class *klass)
 Check if an object "is a" klass.
 
void eo_class_funcs_set (Eo_Class *klass, const Eo_Op_Func_Description *func_descs)
 Sets the OP functions for a class.
 
const char * eo_class_name_get (const Eo_Class *klass)
 Gets the name of the passed class.
 

Detailed Description

Macro Definition Documentation

#define EO_DEFINE_CLASS (   class_get_func_name,
  class_desc,
  parent_class,
  ... 
)

A convenience macro to be used for creating the class_get function.

This macro is fairly simple but should still be used as it'll let us improve things easily.

Parameters
class_get_func_namethe name of the wanted class_get function name.
class_descthe class description.
parent_classThe parent class for the function. Look at eo_class_new() for more information.
...List of etxensions. Look at eo_class_new() for more information.

You must use this macro if you want thread safety in class creation.

#define EO_OP_FUNC_CLASS (   op,
  func 
)    { op, (eo_op_func_type) EO_TYPECHECK(eo_op_func_type_class, func), EO_OP_TYPE_CLASS }

A convenience macro to be used when populating the Eo_Op_Func_Description array.

The same as EO_OP_FUNC but for class functions.

See Also
EO_OP_FUNC
#define EO_OP_FUNC_SENTINEL   { 0, NULL, EO_OP_TYPE_INVALID }

A convenience macro to be used when populating the Eo_Op_Func_Description array.

It must appear at the end of the ARRAY.

#define EO_CLASS_DESCRIPTION_OPS (   base_op_id,
  op_descs,
  count 
)    { base_op_id, op_descs, count }

An helper macro to help populating Eo_Class_Description.

Parameters
base_op_idA pointer to the base op id of the class.
op_descsthe op descriptions array.
countthe number of ops in the op descriptions array.
#define EO_OP_DESCRIPTION (   sub_id,
  doc 
)    { sub_id, #sub_id, doc, EO_OP_TYPE_REGULAR }

An helper macro to help populating Eo_Op_Description.

Parameters
sub_idThe sub id of the op being described.
docAdditional doc for the op.
See Also
Eo_Op_Description
EO_OP_DESCRIPTION_CLASS
EO_OP_DESCRIPTION_SENTINEL
#define EO_OP_DESCRIPTION_CLASS (   sub_id,
  doc 
)    { sub_id, #sub_id, doc, EO_OP_TYPE_CLASS }

An helper macro to help populating Eo_Op_Description This macro is the same as EO_OP_DESCRIPTION but indicates that the op's implementation is of type CLASS.

Parameters
sub_idThe sub id of the op being described.
docAdditional doc for the op.
See Also
Eo_Op_Description
EO_OP_DESCRIPTION
EO_OP_DESCRIPTION_SENTINEL
#define EO_OP_DESCRIPTION_SENTINEL   { 0, NULL, NULL, EO_OP_TYPE_INVALID }

An helper macro to help populating Eo_Op_Description Should be placed at the end of the array.

See Also
Eo_Op_Description
EO_OP_DESCRIPTION

Enumeration Type Documentation

An enum representing the possible types of an Eo class.

Enumerator:
EO_CLASS_TYPE_REGULAR 

Regular class.

EO_CLASS_TYPE_REGULAR_NO_INSTANT 

Regular non instant-able class.

EO_CLASS_TYPE_INTERFACE 

Interface.

EO_CLASS_TYPE_MIXIN 

Mixin.

Function Documentation

const Eo_Class* eo_class_new ( const Eo_Class_Description desc,
const Eo_Class parent,
  ... 
)

Create a new class.

Parameters
descthe class description to create the class with.
parentthe class to inherit from.
...A NULL terminated list of extensions (interfaces, mixins and the classes of any composite objects).
Returns
The new class's handle on success, or NULL otherwise.

You should use EO_DEFINE_CLASS. It'll provide thread safety and other features easily.

See Also
EO_DEFINE_CLASS

References _Eo_Class_Description::data_size, eina_list_append(), eina_list_count(), EINA_LIST_FREE, EINA_MAGIC_CHECK, EINA_MAGIC_FAIL, EINA_MAGIC_SET, EINA_SAFETY_ON_FALSE_RETURN_VAL, EINA_SAFETY_ON_NULL_RETURN_VAL, EO_CLASS_TYPE_INTERFACE, EO_CLASS_TYPE_MIXIN, EO_CLASS_TYPE_REGULAR, EO_CLASS_TYPE_REGULAR_NO_INSTANT, _Eo_Class_Description::name, and _Eo_Class_Description::type.

Eina_Bool eo_isa ( const Eo obj,
const Eo_Class klass 
)

Check if an object "is a" klass.

Parameters
objThe object to check
klassThe klass to check against.
Returns
EINA_TRUE if obj implements klass, EINA_FALSE otherwise.

Notice: This function does not support composite objects.

References EINA_FALSE.

Referenced by evas_object_smart_interface_get(), and evas_object_smart_members_get().

void eo_class_funcs_set ( Eo_Class klass,
const Eo_Op_Func_Description func_descs 
)

Sets the OP functions for a class.

Parameters
klassthe class to set the functions to.
func_descsa NULL terminated array of Eo_Op_Func_Description

Should be called from within the class constructor.

References EINA_LIKELY, EINA_UNLIKELY, EO_NOOP, _Eo_Op_Func_Description::func, _Eo_Op_Description::name, _Eo_Op_Func_Description::op, _Eo_Op_Func_Description::op_type, and _Eo_Op_Description::op_type.

const char* eo_class_name_get ( const Eo_Class klass)

Gets the name of the passed class.

Parameters
klassthe class to work on.
Returns
The class's name.
See Also
eo_class_get()