static int old_flags;
+static int _ecore_cocoa_log_domain = -1;
+
EAPI int
ecore_cocoa_init(void)
{
if (!ecore_event_init())
return --_ecore_cocoa_init_count;
+ _ecore_cocoa_log_domain = eina_log_domain_register("ecore_cocoa", ECORE_DEFAULT_LOG_COLOR);
+ if(_ecore_cocoa_log_domain < 0)
+ {
+ EINA_LOG_ERR("Unable to create a log domain for ecore_cocoa.");
+ return 0;
+ }
+
ECORE_COCOA_EVENT_GOT_FOCUS = ecore_event_type_new();
ECORE_COCOA_EVENT_LOST_FOCUS = ecore_event_type_new();
ECORE_COCOA_EVENT_RESIZE = ecore_event_type_new();
if (--_ecore_cocoa_init_count != 0)
return _ecore_cocoa_init_count;
+ eina_log_domain_unregister(_ecore_cocoa_log_domain);
ecore_event_shutdown();
return _ecore_cocoa_init_count;
if(mod & NSCommandKeyMask) modifiers |= ECORE_EVENT_MODIFIER_WIN;
if(mod & NSNumericPadKeyMask) modifiers |= ECORE_EVENT_LOCK_NUM;
- printf("key modifiers: %d, %d\n", mod, modifiers);
+ DBG("key modifiers: %d, %d\n", mod, modifiers);
return modifiers;
}
{
if (keystable[i].code == [keychar characterAtIndex:0])
{
- printf("Key pressed : %s\n", keystable[i].name);
+ DBG("Key pressed : %s\n", keystable[i].name);
ev->keyname = keystable[i].name;
ev->key = keystable[i].name;
ev->string = keystable[i].compose;
EcoreCocoaWindow *window = (EcoreCocoaWindow *)[event window];
NSString *keychar = [event characters];
- printf("Key Up\n");
+ DBG("Key Up\n");
ev = calloc(1, sizeof (Ecore_Event_Key));
if (!ev) return pass;
}
case NSScrollWheel:
{
- printf("Scroll Wheel\n");
+ DBG("Scroll Wheel\n");
break;
}
default:
#ifndef _ECORE_COCOA_PRIVATE_H
#define _ECORE_COCOA_PRIVATE_H
+#include "ecore_cocoa_window.h"
+
+extern int _ecore_cocoa_log_domain;
+
+#ifdef ERR
+# undef ERR
+#endif
+#define ERR(...) EINA_LOG_DOM_ERR(_ecore_cocoa_log_domain, __VA_ARGS__)
+
+#ifdef DBG
+# undef DBG
+#endif
+#define DBG(...) EINA_LOG_DOM_DBG(_ecore_cocoa_log_domain, __VA_ARGS__)
+
+#ifdef INF
+# undef INF
+#endif
+#define INF(...) EINA_LOG_DOM_INFO(_ecore_cocoa_log_domain, __VA_ARGS__)
+
+#ifdef WRN
+# undef WRN
+#endif
+#define WRN(...) EINA_LOG_DOM_WARN(_ecore_cocoa_log_domain, __VA_ARGS__)
+
+#ifdef CRI
+# undef CRI
+#endif
+#define CRI(...) EINA_LOG_DOM_CRIT(_ecore_cocoa_log_domain, __VA_ARGS__)
+
+
struct _Ecore_Cocoa_Window
{
EcoreCocoaWindow *window;
\r
#include <Ecore.h>\r
#include <Ecore_Cocoa.h>\r
+#include "ecore_cocoa_private.h"\r
#import "ecore_cocoa_window.h"\r
\r
@implementation EcoreCocoaWindow\r
event = malloc(sizeof(Ecore_Cocoa_Event_Video_Resize));\r
if (event == NULL)\r
{\r
- // FIXME Use Eina_Log\r
- printf("Failed to allocate Ecore_Cocoa_Event_Video_Resize\n");\r
+ DBG("Failed to allocate Ecore_Cocoa_Event_Video_Resize\n");\r
return;\r
}\r
event->w = size.width;\r
e = malloc(sizeof(Ecore_Cocoa_Event_Window));\r
if (!e)\r
{\r
- printf("GOT_FOCUS: Failed to allocate Ecore_Cocoa_Event_Window\n");\r
+ DBG("GOT_FOCUS: Failed to allocate Ecore_Cocoa_Event_Window\n");\r
return;\r
}\r
e->wid = [notification object];\r
e = malloc(sizeof(Ecore_Cocoa_Event_Window));\r
if (!e)\r
{\r
- printf("LOST_FOCUS: Failed to allocate Ecore_Cocoa_Event_Window\n");\r
+ DBG("LOST_FOCUS: Failed to allocate Ecore_Cocoa_Event_Window\n");\r
return;\r
}\r
e->wid = [notification object];\r
{\r
if (!window || [window->window isVisible])\r
{\r
- printf("Window(%p) is not visible\n", window->window);\r
+ DBG("Window(%p) is not visible\n", window->window);\r
return;\r
}\r
\r
{\r
if (!window)\r
return 0;\r
+\r
+ DBG("Return : %p", window->window);\r
+\r
return window->window;\r
}\r