Commit Graph

60 Commits

Author SHA1 Message Date
Jean Guyomarc'h adf9608387 ecore_cocoa: fix windows initial rendering
We need to refresh the Cocoa's content view when showing the window.
In some particular cases (including the elementary_test initial window),
the content view is redrawn because of external events (the entry
animator). When no action at all is performed, the window and the
content view are resized... nice... but not drew...

Such a simple fix for this hell of a bug!

Fixes T5210
2017-03-09 23:16:16 +01:00
Jean Guyomarc'h fd7f878320 ecore_cocoa: factorize a little access to the cocoa window 2017-03-09 23:16:16 +01:00
Jean Guyomarc'h 88e352efe8 ecore_cocoa: pass the right window to ecore_evas 2017-03-09 00:57:55 +01:00
Guilherme Iscaro 186dd9b00e Ecore Cocoa: Add missing modifiers field to Ecore Events
Fix T4477
2016-10-10 14:20:47 -03:00
Jean Guyomarc'h e44c48b904 ecore_cocoa: upgrade API to macOS Sierra
Since macOS 10.12, several enumarations have been deprecated in favor of
new ones, with more meaningful ones, which are defined in SDK 10.12.
2016-09-27 08:52:51 +02:00
Jean Guyomarc'h c8d82dfc61 ecore_cocoa: fix build warning 2016-09-08 07:51:30 +02:00
Jean Guyomarc'h 6b3ca899e8 ecore_cocoa: fix fullscreen for older osx versions
Tested on 10.11 and 10.9.

Fixes T4395
2016-08-26 19:38:57 +02:00
Jean Guyomarc'h 7397b9fbe9 ecore_cocoa: refactor resizing request 2016-08-26 19:05:48 +02:00
Jean Guyomarc'h 55f791eb4c ecore_cocoa: remove pointless debug message
This message was also very annoying because systematically
printed out in the syslog when a cocoa window was closed.
2016-08-08 00:12:49 +02:00
Jean Guyomarc'h 266396b1eb ecore_cocoa: fix main loop handling
Pffff... another tricky one...

-windowDidResize is actually also called when the window is not
resize by the user, leading to multiple event posting, and of
course the infamous call of ecore_main_loop_iterate() when it
was not paused at all, leading to messy events handling... the
most visible being the initial resizing of the window going rogue.

We now ensure with -windowWillStartLiveResize and -windowDidEndLiveResize
that we only send an event when the user requested it. Since the main
loop is paused at this point, calling ecore_main_loop_iterate()
becomes safe.

Fixes T3648
2016-06-05 12:12:02 +02:00
Jean Guyomarc'h de5f293426 ecore_cocoa: fix broken scrolling
Evas events recently changed, and involved the use
of the 'multi' field within a mouse mouve event.
It was used afterwards for mouse scrolling, but since
it was never set by ecore_cocoa, scrolling went
broken...

Fixes T3789
2016-06-04 16:53:54 +02:00
Jean Guyomarc'h 29be8f2819 ecore_cocoa: fix window hiding logic 2016-06-04 16:53:26 +02:00
Jean Guyomarc'h b21ab5b541 ecore_cocoa: move Ecore_Cocoa_Cursor.h in Ecore_Cocoa.h
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2016-03-02 13:56:35 -08:00
Jean Guyomarc'h deb553d55e ecore_cocoa: remove Ecore_Cocoa_Event_Window
Create specific structures for each event:
- Ecore_Cocoa_Event_Window_Focused
- Ecore_Cocoa_Event_Window_Unfocused
- Ecore_Cocoa_Event_Window_Destroy

They are currently hold the same data, but this will allow not to break
the event protocol when future extensions will be needed.

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2016-03-02 13:56:28 -08:00
Jean Guyomarc'h e7dc1491a2 ecore_cocoa: rename width and height parameters
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2016-03-02 13:56:24 -08:00
Jean Guyomarc'h 3b61c2e07c ecore_cocoa: better naming of events
Lost and got focused have been renamed FOCUSED and UNFOCUSED to mirror
the focus API in Elementary.

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2016-03-02 13:56:20 -08:00
Jean Guyomarc'h 84bbe500c5 ecore_cocoa: replace Ecore_Cocoa_Window_Id by Ecore_Cocoa_Object
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2016-03-02 13:56:16 -08:00
Jean Guyomarc'h 71199709db ecore_cocoa: unify API with Ecore_Evas
- Sizes are signed integers
- Width is named w
- Height is named h

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2016-03-02 13:56:12 -08:00
Jean Guyomarc'h 0abeacb8ce ecore_cocoa: introduce Ecore_Cocoa_Object
This type is used as a bridge between objective-c objects (which are
ALWAYS pointed to) and the C interface.
Ecore_Cocoa_Object* is a less ugly substitute for void*.

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2016-03-02 13:56:08 -08:00
Jean Guyomarc'h 1528b8c6aa ecore_cocoa: use Eina_Bool instead of int
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2016-03-02 13:56:04 -08:00
Jean Guyomarc'h f85667c3fc ecore_cocoa: implement and const-correct window size step getter
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2016-03-02 13:56:01 -08:00
Jean Guyomarc'h 070430d51a ecore_cocoa: implement and const-correct window size max getter
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2016-03-02 13:55:57 -08:00
Jean Guyomarc'h 3eee82de31 ecore_cocoa: implement and const-correct window min size getter
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2016-03-02 13:55:53 -08:00
Jean Guyomarc'h 5deb157770 ecore_cocoa: implement and const-correct window size getter
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2016-03-02 13:55:49 -08:00
Jean Guyomarc'h 24a7209b51 ecore_cocoa: implement and const-correct window geometry getter
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2016-03-02 13:55:43 -08:00
Jean Guyomarc'h 8d364f56f4 ecore_cocoa: possibly avoid useless copies 2016-01-07 12:03:04 +01:00
Jaehyun Cho 91d9e7f83c Revert "ecore_cocoa: add support for system cursors"
This reverts commit 4623d57762.
This commit is duplicated with 2c93c73cbd.
2015-12-11 14:28:33 +09:00
Jean Guyomarc'h 4623d57762 ecore_cocoa: add support for system cursors
- Ecore_Cocoa_Cursor enum which references system cursors;
- API to show/hide cursor: ecore_cocoa_window_cursor_show();
- API to set system cursor: ecore_cocoa_window_cursor_set();
- Ecore_Evas interface to get Ecore_Cocoa_Window from Ecore_Evas.

@feature

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 12:07:20 -05:00
Jean Guyomarc'h 12db3c2213 ecore_cocoa: fix live resize of windows
This was a tricky little bastard!
When a window is live resized, the NSWindow which is the target of
the live resize will wait for a kevent from the window manager,
until live resizing is done. So... live resizing is synchronous
and blocks the main thread... hence ecore_main_loop.

- When live resize starts, the Ecore_Timer which polls NSRunLoop
is paused.
- When the window is resized, the ecore_main_loop is run manually
with ecore_main_loop_iterate() to process Ecore events (mostly
Ecore_Evas)
- When live resize finished, the Ecore_Timer which polls NSRunLoop
is resumed.

@fix

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-01 12:15:33 -08:00
Jean Guyomarc'h 907f14c003 ecore_cocoa: NSApp must be configured in the App wrapper
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-01 12:15:32 -08:00
Jean Guyomarc'h af19d15a78 ecore_cocoa_window: cosmetic changes
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-01 12:15:32 -08:00
Jean Guyomarc'h a8c9c9a60e ecore_cocoa: remove EINA_UNUSED because parameter is used
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-01 12:15:32 -08:00
Jean Guyomarc'h f83ece242e ecore_cocoa: remove debug log
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-01 12:15:32 -08:00
Jean Guyomarc'h 70a04ea746 ecore_cocoa: reindent file
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-01 12:15:32 -08:00
Jean Guyomarc'h 0bb310f2ad ecore_cocoa: add more safety checks
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-01 12:15:32 -08:00
Jean Guyomarc'h b61fc5814b ecore_cocoa: remove EINA_UNUSED because parameter is actually used
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-01 12:15:32 -08:00
Jean Guyomarc'h 916bf675e1 ecore_cocoa: use EAPI in implementation 2015-12-01 12:15:31 -08:00
Jean Guyomarc'h d48faf39bf ecore_cocoa: improve const-correctness 2015-12-01 12:15:31 -08:00
Jean Guyomarc'h 2c93c73cbd ecore_cocoa: add support for system cursors
- Ecore_Cocoa_Cursor enum which references system cursors;
- API to show/hide cursor: ecore_cocoa_window_cursor_show();
- API to set system cursor: ecore_cocoa_window_cursor_set();
- Ecore_Evas interface to get Ecore_Cocoa_Window from Ecore_Evas.

@feature

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-01 12:15:31 -08:00
pierre lamot c3f40bd0f9 ecore_cocoa: prevent mouse event loss when clicking in titlebar
fix
2015-11-02 20:15:59 +01:00
Nicolas Aguirre 51e0bc022b ecore_cocoa: fix a bug where event timestamp was not retrieved correctly.
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-10-13 15:40:01 -07:00
Stefan Schmidt 56560329ae ecore: cocoa: convert dos to unix line endings 2015-09-04 14:54:07 +02:00
Jean Guyomarc'h 3a3b12d403 ecore_cocoa,ethumb: fix compiling after EAPI policy changes
Summary:
I went through a lot of undefined symbols while compiling ecore_evas_cocoa
module and ethumb-related binaries. E.g.:

  Undefined symbols for architecture x86_64:
    "_ECORE_COCOA_EVENT_EXPOSE", referenced from:
        _ecore_evas_cocoa_new_internal in modules_ecore_evas_engines_cocoa_module_la-ecore_evas_cocoa.o
    "_ECORE_COCOA_EVENT_GOT_FOCUS", referenced from:
        _ecore_evas_cocoa_new_internal in modules_ecore_evas_engines_cocoa_module_la-ecore_evas_cocoa.o
    "_ECORE_COCOA_EVENT_LOST_FOCUS", referenced from:
        _ecore_evas_cocoa_new_internal in modules_ecore_evas_engines_cocoa_module_la-ecore_evas_cocoa.o
    "_ECORE_COCOA_EVENT_RESIZE", referenced from:
        _ecore_evas_cocoa_new_internal in modules_ecore_evas_engines_cocoa_module_la-ecore_evas_cocoa.o
    "_ECORE_COCOA_EVENT_WINDOW_DESTROY", referenced from:
        _ecore_evas_cocoa_new_internal in modules_ecore_evas_engines_cocoa_module_la-ecore_evas_cocoa.o
    "_ecore_cocoa_init", referenced from:
        _ecore_evas_cocoa_new_internal in modules_ecore_evas_engines_cocoa_module_la-ecore_evas_cocoa.o
    "_ecore_cocoa_screen_size_get", referenced from:
        __ecore_evas_screen_geometry_get in modules_ecore_evas_engines_cocoa_module_la-ecore_evas_cocoa.o
    "_ecore_cocoa_shutdown", referenced from:
        _ecore_evas_cocoa_new_internal in modules_ecore_evas_engines_cocoa_module_la-ecore_evas_cocoa.o
        __ecore_evas_cocoa_free in modules_ecore_evas_engines_cocoa_module_la-ecore_evas_cocoa.o

  Undefined symbols for architecture x86_64:
    "_ethumb_calculate_aspect_from_ratio", referenced from:
        __resize_movie in modules_ethumb_emotion_module_la-emotion.o
    "_ethumb_calculate_fill_from_ratio", referenced from:
        __resize_movie in modules_ethumb_emotion_module_la-emotion.o
    "_ethumb_ecore_evas_get", referenced from:
        __frame_decode_cb in modules_ethumb_emotion_module_la-emotion.o
    "_ethumb_evas_get", referenced from:
        __thumb_generate in modules_ethumb_emotion_module_la-emotion.o
        __finish_thumb_generation in modules_ethumb_emotion_module_la-emotion.o
    "_ethumb_finished_callback_call", referenced from:
        __thumb_generate in modules_ethumb_emotion_module_la-emotion.o
        __frame_decode_cb in modules_ethumb_emotion_module_la-emotion.o
        __finish_thumb_generation in modules_ethumb_emotion_module_la-emotion.o
    "_ethumb_image_save", referenced from:
        __frame_decode_cb in modules_ethumb_emotion_module_la-emotion.o
    "_ethumb_plugin_image_resize", referenced from:
        __resize_movie in modules_ethumb_emotion_module_la-emotion.o
    "_ethumb_plugin_register", referenced from:
        __module_init in modules_ethumb_emotion_module_la-emotion.o
    "_ethumb_plugin_unregister", referenced from:
        __module_shutdown in modules_ethumb_emotion_module_la-emotion.o

EAPI was not well re-defined in both cases. It has been handled in
ecore_cocoa_private.h and ethumb_private.h. These files must be included
after a main library header (because EAPI is undef there).

Reviewers: cedric

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2483

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-05-10 22:58:14 +02:00
pierre lamot 59532c7d96 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>
2015-03-17 10:42:51 +01:00
pierre lamot ca3bd69485 ecore_cocoa: add functions to allow min/max window size
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-03-17 10:42:51 +01:00
pierre lamot ef7e8562a1 ecore_cocoa: don't reject mouse events outside the window
mouse events ouside the window where rejected. that was creating
interactions where half an event was created, the application was
then not able to process correctly following events.

@fix

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-03-17 10:42:51 +01:00
pierre lamot 6ea9b476ad ecore_cocoa: release resources on window close event
@fix this patch:

catch the window close event from cocoa and send an ecore event
this event is catched by a handler in ecore_evas wich will
call the registered fn_delete_request (from elementary for instance)

/!\ this patch is currently incomplete and leads to a segv when
closing the last window

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-03-17 10:42:51 +01:00
pierre lamot d9830a199f ecore_cocoa: handle right and other mouse events
right and other mouse events where missing in the patch
correcting mouse event handling

@fix

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-03-12 07:43:59 +01:00
pierre lamot c0aedc828a ecore_cocoa: move mouse event handling to NSWindow
Mouse events was broken after a resize of the window from the left
or the bottom. As I understand, theses resize were changing the origin
of Cocoa window independly from the origin of the EFL.

This has been resolved by moving mouse envents handling to our NSWindow
delegate. thus events are always in the right referential.

@fix

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-03-12 07:43:59 +01:00
Guilherme Lepsch 6749348325 ecore_cocoa: remove duplicated includes.
Summary: Remove duplicated includes in source file.

Reviewers: naguirre

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2001

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-02-20 11:29:34 +01:00