Commit Graph

139 Commits

Author SHA1 Message Date
Jean-Philippe Andre c4ac589455 widget: Remove all legacy event stuff in propagate
The EO API is now clean! Yay!

Ref T5363
2017-08-23 11:16:45 +09:00
Jean-Philippe Andre 66d241eadf elm: Process all input events with EO
This removes all uses of type & event_info in the method widget_event.

Ref T5363
2017-08-23 11:16:45 +09:00
Jean-Philippe Andre 069747b9de widget: Add eo event info inside widget_event
This is an internal function that should probably become an overridable
protected method, as it's required for proper event handling in widgets.
Next step: use eo_event_info in the widgets implementations. Then remove
legacy event struct.

Ref T5363
2017-08-23 11:16:45 +09:00
Andy Williams 91293d3b25 elm_code: small optimisation for large files 2017-08-02 10:32:13 +01:00
Carsten Haitzler 20333c7905 elm code - remove unneded extra check from copy and pasta it seems
extra check already done in if above - no need. looks like copy &
paste of the checks from above thus why it's there, but not needed.
not a bug, byt analysers dont like it so remove

found by PVS studio
2017-07-29 10:56:53 +09:00
Andy Williams 77db870b61 elm_code: Fix missing middle button selection paste
Resolves task T5520
@fix
2017-07-25 23:54:21 +01:00
Andy Williams 292e9e9ecf elm_code: Fix crash with long lines
Also fixes issue where widget would sometimes blank when scrolling
@fix
2017-07-23 21:30:35 +01:00
Jean-Philippe Andre 242127a96b evas,edje,elm: Mark all legacy objects as such 2017-07-07 13:21:18 +09:00
Andy Williams 77800dd9b4 elm_code: fix whitespace highlighting 2017-06-27 16:19:16 +01:00
Andy Williams a7830b9c42 elm_code: Add a matched token so we can highlight searches
Should make dense matches in a text editor clearer.
2017-06-26 22:17:07 +01:00
Sanjeev BA ed201d7f30 Add support for select all with ctrl-a
Summary: Signed-off-by: Sanjeev BA <iamsanjeev@gmail.com>

Test Plan: Test with edi.

Reviewers: ajwillia.ms, jpeg, cedric

Reviewed By: ajwillia.ms

Differential Revision: https://phab.enlightenment.org/D4971
2017-06-17 17:42:18 +01:00
Andy Williams 57a0343775 elm_code: Allow multibyte characters to be entered
@fix T5496
2017-05-26 23:07:52 +01:00
Al Poole 66fd9839a0 elm_code: fix cursor position (100%)
Reviewers: ajwillia.ms

Reviewed By: ajwillia.ms

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4905
2017-05-24 21:25:24 +01:00
Andy Williams 6058401590 elm_code: reduce race conditions in rendering cursor
This code is slowly getting neater as we get to the bottom of it
2017-05-23 23:03:08 +01:00
Andy Williams 7f1ef4e2d4 elm_code: improving cursor move behavior.
There is a blank line off the scroller but for now it's better
2017-05-21 23:19:24 +01:00
Al Poole 6d7a73c68f elm_code: fix carriage return at EOF scroller behaviour
Reviewers: ajwillia.ms

Reviewed By: ajwillia.ms

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4890
2017-05-19 19:04:46 +01:00
Jean-Philippe Andre 55b529cebc evas/elm: Make group_add/group_del internal functions
This hides those two legacy functions from the EO API.
2017-05-19 14:07:00 +09:00
Andy Williams 7510a2a9ee elm_code: Fix crash on tabs in long lines
@fix
2017-05-19 00:01:23 +01:00
Jean-Philippe Andre 90de99eea6 elm_code: Fix use after free 2017-05-17 15:32:03 +09:00
Andy Williams eb04ab591c elm_code: Fix insertion of multiline content in widget
A small refactoring to reduce code duplication as well :)
2017-05-16 22:13:43 +01:00
Andy Williams 94afabf216 elm_code: Move the 'default' font name and size into the theme.
This can still be overridden by the standard method calls
2017-05-06 22:02:17 +01:00
Andy Williams 3b9e69e888 elm_code: Expose API for inserting text at cursor
widget operations use NULL terminated strings, backend does not.
Refactor some selection code so all selection deletions trigger
undo events (except where they should not).
2017-05-03 08:17:06 +01:00
Al Poole 9b8efc4811 elm_code : LINE_APPEND Render fix
Summary: @fix

Reviewers: ajwillia.ms

Reviewed By: ajwillia.ms

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4839
2017-05-02 20:58:14 +01:00
Andy Williams b5761fc227 elm_code: Don't refresh if fonts did not change 2017-04-06 23:30:00 +01:00
Andy Williams 595fc25f3f elm_code: fix copy/paste bug that slipped through 2017-04-06 23:14:03 +01:00
Bryce Harrington 9610d4aaa6 elm_code: Fix coverity issue divide by zero
Summary: @fix 1371128: DIVIDE_BY_ZERO

Reviewers: ajwillia.ms

Reviewed By: ajwillia.ms

Subscribers: ajwillia.ms, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4771
2017-04-06 22:40:13 +01:00
Andy Williams e44c33f233 elm_code: Fix bug when deleting slection beyond start of document.
@fix
2017-04-06 22:16:27 +01:00
Andy Williams 650606ab90 elm_code: better safety around widget edge cases
Fixes crashes when dragging selection out of widget.
@fix
2017-04-05 22:40:43 +01:00
Andy Williams b40b1052b5 elm_code: fix backspace newline in BSD 2017-03-31 21:53:14 +01:00
Andy Williams 6fb1782576 elm_code: Fix newline crash on BSD
@fix
2017-03-30 23:20:22 +01:00
Andy Williams d15faf08fe elm_code: fix CID 1368489
@fix
2017-03-25 12:59:13 +00:00
Andy Williams 2c0b850f57 elm_code: fix keyboard selection forward
@fix
2017-03-21 22:36:53 +00:00
Andy Williams f6434c0e0d elm_code: Update and demo status messages inline 2017-03-17 10:07:04 +00:00
Cedric Bail f06600fc29 elementary: refactor code to avoid duplication in elm_code_widget. 2017-03-12 15:36:17 -07:00
Andy Williams 54e6f3f012 elm_code: Don't leak rows when we resize down
Thanks Cedric :)
@fix
2017-03-12 13:35:41 +00:00
Cedric Bail 343d2e0d87 elementary: force elm_code line fill on object resize.
This fix elementary_test use of elm_code where the object needed
to get clicked to have their content displayed. The reason was that
the line where appended while the object size was 0 and once it was
resized the line where not displayed.
2017-03-11 16:55:05 -08:00
Andy Williams 53c9a06c2d elm_code: Fix position of cursor in selection
Make sure cursor is always at the left of our selection
@fix
2017-03-10 14:27:17 +00:00
Andy Williams c19d3b402a elm_code: Fix missing syntax for .eo files
This was accidentally removed in the transition from edi.
using text/x-eolian which is not well reported by the FS yet.
@fix
2017-03-04 15:42:33 +00:00
Andy Williams dc08c57411 elm_code: Hide the cursor when it is off screen
This resolves cursor artifacts that could be seen @fix
2017-02-27 20:51:40 +00:00
Andy Williams 2c1aeef3d6 elm_code: Fix Coverity issues.
@fix CID1356612 CID1368335 CID1368489 CID1371123 CID1371124 CID1371126 CID1371128
2017-02-18 21:41:53 +00:00
Carsten Haitzler f1693ee3e2 elm code - silence possibly uninitialied compiler warnings
every time i build efl i see all these warnigns spew by about elm_code
and possibly uninited vars being used. yes - they're filled in via ptr
ref bya  func but gcc definitely seems to think they MIGHT not be
filled in in some cases... and either way tyhe cost of setting to 0 is
minimal and less noise is better so we see real warnings more
easily... :)
2017-02-11 10:39:42 +09:00
Amitesh Singh 03cf41c02d elm code: check return value of elm_layout_theme_set
fixes CID 1366922
2017-02-08 09:54:42 +05:30
YeongJong Lee 4aee312774 elm_code: add support for redo
Summary:
now, elm_code support redo.
shortcut is <Ctrl> + <y>

Test Plan:
1. elementary_test - Code Editor
2. Check that undo and redo are work correctly.

Reviewers: ajwillia.ms

Reviewed By: ajwillia.ms

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4642
2017-02-02 18:29:16 +00:00
YeongJong Lee 251469e2fe elm_code: add copy/paste/cut undo
Summary: The patch for supporting copy,paste and cut undo

Test Plan:
1. elementary_test - Code Editor
2. Check that undo work correctly when copy,paste and cut

Reviewers: ajwillia.ms

Reviewed By: ajwillia.ms

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4636
2017-02-01 09:23:08 +00:00
YeongJong Lee 928091bedb elm_code: fix that selected code can't undo
Summary: Change some undo logic and remove unused function

Test Plan:
1. elementary_test - Code Editor
2. Select lines.
3. Remove selected lines.
4. undo removed lines(<Ctrl> + <z>)

Reviewers: ajwillia.ms

Reviewed By: ajwillia.ms

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4631
2017-01-31 19:40:20 +00:00
YeongJong Lee 694c16ab2b elm_code: Add a safety code to prevent arithmetic exception
Test Plan:
1. elementary_test - Code Editor
2. Chack there is not arithmetic exception

Reviewers: ajwillia.ms

Reviewed By: ajwillia.ms

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4621
2017-01-28 12:54:54 +00:00
Andy Williams a0f8cb846c elm_code: simpler handling of token painting 2017-01-21 15:57:21 +00:00
Andy Williams 5851a9d4a8 elm_code: Add initial simple syntax highlighting for C code
For c source and headers lookup a simple syntax definition.
Use a very simple text processing line by line to tokenise.
Simple but it gets us one step closer to cross-language syntax
2017-01-20 22:11:01 +00:00
Andy Williams de92b55e32 elm_code: Add some safety 2017-01-15 23:50:37 +00:00
Andy Williams d86143212a elm_code: Fix selection when moving around with cursor keys
Also fix the handling of newlines in our selections
@fix
2017-01-15 22:41:48 +00:00
Jee-Yong Um 6d0a2398ad Elm.Widget: rename "event.*" methods to solve name conflict
Summary:
Elm.Widget.event_callback_add conflicts with Efl.Object.event_callback_add.
To solve this problem, "widget_" prefix is added to methods starting with
"event".

Reviewers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4521
2017-01-03 10:59:49 +09:00
Andy Williams 8b12c7d5d7 elm_code: select when navigating or clicking with shift
test plan: hold shft whilst using a cursor key or mouse click with shift pressed
2017-01-01 18:50:09 +00:00
YeongJong Lee 65dc673ae8 elm_code: refactor auto indent about brace matching
Summary: return value of brace matching function no longer need free().

Test Plan:
1. run elementry_test - Code Editor or Edi.
2. Type some code with braces.
3. Check that closing brace has correct indent.

Reviewers: ajwillia.ms

Reviewed By: ajwillia.ms

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4540
2017-01-01 14:45:30 +00:00
Andy Williams 0014d0b99e elm_code: Fix another public API using the wrong order 2016-12-27 22:17:01 +00:00
Andy Williams 34c28918d5 elm_code: Don't assume control characters make a change
@fix
2016-12-17 13:12:46 +00:00
Andy Williams 780da3c878 elm_code: Fix tests for parameter reordering
Apologies for the badness of not running the tests before
2016-12-12 14:01:20 +00:00
Andy Williams e0299f3510 elm_code: Fix parameter ordering for consistency 2016-12-12 08:29:51 +00:00
Andy Williams 3d913e8fb3 elm_code: Fix cursor x offset calculations 2016-12-10 00:44:38 +00:00
Andy Williams 78ac434769 elm_code: Use cursor theme from elm_entry 2016-12-09 23:32:20 +00:00
Andy Williams 91e84aa3b8 elm_code: use geometry of cells to paint a simple cursor
Also allows others to figure out where cells are :)
2016-12-09 15:55:34 +00:00
Andy Williams 92eacde6e7 elm_code: refactoring of the elm_code_line_indent to work with lines 2016-12-03 15:59:52 +00:00
Andy Williams ad5bce5cbd elm_code: Add indentation for matching braces
Summary: when type closing brace, it find matching braces and then indent.

Test Plan:
1. run elementry_test - Code Editor or Edi.
2. Type some code with braces.
3. Check that closing braces have correct indent.

Reviewers: ajwillia.ms

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4444
2016-12-03 00:56:25 +00:00
Chris Michael 2c7bedc622 elementary: Fix coverity detected resource leak
As elm_code_line_indent_get will malloc space for the returned string,
that space should be freed after usage. This fixes a resource leak
detected by Coverity.

CID1366468

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-11-29 08:35:52 -05:00
Andy Williams 3febd6a563 elm_code: A better colour for comments 2016-11-28 00:08:43 +00:00
Andy Williams f6486473ed elm_code: Slightly smarter indent logic
Continue comment blocks where appropriate...
A bunch of refactoring of text/indent code to expand further
2016-11-27 23:15:46 +00:00
Jean-Philippe Andre d4929e58fc elm: Remove some eo files from installation
These are some of the EO files that shouldn't be part of the public
EO API:
- elm_access (old)
- actionslider
- bubble
- diskselector
- flipselector (a fancy spinner)
- hoversel (use combobox instead)
- icon (use image instead)
- inwin
- naviframe (unreplaced for now)
- photo (use image)
- prefs
- segment control
- separator
- slideshow
- thumb (use image)

Note: This breaks the use of the elm_widget_xxx.h headers. Those
      were internal headers anyway. Exposed because of a lack of
      a proper inheritance API.
2016-10-26 13:42:54 +09:00
Andy Williams b388b4214c elm_code: Don't allow cursor to be placed mid-tab 2016-10-08 14:44:02 +01:00
Thiep Ha cc7dbde840 text/entry: add more key controls for os x
In OS X, cmd-c,v, ... keys are used instead of ctrl-c,v...,
this patch adapts these key handlings.
2016-09-23 17:51:37 +09:00
Andy Williams 2598ea8da8 elm: don't show our elm_code popup if ctrl pressed 2016-09-11 19:14:20 +01:00
Andy Williams a4398fffef elm: Add popup edit menu in elm_code 2016-09-11 19:14:20 +01:00
Tom Hacohen 9c779dca90 Rename efl_self to efl_added
It has been discussed on the ML (thread: "[RFC] rename efl_self") and
IRC, and has been decided we should rename it to this in order to avoid
confusion with the already established meaning of self which is very
similar to what we were using it for, but didn't have complete overlap.

Kudos to Marcel Hollerbach for initiating the discussion and
fighting for it until he convinced a significant mass. :)

This commit breaks API, and depending on compiler potentially ABI.

@feature
2016-09-05 16:59:56 +01:00
Andy Williams 8f96646605 Elm: Dont insert errors by default in code
Instead insert the line if the gutter is clicked.
And provide a tooltip!
2016-09-01 23:15:34 +01:00
Andy Williams d7e261c3e6 elm: Use the background highlight colors from our website in Elm_Code 2016-09-01 23:14:11 +01:00
Andy Williams b52de36f03 Elm: Dont'd display a ghost 0 width line marker for elm_code.
Avoiding a ghost line when we have no width marker configured
2016-09-01 21:43:57 +01:00
Andy Williams 9e54ae9373 elm: Try to use the code highlight color from out website in Elm_Code 2016-08-30 23:22:41 +01:00
Tom Hacohen d5e321466e Efl object: Rename Eo_Event -> Efl_Event.
This is the last step of the Eo renaming efforts.
2016-08-30 13:34:10 +01:00
Vitor Sousa 8356b16a49 Efl Object: remove legacy callback calls from event_callback_call
Efl.Object.event_callback_call no longer calls legacy smart callbacks;
calling only event callbacks registered with the given event description
pointer.

Create the method Efl.Object.event_callback_legacy_call to inherit the old
behavior from Efl.Object.event_callback_call, calling both Efl.Object events
and legacy smart callbacks.

Update all other files accordingly in order to still supply legacy
callbacks while they are necessary.
2016-08-26 15:45:07 -03:00
Andy Williams 6fce2fb80b elm: Show code widget width marker after the column
Provide a clearer indication of what width is available
2016-08-26 15:17:37 +01:00
Tom Hacohen e65aae994e Eo: Finish the renaming of Eo to the EFL.
This renames all the rest of the API to the EFL namespace except for
Eo_Event that will follow soon.

Obviously breaks both API and ABI.
2016-08-15 15:07:42 +01:00
Tom Hacohen c662934be8 Change the EFL to follow the new Eo rename. 2016-08-11 17:04:43 +01:00
Andy Williams 5c8ea3a6f3 elementary: Grab all key presses in elm_code for now
Working around issues where new key bindings were breaking the editor
2016-07-03 20:48:30 +01:00
Amitesh Singh c37f3c3c31 elm code: check return value from elm_layout_theme_set
CID: 1356991
2016-06-23 09:27:46 +05:30
Tom Hacohen 6202cc7485 Adjust the code according to the eo event stop changes.
This was changed in the previous commit.
2016-06-20 18:02:00 +01:00
Jean-Philippe Andre 52f9220b3f Evas: Rename smart object into Efl.Canvas.Group 2016-06-17 19:32:43 +09:00
Jean-Philippe Andre 42b63f5507 Evas: Add smart_ prefix to all smart functions (eo)
This is a first step at separating legacy smart
object features away from standard efl interfaces.
2016-06-17 19:25:48 +09:00
Andy Williams 6c0d51322b elementary: Fix repeated undo of character deletion
Let's not trigger further undo stack changes when we undo changes.
2016-06-14 22:47:22 +01:00
Andy Williams da1506d4e8 elementary: Fix elm_code theme lookup and use correct naming 2016-06-06 23:59:52 +01:00
Andy Williams 80ca479916 elementary_code: Use correct theme file post-merge 2016-06-06 14:28:17 +01:00
Cedric BAIL d384012307 elementary: merging in elm_code widget.
Theme is not there as it should be manually merged into the elementary
default theme.
2016-06-02 17:19:08 -07:00