summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Zaoui <daniel.zaoui@samsung.com>2014-04-22 18:39:38 +0300
committerDaniel Zaoui <daniel.zaoui@samsung.com>2014-04-23 07:56:20 +0300
commit9122f603f9ea368f1ac197f20d1c0703c2d6df01 (patch)
treec5f494dad59f1bdecea0dd3b78d7ad9c188ecacd
parentadcc32329128b13fda47405a896319c7c96ea85f (diff)
Eo: adapt examples to Eo2.
It includes Eo and Evas porting to Eo2.
-rw-r--r--src/examples/eo/isa/eo_isa_complex.c2
-rw-r--r--src/examples/eo/isa/eo_isa_interface.c12
-rw-r--r--src/examples/eo/isa/eo_isa_interface.h14
-rw-r--r--src/examples/eo/isa/eo_isa_mixin.c35
-rw-r--r--src/examples/eo/isa/eo_isa_mixin.h12
-rw-r--r--src/examples/eo/isa/eo_isa_simple.c50
-rw-r--r--src/examples/eo/isa/eo_isa_simple.h14
-rw-r--r--src/examples/eo/simple/simple_interface.c12
-rw-r--r--src/examples/eo/simple/simple_interface.h14
-rw-r--r--src/examples/eo/simple/simple_main.c6
-rw-r--r--src/examples/eo/simple/simple_mixin.c35
-rw-r--r--src/examples/eo/simple/simple_mixin.h12
-rw-r--r--src/examples/eo/simple/simple_simple.c50
-rw-r--r--src/examples/eo/simple/simple_simple.h14
-rw-r--r--src/examples/evas/evas-object-manipulation-eo.c10
15 files changed, 83 insertions, 209 deletions
diff --git a/src/examples/eo/isa/eo_isa_complex.c b/src/examples/eo/isa/eo_isa_complex.c
index 4e4ff3e..12b8784 100644
--- a/src/examples/eo/isa/eo_isa_complex.c
+++ b/src/examples/eo/isa/eo_isa_complex.c
@@ -11,7 +11,7 @@ static const Eo_Class_Description class_desc = {
11 EO_VERSION, 11 EO_VERSION,
12 "Complex", 12 "Complex",
13 EO_CLASS_TYPE_REGULAR, 13 EO_CLASS_TYPE_REGULAR,
14 EO_CLASS_DESCRIPTION_OPS(NULL, NULL, 0), 14 EO_CLASS_DESCRIPTION_NOOPS(),
15 NULL, 15 NULL,
16 0, 16 0,
17 NULL, 17 NULL,
diff --git a/src/examples/eo/isa/eo_isa_interface.c b/src/examples/eo/isa/eo_isa_interface.c
index 8009012..95f0266 100644
--- a/src/examples/eo/isa/eo_isa_interface.c
+++ b/src/examples/eo/isa/eo_isa_interface.c
@@ -5,20 +5,20 @@
5#include "Eo.h" 5#include "Eo.h"
6#include "eo_isa_interface.h" 6#include "eo_isa_interface.h"
7 7
8EAPI Eo_Op INTERFACE_BASE_ID = 0;
9
10#define MY_CLASS INTERFACE_CLASS 8#define MY_CLASS INTERFACE_CLASS
11 9
12static const Eo_Op_Description op_desc[] = { 10EAPI EO_FUNC_BODY(interface_a_power_3_get, int, 0);
13 EO_OP_DESCRIPTION(INTERFACE_SUB_ID_A_POWER_3_GET, "Get the a^3"), 11
14 EO_OP_DESCRIPTION_SENTINEL 12static Eo_Op_Description op_desc[] = {
13 EO_OP_FUNC(interface_a_power_3_get, NULL, "Get the a^3"),
14 EO_OP_SENTINEL
15}; 15};
16 16
17static const Eo_Class_Description class_desc = { 17static const Eo_Class_Description class_desc = {
18 EO_VERSION, 18 EO_VERSION,
19 "Interface", 19 "Interface",
20 EO_CLASS_TYPE_INTERFACE, 20 EO_CLASS_TYPE_INTERFACE,
21 EO_CLASS_DESCRIPTION_OPS(&INTERFACE_BASE_ID, op_desc, INTERFACE_SUB_ID_LAST), 21 EO_CLASS_DESCRIPTION_OPS(op_desc),
22 NULL, 22 NULL,
23 0, 23 0,
24 NULL, 24 NULL,
diff --git a/src/examples/eo/isa/eo_isa_interface.h b/src/examples/eo/isa/eo_isa_interface.h
index c5bf43e..3827440 100644
--- a/src/examples/eo/isa/eo_isa_interface.h
+++ b/src/examples/eo/isa/eo_isa_interface.h
@@ -3,22 +3,12 @@
3 3
4#include "Eo.h" 4#include "Eo.h"
5 5
6extern EAPI Eo_Op INTERFACE_BASE_ID;
7
8enum {
9 INTERFACE_SUB_ID_A_POWER_3_GET,
10 INTERFACE_SUB_ID_LAST
11};
12
13#define INTERFACE_ID(sub_id) (INTERFACE_BASE_ID + sub_id)
14
15
16/** 6/**
17 * @def interface_a_power_3_get(ret) 7 * @def interface_a_power_3_get(ret)
18 * @brief Get a^3 8 * @brief Get a^3
19 * @param[out] ret integer pointer to ret - value 9 * @return integer value
20 */ 10 */
21#define interface_a_power_3_get(ret) INTERFACE_ID(INTERFACE_SUB_ID_A_POWER_3_GET), EO_TYPECHECK(int *, ret) 11EAPI int interface_a_power_3_get(void);
22 12
23#define INTERFACE_CLASS interface_class_get() 13#define INTERFACE_CLASS interface_class_get()
24const Eo_Class *interface_class_get(void); 14const Eo_Class *interface_class_get(void);
diff --git a/src/examples/eo/isa/eo_isa_mixin.c b/src/examples/eo/isa/eo_isa_mixin.c
index 71f1d85..66d501d 100644
--- a/src/examples/eo/isa/eo_isa_mixin.c
+++ b/src/examples/eo/isa/eo_isa_mixin.c
@@ -6,46 +6,31 @@
6#include "eo_isa_mixin.h" 6#include "eo_isa_mixin.h"
7#include "eo_isa_simple.h" 7#include "eo_isa_simple.h"
8 8
9EAPI Eo_Op MIXIN_BASE_ID = 0;
10
11#define MY_CLASS MIXIN_CLASS 9#define MY_CLASS MIXIN_CLASS
12 10
13static void 11static int
14_a_square_get(Eo *obj, void *class_data EINA_UNUSED, va_list *list) 12_a_square_get(Eo *obj, void *class_data EINA_UNUSED)
15{ 13{
16 int a; 14 int a = eo_do(obj, simple_a_get());
17 eo_do(obj, simple_a_get(&a));
18 int *ret = va_arg(*list, int *);
19 if (ret)
20 *ret = a * a;
21 printf("%s %s\n", eo_class_name_get(MY_CLASS), __func__); 15 printf("%s %s\n", eo_class_name_get(MY_CLASS), __func__);
16 return a * a;
22} 17}
23 18
24static void 19EAPI EO_FUNC_BODY(mixin_a_square_get, int, 0);
25_class_constructor(Eo_Class *klass)
26{
27 const Eo_Op_Func_Description func_desc[] = {
28 EO_OP_FUNC(MIXIN_ID(MIXIN_SUB_ID_A_SQUARE_GET), _a_square_get),
29 EO_OP_FUNC_SENTINEL
30 };
31
32 eo_class_funcs_set(klass, func_desc);
33}
34
35 20
36static const Eo_Op_Description op_desc[] = { 21static Eo_Op_Description op_desc[] = {
37 EO_OP_DESCRIPTION(MIXIN_SUB_ID_A_SQUARE_GET, "Get the value of A^2"), 22 EO_OP_FUNC(mixin_a_square_get, _a_square_get, "Get the value of A^2"),
38 EO_OP_DESCRIPTION_SENTINEL 23 EO_OP_SENTINEL
39}; 24};
40 25
41static const Eo_Class_Description class_desc = { 26static const Eo_Class_Description class_desc = {
42 EO_VERSION, 27 EO_VERSION,
43 "Mixin", 28 "Mixin",
44 EO_CLASS_TYPE_MIXIN, 29 EO_CLASS_TYPE_MIXIN,
45 EO_CLASS_DESCRIPTION_OPS(&MIXIN_BASE_ID, op_desc, MIXIN_SUB_ID_LAST), 30 EO_CLASS_DESCRIPTION_OPS(op_desc),
46 NULL, 31 NULL,
47 0, 32 0,
48 _class_constructor, 33 NULL,
49 NULL 34 NULL
50}; 35};
51 36
diff --git a/src/examples/eo/isa/eo_isa_mixin.h b/src/examples/eo/isa/eo_isa_mixin.h
index 539504d..b09ba4d 100644
--- a/src/examples/eo/isa/eo_isa_mixin.h
+++ b/src/examples/eo/isa/eo_isa_mixin.h
@@ -3,22 +3,12 @@
3 3
4#include "Eo.h" 4#include "Eo.h"
5 5
6extern EAPI Eo_Op MIXIN_BASE_ID;
7
8enum {
9 MIXIN_SUB_ID_A_SQUARE_GET,
10 MIXIN_SUB_ID_LAST
11};
12
13#define MIXIN_ID(sub_id) (MIXIN_BASE_ID + sub_id)
14
15
16/** 6/**
17 * @def mixin_a_square_get(ret) 7 * @def mixin_a_square_get(ret)
18 * @brief Get the square of a. 8 * @brief Get the square of a.
19 * @param[out] ret the square of a 9 * @param[out] ret the square of a
20 */ 10 */
21#define mixin_a_square_get(ret) MIXIN_ID(MIXIN_SUB_ID_A_SQUARE_GET), EO_TYPECHECK(int *, ret) 11EAPI int mixin_a_square_get(void);
22 12
23#define MIXIN_CLASS mixin_class_get() 13#define MIXIN_CLASS mixin_class_get()
24const Eo_Class *mixin_class_get(void); 14const Eo_Class *mixin_class_get(void);
diff --git a/src/examples/eo/isa/eo_isa_simple.c b/src/examples/eo/isa/eo_isa_simple.c
index 67f47fd..f5dcb3c 100644
--- a/src/examples/eo/isa/eo_isa_simple.c
+++ b/src/examples/eo/isa/eo_isa_simple.c
@@ -5,8 +5,6 @@
5#include "Eo.h" 5#include "Eo.h"
6#include "eo_isa_simple.h" 6#include "eo_isa_simple.h"
7 7
8EAPI Eo_Op SIMPLE_BASE_ID = 0;
9
10typedef struct 8typedef struct
11{ 9{
12 int a; 10 int a;
@@ -14,64 +12,48 @@ typedef struct
14 12
15#define MY_CLASS SIMPLE_CLASS 13#define MY_CLASS SIMPLE_CLASS
16 14
17static void 15static int
18_a_get(Eo *obj EINA_UNUSED, void *class_data, va_list *list) 16_a_get(Eo *obj EINA_UNUSED, void *class_data)
19{ 17{
20 const Private_Data *pd = class_data; 18 const Private_Data *pd = class_data;
21 int *a;
22 a = va_arg(*list, int *);
23 *a = pd->a;
24 printf("%s %s\n", eo_class_name_get(MY_CLASS), __func__); 19 printf("%s %s\n", eo_class_name_get(MY_CLASS), __func__);
20 return pd->a;
25} 21}
26 22
27static void 23static void
28_a_set(Eo *obj EINA_UNUSED, void *class_data, va_list *list) 24_a_set(Eo *obj EINA_UNUSED, void *class_data, int a)
29{ 25{
30 Private_Data *pd = class_data; 26 Private_Data *pd = class_data;
31 int a;
32 a = va_arg(*list, int);
33 pd->a = a; 27 pd->a = a;
34 printf("%s %s\n", eo_class_name_get(MY_CLASS), __func__); 28 printf("%s %s\n", eo_class_name_get(MY_CLASS), __func__);
35} 29}
36 30
37static void 31static int
38_a_power_3_get(Eo *obj EINA_UNUSED, void *class_data, va_list *list) 32_a_power_3_get(Eo *obj EINA_UNUSED, void *class_data)
39{ 33{
40 const Private_Data *pd = class_data; 34 const Private_Data *pd = class_data;
41 int *ret;
42 ret = va_arg(*list, int *);
43 if (ret)
44 *ret = pd->a * pd->a * pd->a;
45 printf("%s %s\n", eo_class_name_get(MY_CLASS), __func__); 35 printf("%s %s\n", eo_class_name_get(MY_CLASS), __func__);
36 return pd->a * pd->a * pd->a;
46} 37}
47 38
48static void 39EAPI EO_FUNC_BODY(simple_a_get, int, 0);
49_class_constructor(Eo_Class *klass) 40EAPI EO_VOID_FUNC_BODYV(simple_a_set, EO_FUNC_CALL(a), int a);
50{
51 const Eo_Op_Func_Description func_desc[] = {
52 EO_OP_FUNC(SIMPLE_ID(SIMPLE_SUB_ID_A_SET), _a_set),
53 EO_OP_FUNC(SIMPLE_ID(SIMPLE_SUB_ID_A_GET), _a_get),
54 EO_OP_FUNC(INTERFACE_ID(INTERFACE_SUB_ID_A_POWER_3_GET), _a_power_3_get),
55 EO_OP_FUNC_SENTINEL
56 };
57
58 eo_class_funcs_set(klass, func_desc);
59}
60 41
61static const Eo_Op_Description op_desc[] = { 42static Eo_Op_Description op_desc[] = {
62 EO_OP_DESCRIPTION(SIMPLE_SUB_ID_A_SET, "Set property A"), 43 EO_OP_FUNC(simple_a_set, _a_set, "Set property A"),
63 EO_OP_DESCRIPTION(SIMPLE_SUB_ID_A_GET, "Get property A"), 44 EO_OP_FUNC(simple_a_get, _a_get, "Get property A"),
64 EO_OP_DESCRIPTION_SENTINEL 45 EO_OP_FUNC_OVERRIDE(interface_a_power_3_get, _a_power_3_get),
46 EO_OP_SENTINEL
65}; 47};
66 48
67static const Eo_Class_Description class_desc = { 49static const Eo_Class_Description class_desc = {
68 EO_VERSION, 50 EO_VERSION,
69 "Simple", 51 "Simple",
70 EO_CLASS_TYPE_REGULAR, 52 EO_CLASS_TYPE_REGULAR,
71 EO_CLASS_DESCRIPTION_OPS(&SIMPLE_BASE_ID, op_desc, SIMPLE_SUB_ID_LAST), 53 EO_CLASS_DESCRIPTION_OPS(op_desc),
72 NULL, 54 NULL,
73 sizeof(Private_Data), 55 sizeof(Private_Data),
74 _class_constructor, 56 NULL,
75 NULL 57 NULL
76}; 58};
77 59
diff --git a/src/examples/eo/isa/eo_isa_simple.h b/src/examples/eo/isa/eo_isa_simple.h
index eead797..ee30208 100644
--- a/src/examples/eo/isa/eo_isa_simple.h
+++ b/src/examples/eo/isa/eo_isa_simple.h
@@ -5,29 +5,19 @@
5#include "eo_isa_interface.h" 5#include "eo_isa_interface.h"
6#include "eo_isa_mixin.h" 6#include "eo_isa_mixin.h"
7 7
8extern EAPI Eo_Op SIMPLE_BASE_ID;
9
10enum {
11 SIMPLE_SUB_ID_A_SET,
12 SIMPLE_SUB_ID_A_GET,
13 SIMPLE_SUB_ID_LAST
14};
15
16#define SIMPLE_ID(sub_id) (SIMPLE_BASE_ID + sub_id)
17
18/** 8/**
19 * @def simple_a_set(a) 9 * @def simple_a_set(a)
20 * @brief Set value to a-property 10 * @brief Set value to a-property
21 * @param[in] a integer value to set 11 * @param[in] a integer value to set
22 */ 12 */
23#define simple_a_set(a) SIMPLE_ID(SIMPLE_SUB_ID_A_SET), EO_TYPECHECK(int, a) 13EAPI void simple_a_set(int a);
24 14
25/** 15/**
26 * @def simple_a_get(a) 16 * @def simple_a_get(a)
27 * @brief Get value of a-property 17 * @brief Get value of a-property
28 * @param[out] integer pointer to a-value 18 * @param[out] integer pointer to a-value
29 */ 19 */
30#define simple_a_get(a) SIMPLE_ID(SIMPLE_SUB_ID_A_GET), EO_TYPECHECK(int *, a) 20EAPI int simple_a_get(void);
31 21
32#define SIMPLE_CLASS simple_class_get() 22#define SIMPLE_CLASS simple_class_get()
33const Eo_Class *simple_class_get(void); 23const Eo_Class *simple_class_get(void);
diff --git a/src/examples/eo/simple/simple_interface.c b/src/examples/eo/simple/simple_interface.c
index e591072..eeda051 100644
--- a/src/examples/eo/simple/simple_interface.c
+++ b/src/examples/eo/simple/simple_interface.c
@@ -5,20 +5,20 @@
5#include "Eo.h" 5#include "Eo.h"
6#include "simple_interface.h" 6#include "simple_interface.h"
7 7
8EAPI Eo_Op INTERFACE_BASE_ID = 0;
9
10#define MY_CLASS INTERFACE_CLASS 8#define MY_CLASS INTERFACE_CLASS
11 9
12static const Eo_Op_Description op_desc[] = { 10EAPI EO_FUNC_BODY(interface_a_power_3_get, int, 0);
13 EO_OP_DESCRIPTION(INTERFACE_SUB_ID_A_POWER_3_GET, "Get the a^3"), 11
14 EO_OP_DESCRIPTION_SENTINEL 12static Eo_Op_Description op_desc[] = {
13 EO_OP_FUNC(interface_a_power_3_get, NULL, "Get the a^3"),
14 EO_OP_SENTINEL
15}; 15};
16 16
17static const Eo_Class_Description class_desc = { 17static const Eo_Class_Description class_desc = {
18 EO_VERSION, 18 EO_VERSION,
19 "Interface", 19 "Interface",
20 EO_CLASS_TYPE_INTERFACE, 20 EO_CLASS_TYPE_INTERFACE,
21 EO_CLASS_DESCRIPTION_OPS(&INTERFACE_BASE_ID, op_desc, INTERFACE_SUB_ID_LAST), 21 EO_CLASS_DESCRIPTION_OPS(op_desc),
22 NULL, 22 NULL,
23 0, 23 0,
24 NULL, 24 NULL,
diff --git a/src/examples/eo/simple/simple_interface.h b/src/examples/eo/simple/simple_interface.h
index c5bf43e..3827440 100644
--- a/src/examples/eo/simple/simple_interface.h
+++ b/src/examples/eo/simple/simple_interface.h
@@ -3,22 +3,12 @@
3 3
4#include "Eo.h" 4#include "Eo.h"
5 5
6extern EAPI Eo_Op INTERFACE_BASE_ID;
7
8enum {
9 INTERFACE_SUB_ID_A_POWER_3_GET,
10 INTERFACE_SUB_ID_LAST
11};
12
13#define INTERFACE_ID(sub_id) (INTERFACE_BASE_ID + sub_id)
14
15
16/** 6/**
17 * @def interface_a_power_3_get(ret) 7 * @def interface_a_power_3_get(ret)
18 * @brief Get a^3 8 * @brief Get a^3
19 * @param[out] ret integer pointer to ret - value 9 * @return integer value
20 */ 10 */
21#define interface_a_power_3_get(ret) INTERFACE_ID(INTERFACE_SUB_ID_A_POWER_3_GET), EO_TYPECHECK(int *, ret) 11EAPI int interface_a_power_3_get(void);
22 12
23#define INTERFACE_CLASS interface_class_get() 13#define INTERFACE_CLASS interface_class_get()
24const Eo_Class *interface_class_get(void); 14const Eo_Class *interface_class_get(void);
diff --git a/src/examples/eo/simple/simple_main.c b/src/examples/eo/simple/simple_main.c
index a93a5e3..2ee7ee4 100644
--- a/src/examples/eo/simple/simple_main.c
+++ b/src/examples/eo/simple/simple_main.c
@@ -18,9 +18,9 @@ main(int argc, char *argv[])
18 18
19 int a = 0, a2 = 0, a3 = 0; 19 int a = 0, a2 = 0, a3 = 0;
20 20
21 eo_do(obj, simple_a_get(&a), 21 eo_do(obj, a = simple_a_get(),
22 interface_a_power_3_get(&a3), 22 a3 = interface_a_power_3_get(),
23 mixin_a_square_get(&a2)); 23 a2 = mixin_a_square_get());
24 24
25 printf("Got %d %d %d\n", a, a2, a3); 25 printf("Got %d %d %d\n", a, a2, a3);
26 26
diff --git a/src/examples/eo/simple/simple_mixin.c b/src/examples/eo/simple/simple_mixin.c
index 389b089..9f31880 100644
--- a/src/examples/eo/simple/simple_mixin.c
+++ b/src/examples/eo/simple/simple_mixin.c
@@ -6,46 +6,31 @@
6#include "simple_mixin.h" 6#include "simple_mixin.h"
7#include "simple_simple.h" 7#include "simple_simple.h"
8 8
9EAPI Eo_Op MIXIN_BASE_ID = 0;
10
11#define MY_CLASS MIXIN_CLASS 9#define MY_CLASS MIXIN_CLASS
12 10
13static void 11static int
14_a_square_get(Eo *obj, void *class_data EINA_UNUSED, va_list *list) 12_a_square_get(Eo *obj, void *class_data EINA_UNUSED)
15{ 13{
16 int a; 14 int a = eo_do(obj, simple_a_get());
17 eo_do(obj, simple_a_get(&a));
18 int *ret = va_arg(*list, int *);
19 if (ret)
20 *ret = a * a;
21 printf("%s %s\n", eo_class_name_get(MY_CLASS), __func__); 15 printf("%s %s\n", eo_class_name_get(MY_CLASS), __func__);
16 return a * a;
22} 17}
23 18
24static void 19EAPI EO_FUNC_BODY(mixin_a_square_get, int, 0);
25_class_constructor(Eo_Class *klass)
26{
27 const Eo_Op_Func_Description func_desc[] = {
28 EO_OP_FUNC(MIXIN_ID(MIXIN_SUB_ID_A_SQUARE_GET), _a_square_get),
29 EO_OP_FUNC_SENTINEL
30 };
31
32 eo_class_funcs_set(klass, func_desc);
33}
34
35 20
36static const Eo_Op_Description op_desc[] = { 21static Eo_Op_Description op_desc[] = {
37 EO_OP_DESCRIPTION(MIXIN_SUB_ID_A_SQUARE_GET, "Get the value of A^2"), 22 EO_OP_FUNC(mixin_a_square_get, _a_square_get, "Get the value of A^2"),
38 EO_OP_DESCRIPTION_SENTINEL 23 EO_OP_SENTINEL
39}; 24};
40 25
41static const Eo_Class_Description class_desc = { 26static const Eo_Class_Description class_desc = {
42 EO_VERSION, 27 EO_VERSION,
43 "Mixin", 28 "Mixin",
44 EO_CLASS_TYPE_MIXIN, 29 EO_CLASS_TYPE_MIXIN,
45 EO_CLASS_DESCRIPTION_OPS(&MIXIN_BASE_ID, op_desc, MIXIN_SUB_ID_LAST), 30 EO_CLASS_DESCRIPTION_OPS(op_desc),
46 NULL, 31 NULL,
47 0, 32 0,
48 _class_constructor, 33 NULL,
49 NULL 34 NULL
50}; 35};
51 36
diff --git a/src/examples/eo/simple/simple_mixin.h b/src/examples/eo/simple/simple_mixin.h
index 539504d..b09ba4d 100644
--- a/src/examples/eo/simple/simple_mixin.h
+++ b/src/examples/eo/simple/simple_mixin.h
@@ -3,22 +3,12 @@
3 3
4#include "Eo.h" 4#include "Eo.h"
5 5
6extern EAPI Eo_Op MIXIN_BASE_ID;
7
8enum {
9 MIXIN_SUB_ID_A_SQUARE_GET,
10 MIXIN_SUB_ID_LAST
11};
12
13#define MIXIN_ID(sub_id) (MIXIN_BASE_ID + sub_id)
14
15
16/** 6/**
17 * @def mixin_a_square_get(ret) 7 * @def mixin_a_square_get(ret)
18 * @brief Get the square of a. 8 * @brief Get the square of a.
19 * @param[out] ret the square of a 9 * @param[out] ret the square of a
20 */ 10 */
21#define mixin_a_square_get(ret) MIXIN_ID(MIXIN_SUB_ID_A_SQUARE_GET), EO_TYPECHECK(int *, ret) 11EAPI int mixin_a_square_get(void);
22 12
23#define MIXIN_CLASS mixin_class_get() 13#define MIXIN_CLASS mixin_class_get()
24const Eo_Class *mixin_class_get(void); 14const Eo_Class *mixin_class_get(void);
diff --git a/src/examples/eo/simple/simple_simple.c b/src/examples/eo/simple/simple_simple.c
index 42eb1f7..480938f 100644
--- a/src/examples/eo/simple/simple_simple.c
+++ b/src/examples/eo/simple/simple_simple.c
@@ -5,8 +5,6 @@
5#include "Eo.h" 5#include "Eo.h"
6#include "simple_simple.h" 6#include "simple_simple.h"
7 7
8EAPI Eo_Op SIMPLE_BASE_ID = 0;
9
10typedef struct 8typedef struct
11{ 9{
12 int a; 10 int a;
@@ -14,64 +12,48 @@ typedef struct
14 12
15#define MY_CLASS SIMPLE_CLASS 13#define MY_CLASS SIMPLE_CLASS
16 14
17static void 15static int
18_a_get(Eo *obj EINA_UNUSED, void *class_data, va_list *list) 16_a_get(Eo *obj EINA_UNUSED, void *class_data)
19{ 17{
20 const Private_Data *pd = class_data; 18 const Private_Data *pd = class_data;
21 int *a;
22 a = va_arg(*list, int *);
23 *a = pd->a;
24 printf("%s %s\n", eo_class_name_get(MY_CLASS), __func__); 19 printf("%s %s\n", eo_class_name_get(MY_CLASS), __func__);
20 return pd->a;
25} 21}
26 22
27static void 23static void
28_a_set(Eo *obj EINA_UNUSED, void *class_data, va_list *list) 24_a_set(Eo *obj EINA_UNUSED, void *class_data, int a)
29{ 25{
30 Private_Data *pd = class_data; 26 Private_Data *pd = class_data;
31 int a;
32 a = va_arg(*list, int);
33 pd->a = a; 27 pd->a = a;
34 printf("%s %s\n", eo_class_name_get(MY_CLASS), __func__); 28 printf("%s %s\n", eo_class_name_get(MY_CLASS), __func__);
35} 29}
36 30
37static void 31static int
38_a_power_3_get(Eo *obj EINA_UNUSED, void *class_data, va_list *list) 32_a_power_3_get(Eo *obj EINA_UNUSED, void *class_data)
39{ 33{
40 const Private_Data *pd = class_data; 34 const Private_Data *pd = class_data;
41 int *ret;
42 ret = va_arg(*list, int *);
43 if (ret)
44 *ret = pd->a * pd->a * pd->a;
45 printf("%s %s\n", eo_class_name_get(MY_CLASS), __func__); 35 printf("%s %s\n", eo_class_name_get(MY_CLASS), __func__);
36 return pd->a * pd->a * pd->a;
46} 37}
47 38
48static void 39EAPI EO_FUNC_BODY(simple_a_get, int, 0);
49_class_constructor(Eo_Class *klass) 40EAPI EO_VOID_FUNC_BODYV(simple_a_set, EO_FUNC_CALL(a), int a);
50{
51 const Eo_Op_Func_Description func_desc[] = {
52 EO_OP_FUNC(SIMPLE_ID(SIMPLE_SUB_ID_A_SET), _a_set),
53 EO_OP_FUNC(SIMPLE_ID(SIMPLE_SUB_ID_A_GET), _a_get),
54 EO_OP_FUNC(INTERFACE_ID(INTERFACE_SUB_ID_A_POWER_3_GET), _a_power_3_get),
55 EO_OP_FUNC_SENTINEL
56 };
57
58 eo_class_funcs_set(klass, func_desc);
59}
60 41
61static const Eo_Op_Description op_desc[] = { 42static Eo_Op_Description op_desc[] = {
62 EO_OP_DESCRIPTION(SIMPLE_SUB_ID_A_SET, "Set property A"), 43 EO_OP_FUNC(simple_a_set, _a_set, "Set property A"),
63 EO_OP_DESCRIPTION(SIMPLE_SUB_ID_A_GET, "Get property A"), 44 EO_OP_FUNC(simple_a_get, _a_get, "Get property A"),
64 EO_OP_DESCRIPTION_SENTINEL 45 EO_OP_FUNC_OVERRIDE(interface_a_power_3_get, _a_power_3_get),
46 EO_OP_SENTINEL
65}; 47};
66 48
67static const Eo_Class_Description class_desc = { 49static const Eo_Class_Description class_desc = {
68 EO_VERSION, 50 EO_VERSION,
69 "Simple", 51 "Simple",
70 EO_CLASS_TYPE_REGULAR, 52 EO_CLASS_TYPE_REGULAR,
71 EO_CLASS_DESCRIPTION_OPS(&SIMPLE_BASE_ID, op_desc, SIMPLE_SUB_ID_LAST), 53 EO_CLASS_DESCRIPTION_OPS(op_desc),
72 NULL, 54 NULL,
73 sizeof(Private_Data), 55 sizeof(Private_Data),
74 _class_constructor, 56 NULL,
75 NULL 57 NULL
76}; 58};
77 59
diff --git a/src/examples/eo/simple/simple_simple.h b/src/examples/eo/simple/simple_simple.h
index 36d4a00..845a1f1 100644
--- a/src/examples/eo/simple/simple_simple.h
+++ b/src/examples/eo/simple/simple_simple.h
@@ -5,29 +5,19 @@
5#include "simple_interface.h" 5#include "simple_interface.h"
6#include "simple_mixin.h" 6#include "simple_mixin.h"
7 7
8extern EAPI Eo_Op SIMPLE_BASE_ID;
9
10enum {
11 SIMPLE_SUB_ID_A_SET,
12 SIMPLE_SUB_ID_A_GET,
13 SIMPLE_SUB_ID_LAST
14};
15
16#define SIMPLE_ID(sub_id) (SIMPLE_BASE_ID + sub_id)
17
18/** 8/**
19 * @def simple_a_set(a) 9 * @def simple_a_set(a)
20 * @brief Set value to a-property 10 * @brief Set value to a-property
21 * @param[in] a integer value to set 11 * @param[in] a integer value to set
22 */ 12 */
23#define simple_a_set(a) SIMPLE_ID(SIMPLE_SUB_ID_A_SET), EO_TYPECHECK(int, a) 13EAPI void simple_a_set(int a);
24 14
25/** 15/**
26 * @def simple_a_get(a) 16 * @def simple_a_get(a)
27 * @brief Get value of a-property 17 * @brief Get value of a-property
28 * @param[out] integer pointer to a-value 18 * @param[out] integer pointer to a-value
29 */ 19 */
30#define simple_a_get(a) SIMPLE_ID(SIMPLE_SUB_ID_A_GET), EO_TYPECHECK(int *, a) 20EAPI int simple_a_get(void);
31 21
32#define SIMPLE_CLASS simple_class_get() 22#define SIMPLE_CLASS simple_class_get()
33const Eo_Class *simple_class_get(void); 23const Eo_Class *simple_class_get(void);
diff --git a/src/examples/evas/evas-object-manipulation-eo.c b/src/examples/evas/evas-object-manipulation-eo.c
index 5a2bdb8..2621791 100644
--- a/src/examples/evas/evas-object-manipulation-eo.c
+++ b/src/examples/evas/evas-object-manipulation-eo.c
@@ -122,7 +122,7 @@ _on_keydown(void *data EINA_UNUSED,
122 fprintf(stdout, "Toggling clipping "); 122 fprintf(stdout, "Toggling clipping ");
123 123
124 Evas_Object *clip = NULL; 124 Evas_Object *clip = NULL;
125 eo_do(d.img, evas_obj_clip_get(&clip)); 125 clip = eo_do(d.img, evas_obj_clip_get());
126 if (clip == d.clipper) 126 if (clip == d.clipper)
127 { 127 {
128 eo_do(d.img, evas_obj_clip_unset()); 128 eo_do(d.img, evas_obj_clip_unset());
@@ -141,7 +141,7 @@ _on_keydown(void *data EINA_UNUSED,
141 Eina_Bool visibility; 141 Eina_Bool visibility;
142 /* Don't use "get"-"set" expressions in one eo_do call, 142 /* Don't use "get"-"set" expressions in one eo_do call,
143 * if you pass parameter to "set" by value. */ 143 * if you pass parameter to "set" by value. */
144 eo_do(d.clipper, evas_obj_visibility_get(&visibility)); 144 visibility = eo_do(d.clipper, evas_obj_visibility_get());
145 eo_do(d.clipper, evas_obj_visibility_set(!visibility)); 145 eo_do(d.clipper, evas_obj_visibility_set(!visibility));
146 fprintf(stdout, "Clipper is now %s\n", visibility ? "hidden" : "visible"); 146 fprintf(stdout, "Clipper is now %s\n", visibility ? "hidden" : "visible");
147 return; 147 return;
@@ -193,7 +193,7 @@ main(void)
193 193
194 eo_do(d.img, evas_obj_image_filled_set(EINA_TRUE), 194 eo_do(d.img, evas_obj_image_filled_set(EINA_TRUE),
195 evas_obj_image_file_set(img_path, NULL), 195 evas_obj_image_file_set(img_path, NULL),
196 evas_obj_image_load_error_get(&err)); 196 err = evas_obj_image_load_error_get());
197 197
198 if (err != EVAS_LOAD_ERROR_NONE) 198 if (err != EVAS_LOAD_ERROR_NONE)
199 { 199 {
@@ -206,7 +206,7 @@ main(void)
206 evas_obj_visibility_set(EINA_TRUE)); 206 evas_obj_visibility_set(EINA_TRUE));
207 207
208 const char *type = NULL; 208 const char *type = NULL;
209 eo_do(d.img, evas_obj_type_get(&type)); 209 eo_do(d.img, type = evas_obj_type_get());
210 fprintf(stdout, "Image object added, type is: %s\n", type); 210 fprintf(stdout, "Image object added, type is: %s\n", type);
211 } 211 }
212 212
@@ -214,7 +214,7 @@ main(void)
214 d.clipper_border = eo_add(EVAS_OBJ_IMAGE_CLASS, d.canvas); 214 d.clipper_border = eo_add(EVAS_OBJ_IMAGE_CLASS, d.canvas);
215 eo_do(d.clipper_border, evas_obj_image_filled_set(EINA_TRUE), 215 eo_do(d.clipper_border, evas_obj_image_filled_set(EINA_TRUE),
216 evas_obj_image_file_set(border_img_path, NULL), 216 evas_obj_image_file_set(border_img_path, NULL),
217 evas_obj_image_load_error_get(&err)); 217 err = evas_obj_image_load_error_get());
218 218
219 if (err != EVAS_LOAD_ERROR_NONE) 219 if (err != EVAS_LOAD_ERROR_NONE)
220 { 220 {