summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean Guyomarc'h <jean@guyomarch.bzh>2017-03-09 22:58:50 +0100
committerJean Guyomarc'h <jean@guyomarch.bzh>2017-03-09 23:16:16 +0100
commitc1604cdac8c474bb5f8266886046db26ca80f37d (patch)
tree5a1589b2d498a87d855ee9a7755f831bfed14160
parentfd7f878320caedf822ad12b2128b4570b8890051 (diff)
ecore_evas_cocoa: better debugging log
-rw-r--r--src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c47
1 files changed, 22 insertions, 25 deletions
diff --git a/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c b/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c
index 7880442ca0..31559540d2 100644
--- a/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c
+++ b/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c
@@ -104,8 +104,8 @@ _ecore_evas_resize_common(Ecore_Evas *ee,
104 int h, 104 int h,
105 Eina_Bool resize_cocoa) 105 Eina_Bool resize_cocoa)
106{ 106{
107 DBG("Ecore_Evas Resize %i %i, was %i %i (resize_cocoa: %s)", 107 DBG("%p (old: %i %i, new: %i %i, resize_cocoa: %s)",
108 w, h, ee->w, ee->h, resize_cocoa ? "yes" : "no"); 108 ee, ee->w, ee->h, w, h, resize_cocoa ? "yes" : "no");
109 109
110 ee->req.w = w; 110 ee->req.w = w;
111 ee->req.h = h; 111 ee->req.h = h;
@@ -138,14 +138,13 @@ _ecore_evas_cocoa_event_window_resize(void *data EINA_UNUSED, int type EINA_UNUS
138 Ecore_Cocoa_Event_Window_Resize_Request *e = event; 138 Ecore_Cocoa_Event_Window_Resize_Request *e = event;
139 Ecore_Evas *ee; 139 Ecore_Evas *ee;
140 140
141 DBG("");
142
143 ee = _ecore_evas_cocoa_match(e->cocoa_window); 141 ee = _ecore_evas_cocoa_match(e->cocoa_window);
144 if (EINA_UNLIKELY(!ee)) 142 if (EINA_UNLIKELY(!ee))
145 { 143 {
146 ERR("Unregistered Ecore_Evas for Cocoa window %p", e->cocoa_window); 144 ERR("Unregistered Ecore_Evas for Cocoa window %p", e->cocoa_window);
147 return ECORE_CALLBACK_PASS_ON; 145 return ECORE_CALLBACK_PASS_ON;
148 } 146 }
147 DBG("%p", ee);
149 148
150 /* Do the resize */ 149 /* Do the resize */
151 _ecore_evas_resize_common(ee, e->w, e->h, EINA_FALSE); 150 _ecore_evas_resize_common(ee, e->w, e->h, EINA_FALSE);
@@ -159,17 +158,13 @@ _ecore_evas_cocoa_event_window_destroy(void *data EINA_UNUSED, int type EINA_UNU
159 Ecore_Cocoa_Event_Window_Destroy *e = event; 158 Ecore_Cocoa_Event_Window_Destroy *e = event;
160 Ecore_Evas *ee; 159 Ecore_Evas *ee;
161 160
162 DBG("");
163
164 if (!e->cocoa_window)
165 return ECORE_CALLBACK_PASS_ON;
166
167 ee = _ecore_evas_cocoa_match(e->cocoa_window); 161 ee = _ecore_evas_cocoa_match(e->cocoa_window);
168 if (!ee) 162 if (!ee)
169 { 163 {
170 ERR("Unregistered Ecore_Evas for Cocoa window %p", e->cocoa_window); 164 ERR("Unregistered Ecore_Evas for Cocoa window %p", e->cocoa_window);
171 return ECORE_CALLBACK_PASS_ON; 165 return ECORE_CALLBACK_PASS_ON;
172 } 166 }
167 DBG("%p", ee);
173 168
174 if (ee->func.fn_delete_request) ee->func.fn_delete_request(ee); 169 if (ee->func.fn_delete_request) ee->func.fn_delete_request(ee);
175 170
@@ -179,7 +174,8 @@ _ecore_evas_cocoa_event_window_destroy(void *data EINA_UNUSED, int type EINA_UNU
179static int 174static int
180_ecore_evas_cocoa_init(void) 175_ecore_evas_cocoa_init(void)
181{ 176{
182 DBG(""); 177 DBG("%i", _ecore_evas_init_count);
178
183 _ecore_evas_init_count++; 179 _ecore_evas_init_count++;
184 if (_ecore_evas_init_count > 1) 180 if (_ecore_evas_init_count > 1)
185 return _ecore_evas_init_count; 181 return _ecore_evas_init_count;
@@ -205,7 +201,7 @@ _ecore_evas_cocoa_init(void)
205static int 201static int
206_ecore_evas_cocoa_shutdown(void) 202_ecore_evas_cocoa_shutdown(void)
207{ 203{
208 DBG(""); 204 DBG("%i", _ecore_evas_init_count);
209 _ecore_evas_init_count--; 205 _ecore_evas_init_count--;
210 if (_ecore_evas_init_count == 0) 206 if (_ecore_evas_init_count == 0)
211 { 207 {
@@ -222,7 +218,7 @@ _ecore_evas_cocoa_shutdown(void)
222static void 218static void
223_ecore_evas_cocoa_free(Ecore_Evas *ee) 219_ecore_evas_cocoa_free(Ecore_Evas *ee)
224{ 220{
225 DBG(""); 221 DBG("%p", ee);
226 222
227 ecore_cocoa_window_free((Ecore_Cocoa_Window *)ee->prop.window); 223 ecore_cocoa_window_free((Ecore_Cocoa_Window *)ee->prop.window);
228 ecore_event_window_unregister(ee->prop.window); 224 ecore_event_window_unregister(ee->prop.window);
@@ -257,21 +253,21 @@ _ecore_evas_size_step_set(Ecore_Evas *ee, int w, int h)
257static void 253static void
258_ecore_evas_move(Ecore_Evas *ee, int x, int y) 254_ecore_evas_move(Ecore_Evas *ee, int x, int y)
259{ 255{
260 DBG(""); 256 DBG("%p", ee);
261 ecore_cocoa_window_move((Ecore_Cocoa_Window *)ee->prop.window, x, y); 257 ecore_cocoa_window_move((Ecore_Cocoa_Window *)ee->prop.window, x, y);
262} 258}
263 259
264static void 260static void
265_ecore_evas_resize(Ecore_Evas *ee, int w, int h) 261_ecore_evas_resize(Ecore_Evas *ee, int w, int h)
266{ 262{
267 DBG(""); 263 DBG("%p", ee);
268 _ecore_evas_resize_common(ee, w, h, EINA_TRUE); 264 _ecore_evas_resize_common(ee, w, h, EINA_TRUE);
269} 265}
270 266
271static void 267static void
272_ecore_evas_move_resize(Ecore_Evas *ee, int x, int y, int w, int h) 268_ecore_evas_move_resize(Ecore_Evas *ee, int x, int y, int w, int h)
273{ 269{
274 DBG(""); 270 DBG("%p", ee);
275 if ((ee->w == w) && (ee->h == h) && (x == ee->x) && (y == ee->y)) 271 if ((ee->w == w) && (ee->h == h) && (x == ee->x) && (y == ee->y))
276 return; 272 return;
277 273
@@ -297,7 +293,7 @@ _ecore_evas_move_resize(Ecore_Evas *ee, int x, int y, int w, int h)
297static void 293static void
298_ecore_evas_show(Ecore_Evas *ee) 294_ecore_evas_show(Ecore_Evas *ee)
299{ 295{
300 DBG(""); 296 DBG("%p", ee);
301 297
302 ecore_cocoa_window_show((Ecore_Cocoa_Window *)ee->prop.window); 298 ecore_cocoa_window_show((Ecore_Cocoa_Window *)ee->prop.window);
303 evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h); 299 evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
@@ -316,7 +312,7 @@ _ecore_evas_show(Ecore_Evas *ee)
316static void 312static void
317_ecore_evas_hide(Ecore_Evas *ee) 313_ecore_evas_hide(Ecore_Evas *ee)
318{ 314{
319 DBG(""); 315 DBG("%p", ee);
320 316
321 ecore_cocoa_window_hide((Ecore_Cocoa_Window *)ee->prop.window); 317 ecore_cocoa_window_hide((Ecore_Cocoa_Window *)ee->prop.window);
322 318
@@ -337,7 +333,7 @@ _ecore_evas_hide(Ecore_Evas *ee)
337static void 333static void
338_ecore_evas_raise(Ecore_Evas *ee) 334_ecore_evas_raise(Ecore_Evas *ee)
339{ 335{
340 DBG(""); 336 DBG("%p", ee);
341 337
342 ecore_cocoa_window_raise((Ecore_Cocoa_Window *)ee->prop.window); 338 ecore_cocoa_window_raise((Ecore_Cocoa_Window *)ee->prop.window);
343} 339}
@@ -345,7 +341,7 @@ _ecore_evas_raise(Ecore_Evas *ee)
345static void 341static void
346_ecore_evas_lower(Ecore_Evas *ee) 342_ecore_evas_lower(Ecore_Evas *ee)
347{ 343{
348 DBG(""); 344 DBG("%p", ee);
349 345
350 ecore_cocoa_window_lower((Ecore_Cocoa_Window *)ee->prop.window); 346 ecore_cocoa_window_lower((Ecore_Cocoa_Window *)ee->prop.window);
351} 347}
@@ -353,7 +349,7 @@ _ecore_evas_lower(Ecore_Evas *ee)
353static void 349static void
354_ecore_evas_activate(Ecore_Evas *ee) 350_ecore_evas_activate(Ecore_Evas *ee)
355{ 351{
356 DBG(""); 352 DBG("%p", ee);
357 353
358 ecore_cocoa_window_activate((Ecore_Cocoa_Window *)ee->prop.window); 354 ecore_cocoa_window_activate((Ecore_Cocoa_Window *)ee->prop.window);
359} 355}
@@ -361,7 +357,7 @@ _ecore_evas_activate(Ecore_Evas *ee)
361static void 357static void
362_ecore_evas_iconified_set(Ecore_Evas *ee, Eina_Bool on) 358_ecore_evas_iconified_set(Ecore_Evas *ee, Eina_Bool on)
363{ 359{
364 DBG(""); 360 DBG("%p", ee);
365 361
366 ecore_cocoa_window_iconified_set((Ecore_Cocoa_Window *)ee->prop.window, on); 362 ecore_cocoa_window_iconified_set((Ecore_Cocoa_Window *)ee->prop.window, on);
367} 363}
@@ -369,7 +365,7 @@ _ecore_evas_iconified_set(Ecore_Evas *ee, Eina_Bool on)
369static void 365static void
370_ecore_evas_title_set(Ecore_Evas *ee, const char *title) 366_ecore_evas_title_set(Ecore_Evas *ee, const char *title)
371{ 367{
372 INF("ecore evas title set"); 368 DBG("%p: %s", ee, title);
373 369
374 if (eina_streq(ee->prop.title, title)) return; 370 if (eina_streq(ee->prop.title, title)) return;
375 if (ee->prop.title) free(ee->prop.title); 371 if (ee->prop.title) free(ee->prop.title);
@@ -413,7 +409,7 @@ _ecore_evas_engine_cocoa_init(Ecore_Evas *ee)
413 const char *driver; 409 const char *driver;
414 int rmethod; 410 int rmethod;
415 411
416 DBG(""); 412 DBG("%p", ee);
417 413
418 driver = "gl_cocoa"; 414 driver = "gl_cocoa";
419 415
@@ -563,8 +559,8 @@ ecore_evas_cocoa_new_internal(Ecore_Cocoa_Window *parent EINA_UNUSED, int x, int
563 if (!ecore_cocoa_init()) 559 if (!ecore_cocoa_init())
564 return NULL; 560 return NULL;
565 561
566 DBG(""); 562 INF("x,y,w,h = %i,%i,%i,%i", x, y, w, h);
567 563
568 ee = calloc(1, sizeof(Ecore_Evas)); 564 ee = calloc(1, sizeof(Ecore_Evas));
569 if (!ee) 565 if (!ee)
570 goto shutdown_ecore_cocoa; 566 goto shutdown_ecore_cocoa;
@@ -595,6 +591,7 @@ ecore_evas_cocoa_new_internal(Ecore_Cocoa_Window *parent EINA_UNUSED, int x, int
595 ee->prop.withdrawn = EINA_TRUE; 591 ee->prop.withdrawn = EINA_TRUE;
596 592
597 ee->evas = evas_new(); 593 ee->evas = evas_new();
594 INF("ecore_evas: %p, evas: %p", ee, ee->evas);
598 595
599 if (!ee->evas) 596 if (!ee->evas)
600 goto free_name; 597 goto free_name;