From bc11fb3ab5cd14f39d0981fa135807d560001fc1 Mon Sep 17 00:00:00 2001 From: caro Date: Thu, 1 Oct 2009 07:44:39 +0000 Subject: [PATCH] fix eina logging in software_ddraw git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@42829 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/modules/engines/software_ddraw/evas_engine.c | 16 +++++++++++++++ src/modules/engines/software_ddraw/evas_engine.h | 26 ++++++++++++++++++++++++ src/modules/engines/software_ddraw/evas_outbuf.c | 20 +++++++++--------- 3 files changed, 52 insertions(+), 10 deletions(-) diff --git a/src/modules/engines/software_ddraw/evas_engine.c b/src/modules/engines/software_ddraw/evas_engine.c index c9340c9..83fdbb0 100644 --- a/src/modules/engines/software_ddraw/evas_engine.c +++ b/src/modules/engines/software_ddraw/evas_engine.c @@ -19,6 +19,10 @@ struct _Render_Engine }; +/* log domain variable */ +int _evas_log_dom_module = -1; + + static void * _output_setup(int width, int height, @@ -92,6 +96,15 @@ eng_info(Evas *e) info = calloc(1, sizeof(Evas_Engine_Info_Software_DDraw)); if (!info) return NULL; info->magic.magic = rand(); + + _evas_log_dom_module = eina_log_domain_register("Software_DDraw", EVAS_DEFAULT_LOG_COLOR); + if(_evas_log_dom_module < 0) + { + EINA_LOG_ERR("Can not create a module log domain."); + free(info); + return NULL; + } + return info; e = NULL; } @@ -101,6 +114,9 @@ eng_info_free(Evas *e, void *info) { Evas_Engine_Info_Software_DDraw *in; + eina_log_domain_unregister(_evas_log_dom_module); + _evas_log_dom_module = -1; + in = (Evas_Engine_Info_Software_DDraw *)info; free(in); } diff --git a/src/modules/engines/software_ddraw/evas_engine.h b/src/modules/engines/software_ddraw/evas_engine.h index 52cc96a..5e082c3 100644 --- a/src/modules/engines/software_ddraw/evas_engine.h +++ b/src/modules/engines/software_ddraw/evas_engine.h @@ -85,6 +85,32 @@ struct _DD_Output_Buffer int psize; }; +extern int _evas_log_dom_module; + +#ifdef EVAS_DEFAULT_LOG_COLOR +# undef EVAS_DEFAULT_LOG_COLOR +#endif +#define EVAS_DEFAULT_LOG_COLOR "\033[36m" +#ifdef ERR +# undef ERR +#endif +#define ERR(...) EINA_LOG_DOM_ERR(_evas_log_dom_module, __VA_ARGS__) +#ifdef DBG +# undef DBG +#endif +#define DBG(...) EINA_LOG_DOM_DBG(_evas_log_dom_module, __VA_ARGS__) +#ifdef INF +# undef INF +#endif +#define INF(...) EINA_LOG_DOM_INFO(_evas_log_dom_module, __VA_ARGS__) +#ifdef WRN +# undef WRN +#endif +#define WRN(...) EINA_LOG_DOM_WARN(_evas_log_dom_module, __VA_ARGS__) +#ifdef CRT +# undef CRT +#endif +#define CRT(...) EINA_LOG_DOM_CRIT(_evas_log_dom_module, __VA_ARGS__) /* evas_outbuf.c */ diff --git a/src/modules/engines/software_ddraw/evas_outbuf.c b/src/modules/engines/software_ddraw/evas_outbuf.c index 9e01670..ce45907 100644 --- a/src/modules/engines/software_ddraw/evas_outbuf.c +++ b/src/modules/engines/software_ddraw/evas_outbuf.c @@ -160,16 +160,16 @@ evas_software_ddraw_outbuf_setup(int width, if (!conv_func) { - ERROR("DDraw engine Error" - " {" - " At depth %i:" - " RGB format mask: %08x, %08x, %08x" - " Not supported by and compiled in converters!" - " }", - buf->priv.dd.depth, - buf->priv.mask.r, - buf->priv.mask.g, - buf->priv.mask.b); + ERR("DDraw engine Error" + " {" + " At depth %i:" + " RGB format mask: %08x, %08x, %08x" + " Not supported by and compiled in converters!" + " }", + buf->priv.dd.depth, + buf->priv.mask.r, + buf->priv.mask.g, + buf->priv.mask.b); } } } -- 2.7.4