Commit Graph

184 Commits

Author SHA1 Message Date
Jean-Philippe Andre dee61f4097 elm: Cleanup theme and style set functions
This makes efl_ui_layout_theme_set() return a Theme_Apply error
code. The type is now public as Efl.Ui.Theme.Apply.

Ref T5329
Ref T5363
2017-08-09 17:08:24 +09:00
Jean-Philippe Andre 2450038436 widget: Remove sub_obj arg to resize_object_set
This removes an argument that was false only for a single widget:
naviframe. Hopefully this logic is now simpler, even though it involves
a small hack within naviframe itself.

Ref T5363
2017-08-09 12:21:42 +09:00
Jean-Philippe Andre 9a2d4928f0 elm: Rename elm_layout to Efl.Ui.Layout
Some names have not been changed, hopefully making a distinction
between legacy APIs and internal code (elm_layout_blah) and valid EO
usages.

This means many internal functions are still elm_layout_ as their
sole purpose is to support the legacy API.

Ref T5315
2017-08-08 13:25:58 +09:00
Jean-Philippe Andre 6864495c99 elm: Move elm_layout_sizing_eval to legacy
elm_layout_sizing_eval() marks an object as requiring recalc.

Unfortunately, it's been massively abused by various widgets into
actually doing the calc, or the min calc. So we end up with one API
that has 3 different definitions depending on the widget type:
1. Mark as requiring recalc (correct, respects doc, elm_layout)
2. Calculate min size and other size hints
3. Actually do some geometry modification

I believe we need to clarify these 3 requirements into 3 very clear
and specific APIs in elementary. Right now we have similar functions
in evas for 1 (evas_object_smart_changed) and 3 (smart_calculate).
But their exact definition also isn't necessarily what we want for
elementary.

Another clear problem is that layout_eval does not do any calculation
(in theory), so the "eval" word is a bit of a stretch here.

Once we're sure about the exact API we want, we can add this back to
EO and make it work across our EO widgets. For now let's just keep
the legacy API, and its EO overrides, as is.

Ref T5315
2017-08-08 11:10:56 +09:00
Jean-Philippe Andre 3e5cfb83c0 elm: Remove custom layout signal APIs
This merges them with the now standard interface:
  Efl.Canvas.Layout_Signal

Some wrapping work was required for legacy API which
takes no user_data in del() but instead returns it. The
new EO function, while harder to use, is more correct
(you can't delete the invalid callback by accident, and
this follows EO events design).

Another crazy wrapping was done in entry/text in order
to add the callbacks to 2 objects instead of just one,
and still return the user data.

As for Naviframe and Popup, those two widgets override
signal_emit to forward the call to another object than
the resize object, but not callback_add/del. So they
are definitely broken.

Ref T5315
2017-08-04 11:52:16 +09:00
Jean-Philippe Andre a4940ae6c9 layout: Remove method theme_enable
This was an internal thing, ugly, replaced by another ugly
solution, but maybe less ugly.

Ref T5315
2017-08-04 11:52:16 +09:00
Jean-Philippe Andre 796d4b138b elm: Make content and text aliases internal only
This removes the APIs from the EO API.

Ref T5315
2017-08-04 10:24:03 +09:00
Daniel Hirt 4923945f81 Text: move Annotation type to Efl.Text.Annotate namespace 2017-07-17 17:38:28 +03:00
Daniel Hirt d5f781da2b Efl text: replace all usages of cursor handle to same type
Changes cursor handle name from 'Efl.Text.Cursor.Cursor_Data' to
'Efl.Text.Cursor.Cursor'.
Also, replace all usages of Efl_Canvas_Text_Cursor
with Efl_Text_Cursor_Cursor as the handle for the cursor.
2017-07-17 16:51:45 +03:00
Daniel Hirt e7f7636ac1 Ui text: don't send focus action to cursor on init
It made the cursor animation start on init, even if widget wasn't
focused.
2017-07-17 16:50:31 +03:00
Daniel Hirt 02a607f360 Ui text: set default color (white) 2017-07-17 16:50:31 +03:00
Daniel Hirt f3fff0c687 Ui text: defer region show to job
This moves the region-show logic to the proper update job where
cursors are also updated.
2017-06-21 11:29:34 +03:00
Daniel Hirt ec02b5f3fb Ui text: fix cursor api call
This widget doesn't have a text part.
2017-06-21 11:29:34 +03:00
Jean-Philippe Andre ed41adf791 widget: Implement mirrored from Efl.Ui.Base
Ref T5363
2017-06-14 11:02:05 +09:00
Jean-Philippe Andre 06b14827b7 widget: Implement scale from Efl.Ui.Base 2017-06-12 11:50:30 +09:00
Daniel Hirt 616a60f041 Efl text: shorten naming of methods
eo_prefix are set to "efl_text".
Also, "Efl.Text.Format" is shortened to now include the "_format"
prefix.
"Efl.Text.Font" keeps the "_font" prefix, for better readability.
2017-06-12 00:32:34 +03:00
Daniel Hirt ba45b93b1e Ui text: set some default font and size
This should later be setup through the theme.
One option will be to use global text classes.
Until the above is finalized, at least set this font and size to make
setup of the widget a bit easier.
2017-06-12 00:10:05 +03:00
Daniel Hirt 6c76d799da Text: remove leftover printfs 2017-06-12 00:10:05 +03:00
Daniel Hirt 869da955ec Text: enhance cursor_get to ask for a "get type" 2017-06-12 00:10:05 +03:00
Daniel Hirt 4a1b42aee8 Text: add annotate interface 2017-06-12 00:10:04 +03:00
Daniel Hirt bdf64946a9 Ui text: fix text initialization
It uses elm_layout's, where it shouldn't (it's legacy).
Also, it's not needed to to that there.
2017-06-11 23:58:52 +03:00
Daniel Hirt 30f74a759d Text cursor: add interface and implement in Canvas.Text 2017-06-11 23:58:52 +03:00
Daniel Hirt 97eda67737 Ui text: fix leak of selection on destruction 2017-06-11 23:58:52 +03:00
Daniel Hirt c45e957079 Ui text: initialize potentially unset variables 2017-06-11 23:58:52 +03:00
Daniel Hirt f23d08c56c Ui text: free iterator once done 2017-06-11 23:58:52 +03:00
Daniel Hirt 303d2e79cc Ui text: fix leak in decorations 2017-06-11 23:58:52 +03:00
Daniel Hirt 49b838c448 Canvas text cursor: move to Efl.Canvas.Text namespace
Originally it was its own object.
There are some valid claims that there is no justification for it to
remain an object.
Furthermore, it's apparent that it added little benefit: changes of
each cursors, in practice, triggered a query for all objects of the
same textblock. There wasn't real advantage to have a finer resolution
of controlling the cursors with their own events.

This ports back a lot of code, and changes a lot of other code in the
higher-up widgets, such as Efl.Ui.Text and co.

The usage was replaces from:
  efl_canvas_text_cursor_char_next(cur_obj)
to
  efl_canvas_text_cursor_char_next(text_obj, cur_obj)
that is, it is an operations on the TEXT OBJECT, rather than on the
(now removed) cursor object.

So, one less efl object to worry about now.
Hopefully, the port went smooth.
2017-06-11 23:58:52 +03:00
Daniel Hirt 3eb649b180 Elm layout: replace 'text' property with 'efl_part' interface
The expected usage is efl_text_set(efl_part(layout, part), text);
Same for text_get.

Also, added an example how to make API easier with providing
efl_text_set/get for the widget itself, in efl_ui_button. Please see
this example.
2017-06-05 02:08:03 +03:00
Daniel Hirt 0d83604599 Ui text: use new text api instead of 'style' 2017-05-28 15:34:26 +03:00
Daniel Hirt e55b91aa91 Ui text: use 'wrap' and 'multiline' properties 2017-05-28 15:34:26 +03: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
Daniel Hirt 099c1f2d83 Ui text: fix size evaluation for default setup
Now the size evaluation will query for the native size of the
canvas.text object, and continue with calculations to set the min size
of itself.
This fixes a bug in containers where the widget's size wasn't picked up.

Also, the canvas.text object wasn't reporting 'changed' on text changes.

Signed-off-by: Jean-Philippe Andre <jp.andre@samsung.com>
2017-01-17 14:35:30 +09:00
Daniel Hirt 50c9d1aeaa Ui text: fix deletion of the swallowed text object
The Efl.Canvas.Text object loses its parent due to a specific behavior
of Edje when swallowing objects.
The mentioned object then loses sync with the Ui.Text object, thus not
getting deleted upon destruction - that's actually because Edje
reparents to the canvas upon its own deletion.
Adding this fix until we figure out if there is a better alternative.
2017-01-12 18:15:10 +02:00
Daniel Hirt 43949062eb Ui text: remove unimplemented imf api 2016-12-12 11:21:01 +02:00
Daniel Hirt a8cea307dc Ui text: implement non-editable beahvior
Non-editable behavior resembles a label. It doesn't allow changing the
text in any interactive form. The blinking cursor is also hidden.
Selection, however, it allowed.

Among the changes, I added a test which you can run using:
"elementary_test -to "efl ui text label".
2016-12-12 10:48:28 +02:00
Daniel Hirt b6cf837196 Ui text: fix selection handler behavior 2016-12-12 10:48:28 +02:00
Daniel Hirt c0331b41eb Ui text: implement scrolling with line wrap 2016-12-12 10:48:28 +02:00
Shinwoo Kim e648f1e85e [elementary][atspi] change accessible description to char* from const char*
Summary:
The accessible name is char*, this could confuse API user.
If we provide user callback to get description, an user would return allocated string.
The usage of elm_interface_atspi_description_get/set should be same with elm_interface_atspi_name_get/set

Reviewers: lukasz.stanislawski, cedric, raster

Reviewed By: raster

Subscribers: stanluk, jpeg

Differential Revision: https://phab.enlightenment.org/D4378
2016-11-10 11:11:48 +09: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
Jean-Philippe Andre 8a9f0bd603 evas/elm: Remove function group_resize
This is an override of efl_gfx_size_set. Same as before, the
order of operations matter so it is possible that a corner
case will break. In particular, legacy code was:
 - intercept
 - smart resize (do stuff), super, super, super
 - evas object resize

The new code is more like:
 - intercept
 - super, super, super, evas object resize
 - do stuff

But unfortunately this broke elm_widget (read: all widgets) as
the internal resize was done before the object resize. So,
inside the resize event cb, the resize_obj size would not match
the smart object size. >_<
2016-10-12 11:25:56 +09:00
Jean-Philippe Andre 11b7cf6b72 evas/elm: Remove function group_move
This is an override of efl_gfx_position_set.
As for the other patches, I hope I didn't break anything.

A problem likely to happen is that the super call was inserted
too early or too late in the call flow. For instance:

  _myclass_position_set(obj, x, y) {
    position_set(super(obj), x, y);
    position_get(obj, &prevx, &prevy);
    do_something_with_delta_xy();
  }

The above code flow is obvisouly wrong, but may have crept in this
patch (such a bug sneaked in inside smart object, breaking
everything at first).
2016-10-12 11:25:56 +09:00
Jean-Philippe Andre 97c9fa64a4 evas/elm: Remove group_show and group_hide
These should be just overrides of Efl.Gfx.visible.set. Many
widgets were handling smart show() and hide() manually, which
means this patch is quite large.

Hopefully this doesn't break anything, obviously. But here are
some widgets known to be problematic, as the old code flow was
really strange (sometimes not calling the efl_super function):
 - window
 - notify
2016-10-12 11:25:56 +09:00
Daniel Hirt ed750f091a Ui text: port link anchors from entry
This is without the viewport optimization in the meantime.
2016-10-05 17:12:22 +03:00
Daniel Hirt 42a3c773c0 Ui text: update all decorations on resize 2016-10-05 17:12:22 +03:00
Daniel Hirt bc640e51b6 Ui text: port atspi implementation 2016-10-05 17:12:22 +03: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 a050395770 elm: Fix edit popup menu order
Cut/Copy/Paste is the standard order most other places.
@fix
2016-09-17 23:58:55 +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
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
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
Cedric Bail a7bb1662e2 Revert "elementary/layout: attach edje object API with eo compositing"
This reverts commit 8a988717e1.

It seems we can't actually inherit from class more than once and neither eo
nor eolian will complain about it. You will just get random weird behavior.
This patch should come back once we have made an interface of edje.
2016-08-05 11:09:55 -07:00
Daniel Hirt 979338978a Ui text: remove unused variables 2016-07-19 14:08:48 +00:00
Carsten Haitzler 2936834d31 elementary - fix focus switching again after break
this fixes T4053

this was due to everal widgets haveing changed their class names and
are using the new names for mapping to keybinding config that used
legacy names to match binding to widget.
2016-07-12 18:06:13 +09:00
Daniel Hirt a7cb1eb502 Ui text: track changes made in text object
This is required when a user uses the Efl.Canvas.Text API to change the content.
2016-07-12 11:01:45 +00:00
Daniel Hirt 113f828b3c Ui text: bring back selection handlers support 2016-07-12 11:01:45 +00:00
Daniel Hirt fe69830261 Ui text: cleanup some port leftovers 2016-07-12 11:01:45 +00:00
Daniel Hirt 491b323d06 Ui text: instantiate canvas text obj before smart_add 2016-07-12 11:01:45 +00:00
Daniel Hirt 51e4ec2d5c Ui text: bring back some atspi support 2016-07-12 11:01:45 +00:00
Daniel Hirt 420d9373cf Ui text: cleanup ifdef 2016-07-12 11:01:45 +00:00
Daniel Hirt 2bc943d3bb Ui text: make scroller work 2016-07-12 11:01:45 +00:00
Daniel Hirt 1032198946 Ui text: use the right clip 2016-07-12 11:01:45 +00:00
Daniel Hirt dac18347c4 Ui text: remove old edje callbacks 2016-07-12 11:01:45 +00:00
Daniel Hirt f13b5aebc8 Ui text: port changed_cb from entry 2016-07-03 17:10:57 +00:00
Daniel Hirt 5c776eb534 Ui text: move defer call to a function
Make it easier to call/debug this.
2016-07-03 17:10:57 +00:00
Daniel Hirt eaee241348 Ui text: fix leak in selection_changed 2016-07-03 17:10:56 +00:00
Daniel Hirt 01872dc1e6 Ui text: fix invalid call to image api 2016-07-03 17:10:56 +00:00
Daniel Hirt 391fdc5cac Ui text: send signals to cursors explicitly
The edje code used to register the cursor objects as "edje sub-objects" of the
edje entry object. This is not edje API, so will send these signals explicitly
to the objects.
2016-07-03 17:07:29 +00:00
Jinyong Park 3271ec8d18 theme: return enum from elm_widget_style_set instead of bool
Summary:
if trying to apply incorrect theme, widget apply default theme and return TRUE.
so there is no way to check it really apply correct theme.
To resolve this problem, _elm_theme_set return three type enum

* related history : 4ca3ef4514
* elm_object_style_set is public api, so I didn't change it.
* typedef name [ Theme_Apply ] is temporarily, please suggest better one.

@fix

Reviewers: singh.amitesh, herb, Hermet, cedric, jpeg, raster

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4073
2016-07-01 15:09:43 +09:00
Jee-Yong Um 8a988717e1 elementary/layout: attach edje object API with eo compositing
Test Plan: make check

Reviewers: Hermet, jpeg, cedric

Subscribers: slotus.lee

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

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2016-06-27 11:18:05 -07:00
Daniel Hirt dac29ba70b Ui text: defer decorations to one job
Also, remove callbacks on the deletion.
2016-06-27 15:18:08 +00:00
Daniel Hirt 41de795530 Ui text: port item support from Entry
This uses the annotations API to retrieve items and their geometries, instead of
the old format API.
2016-06-27 15:18:08 +00:00
Daniel Hirt a9546e36ec Ui text: add cursor_new method
The cursor object is meant to be instantiated in the following manner:
   eo_add(EFL_CANVAS_TEXT_CURSOR_CLASS, text_obj,
      efl_canvas_text_cursor_text_object_set(eo_self, text_obj));

This can't be done directly on the Ui Text object, so it has to be with an
method call, sadly.

@feature
2016-06-27 15:18:08 +00:00
Tom Hacohen 2fd8861874 Ui text: Add an editable variant (tiny wrapper).
As part of this commit, also add a way to change whether the widget is
editable or not.
2016-06-22 14:34:38 +01:00
Jean-Philippe Andre 7bf8da2baa evas: Rename Evas.Object to Efl.Canvas.Object
One step closer to make the EO inheritance tree look like
it's all Efl.
2016-06-21 14:35:19 +09:00
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
Stefan Schmidt ecdbde7493 eo: remove now longer needed EO_BASE_BETA define from code base
This was needed when the eo composite object was still in beta. Since commit
d7c45e41d4 this is no longer the case. No beta
part left in eo base so we can safely remove this define.
2016-06-20 10:07:30 +02: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
Jean-Philippe Andre 9a052a740d Evas: Move smart_callbacks_descriptions to legacy 2016-06-17 19:25:47 +09:00
Daniel Hirt 3c5b0bc1b5 Ui text: store SEL_FORMAT_TEXT only for now. 2016-06-16 19:15:20 +01:00
Daniel Hirt aa4b93e250 Ui text: fixup build 2016-06-16 19:15:20 +01:00
Daniel Hirt dbc82782d1 Ui text: introduce this new text widget
This composite object utilizes the Efl.Canvas.Text, Efl.Canvas.Text.Cursor and
Efl.Ui.Interactive API to server as a proper replacement for the Elm Entry
widget.

@feature
2016-06-16 19:15:20 +01:00