From: Stefan Schmidt Date: Tue, 10 May 2016 09:10:24 +0000 (+0200) Subject: examples: eolian_cxx: fix some problems after changing the colourable namespace X-Git-Tag: upstream/1.20.0~6415 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=26f309112e7dd3d41ce12b04d7b990304673ec97;p=platform%2Fupstream%2Fefl.git examples: eolian_cxx: fix some problems after changing the colourable namespace Fix commit 3e8db298f70932ce7b2f5296d44b262a615ea87c the namepsace changed but only a few files have been fixed for this. Many files did still not compile with make examples. I fixed some more but stopped at the cxx files with the hope that the original author would actually do this. --- diff --git a/src/examples/eolian_cxx/colourable.c b/src/examples/eolian_cxx/colourable.c index 0c132c4..dd2cc11 100644 --- a/src/examples/eolian_cxx/colourable.c +++ b/src/examples/eolian_cxx/colourable.c @@ -6,16 +6,16 @@ #include "Eo.h" #include "Eina.h" -#include "colourable.eo.h" +#include "ns_colourable.eo.h" -#define MY_CLASS COLOURABLE_CLASS +#define MY_CLASS NS_COLOURABLE_CLASS -static int _colourable_impl_logdomain; +static int _ns_colourable_impl_logdomain; #ifdef DBG #undef DBG #endif -#define DBG(...) EINA_LOG_DOM_DBG(_colourable_impl_logdomain, __VA_ARGS__) +#define DBG(...) EINA_LOG_DOM_DBG(_ns_colourable_impl_logdomain, __VA_ARGS__) struct _Colourable_Data { @@ -27,102 +27,102 @@ struct _Colourable_Data typedef struct _Colourable_Data Colourable_Data; Eo * -_colourable_eo_base_constructor(Eo *obj, Colourable_Data *self EINA_UNUSED) +_ns_colourable_eo_base_constructor(Eo *obj, Colourable_Data *self EINA_UNUSED) { - if(!_colourable_impl_logdomain) + if(!_ns_colourable_impl_logdomain) { - _colourable_impl_logdomain + _ns_colourable_impl_logdomain = eina_log_domain_register("colourable", EINA_COLOR_BLUE); } - DBG("_colourable_constructor(%p, %p)\n", obj, MY_CLASS); + DBG("_ns_colourable_constructor(%p, %p)\n", obj, MY_CLASS); return eo_constructor(eo_super(obj, MY_CLASS)); } void -_colourable_eo_base_destructor(Eo *obj, Colourable_Data *self EINA_UNUSED) +_ns_colourable_eo_base_destructor(Eo *obj, Colourable_Data *self EINA_UNUSED) { - if(_colourable_impl_logdomain) + if(_ns_colourable_impl_logdomain) { - eina_log_domain_unregister(_colourable_impl_logdomain); - _colourable_impl_logdomain = 0; + eina_log_domain_unregister(_ns_colourable_impl_logdomain); + _ns_colourable_impl_logdomain = 0; } - DBG("_colourable_destructor()\n"); + DBG("_ns_colourable_destructor()\n"); eo_destructor(eo_super(obj, MY_CLASS)); } void -_colourable_rgb_24bits_constructor(Eo *obj, Colourable_Data *self, int rgb) +_ns_colourable_rgb_24bits_constructor(Eo *obj, Colourable_Data *self, int rgb) { - if(!_colourable_impl_logdomain) + if(!_ns_colourable_impl_logdomain) { - _colourable_impl_logdomain + _ns_colourable_impl_logdomain = eina_log_domain_register("colourable", EINA_COLOR_BLUE); } self->r = (rgb & 0x00ff0000) >> 16; self->g = (rgb & 0x0000ff00) >> 8; self->b = rgb & 0x000000ff; - DBG("_colourable_rgb_24bits_constructor(0x%.6x)\n", (int)rgb); + DBG("_ns_colourable_rgb_24bits_constructor(0x%.6x)\n", (int)rgb); eo_constructor(eo_super(obj, MY_CLASS)); } void -_colourable_print_colour(Eo *obj EINA_UNUSED, Colourable_Data *self EINA_UNUSED) +_ns_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); + DBG("_ns_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 EINA_UNUSED, Colourable_Data *self, int mask) +_ns_colourable_colour_mask(Eo *obj EINA_UNUSED, Colourable_Data *self, int mask) { int masked_rgb = (((self->r << 16)& 0x00ff0000) | ((self->g << 8) & 0x0000ff00) | (self->b & 0x000000ff)) & mask; - DBG("_colourable_colour_mask() ==> 0x%2.x\n", (unsigned int)masked_rgb); + DBG("_ns_colourable_colour_mask() ==> 0x%2.x\n", (unsigned int)masked_rgb); return masked_rgb; } void -_colourable_composite_colour_get(Eo *obj EINA_UNUSED, Colourable_Data *self, int* r, int* g, int* b) +_ns_colourable_composite_colour_get(Eo *obj EINA_UNUSED, Colourable_Data *self, int* r, int* g, int* b) { *r = self->r; *g = self->g; *b = self->b; - DBG("_colourable_composite_colour_get() ==> 0x%2.x 0x%2.x 0x%2.x\n", *r, *g, *b); + DBG("_ns_colourable_composite_colour_get() ==> 0x%2.x 0x%2.x 0x%2.x\n", *r, *g, *b); return; } void -_colourable_composite_colour_set(Eo *obj EINA_UNUSED, Colourable_Data *self, int r, int g, int b) +_ns_colourable_composite_colour_set(Eo *obj EINA_UNUSED, Colourable_Data *self, int r, int g, int b) { self->r = r; self->g = g; self->b = b; - DBG("_colourable_composite_colour_set(0x%2.x, 0x%2.x, 0x%2.x)\n", + DBG("_ns_colourable_composite_colour_set(0x%2.x, 0x%2.x, 0x%2.x)\n", (int)self->r, (int)self->g, (int)self->b); return; } int -_colourable_colour_get(Eo *obj EINA_UNUSED, Colourable_Data *self) +_ns_colourable_colour_get(Eo *obj EINA_UNUSED, Colourable_Data *self) { int rgb = ((self->r << 16)& 0x00ff0000) | ((self->g << 8) & 0x0000ff00) | (self->b & 0x000000ff); - DBG("_colourable_colour_get() ==> 0x%.6x\n", (unsigned int)rgb); + DBG("_ns_colourable_colour_get() ==> 0x%.6x\n", (unsigned int)rgb); return rgb; } void -_colourable_colour_set(Eo *obj EINA_UNUSED, Colourable_Data *self, int rgb) +_ns_colourable_colour_set(Eo *obj EINA_UNUSED, Colourable_Data *self, int rgb) { self->r = (rgb & 0x00ff0000) >> 16; self->g = (rgb & 0x0000ff00) >> 8; self->b = rgb & 0x000000ff; - DBG("_colourable_colour_set(0x%.6x)\n", (unsigned int)rgb); + DBG("_ns_colourable_colour_set(0x%.6x)\n", (unsigned int)rgb); return; } -#include "colourable.eo.c" +#include "ns_colourable.eo.c" diff --git a/src/examples/eolian_cxx/colourable_cxx.cc b/src/examples/eolian_cxx/colourable_cxx.cc index f1f6bec..513e3dc 100644 --- a/src/examples/eolian_cxx/colourable_cxx.cc +++ b/src/examples/eolian_cxx/colourable_cxx.cc @@ -12,10 +12,10 @@ extern "C" { #include "colourable_stub.h" -#include "colourable.eo.h" +#include "ns_colourable.eo.h" } -#define MY_CLASS COLOURABLE_CLASS +#define MY_CLASS NS_COLOURABLE_CLASS static efl::eina::log_domain domain("colourable"); diff --git a/src/examples/eolian_cxx/colourable_stub.c b/src/examples/eolian_cxx/colourable_stub.c index a427cc5..8adb4b1 100644 --- a/src/examples/eolian_cxx/colourable_stub.c +++ b/src/examples/eolian_cxx/colourable_stub.c @@ -8,5 +8,5 @@ #include "Eina.h" #include "colourable_stub.h" -#include "colourable.eo.h" -#include "colourable.eo.c" +#include "ns_colourable.eo.h" +#include "ns_colourable.eo.c" diff --git a/src/examples/eolian_cxx/colourablesquare.c b/src/examples/eolian_cxx/colourablesquare.c index 0804d36..f367c59 100644 --- a/src/examples/eolian_cxx/colourablesquare.c +++ b/src/examples/eolian_cxx/colourablesquare.c @@ -6,17 +6,17 @@ #include "Eo.h" -#include "colourable.eo.h" -#include "colourablesquare.eo.h" +#include "ns_colourable.eo.h" +#include "ns_colourablesquare.eo.h" -#define MY_CLASS COLOURABLESQUARE_CLASS +#define MY_CLASS NS_COLOURABLESQUARE_CLASS -static int _colourablesquare_impl_logdomain; +static int _ns_colourablesquare_impl_logdomain; #ifdef DBG #undef DBG #endif -#define DBG(...) EINA_LOG_DOM_DBG(_colourablesquare_impl_logdomain, __VA_ARGS__) +#define DBG(...) EINA_LOG_DOM_DBG(_ns_colourablesquare_impl_logdomain, __VA_ARGS__) struct _ColourableSquare_Data { @@ -25,36 +25,36 @@ struct _ColourableSquare_Data typedef struct _ColourableSquare_Data ColourableSquare_Data; static void -_colourablesquare_size_constructor(Eo *obj, ColourableSquare_Data *self, int size) +_ns_colourablesquare_size_constructor(Eo *obj, ColourableSquare_Data *self, int size) { - if(!_colourablesquare_impl_logdomain) + if(!_ns_colourablesquare_impl_logdomain) { - _colourablesquare_impl_logdomain + _ns_colourablesquare_impl_logdomain = eina_log_domain_register ("colourablesquare", EINA_COLOR_LIGHTBLUE); } self->size = size; - DBG("_colourablesquare_constructor(%d)\n", size); + DBG("_ns_colourablesquare_constructor(%d)\n", size); eo_constructor(eo_super(obj, MY_CLASS)); } static int -_colourablesquare_size_get(Eo *obj EINA_UNUSED, ColourableSquare_Data *self) +_ns_colourablesquare_size_get(Eo *obj EINA_UNUSED, ColourableSquare_Data *self) { - DBG("_colourablesquare_size_get() => %d\n", self->size); + DBG("_ns_colourablesquare_size_get() => %d\n", self->size); return self->size; } static void -_colourablesquare_size_print(Eo *obj EINA_UNUSED, ColourableSquare_Data *self) +_ns_colourablesquare_size_print(Eo *obj EINA_UNUSED, ColourableSquare_Data *self) { - DBG("_colourablesquare_size_print() ==> %d\n", self->size); + DBG("_ns_colourablesquare_size_print() ==> %d\n", self->size); } static void -_colourablesquare_size_set(Eo *obj EINA_UNUSED, ColourableSquare_Data *self EINA_UNUSED, int size) +_ns_colourablesquare_size_set(Eo *obj EINA_UNUSED, ColourableSquare_Data *self EINA_UNUSED, int size) { - DBG("_colourablesquare_size_set(%d)\n", size); + DBG("_ns_colourablesquare_size_set(%d)\n", size); } -#include "colourablesquare.eo.c" +#include "ns_colourablesquare.eo.c" diff --git a/src/examples/eolian_cxx/colourablesquare_cxx.cc b/src/examples/eolian_cxx/colourablesquare_cxx.cc index 6908f73..b4c92b8 100644 --- a/src/examples/eolian_cxx/colourablesquare_cxx.cc +++ b/src/examples/eolian_cxx/colourablesquare_cxx.cc @@ -12,11 +12,11 @@ extern "C" { #include "colourablesquare_stub.h" -#include "colourable.eo.h" -#include "colourablesquare.eo.h" +#include "ns_colourable.eo.h" +#include "ns_colourablesquare.eo.h" } -#define MY_CLASS COLOURABLESQUARE_CLASS +#define MY_CLASS NS_COLOURABLESQUARE_CLASS static efl::eina::log_domain domain("colourablesquare"); diff --git a/src/examples/eolian_cxx/colourablesquare_stub.c b/src/examples/eolian_cxx/colourablesquare_stub.c index 276130c..b352b22 100644 --- a/src/examples/eolian_cxx/colourablesquare_stub.c +++ b/src/examples/eolian_cxx/colourablesquare_stub.c @@ -7,6 +7,6 @@ #include "Eo.h" #include "colourablesquare_stub.h" -#include "colourable.eo.h" -#include "colourablesquare.eo.h" -#include "colourablesquare.eo.c" +#include "ns_colourable.eo.h" +#include "ns_colourablesquare.eo.h" +#include "ns_colourablesquare.eo.c"