Commit Graph

159 Commits

Author SHA1 Message Date
Mike Blumenkrantz 823b7b05cd elm: resolve float comparison warnings
Summary: Depends on D11790

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11791
2020-05-09 09:25:21 +01:00
Alastair Poole b7804910a7 code: Silence compiler warnings. 2020-04-03 11:38:48 +01:00
Alastair Poole bd6608dd90 elm_code: Avoid moving to non-existent line.
Check for line existence before moving cursor.
2020-03-06 01:23:35 +00:00
Alastair Poole b847348699 elm_code: Improve efficiency of the widget.
For now, only create textgrids when needed. Also improve other
regions of the widget. This will improve large file support and
also some rendering of the widget.

This improves performance 1-2 times. However, there must be a
reasonable redesign regarding the current use of textgrids.
2020-03-04 01:41:43 +00:00
Alastair Poole 7f727c1366 elm_code_widget: Display cursor within widget.
Only render the cursor when its within the bounds of the
widget.
2020-02-09 21:14:42 +00:00
Alastair Poole 5c7fe5ac31 elm_code_widget: Line numbers Off then Gutter Off.
When line numbers were disabled in the widget there was still
some remnant of the background colour of gutter in the widget.
This respects having the line numbers disabled visually.
2020-01-02 00:01:00 +00:00
Alastair Poole 072ff46aa2 elm_code_widget: Fix cursor position sync.
The scroller was causing the cursor to be out of sync with the
widget content. This fixes that.
2020-01-01 23:16:25 +00:00
Marcel Hollerbach c33aaf32a8 elm_code: set box align correctly
sometimes the resize size is not in line with the size of the outer
widget, in this case the box should align its children at the very top,
otherwise the cursor grid is falling out of sync with the text content.
2019-12-06 19:19:38 +01:00
Marcel Hollerbach 8de8f059c9 elm_code_widget: when the position is updated, set new geom to cursor
in order to do that, we need to ensure that the internal box is
calculated, otherwise the position is still not updated correctly.
This fixes wrong cursor positions in edi.

fixes T8214

Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D10225
2019-09-30 10:46:40 +02:00
Marcel Hollerbach 9bc9eff716 elm_code_widget: initialize these vars correctly
otherwise we are setting a cursor from time to time at a uninitialized
position. Which causes disappeared cursors

Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D10224
2019-09-30 10:46:38 +02:00
Yeongjong Lee f2b1f312a9 efl_input_key: replace key property name with key_sym
Summary:
Sorry to touch stable eo classes. there is name conflict issue between class and
property when binding language is generated from eo. for example in C#, compiler
error occurs.

```
src/bindings/mono/efl_input_key.eo.cs(272,26): error CS0542:
`Efl.Input.Key.Key': member names cannot be the same as their enclosing type
```

This patch changes Efl.Input.Key.GetKey/SetKey method to
Efl.Input.Key.GetKeySym/SetKeySym and generates Efl.Input.Key.KeySym
property.

Note that CAPI is not changed.

ref T8093

Test Plan: meson setup -Dbindings=mono,cxx -Dmono-beta=true

Reviewers: lauromoura, woohyun, zmike, segfaultxavi

Reviewed By: segfaultxavi

Subscribers: bu5hm4n, cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8093

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

zmike note: this class was not released at the point of this patch, the class
was only recently marked as stable
2019-08-05 08:51:22 -04:00
Mike Blumenkrantz ba3998544b elm/code: check for cursor layout existence before emitting signals to it
Summary:
non-editable widgets do not have this object and will trigger errors

@fix
Depends on D8988

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8989
2019-05-29 12:29:04 -04:00
Vincent Torri 7db4714db6 replace strndup with eina_strndup, remove strndup definition in evil and elm_test_dnd
Test Plan: compilation

Reviewers: cedric, zmike, raster

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8814
2019-05-03 13:13:57 +01:00
Mike Blumenkrantz 6d40a78b25 elm.code.widget: rename events to avoid conflicts
Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D8264
2019-03-08 12:18:01 -08:00
Mike Blumenkrantz a5b5d6d277 elm_code_widget_legacy: remove all legacy usage from eo files
this takes the current generated output from eolian for legacy code in
efl and adds it to the tree, then removes legacy references from the
corresponding eo files. in the case where the entire eo file was for
a legacy object, that eo file has been removed from the tree

ref T7724

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D8159
2019-03-07 14:14:57 -08:00
Mike Blumenkrantz ca9daf94c6 elm_code_widget: make this efl_ui namespaced
this currently has no counterpart in interface widgets but would be
useful there. removing the use of an elm_scroller type makes it independent
of legacy widgets, and it's still a beta api so at least future development
can be resumed at some point without much issue

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D8158
2019-03-07 14:14:55 -08:00
Mike Blumenkrantz 1abf1518fe elm_hoversel: remove all legacy usage from eo files
this takes the current generated output from eolian for legacy code in
evas and adds it to the tree, then removes legacy references from the
corresponding eo files. in the case where the entire eo file was for
a legacy object, that eo file has been removed from the tree

ref T7724

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D8134
2019-03-06 13:03:08 -08:00
Mike Blumenkrantz bc0c50c507 efl.ui.widget: widget_event -> widget_input_event_handler
Summary:
ref T7553
Depends on D8081

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7553

Differential Revision: https://phab.enlightenment.org/D8082
2019-03-04 13:37:18 -05:00
Mike Blumenkrantz bb6caaa471 efl.ui: remove Efl.Ui.Theme_Apply_Error
Summary:
now that the error codes have been change to be compatible with eina_error,
this can be removed and will work through eina_error naturally

fix T7718

Depends on D8067

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl_api

Maniphest Tasks: T7718

Differential Revision: https://phab.enlightenment.org/D8068
2019-03-04 13:37:07 -05:00
Mike Blumenkrantz 644b771fe4 efl.ui: Efl.Ui.Theme_Apply_Result -> Efl.Ui.Theme_Apply_Error
Summary:
this swaps the values of "no error" and "error" in order to maintain
consistency with the rest of efl where the zero value means "no error"
Depends on D8060

Reviewers: cedric

Reviewed By: cedric

Subscribers: segfaultxavi, cedric, #reviewers, #committers

Tags: #efl_api

Differential Revision: https://phab.enlightenment.org/D8063
2019-03-04 13:36:41 -05:00
WooHyun Jung 7f2b26861f elm: prevent from accessing null pointer after memory allocation
Summary: Add null checking code just after allocating memory

Test Plan: make check

Reviewers: jypark, Jaehyun_Cho, zmike

Reviewed By: Jaehyun_Cho, zmike

Subscribers: devilhorns, zmike, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7801
2019-01-29 09:23:44 -05:00
Derek Foreman 014705c740 elm_code: Pass widget data to _elm_code_widget_fill_line
We already have this looked up in all callers, and the lookup is mind
smashingly heavy.  Just use what we have.

ref T6209

Signed-off-by: Derek Foreman <derek.foreman.samsung@gmail.com>
Reviewed-by: Chris Michael <cp.michael@samsung.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D7694
2019-01-18 13:06:37 -06:00
Derek Foreman 965cb9d28d elm_code: Pass data to status_type_get
Summary:
Every single call path has already dearly paid the price of pointer
indirection so let's save a few million extra look-ups and just pass
it along.

ref T6209

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T6209

Differential Revision: https://phab.enlightenment.org/D7692
2019-01-18 12:20:59 -05:00
Alastair Poole 29c388a35b efl: fix misspelt focused in API and documents.
Fix spelling in elm_code API and other documents too where this occurs.
Differential Revision: https://phab.enlightenment.org/D7299
2018-12-06 15:11:17 +01:00
Chris Michael 7f42105cb7 elementary: Reduce EO calls by using geometry_set
This patch reduces EO calls by using evas_object_geometry_set rather
than calling move & resize.
2018-11-21 11:25:58 -05:00
Jaehyun Cho 4f9c8d524c efl_ui_theme: Introduce Efl.Ui.Theme class
Summary:
Efl.Ui.Theme class is required to support language bindings.
Efl.Ui.Theme works based on current elm_theme features.

This patch fixes T7357.

Reviewers: segfaultxavi, cedric, lauromoura, woohyun, zmike, SanghyeonLee

Reviewed By: segfaultxavi, SanghyeonLee

Subscribers: SanghyeonLee, herdsman, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7357

Differential Revision: https://phab.enlightenment.org/D7244
2018-11-20 13:56:37 +09:00
Alastair Poole be8b7e5210 elm_code: Allow widget to be focused.
Summary: This fixes a lost cursor with latest git.

Test Plan: elementary_test -> elm_code -> view a cursor

Reviewers: raster, ajwillia.ms

Reviewed By: raster

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7298
2018-11-17 13:05:02 +00:00
Daniel Zaoui 1b85d7d12f Elm_Code: check pointer nullity before using it 2018-11-01 23:09:32 +02:00
Alastair Poole f747e35f48 elm_code: make the hoversel not focusable.
Summary: Disabling focus prevents incorrect operations.

Test Plan:
With EDI, use mouse (cut/copy/paste).
Due to the focus passing to the hoversel we break focus in the
application when it's lost. By disabling this cut/copy/paste
works as it should. A similar approach was used in elm_entry.

Reviewers: ajwillia.ms

Reviewed By: ajwillia.ms

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6986
2018-09-05 22:07:49 +01:00
Alastair Poole 7b3f7bf9e1 elm_code: fix DEL at end of line.
Summary:
In one case we do not want to move the cursor.
When merging up with DEL the cursor should
remain on the same line.

Test Plan: Cursor at end of line, press delete.

Reviewers: ajwillia.ms

Reviewed By: ajwillia.ms

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6957
2018-08-31 17:58:17 +01:00
Alastair Poole 0f21b1f7aa elm_code: fix crash on backspace and selection delete.
FIx backspace issue and also issue involving the cursor
position and deleting/cutting/backspace of selected text.
Now that we properly move the cursor around when making a
selection, it's important that we place the cursor in a
valid position in the widget following the removal of text.

Previously the cursor always remained in a "safe" position
however now it's crucial to update this position when
necessary.

@fix T7259
Differential Revision: https://phab.enlightenment.org/D6835
2018-08-17 21:44:17 +02:00
Mike Blumenkrantz db377832f7 elm/code: use evas as parent for evas object creation
Summary:
evas object types require an evas as the parent. this has always been
the case, though it has only begun to (again) be treated as an error
recently

fixes unit test failures

Subscribers: cedric, #reviewers, #committers

Tags: #efl_widgets_code

Differential Revision: https://phab.enlightenment.org/D6852
2018-08-16 20:00:41 +01:00
Chris Michael 6119cc0c65 elementary: Check for valid cursor_rect when (un)setting focus
Summary:
As the cursor_rect for elm_code_widget is not created until the code
widget gets focus, we cannot just assume it is already there when
trying to emit a focus signal. The cursor_rect does not get created
until widget_cursor_update is called.

This fixes an issue where NULL is passed to efl_layout_signal_emit.

To test this, just launch elementary_test and click the Code Editor
test. As soon as you try to click into the Code Editor, this gets
triggered.

ref T7030

Reviewers: netstar, ajwillia.ms

Reviewed By: netstar

Subscribers: #reviewers, cedric, #committers, zmike

Tags: #efl

Maniphest Tasks: T7030

Differential Revision: https://phab.enlightenment.org/D6701
2018-08-14 15:45:57 +01:00
Alastair Poole b0d1ab4ad9 elm_code_widget: match bg color with widget color.
Test Plan: elm_test -> "Code Editor" -> Consistent widget colours.

Reviewers: #committers, ajwillia.ms, zmike

Reviewed By: #committers, ajwillia.ms

Subscribers: cedric

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6719
2018-08-05 21:15:01 +01:00
Alastair Poole ad379ce04f elm_code_widget: fix keyboard and scrolling with active selection.
Summary:
This adds some attributes to the selectiont type in elm_code.
Including the type (whether it is mouse or keyboard) and also whether
a selection is in progress. Thus we can reliably select around the
file and also move/scroll when there is an active selection.

Test Plan:
Drag and select text with mouse. Also the same with keyboard (hold shift and select).
Leave selection active and scroll around the file. The selection should remain and
full movement is possible while retaining the active selection. This could really
be refactored for a next major release.

Reviewers: #committers, ajwillia.ms, cedric

Reviewed By: ajwillia.ms

Subscribers: zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6676
2018-07-27 17:08:44 +01:00
Alastair Poole ab7d2ebb55 elm_code_widget: resize cursor at time of font change.
Summary:
This ensures the cursor changes to meet the font size change
when a font change is made in an Elm_Code_Widget.

@fix T6470

Test Plan:
Run ecrire or Edi. Open a text file and change the font settings.
Cursor should resize with the font when it is changed.

Reviewers: #committers, ajwillia.ms

Reviewed By: #committers, ajwillia.ms

Subscribers: cedric, zmike

Tags: #efl

Maniphest Tasks: T6470

Differential Revision: https://phab.enlightenment.org/D6596
2018-07-24 10:10:26 +01:00
Alastair Poole 08d23ea582 elm_code_widget: fix select and drag (scrolling).
Summary:
Currently when selecting with the mouse and scrollling,
the selection will only continue in one direction. With
this patch, the selection can move freely between "pages".

Test Plan: select text and drag up and down in elm_code widget (Edi).

Reviewers: #committers, ajwillia.ms

Reviewed By: ajwillia.ms

Subscribers: cedric, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6632
2018-07-24 10:04:28 +01:00
Andy Williams 1485cf9df5 elm_code: (cherry-pick) Support indentation styles that are purely tab based
read: Allow non-EFL style indentation.
This is off by default but is switched on if you turn 'tabs insert spaces' off
2018-07-22 17:02:23 +01:00
Alastair Poole a92b80ff86 elm_code: add EOAPI to refresh theme after a user layout change.
Hopefully this retains the object hierarchy. Gives us a method
to update the widget theme after a layout change.
2018-05-13 17:16:13 +01:00
Alastair Poole 4d61374872 elm_code_widget: on theme change update the background widget.
This ensures consistency between the colours of the widget and
its parent. When theme changes the whole visible region changes
and matches so that it isn't bogus and ugly.
2018-05-13 13:43:08 +01:00
Daniel Kolesa fcae7cab27 eolian gen: enable constness generation on property getter impls
This changes a lot of things all across the EFL. Previously,
methods tagged @const had both their external prototype and
internal impl generated with const on object, while property
getters only had const on the external API. This is now changed
and it all has const everywhere.

Ref T6859.
2018-04-17 20:31:55 +02:00
Andy Williams cc2b7a10a8 elm_code: Remove a render test and complex workarounds required
Fixes issues with Windows and general unused method warnings
2018-03-28 17:30:17 +01:00
Andy Williams 2aa580b073 elm_code: Fix issue where text selection menu did not show 2018-02-16 14:38:25 +00:00
Sungtaek Hong cb25699dac efl_ui_legacy: add new interface to indicate legacy widget
Summary:
For now, how to check whether a widget is legacy or not
is to check flags in private data or static flag, which is set
during elm_legacy_add.
If Efl.Ui.Legacy interface is added, it can be easilly checked
by efl_isa(obj, EFL_UI_LEGACY_INTERFACE)

Reviewers: woohyun, jpeg, cedric, Jaehyun_Cho

Subscribers: conr2d, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5748
2018-01-24 18:14:26 +09:00
Jean-Philippe Andre e592a0ab5b code widget: Fix order of operations
super functions, when creating stuff, should be called first.
2018-01-16 19:35:54 +09:00
Amitesh Singh 44d3227beb widget: rename elm widget to Efl.Ui.Widget. 2018-01-08 21:28:10 +09:00
Andy Williams 14d10e8b7b elm_code: Cancel selection if clicked outside of the editor area 2017-12-21 22:05:42 +00:00
Andy Williams fcdf4e9d10 elm_code: Correct tooltip behaviour for elm_cde_widget 2017-12-14 08:55:01 +00:00
Andy Williams 433c7ef8fe elm_code: Fix tooltip crash 2017-12-13 22:44:31 +00:00
Sungtaek Hong 3490da0fff elm_code_widget: change efl_add to legacy_add
Summary:
elm_code_widget is legacy add, thus efl_add is not available.

Signed-off-by: Sungtaek Hong <sth253.hong@samsung.com>

Reviewers: jpeg, cedric, ajwillia.ms, woohyun

Differential Revision: https://phab.enlightenment.org/D5548
2017-12-08 16:02:22 +09:00