summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpierre lamot <pierre.lamot@openwide.fr>2015-03-12 12:13:08 +0100
committerCedric BAIL <cedric@osg.samsung.com>2015-03-17 10:42:51 +0100
commit59532c7d9692d70d8fb6b59a76a0611aec15ce3f (patch)
tree34344741b4791b7f279bfc52fdd00fc021e467c7
parentca3bd69485f2c8c49a7a121bcb32b7862736a2e4 (diff)
ecore_cocoa: add missing window state functions
implement missing window state functions: * raise * lower * activate * iconified_set * withdrawn_set * move Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
-rw-r--r--src/lib/ecore_cocoa/Ecore_Cocoa.h2
-rw-r--r--src/lib/ecore_cocoa/ecore_cocoa_window.m40
-rw-r--r--src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c64
3 files changed, 98 insertions, 8 deletions
diff --git a/src/lib/ecore_cocoa/Ecore_Cocoa.h b/src/lib/ecore_cocoa/Ecore_Cocoa.h
index c081721c9e..3b650011f3 100644
--- a/src/lib/ecore_cocoa/Ecore_Cocoa.h
+++ b/src/lib/ecore_cocoa/Ecore_Cocoa.h
@@ -145,6 +145,8 @@ EAPI void ecore_cocoa_window_raise(Ecore_Cocoa_Window *window);
145 145
146EAPI void ecore_cocoa_window_lower(Ecore_Cocoa_Window *window); 146EAPI void ecore_cocoa_window_lower(Ecore_Cocoa_Window *window);
147 147
148EAPI void ecore_cocoa_window_activate(Ecore_Cocoa_Window *window);
149
148EAPI void ecore_cocoa_window_title_set(Ecore_Cocoa_Window *window, 150EAPI void ecore_cocoa_window_title_set(Ecore_Cocoa_Window *window,
149 const char *title); 151 const char *title);
150 152
diff --git a/src/lib/ecore_cocoa/ecore_cocoa_window.m b/src/lib/ecore_cocoa/ecore_cocoa_window.m
index b231106904..eabc65fdde 100644
--- a/src/lib/ecore_cocoa/ecore_cocoa_window.m
+++ b/src/lib/ecore_cocoa/ecore_cocoa_window.m
@@ -410,6 +410,46 @@ ecore_cocoa_window_hide(Ecore_Cocoa_Window *window)
410 [window->window orderOut:NSApp]; 410 [window->window orderOut:NSApp];
411} 411}
412 412
413void ecore_cocoa_window_raise(Ecore_Cocoa_Window *window)
414{
415 if (!window)
416 return;
417
418 [window->window orderFront:nil];
419}
420
421void ecore_cocoa_window_lower(Ecore_Cocoa_Window *window)
422{
423 if (!window)
424 return;
425
426 [window->window orderBack:nil];
427}
428
429void ecore_cocoa_window_activate(Ecore_Cocoa_Window *window)
430{
431 if (!window)
432 return;
433
434 [window->window makeKeyAndOrderFront:nil];
435}
436
437void ecore_cocoa_window_iconified_set(Ecore_Cocoa_Window *window,
438 int on)
439{
440 if (!window)
441 return;
442
443 if (on)
444 {
445 [window->window miniaturize:nil];
446 }
447 else
448 {
449 [window->window deminiaturize:nil];
450 }
451}
452
413void 453void
414ecore_cocoa_window_borderless_set(Ecore_Cocoa_Window *window, 454ecore_cocoa_window_borderless_set(Ecore_Cocoa_Window *window,
415 int on) 455 int on)
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 5adf742bf9..985792be85 100644
--- a/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c
+++ b/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c
@@ -319,7 +319,14 @@ _ecore_evas_size_step_set(Ecore_Evas *ee, int w, int h)
319{ 319{
320 ecore_cocoa_window_size_step_set((Ecore_Cocoa_Window *)ee->prop.window, w, h); 320 ecore_cocoa_window_size_step_set((Ecore_Cocoa_Window *)ee->prop.window, w, h);
321} 321}
322 322
323static void
324_ecore_evas_move(Ecore_Evas *ee, int x, int y)
325{
326 DBG("Move");
327 ecore_cocoa_window_move((Ecore_Cocoa_Window *)ee->prop.window, x, y);
328}
329
323static void 330static void
324_ecore_evas_resize(Ecore_Evas *ee, int w, int h) 331_ecore_evas_resize(Ecore_Evas *ee, int w, int h)
325{ 332{
@@ -390,6 +397,38 @@ _ecore_evas_hide(Ecore_Evas *ee)
390} 397}
391 398
392static void 399static void
400_ecore_evas_raise(Ecore_Evas *ee)
401{
402 DBG("Raise");
403
404 ecore_cocoa_window_raise((Ecore_Cocoa_Window *)ee->prop.window);
405}
406
407static void
408_ecore_evas_lower(Ecore_Evas *ee)
409{
410 DBG("Lower");
411
412 ecore_cocoa_window_lower((Ecore_Cocoa_Window *)ee->prop.window);
413}
414
415static void
416_ecore_evas_activate(Ecore_Evas *ee)
417{
418 DBG("Activate");
419
420 ecore_cocoa_window_activate((Ecore_Cocoa_Window *)ee->prop.window);
421}
422
423static void
424_ecore_evas_iconified_set(Ecore_Evas *ee, Eina_Bool on)
425{
426 DBG("IconifiedSet");
427
428 ecore_cocoa_window_iconified_set((Ecore_Cocoa_Window *)ee->prop.window, on);
429}
430
431static void
393_ecore_evas_title_set(Ecore_Evas *ee, const char *title) 432_ecore_evas_title_set(Ecore_Evas *ee, const char *title)
394{ 433{
395 INF("ecore evas title set"); 434 INF("ecore evas title set");
@@ -455,6 +494,15 @@ _ecore_evas_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int h
455 evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL, _ecore_evas_object_cursor_del, ee); 494 evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL, _ecore_evas_object_cursor_del, ee);
456} 495}
457 496
497static void
498_ecore_evas_withdrawn_set(Ecore_Evas *ee, Eina_Bool on)
499{
500 if (on)
501 _ecore_evas_hide(ee);
502 else
503 _ecore_evas_show(ee);
504}
505
458static int 506static int
459_ecore_evas_engine_cocoa_init(Ecore_Evas *ee) 507_ecore_evas_engine_cocoa_init(Ecore_Evas *ee)
460{ 508{
@@ -518,8 +566,8 @@ static Ecore_Evas_Engine_Func _ecore_cocoa_engine_func =
518 NULL, 566 NULL,
519 NULL, 567 NULL,
520 NULL, 568 NULL,
521 _ecore_evas_callback_delete_request_set,
522 NULL, 569 NULL,
570 _ecore_evas_callback_delete_request_set,
523 NULL, 571 NULL,
524 NULL, 572 NULL,
525 NULL, 573 NULL,
@@ -529,7 +577,7 @@ static Ecore_Evas_Engine_Func _ecore_cocoa_engine_func =
529 NULL, 577 NULL,
530 NULL, 578 NULL,
531 NULL, 579 NULL,
532 NULL, //move 580 _ecore_evas_move, //move
533 NULL, 581 NULL,
534 _ecore_evas_resize, 582 _ecore_evas_resize,
535 _ecore_evas_move_resize, 583 _ecore_evas_move_resize,
@@ -537,9 +585,9 @@ static Ecore_Evas_Engine_Func _ecore_cocoa_engine_func =
537 NULL, //shaped 585 NULL, //shaped
538 _ecore_evas_show, 586 _ecore_evas_show,
539 _ecore_evas_hide, 587 _ecore_evas_hide,
540 NULL, //raise 588 _ecore_evas_raise,
541 NULL, //lower 589 _ecore_evas_lower,
542 NULL, //activate 590 _ecore_evas_activate,
543 _ecore_evas_title_set, 591 _ecore_evas_title_set,
544 NULL, 592 NULL,
545 _ecore_evas_size_min_set, 593 _ecore_evas_size_min_set,
@@ -550,13 +598,13 @@ static Ecore_Evas_Engine_Func _ecore_cocoa_engine_func =
550 _ecore_evas_object_cursor_unset, 598 _ecore_evas_object_cursor_unset,
551 NULL, 599 NULL,
552 NULL, 600 NULL,
601 _ecore_evas_iconified_set,
553 NULL, 602 NULL,
554 NULL, 603 NULL,
555 NULL, 604 NULL,
556 NULL, 605 NULL,
557 NULL, 606 NULL,
558 NULL, 607 _ecore_evas_withdrawn_set,
559 NULL,
560 NULL, 608 NULL,
561 NULL, 609 NULL,
562 NULL, 610 NULL,