From 9a5644b2856cc15dcf83c003c32462aa1096f715 Mon Sep 17 00:00:00 2001 From: Savio Sena Date: Thu, 19 Jun 2014 23:54:36 +0100 Subject: [PATCH] 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 --- eolian_cxx/colourable.eo | 43 ++++++++++---------- eolian_cxx/colourablesquare.eo | 31 ++++++++------ unsorted/eolian_cxx/colourable.c | 22 ++++------ unsorted/eolian_cxx/colourablesquare.c | 23 ++--------- unsorted/eolian_cxx/eolian_cxx_inherit_01.cc | 1 + unsorted/eolian_cxx/eolian_cxx_simple_01.cc | 1 + 6 files changed, 53 insertions(+), 68 deletions(-) diff --git a/eolian_cxx/colourable.eo b/eolian_cxx/colourable.eo index a708217a..22bd59e4 100644 --- a/eolian_cxx/colourable.eo +++ b/eolian_cxx/colourable.eo @@ -2,6 +2,7 @@ class Colourable (Eo_Base) { /*@ Colourable class. */ legacy_prefix: legacy; + data: Colourable_Data; constructors { constructor { /*@ Default constructor. */ @@ -12,52 +13,52 @@ class Colourable (Eo_Base) @in int r; /*@ The red component. */ @in int g; /*@ The green component. */ @in int b; /*@ The blue component. */ - }; - }; + } + } rgb_24bits_constructor { /*@ RGB Constructor. */ params { @in int rgb; /*@ 24-bit RGB Component. */ - }; - }; - }; + } + } + } methods { - print_colour { /*@ Print the RGB colour. */ }; + print_colour { /*@ Print the RGB colour. */ } colour_mask { /*@ The masked RGB value. */ - return int; params { @in int mask; /*@ The colour mask to be applied to current RGB value. */ - }; - }; - }; + } + return int; /*@ The RGB colour. */ + } + } properties { colour { set { /*@ Sets a 24-bit RGB colour. */ - }; + } get { /*@ Gets the 24-bit RGB colour. */ - }; + } values { int rgb; /*@ The RGB colour value. */ - }; - }; + } + } composite_colour { set { /*@ Sets a composite RGB colour. */ - }; + } get { /*@ Gets the composite RGB colour. */ - }; + } values { int r; /*@ The red component. */ int g; /*@ The green component. */ int b; /*@ The blue component. */ - }; - }; - }; + } + } + } events { colour_changed(int); - }; -}; + } +} diff --git a/eolian_cxx/colourablesquare.eo b/eolian_cxx/colourablesquare.eo index d2541511..0a7c1012 100644 --- a/eolian_cxx/colourablesquare.eo +++ b/eolian_cxx/colourablesquare.eo @@ -1,23 +1,28 @@ class ColourableSquare (Colourable) { - constructors { - size_constructor { params { @in int size; } } - }; legacy_prefix: legacy; + data: ColourableSquare_Data; + constructors { + size_constructor { + params { + @in int size; + } + } + } properties { size { - values { - int size; - }; set { /*@ Sets size. */ - }; + } get { /*@ Gets size. */ - }; - }; - }; + } + values { + int size; /*@ The size. */ + } + } + } methods { - size_print { /*@ Show the square. */ }; - }; -}; + size_print { /*@ Show the square. */ } + } +} diff --git a/unsorted/eolian_cxx/colourable.c b/unsorted/eolian_cxx/colourable.c index 3e289583..9bbcce24 100644 --- a/unsorted/eolian_cxx/colourable.c +++ b/unsorted/eolian_cxx/colourable.c @@ -40,7 +40,7 @@ typedef struct _Colourable_Data Colourable_Data; Colourable_Data *wd = eo_data_scope_get(o, MY_CLASS) void -_colourable_constructor(Eo *obj, Colourable_Data *self) +_colourable_constructor(Eo *obj, Colourable_Data *self EINA_UNUSED) { if(!_colourable_impl_logdomain) { @@ -52,7 +52,7 @@ _colourable_constructor(Eo *obj, Colourable_Data *self) } void -_colourable_destructor(Eo *obj, Colourable_Data *self) +_colourable_destructor(Eo *obj, Colourable_Data *self EINA_UNUSED) { if(_colourable_impl_logdomain) { @@ -98,13 +98,13 @@ _colourable_rgb_24bits_constructor(Eo *obj, Colourable_Data *self, int rgb) } void -_colourable_print_colour(Eo *obj, Colourable_Data *self) +_colourable_print_colour(Eo *obj EINA_UNUSED, Colourable_Data *self EINA_UNUSED) { DBG("_colourable_print_colour() ==> 0x%2.x 0x%2.x 0x%2.x\n", self->r, self->g, self->b); } int -_colourable_colour_mask(Eo *obj, Colourable_Data *self, int mask) +_colourable_colour_mask(Eo *obj EINA_UNUSED, Colourable_Data *self, int mask) { int masked_rgb = (((self->r << 16)& 0x00ff0000) | @@ -115,7 +115,7 @@ _colourable_colour_mask(Eo *obj, Colourable_Data *self, int mask) } void -_colourable_composite_colour_get(Eo *obj, Colourable_Data *self, int* r, int* g, int* b) +_colourable_composite_colour_get(Eo *obj EINA_UNUSED, Colourable_Data *self, int* r, int* g, int* b) { *r = self->r; *g = self->g; @@ -125,7 +125,7 @@ _colourable_composite_colour_get(Eo *obj, Colourable_Data *self, int* r, int* g, } void -_colourable_composite_colour_set(Eo *obj, Colourable_Data *self, int r, int g, int b) +_colourable_composite_colour_set(Eo *obj EINA_UNUSED, Colourable_Data *self, int r, int g, int b) { self->r = r; self->g = g; @@ -136,7 +136,7 @@ _colourable_composite_colour_set(Eo *obj, Colourable_Data *self, int r, int g, i } int -_colourable_colour_get(Eo *obj, Colourable_Data *self) +_colourable_colour_get(Eo *obj EINA_UNUSED, Colourable_Data *self) { int rgb = ((self->r << 16)& 0x00ff0000) | @@ -147,7 +147,7 @@ _colourable_colour_get(Eo *obj, Colourable_Data *self) } void -_colourable_colour_set(Eo *obj, Colourable_Data *self, int rgb) +_colourable_colour_set(Eo *obj EINA_UNUSED, Colourable_Data *self, int rgb) { self->r = (rgb & 0x00ff0000) >> 16; self->g = (rgb & 0x0000ff00) >> 8; @@ -156,10 +156,4 @@ _colourable_colour_set(Eo *obj, Colourable_Data *self, int rgb) return; } -static void -_user_colourable_class_constructor(Eo_Class *klass) -{ - DBG("_colourable_class_constructor()\n"); -} - #include "colourable.eo.c" diff --git a/unsorted/eolian_cxx/colourablesquare.c b/unsorted/eolian_cxx/colourablesquare.c index 1eb190cf..9ed046a4 100644 --- a/unsorted/eolian_cxx/colourablesquare.c +++ b/unsorted/eolian_cxx/colourablesquare.c @@ -52,40 +52,23 @@ _colourablesquare_size_constructor(Eo *obj, ColourableSquare_Data *self, int siz eo_do_super(obj, MY_CLASS, eo_constructor()); } -static void -_colourablesquare_destructor(Eo *obj, ColourableSquare_Data *self) -{ - eo_do_super(obj, MY_CLASS, eo_destructor()); - if(_colourablesquare_impl_logdomain) - { - eina_log_domain_unregister(_colourablesquare_impl_logdomain); - _colourablesquare_impl_logdomain = 0; - } -} - static int -_colourablesquare_size_get(Eo *obj, ColourableSquare_Data *self) +_colourablesquare_size_get(Eo *obj EINA_UNUSED, ColourableSquare_Data *self) { DBG("_colourablesquare_size_get() => %d\n", self->size); return self->size; } static void -_colourablesquare_size_print(Eo *obj, ColourableSquare_Data *self) +_colourablesquare_size_print(Eo *obj EINA_UNUSED, ColourableSquare_Data *self) { DBG("_colourablesquare_size_print() ==> %d\n", self->size); } static void -_colourablesquare_size_set(Eo *obj, ColourableSquare_Data *self, int size) +_colourablesquare_size_set(Eo *obj EINA_UNUSED, ColourableSquare_Data *self EINA_UNUSED, int size) { DBG("_colourablesquare_size_set(%d)\n", size); } -static void -_user_colourablesquare_class_constructor(Eo_Class *klass) -{ - DBG("_colourablesquare_class_constructor()\n"); -} - #include "colourablesquare.eo.c" diff --git a/unsorted/eolian_cxx/eolian_cxx_inherit_01.cc b/unsorted/eolian_cxx/eolian_cxx_inherit_01.cc index 798b3a8c..763e0c33 100644 --- a/unsorted/eolian_cxx/eolian_cxx_inherit_01.cc +++ b/unsorted/eolian_cxx/eolian_cxx_inherit_01.cc @@ -1,5 +1,6 @@ #include +#include #ifdef HAVE_CONFIG_H # include diff --git a/unsorted/eolian_cxx/eolian_cxx_simple_01.cc b/unsorted/eolian_cxx/eolian_cxx_simple_01.cc index 363073a2..0a35f931 100644 --- a/unsorted/eolian_cxx/eolian_cxx_simple_01.cc +++ b/unsorted/eolian_cxx/eolian_cxx_simple_01.cc @@ -1,6 +1,7 @@ // EINA_LOG_LEVELS=colourable:4,colourablesquare:4 ./eolian_cxx_simple_01 #include +#include #ifdef HAVE_CONFIG_H # include