* evas: Cleanup move to eina log.
authorcedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 22 Oct 2009 15:22:22 +0000 (15:22 +0000)
committercedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 22 Oct 2009 15:22:22 +0000 (15:22 +0000)
Patch from Mathieu Taillefumier.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@43200 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

82 files changed:
src/bin/evas_cserve_main.c
src/lib/canvas/evas_events.c
src/lib/canvas/evas_font_dir.c
src/lib/canvas/evas_main.c
src/lib/canvas/evas_object_box.c
src/lib/canvas/evas_object_image.c
src/lib/canvas/evas_object_smart.c
src/lib/canvas/evas_object_table.c
src/lib/canvas/evas_render.c
src/lib/canvas/evas_smart.c
src/lib/canvas/evas_stack.c
src/lib/cserve/evas_cs_client.c
src/lib/cserve/evas_cs_server.c
src/lib/engines/common/evas_convert_main.c
src/lib/engines/common/evas_convert_rgb_16.c
src/lib/engines/common/evas_cpu.c
src/lib/engines/common/evas_font_query.c
src/lib/engines/common/evas_image_main.c
src/lib/engines/common/evas_image_scalecache.c
src/lib/engines/common/evas_pipe.c
src/lib/engines/common/evas_tiler.c
src/lib/engines/common_16/evas_soft16_image_scaled_sampled.c
src/lib/engines/common_16/evas_soft16_image_unscaled.c
src/lib/engines/common_16/evas_soft16_main.c
src/lib/engines/common_16/evas_soft16_rectangle.c
src/lib/include/evas_common.h
src/lib/main.c
src/modules/engines/buffer/evas_engine.c
src/modules/engines/buffer/evas_engine.h
src/modules/engines/cairo_x11/evas_engine.c
src/modules/engines/cairo_x11/evas_engine.h
src/modules/engines/direct3d/evas_direct3d_device.cpp
src/modules/engines/direct3d/evas_direct3d_image_cache.cpp
src/modules/engines/direct3d/evas_direct3d_main.cpp
src/modules/engines/direct3d/evas_direct3d_object_font.cpp
src/modules/engines/direct3d/evas_direct3d_object_image.cpp
src/modules/engines/direct3d/evas_direct3d_object_line.cpp
src/modules/engines/direct3d/evas_direct3d_object_rect.cpp
src/modules/engines/direct3d/evas_direct3d_shader_pack.cpp
src/modules/engines/direct3d/evas_direct3d_vertex_buffer_cache.cpp
src/modules/engines/direct3d/evas_engine.c
src/modules/engines/direct3d/evas_engine.h
src/modules/engines/directfb/evas_engine.c
src/modules/engines/directfb/evas_engine.h
src/modules/engines/fb/evas_engine.c
src/modules/engines/fb/evas_engine.h
src/modules/engines/fb/evas_fb_main.c
src/modules/engines/fb/evas_outbuf.c
src/modules/engines/gl_glew/evas_engine.c
src/modules/engines/gl_glew/evas_engine.h
src/modules/engines/gl_glew/evas_glew_main.c
src/modules/engines/gl_x11/evas_engine.c
src/modules/engines/gl_x11/evas_engine.h
src/modules/engines/quartz/evas_engine.c
src/modules/engines/quartz/evas_engine.h
src/modules/engines/software_16/evas_engine.c
src/modules/engines/software_16_ddraw/evas_engine.c
src/modules/engines/software_16_ddraw/evas_engine.h
src/modules/engines/software_16_sdl/evas_engine.c
src/modules/engines/software_16_sdl/evas_engine.h
src/modules/engines/software_16_wince/evas_engine.c
src/modules/engines/software_16_wince/evas_engine.h
src/modules/engines/software_16_wince/evas_wince_fb_buffer.c
src/modules/engines/software_16_wince/evas_wince_gapi_buffer.c
src/modules/engines/software_16_wince/evas_wince_gdi_buffer.c
src/modules/engines/software_16_x11/evas_engine.c
src/modules/engines/software_16_x11/evas_engine.h
src/modules/engines/software_ddraw/evas_engine.c
src/modules/engines/software_gdi/evas_engine.c
src/modules/engines/software_gdi/evas_engine.h
src/modules/engines/software_gdi/evas_gdi_main.c
src/modules/engines/software_gdi/evas_outbuf.c
src/modules/engines/software_generic/evas_engine.c
src/modules/engines/software_qtopia/evas_engine.c
src/modules/engines/software_qtopia/evas_engine.h
src/modules/engines/software_sdl/evas_engine.c
src/modules/engines/software_sdl/evas_engine.h
src/modules/engines/software_x11/evas_engine.c
src/modules/engines/software_x11/evas_engine.h
src/modules/engines/software_x11/evas_xcb_outbuf.c
src/modules/engines/xrender_x11/evas_engine.c
src/modules/engines/xrender_x11/evas_engine.h

index 5f6659b..15d2739 100644 (file)
@@ -16,7 +16,7 @@
 #include "Evas.h"
 #include "evas_cs.h"
 
-#define D(...) EINA_LOG_DBG(__VA_ARGS__)
+#define D(...) EINA_LOG_DOM_DBG(_evas_cserve_bin_log_dom, __VA_ARGS__)
 #ifdef ERR
 #undef ERR
 #endif
@@ -33,7 +33,7 @@
 #ifdef CSERVE_BIN_DEFAULT_COLOR
 #undef CSERVE_BIN_DEFAULT_COLOR
 #endif
-#define CSERVE_BIN_DEFAULT_COLOR "\033[36m"
+#define CSERVE_BIN_DEFAULT_COLOR EINA_COLOR_BLUE
 // fixme:'s
 // 
 // preload - make it work (both)
index 64d2a1d..b7e985c 100644 (file)
@@ -398,13 +398,13 @@ evas_event_feed_mouse_up(Evas *e, int b, Evas_Button_Flags flags, unsigned int t
 
    if (e->pointer.mouse_grabbed < 0)
      {
-        ERROR("BUG? e->pointer.mouse_grabbed (=%d) < 0!",
+        ERR("BUG? e->pointer.mouse_grabbed (=%d) < 0!",
              e->pointer.mouse_grabbed);
      }
 
    if ((e->pointer.button == 0) && (e->pointer.mouse_grabbed != 0))
      {
-        INFO("restore to 0 grabs (from %i)", e->pointer.mouse_grabbed);
+        INF("restore to 0 grabs (from %i)", e->pointer.mouse_grabbed);
        e->pointer.mouse_grabbed = 0;
      }
    _evas_unwalk(e);
index 2d2fe47..43d6d59 100644 (file)
@@ -394,7 +394,7 @@ evas_font_load(Evas *evas, const char *name, const char *source, int size)
        set = FcFontSort(NULL, p_nm, FcTrue, NULL, &res);
        if (!set)
          {
-            ERROR("No fontconfig font matches '%s'. It was the last resource, no font found!", name);
+            ERR("No fontconfig font matches '%s'. It was the last resource, no font found!", name);
             goto fc_end;
          }
 
index 07906d7..0b90ce5 100644 (file)
@@ -27,7 +27,7 @@ evas_init(void)
    _evas_log_dom_global = eina_log_domain_register("evas_main",EVAS_DEFAULT_LOG_COLOR);
    if (_evas_log_dom_global < 0)
      {
-       fprintf(stderr,"Error: Evas could not create a default log domain\n");
+       EINA_LOG_ERR("Evas could not create a default log domain\n");
        goto shutdown_eina;
      }
 
@@ -489,7 +489,7 @@ evas_output_viewport_set(Evas *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas
    if (h <= 0) return;
    if ((x != 0) || (y != 0))
      {
-       ERROR("EVAS: compat error. viewport x,y != 0,0 not supported");
+       ERR("Compat error. viewport x,y != 0,0 not supported");
        x = 0;
        y = 0;
      }
index 8bf66a9..53a5971 100644 (file)
@@ -32,7 +32,7 @@ struct _Evas_Object_Box_Accessor
   EVAS_OBJECT_BOX_DATA_GET(o, ptr);                                    \
   if (!ptr)                                                            \
     {                                                                  \
-       CRITICAL("no widget data for object %p (%s)",   \
+       CRIT("no widget data for object %p (%s)",       \
                o, evas_object_type_get(o));                            \
        fflush(stderr);                                                 \
        abort();                                                                \
@@ -43,7 +43,7 @@ struct _Evas_Object_Box_Accessor
   EVAS_OBJECT_BOX_DATA_GET(o, ptr);                                    \
   if (!ptr)                                                            \
     {                                                                  \
-       CRITICAL("no widget data for object %p (%s)",   \
+       CRIT("no widget data for object %p (%s)",       \
               o, evas_object_type_get(o));                             \
        fflush(stderr);                                                 \
        abort();                                                                \
@@ -374,15 +374,15 @@ _evas_object_box_remove_at_default(Evas_Object *o, Evas_Object_Box_Data *priv, u
 
    if ((!api) || (!api->option_free))
      {
-       fputs("WARNING: api->option_free not set (may cause memory leaks,"
-             " segfaults)\n", stderr);
+       WRN("api->option_free not set (may cause memory leaks,"
+             " segfaults)\n");
         return NULL;
      }
 
    node = eina_list_nth_list(priv->children, pos);
    if (!node)
      {
-       ERROR("ERROR: no item to be removed at position %d\n", pos);
+       ERR("No item to be removed at position %d\n", pos);
        return NULL;
      }
 
@@ -408,7 +408,7 @@ _evas_object_box_smart_add(Evas_Object *o)
        priv = (Evas_Object_Box_Data *)calloc(1, sizeof(*priv));
        if (!priv)
          {
-            fputs("ERROR: could not allocate object private data.\n", stderr);
+            ERR("Could not allocate object private data.\n");
             return;
          }
 
@@ -441,8 +441,8 @@ _evas_object_box_smart_del(Evas_Object *o)
    api = priv->api;
    if ((!api) || (!api->option_free))
      {
-       fputs("WARNING: api->option_free not set (may cause memory leaks,"
-             " segfaults)\n", stderr);
+       WRN("api->option_free not set (may cause memory leaks,"
+             " segfaults)\n");
         return;
      }
 
@@ -478,7 +478,7 @@ _evas_object_box_smart_calculate(Evas_Object *o)
    if (priv->layout.cb)
      priv->layout.cb(o, priv, priv->layout.data);
    else
-     ERROR("No layout function set for %p box.", o);
+     ERR("No layout function set for %p box.", o);
 }
 
 static Evas_Smart *
index b55f2b6..e94fb6c 100644 (file)
@@ -2533,7 +2533,7 @@ evas_object_image_render_pre(Evas_Object *obj)
 
    if ((o->cur.fill.w < 1) || (o->cur.fill.h < 1))
      {
-       ERROR("evas image: %p has invalid fill size: %dx%d. Ignored",
+       ERR("%p has invalid fill size: %dx%d. Ignored",
             obj, o->cur.fill.w, o->cur.fill.h);
        return;
      }
index 07fdd46..cb9b622 100644 (file)
@@ -174,26 +174,26 @@ evas_object_smart_member_add(Evas_Object *obj, Evas_Object *smart_obj)
 
    if (obj->delete_me)
      {
-        ERROR("Adding deleted object %p to smart obj %p", obj, smart_obj);
+        CRIT("Adding deleted object %p to smart obj %p", obj, smart_obj);
        abort();
        return;
      }
    if (smart_obj->delete_me)
      {
-       ERROR("Adding object %p to deleted smart obj %p", obj, smart_obj);
+       CRIT("Adding object %p to deleted smart obj %p", obj, smart_obj);
        abort();
        return;
      }
    if (!smart_obj->layer)
      {
-       ERROR("No evas surface associated with smart object (%p)", smart_obj);
+       CRIT("No evas surface associated with smart object (%p)", smart_obj);
        abort();
        return;
      }
    if (obj->layer && smart_obj->layer
        && obj->layer->evas != smart_obj->layer->evas)
      {
-       ERROR("EVAS ERROR: Adding object %p from Evas (%p) from another Evas (%p)", obj, obj->layer->evas, smart_obj->layer->evas);
+       CRIT("Adding object %p from Evas (%p) from another Evas (%p)", obj, obj->layer->evas, smart_obj->layer->evas);
        abort();
        return;
      }
index 483b6ba..44a8ee7 100644 (file)
@@ -93,8 +93,8 @@ struct _Evas_Object_Table_Accessor
   EVAS_OBJECT_TABLE_DATA_GET(o, ptr);                                  \
   if (!ptr)                                                            \
     {                                                                  \
-      CRITICAL("CRITICAL: no widget data for object %p (%s)",          \
-              o, evas_object_type_get(o));                             \
+      CRIT("no widget data for object %p (%s)",                \
+          o, evas_object_type_get(o));                                 \
        abort();                                                                \
        return;                                                         \
 }
@@ -103,7 +103,7 @@ struct _Evas_Object_Table_Accessor
   EVAS_OBJECT_TABLE_DATA_GET(o, ptr);                                  \
   if (!ptr)                                                            \
     {                                                                  \
-       CRITICAL("No widget data for object %p (%s)",                   \
+       CRIT("No widget data for object %p (%s)",                       \
               o, evas_object_type_get(o));                             \
        abort();                                                                \
        return val;                                                     \
@@ -170,7 +170,7 @@ _evas_object_table_cache_alloc(int cols, int rows)
    cache = malloc(size);
    if (!cache)
      {
-       ERROR("Could not allocate table cache %dx%d (%d bytes): %s",
+       ERR("Could not allocate table cache %dx%d (%d bytes): %s",
              cols, rows, size, strerror(errno));
        return NULL;
      }
@@ -322,7 +322,7 @@ _evas_object_table_calculate_cell(const Evas_Object_Table_Option *opt, Evas_Coor
 /*      } */
 /*    else if (min < 1) */
 /*      { */
-/*     WARN("Child %p [%s, %s] has no minimum width " */
+/*     WRN("Child %p [%s, %s] has no minimum width " */
 /*             "and no %s expand (weight is not > 0.0). " */
 /*             "Assuming weight > 0.0\n", */
 /*             child, evas_object_type_get(child), evas_object_name_get(child), */
@@ -429,13 +429,13 @@ _evas_object_table_calculate_hints_homogeneous(Evas_Object *o, Evas_Object_Table
      {
        if (o_minw < 1)
          {
-            ERROR("homogeneous table based on item size but no "
+            ERR("homogeneous table based on item size but no "
                   "horizontal mininum size specified! Using expand.");
             expand_h = 1;
          }
        if (o_minh < 1)
          {
-            ERROR("homogeneous table based on item size but no "
+            ERR("homogeneous table based on item size but no "
                   "vertical mininum size specified! Using expand.");
             expand_v = 1;
          }
@@ -746,7 +746,7 @@ _evas_object_table_calculate_layout_regular(Evas_Object *o, Evas_Object_Table_Da
        cols = malloc(size);
        if (!cols)
          {
-            ERROR("Could not allocate temp columns (%d bytes): %s",
+            ERR("Could not allocate temp columns (%d bytes): %s",
                   size, strerror(errno));
             return;
          }
@@ -769,7 +769,7 @@ _evas_object_table_calculate_layout_regular(Evas_Object *o, Evas_Object_Table_Da
        rows = malloc(size);
        if (!rows)
          {
-            ERROR("could not allocate temp rows (%d bytes): %s",
+            ERR("could not allocate temp rows (%d bytes): %s",
                     size, strerror(errno));
             goto end;
          }
@@ -826,7 +826,7 @@ _evas_object_table_smart_add(Evas_Object *o)
        priv = calloc(1, sizeof(*priv));
        if (!priv)
          {
-            ERROR("could not allocate object private data.");
+            ERR("could not allocate object private data.");
             return;
          }
        evas_object_smart_data_set(o, priv);
@@ -884,7 +884,7 @@ _evas_object_table_smart_calculate(Evas_Object *o)
 
    if ((priv->size.cols < 1) || (priv->size.rows < 1))
      {
-       DEBUG("Nothing to do: cols=%d, rows=%d",
+       DBG("Nothing to do: cols=%d, rows=%d",
              priv->size.cols, priv->size.rows);
        return;
      }
@@ -1118,26 +1118,26 @@ evas_object_table_pack(Evas_Object *o, Evas_Object *child, unsigned short col, u
 
    if (rowspan < 1)
      {
-       ERROR("rowspan < 1");
+       ERR("rowspan < 1");
        return EINA_FALSE;
      }
    if (colspan < 1)
      {
-       ERROR("colspan < 1");
+       ERR("colspan < 1");
        return EINA_FALSE;
      }
 
    opt = _evas_object_table_option_get(child);
    if (opt)
      {
-       ERROR("cannot add object that is already part of a table!");
+       ERR("cannot add object that is already part of a table!");
        return EINA_FALSE;
      }
 
    opt = malloc(sizeof(*opt));
    if (!opt)
      {
-       ERROR("could not allocate table option data.");
+       ERR("could not allocate table option data.");
        return EINA_FALSE;
      }
 
@@ -1241,14 +1241,14 @@ evas_object_table_unpack(Evas_Object *o, Evas_Object *child)
 
    if (o != evas_object_smart_parent_get(child))
      {
-       ERROR("cannot unpack child from incorrect table!");
+       ERR("cannot unpack child from incorrect table!");
        return EINA_FALSE;
      }
 
    opt = _evas_object_table_option_del(child);
    if (!opt)
      {
-       ERROR("cannot unpack child with no packing option!");
+       ERR("cannot unpack child with no packing option!");
        return EINA_FALSE;
      }
 
index 39eb429..99e3277 100644 (file)
@@ -404,7 +404,7 @@ evas_render_updates_internal(Evas *e, unsigned char make_updates, unsigned char
      }
    if ((e->output.w != e->viewport.w) || (e->output.h != e->viewport.h))
      {
-       ERROR("viewport size != output size!");
+       ERR("viewport size != output size!");
      }
    /* phase 5. add obscures */
    EINA_LIST_FOREACH(e->obscures, ll, r)
index 09769e1..83309dc 100644 (file)
@@ -65,7 +65,7 @@ evas_smart_new(const char *name,
    Evas_Smart *s;
    Evas_Smart_Class *sc;
 
-   WARN("----- WARNING. evas_smart_new() will be deprecated and removed soon"
+   WRN("----- WARNING. evas_smart_new() will be deprecated and removed soon"
          "----- Please use evas_smart_class_new() instead");
 
    if (!name) return NULL;
index 84e600a..f0b04c4 100644 (file)
@@ -187,7 +187,7 @@ evas_object_stack_above(Evas_Object *obj, Evas_Object *above)
      {
        if (obj->smart.parent != above->smart.parent)
          {
-//          ERROR("BITCH! evas_object_stack_above(), %p not inside same smart as %p!", obj, above);
+//          ERR("BITCH! evas_object_stack_above(), %p not inside same smart as %p!", obj, above);
             return;
          }
        evas_object_smart_member_stack_above(obj, above);
@@ -275,7 +275,7 @@ evas_object_stack_below(Evas_Object *obj, Evas_Object *below)
      {
        if (obj->smart.parent != below->smart.parent)
          {
-//          ERROR("BITCH! evas_object_stack_below(), %p not inside same smart as %p!", obj, below);
+//          ERR("BITCH! evas_object_stack_below(), %p not inside same smart as %p!", obj, below);
             return;
          }
        evas_object_smart_member_stack_below(obj, below);
index ea3da30..18f2c4a 100644 (file)
@@ -145,7 +145,7 @@ server_read(Server *s, int channel, int *opcode, int *size)
    if ((*size < 0) || (*size > (1024 * 1024))) return NULL;
    if (ints[2] != (s->ch[channel].req_from + 1))
      {
-        ERROR("EEK! sequence number mismatch from serer with pid: %i\n"
+        ERR("EEK! sequence number mismatch from serer with pid: %i\n"
                "---- num %i is not 1 more than %i"
                ,
                s->pid, ints[2], s->ch[channel].req_from);
index d73f042..c3fb6df 100644 (file)
@@ -225,7 +225,7 @@ server_parse(Server *s, Client *c)
    data = c->inbuf + (sizeof(int) * 3);
    if (ints[2] != (c->req_from + 1))
      {
-        ERROR("EEK! sequence number mismatch from client with pid: %i\n"
+        ERR("EEK! sequence number mismatch from client with pid: %i\n"
                "---- num %i is not 1 more than %i"
                ,
                c->pid, ints[2], c->req_from);
index a460109..9d36900 100644 (file)
@@ -591,7 +591,7 @@ evas_common_convert_func_get(DATA8 *dest, int w, int h, int depth, DATA32 rmask,
               }
 #endif
          }
-       INFO("depth = %i mode = %i", depth, pal_mode);
+       INF("depth = %i mode = %i", depth, pal_mode);
        if (depth == 8)
          {
 #ifdef BUILD_CONVERT_8_RGB_332
index f46f770..143f150 100644 (file)
@@ -715,7 +715,7 @@ evas_common_convert_rgba_to_16bpp_bgr_565_dith_rot_180 (DATA32 *src, DATA8 *dst,
 
    dst_ptr = (DATA16 *)dst;
 
-   ERROR("evas_common_convert_rgba_to_16bpp_bgr_565_dith_rot_180");
+   ERR("evas_common_convert_rgba_to_16bpp_bgr_565_dith_rot_180");
 
    CONVERT_LOOP_START_ROT_180();
 
index f4cc528..b0797f3 100644 (file)
@@ -221,7 +221,7 @@ evas_common_cpu_can_do(int *mmx, int *sse, int *sse2)
        if (cpu_feature_mask & CPU_FEATURE_MMX2) do_sse = 1;
        if (cpu_feature_mask & CPU_FEATURE_SSE) do_sse = 1;
      }
-//   INFO("%i %i %i", do_mmx, do_sse, do_sse2);
+//   INF("%i %i %i", do_mmx, do_sse, do_sse2);
    *mmx = do_mmx;
    *sse = do_sse;
    *sse2 = do_sse2;
index d962d6b..43cec87 100644 (file)
@@ -149,7 +149,7 @@ evas_common_font_query_inset(RGBA_Font *fn, const char *text)
    fg = evas_common_font_int_cache_glyph_get(fi, index);
    if (!fg) return 0;
 /*
-   INFO("fg->glyph_out->left = %i\n"
+   INF("fg->glyph_out->left = %i\n"
          "fi->src->ft.face->glyph->bitmap_left = %i\n"
          "fi->src->ft.face->glyph->metrics.horiBearingX = %i\n"
          "fi->src->ft.face->glyph->metrics.horiBearingY = %i\n"
index 4e1fe3a..5827bef 100644 (file)
@@ -53,7 +53,7 @@ static int               _evas_common_rgba_image_dirty(Image_Entry* dst, const I
 static void
 _evas_common_rgba_image_debug(const char* context, Image_Entry *eim)
 {
-  DEBUG("%p = [%s] {%s,%s} %i [%i|%i]", eim, context, eim->file, eim->key, eim->references, eim->w, eim->h);
+  DBG("%p = [%s] {%s,%s} %i [%i|%i]", eim, context, eim->file, eim->key, eim->references, eim->w, eim->h);
 }
 
 static const Evas_Cache_Image_Func      _evas_common_image_func =
@@ -83,7 +83,7 @@ evas_common_image_init(void)
    if (!eci)
      eci = evas_cache_image_init(&_evas_common_image_func);
    reference++;
-////   ERROR("REF++=%i", reference);
+////   ERR("REF++=%i", reference);
 
 #ifdef BUILD_LOADER_EET
    eet_init();
index d66b250..ec8a525 100644 (file)
@@ -118,7 +118,7 @@ evas_common_rgba_image_scalecache_dirty(Image_Entry *ie)
         im->cache.list = eina_list_remove(im->cache.list, sci);
         if (sci->im)
           {
-//             INFO(" 0- %i", sci->dst_w * sci->dst_h * 4);
+//             INF(" 0- %i", sci->dst_w * sci->dst_h * 4);
              LKL(cache_lock);
              evas_common_rgba_image_free(&sci->im->cache_entry);
              if (!sci->forced_unload)
@@ -185,7 +185,7 @@ _sci_fix_newest(RGBA_Image *im)
         if (sci->usage_count > im->cache.newest_usage_count)
           im->cache.newest_usage_count = sci->usage_count;
      }
-//   INFO("_sci_fix_newest! -> %i", im->cache.newest_usage);
+//   INF("_sci_fix_newest! -> %i", im->cache.newest_usage);
 }
 
 static Scaleitem *
@@ -233,7 +233,7 @@ _sci_find(RGBA_Image *im,
                cache_size -= sci->dst_w * sci->dst_h * 4;
              else
                cache_size -= sci->size_adjust;
-//             INFO(" 1- %i", sci->dst_w * sci->dst_h * 4);
+//             INF(" 1- %i", sci->dst_w * sci->dst_h * 4);
              cache_list = eina_inlist_remove(cache_list, (Eina_Inlist *)sci);
           }
         if (max_scale_items < 1) return NULL;
@@ -291,11 +291,11 @@ _cache_prune(Scaleitem *notsci, Eina_Bool copies_only)
                cache_size -= sci->dst_w * sci->dst_h * 4;
              else
                cache_size -= sci->size_adjust;
-//             INFO(" 2- %i", sci->dst_w * sci->dst_h * 4);
+//             INF(" 2- %i", sci->dst_w * sci->dst_h * 4);
              cache_list = eina_inlist_remove(cache_list, (Eina_Inlist *)sci);
              memset(sci, 0, sizeof(Eina_Inlist));
           }
-//        INFO("FLUSH %i > %i", cache_size, max_cache_size);
+//        INF("FLUSH %i > %i", cache_size, max_cache_size);
       }
 }
 #endif
@@ -385,7 +385,7 @@ evas_common_rgba_image_scalecache_prepare(Image_Entry *ie, RGBA_Image *dst,
         LKU(im->cache.lock);
         return;
      }
-//   INFO("%10i | %4i %4i %4ix%4i -> %4i %4i %4ix%4i | %i",
+//   INF("%10i | %4i %4i %4ix%4i -> %4i %4i %4ix%4i | %i",
 //          (int)use_counter,
 //          src_region_x, src_region_y, src_region_w, src_region_h,
 //          dst_region_x, dst_region_y, dst_region_w, dst_region_h,
@@ -413,12 +413,12 @@ evas_common_rgba_image_scalecache_prepare(Image_Entry *ie, RGBA_Image *dst,
    LKU(cache_lock);
    if (sci->usage > im->cache.newest_usage) 
      im->cache.newest_usage = sci->usage;
-//   INFO("newset? %p %i > %i", im, 
+//   INF("newset? %p %i > %i", im, 
 //          (int)sci->usage, 
 //          (int)im->cache.newest_usage);
    if (sci->usage_count > im->cache.newest_usage_count) 
      im->cache.newest_usage_count = sci->usage_count;
-//   INFO("  -------------- used %8i#, %8i@", (int)sci->usage, (int)sci->usage_count);
+//   INF("  -------------- used %8i#, %8i@", (int)sci->usage, (int)sci->usage_count);
    LKU(im->cache.lock);
 #endif
 }
@@ -449,7 +449,7 @@ evas_common_rgba_image_scalecache_do(Image_Entry *ie, RGBA_Image *dst,
    i++;
    if (i > 2000)
      {
-        INFO("p: %6i, h: %6i, m: %6i, n: %6i",
+        INF("p: %6i, h: %6i, m: %6i, n: %6i",
                pops, hits, misses, noscales);
         i = 0;
      }
@@ -552,7 +552,7 @@ evas_common_rgba_image_scalecache_do(Image_Entry *ie, RGBA_Image *dst,
      }
    if (sci->populate_me)
      {
-//        INFO("##! populate!");
+//        INF("##! populate!");
         sci->im = evas_common_image_new
           (dst_region_w, dst_region_h, im->cache_entry.flags.alpha);
         if (sci->im)
@@ -625,7 +625,7 @@ evas_common_rgba_image_scalecache_do(Image_Entry *ie, RGBA_Image *dst,
                {
                   cache_size += sci->dst_w * sci->dst_h * 4;
                }
-//             INFO(" + %i @ flop: %i (%ix%i)", 
+//             INF(" + %i @ flop: %i (%ix%i)", 
 //                    sci->dst_w * sci->dst_h * 4, sci->flop, 
 //                    sci->dst_w, sci->dst_h);
              cache_list = eina_inlist_append(cache_list, (Eina_Inlist *)sci);
@@ -645,7 +645,7 @@ evas_common_rgba_image_scalecache_do(Image_Entry *ie, RGBA_Image *dst,
           {
              if (sci->flop > 0) sci->flop -= FLOP_DEL;
           }
-//        INFO("use cached!");
+//        INF("use cached!");
         evas_common_scale_rgba_in_to_out_clip_sample
           (sci->im, dst, dc,
            0, 0,
@@ -653,7 +653,7 @@ evas_common_rgba_image_scalecache_do(Image_Entry *ie, RGBA_Image *dst,
            dst_region_x, dst_region_y, 
            dst_region_w, dst_region_h);
 //        hits++;
-//        INFO("check %p %i < %i", 
+//        INF("check %p %i < %i", 
 //               im,
 //               (int)im->cache.orig_usage, 
 //               (int)im->cache.newest_usage);
index 9ef20e4..a9fee85 100644 (file)
@@ -75,7 +75,7 @@ evas_common_pipe_thread(void *data)
 {
    Thinfo *thinfo;
 
-//   INFO("TH [...........");
+//   INF("TH [...........");
    thinfo = data;
    for (;;)
      {
@@ -83,13 +83,13 @@ evas_common_pipe_thread(void *data)
        RGBA_Pipe *p;
 
        /* wait for start signal */
-//     INFO(" TH %i START...", thinfo->thread_num);
+//     INF(" TH %i START...", thinfo->thread_num);
        pthread_barrier_wait(&(thinfo->barrier[0]));
        info = thinfo->info;
 //     if (info)
 //       {
 //          thinfo->info = NULL;
-//          INFO(" TH %i GO", thinfo->thread_num);
+//          INF(" TH %i GO", thinfo->thread_num);
        EINA_INLIST_FOREACH(EINA_INLIST_GET(info->im->pipe), p)
               {
                  int i;
@@ -102,7 +102,7 @@ evas_common_pipe_thread(void *data)
               }
             free(info);
 //       }
-//     INFO(" TH %i DONE", thinfo->thread_num);
+//     INF(" TH %i DONE", thinfo->thread_num);
        /* send finished signal */
        pthread_barrier_wait(&(thinfo->barrier[1]));
      }
index c28641c..c29359f 100644 (file)
@@ -94,7 +94,7 @@ rect_init(rect_t *r, int x, int y, int w, int h)
 void
 rect_print(const rect_t r)
 {
-   INFO("<rect(%d, %d, %d, %d)>", r.left, r.top, r.width, r.height);
+   INF("<rect(%d, %d, %d, %d)>", r.left, r.top, r.width, r.height);
 }
 
 void
@@ -716,7 +716,7 @@ rect_list_add_split_fuzzy(list_t *rects, list_node_t *node, int accepted_error)
                        */
                       /* prev_cur_node = cur_node; */
                       /* cur_node = cur_node->next; */
-                      WARN("Should not get here!");
+                      WRN("Should not get here!");
                       abort();
                    }
 
@@ -919,7 +919,7 @@ _add_redraw(list_t *rects, int max_w, int max_h, int x, int y, int w, int h)
    rn = (rect_node_t *)rect_list_node_pool_get();
    rn->_lst = list_node_zeroed;
    rect_init(&rn->rect, x, y, w, h);
-   //INFO(stderr, "ACCOUNTING: add_redraw: %4d,%4d %3dx%3d", x, y, w, h);
+   //INF("ACCOUNTING: add_redraw: %4d,%4d %3dx%3d", x, y, w, h);
    //testing on my core2 duo desktop - fuzz of 32 or 48 is best.
 #define FUZZ 32
    rect_list_add_split_fuzzy_and_merge(rects, (list_node_t *)rn,
@@ -1007,7 +1007,7 @@ evas_common_tilebuf_del_redraw(Tilebuf *tb, int x, int y, int w, int h)
    if ((w <= 0) || (h <= 0)) return 0;
 
    rect_init(&r, x, y, w, h);
-   //ERROR("ACCOUNTING: del_redraw: %4d,%4d %3dx%3d", x, y, w, h);
+   //ERR("ACCOUNTING: del_redraw: %4d,%4d %3dx%3d", x, y, w, h);
 
    rect_list_del_split_strict(&tb->rects, r);
    tb->need_merge = 1;
index 675be74..b5b07d6 100644 (file)
@@ -101,7 +101,7 @@ _soft16_image_draw_scaled_no_mul(Soft16_Image *src, Soft16_Image *dst,
       _soft16_image_draw_scaled_solid_solid
        (src, dst, dc, dst_offset, w, h, offset_x, offset_y);
    else
-      ERROR("Unsupported draw of scaled images src->cache_entry.flags.alpha=%d, "
+      ERR("Unsupported draw of scaled images src->cache_entry.flags.alpha=%d, "
               "dst->cache_entry.flags.alpha=%d, WITHOUT COLOR MUL",
               src->cache_entry.flags.alpha, dst->cache_entry.flags.alpha);
 }
@@ -213,7 +213,7 @@ _soft16_image_draw_scaled_mul_alpha(Soft16_Image *src, Soft16_Image *dst,
       _soft16_image_draw_scaled_solid_solid_mul_alpha
          (src, dst, dc, dst_offset, w, h, offset_x, offset_y, a);
    else
-     ERROR("Unsupported draw of scaled images src->cache_entry.flags.alpha=%d, "
+     ERR("Unsupported draw of scaled images src->cache_entry.flags.alpha=%d, "
           "dst->cache_entry.flags.alpha=%d, WITH ALPHA MUL %d",
           src->cache_entry.flags.alpha, dst->cache_entry.flags.alpha, A_VAL(&dc->mul.col));
 }
@@ -395,7 +395,7 @@ _soft16_image_draw_scaled_mul_color(Soft16_Image *src, Soft16_Image *dst,
       _soft16_image_draw_scaled_solid_solid_mul_color
          (src, dst, dc, dst_offset, w, h, offset_x, offset_y, r, g, b, a);
    else
-      ERROR("Unsupported draw of scaled images src->cache_entry.flags.alpha=%d, "
+      ERR("Unsupported draw of scaled images src->cache_entry.flags.alpha=%d, "
               "dst->cache_entry.flags.alpha=%d, WITH COLOR MUL 0x%08x",
               src->cache_entry.flags.alpha, dst->cache_entry.flags.alpha, dc->mul.col);
 }
index fc782ad..b7a428d 100644 (file)
@@ -60,7 +60,7 @@ _soft16_image_draw_unscaled_no_mul(Soft16_Image *src, Soft16_Image *dst,
                                               src_offset, dst_offset,
                                               width, height);
    else
-     ERROR("Unsupported draw of unscaled images src->cache_entry.flags.alpha=%d, "
+     ERR("Unsupported draw of unscaled images src->cache_entry.flags.alpha=%d, "
               "dst->cache_entry.flags.alpha=%d, WITHOUT COLOR MUL",
               src->cache_entry.flags.alpha, dst->cache_entry.flags.alpha);
 }
@@ -127,7 +127,7 @@ _soft16_image_draw_unscaled_mul_alpha(Soft16_Image *src, Soft16_Image *dst,
       _soft16_image_draw_unscaled_solid_solid_mul_alpha
          (src, dst, dc, src_offset, dst_offset, width, height, a);
    else
-     ERROR("Unsupported draw of unscaled images src->cache_entry.flags.alpha=%d, "
+     ERR("Unsupported draw of unscaled images src->cache_entry.flags.alpha=%d, "
               "dst->cache_entry.flags.alpha=%d, WITH ALPHA MUL %d",
               src->cache_entry.flags.alpha, dst->cache_entry.flags.alpha, A_VAL(&dc->mul.col));
 }
@@ -217,7 +217,7 @@ _soft16_image_draw_unscaled_mul_color(Soft16_Image *src, Soft16_Image *dst,
      _soft16_image_draw_unscaled_solid_solid_mul_color
        (src, dst, dc, src_offset, dst_offset, width, height, r, g, b, a);
    else
-     ERROR("Unsupported draw of unscaled images src->cache_entry.flags.alpha=%d, "
+     ERR("Unsupported draw of unscaled images src->cache_entry.flags.alpha=%d, "
               "dst->cache_entry.flags.alpha=%d, WITH COLOR MUL 0x%08x",
               src->cache_entry.flags.alpha, dst->cache_entry.flags.alpha, dc->mul.col);
 }
index 64b9cb8..415d137 100644 (file)
@@ -28,7 +28,7 @@ static int               _evas_common_load_soft16_image_data_from_file(Image_Ent
 /* static void */
 /* _evas_common_soft16_image_debug(const char* context, Image_Entry *eim) */
 /* { */
-/*    DEBUG("[16] %p = [%s] {%s,%s} %i [%i|%i]", eim, context, eim->file, eim->key, eim->references, eim->w, eim->h); */
+/*    DBG("[16] %p = [%s] {%s,%s} %i [%i|%i]", eim, context, eim->file, eim->key, eim->references, eim->w, eim->h); */
 /* } */
 
 static const Evas_Cache_Image_Func      _evas_common_soft16_image_func =
index dd5571d..37b1d56 100644 (file)
@@ -71,7 +71,7 @@ _soft16_rectangle_draw_int(Soft16_Image *dst, RGBA_Draw_Context *dc,
             (dst, dst_offset, dr.w, dr.h, rgb565, alpha);
       }
    else
-     ERROR("Unsupported feature: drawing rectangle to non-opaque destination.");
+     ERR("Unsupported feature: drawing rectangle to non-opaque destination.");
 }
 
 void
index 924ee3a..377320d 100644 (file)
 
 /* macros needed to log message through eina_log */
 extern EAPI int _evas_log_dom_global;
-#ifdef  _EVAS_DEFAULT_MODULE_LOG_DOM
-# undef _EVAS_DEFAULT_MODULE_LOG_DOM
+#ifdef  _EVAS_DEFAULT_LOG_DOM
+# undef _EVAS_DEFAULT_LOG_DOM
 #endif
-#define _EVAS_DEFAULT_MODULE_LOG_DOM _evas_log_dom_global
+#define _EVAS_DEFAULT_LOG_DOM _evas_log_dom_global
 
 #ifdef EVAS_DEFAULT_LOG_COLOR
 # undef EVAS_DEFAULT_LOG_COLOR
 #endif
-#define EVAS_DEFAULT_LOG_COLOR "\033[36m"
-#ifdef ERROR
-# undef ERROR
-#endif
-#define ERROR(...) EINA_LOG_DOM_ERR(_evas_log_dom_global, __VA_ARGS__)
-#ifdef DEBUG
-# undef DEBUG
-#endif
-#define DEBUG(...) EINA_LOG_DOM_DBG(_evas_log_dom_global, __VA_ARGS__)
-#ifdef INFO
-# undef INFO
-#endif
-#define INFO(...) EINA_LOG_DOM_INFO(_evas_log_dom_global, __VA_ARGS__)
-#ifdef WARN
-# undef WARN
-#endif
-#define WARN(...) EINA_LOG_DOM_WARN(_evas_log_dom_global, __VA_ARGS__)
-#ifdef CRITICAL
-# undef CRITICAL
-#endif
-#define CRITICAL(...) EINA_LOG_DOM_CRIT(_evas_log_dom_global, __VA_ARGS__)
-/**
- * macros that are used all around the code for message processing
- * four macros are defined ERR, WRN, DGB, INF. 
- * EFREET_MODULE_LOG_DOM should be defined individually for each module
- */
+#define EVAS_DEFAULT_LOG_COLOR EINA_COLOR_BLUE
 
 #ifdef ERR
 # undef ERR
 #endif
-#define ERR(...) EINA_LOG_DOM_ERR(_EVAS_DEFAULT_MODULE_LOG_DOM, __VA_ARGS__)
+#define ERR(...) EINA_LOG_DOM_ERR(_EVAS_DEFAULT_LOG_DOM, __VA_ARGS__)
+
 #ifdef DBG
 # undef DBG
 #endif
-#define DBG(...) EINA_LOG_DOM_DBG(_EVAS_DEFAULT_MODULE_LOG_DOM, __VA_ARGS__)
+#define DBG(...) EINA_LOG_DOM_DBG(_EVAS_DEFAULT_LOG_DOM, __VA_ARGS__)
+
 #ifdef INF
 # undef INF
 #endif
-#define INF(...) EINA_LOG_DOM_INFO(_EVAS_DEFAULT__MODULE_LOG_DOM, __VA_ARGS__)
+#define INF(...) EINA_LOG_DOM_INFO(_EVAS_DEFAULT_LOG_DOM, __VA_ARGS__)
+
 #ifdef WRN
 # undef WRN
 #endif
-#define WRN(...) EINA_LOG_DOM_WARN(_EVAS_DEFAULT_MODULE_LOG_DOM, __VA_ARGS__)
+#define WRN(...) EINA_LOG_DOM_WARN(_EVAS_DEFAULT_LOG_DOM, __VA_ARGS__)
+
 #ifdef CRIT
 # undef CRIT
 #endif
-#define CRIT(...) EINA_LOG_DOM_CRIT(_EVAS_DEFAULT_MODULE_LOG_DOM, __VA_ARGS__)
+#define CRIT(...) EINA_LOG_DOM_CRIT(_EVAS_DEFAULT_LOG_DOM, __VA_ARGS__)
 
 /*****************************************************************************/
 
index f95da6f..a50e8cd 100644 (file)
@@ -101,7 +101,7 @@ evas_debug_error(void)
        _evas_debug_init = 1;
      }
    if (_evas_debug_show)
-     DEBUG("*** EVAS ERROR: Evas Magic Check Failed!!!");
+     DBG("*** EVAS ERROR: Evas Magic Check Failed!!!");
 }
 
 void
@@ -114,7 +114,7 @@ evas_debug_input_null(void)
        _evas_debug_init = 1;
      }
    if (_evas_debug_show)
-     DEBUG("Input object pointer is NULL!");
+     DBG("Input object pointer is NULL!");
    if (_evas_debug_abort) abort();
 }
 
@@ -128,7 +128,7 @@ evas_debug_magic_null(void)
        _evas_debug_init = 1;
      }
    if (_evas_debug_show)
-     DEBUG("Input object is zero'ed out (maybe a freed object or zero-filled RAM)!");
+     DBG("Input object is zero'ed out (maybe a freed object or zero-filled RAM)!");
    if (_evas_debug_abort) abort();
 }
 
@@ -142,7 +142,7 @@ evas_debug_magic_wrong(DATA32 expected, DATA32 supplied)
        _evas_debug_init = 1;
      }
    if (_evas_debug_show)
-     DEBUG("  Input object is wrong type\n"
+     DBG("  Input object is wrong type\n"
           "    Expected: %08x - %s\n"
           "    Supplied: %08x - %s",
           expected, evas_debug_magic_string_get(expected),
@@ -160,7 +160,7 @@ evas_debug_generic(const char *str)
        _evas_debug_init = 1;
      }
    if (_evas_debug_show)
-     DEBUG("*** EVAS ERROR:\n"
+     DBG("*** EVAS ERROR:\n"
           "%s", (char *)str);
    if (_evas_debug_abort) abort();
 }
index d9a5b08..04820b3 100644 (file)
@@ -3,9 +3,19 @@
 #include "evas_engine.h"
 #include "Evas_Engine_Buffer.h"
 
+/* domain for eina_log */
+/* the log macros are defined in evas_common.h */
+/* theirs names are EVAS_ERR, EVAS_DBG, EVAS_CRIT, EVAS_WRN and EVAS_INF */
+/* although we can use the EVAS_ERROR, etc... macros it will not work
+   when the -fvisibility=hidden option is passed to gcc */
+
+int _evas_engine_buffer_log_dom = -1;
+
 /* function tables - filled in later (func and parent func) */
+
 static Evas_Func func, pfunc;
 
+
 /* engine struct data */
 typedef struct _Render_Engine Render_Engine;
 
@@ -72,7 +82,7 @@ _output_setup(int w,
    evas_common_tilebuf_init();
 
    evas_buffer_outbuf_buf_init();
-
+   
      {
        Outbuf_Depth dep;
        DATA32 color_key = 0;
@@ -113,7 +123,6 @@ static void *
 eng_info(Evas *e)
 {
    Evas_Engine_Info_Buffer *info;
-
    info = calloc(1, sizeof(Evas_Engine_Info_Buffer));
    if (!info) return NULL;
    info->magic.magic = rand();
@@ -125,7 +134,6 @@ static void
 eng_info_free(Evas *e __UNUSED__, void *info)
 {
    Evas_Engine_Info_Buffer *in;
-
    in = (Evas_Engine_Info_Buffer *)info;
    free(in);
 }
@@ -340,6 +348,14 @@ module_open(Evas_Module *em)
    if (!em) return 0;
    /* get whatever engine module we inherit from */
    if (!_evas_module_engine_inherit(&pfunc, "software_generic")) return 0;
+   
+   _evas_engine_buffer_log_dom = eina_log_domain_register("EvasBufferEngine", EINA_COLOR_BLUE);
+   if(_evas_engine_buffer_log_dom < 0)
+     {
+       EINA_LOG_ERR("Impossible to create a log domain for Eina.buffer.\n");
+       return 0;
+     }
+   
    /* store it for later use */
    func = pfunc;
    /* now to override methods */
@@ -366,6 +382,7 @@ module_open(Evas_Module *em)
 static void
 module_close(Evas_Module *em)
 {
+  eina_log_domain_unregister(_evas_engine_buffer_log_dom);
 }
 
 static Evas_Module_Api evas_modapi =
index ac28620..32577cf 100644 (file)
@@ -1,5 +1,33 @@
 #ifndef EVAS_ENGINE_H
 #define EVAS_ENGINE_H
+#include "evas_common.h"
+/*  this thing is for eina_log */
+extern int _evas_engine_buffer_log_dom ;
+
+#ifdef ERR
+# undef ERR
+#endif
+#define ERR(...) EINA_LOG_DOM_ERR(_evas_engine_buffer_log_dom, __VA_ARGS__)
+
+#ifdef DBG
+# undef DBG
+#endif
+#define DBG(...) EINA_LOG_DOM_DBG(_evas_engine_buffer_log_dom, __VA_ARGS__)
+
+#ifdef INF
+# undef INF
+#endif
+#define INF(...) EINA_LOG_DOM_INFO(_evas_engine_buffer_log_dom, __VA_ARGS__)
+
+#ifdef WRN
+# undef WRN
+#endif
+#define WRN(...) EINA_LOG_DOM_WARN(_evas_engine_buffer_log_dom, __VA_ARGS__)
+
+#ifdef CRIT
+# undef CRIT
+#endif
+#define CRIT(...) EINA_LOG_DOM_CRIT(_evas_engine_buffer_log_dom, __VA_ARGS__)
 
 typedef struct _Outbuf                Outbuf;
 
index e9dbac0..a6a9923 100644 (file)
@@ -8,6 +8,9 @@
 #include "Evas_Engine_Cairo_X11.h"
 #include "evas_cairo_common.h"
 
+/* domain for eina_log */
+int _evas_engine_cairo_X11_log_dom = -1;
+
 static void *eng_info(Evas *e);
 static void eng_info_free(Evas *e, void *info);
 static int eng_setup(Evas *e, void *info);
@@ -257,11 +260,10 @@ static void *
 eng_info(Evas *e)
 {
    Evas_Engine_Info_Cairo_X11 *info;
-
+   INF("CAIRO: create info...");
    info = calloc(1, sizeof(Evas_Engine_Info_Cairo_X11));
    if (!info) return NULL;
-   info->magic.magic = rand();
-   INFO("CAIRO: create info...");
+   info->magic.magic = rand();   
    return info;
    e = NULL;
 }
@@ -270,7 +272,6 @@ static void
 eng_info_free(Evas *e, void *info)
 {
    Evas_Engine_Info_Cairo_X11 *in;
-
    in = (Evas_Engine_Info_Cairo_X11 *)info;
    free(in);
 }
@@ -282,7 +283,7 @@ eng_setup(Evas *e, void *in)
    Evas_Engine_Info_Cairo_X11 *info;
 
    info = (Evas_Engine_Info_Cairo_X11 *)in;
-   INFO("CAIRO: setup info...");
+   INF("CAIRO: setup info...");
    if (!e->engine.data.output)
      e->engine.data.output =
      eng_output_setup(e->output.w,
@@ -318,7 +319,7 @@ eng_output_setup(int w, int h, Display *disp, Drawable draw, Visual *vis, Colorm
        free(re);
        return NULL;
      }
-   INFO("CAIRO: cairo window setup done.");
+   INF("CAIRO: cairo window setup done.");
    evas_common_cpu_init();
 
    evas_common_blend_init();
@@ -1500,6 +1501,12 @@ static int
 module_open(Evas_Module *em)
 {
    if (!em) return 0;
+   _evas_engine_cairo_X11_log_dom = eina_log_domain_register("EvasCairoX11Engine", EINA_COLOR_BLUE);
+   if(_evas_engine_cairo_X11_log_dom < 0)
+     {
+       EINA_LOG_ERR("Impossible to create a log doamin for the cairo (X11) engine.\n");
+       return 0;
+     }
    em->functions = (void *)(&eng_func);
    return 1;
 }
@@ -1507,6 +1514,7 @@ module_open(Evas_Module *em)
 static void
 module_close(Evas_Module *em)
 {
+  eina_log_domain_unregister(_evas_engine_cairo_X11_log_dom);
 }
 
 static Evas_Module_Api evas_modapi =
index 7d52241..a454af8 100644 (file)
@@ -1,8 +1,36 @@
 #ifndef EVAS_ENGINE_H
 #define EVAS_ENGINE_H
-
+#include "evas_common.h"
 #include "evas_cairo_common.h"
 
+extern int _evas_engine_cairo_X11_log_dom ;
+
+#ifdef ERR
+# undef ERR
+#endif
+#define ERR(...) EINA_LOG_DOM_ERR(_evas_engine_cairo_X11_log_dom, __VA_ARGS__)
+
+#ifdef DBG
+# undef DBG
+#endif
+#define DBG(...) EINA_LOG_DOM_DBG(_evas_engine_cairo_X11_log_dom, __VA_ARGS__)
+
+#ifdef INF
+# undef INF
+#endif
+#define INF(...) EINA_LOG_DOM_INFO(_evas_engine_cairo_X11_log_dom, __VA_ARGS__)
+
+#ifdef WRN
+# undef WRN
+#endif
+#define WRN(...) EINA_LOG_DOM_WARN(_evas_engine_cairo_X11_log_dom, __VA_ARGS__)
+
+#ifdef CRIT
+# undef CRIT
+#endif
+#define CRIT(...) EINA_LOG_DOM_CRIT(_evas_engine_cairo_X11_log_dom, __VA_ARGS__)
+
+
 typedef struct _Evas_Cairo_X11_Window Evas_Cairo_X11_Window;
 
 struct _Evas_Cairo_X11_Window
index 5be8ddb..ce0d985 100644 (file)
@@ -29,21 +29,21 @@ bool D3DDevice::Init(HWND window, int depth, bool fullscreen)
 
    if (FAILED(hr = _object->GetAdapterDisplayMode(D3DADAPTER_DEFAULT, &dm)))
      {
-     Log("GetAdapterDisplayMode failed: %x", hr);
-     Destroy();
-     return false;
+       ERR("GetAdapterDisplayMode failed: %x", hr);
+       Destroy();
+       return false;
      }
 
    if (FAILED(hr = _object->GetDeviceCaps(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, &caps)))
      {
-     Log("GetDeviceCaps failed: %x", hr);
+     ERR("GetDeviceCaps failed: %x", hr);
      Destroy();
      return false;
      }
 
    if (!GetClientRect(window, &rect))
      {
-     Log("GetClientRect failed: %x", GetLastError());
+     ERR("GetClientRect failed: %x", GetLastError());
      Destroy();
      return false;
      }
@@ -84,7 +84,7 @@ bool D3DDevice::Init(HWND window, int depth, bool fullscreen)
    if (FAILED(hr = _object->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL,
      window, flag, &pp, &_device)))
      {
-     Log("CreateDevice failed: %x", hr);
+     WRN("CreateDevice failed: %x", hr);
      Destroy();
      return false;
      }
@@ -103,7 +103,7 @@ bool D3DDevice::Init(HWND window, int depth, bool fullscreen)
      _depth = 16;
      break;
    default:
-     Log("No supported format found");
+     WRN("No supported format found");
      Destroy();
      return false;
    }
@@ -119,7 +119,7 @@ bool D3DDevice::Init(HWND window, int depth, bool fullscreen)
 
    if (FAILED(CreateRenderTarget()))
    {
-      Log("Failed to create render target");
+      ERR("Failed to create render target");
       Destroy();
       return false;
    }
@@ -136,7 +136,7 @@ bool D3DDevice::Reset(int width, int height, int fullscreen)
    _d3dpp.Windowed = (fullscreen == 1) ? FALSE : ((fullscreen == 0) ? TRUE : _d3dpp.Windowed);
    if (FAILED(ResetDevice()))
    {
-      Log("Couldnt restore device");
+      WRN("Couldnt restore device");
       _d3dpp = pp;
       return SUCCEEDED(ResetDevice());
    }
@@ -166,7 +166,7 @@ void D3DDevice::Destroy()
       _object->Release();
    ResetParams();
 
-   Log("uninitialized");
+   INF("uninitialized");
 }
 
 void D3DDevice::ResetParams()
@@ -201,7 +201,7 @@ HRESULT D3DDevice::RestoreDevice()
    if (SUCCEEDED(hr = _device->TestCooperativeLevel()))
    {
       _device_lost = FALSE;
-      Log("render test ok");
+      DBG("render test ok");
       return S_OK;
    }
 
@@ -220,7 +220,7 @@ HRESULT D3DDevice::RestoreDevice()
 
 HRESULT D3DDevice::ResetDevice()
 {
-   Log("reset");
+   DBG("reset");
    HRESULT hr = S_OK;
 
    _scene_rendering = FALSE;
@@ -243,7 +243,7 @@ HRESULT D3DDevice::ResetDevice()
    // Reset the device
    if (FAILED(hr = _device->Reset(&_d3dpp)))
    {
-      Log("D3DDevice: Reset of the device failed! Error (%X)", (DWORD)hr);
+      ERR("D3DDevice: Reset of the device failed! Error (%X)", (DWORD)hr);
       return hr;
    }
 
@@ -261,13 +261,13 @@ HRESULT D3DDevice::ResetDevice()
 
    if (FAILED(hr))
    {
-      Log("Restoration of device objects failed");
+      WRN("Restoration of device objects failed");
       // Invalidate objects
 
       return E_FAIL;
    }
 
-   Log("Device objects were successfuly restored");
+   DBG("Device objects were successfuly restored");
    _textures.Set(NULL);
 
    //_device_objects_restored = true;
@@ -290,7 +290,7 @@ bool D3DDevice::Begin()
    HRESULT hr;
    if (FAILED(hr = _device->BeginScene()))
    {
-      Log("Cannot begin scene: %X", (DWORD)hr);
+      WRN("Cannot begin scene: %X", (DWORD)hr);
       return false;
    }
 
@@ -332,7 +332,7 @@ TArray<DWORD> &D3DDevice::GetRenderData()
       return _render_data;
    if (FAILED(hr = _device->GetRenderTargetData(surf, _render_target_data)))
    {
-      Log("Failed to get render target data (%X)", (DWORD)hr);
+      WRN("Failed to get render target data (%X)", (DWORD)hr);
       surf->Release();
       return _render_data;
    }
index a92ee5b..aa44eb9 100644 (file)
@@ -208,7 +208,7 @@ bool D3DImageCache::ResizeImage(D3DDevice *d3d, int nw, int nh, int id)
    if (FAILED(hr = d3d->GetDevice()->CreateTexture(nw, nh, 0, 0, D3DFMT_A8R8G8B8,
       D3DPOOL_MANAGED, &tex, NULL)))
    {
-      Log("Failed to create texture: %X", hr);
+      WRN("Failed to create texture: %X", hr);
       return false;
    }
    assert(tex != NULL);
@@ -249,7 +249,7 @@ bool D3DImageCache::CreateEntry(D3DDevice *d3d, CacheEntry &entry, int w, int h,
    if (FAILED(hr = d3d->GetDevice()->CreateTexture(width, height, 0, 0, D3DFMT_A8R8G8B8,
       D3DPOOL_MANAGED, &entry.texture, NULL)))
    {
-      Log("Failed to create texture: %X", hr);
+      WRN("Failed to create texture: %X", hr);
       return false;
    }
 
@@ -271,7 +271,7 @@ bool D3DImageCache::InsertData(CacheEntry &entry, DWORD *data, int w, int h)
    D3DLOCKED_RECT lr;
    if (FAILED(entry.texture->LockRect(0, &lr, &rc, 0)))
    {
-      Log("Failed to lock texture");
+      WRN("Failed to lock texture");
       return false;
    }
 
@@ -288,7 +288,7 @@ bool D3DImageCache::InsertData(CacheEntry &entry, DWORD *data, int w, int h)
 
    if (FAILED(entry.texture->UnlockRect(0)))
    {
-      Log("Failed to unlock texture");
+      WRN("Failed to unlock texture");
       return false;
    }
    return true;
@@ -304,7 +304,7 @@ bool D3DImageCache::RetrieveData(CacheEntry &entry, DWORD *data, int w, int h)
    D3DLOCKED_RECT lr;
    if (FAILED(entry.texture->LockRect(0, &lr, &rc, D3DLOCK_READONLY)))
    {
-      Log("Failed to lock texture");
+      WRN("Failed to lock texture");
       return false;
    }
 
@@ -313,7 +313,7 @@ bool D3DImageCache::RetrieveData(CacheEntry &entry, DWORD *data, int w, int h)
 
    if (FAILED(entry.texture->UnlockRect(0)))
    {
-      Log("Failed to unlock texture");
+      WRN("Failed to unlock texture");
       return false;
    }
    return true;
@@ -349,7 +349,7 @@ bool D3DImageCache::UpdateImageDataWithDirtyInfo(CacheEntryInfo &info, DWORD *da
    D3DLOCKED_RECT lr;
    if (FAILED(entry.texture->LockRect(0, &lr, &rc, 0)))
    {
-      Log("Failed to lock texture");
+      WRN("Failed to lock texture");
       return false;
    }
 
@@ -386,7 +386,7 @@ bool D3DImageCache::UpdateImageDataWithDirtyInfo(CacheEntryInfo &info, DWORD *da
 
    if (FAILED(entry.texture->UnlockRect(0)))
    {
-      Log("Failed to unlock texture");
+      WRN("Failed to unlock texture");
       return false;
    }
    return true;
@@ -405,7 +405,7 @@ bool D3DImageCache::UpdateImageDataDiscard(CacheEntryInfo &info, DWORD *data)
    D3DLOCKED_RECT lr;
    if (FAILED(entry.texture->LockRect(0, &lr, &rc, 0)))
    {
-      Log("Failed to lock texture");
+      WRN("Failed to lock texture");
       return false;
    }
 
@@ -417,7 +417,7 @@ bool D3DImageCache::UpdateImageDataDiscard(CacheEntryInfo &info, DWORD *data)
 
    if (FAILED(entry.texture->UnlockRect(0)))
    {
-      Log("Failed to unlock texture");
+      WRN("Failed to unlock texture");
       return false;
    }
    return true;
index 4af8448..566cc9a 100644 (file)
@@ -83,7 +83,7 @@ bool CreateDIBObjects(DevicePtr *dev_ptr)
    assert(dev_ptr != NULL);
    if ((dev_ptr->dib.hdc = CreateCompatibleDC(NULL)) == NULL)
    {
-      Log("Failed to create compatible DC");
+      WRN("Failed to create compatible DC");
       return false;
    }
    ZeroMemory(&dev_ptr->dib.info, sizeof(dev_ptr->dib.info));
@@ -96,7 +96,7 @@ bool CreateDIBObjects(DevicePtr *dev_ptr)
    if ((dev_ptr->dib.image = CreateDIBSection(dev_ptr->dib.hdc, &dev_ptr->dib.info,
       DIB_RGB_COLORS, (void **)&dev_ptr->dib.data, NULL, 0)) == NULL)
    {
-      Log("Failed to create dib section");
+      WRN("Failed to create dib section");
       DeleteDIBObjects(dev_ptr);
       return false;
    }
@@ -122,7 +122,7 @@ Direct3DDeviceHandler evas_direct3d_init(HWND window, int depth, int fullscreen)
 
    if (!D3DShaderPack::Current()->Initialize(device))
    {
-      Log("Failed to build shader pack");
+      ERR("Failed to build shader pack");
       device->Destroy();
       return NULL;
    }
@@ -141,7 +141,7 @@ Direct3DDeviceHandler evas_direct3d_init(HWND window, int depth, int fullscreen)
    if (!D3DImageCache::Current()->CreateImage(device, device->GetWidth(), device->GetHeight(),
       true, info))
    {
-      Log("Failed to create fonts image buffer");
+      WRN("Failed to create fonts image buffer");
       return NULL;
    }
    dev_ptr->fonts_buffer_image_id = info.id;
@@ -171,7 +171,7 @@ evas_direct3d_free(Direct3DDeviceHandler d3d)
    dev_ptr->device = NULL;
    delete dev_ptr;
 
-   Log("uninitialized");
+   DBG("uninitialized");
 }
 
 void
@@ -181,19 +181,19 @@ evas_direct3d_resize(Direct3DDeviceHandler d3d, int width, int height)
    D3DDevice *device = dev_ptr->device;
    if (!device->Reset(width, height, -1))
    {
-      Log("Failed to resize");
+      ERR("Failed to resize");
       return;
    }
    if (!D3DImageCache::Current()->ResizeImage(device, width, height,
       dev_ptr->fonts_buffer_image_id))
    {
-      Log("Failed to resize fonts image buffer");
+      WRN("Failed to resize fonts image buffer");
    }
    if (dev_ptr->layered)
    {
       DeleteDIBObjects(dev_ptr);
       if (!CreateDIBObjects(dev_ptr))
-         Log("Failed to create dib objects");
+         WRN("Failed to create dib objects");
    }
 }
 
@@ -210,13 +210,13 @@ evas_direct3d_set_fullscreen(Direct3DDeviceHandler d3d, int width, int height, i
 
    if (!device->Reset(width, height, fullscreen))
    {
-      Log("Failed to resize");
+      WRN("Failed to resize");
       return;
    }
    if (!D3DImageCache::Current()->ResizeImage(device, width, height,
       dev_ptr->fonts_buffer_image_id))
    {
-      Log("Failed to resize fonts image buffer");
+      WRN("Failed to resize fonts image buffer");
    }
 
    if (fullscreen == 0)
@@ -258,7 +258,7 @@ evas_direct3d_context_set_multiplier(Direct3DDeviceHandler d3d, int r, int g, in
 void
 evas_direct3d_render_all(Direct3DDeviceHandler d3d)
 {
-   Log("render");
+   DBG("render");
    assert(d3d != NULL);
    DevicePtr *dev_ptr = SelectDevice(d3d);
    D3DDevice *device = dev_ptr->device;
@@ -349,12 +349,12 @@ void evas_direct3d_line_draw(Direct3DDeviceHandler d3d, int x1, int y1, int x2,
    {
       line = new D3DObjectLine();
       scene->AddObject(line);
-      Log("New line object (total objects: %d)", scene->GetObjectCount());
+      DBG("New line object (total objects: %d)", scene->GetObjectCount());
    }
    else
    {
       line->SetFree(false);
-      Log("Line reused (object: %p)", line.Addr());
+      DBG("Line reused (object: %p)", line.Addr());
    }
 
    line->Setup(
@@ -377,12 +377,12 @@ void evas_direct3d_rectangle_draw(Direct3DDeviceHandler d3d, int x, int y, int w
    {
       rect = new D3DObjectRect();
       scene->AddObject(rect);
-      Log("New rect object (total objects: %d)", scene->GetObjectCount());
+      DBG("New rect object (total objects: %d)", scene->GetObjectCount());
    }
    else
    {
       rect->SetFree(false);
-      Log("Rect reused (object: %p)", rect.Addr());
+      DBG("Rect reused (object: %p)", rect.Addr());
    }
 
    rect->Setup(
@@ -403,7 +403,7 @@ Direct3DImageHandler evas_direct3d_image_load(Direct3DDeviceHandler d3d,
    RGBA_Image *evas_image = evas_common_load_image_from_file(file, key, lo);
    if (evas_image == NULL)
    {
-      Log("Failed to load image from %s", file);
+      WRN("Failed to load image from %s", file);
       return NULL;
    }
    int image_width = evas_image->cache_entry.w;
@@ -420,7 +420,7 @@ Direct3DImageHandler evas_direct3d_image_load(Direct3DDeviceHandler d3d,
    image->SetFree(true);
    scene->AddObject(image);
 
-   Log("New image object (total objects: %d)", scene->GetObjectCount());
+   DBG("New image object (total objects: %d)", scene->GetObjectCount());
 
    ImagePtr *ptr = new ImagePtr;
    ptr->ref = image;
@@ -447,7 +447,7 @@ Direct3DImageHandler evas_direct3d_image_new_from_data(Direct3DDeviceHandler d3d
    if (!D3DImageCache::Current()->InsertImage(device, image_data,
       image_width, image_height, info))
    {
-      Log("Couldnt add image to the cache");
+      WRN("Couldnt add image to the cache");
       return NULL;
    }
    char buf[64];
@@ -458,7 +458,7 @@ Direct3DImageHandler evas_direct3d_image_new_from_data(Direct3DDeviceHandler d3d
    image->SetFree(true);
    scene->AddObject(image);
 
-   Log("New image object (total objects: %d)", scene->GetObjectCount());
+   DBG("New image object (total objects: %d)", scene->GetObjectCount());
 
    ImagePtr *ptr = new ImagePtr;
    ptr->ref = image;
@@ -498,7 +498,7 @@ void evas_direct3d_image_data_put(Direct3DDeviceHandler d3d, Direct3DImageHandle
       return;
 
    if (!image_ref->UpdateImageData(image_data))
-      Log("Failed to update image data");
+      ERR("Failed to update image data");
 }
 
 void evas_direct3d_image_data_get(Direct3DDeviceHandler d3d, Direct3DImageHandler image,
@@ -540,7 +540,7 @@ void evas_direct3d_image_draw(Direct3DDeviceHandler d3d, Direct3DImageHandler im
          {
             images[i]->CopyTo(image_ref);
             found = true;
-            Log("Image object info reused, source: \"%s\"", image_ref->GetSource());
+            WRN("Image object info reused, source: \"%s\"", image_ref->GetSource());
             break;
          }
       }
@@ -556,7 +556,7 @@ void evas_direct3d_image_draw(Direct3DDeviceHandler d3d, Direct3DImageHandler im
       if (!D3DImageCache::Current()->InsertImage(device, (DWORD *)evas_image->image.data,
          evas_image->cache_entry.w, evas_image->cache_entry.h, info))
       {
-         Log("Couldnt add image to the cache");
+         WRN("Couldnt add image to the cache");
          return;
       }
       image_ref->Init(info.u, info.v, info.du, info.dv, info.id,
index 7730f7c..f072e87 100644 (file)
@@ -113,7 +113,7 @@ D3DObjectFont::Glyph *D3DObjectFont::GetGlyph(void *source)
 {
    if (_image_id < 0)
    {
-      Log("Font is not initialized");
+      WRN("Font is not initialized");
       return NULL;
    }
    for (int i = 0; i < _glyphs.Length(); i++)
@@ -129,7 +129,7 @@ D3DObjectFont::Glyph *D3DObjectFont::AddGlyph(D3DDevice *d3d, void *source,
 {
    if (_image_id < 0)
    {
-      Log("Font is not initialized");
+      WRN("Font is not initialized");
       return NULL;
    }
    for (int i = 0; i < _glyphs.Length(); i++)
index 3bf2f38..3bfbe1e 100644 (file)
@@ -139,7 +139,7 @@ void D3DObjectImage::EndCache(D3DDevice *d3d)
       cur += groups[i].num * 6;
    }
 
-   Log("Image cache drawn: %d items, %d groups", _cache.Length(), groups.Length());
+   DBG("Image cache drawn: %d items, %d groups", _cache.Length(), groups.Length());
    _cache_enabled = false;
 }
 
@@ -147,7 +147,7 @@ void D3DObjectImage::Draw(D3DDevice *d3d)
 {
    _dirty = false;
 
-   Log("Image draw: (%.3f, %.3f, %.3f, %.3f)", _x, _y, _w, _h);
+   DBG("Image draw: (%.3f, %.3f, %.3f, %.3f)", _x, _y, _w, _h);
 
    if (_cache_enabled)
    {
index 5c0f774..9442243 100644 (file)
@@ -28,7 +28,7 @@ void D3DObjectLine::EndCache(D3DDevice *d3d)
    d3d->GetDevice()->DrawPrimitiveUP(D3DPT_LINELIST, _cache.Length() / 2, 
       _cache.Data(), sizeof(Vertex));
 
-   Log("Line cache drawn: %d items", _cache.Length() / 2);
+   DBG("Line cache drawn: %d items", _cache.Length() / 2);
    _cache_enabled = false;
 }
 
index f37e28e..ebdd22b 100644 (file)
@@ -27,7 +27,7 @@ void D3DObjectRect::EndCache(D3DDevice *d3d)
    d3d->GetDevice()->DrawPrimitiveUP(D3DPT_TRIANGLELIST, _cache.Length() / 3,
       _cache.Data(), sizeof(Vertex));
 
-   Log("Rect cache drawn: %d items", _cache.Length() / 6);
+   DBG("Rect cache drawn: %d items", _cache.Length() / 6);
    _cache_enabled = false;
 }
 
index 6d7a789..d9c868f 100644 (file)
@@ -34,11 +34,11 @@ bool D3DShaderPack::Initialize(D3DDevice *d3d)
 {
    bool res = true;
    if (!(res = InitVertexDeclarations(d3d) && res))
-      Log("Failed to create vdecl set");
+      WRN("Failed to create vdecl set");
    if (!(res = InitVertexShaders(d3d) && res))
-      Log("Failed to create vs set");
+      WRN("Failed to create vs set");
    if (!(res = InitPixelShaders(d3d) && res))
-      Log("Failed to create ps set");
+      WRN("Failed to create ps set");
    return res;
 }
 
@@ -280,11 +280,11 @@ void *D3DShaderPack::CompileShader(D3DDevice *d3d, bool make_vs,
 
    if (FAILED(res))
    {
-      Log("Shader %s compilation failed, code = %X", name, res);
+      ERR("Shader %s compilation failed, code = %X", name, res);
       if (error_msgs == NULL)
          return NULL;
       const char *mess = (const char *)error_msgs->GetBufferPointer();
-      Log("Error output:\n%s", mess);
+      ERR("Error output:\n%s", mess);
       error_msgs->Release();
       return NULL;
    }
@@ -310,7 +310,7 @@ void *D3DShaderPack::CompileShader(D3DDevice *d3d, bool make_vs,
 
    if (FAILED(res))
    {
-      Log("Shader %s creation failed, code = %X", name, res);
+      WRN("Shader %s creation failed, code = %X", name, res);
       return NULL;
    }
    return res_ptr;
index 5b5da7b..8d3dd45 100644 (file)
@@ -64,7 +64,7 @@ bool D3DVertexBufferCache::InitBuffer(D3DDevice *d3d, BYTE *data, int size, Cach
       CacheEntry new_entry;
       if (!CreateEntry(d3d, new_entry, size))
       {
-         Log("Failed to create new vbcache entry");
+       WRN("Failed to create new vbcache entry");
          return false;
       }
       _cache.Add(new_entry);
@@ -80,7 +80,7 @@ bool D3DVertexBufferCache::InitBuffer(D3DDevice *d3d, BYTE *data, int size, Cach
    assert(ce != NULL);
    if (!InsertData(*ce, data, size))
    {
-      Log("Failed to insert vbcache data");
+      WRN("Failed to insert vbcache data");
       return false;
    }
    return true;
index 736d3b7..35d0683 100644 (file)
@@ -15,6 +15,7 @@ struct _Render_Engine
    int in_redraw : 1;
 };
 
+int _evas_engine_direct3d_log_dom = -1;
 
 /* function tables - filled in later (func and parent func) */
 static Evas_Func func, pfunc;
@@ -55,7 +56,7 @@ _output_setup(int width, int height, int rotation, HWND window, int depth, int f
    evas_common_font_init();
    evas_common_draw_init();
    evas_common_tilebuf_init();
-
+   
    if ((re->d3d = evas_direct3d_init(window, depth, fullscreen)) == 0)
      {
      free(re);
@@ -93,8 +94,7 @@ eng_setup(Evas *e, void *info)
 {
    Render_Engine *re;
    Evas_Engine_Info_Direct3D *in;
-   re = (Render_Engine *)e->engine.data.output;
-
+   re = (Render_Engine *)e->engine.data.output;   
    in = (Evas_Engine_Info_Direct3D *)info;
    if (e->engine.data.output == NULL)
      {
@@ -533,6 +533,13 @@ module_open(Evas_Module *em)
    if (!em) return 0;
    /* get whatever engine module we inherit from */
    if (!_evas_module_engine_inherit(&pfunc, "software_generic")) return 0;
+    /* Initialize the log domain */
+   _evas_engine_direct3d_log_dom = eina_log_domain_register("EvasDirect3D", EVAS_DEFAULT_LOG_COLOR);
+   if(_evas_engine_direct3d_log_dom < 0)
+     {
+       EINA_LOG_ERR("Impossible to create a log domain for the Direct3D engine.\n");
+       return 0;
+     }
    /* store it for later use */
    func = pfunc;
    /* now to override methods */
@@ -603,6 +610,7 @@ module_open(Evas_Module *em)
 static void
 module_close(Evas_Module *em)
 {
+  eina_log_domain_unregister(_evas_engine_direct3d_log_dom);
 }
 
 static Evas_Module_Api evas_modapi =
index 6257227..da1ebff 100644 (file)
@@ -14,15 +14,42 @@ extern "C" {
 #define EVAS_INLINE_ARRAY_H  // We dont need that and it is buggy
 
 #include "evas_common.h"
-#include "evas_private.h"
 
 #ifdef __cplusplus
 }
 #endif
 
+
 //#define ENABLE_LOG_PRINTF
+
+extern int _evas_engine_direct3d_log_dom ;
+#ifdef ERR
+# undef ERR
+#endif
+#define ERR(...) EINA_LOG_DOM_ERR(_evas_engine_direct3d_log_dom, __VA_ARGS__)
+
+#ifdef DBG
+# undef DBG
+#endif
+#define DBG(...) EINA_LOG_DOM_DBG(_evas_engine_direct3d_log_dom, __VA_ARGS__)
+
+#ifdef INF
+# undef INF
+#endif
+#define INF(...) EINA_LOG_DOM_INFO(_evas_engine_direct3d_log_dom, __VA_ARGS__)
+
+#ifdef WRN
+# undef WRN
+#endif
+#define WRN(...) EINA_LOG_DOM_WARN(_evas_engine_direct3d_log_dom, __VA_ARGS__)
+
+#ifdef CRIT
+# undef CRIT
+#endif
+#define CRIT(...) EINA_LOG_DOM_CRIT(_evas_engine_direct3d_log_dom, __VA_ARGS__)
+
 #ifdef ENABLE_LOG_PRINTF
-#define Log(str, ...) INFO("D3D "str, __VA_ARGS__)
+#define Log(str, ...) INF("D3D "str, __VA_ARGS__)
 #else
 #define Log(str, ...)
 #endif
@@ -31,6 +58,7 @@ typedef void * Direct3DDeviceHandler;
 typedef void * Direct3DImageHandler;
 typedef void * Direct3DFontGlyphHandler;
 
+
 #ifdef __cplusplus
 extern "C" {
 #endif
index aa91d48..ed7bf8c 100644 (file)
@@ -17,6 +17,7 @@
 //#define DFB_DEBUG_IMAGE 1
 //#define DFB_DEBUG_FLAGS 1
 //#define DFB_DEBUG_ACCELERATION 1
+int _evas_engine_directfb_log_dom = -1;
 
 static Evas_Func func = {};
 static Evas_Func parent_func = {};
@@ -69,7 +70,7 @@ _dfb_surface_clear(IDirectFBSurface *surface, int x, int y, int w, int h)
    return;
 
  error:
-   ERROR("DirectFB: could not clear surface: %s",
+   ERR("DirectFB: could not clear surface: %s",
         DirectFBErrorString(r));
 }
 
@@ -93,7 +94,7 @@ _image_autoset_alpha(DirectFB_Engine_Image_Entry *image)
    r = surface->GetPixelFormat(surface, &fmt);
    if (r != DFB_OK)
      {
-       ERROR("DirectFB: could not get pixel format: %s",
+       ERR("Could not get pixel format: %s",
                DirectFBErrorString(r));
        return;
      }
@@ -114,7 +115,7 @@ _dfb_surface_update(IDirectFBSurface *surface, int x, int y, int w, int h)
    cr.y2 = y + h - 1;
    r = surface->Flip(surface, &cr, DSFLIP_NONE);
    if (r != DFB_OK)
-     WARN("DirectFB: could not update surface: %s",
+     WRN("Could not update surface: %s",
           DirectFBErrorString(r));
 }
 
@@ -138,8 +139,8 @@ _dfb_surface_from_data(IDirectFB *dfb, int w, int h, void *data)
    r = dfb->CreateSurface(dfb, &desc, &s);
    if (r != DFB_OK)
      {
-       ERROR("DirectFB: cannot create DirectFB surface: %s",
-               DirectFBErrorString(r));
+       ERR("Cannot create DirectFB surface: %s",
+                    DirectFBErrorString(r));
        return NULL;
      }
 
@@ -165,14 +166,14 @@ _dfb_blit_accel_caps_print(IDirectFBSurface *dst, IDirectFBSurface *src)
    r = dst->GetAccelerationMask(dst, src, &mask);
    if (r != DFB_OK)
      {
-       ERROR("DirectFB: Could not retrieve acceleration mask: %s",
+       ERR("Could not retrieve acceleration mask: %s",
                DirectFBErrorString(r));
        return;
      }
 
-   DEBUG("Acceleration: ");
+   DBG("Acceleration: ");
 
-#define O(m) if (mask & m) DEBUG(#m " ")
+#define O(m) if (mask & m) DBG(#m " ")
    O(DFXL_FILLRECTANGLE);
    O(DFXL_DRAWRECTANGLE);
    O(DFXL_DRAWLINE);
@@ -183,7 +184,7 @@ _dfb_blit_accel_caps_print(IDirectFBSurface *dst, IDirectFBSurface *src)
    O(DFXL_DRAWSTRING);
 #undef O
 
-   if (mask == DFXL_NONE) DEBUG("<NONE>");
+   if (mask == DFXL_NONE) DBG("<NONE>");
 #endif /* DFB_DEBUG_ACCELERATION */
 }
 
@@ -299,14 +300,14 @@ _dfb_surface_set_color_from_context(IDirectFBSurface *surface, RGBA_Draw_Context
      goto error;
 
 #ifdef DFB_DEBUG_FLAGS
-   DEBUG("DirectFB DRAW: color=%d %d %d %d, flags=%s",
+   DBG("Color=%d %d %d %d, flags=%s",
          r, g, b, a, _dfb_draw_flags_str(flags));
 #endif /* DFB_DEBUG_FLAGS */
 
    return 1;
 
  error:
-   ERROR("DirectFB: could not set color from context: %s",
+   ERR("Could not set color from context: %s",
           DirectFBErrorString(res));
    return 0;
 }
@@ -353,7 +354,7 @@ _dfb_surface_set_blit_params(DirectFB_Engine_Image_Entry *d, DirectFB_Engine_Ima
      goto error;
 
 #ifdef DFB_DEBUG_FLAGS
-   DEBUG("DirectFB BLIT: sfunc=%s, dfunc=%s, color=%d %d %d %d\n\tblit=%s\n\tdraw=%s",
+   DBG("sfunc=%s, dfunc=%s, color=%d %d %d %d\n\tblit=%s\n\tdraw=%s",
          _dfb_blend_func_str(src_func), _dfb_blend_func_str(dst_func),
          r, g, b, a,
          _dfb_blit_flags_str(blit_flags), _dfb_draw_flags_str(draw_flags));
@@ -362,7 +363,7 @@ _dfb_surface_set_blit_params(DirectFB_Engine_Image_Entry *d, DirectFB_Engine_Ima
    return 1;
 
  error:
-   ERROR("DirectFB: Could not set blit params: %s",
+   ERR("Could not set blit params: %s",
         DirectFBErrorString(res));
    return 0;
 }
@@ -385,7 +386,7 @@ _dfb_lock_and_sync_image(IDirectFBSurface *surface, RGBA_Image *image, DFBSurfac
    if (pitch != (sw * 4))
      {
        /* XXX TODO: support other pixel formats. */
-       ERROR("DirectFB: IDirectFBSurface pitch(%d) is not supported: "
+       ERR("IDirectFBSurface pitch(%d) is not supported: "
                "should be %d.",
                pitch, sw * 4);
        surface->Unlock(surface);
@@ -611,7 +612,7 @@ evas_cache_image_dfb_mem_size_get(Engine_Image_Entry *eie)
    r = deie->surface->GetSize(deie->surface, &w, &h);
    if (r != DFB_OK)
      {
-       ERROR("DirectFB: Could not get surface size: %s",
+       ERR("Could not get surface size: %s",
                DirectFBErrorString(r));
        return size;
      }
@@ -627,10 +628,10 @@ evas_cache_image_dfb_debug(const char *context, Engine_Image_Entry* eie)
 {
    DirectFB_Engine_Image_Entry *eim = (DirectFB_Engine_Image_Entry *)eie;
 
-   DEBUG("*** %s image (%p) ***", context, eim);
+   DBG("*** %s image (%p) ***", context, eim);
    if (eim)
      {
-       DEBUG("* W: %d\n"
+       DBG("* W: %d\n"
                "* H: %d\n"
                "* R: %d\n"
                "* Key: %s\n"
@@ -638,9 +639,9 @@ evas_cache_image_dfb_debug(const char *context, Engine_Image_Entry* eie)
                eie->w, eie->h, eie->references, eie->cache_key, eim->surface);
 
         if (eie->src)
-          DEBUG("* Pixels: %p", ((RGBA_Image*) eie->src)->image.data);
+          DBG("* Pixels: %p", ((RGBA_Image*) eie->src)->image.data);
      }
-   DEBUG("*** ***");
+   DBG("*** ***");
 }
 #endif
 
@@ -671,13 +672,10 @@ static void *
 evas_engine_dfb_info(Evas* e __UNUSED__)
 {
    Evas_Engine_Info_DirectFB *info;
-
    info = calloc(1, sizeof(Evas_Engine_Info_DirectFB));
    if (!info)
      return NULL;
-
    info->magic.magic = rand();
-
    return info;
 }
 
@@ -685,7 +683,6 @@ static void
 evas_engine_dfb_info_free(Evas *e __UNUSED__, void *in)
 {
    Evas_Engine_Info_DirectFB *info = in;
-
    free(info);
 }
 
@@ -697,28 +694,28 @@ _is_dfb_data_ok(IDirectFB *idfb, IDirectFBSurface *surface, int w, int h)
 
    if (!idfb)
      {
-       ERROR("missing IDirectFB");
+       ERR("missing IDirectFB");
        return EINA_FALSE;
      }
    dfb = idfb;
 
    if (!surface)
      {
-       ERROR("missing IDirectFBSurface");
+       ERR("missing IDirectFBSurface");
        return EINA_FALSE;
      }
 
    r = surface->GetSize(surface, &sw, &sh);
    if (r != DFB_OK)
      {
-       ERROR("DirectFB: could not get surface %p size: %s",
+       ERR("Could not get surface %p size: %s",
             surface, DirectFBErrorString(r));
        return EINA_FALSE;
      }
 
    if ((w > sw) || (h > sh))
      {
-       ERROR("DirectFB: requested size is larger than surface: %dx%d > %dx%d",
+       ERR("Requested size is larger than surface: %dx%d > %dx%d",
                w, h, sw, sh);
        return EINA_FALSE;
      }
@@ -760,7 +757,7 @@ evas_engine_dfb_output_reconfigure(Render_Engine *re, int w, int h)
    re->tb = evas_common_tilebuf_new(w, h);
    if (!re->tb)
      {
-       ERROR("DirectFB: could not allocate tile buffer.");
+       ERR("Could not allocate tile buffer.");
        goto failed_tilebuf;
      }
    evas_common_tilebuf_set_tile_size(re->tb, TILESIZE, TILESIZE);
@@ -773,7 +770,7 @@ evas_engine_dfb_output_reconfigure(Render_Engine *re, int w, int h)
      evas_cache_engine_image_engine(re->cache, re->spec->surface);
    if (!re->screen_image)
      {
-       ERROR("DirectFB: RGBA_Image allocation from DFB failed");
+       ERR("RGBA_Image allocation from DFB failed");
        goto failed_image;
      }
    re->screen_image->flags.engine_surface = 1;
@@ -788,7 +785,7 @@ evas_engine_dfb_output_reconfigure(Render_Engine *re, int w, int h)
    re->tb = NULL;
  failed_tilebuf:
    re->screen_image = NULL;
-   ERROR("DirectFB: Evas DirectFB reconfigure failed");
+   ERR("Evas DirectFB reconfigure failed");
    return 0;
 }
 
@@ -814,13 +811,13 @@ _dfb_output_setup(int w, int h, const struct Evas_Engine_DirectFB_Spec *spec)
                                            evas_common_image_cache_get());
    if (!re->cache)
      {
-       ERROR("DirectFB: Evas_Cache_Engine_Image allocation failed!");
+       ERR("Evas_Cache_Engine_Image allocation failed!");
        goto fatal_after_engine;
      }
 
    if (!evas_engine_dfb_output_reconfigure(re, w, h))
      {
-       ERROR("DirectFB: Could not reconfigure evas engine.");
+       ERR("Could not reconfigure evas engine.");
        goto fatal_after_reconfigure;
      }
 
@@ -834,7 +831,7 @@ _dfb_output_setup(int w, int h, const struct Evas_Engine_DirectFB_Spec *spec)
  fatal_after_engine:
    free(re);
  fatal:
-   CRITICAL("DirectFB: unable to continue, abort()!");
+   CRIT("DirectFB: unable to continue, abort()!");
    abort();
    return NULL;
 }
@@ -882,7 +879,7 @@ static void
 evas_engine_dfb_output_resize(void *data, int w, int h)
 {
    if (!evas_engine_dfb_output_reconfigure(data, w, h))
-     ERROR("DirectFB: failed to resize DirectFB evas");
+     ERR("Failed to resize DirectFB evas");
 }
 
 static void
@@ -1026,7 +1023,7 @@ evas_engine_dfb_output_idle_flush(void *data)
    Render_Engine *re = data;
 
    if (re->update_regions_count != 0)
-     ERROR("DirectFB: update_regions_count not 0 as it should be!");
+     ERR("update_regions_count not 0 as it should be!");
 
    free(re->update_regions);
    re->update_regions_count = 0;
@@ -1346,7 +1343,7 @@ evas_engine_dfb_image_data_get(void *data __UNUSED__, void *image, int to_write,
          break;
 
        error:
-         ERROR("DirectFB: could not lock surface %p: %s",
+         ERR("Could not lock surface %p: %s",
                  s, DirectFBErrorString(r));
          *image_data = NULL;
          break;
@@ -1631,6 +1628,12 @@ module_open(Evas_Module *em)
    if (!em) return 0;
    /* get whatever engine module we inherit from */
    if (!_evas_module_engine_inherit(&parent_func, "software_generic")) return 0;
+   _evas_engine_directfb_log_dom = eina_log_domain_register("EvasEngineDirectFB",EVAS_DEFAULT_COLOR);
+   if(_evas_engine_directfb_log_dom < 0)
+     {
+       EINA_LOG_ERR("Impossible to create a log domain for the DirectFb engine.\n");
+       return 0;
+     }
    /* store it for later use */
    func = parent_func;
    /* now to override methods */
@@ -1684,6 +1687,7 @@ module_open(Evas_Module *em)
 static void
 module_close(Evas_Module *em)
 {
+   eina_log_domain_unregister(_evas_engine_directfb_log_dom);
 }
 
 static Evas_Module_Api evas_modapi =
index dff4a1f..a8d8357 100644 (file)
@@ -5,6 +5,33 @@
 #include "evas_private.h"
 #include "Evas_Engine_DirectFB.h"
 
+extern int _evas_engine_directfb_log_dom ;
+
+#ifdef ERR
+# undef ERR
+#endif
+#define ERR(...) EINA_LOG_DOM_ERR(_evas_engine_directfb_log_dom, __VA_ARGS__)
+
+#ifdef DBG
+# undef DBG
+#endif
+#define DBG(...) EINA_LOG_DOM_DBG(_evas_engine_directfb_log_dom, __VA_ARGS__)
+
+#ifdef INF
+# undef INF
+#endif
+#define INF(...) EINA_LOG_DOM_INFO(_evas_engine_directfb_log_dom, __VA_ARGS__)
+
+#ifdef WRN
+# undef WRN
+#endif
+#define WRN(...) EINA_LOG_DOM_WARN(_evas_engine_directfb_log_dom, __VA_ARGS__)
+
+#ifdef CRIT
+# undef CRIT
+#endif
+#define CRIT(...) EINA_LOG_DOM_CRIT(_evas_engine_directfb_log_dom, __VA_ARGS__)
+
 typedef struct _DirectFB_Engine_Image_Entry DirectFB_Engine_Image_Entry;
 struct _DirectFB_Engine_Image_Entry
 {
index 17e5c01..43d1a4a 100644 (file)
@@ -3,6 +3,8 @@
 #include "evas_engine.h"
 #include "Evas_Engine_FB.h"
 
+int _evas_engine_fb_log_dom = -1;
+
 /* function tables - filled in later (func and parent func) */
 static Evas_Func func, pfunc;
 
@@ -76,7 +78,6 @@ static void *
 eng_info(Evas *e)
 {
    Evas_Engine_Info_FB *info;
-
    info = calloc(1, sizeof(Evas_Engine_Info_FB));
    if (!info) return NULL;
    info->magic.magic = rand();
@@ -88,7 +89,6 @@ static void
 eng_info_free(Evas *e __UNUSED__, void *info)
 {
    Evas_Engine_Info_FB *in;
-
    in = (Evas_Engine_Info_FB *)info;
    free(in);
 }
@@ -263,6 +263,12 @@ module_open(Evas_Module *em)
    if (!em) return 0;
    /* get whatever engine module we inherit from */
    if (!_evas_module_engine_inherit(&pfunc, "software_generic")) return 0;
+   _evas_engine_fb_log_dom = eina_log_domain_register("Evas_fb_engine", EVAS_DEFAULT_LOG_COLOR);
+   if (_evas_engine_fb_log_dom < 0) {
+     EINA_LOG_ERR("Impossible to create a log domain for FB engine.\n");
+     return 0;
+   }
+
    /* store it for later use */
    func = pfunc;
    /* now to override methods */
@@ -289,6 +295,7 @@ module_open(Evas_Module *em)
 static void
 module_close(Evas_Module *em)
 {
+  eina_log_dom_unregister(_evas_engine_fb_log_dom);
 }
 
 static Evas_Module_Api evas_modapi =
index d514582..295e91e 100644 (file)
@@ -3,6 +3,32 @@
 
 #include "evas_fb.h"
 
+extern int _evas_engine_fb_log_dom;
+#ifdef ERR
+# undef ERR
+#endif
+#define ERR(...) EINA_LOG_DOM_ERR(_evas_engine_fb_log_dom, __VA_ARGS__)
+
+#ifdef DBG
+# undef DBG
+#endif
+#define DBG(...) EINA_LOG_DOM_DBG(_evas_engine_fb_log_dom, __VA_ARGS__)
+
+#ifdef INF
+# undef INF
+#endif
+#define INF(...) EINA_LOG_DOM_INFO(_evas_engine_fb_log_dom, __VA_ARGS__)
+
+#ifdef WRN
+# undef WRN
+#endif
+#define WRN(...) EINA_LOG_DOM_WARN(_evas_engine_fb_log_dom, __VA_ARGS__)
+
+#ifdef CRIT
+# undef CRIT
+#endif
+#define CRIT(...) EINA_LOG_DOM_CRIT(_evas_engine_fb_log_dom, __VA_ARGS__)
+
 typedef struct _Outbuf                Outbuf;
 
 typedef enum   _Outbuf_Depth          Outbuf_Depth;
index 114cc25..7d2c73a 100644 (file)
@@ -377,10 +377,10 @@ fb_getmode(void)
       bpp = mode->fb_var.bits_per_pixel / 8;
       break;
      default:
-       ERROR("EvasFB: Cannot handle framebuffer of depth %i",
+      ERR("Cannot handle framebuffer of depth %i",
             mode->fb_var.bits_per_pixel);
       fb_cleanup();
-       free(mode);
+      free(mode);
       return NULL;
   }
   mode->depth = depth;
@@ -418,7 +418,7 @@ fb_setvt(int vtno)
   chown(vtname, getuid(), getgid());
   if (access(vtname,R_OK | W_OK) == -1)
     {
-      CRITICAL("EvasFB: access %s: %s",vtname,strerror(errno));
+      CRIT("Access %s: %s",vtname,strerror(errno));
       exit(1);
     }
   open(vtname,O_RDWR);
@@ -463,7 +463,7 @@ fb_init(int vt, int device)
      }
    if (fb == -1)
      {
-       CRITICAL("open %s: %s", dev, strerror(errno));
+       CRIT("open %s: %s", dev, strerror(errno));
        fb_cleanup();
        exit(1);
      }
@@ -527,7 +527,7 @@ fb_postinit(FB_Mode *mode)
 
   if (fb_fix.type != FB_TYPE_PACKED_PIXELS)
     {
-      CRITICAL("can handle only packed pixel frame buffers");
+      CRIT("can handle only packed pixel frame buffers");
       fb_cleanup();
       exit(1);
     }
index e2210e7..ec97910 100644 (file)
@@ -12,7 +12,7 @@ void
 evas_fb_outbuf_fb_free(Outbuf *buf)
 {
    /* FIXME: impliment */
-   WARN("destroying fb info.. not implemented!!!! WARNING. LEAK!");
+   WRN("destroying fb info.. not implemented!!!! WARNING. LEAK!");
    if (buf->priv.back_buf)
      evas_cache_image_drop(&buf->priv.back_buf->cache_entry);
    free(buf);
index 6386e36..3d05c9b 100644 (file)
@@ -1,7 +1,7 @@
 #include "evas_engine.h"
 #include "Evas_Engine_GL_Glew.h"
 
-
+int _evas_engine_GL_GLEW_log_dom = -1;
 /* function tables - filled in later (func and parent func) */
 static Evas_Func func, pfunc;
 
@@ -20,12 +20,8 @@ static void *
 eng_info(Evas *e)
 {
    Evas_Engine_Info_GL_Glew *info;
-
    info = calloc(1, sizeof(Evas_Engine_Info_GL_Glew));
-   if (!info) return NULL;
-
    info->magic.magic = rand();
-
    return info;
    e = NULL;
 }
@@ -34,7 +30,6 @@ static void
 eng_info_free(Evas *e, void *info)
 {
    Evas_Engine_Info_GL_Glew *in;
-
    in = (Evas_Engine_Info_GL_Glew *)info;
    free(in);
 }
@@ -928,6 +923,12 @@ module_open(Evas_Module *em)
    if (!em) return 0;
    /* get whatever engine module we inherit from */
    if (!_evas_module_engine_inherit(&pfunc, "software_generic")) return 0;
+   _evas_engine_GL_GLEW_log_dom = eina_log_domain_register("EvasGLGlew",EVAS_DEFAULT_LOG_COLOR);
+   if(_evas_engine_GL_GLEW_log_dom < 0) 
+     {
+       EINA_LOG_ERR("Impossible to create a log domain for GL (Glew) engine.\n");
+       return 0;
+     }
    /* store it for later use */
    func = pfunc;
    /* now to override methods */
@@ -1006,6 +1007,7 @@ module_open(Evas_Module *em)
 static void
 module_close(Evas_Module *em)
 {
+  eina_log_domain_unregister(_evas_engine_GL_GLEW_log_dom);
 }
 
 static Evas_Module_Api evas_modapi =
index 8df1782..b35c1c5 100644 (file)
@@ -4,7 +4,31 @@
 #include <windows.h>
 
 #include "evas_gl_common.h"
+extern int _evas_engine_GL_glew_log_dom ;
+#ifdef ERR
+# undef ERR
+#endif
+#define ERR(...) EINA_LOG_DOM_ERR(_evas_engine_GL_glew_log_dom, __VA_ARGS__)
 
+#ifdef DBG
+# undef DBG
+#endif
+#define DBG(...) EINA_LOG_DOM_DBG(_evas_engine_GL_glew_log_dom, __VA_ARGS__)
+
+#ifdef INF
+# undef INF
+#endif
+#define INF(...) EINA_LOG_DOM_INFO(_evas_engine_GL_glew_log_dom, __VA_ARGS__)
+
+#ifdef WRN
+# undef WRN
+#endif
+#define WRN(...) EINA_LOG_DOM_WARN(_evas_engine_GL_glew_log_dom, __VA_ARGS__)
+
+#ifdef CRIT
+# undef CRIT
+#endif
+#define CRIT(...) EINA_LOG_DOM_CRIT(_evas_engine_GL_glew_log_dom, __VA_ARGS__)
 
 typedef struct _Evas_GL_Glew_Window Evas_GL_Glew_Window;
 
index 68a67d7..dbaf473 100644 (file)
@@ -44,7 +44,7 @@ evas_glew_init(HWND window, HDC *dc, HGLRC *context)
 
    if (GLEW_VERSION_2_0)
      {
-       INFO("2.0");
+       INF("2.0");
      }
 
    return 1;
index cfbabdc..f508f06 100644 (file)
@@ -9,7 +9,7 @@
 #else
 #endif
 
-
+int _evas_engine_GL_X11_log_dom = -1;
 /* function tables - filled in later (func and parent func) */
 static Evas_Func func, pfunc;
 
@@ -25,9 +25,7 @@ static void *
 eng_info(Evas *e)
 {
    Evas_Engine_Info_GL_X11 *info;
-
    info = calloc(1, sizeof(Evas_Engine_Info_GL_X11));
-   if (!info) return NULL;
    info->magic.magic = rand();
    info->func.best_visual_get = eng_best_visual_get;
    info->func.best_colormap_get = eng_best_colormap_get;
@@ -40,7 +38,7 @@ static void
 eng_info_free(Evas *e __UNUSED__, void *info)
 {
    Evas_Engine_Info_GL_X11 *in;
-
+   eina_log_domain_unregister(_evas_engine_GL_X11_log_dom);
    in = (Evas_Engine_Info_GL_X11 *)info;
    free(in);
 }
@@ -194,7 +192,7 @@ eng_output_redraws_clear(void *data)
 
    re = (Render_Engine *)data;
    re->win->draw.redraw = 0;
-//   INFO("GL: finish update cycle!");
+//   INF("GL: finish update cycle!");
 }
 
 /* at least the nvidia drivers are so abysmal that copying from the backbuffer
@@ -1078,6 +1076,12 @@ module_open(Evas_Module *em)
    if (!em) return 0;
    /* get whatever engine module we inherit from */
    if (!_evas_module_engine_inherit(&pfunc, "software_generic")) return 0;
+   _evas_engine_GL_X11_log_dom = eina_log_domain_register("EvasEngineGLX11", EVAS_DEFAULT_LOG_COLOR);
+   if(_evas_engine_GL_X11_log_dom<0)
+     {
+       EINA_LOG_ERR("Impossible to create a log domain for GL X11 engine.\n");
+       return 0;
+     }
    /* store it for later use */
    func = pfunc;
    /* now to override methods */
@@ -1179,6 +1183,7 @@ module_open(Evas_Module *em)
 static void
 module_close(Evas_Module *em)
 {
+    eina_log_domain_unregister(_evas_engine_GL_X11_log_dom);
 }
 
 static Evas_Module_Api evas_modapi =
index 71ab07a..579a063 100644 (file)
 #include "Evas.h"
 #include "Evas_Engine_GL_X11.h"
 
+extern int _evas_engine_GL_X11_log_dom ;
+#ifdef ERR
+# undef ERR
+#endif
+#define ERR(...) EINA_LOG_DOM_ERR(_evas_engine_GL_X11_log_dom, __VA_ARGS__)
+
+#ifdef DBG
+# undef DBG
+#endif
+#define DBG(...) EINA_LOG_DOM_DBG(_evas_engine_GL_X11_log_dom, __VA_ARGS__)
+
+#ifdef INF
+# undef INF
+#endif
+#define INF(...) EINA_LOG_DOM_INFO(_evas_engine_GL_X11_log_dom, __VA_ARGS__)
+
+#ifdef WRN
+# undef WRN
+#endif
+#define WRN(...) EINA_LOG_DOM_WARN(_evas_engine_GL_X11_log_dom, __VA_ARGS__)
+
+#ifdef CRIT
+# undef CRIT
+#endif
+#define CRIT(...) EINA_LOG_DOM_CRIT(_evas_engine_GL_X11_log_dom, __VA_ARGS__)
+
 typedef struct _Evas_GL_X11_Window Evas_GL_X11_Window;
 
 struct _Evas_GL_X11_Window
index 91c646d..5f522ac 100644 (file)
@@ -8,7 +8,7 @@
 #include "evas_engine.h"
 #include "Evas_Engine_Quartz.h"
 #include "evas_quartz_private.h"
-
+int _evas_engine_quartz_log_dom = -1;
 static Evas_Func func;
 
 typedef struct _Render_Engine Render_Engine;
@@ -40,12 +40,10 @@ static void *
 eng_info(Evas *e)
 {
    Evas_Engine_Info_Quartz *info;
-
+   
    info = calloc(1, sizeof(Evas_Engine_Info_Quartz));
    if (!info) return NULL;
-
    info->magic.magic = rand();
-
    return info;
 }
 
@@ -686,15 +684,15 @@ eng_gradient_draw(void *data, void *context, void *surface, void *gradient, int
    RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
    Evas_Quartz_Gradient *gr = (Evas_Quartz_Gradient *)gradient;
 
-   INFO("#Gradient#");
-   INFO("Fill: %i %i %i %i", gr->grad->fill.x, gr->grad->fill.y, gr->grad->fill.w, gr->grad->fill.h);
-   INFO("Type: %s %s", gr->grad->type.name, gr->grad->type.params);
-   INFO("XYWH: %i %i %i %i", x, y, w, h);
-   INFO("Geom: %p %p", gr->grad->type.geometer, gr->grad->type.geometer->get_fill_func);
-   INFO("Map: len: %d angle: %f direction: %d offset: %f", gr->grad->map.len, gr->grad->map.angle, gr->grad->map.direction, gr->grad->map.offset);
-   INFO("Color: nstops: %d len: %d", gr->grad->color.nstops, gr->grad->color.len);
-   INFO("Alpha: nstops: %d len: %d", gr->grad->alpha.nstops, gr->grad->alpha.len);
-   INFO("");
+   INF("#Gradient#");
+   INF("Fill: %i %i %i %i", gr->grad->fill.x, gr->grad->fill.y, gr->grad->fill.w, gr->grad->fill.h);
+   INF("Type: %s %s", gr->grad->type.name, gr->grad->type.params);
+   INF("XYWH: %i %i %i %i", x, y, w, h);
+   INF("Geom: %p %p", gr->grad->type.geometer, gr->grad->type.geometer->get_fill_func);
+   INF("Map: len: %d angle: %f direction: %d offset: %f", gr->grad->map.len, gr->grad->map.angle, gr->grad->map.direction, gr->grad->map.offset);
+   INF("Color: nstops: %d len: %d", gr->grad->color.nstops, gr->grad->color.len);
+   INF("Alpha: nstops: %d len: %d", gr->grad->alpha.nstops, gr->grad->alpha.len);
+   INF("");
 
    if ((gr->sw != w) || (gr->sh != h))
       gr->changed = 1;
@@ -1416,7 +1414,16 @@ static int
 module_open(Evas_Module *em)
 {
    if (!em) return 0;
+
    if (!_evas_module_engine_inherit(&func, "software_generic")) return 0;
+
+   _evas_engine_quartz_log_dom = eina_log_domain_register("EvasQuartz", EVAS_DEFAULT_LOG_COLOR);
+   if(_evas_engine_quartz_log_dom < 0)
+     {
+       EINA_LOG_ERR("Impossible to create a log domain for the Quartz engine.\n");
+       return 0;
+     }
+
    #define ORD(f) EVAS_API_OVERRIDE(f, &func, eng_)
    ORD(context_anti_alias_get);
    ORD(context_anti_alias_set);
@@ -1514,7 +1521,7 @@ module_open(Evas_Module *em)
 static void
 module_close(Evas_Module *em)
 {
-
+   eina_log_domain_unregister(_evas_engine_quartz_log_dom);
 }
 
 static Evas_Module_Api evas_modapi =
index cb43373..a32e232 100644 (file)
@@ -3,6 +3,33 @@
 
 #include <ApplicationServices/ApplicationServices.h>
 
+/* log domain variable declared in evas_engine.c */
+extern int _evas_engine_quartz_log_dom ;
+#ifdef ERR
+# undef ERR
+#endif
+#define ERR(...) EINA_LOG_DOM_ERR(_evas_engine_quartz_log_dom, __VA_ARGS__)
+
+#ifdef DBG
+# undef DBG
+#endif
+#define DBG(...) EINA_LOG_DOM_DBG(_evas_engine_quartz_log_dom, __VA_ARGS__)
+
+#ifdef INF
+# undef INF
+#endif
+#define INF(...) EINA_LOG_DOM_INFO(_evas_engine_quartz_log_dom, __VA_ARGS__)
+
+#ifdef WRN
+# undef WRN
+#endif
+#define WRN(...) EINA_LOG_DOM_WARN(_evas_engine_quartz_log_dom, __VA_ARGS__)
+
+#ifdef CRIT
+# undef CRIT
+#endif
+#define CRIT(...) EINA_LOG_DOM_CRIT(_evas_engine_quartz_log_dom, __VA_ARGS__)
+
 typedef struct _Evas_Quartz_Context Evas_Quartz_Context;
 
 struct _Evas_Quartz_Context
index 698f960..6f4ecab 100644 (file)
@@ -1,5 +1,4 @@
 #include "evas_common.h"
-#include "evas_private.h"
 #include "evas_common_soft16.h"
 
 /*
@@ -9,9 +8,34 @@
  **
  *****
  */
+int _evas_soft16_log_dom = -1;
+#ifdef ERR
+#undef ERR
+#endif
+#define ERR(...) EINA_LOG_DOM_ERR( _evas_soft16_log_dom, __VA_ARGS__)
+
+#ifdef DBG
+#undef DBG
+#endif
+#define DBG(...) EINA_LOG_DOM_DBG(_evas_soft16_log_dom, __VA_ARGS__)
+
+#ifdef INF
+#undef INF
+#endif
+#define INF(...) EINA_LOG_DOM_INFO(_evas_soft16_log_dom, __VA_ARGS__)
+
+#ifdef WRN
+#undef WRN
+#endif
+#define WRN(...) EINA_LOG_DOM_WARN(_evas_soft16_log_dom, __VA_ARGS__)
+
+#ifdef CRIT
+#undef CRIT
+#endif
+#define CRIT(...) EINA_LOG_DOM_CRIT(_evas_soft16_log_dom, __VA_ARGS__)
 
 #define NOT_IMPLEMENTED()                                               \
-  WARN("NOT_IMPLEMENTED: %s() at %s:%d",                                       \
+  WRN("NOT_IMPLEMENTED: %s() at %s:%d",                                \
            __FUNCTION__, __FILE__, __LINE__)
 
 static void *
@@ -509,7 +533,7 @@ eng_image_new_from_data(void *data __UNUSED__, int w, int h, DATA32 *image_data,
 {
    if ((image_data) && (cspace != EVAS_COLORSPACE_RGB565_A5P))
      {
-       WARN("Unsupported colorspace %d in %s() (%s:%d)",
+       WRN("Unsupported colorspace %d in %s() (%s:%d)",
                cspace, __FUNCTION__, __FILE__, __LINE__);
        return NULL;
      }
@@ -521,7 +545,7 @@ eng_image_new_from_copied_data(void *data __UNUSED__, int w, int h, DATA32 *imag
 {
    if ((image_data) && (cspace != EVAS_COLORSPACE_RGB565_A5P))
      {
-       WARN("Unsupported colorspace %d in %s() (%s:%d)",
+       WRN("Unsupported colorspace %d in %s() (%s:%d)",
                cspace, __FUNCTION__, __FILE__, __LINE__);
        return NULL;
      }
@@ -1002,13 +1026,21 @@ static int
 module_open(Evas_Module *em)
 {
    if (!em) return 0;
+   _evas_soft16_log_dom = eina_log_domain_register("Soft16Engine", EVAS_DEFAULT_LOG_COLOR);
+   if(_evas_soft16_log_dom < 0) 
+     {
+       EINA_LOG_ERR("Impossible to create a log domain for the soft16 Engine.\n");
+       return 0;
+     }
    em->functions = (void *)(&func);
+   
    return 1;
 }
 
 static void
 module_close(Evas_Module *em)
 {
+   eina_log_domain_unregister(_evas_soft16_log_dom);
 }
 
 static Evas_Module_Api evas_modapi =
index 1e9a1b9..6e2abb0 100644 (file)
@@ -4,6 +4,7 @@
 #include "Evas_Engine_Software_16_DDraw.h"
 #include "evas_common_soft16.h"
 
+int _evas_engine_soft16_ddraw_log_dom = -1;
 /* function tables - filled in later (func and parent func) */
 static Evas_Func func, pfunc;
 
@@ -50,7 +51,6 @@ static void *
 eng_info(Evas *e)
 {
    Evas_Engine_Info_Software_16_DDraw *info;
-
    info = calloc(1, sizeof(Evas_Engine_Info_Software_16_DDraw));
    if (!info) return NULL;
    info->magic.magic = rand();
@@ -62,7 +62,6 @@ static void
 eng_info_free(Evas *e, void *info)
 {
    Evas_Engine_Info_Software_16_DDraw *in;
-
    in = (Evas_Engine_Info_Software_16_DDraw *)info;
    free(in);
 }
@@ -575,6 +574,12 @@ module_open(Evas_Module *em)
    if (!em) return 0;
    /* get whatever engine module we inherit from */
    if (!_evas_module_engine_inherit(&pfunc, "software_16")) return 0;
+   _evas_engine_soft16_ddraw_log_dom = eina_log_domain_register("EvasSoft16DDraw",EINA_COLOR_BLUE);
+   if(_evas_engine_soft16_ddraw_log_dom < 0)
+     {
+       EINA_LOG_ERR("Impossible to create a log domain for Soft16_DDraw engine.\n");
+       return 0;
+     }
    /* store it for later use */
    func = pfunc;
    /* now to override methods */
@@ -601,6 +606,7 @@ module_open(Evas_Module *em)
 static void
 module_close(Evas_Module *em)
 {
+  eina_log_domain_unregister(_evas_engine_soft16_ddraw_log_dom);
 }
 
 static Evas_Module_Api evas_modapi =
index 8307ad8..fe85e97 100644 (file)
@@ -1,12 +1,37 @@
 #ifndef __EVAS_ENGINE_H__
 #define __EVAS_ENGINE_H__
 
-
 #include <windows.h>
 #include <ddraw.h>
 
 #include "evas_common_soft16.h"
 
+extern int _evas_engine_soft16_ddraw_log_dom ;
+#ifdef ERR
+# undef ERR
+#endif
+#define ERR(...) EINA_LOG_DOM_ERR(_evas_engine_soft16_ddraw_log_dom, __VA_ARGS__)
+
+#ifdef DBG
+# undef DBG
+#endif
+#define DBG(...) EINA_LOG_DOM_DBG(_evas_engine_soft16_ddraw_log_dom, __VA_ARGS__)
+
+#ifdef INF
+# undef INF
+#endif
+#define INF(...) EINA_LOG_DOM_INFO(_evas_engine_soft16_ddraw_log_dom, __VA_ARGS__)
+
+#ifdef WRN
+# undef WRN
+#endif
+#define WRN(...) EINA_LOG_DOM_WARN(_evas_engine_soft16_ddraw_log_dom, __VA_ARGS__)
+
+#ifdef CRIT
+# undef CRIT
+#endif
+#define CRIT(...) EINA_LOG_DOM_CRIT(_evas_engine_soft16_ddraw_log_dom, __VA_ARGS__)
+
 typedef struct _DDraw_Output_Buffer       DDraw_Output_Buffer;
 
 struct _DDraw_Output_Buffer
index 5ccb789..76e5325 100644 (file)
@@ -7,6 +7,7 @@
 
 #include "evas_common.h"
 #include "evas_engine.h"
+int _evas_engine_soft16_sdl_log_dom = -1;
 
 /* function tables - filled in later (func and parent func) */
 static Evas_Func        func = {};
@@ -65,7 +66,6 @@ static void *
 evas_engine_sdl16_info(Evas *e __UNUSED__)
 {
    Evas_Engine_Info_SDL_16      *info;
-
    info = calloc(1, sizeof(Evas_Engine_Info_SDL_16));
    if (!info) return NULL;
    info->magic.magic = rand();
@@ -76,7 +76,6 @@ static void
 evas_engine_sdl16_info_free(Evas *e __UNUSED__, void *info)
 {
    Evas_Engine_Info_SDL_16 *in;
-
    in = (Evas_Engine_Info_SDL_16 *)info;
    free(in);
 }
@@ -144,7 +143,7 @@ _sdl16_output_setup(int w, int h, int rotation, int fullscreen, int noframe, int
    re->cache = evas_cache_engine_image_init(&_sdl16_cache_engine_image_cb, evas_common_soft16_image_cache_get());
    if (!re->cache)
      {
-        ERROR("Evas_Cache_Engine_Image allocation failed!");
+        ERR("Evas_Cache_Engine_Image allocation failed!");
         free(re);
         return NULL;
      }
@@ -170,7 +169,7 @@ _sdl16_output_setup(int w, int h, int rotation, int fullscreen, int noframe, int
                               | (noframe ? SDL_NOFRAME : 0));
    if (!surface)
      {
-        ERROR("SDL_SetVideoMode [ %i x %i x 16 ] failed", w, h);
+        ERR("SDL_SetVideoMode [ %i x %i x 16 ] failed", w, h);
         evas_cache_engine_image_shutdown(re->cache);
         free(re);
         return NULL;
@@ -182,7 +181,7 @@ _sdl16_output_setup(int w, int h, int rotation, int fullscreen, int noframe, int
    re->soft16_engine_image = (SDL_Engine_Image_Entry *) evas_cache_engine_image_engine(re->cache, surface);
    if (!re->soft16_engine_image)
      {
-        ERROR("Soft16_Image allocation from SDL failed");
+        ERR("Soft16_Image allocation from SDL failed");
         evas_cache_engine_image_shutdown(re->cache);
         free(re);
         return NULL;
@@ -204,7 +203,7 @@ evas_engine_sdl16_setup(Evas *e, void *in)
 
    if (SDL_InitSubSystem(SDL_INIT_VIDEO) < 0)
      {
-        ERROR("SDL_Init failed with %s", SDL_GetError());
+        ERR("SDL_Init failed with %s", SDL_GetError());
         SDL_Quit();
         return 0;
      }
@@ -263,13 +262,13 @@ evas_engine_sdl16_output_resize(void *data, int w, int h)
                               | (re->flags.noframe ? SDL_NOFRAME : 0));
    if (!surface)
      {
-        ERROR("Unable to change the resolution to : %ix%i", w, h);
+        ERR("Unable to change the resolution to : %ix%i", w, h);
         exit(-1);
      }
    re->soft16_engine_image = (SDL_Engine_Image_Entry *) evas_cache_engine_image_engine(re->cache, surface);
    if (!re->soft16_engine_image)
      {
-       ERROR("RGBA_Image allocation from SDL failed");
+       ERR("RGBA_Image allocation from SDL failed");
        exit(-1);
      }
 
@@ -612,12 +611,12 @@ evas_engine_sdl16_image_new_from_copied_data(void *data,
 
    if (cspace != EVAS_COLORSPACE_RGB565_A5P)
      {
-        WARN("Unsupported colorspace %d in %s() (%s:%d)",
+        WRN("Unsupported colorspace %d in %s() (%s:%d)",
                 cspace, __FUNCTION__, __FILE__, __LINE__);
         return NULL;
      }
 
-   WARN("s image_data: %p", image_data);
+   WRN("s image_data: %p", image_data);
 
    return evas_cache_engine_image_copied_data(re->cache,
                                               w, h,
@@ -632,7 +631,7 @@ evas_engine_sdl16_image_new_from_data(void *data, int w, int h, DATA32* image_da
 
    if (cspace != EVAS_COLORSPACE_RGB565_A5P)
      {
-        WARN("Unsupported colorspace %d in %s() (%s:%d)",
+        WRN("Unsupported colorspace %d in %s() (%s:%d)",
                 cspace, __FUNCTION__, __FILE__, __LINE__);
         return NULL;
      }
@@ -1030,6 +1029,13 @@ module_open(Evas_Module *em)
    if (!em) return 0;
    /* get whatever engine module we inherit from */
    if (!_evas_module_engine_inherit(&pfunc, "software_16")) return 0;
+   _evas_engine_soft16_sdl_log_dom = eina_log_domain_register("EvasSoft16SDL",EVAS_DEFAULT_LOG_COLOR);
+   if(_evas_engine_soft16_sdl_log_dom < 0)
+     {
+       EINA_LOG_ERR("Impossible to create a log domain for the Soft16_SDL engine.\n");
+       return 0;
+     }
+
    /* store it for later use */
    func = pfunc;
    /* now to override methods */
@@ -1088,6 +1094,7 @@ module_open(Evas_Module *em)
 static void
 module_close(Evas_Module *em)
 {
+  eina_log_domain_unregister(_evas_engine_soft16_sdl_log_dom);
 }
 
 static Evas_Module_Api evas_modapi =
index 03a1e36..a1b0ee0 100644 (file)
@@ -5,6 +5,31 @@
 #include "evas_private.h"
 #include "evas_common_soft16.h"
 #include "Evas_Engine_SDL_16.h"
+extern int _evas_engine_soft16_sdl_log_dom ;
+#ifdef ERR
+# undef ERR
+#endif
+#define ERR(...) EINA_LOG_DOM_ERR(_evas_engine_soft16_sdl_log_dom, __VA_ARGS__)
+
+#ifdef DBG
+# undef DBG
+#endif
+#define DBG(...) EINA_LOG_DOM_DBG(_evas_engine_soft16_sdl_log_dom, __VA_ARGS__)
+
+#ifdef INF
+# undef INF
+#endif
+#define INF(...) EINA_LOG_DOM_INFO(_evas_engine_soft16_sdl_log_dom, __VA_ARGS__)
+
+#ifdef WRN
+# undef WRN
+#endif
+#define WRN(...) EINA_LOG_DOM_WARN(_evas_engine_soft16_sdl_log_dom, __VA_ARGS__)
+
+#ifdef CRIT
+# undef CRIT
+#endif
+#define CRIT(...) EINA_LOG_DOM_CRIT(_evas_engine_soft16_sdl_log_dom, __VA_ARGS__)
 
 typedef struct _SDL_Engine_Image_Entry SDL_Engine_Image_Entry;
 struct _SDL_Engine_Image_Entry
index 8e78aea..9bca9b5 100644 (file)
@@ -4,6 +4,7 @@
 #include "Evas_Engine_Software_16_WinCE.h"
 #include "evas_common_soft16.h"
 
+int _evas_enigne_soft16_wince_log_dom = -1;
 
 typedef enum
 {
@@ -89,7 +90,6 @@ static void *
 eng_info(Evas *e)
 {
    Evas_Engine_Info_Software_16_WinCE *info;
-
    info = calloc(1, sizeof(Evas_Engine_Info_Software_16_WinCE));
    if (!info) return NULL;
    info->magic.magic = rand();
@@ -103,7 +103,6 @@ static void
 eng_info_free(Evas *e, void *info)
 {
    Evas_Engine_Info_Software_16_WinCE *in;
-
    in = (Evas_Engine_Info_Software_16_WinCE *)info;
    free(in);
 }
@@ -716,6 +715,14 @@ module_open(Evas_Module *em)
    if (!em) return 0;
    /* get whatever engine module we inherit from */
    if (!_evas_module_engine_inherit(&pfunc, "software_16")) return 0;
+   _evas_engine_soft16_wince_log_dom = eina_log_domain_register("EvasSoft16Wince", EVAS_DEFAULT_LOG_COLOR);
+   
+   if(_evas_engine_soft16_wince_log_dom < 0)
+     {
+       EINA_LOG_ERR("Impossible to create a log domain for the Soft16 Wince engine.\n");
+       return NULL;
+     }
+
    /* store it for later use */
    func = pfunc;
    /* now to override methods */
@@ -742,6 +749,8 @@ module_open(Evas_Module *em)
 static void
 module_close(Evas_Module *em)
 {
+  eina_log_domain_unregister(_evas_soft16_wince_log_dom);
+  return NULL;
 }
 
 static Evas_Module_Api evas_modapi =
index a11d512..344e7b9 100644 (file)
@@ -1,13 +1,37 @@
 #ifndef __EVAS_ENGINE_H__
 #define __EVAS_ENGINE_H__
 
-
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #undef WIN32_LEAN_AND_MEAN
-
+#include "evas_common.h"
 #include "evas_common_soft16.h"
 
+extern int _evas_engine_soft16_wince_log_dom;
+#ifdef ERR
+# undef ERR
+#endif
+#define ERR(...) EINA_LOG_DOM_ERR(_evas_engine_soft16_wince_log_dom, __VA_ARGS__)
+
+#ifdef DBG
+# undef DBG
+#endif
+#define DBG(...) EINA_LOG_DOM_DBG(_evas_engine_soft16_wince_log_dom, __VA_ARGS__)
+
+#ifdef INF
+# undef INF
+#endif
+#define INF(...) EINA_LOG_DOM_INFO(_evas_engine_soft16_wince_log_dom, __VA_ARGS__)
+
+#ifdef WRN
+# undef WRN
+#endif
+#define WRN(...) EINA_LOG_DOM_WARN(_evas_engine_soft16_wince_log_dom, __VA_ARGS__)
+
+#ifdef CRIT
+# undef CRIT
+#endif
+#define CRIT(...) EINA_LOG_DOM_CRIT(_evas_engine_soft16_wince_log_dom, __VA_ARGS__)
 
 typedef struct _FB_Output_Buffer FB_Output_Buffer;
 
index 8d7905d..d97231b 100644 (file)
@@ -51,7 +51,7 @@ _evas_software_wince_gxinfo_init(HDC dc, int *width, int *height, void **buffer)
                       (char *) &gxInfo);
    if (result <= 0)
      {
-        fprintf(stderr, "[Engine] [WinCE FB] ExtEscape() with GETGXINFO failed\n");
+        ERR("[Engine] [WinCE FB] ExtEscape() with GETGXINFO failed\n");
         return 0;
      }
 
@@ -79,7 +79,7 @@ evas_software_wince_fb_init(HWND window,
    dc = GetDC (window);
    if (!dc)
      {
-        fprintf(stderr, "[Engine] [WinCE FB] Can not get DC\n");
+        ERR("[Engine] [WinCE FB] Can not get DC\n");
         free(priv);
         return NULL;
      }
@@ -102,9 +102,9 @@ evas_software_wince_fb_init(HWND window,
        if ((priv->width != width) ||
            (priv->height != height))
          {
-            fprintf(stderr, "[Engine] [WinCE FB] Size mismatch\n");
-            fprintf(stderr, "[Engine] [WinCE FB] asked: %dx%d\n", width, height);
-            fprintf(stderr, "[Engine] [WinCE FB] got  : %dx%d\n", priv->width, priv->height);
+            ERR("[Engine] [WinCE FB] Size mismatch\n");
+            ERR("[Engine] [WinCE FB] asked: %dx%d\n", width, height);
+            ERR("[Engine] [WinCE FB] got  : %dx%d\n", priv->width, priv->height);
             ReleaseDC(window, dc);
             free(priv);
             return NULL;
@@ -119,8 +119,8 @@ evas_software_wince_fb_init(HWND window,
        (rfbi.wBPP != 16) ||
        (rfbi.wFormat != 1))
      {
-        fprintf(stderr, "[Engine] [WinCE FB] ExtEscape() with GETRAWFRAMEBUFFER failed\n");
-        fprintf(stderr, "[Engine] [WinCE FB] trying ExtEscape() with GETGXINFO\n");
+        ERR("[Engine] [WinCE FB] ExtEscape() with GETRAWFRAMEBUFFER failed\n");
+        ERR("[Engine] [WinCE FB] trying ExtEscape() with GETGXINFO\n");
         if (!_evas_software_wince_gxinfo_init(dc, &priv->width, &priv->height, &priv->buffer))
           {
              ReleaseDC(window, dc);
@@ -139,9 +139,9 @@ evas_software_wince_fb_init(HWND window,
   if ((priv->width != width) ||
       (priv->height != height))
     {
-       fprintf(stderr, "[Engine] [WinCE FB] Size mismatch\n");
-       fprintf(stderr, "[Engine] [WinCE FB] asked: %dx%d\n", width, height);
-       fprintf(stderr, "[Engine] [WinCE FB] got  : %dx%d\n", priv->width, priv->height);
+       ERR("[Engine] [WinCE FB] Size mismatch\n");
+       ERR("[Engine] [WinCE FB] asked: %dx%d\n", width, height);
+       ERR("[Engine] [WinCE FB] got  : %dx%d\n", priv->width, priv->height);
        ReleaseDC(window, dc);
        free(priv);
        return NULL;
index 0c5b04c..5e46ab1 100644 (file)
@@ -110,7 +110,7 @@ evas_software_wince_gapi_init(HWND window,
         gapi_lib = LoadLibrary(L"gx.dll");
         if (!gapi_lib)
           {
-             fprintf(stderr, "[Engine] [WinCE GAPI] Can not load gx.dll\n");
+             ERR("[Engine] [WinCE GAPI] Can not load gx.dll");
              goto free_priv;
           }
      }
@@ -131,13 +131,13 @@ evas_software_wince_gapi_init(HWND window,
        !suspend ||
        !resume)
      {
-        fprintf(stderr, "[Engine] [WinCE GAPI] Can not find valid symbols\n");
+       ERR("[Engine] [WinCE GAPI] Can not find valid symbols");
         goto free_lib;
      }
 
    if (!display_open(window, GX_FULLSCREEN))
      {
-        fprintf(stderr, "[Engine] [WinCE GAPI] Can not open display\n");
+       ERR("[Engine] [WinCE GAPI] Can not open display");
         goto free_lib;
      }
 
@@ -146,7 +146,7 @@ evas_software_wince_gapi_init(HWND window,
    // verify pixel format
    if(!(prop.ffFormat & kfDirect565) || (prop.cBPP != 16))
      {
-        fprintf(stderr, "[Engine] [WinCE GAPI] display format mismatch\n");
+        ERR("[Engine] [WinCE GAPI] display format mismatch\n");
         goto close_display;
      }
 
@@ -154,7 +154,7 @@ evas_software_wince_gapi_init(HWND window,
    if ((GetSystemMetrics(SM_CXSCREEN) != (int)prop.cxWidth) ||
        (GetSystemMetrics(SM_CYSCREEN) != (int)prop.cyHeight))
      {
-        fprintf(stderr, "[Engine] [WinCE GAPI] display size mismatch\n");
+        ERR("[Engine] [WinCE GAPI] display size mismatch\n");
         goto close_display;
      }
 
@@ -221,7 +221,7 @@ v |         |
         dc = GetDC (window);
         if (!dc)
           {
-             fprintf(stderr, "[Engine] [WinCE GAPI] Can not get device\n");
+             ERR("[Engine] [WinCE GAPI] Can not get device\n");
              goto close_display;
           }
 
@@ -230,7 +230,7 @@ v |         |
                            (char *) &gxInfo);
         if (result <= 0)
           {
-             fprintf(stderr, "[Engine] [WinCE GAPI] ExtEscape failed\n");
+             ERR("[Engine] [WinCE GAPI] ExtEscape failed\n");
              ReleaseDC(window, dc);
              goto close_display;
           }
@@ -249,9 +249,9 @@ v |         |
    if ((priv->width != width) ||
        (priv->height != height))
      {
-        fprintf(stderr, "[Engine] [WinCE GAPI] Size mismatch\n");
-        fprintf(stderr, "[Engine] [WinCE GAPI] asked: %dx%d\n", width, height);
-        fprintf(stderr, "[Engine] [WinCE GAPI] got  : %dx%d\n", priv->width, priv->height);
+        ERR("[Engine] [WinCE GAPI] Size mismatch\n");
+        ERR("[Engine] [WinCE GAPI] asked: %dx%d\n", width, height);
+        ERR("[Engine] [WinCE GAPI] got  : %dx%d\n", priv->width, priv->height);
         goto close_display;
      }
 
index 4de63c1..4d609f2 100644 (file)
@@ -37,7 +37,7 @@ evas_software_wince_gdi_init(HWND window,
    priv->dc = GetDC(window);
    if (!priv->dc)
      {
-        fprintf(stderr, "[Engine] [WinCE GDI] Can not get DC\n");
+        ERR("[Engine] [WinCE GDI] Can not get DC\n");
         free(priv);
         return NULL;
      }
@@ -56,7 +56,7 @@ evas_software_wince_gdi_init(HWND window,
    priv->bitmap_info = (BITMAPINFO_16bpp *)malloc(sizeof(BITMAPINFO_16bpp));
    if (!priv->bitmap_info)
      {
-        fprintf(stderr, "[Engine] [WinCE GDI] Can not allocate bitmap info\n");
+        ERR("[Engine] [WinCE GDI] Can not allocate bitmap info\n");
         ReleaseDC(window, priv->dc);
         free(priv);
         return NULL;
index 76558f9..a412c11 100644 (file)
@@ -4,6 +4,7 @@
 #include "Evas_Engine_Software_16_X11.h"
 #include "evas_common_soft16.h"
 
+int _evas_engine_soft16_x11_log_dom = -1;
 /* function tables - filled in later (func and parent func) */
 static Evas_Func func, pfunc;
 
@@ -47,7 +48,7 @@ static void *
 eng_info(Evas *e)
 {
    Evas_Engine_Info_Software_16_X11 *info;
-
+   
    info = calloc(1, sizeof(Evas_Engine_Info_Software_16_X11));
    if (!info) return NULL;
    info->magic.magic = rand();
@@ -59,7 +60,6 @@ static void
 eng_info_free(Evas *e __UNUSED__, void *info)
 {
    Evas_Engine_Info_Software_16_X11 *in;
-
    in = (Evas_Engine_Info_Software_16_X11 *)info;
    free(in);
 }
@@ -555,6 +555,13 @@ module_open(Evas_Module *em)
    if (!em) return 0;
    /* get whatever engine module we inherit from */
    if (!_evas_module_engine_inherit(&pfunc, "software_16")) return 0;
+   _evas_engine_soft16_x11_log_dom = eina_log_domain_register("EvasSoft16X11", EVAS_DEFAULT_LOG_COLOR);
+   if(_evas_engine_soft16_x11_log_dom < 0) 
+     {
+       EINA_LOG_ERR("Impossible to create a log domain for the Soft16_X11 engine.\n");
+       return 0;
+     }
+
    /* store it for later use */
    func = pfunc;
    /* now to override methods */
@@ -581,6 +588,7 @@ module_open(Evas_Module *em)
 static void
 module_close(Evas_Module *em)
 {
+  eina_log_dom_unregister(_evas_engine_soft16_x11_log_dom);
 }
 
 static Evas_Module_Api evas_modapi =
index 7150126..3aef165 100644 (file)
@@ -7,9 +7,35 @@
 #include <X11/extensions/XShm.h>
 #include <sys/ipc.h>
 #include <sys/shm.h>
-
+#include "evas_common.h"
 #include "evas_common_soft16.h"
 
+extern int _evas_engine_soft16_x11_log_dom;
+#ifdef ERR
+# undef ERR
+#endif
+#define ERR(...) EINA_LOG_DOM_ERR(_evas_engine_soft16_x11_log_dom, __VA_ARGS__)
+
+#ifdef DBG
+# undef DBG
+#endif
+#define DBG(...) EINA_LOG_DOM_DBG(_evas_engine_soft16_x11_log_dom, __VA_ARGS__)
+
+#ifdef INF
+# undef INF
+#endif
+#define INF(...) EINA_LOG_DOM_INFO(_evas_engine_soft16_x11_log_dom, __VA_ARGS__)
+
+#ifdef WRN
+# undef WRN
+#endif
+#define WRN(...) EINA_LOG_DOM_WARN(_evas_engine_soft16_x11_log_dom, __VA_ARGS__)
+
+#ifdef CRIT
+# undef CRIT
+#endif
+#define CRIT(...) EINA_LOG_DOM_CRIT(_evas_engine_soft16_x11_log_dom, __VA_ARGS__)
+
 typedef struct _X_Output_Buffer       X_Output_Buffer;
 
 struct _X_Output_Buffer
index 83fdbb0..29db61b 100644 (file)
@@ -3,6 +3,7 @@
 #include "evas_engine.h"
 #include "Evas_Engine_Software_DDraw.h"
 
+int _evas_engine_soft_ddraw_log_dom = -1;
 /* function tables - filled in later (func and parent func) */
 static Evas_Func func, pfunc;
 
@@ -96,15 +97,6 @@ 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;
 }
@@ -113,10 +105,6 @@ static void
 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);
 }
@@ -338,6 +326,13 @@ module_open(Evas_Module *em)
    if (!em) return 0;
    /* get whatever engine module we inherit from */
    if (!_evas_module_engine_inherit(&pfunc, "software_generic")) return 0;
+   _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;
+     }
    /* store it for later use */
    func = pfunc;
    /* now to override methods */
@@ -364,6 +359,7 @@ module_open(Evas_Module *em)
 static void
 module_close(Evas_Module *em)
 {
+  eina_log_domain_unregister(_evas_log_dom_module);
 }
 
 static Evas_Module_Api evas_modapi =
index b494634..0611e4e 100644 (file)
@@ -3,6 +3,7 @@
 #include "evas_engine.h"
 #include "Evas_Engine_Software_Gdi.h"
 
+int _evas_engine_soft_gdi_log_dom = -1;
 /* function tables - filled in later (func and parent func) */
 static Evas_Func func, pfunc;
 
@@ -96,7 +97,6 @@ static void *
 eng_info(Evas *e __UNUSED__)
 {
    Evas_Engine_Info_Software_Gdi *info;
-
    info = calloc(1, sizeof(Evas_Engine_Info_Software_Gdi));
    if (!info) return NULL;
    info->magic.magic = rand();
@@ -107,7 +107,6 @@ static void
 eng_info_free(Evas *e __UNUSED__, void *info)
 {
    Evas_Engine_Info_Software_Gdi *in;
-
    in = (Evas_Engine_Info_Software_Gdi *)info;
    free(in);
 }
@@ -332,6 +331,13 @@ module_open(Evas_Module *em)
    if (!em) return 0;
    /* get whatever engine module we inherit from */
    if (!_evas_module_engine_inherit(&pfunc, "software_generic")) return 0;
+
+   _evas_engine_soft_gdi_log_dom = eina_log_domain_register("EvasSoftGDI",EVAS_DEFAULT_LOG_COLOR);
+   if(_evas_engine_soft_gdi_log_dom < 0)
+     {
+       EINA_LOG_ERR("Impossible to create a log domain for the Soft_GDI engine.\n");
+       return NULL;
+     }
    /* store it for later use */
    func = pfunc;
    /* now to override methods */
@@ -358,6 +364,7 @@ module_open(Evas_Module *em)
 static void
 module_close(Evas_Module *em)
 {
+  eina_log_domain_unregister(_evas_engine_soft_gdi_log_dom);
 }
 
 static Evas_Module_Api evas_modapi =
index 551c52b..086d1a1 100644 (file)
@@ -6,6 +6,32 @@
 #include <windows.h>
 #undef WIN32_LEAN_AND_MEAN
 
+extern _evas_engine_soft_gdi_log_dom = -1;
+
+#ifdef ERR
+# undef ERR
+#endif
+#define ERR(...) EINA_LOG_DOM_ERR(_evas_engine_soft_gdi_log_dom, __VA_ARGS__)
+
+#ifdef DBG
+# undef DBG
+#endif
+#define DBG(...) EINA_LOG_DOM_DBG(_evas_engine_soft_gdi_log_dom, __VA_ARGS__)
+
+#ifdef INF
+# undef INF
+#endif
+#define INF(...) EINA_LOG_DOM_INFO(_evas_engine_soft_gdi_log_dom, __VA_ARGS__)
+
+#ifdef WRN
+# undef WRN
+#endif
+#define WRN(...) EINA_LOG_DOM_WARN(_evas_engine_soft_gdi_log_dom, __VA_ARGS__)
+
+#ifdef CRIT
+# undef CRIT
+#endif
+#define CRIT(...) EINA_LOG_DOM_CRIT(_evas_engine_soft_gdi_log_dom, __VA_ARGS__)
 
 typedef enum _Outbuf_Depth Outbuf_Depth;
 
index 53126a5..edd7201 100644 (file)
@@ -15,7 +15,7 @@ evas_software_gdi_init (HWND         window,
 
    if (!window)
      {
-        ERROR("[Engine] [GDI] Window is NULL");
+        ERR("[Engine] [GDI] Window is NULL");
         return 0;
      }
 
@@ -24,14 +24,14 @@ evas_software_gdi_init (HWND         window,
    buf->priv.gdi.dc = GetDC(window);
    if (!buf->priv.gdi.dc)
      {
-        ERROR("[Engine] [GDI] Can not get DC");
+        ERR("[Engine] [GDI] Can not get DC");
         return 0;
      }
 
    /* FIXME: check depth */
    if (depth != GetDeviceCaps(buf->priv.gdi.dc, BITSPIXEL))
      {
-        ERROR("[Engine] [GDI] no compatible depth");
+        ERR("[Engine] [GDI] no compatible depth");
         ReleaseDC(window, buf->priv.gdi.dc);
         return 0;
      }
@@ -58,7 +58,7 @@ evas_software_gdi_init (HWND         window,
    buf->priv.gdi.bitmap_info = (BITMAPINFO_GDI *)malloc(sizeof(BITMAPINFO_GDI));
    if (!buf->priv.gdi.bitmap_info)
      {
-        ERROR("[Engine] [GDI] Can not allocate bitmap info");
+        ERR("[Engine] [GDI] Can not allocate bitmap info");
         ReleaseDC(window, buf->priv.gdi.dc);
         return 0;
      }
@@ -88,7 +88,7 @@ evas_software_gdi_init (HWND         window,
          buf->priv.gdi.bitmap_info->masks[2] = 0x000000ff;
          break;
       default:
-        ERROR("[Engine] [GDI] wrong depth");
+        ERR("[Engine] [GDI] wrong depth");
         free(buf->priv.gdi.bitmap_info);
         ReleaseDC(window, buf->priv.gdi.dc);
         return 0;
index dd8d89d..09a2546 100644 (file)
@@ -193,7 +193,7 @@ evas_software_gdi_outbuf_setup(int          width,
 
            if (!conv_func)
              {
-                ERROR(".[ soft_gdi engine Error ]."
+                ERR(".[ soft_gdi engine Error ]."
                       " {"
                       "  At depth         %i:"
                       "  RGB format mask: %08lx, %08lx, %08lx"
index 076c2dd..eded318 100644 (file)
@@ -8,9 +8,8 @@
  **
  *****
  */
-
 static int cpunum = 0;
-
+static int _evas_soft_gen_log_dom = -1;
 static void *
 eng_context_new(void *data __UNUSED__)
 {
@@ -1152,6 +1151,12 @@ static int
 module_open(Evas_Module *em)
 {
    if (!em) return 0;
+   _evas_soft_gen_log_dom = eina_log_domain_register("EvasSoftGeneric", EVAS_DEFAULT_LOG_COLOR);
+   if(_evas_soft_gen_log_dom<0)
+     {
+       EINA_LOG_ERR("Evas SoftGen : Impossible to create a log domain for the software generic engine.\n");
+       return 0;
+     }
    em->functions = (void *)(&func);
    cpunum = eina_cpu_count();
    return 1;
@@ -1160,6 +1165,7 @@ module_open(Evas_Module *em)
 static void
 module_close(Evas_Module *em)
 {
+  eina_log_domain_unregister(_evas_soft_gen_log_dom);
 }
 
 static Evas_Module_Api evas_modapi =
index 7b57ea2..73d9ccb 100644 (file)
@@ -3,6 +3,7 @@
 #include "evas_engine.h"
 #include "Evas_Engine_Software_Qtopia.h"
 
+int _evas_engine_soft_qtopia_log_dom = -1;
 /* function tables - filled in later (func and parent func) */
 static Evas_Func func, pfunc;
 
@@ -86,7 +87,6 @@ static void *
 eng_info(Evas *e)
 {
    Evas_Engine_Info_Software_Qtopia *info;
-
    info = calloc(1, sizeof(Evas_Engine_Info_Software_Qtopia));
    if (!info) return NULL;
    info->magic.magic = rand();
@@ -98,7 +98,6 @@ static void
 eng_info_free(Evas *e, void *info)
 {
    Evas_Engine_Info_Software_Qtopia *in;
-
    in = (Evas_Engine_Info_Software_Qtopia *)info;
    free(in);
 }
@@ -275,6 +274,12 @@ module_open(Evas_Module *em)
    if (!em) return 0;
    /* get whatever engine module we inherit from */
    if (!_evas_module_engine_inherit(&pfunc, "software_generic")) return 0;
+   _evas_engine_soft_qtopia_log_dom = eina_log_domain_register("EvasSoftQtopia",EVAS_DEFAULT_COLOR);
+   if(_evas_engine_soft_qtopia_log_dom < 0)
+     {
+       EINA_LOG_ERR("Impossible to create a log domain for the qtopia engine.\n");
+       return NULL;
+     }
    /* store it for later use */
    func = pfunc;
    /* now to override methods */
@@ -301,6 +306,7 @@ module_open(Evas_Module *em)
 static void
 module_close(Evas_Module *em)
 {
+  eina_log_domain_unregister(_evas_engine_soft_qtopia_log_dom);
 }
 
 static Evas_Module_Api evas_modapi =
index 574d61a..9e65fbe 100644 (file)
@@ -1,6 +1,32 @@
 #ifndef EVAS_ENGINE_H
 #define EVAS_ENGINE_H
 
+extern int _evas_engine_soft_qtopia_log_dom ;
+#ifdef ERR
+# undef ERR
+#endif
+#define ERR(...) EINA_LOG_DOM_ERR(_evas_engine_qtopia_log_dom, __VA_ARGS__)
+
+#ifdef DBG
+# undef DBG
+#endif
+#define DBG(...) EINA_LOG_DOM_DBG(_evas_engine_qtopia_log_dom, __VA_ARGS__)
+
+#ifdef INF
+# undef INF
+#endif
+#define INF(...) EINA_LOG_DOM_INFO(_evas_engine_qtopia_log_dom, __VA_ARGS__)
+
+#ifdef WRN
+# undef WRN
+#endif
+#define WRN(...) EINA_LOG_DOM_WARN(_evas_engine_qtopia_log_dom, __VA_ARGS__)
+
+#ifdef CRIT
+# undef CRIT
+#endif
+#define CRIT(...) EINA_LOG_DOM_CRIT(_evas_engine_qtopia_log_dom, __VA_ARGS__)
+
 typedef struct _Outbuf                Outbuf;
 typedef struct _QT_Direct             QT_Direct;
 typedef struct _QT_Direct_Rect        QT_Direct_Rect;
index 64a80d6..97470ef 100644 (file)
@@ -8,6 +8,7 @@
 #include "evas_common.h"
 #include "evas_engine.h"
 
+int _evas_engine_soft_sdl_log_dom = -1;
 /* #define DEBUG_SDL */
 
 static Evas_Func       func = {};
@@ -67,21 +68,18 @@ static const Evas_Cache_Engine_Image_Func       _sdl_cache_engine_image_cb = {
 static void*
 evas_engine_sdl_info           (Evas* e __UNUSED__)
 {
-   Evas_Engine_Info_SDL*       info = calloc(1, sizeof (Evas_Engine_Info_SDL));
-
-   if (!info)
-      return NULL;
-
+   Evas_Engine_Info_SDL*       info;
+   info = calloc(1, sizeof (Evas_Engine_Info_SDL));
+   if (!info) return NULL;
    info->magic.magic = rand();
-
    return info;
 }
 
 static void
 evas_engine_sdl_info_free      (Evas* e __UNUSED__, void* info)
 {
-   Evas_Engine_Info_SDL*       in = (Evas_Engine_Info_SDL*) info;
-
+   Evas_Engine_Info_SDL*       in;
+   in = (Evas_Engine_Info_SDL*) info;
    free(in);
    in = NULL;
 }
@@ -100,7 +98,7 @@ evas_engine_sdl_setup                (Evas* e, void* in)
 
    if (SDL_InitSubSystem(SDL_INIT_VIDEO) < 0)
      {
-       ERROR("SDL_Init failed with %s", SDL_GetError());
+       ERR("SDL_Init failed with %s", SDL_GetError());
         SDL_Quit();
         return 0;
      }
@@ -171,13 +169,13 @@ evas_engine_sdl_output_resize     (void *data, int w, int h)
 
    if (!surface)
      {
-       ERROR("Unable to change the resolution to : %ix%i", w, h);
+       ERR("Unable to change the resolution to : %ix%i", w, h);
        exit(-1);
      }
    re->rgba_engine_image = (SDL_Engine_Image_Entry *) evas_cache_engine_image_engine(re->cache, surface);
    if (!re->rgba_engine_image)
      {
-       ERROR("RGBA_Image allocation from SDL failed");
+       ERR("RGBA_Image allocation from SDL failed");
        exit(-1);
      }
 
@@ -821,6 +819,12 @@ static int module_open(Evas_Module *em)
    if (!em) return 0;
    /* get whatever engine module we inherit from */
    if (!_evas_module_engine_inherit(&pfunc, "software_generic")) return 0;
+   _evas_engine_soft_sdl_log_dom = eina_log_domain_register("EvasSoftSdl",EVAS_DEFAULT_LOG_COLOR);
+   if(_evas_engine_soft_sdl_log_dom < 0) 
+     {
+       EINA_LOG_ERR("Impossible to create a log domain for the SoftSdl engine.\n");
+       return 0;
+     }
    /* store it for later use */
    func = pfunc;
    /* now to override methods */
@@ -877,7 +881,7 @@ static int module_open(Evas_Module *em)
 
 static void module_close(Evas_Module *em)
 {
-
+  eina_log_domain_unregister(_evas_engine_soft_sdl_log_dom);
 }
 
 static Evas_Module_Api evas_modapi =
@@ -925,7 +929,7 @@ _sdl_output_setup           (int w, int h, int fullscreen, int noframe, int alpha, int hw
    re->cache = evas_cache_engine_image_init(&_sdl_cache_engine_image_cb, evas_common_image_cache_get());
    if (!re->cache)
      {
-        CRITICAL("Evas_Cache_Engine_Image allocation failed!");
+        CRIT("Evas_Cache_Engine_Image allocation failed!");
         exit(-1);
      }
 
@@ -940,7 +944,7 @@ _sdl_output_setup           (int w, int h, int fullscreen, int noframe, int alpha, int hw
 
    if (!surface)
      {
-        CRITICAL("SDL_SetVideoMode [ %i x %i x 32 ] failed.", w, h);
+        CRIT("SDL_SetVideoMode [ %i x %i x 32 ] failed.", w, h);
         exit(-1);
      }
 
@@ -952,7 +956,7 @@ _sdl_output_setup           (int w, int h, int fullscreen, int noframe, int alpha, int hw
    re->rgba_engine_image = (SDL_Engine_Image_Entry *) evas_cache_engine_image_engine(re->cache, surface);
    if (!re->rgba_engine_image)
      {
-       CRITICAL("RGBA_Image allocation from SDL failed");
+       CRIT("RGBA_Image allocation from SDL failed");
         exit(-1);
      }
 
@@ -1137,17 +1141,17 @@ _sdl_image_debug(const char* context, Engine_Image_Entry* eie)
 {
    SDL_Engine_Image_Entry       *eim = (SDL_Engine_Image_Entry *) eie;
 
-   DEBUG("*** %s image (%p) ***", context, eim);
+   DBG("*** %s image (%p) ***", context, eim);
    if (eim)
      {
-        DEBUG ("* W: %i\n* H: %i\n* R: %i", eim->cache_entry.w, eim->cache_entry.h, eim->cache_entry.references);
+        DBG ("* W: %i\n* H: %i\n* R: %i", eim->cache_entry.w, eim->cache_entry.h, eim->cache_entry.references);
         if (eim->cache_entry.src)
-          DEBUG ("* Pixels: %p\n* SDL Surface: %p",((RGBA_Image*) eim->cache_entry.src)->image.data, eim->surface);
+          DBG ("* Pixels: %p\n* SDL Surface: %p",((RGBA_Image*) eim->cache_entry.src)->image.data, eim->surface);
         if (eim->surface)
-          DEBUG ("* Surface->pixels: %p", eim->surface->pixels);
-       DEBUG ("* Key: %s", eim->cache_entry.cache_key);
-        DEBUG ("* Reference: %i", eim->cache_entry.references);
+          DBG ("* Surface->pixels: %p", eim->surface->pixels);
+       DBG ("* Key: %s", eim->cache_entry.cache_key);
+        DBG ("* Reference: %i", eim->cache_entry.references);
      }
-   DEBUG ("*** ***");
+   DBG ("*** ***");
 }
 #endif
index 7ad3261..5133fec 100644 (file)
@@ -5,6 +5,32 @@
 #include "evas_private.h"
 #include "Evas_Engine_SDL.h"
 
+extern int _evas_engine_soft_sdl_log_dom ;
+#ifdef ERR
+# undef ERR
+#endif
+#define ERR(...) EINA_LOG_DOM_ERR(_evas_engine_soft_sdl_log_dom, __VA_ARGS__)
+
+#ifdef DBG
+# undef DBG
+#endif
+#define DBG(...) EINA_LOG_DOM_DBG(_evas_engine_soft_sdl_log_dom, __VA_ARGS__)
+
+#ifdef INF
+# undef INF
+#endif
+#define INF(...) EINA_LOG_DOM_INFO(_evas_engine_soft_sdl_log_dom, __VA_ARGS__)
+
+#ifdef WRN
+# undef WRN
+#endif
+#define WRN(...) EINA_LOG_DOM_WARN(_evas_engine_soft_sdl_log_dom, __VA_ARGS__)
+
+#ifdef CRIT
+# undef CRIT
+#endif
+#define CRIT(...) EINA_LOG_DOM_CRIT(_evas_engine_soft_sdl_log_dom, __VA_ARGS__)
+
 typedef struct _SDL_Engine_Image_Entry SDL_Engine_Image_Entry;
 struct _SDL_Engine_Image_Entry
 {
index 2b42599..a7f44b1 100644 (file)
@@ -15,6 +15,8 @@
 # include "evas_xcb_color.h"
 #endif
 
+int _evas_engine_soft_x11_log_dom = -1;
+int test ;
 /* function tables - filled in later (func and parent func) */
 static Evas_Func func, pfunc;
 
@@ -320,7 +322,6 @@ static void *
 eng_info(Evas *e __UNUSED__)
 {
    Evas_Engine_Info_Software_X11 *info;
-
    info = calloc(1, sizeof(Evas_Engine_Info_Software_X11));
    if (!info) return NULL;
    info->magic.magic = rand();
@@ -337,7 +338,6 @@ static void
 eng_info_free(Evas *e __UNUSED__, void *info)
 {
    Evas_Engine_Info_Software_X11 *in;
-
    in = (Evas_Engine_Info_Software_X11 *)info;
    free(in);
 }
@@ -643,6 +643,12 @@ module_open(Evas_Module *em)
    if (!em) return 0;
    /* get whatever engine module we inherit from */
    if (!_evas_module_engine_inherit(&pfunc, "software_generic")) return 0;
+   _evas_engine_soft_x11_log_dom = eina_log_domain_register("EvasSoftX11", EVAS_DEFAULT_LOG_COLOR);
+   if(_evas_engine_soft_x11_log_dom < 0)
+     {
+       EINA_LOG_ERR("Impossible to create a log domain for the SoftX11 engine.\n");
+       return 0;
+     }
    /* store it for later use */
    func = pfunc;
    /* now to override methods */
@@ -669,6 +675,7 @@ module_open(Evas_Module *em)
 static void
 module_close(Evas_Module *em __UNUSED__)
 {
+  eina_log_domain_unregister(_evas_engine_soft_x11_log_dom);
 }
 
 static Evas_Module_Api evas_modapi =
index 40fa5a8..3a9d581 100644 (file)
 # include <xcb/xcb_image.h>
 #endif
 
+extern int _evas_engine_soft_x11_log_dom;
+#ifdef ERR
+# undef ERR
+#endif
+#define ERR(...) EINA_LOG_DOM_ERR(_evas_engine_soft_x11_log_dom, __VA_ARGS__)
+
+#ifdef DBG
+# undef DBG
+#endif
+#define DBG(...) EINA_LOG_DOM_DBG(_evas_engine_soft_x11_log_dom, __VA_ARGS__)
+
+#ifdef INF
+# undef INF
+#endif
+#define INF(...) EINA_LOG_DOM_INFO(_evas_engine_soft_x11_log_dom, __VA_ARGS__)
+
+#ifdef WRN
+# undef WRN
+#endif
+#define WRN(...) EINA_LOG_DOM_WARN(_evas_engine_soft_x11_log_dom, __VA_ARGS__)
+
+#ifdef CRIT
+# undef CRIT
+#endif
+#define CRIT(...) EINA_LOG_DOM_CRIT(_evas_engine_soft_x11_log_dom, __VA_ARGS__)
 
 typedef enum   _Outbuf_Depth    Outbuf_Depth;
 
index defce80..2065dda 100644 (file)
@@ -355,7 +355,7 @@ evas_software_xcb_outbuf_setup_x(int               w,
           evas_software_xcb_x_output_buffer_free(xcbob, 1);
           if (!conv_func)
             {
-               ERROR("XCB Engine"
+               ERR("XCB Engine"
                       " {"
                       "  At depth         %i:"
                       "  RGB format mask: %08x, %08x, %08x"
index 5d51099..3fd4b07 100644 (file)
@@ -4,7 +4,7 @@
 #include "Evas_Engine_XRender_X11.h"
 
 #include "evas_engine.h"
-
+int _evas_xrender_xcb_log_dom = -1;
 /* function tables - filled in later (func and parent func) */
 static Evas_Func func, pfunc;
 
@@ -350,7 +350,6 @@ static void *
 eng_info(Evas *e __UNUSED__)
 {
    Evas_Engine_Info_XRender_X11 *info;
-
    info = calloc(1, sizeof(Evas_Engine_Info_XRender_X11));
    if (!info) return NULL;
    info->magic.magic = rand();
@@ -361,7 +360,6 @@ static void
 eng_info_free(Evas *e __UNUSED__, void *info)
 {
    Evas_Engine_Info_XRender_X11 *in;
-
    in = (Evas_Engine_Info_XRender_X11 *)info;
    free(in);
 }
@@ -1405,7 +1403,12 @@ module_open(Evas_Module *em)
    if (!em) return 0;
    /* get whatever engine module we inherit from */
    if (!_evas_module_engine_inherit(&pfunc, "software_generic")) return 0;
-   
+   _evas_xrender_xcb_log_dom = eina_log_domain_register("EvasSoftXrender", EVAS_DEFAULT_LOG_COLOR);
+   if(_evas_xrender_xcb_log_dom < 0)
+     {
+       EINA_LOG_ERR("Impossible to create a log domain for the Software Xrender engine.\n");
+       return 0;
+     }
    /* store it for later use */
    func = pfunc;
    /* now to override methods */
@@ -1506,6 +1509,7 @@ module_open(Evas_Module *em)
 static void
 module_close(Evas_Module *em)
 {
+  eina_log_domain_unregister(_evas_xrender_xcb_log_dom);
 }
 
 static Evas_Module_Api evas_modapi =
index d174d2a..b1510cf 100644 (file)
 # include <xcb/xcb_image.h>
 #endif
 
+extern int _evas_xrender_xcb_log_dom ;
+#ifdef ERR
+# undef ERR
+#endif
+#define ERR(...) EINA_LOG_DOM_ERR(_evas_xrender_xcb_log_dom, __VA_ARGS__)
+
+#ifdef DBG
+# undef DBG
+#endif
+#define DBG(...) EINA_LOG_DOM_DBG(_evas_xrender_xcb_log_dom, __VA_ARGS__)
+
+#ifdef INF
+# undef INF
+#endif
+#define INF(...) EINA_LOG_DOM_INFO(_evas_xrender_xcb_log_dom, __VA_ARGS__)
+
+#ifdef WRN
+# undef WRN
+#endif
+#define WRN(...) EINA_LOG_DOM_WARN(_evas_xrender_xcb_log_dom, __VA_ARGS__)
+
+#ifdef CRIT
+# undef CRIT
+#endif
+#define CRIT(...) EINA_LOG_DOM_CRIT(_evas_xrender_xcb_log_dom, __VA_ARGS__)
+
 typedef struct _Ximage_Info      Ximage_Info;
 typedef struct _Ximage_Image     Ximage_Image;
 typedef struct _Xrender_Surface  Xrender_Surface;