#include "ecore_evas_private.h"
#include "Ecore_Evas.h"
+int _ecore_evas_log_dom = -1;
static int _ecore_evas_init_count = 0;
static Ecore_Fd_Handler *_ecore_evas_async_events_fd = NULL;
static int _ecore_evas_async_events_fd_handler(void *data, Ecore_Fd_Handler *fd_handler);
{
int fd;
- evas_init ();
+ evas_init();
ecore_init();
+ _ecore_evas_log_dom = eina_log_domain_register("Ecore_Evas", ECORE_EVAS_DEFAULT_LOG_COLOR);
+ if(_ecore_evas_log_dom < 0)
+ {
+ EINA_LOG_ERR("Impossible to create a log domain for Ecore_Evas.\n");
+ ecore_shutdown();
+ evas_shutdown();
+ return 0;
+ }
fd = evas_async_events_fd_get();
if (fd > 0)
_ecore_evas_async_events_fd = ecore_main_fd_handler_add(fd,
#endif
if (_ecore_evas_async_events_fd)
ecore_main_fd_handler_del(_ecore_evas_async_events_fd);
-
+ eina_log_domain_unregister(_ecore_evas_log_dom);
ecore_shutdown();
evas_shutdown();
}
}
else if ((tim - rlapse) >= 0.5)
{
- printf("FRAME: %i, FPS: %3.1f, RTIME %3.0f%%\n",
+ DBG("FRAME: %i, FPS: %3.1f, RTIME %3.0f%%\n",
frames,
(frames - flapse) / (tim - rlapse),
(100.0 * rtime) / (tim - rlapse)
# include <Evas_Engine_Software_16_WinCE.h>
#endif
+/**
+ Log domain macros and variable
+ **/
+
+extern int _ecore_evas_log_dom;
+
+#ifdef ECORE_EVAS_DEFAULT_LOG_COLOR
+# undef ECORE_EVAS_DEFAULT_LOG_COLOR
+#endif
+#define ECORE_EVAS_DEFAULT_LOG_COLOR EINA_COLOR_CYAN
+#ifdef ERR
+# undef ERR
+#endif
+#define ERR(...) EINA_LOG_DOM_ERR(_ecore_evas_log_dom, __VA_ARGS__)
+#ifdef DBG
+# undef DBG
+#endif
+#define DBG(...) EINA_LOG_DOM_DBG(_ecore_evas_log_dom, __VA_ARGS__)
+#ifdef INF
+# undef INF
+#endif
+#define INF(...) EINA_LOG_DOM_INFO(_ecore_evas_log_dom, __VA_ARGS__)
+#ifdef WRN
+# undef WRN
+#endif
+#define WRN(...) EINA_LOG_DOM_WARN(_ecore_evas_log_dom, __VA_ARGS__)
+#ifdef CRIT
+# undef CRIT
+#endif
+#define CRIT(...) EINA_LOG_DOM_CRIT(_ecore_evas_log_dom, __VA_ARGS__)
+
#define IDLE_FLUSH_TIME 0.5
#ifndef _ECORE_EVAS_H
return NULL;
#else
- fprintf(stderr, "OUTCH name='%s' size=%dx%d!\n", name ? name : "", w, h);
+ ERR("OUTCH name='%s' size=%dx%d!\n", name ? name : "", w, h);
return NULL;
#endif
}
EAPI Ecore_Evas*
ecore_evas_sdl_new(const char* name __UNUSED__, int w __UNUSED__, int h __UNUSED__, int fullscreen __UNUSED__, int hwsurface __UNUSED__, int noframe __UNUSED__, int alpha __UNUSED__)
{
- fprintf(stderr, "OUTCH !\n");
+ ERR("OUTCH !\n");
return NULL;
}
#endif
EAPI Ecore_Evas*
ecore_evas_sdl16_new(const char* name __UNUSED__, int w __UNUSED__, int h __UNUSED__, int fullscreen __UNUSED__, int hwsurface __UNUSED__, int noframe __UNUSED__, int alpha __UNUSED__)
{
- fprintf(stderr, "OUTCH !\n");
+ ERR("OUTCH !\n");
return NULL;
}
#endif
static void
_ecore_evas_obj_intercept_stack_above(void *data __UNUSED__, Evas_Object *obj __UNUSED__, Evas_Object *above __UNUSED__)
{
- fprintf(stderr, "TODO: %s\n", __FUNCTION__);
+ INF("TODO: %s", __FUNCTION__);
}
static void
_ecore_evas_obj_intercept_stack_below(void *data __UNUSED__, Evas_Object *obj __UNUSED__, Evas_Object *below __UNUSED__)
{
- fprintf(stderr, "TODO: %s\n", __FUNCTION__);
+ INF("TODO: %s", __FUNCTION__);
}
static void
name = evas_object_name_get(obj);
type = evas_object_type_get(obj);
- fprintf(stderr,
- "ERROR: %s(): object %p (name=\"%s\", type=\"%s\") evas "
- "is not the same as this Ecore_Evas evas: %p != %p\n",
- function, obj,
- name ? name : "", type ? type : "", e, ee->evas);
+ ERR("ERROR: %s(): object %p (name=\"%s\", type=\"%s\") evas "
+ "is not the same as this Ecore_Evas evas: %p != %p",
+ function, obj,
+ name ? name : "", type ? type : "", e, ee->evas);
fflush(stderr);
if (getenv("ECORE_ERROR_ABORT")) abort();
CHECK_PARAM_POINTER_RETURN("obj", obj, 0);
old_ee = _evas_object_associate_get(obj);
if (ee != old_ee) {
- fprintf(stderr, "ERROR: trying to dissociate object that is not using "
- "this Ecore_Evas: %p != %p\n", ee, old_ee);
+ ERR("ERROR: trying to dissociate object that is not using "
+ "this Ecore_Evas: %p != %p", ee, old_ee);
return 0;
}
old_obj = _ecore_evas_associate_get(ee);
if (old_obj != obj) {
- fprintf(stderr, "ERROR: trying to dissociate object that is not being "
- "used by this Ecore_Evas: %p != %p\n", old_obj, obj);
+ ERR("ERROR: trying to dissociate object that is not being "
+ "used by this Ecore_Evas: %p != %p", old_obj, obj);
return 0;
}
#ifdef BUILD_ECORE_EVAS_WIN32
-/* logging messages macros */
-int _ecore_evas_log_dom = -1;
-
-#define ECORE_EVAS_MSG_ERR(...) EINA_LOG_DOM_ERR(_ecore_evas_log_dom , __VA_ARGS__)
-#define ECORE_EVAS_MSG_DBG(...) EINA_LOG_DOM_DBG(_ecore_evas_log_dom , __VA_ARGS__)
-#define ECORE_EVAS_MSG_INFO(...) EINA_LOG_DOM_INFO(_ecore_evas_log_dom , __VA_ARGS__)
-
#define ECORE_EVAS_EVENT_COUNT 8
static int _ecore_evas_init_count = 0;
Ecore_Evas *ee;
Ecore_Win32_Event_Mouse_In *e;
- ECORE_EVAS_MSG_INFO("mouse in");
+ INF("mouse in");
e = event;
ee = ecore_event_window_match((Ecore_Window)e->window);
Ecore_Evas *ee;
Ecore_Win32_Event_Mouse_Out *e;
- ECORE_EVAS_MSG_INFO("mouse out");
+ INF("mouse out");
e = event;
ee = ecore_event_window_match((Ecore_Window)e->window);
Ecore_Evas *ee;
Ecore_Win32_Event_Window_Damage *e;
- ECORE_EVAS_MSG_INFO("window damage");
+ INF("window damage");
e = event;
ee = ecore_event_window_match((Ecore_Window)e->window);
Ecore_Evas *ee;
Ecore_Win32_Event_Window_Destroy *e;
- ECORE_EVAS_MSG_INFO("window destroy");
+ INF("window destroy");
e = event;
ee = ecore_event_window_match((Ecore_Window)e->window);
Ecore_Evas *ee;
Ecore_Win32_Event_Window_Show *e;
- ECORE_EVAS_MSG_INFO("window show");
+ INF("window show");
e = event;
ee = ecore_event_window_match((Ecore_Window)e->window);
Ecore_Evas *ee;
Ecore_Win32_Event_Window_Hide *e;
- ECORE_EVAS_MSG_INFO("window hide");
+ INF("window hide");
e = event;
ee = ecore_event_window_match((Ecore_Window)e->window);
Ecore_Evas *ee;
Ecore_Win32_Event_Window_Configure *e;
- ECORE_EVAS_MSG_INFO("window configure");
+ INF("window configure");
e = event;
ee = ecore_event_window_match((Ecore_Window)e->window);
Ecore_Evas *ee;
Ecore_Win32_Event_Window_Delete_Request *e;
- ECORE_EVAS_MSG_INFO("window delete request");
+ INF("window delete request");
e = event;
ee = ecore_event_window_match((Ecore_Window)e->window);
if ((Ecore_Window)e->window != ee->prop.window) return 1;
if (ee->func.fn_delete_request) ee->func.fn_delete_request(ee);
- printf (" * ee event delete\n");
+ INF(" * ee event delete\n");
return 1;
}
static void
_ecore_evas_win32_free(Ecore_Evas *ee)
{
- ECORE_EVAS_MSG_INFO("ecore evas free");
+ INF("ecore evas free");
ecore_win32_window_free((struct _Ecore_Win32_Window *)ee->prop.window);
ecore_event_window_unregister(ee->prop.window);
static void
_ecore_evas_win32_move(Ecore_Evas *ee, int x, int y)
{
- ECORE_EVAS_MSG_INFO("ecore evas move (%dx%d)", x, y);
+ INF("ecore evas move (%dx%d)", x, y);
if ((x != ee->x) || (y != ee->y))
{
static void
_ecore_evas_win32_resize(Ecore_Evas *ee, int width, int height)
{
- ECORE_EVAS_MSG_INFO("ecore evas resize (%dx%d)", width, height);
+ INF("ecore evas resize (%dx%d)", width, height);
if ((ee->w != width) || (ee->h != height))
{
static void
_ecore_evas_win32_move_resize(Ecore_Evas *ee, int x, int y, int width, int height)
{
- ECORE_EVAS_MSG_INFO("ecore evas resize (%dx%d %dx%d)", x, y, width, height);
+ INF("ecore evas resize (%dx%d %dx%d)", x, y, width, height);
if ((ee->w != width) || (ee->h != height) || (x != ee->x) || (y != ee->y))
{
static void
_ecore_evas_win32_rotation_set(Ecore_Evas *ee, int rotation)
{
- ECORE_EVAS_MSG_INFO("ecore evas rotation: %s", rotation ? "yes" : "no");
+ INF("ecore evas rotation: %s", rotation ? "yes" : "no");
if (ee->rotation == rotation) return;
static void
_ecore_evas_win32_show(Ecore_Evas *ee)
{
- ECORE_EVAS_MSG_INFO("ecore evas show");
+ INF("ecore evas show");
ee->should_be_visible = 1;
if (ee->prop.avoid_damage)
static void
_ecore_evas_win32_hide(Ecore_Evas *ee)
{
- ECORE_EVAS_MSG_INFO("ecore evas hide");
+ INF("ecore evas hide");
ecore_win32_window_hide((struct _Ecore_Win32_Window *)ee->prop.window);
ee->should_be_visible = 0;
static void
_ecore_evas_win32_raise(Ecore_Evas *ee)
{
- ECORE_EVAS_MSG_INFO("ecore evas raise");
+ INF("ecore evas raise");
if (!ee->prop.fullscreen)
ecore_win32_window_raise((struct _Ecore_Win32_Window *)ee->prop.window);
static void
_ecore_evas_win32_lower(Ecore_Evas *ee)
{
- ECORE_EVAS_MSG_INFO("ecore evas lower");
+ INF("ecore evas lower");
if (!ee->prop.fullscreen)
ecore_win32_window_lower((struct _Ecore_Win32_Window *)ee->prop.window);
static void
_ecore_evas_win32_activate(Ecore_Evas *ee)
{
- ECORE_EVAS_MSG_INFO("ecore evas activate");
+ INF("ecore evas activate");
ecore_win32_window_focus_set((struct _Ecore_Win32_Window *)ee->prop.window);
}
static void
_ecore_evas_win32_title_set(Ecore_Evas *ee, const char *title)
{
- ECORE_EVAS_MSG_INFO("ecore evas title set");
+ INF("ecore evas title set");
if (ee->prop.title) free(ee->prop.title);
ee->prop.title = NULL;
{
struct _Ecore_Win32_Window *window;
- ECORE_EVAS_MSG_INFO("ecore evas fullscreen set");
+ INF("ecore evas fullscreen set");
if ((ee->engine.win32.state.fullscreen && on) ||
(!ee->engine.win32.state.fullscreen && !on))
#ifdef BUILD_ECORE_EVAS_SOFTWARE_16_WINCE
-/* logging messages macros */
-int _ecore_evas_log_dom = -1;
-
-#define ECORE_EVAS_MSG_ERR(...) EINA_LOG_DOM_ERR(_ecore_evas_log_dom , __VA_ARGS__)
-#define ECORE_EVAS_MSG_DBG(...) EINA_LOG_DOM_DBG(_ecore_evas_log_dom , __VA_ARGS__)
-#define ECORE_EVAS_MSG_INFO(...) EINA_LOG_DOM_INFO(_ecore_evas_log_dom , __VA_ARGS__)
-
#define ECORE_EVAS_EVENT_COUNT 7
static int _ecore_evas_init_count = 0;
Ecore_Evas *ee;
Ecore_WinCE_Event_Mouse_In *e;
- ECORE_EVAS_MSG_INFO("mouse in\n");
+ INF("mouse in");
e = event;
ee = ecore_event_window_match((Ecore_Window)e->window);
Ecore_Evas *ee;
Ecore_WinCE_Event_Mouse_Out *e;
- ECORE_EVAS_MSG_INFO("mouse out\n");
+ INF("mouse out");
e = event;
ee = ecore_event_window_match((Ecore_Window)e->window);
Ecore_Evas *ee;
Ecore_WinCE_Event_Window_Damage *e;
- ECORE_EVAS_MSG_INFO("window damage\n");
+ INF("window damage");
e = event;
ee = ecore_event_window_match((Ecore_Window)e->window);
Ecore_Evas *ee;
Ecore_WinCE_Event_Window_Destroy *e;
- ECORE_EVAS_MSG_INFO("window destroy\n");
+ INF("window destroy");
e = event;
ee = ecore_event_window_match((Ecore_Window)e->window);
Ecore_Evas *ee;
Ecore_WinCE_Event_Window_Show *e;
- ECORE_EVAS_MSG_INFO("window show\n");
+ INF("window show");
e = event;
ee = ecore_event_window_match((Ecore_Window)e->window);
Ecore_Evas *ee;
Ecore_WinCE_Event_Window_Hide *e;
- ECORE_EVAS_MSG_INFO("window hide\n");
+ INF("window hide");
e = event;
ee = ecore_event_window_match((Ecore_Window)e->window);
Ecore_Evas *ee;
Ecore_WinCE_Event_Window_Delete_Request *e;
- ECORE_EVAS_MSG_INFO("window delete request\n");
+ INF("window delete request");
e = event;
ee = ecore_event_window_match((Ecore_Window)e->window);
static void
_ecore_evas_wince_free(Ecore_Evas *ee)
{
- ECORE_EVAS_MSG_INFO("ecore evas free\n");
+ INF("ecore evas free");
ecore_wince_window_free((Ecore_WinCE_Window *)ee->prop.window);
ecore_event_window_unregister(ee->prop.window);
static void
_ecore_evas_wince_move(Ecore_Evas *ee, int x, int y)
{
- ECORE_EVAS_MSG_INFO("ecore evas move (%dx%d)\n", x, y);
+ INF("ecore evas move (%dx%d)", x, y);
if ((x != ee->x) || (y != ee->y))
{
static void
_ecore_evas_wince_resize(Ecore_Evas *ee, int width, int height)
{
- ECORE_EVAS_MSG_INFO("ecore evas resize (%dx%d)\n", width, height);
+ INF("ecore evas resize (%dx%d)", width, height);
if ((ee->w != width) || (ee->h != height))
{
static void
_ecore_evas_wince_move_resize(Ecore_Evas *ee, int x, int y, int width, int height)
{
- ECORE_EVAS_MSG_INFO("ecore evas resize (%dx%d %dx%d)\n", x, y, width, height);
+ INF("ecore evas resize (%dx%d %dx%d)", x, y, width, height);
if ((ee->w != width) || (ee->h != height) || (x != ee->x) || (y != ee->y))
{
static void
_ecore_evas_wince_show(Ecore_Evas *ee)
{
- ECORE_EVAS_MSG_INFO("ecore evas show\n");
+ INF("ecore evas show");
ee->should_be_visible = 1;
if (ee->prop.avoid_damage)
static void
_ecore_evas_wince_hide(Ecore_Evas *ee)
{
- ECORE_EVAS_MSG_INFO("ecore evas hide\n");
+ INF("ecore evas hide");
ecore_wince_window_hide((Ecore_WinCE_Window *)ee->prop.window);
ee->should_be_visible = 0;
static void
_ecore_evas_wince_title_set(Ecore_Evas *ee, const char *title)
{
- ECORE_EVAS_MSG_INFO("ecore evas title set\n");
+ INF("ecore evas title set");
if (ee->prop.title) free(ee->prop.title);
ee->prop.title = NULL;
Evas_Engine_Info_Software_16_WinCE *einfo;
struct _Ecore_WinCE_Window *window;
- ECORE_EVAS_MSG_INFO("ecore evas fullscreen set\n");
+ INF("ecore evas fullscreen set");
if ((ee->engine.wince.state.fullscreen && on) ||
(!ee->engine.wince.state.fullscreen && !on))