Commit Graph

55 Commits

Author SHA1 Message Date
Marcel Hollerbach 70ecf1056b ecore_cocoa: stop leaking init counts 2018-10-02 16:22:07 +02:00
Alastair Poole 9d3b5079db ecore_cocoa: explicity allocate for keyname and key
Summary:
Allocate memory for keyname and key. Also refactor
unnecessary calloc and free.

Reviewers: #committers, zmike, devilhorns

Reviewed By: zmike

Subscribers: cedric

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6366
2018-06-22 12:41:05 -04:00
Alastair Poole a939b57c7b ecore_cocoa: fix ECORE_EVENT_KEY_DOWN/UP on MacOS.
Fixing issue with modifier keys on MacOS. These events were missing
window information. Tested with Fyne.io. Window ID and keyname
are valid. See: http://bogosys.org/images/fyne_OSX.png. Thanks
zmike for initial investigation.

@fix T6944
2018-06-21 13:39:22 +01:00
Cedric BAIL af7a5ef5d9 ecore_cocoa: avoid crash during shutdown due to Ecore_Event queue. 2017-03-09 16:17:58 -08:00
Jean Guyomarc'h 5e149977e7 ecore_cocoa: fix handling of some keys
The ascii circumflex (^) can be typed by pressing twice the ^ key on a
mac keyboard. A single press allows composition (e.g. ^+e = ê).
Pressing ^ twice though, led to a segmentation fault in elementary,
because the result character of the operation (^) appeared in the raw
characters stack, and not in the filtered one.
This is a bit weird, as backtick (`) appears in the filtered keys stack.

@fix
2016-10-30 16:46:30 +01:00
Jean Guyomarc'h 5c366cab26 ecore_cocoa: prettify code a bit
Remove extraneous whitespaces, use appropriate macros when possible,
and mark a memory allocation failure as an unlikely case.
2016-10-30 16:46:30 +01:00
Jean Guyomarc'h 4029164c8e ecore_cocoa: fix behaviour of option key
Commit e44c48b904 failed to translate the
deprecated API into the Sierra API... replacing the Command key flags
by the Option key flags. This resulted of Opt+q quitting the program.

@fix
2016-10-30 16:46:30 +01:00
Jean Guyomarc'h 1f8224cc9a ecore_cocoa: allow to override termination sequence 2016-10-30 16:46:29 +01:00
Guilherme Iscaro 186dd9b00e Ecore Cocoa: Add missing modifiers field to Ecore Events
Fix T4477
2016-10-10 14:20:47 -03:00
Guilherme Iscaro 0897715c8d Ecore_Cocoa: Fix repeat modifers keys.
Some values were repeated.
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
Thiep Ha db8b0020ec ecore_cocoa: quit application with key
In OS X, cmd-q is used to quit application,
this patch adds that feature.
2016-09-23 17:49:34 +09:00
Jean Guyomarc'h 8118829225 ecore_cocoa: fix wrong key assignment 2016-08-31 21:24:49 +02:00
Jean Guyomarc'h 8d41099f9e ecore_cocoa: fix memory leak 2016-08-26 19:05:48 +02:00
Jean Guyomarc'h 8a23d53c66 ecore_cocoa: remove extra whitespaces 2016-06-04 16:53:18 +02:00
Duna Oh fbe4e4b6ad Ecore: Use calloc() to initialize Ecore_Event_Mouse_XXXX
Summary:
To ensure initialize all fields of Ecore_Event_Mouse_XXX,
use calloc() instead of malloc().

Test Plan: N/A

Reviewers: gwanglim, cedric, raster, devilhorns, ManMower, zmike

Subscribers: jpeg, input.hacker, JHyun

Differential Revision: https://phab.enlightenment.org/D3906
2016-04-20 08:33:20 -04: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 2d7870083c ecore_cocoa: don't make ecore_cocoa_feed_events() a public API
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-01 12:15:32 -08:00
Jean Guyomarc'h 967d2fe7fa ecore_cocoa: don't export Ecore_Cocoa_Keys.h
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-01 12:15:32 -08:00
Jean Guyomarc'h 614274f857 ecore_cocoa: factorize code
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-01 12:15:32 -08:00
Jean Guyomarc'h 32d6cb6efd ecore_cocoa: NSEvent modifiers are of type NSUInteger
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-01 12:15:32 -08:00
Jean Guyomarc'h 1ab2b14cfb ecore_cocoa: remove ECORE_COCOA_EVENT_EXPOSE
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-01 12:15:32 -08:00
Jean Guyomarc'h 616ad954fc ecore_cocoa: remove unused events 2015-12-01 12:15:32 -08:00
Jean Guyomarc'h 25a44cc9d8 ecore_cocoa: don't track NSAppKitDefined event
Currently, it was used only to get track of focus, howver focus was
already handled (and better) in ecore_cocoa_window (with
NSWindowDelegate).
This led to the LOST_FOCUS event to be posted twice, with different
values, which messed up the focus stack.

@fix

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-01 12:15:31 -08:00
Jean Guyomarc'h cb334b3e37 ecore_cocoa: fix types
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-01 12:15:31 -08:00
Jean Guyomarc'h 3d5f1817e6 ecore_cocoa: copy and paste support
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-01 12:15:31 -08:00
Jean Guyomarc'h 586c8b4582 ecore_cocoa: don't specify inline
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
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
Nicolas Aguirre aab530e347 ecore_cocoa/evas_gl_cocoa: fix indent, remove printf, and add DBG messages
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-09 10:42:34 -08:00
Nicolas Aguirre 86030d308c ecore_cocoa: fix warnings, add Debug outputs where needed and remove printfs
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-10-13 15:40:00 -07: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 869ed025a2 ecore_cocoa: fix scrollwheel behavior
- prioritize vertical scroll over horizontal
  - set amount to either -1 or 1, since EFL doesn't handle other value properly
  - fix wheel bouncing with some devices (X:0,Y:0 scrolling events)

  @fix
2015-04-07 19:05:55 +02:00
pierre lamot be98af31bf ecore_cocoa: fix mouse scrollwheel direction
horizontal and vertical direction where inverted

@fix
2015-03-17 10:42:51 +01:00
pierre lamot fec6d1207a ecore_cocoa: add support for non latin keyboard events
this patch adds support for non latin keyboard layout such as
arabic, greek or hebrew, some language might not be functionnal
tough like korean or chineese

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 ae4389a7bd ecore_cocoa: fix keyboad event handling
This patch allows to interpret correctly several types of key combinations:
  - alt keys : € œ ¬
  - dead keys : ä ë
  - dead keys (bis, they are handled differently) : ~ ã
  - control keys: ^C ^A
  - page up/ page down

@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 186a1ab11d ecore_cocoa: cosmetic color.
Summary: The log is registered with the private definition ECORE_DEFAULT_LOG_COLOR from ecore_private.h. Changed to a explicit color.

Reviewers: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-02-20 14:53:04 +01:00
Guilherme Lepsch 7b12e6cc86 ecore_cocoa: fix MacOS X build with clang 3.6
Summary:
* Fix extern declaration of _ecore_cocoa_log_domain variable defined as private with static;
* Fix including a private header from another module (ecore).

Reviewers: naguirre

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-02-20 11:28:03 +01:00
Michelle Legrand 73634580f8 ecore_cocoa: Handle more special characters and capital characters.
This improve the situation and only affect Ecore_Cocoa code base by
detecting a useful charactere.

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-02-05 16:38:07 +01:00
Michelle Legrand 48fff1478c ecore_cocoa: add ecore event on mouse scroll for cocoa.
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-02-05 16:38:07 +01:00
Michelle Legrand c9dd8fde7d ecore_cocoa: replace "keyname" by "key".
Ecore_Event_Key attribute "key" cannot be NULL. This
raise a segmentation fault in Enventor when hitting on
modifier keys.

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-02-05 16:38:07 +01:00
Nicolas Aguirre 72baccaf44 ecore_cocoa: create a log domain and use Eina_Log.
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-02-05 16:38:07 +01:00
Nicolas Aguirre 61fbb2ffd9 ecore_cocoa: don't send mouse event with negative x or y values.
With cocoa you may have negatives values when Mouse Down or Up. This
changes fix this behavior by sending mouse event only if x and y are
inside the ecore_evas space.

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-02-05 16:38:07 +01:00
Romain Perier c6945c075e ecore_cocoa: use the right Cocoa notification handlers for focus events
Don't use NSAppKitDefined events subtype for focus events, which contain NULL
window object most of the time. Use the NSWindowDelegate method designed for that
purpose instead. It fixes random focus issues in windows which was caused by
incorrect window identifier not found in ecore_evas_cocoa.

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-02-05 16:38:07 +01:00
Romain Perier 2f6c564cc9 ecore_cocoa: fix _nsevent_window_is_type_of() type check
isKindOfClass should receive an instance of a class and a class as arguments and
not two class. It fixes Mouse events sent to a window on OSX.

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-02-05 16:38:07 +01:00
Michelle Legrand 1d18543719 ecore_cocoa: handle more special characters and capital characters.
This patch is self contained for Mac OS X and improve its keyboard handling.

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-02-05 16:38:07 +01:00
Jean Guyomarc'h c03876d611 ecore_cocoa: NSRunLoop integration
Summary: Get rid of the old NSApplicationLoad() which was aimed to be use with Carbon. Unless the NSRunLoop is strictly integrated to the ecore_main_loop() (where cocoa events would be checked when entering the ecore_main_loop) I think the poller is the only option left.

Reviewers: raster, naguirre, raoulh, stefan_schmidt, cedric

@feature

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2014-09-03 20:34:57 +02:00
Jean Guyomarc'h f8235ff5c1 ecore_cocoa: Lion fullscreen workaround + warning fixes
Summary: Warnings and deprecated code fixes. I started to implement the OSX-Lion fullscreen style.

Reviewers: cedric, naguirre, raster, raoulh

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1175
2014-07-23 16:56:16 +02:00
Jean Guyomarc'h be077f079d ecore_cocoa: Introduce canvas resizing + warning fixes
Summary: Add support for canvas resizing: the window was resizable but its content was not resized.

Reviewers: raster, raoulh, naguirre, cedric

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1163
2014-07-10 20:04:24 +02:00