summaryrefslogtreecommitdiff
path: root/src/examples/eolian_cxx
diff options
context:
space:
mode:
authorSavio Sena <savio@expertisesolutions.com.br>2014-06-19 23:54:36 +0100
committerDaniel Kolesa <d.kolesa@samsung.com>2014-06-19 23:54:36 +0100
commitbdd5cf5219a24a7ed46d54cbc13a52ff6851e5fe (patch)
tree6e5c0a006479fda7154b9212117247a489651022 /src/examples/eolian_cxx
parent35f0cd2680653b2a2bf1f7e430a91f78b7b792bb (diff)
Eolian-Cxx: Corrected the syntax of the .eo examples and added missing includes.
Summary: Just updating the .eo's to match the new syntax. Reviewers: cedric, q66, tasn, JackDanielZ Reviewed By: q66 CC: felipealmeida, smohanty, woohyun, cedric Differential Revision: https://phab.enlightenment.org/D1067
Diffstat (limited to 'src/examples/eolian_cxx')
-rw-r--r--src/examples/eolian_cxx/colourable.c22
-rw-r--r--src/examples/eolian_cxx/colourable.eo43
-rw-r--r--src/examples/eolian_cxx/colourablesquare.c23
-rw-r--r--src/examples/eolian_cxx/colourablesquare.eo31
-rw-r--r--src/examples/eolian_cxx/eolian_cxx_inherit_01.cc1
-rw-r--r--src/examples/eolian_cxx/eolian_cxx_simple_01.cc1
6 files changed, 53 insertions, 68 deletions
diff --git a/src/examples/eolian_cxx/colourable.c b/src/examples/eolian_cxx/colourable.c
index 3e28958..9bbcce2 100644
--- a/src/examples/eolian_cxx/colourable.c
+++ b/src/examples/eolian_cxx/colourable.c
@@ -40,7 +40,7 @@ typedef struct _Colourable_Data Colourable_Data;
40 Colourable_Data *wd = eo_data_scope_get(o, MY_CLASS) 40 Colourable_Data *wd = eo_data_scope_get(o, MY_CLASS)
41 41
42void 42void
43_colourable_constructor(Eo *obj, Colourable_Data *self) 43_colourable_constructor(Eo *obj, Colourable_Data *self EINA_UNUSED)
44{ 44{
45 if(!_colourable_impl_logdomain) 45 if(!_colourable_impl_logdomain)
46 { 46 {
@@ -52,7 +52,7 @@ _colourable_constructor(Eo *obj, Colourable_Data *self)
52} 52}
53 53
54void 54void
55_colourable_destructor(Eo *obj, Colourable_Data *self) 55_colourable_destructor(Eo *obj, Colourable_Data *self EINA_UNUSED)
56{ 56{
57 if(_colourable_impl_logdomain) 57 if(_colourable_impl_logdomain)
58 { 58 {
@@ -98,13 +98,13 @@ _colourable_rgb_24bits_constructor(Eo *obj, Colourable_Data *self, int rgb)
98} 98}
99 99
100void 100void
101_colourable_print_colour(Eo *obj, Colourable_Data *self) 101_colourable_print_colour(Eo *obj EINA_UNUSED, Colourable_Data *self EINA_UNUSED)
102{ 102{
103 DBG("_colourable_print_colour() ==> 0x%2.x 0x%2.x 0x%2.x\n", self->r, self->g, self->b); 103 DBG("_colourable_print_colour() ==> 0x%2.x 0x%2.x 0x%2.x\n", self->r, self->g, self->b);
104} 104}
105 105
106int 106int
107_colourable_colour_mask(Eo *obj, Colourable_Data *self, int mask) 107_colourable_colour_mask(Eo *obj EINA_UNUSED, Colourable_Data *self, int mask)
108{ 108{
109 int masked_rgb = 109 int masked_rgb =
110 (((self->r << 16)& 0x00ff0000) | 110 (((self->r << 16)& 0x00ff0000) |
@@ -115,7 +115,7 @@ _colourable_colour_mask(Eo *obj, Colourable_Data *self, int mask)
115} 115}
116 116
117void 117void
118_colourable_composite_colour_get(Eo *obj, Colourable_Data *self, int* r, int* g, int* b) 118_colourable_composite_colour_get(Eo *obj EINA_UNUSED, Colourable_Data *self, int* r, int* g, int* b)
119{ 119{
120 *r = self->r; 120 *r = self->r;
121 *g = self->g; 121 *g = self->g;
@@ -125,7 +125,7 @@ _colourable_composite_colour_get(Eo *obj, Colourable_Data *self, int* r, int* g,
125} 125}
126 126
127void 127void
128_colourable_composite_colour_set(Eo *obj, Colourable_Data *self, int r, int g, int b) 128_colourable_composite_colour_set(Eo *obj EINA_UNUSED, Colourable_Data *self, int r, int g, int b)
129{ 129{
130 self->r = r; 130 self->r = r;
131 self->g = g; 131 self->g = g;
@@ -136,7 +136,7 @@ _colourable_composite_colour_set(Eo *obj, Colourable_Data *self, int r, int g, i
136} 136}
137 137
138int 138int
139_colourable_colour_get(Eo *obj, Colourable_Data *self) 139_colourable_colour_get(Eo *obj EINA_UNUSED, Colourable_Data *self)
140{ 140{
141 int rgb = 141 int rgb =
142 ((self->r << 16)& 0x00ff0000) | 142 ((self->r << 16)& 0x00ff0000) |
@@ -147,7 +147,7 @@ _colourable_colour_get(Eo *obj, Colourable_Data *self)
147} 147}
148 148
149void 149void
150_colourable_colour_set(Eo *obj, Colourable_Data *self, int rgb) 150_colourable_colour_set(Eo *obj EINA_UNUSED, Colourable_Data *self, int rgb)
151{ 151{
152 self->r = (rgb & 0x00ff0000) >> 16; 152 self->r = (rgb & 0x00ff0000) >> 16;
153 self->g = (rgb & 0x0000ff00) >> 8; 153 self->g = (rgb & 0x0000ff00) >> 8;
@@ -156,10 +156,4 @@ _colourable_colour_set(Eo *obj, Colourable_Data *self, int rgb)
156 return; 156 return;
157} 157}
158 158
159static void
160_user_colourable_class_constructor(Eo_Class *klass)
161{
162 DBG("_colourable_class_constructor()\n");
163}
164
165#include "colourable.eo.c" 159#include "colourable.eo.c"
diff --git a/src/examples/eolian_cxx/colourable.eo b/src/examples/eolian_cxx/colourable.eo
index a708217..22bd59e 100644
--- a/src/examples/eolian_cxx/colourable.eo
+++ b/src/examples/eolian_cxx/colourable.eo
@@ -2,6 +2,7 @@ class Colourable (Eo_Base)
2{ 2{
3 /*@ Colourable class. */ 3 /*@ Colourable class. */
4 legacy_prefix: legacy; 4 legacy_prefix: legacy;
5 data: Colourable_Data;
5 constructors { 6 constructors {
6 constructor { 7 constructor {
7 /*@ Default constructor. */ 8 /*@ Default constructor. */
@@ -12,52 +13,52 @@ class Colourable (Eo_Base)
12 @in int r; /*@ The red component. */ 13 @in int r; /*@ The red component. */
13 @in int g; /*@ The green component. */ 14 @in int g; /*@ The green component. */
14 @in int b; /*@ The blue component. */ 15 @in int b; /*@ The blue component. */
15 }; 16 }
16 }; 17 }
17 rgb_24bits_constructor { 18 rgb_24bits_constructor {
18 /*@ RGB Constructor. */ 19 /*@ RGB Constructor. */
19 params { 20 params {
20 @in int rgb; /*@ 24-bit RGB Component. */ 21 @in int rgb; /*@ 24-bit RGB Component. */
21 }; 22 }
22 }; 23 }
23 }; 24 }
24 methods { 25 methods {
25 print_colour { /*@ Print the RGB colour. */ }; 26 print_colour { /*@ Print the RGB colour. */ }
26 colour_mask { 27 colour_mask {
27 /*@ The masked RGB value. */ 28 /*@ The masked RGB value. */
28 return int;
29 params { 29 params {
30 @in int mask; /*@ The colour mask to be applied to current RGB value. */ 30 @in int mask; /*@ The colour mask to be applied to current RGB value. */
31 }; 31 }
32 }; 32 return int; /*@ The RGB colour. */
33 }; 33 }
34 }
34 properties { 35 properties {
35 colour { 36 colour {
36 set { 37 set {
37 /*@ Sets a 24-bit RGB colour. */ 38 /*@ Sets a 24-bit RGB colour. */
38 }; 39 }
39 get { 40 get {
40 /*@ Gets the 24-bit RGB colour. */ 41 /*@ Gets the 24-bit RGB colour. */
41 }; 42 }
42 values { 43 values {
43 int rgb; /*@ The RGB colour value. */ 44 int rgb; /*@ The RGB colour value. */
44 }; 45 }
45 }; 46 }
46 composite_colour { 47 composite_colour {
47 set { 48 set {
48 /*@ Sets a composite RGB colour. */ 49 /*@ Sets a composite RGB colour. */
49 }; 50 }
50 get { 51 get {
51 /*@ Gets the composite RGB colour. */ 52 /*@ Gets the composite RGB colour. */
52 }; 53 }
53 values { 54 values {
54 int r; /*@ The red component. */ 55 int r; /*@ The red component. */
55 int g; /*@ The green component. */ 56 int g; /*@ The green component. */
56 int b; /*@ The blue component. */ 57 int b; /*@ The blue component. */
57 }; 58 }
58 }; 59 }
59 }; 60 }
60 events { 61 events {
61 colour_changed(int); 62 colour_changed(int);
62 }; 63 }
63}; 64}
diff --git a/src/examples/eolian_cxx/colourablesquare.c b/src/examples/eolian_cxx/colourablesquare.c
index 1eb190c..9ed046a 100644
--- a/src/examples/eolian_cxx/colourablesquare.c
+++ b/src/examples/eolian_cxx/colourablesquare.c
@@ -52,40 +52,23 @@ _colourablesquare_size_constructor(Eo *obj, ColourableSquare_Data *self, int siz
52 eo_do_super(obj, MY_CLASS, eo_constructor()); 52 eo_do_super(obj, MY_CLASS, eo_constructor());
53} 53}
54 54
55static void
56_colourablesquare_destructor(Eo *obj, ColourableSquare_Data *self)
57{
58 eo_do_super(obj, MY_CLASS, eo_destructor());
59 if(_colourablesquare_impl_logdomain)
60 {
61 eina_log_domain_unregister(_colourablesquare_impl_logdomain);
62 _colourablesquare_impl_logdomain = 0;
63 }
64}
65
66static int 55static int
67_colourablesquare_size_get(Eo *obj, ColourableSquare_Data *self) 56_colourablesquare_size_get(Eo *obj EINA_UNUSED, ColourableSquare_Data *self)
68{ 57{
69 DBG("_colourablesquare_size_get() => %d\n", self->size); 58 DBG("_colourablesquare_size_get() => %d\n", self->size);
70 return self->size; 59 return self->size;
71} 60}
72 61
73static void 62static void
74_colourablesquare_size_print(Eo *obj, ColourableSquare_Data *self) 63_colourablesquare_size_print(Eo *obj EINA_UNUSED, ColourableSquare_Data *self)
75{ 64{
76 DBG("_colourablesquare_size_print() ==> %d\n", self->size); 65 DBG("_colourablesquare_size_print() ==> %d\n", self->size);
77} 66}
78 67
79static void 68static void
80_colourablesquare_size_set(Eo *obj, ColourableSquare_Data *self, int size) 69_colourablesquare_size_set(Eo *obj EINA_UNUSED, ColourableSquare_Data *self EINA_UNUSED, int size)
81{ 70{
82 DBG("_colourablesquare_size_set(%d)\n", size); 71 DBG("_colourablesquare_size_set(%d)\n", size);
83} 72}
84 73
85static void
86_user_colourablesquare_class_constructor(Eo_Class *klass)
87{
88 DBG("_colourablesquare_class_constructor()\n");
89}
90
91#include "colourablesquare.eo.c" 74#include "colourablesquare.eo.c"
diff --git a/src/examples/eolian_cxx/colourablesquare.eo b/src/examples/eolian_cxx/colourablesquare.eo
index d254151..0a7c101 100644
--- a/src/examples/eolian_cxx/colourablesquare.eo
+++ b/src/examples/eolian_cxx/colourablesquare.eo
@@ -1,23 +1,28 @@
1class ColourableSquare (Colourable) 1class ColourableSquare (Colourable)
2{ 2{
3 constructors {
4 size_constructor { params { @in int size; } }
5 };
6 legacy_prefix: legacy; 3 legacy_prefix: legacy;
4 data: ColourableSquare_Data;
5 constructors {
6 size_constructor {
7 params {
8 @in int size;
9 }
10 }
11 }
7 properties { 12 properties {
8 size { 13 size {
9 values {
10 int size;
11 };
12 set { 14 set {
13 /*@ Sets size. */ 15 /*@ Sets size. */
14 }; 16 }
15 get { 17 get {
16 /*@ Gets size. */ 18 /*@ Gets size. */
17 }; 19 }
18 }; 20 values {
19 }; 21 int size; /*@ The size. */
22 }
23 }
24 }
20 methods { 25 methods {
21 size_print { /*@ Show the square. */ }; 26 size_print { /*@ Show the square. */ }
22 }; 27 }
23}; 28}
diff --git a/src/examples/eolian_cxx/eolian_cxx_inherit_01.cc b/src/examples/eolian_cxx/eolian_cxx_inherit_01.cc
index 798b3a8..763e0c3 100644
--- a/src/examples/eolian_cxx/eolian_cxx_inherit_01.cc
+++ b/src/examples/eolian_cxx/eolian_cxx_inherit_01.cc
@@ -1,5 +1,6 @@
1 1
2#include <iostream> 2#include <iostream>
3#include <cassert>
3 4
4#ifdef HAVE_CONFIG_H 5#ifdef HAVE_CONFIG_H
5# include <config.h> 6# include <config.h>
diff --git a/src/examples/eolian_cxx/eolian_cxx_simple_01.cc b/src/examples/eolian_cxx/eolian_cxx_simple_01.cc
index 363073a..0a35f93 100644
--- a/src/examples/eolian_cxx/eolian_cxx_simple_01.cc
+++ b/src/examples/eolian_cxx/eolian_cxx_simple_01.cc
@@ -1,6 +1,7 @@
1// EINA_LOG_LEVELS=colourable:4,colourablesquare:4 ./eolian_cxx_simple_01 1// EINA_LOG_LEVELS=colourable:4,colourablesquare:4 ./eolian_cxx_simple_01
2 2
3#include <iostream> 3#include <iostream>
4#include <cassert>
4 5
5#ifdef HAVE_CONFIG_H 6#ifdef HAVE_CONFIG_H
6# include <config.h> 7# include <config.h>