2019-03-08 06:55:43 -08:00
|
|
|
enum @beta Efl.Canvas.Layout_Part_Text_Expand
|
2018-11-06 06:52:53 -08:00
|
|
|
{
|
2019-07-08 07:56:49 -07:00
|
|
|
[[Text layout policy to enforce. If none is set, only min/max descriptions
|
|
|
|
are taken into account.
|
2018-11-06 06:52:53 -08:00
|
|
|
]]
|
2019-07-08 07:56:49 -07:00
|
|
|
none = 0, [[No policy. Use default description parameters.]]
|
|
|
|
min_x = 1, [[Text is tied to the left side of the container.]]
|
|
|
|
min_y = 1 << 1, [[Text is tied to the top side of the container.]]
|
|
|
|
max_x = 1 << 2, [[Text is tied to the right side of the container.]]
|
|
|
|
max_y = 1 << 3, [[Text is tied to the bottom side of the container.]]
|
2018-11-06 06:52:53 -08:00
|
|
|
}
|
|
|
|
|
2019-02-14 08:37:02 -08:00
|
|
|
class @beta Efl.Canvas.Layout_Part_Text extends Efl.Canvas.Layout_Part implements Efl.Text,
|
Efl.Text.Cursor
Summary:
Implementation of new cursor text object.
This Patch Contains :
1- Remove Efl.Text.Cursor & Efl.Text_Markup_Interactive interfaces and replace them with one Class Efl.Text.Cursor
=> there are some modifications on cursor methods
2- Update all related classes to use Efl.Text.Cursor object instead of the old interfaces
3- If class uses Efl.Text_Cursor_Cursor (handle), mainly annotation it will stay as it is until we update other annotations into attribute_factory
4- Add main cursor property into efl.text.interactive
5- Add cursor_new method in efl.ui.text (I think we may move it into efl.text.interactive interface)
There still some parts that need discussion: especially cursor movement functionality, I prefer to move function with Enum, instead of special function for each movement.
```
enum @beta Efl.Text.Cursor_Move_Type
{
[[Text cursor movement types]]
char_next, [[Advances to the next character]]
char_prev, [[Advances to the previous character]]
cluster_next, [[Advances to the next grapheme cluster]]
cluster_prev, [[Advances to the previous grapheme cluster]]
paragraph_start, [[Advances to the first character in this paragraph]]
paragraph_end, [[Advances to the last character in this paragraph]]
word_start, [[Advance to current word start]]
word_end, [[Advance to current word end]]
line_start, [[Advance to current line first character]]
line_end, [[Advance to current line last character]]
paragraph_first, [[Advance to current paragraph first character]]
paragraph_last, [[Advance to current paragraph last character]]
paragraph_next, [[Advances to the start of the next text node]]
paragraph_prev [[Advances to the end of the previous text node]]
}
move {
[[Move the cursor]]
params {
@in type: Efl.Text.Cursor_Move_Type; [[The type of movement]]
}
return: bool; [[True if actually moved]]
}
```
or old way:
```
char_next {
[[Advances to the next character]]
// FIXME: Make the number of characters we moved by? Useful for all the other functions
return: bool; [[True if actually moved]]
}
char_prev {
[[Advances to the previous character]]
return: bool; [[True if actually moved]]
}
char_delete {
[[Deletes a single character from position pointed by given cursor.]]
}
cluster_next {
[[Advances to the next grapheme cluster]]
return: bool; [[True if actually moved]]
}
cluster_prev {
[[Advances to the previous grapheme cluster]]
return: bool; [[True if actually moved]]
}
// FIXME: paragraph_end is inconsistent with word_end. The one goes to the last character and the other after the last character.
paragraph_start {
[[Advances to the first character in this paragraph]]
return: bool; [[True if actually moved]]
}
paragraph_end {
[[Advances to the last character in this paragraph]]
return: bool; [[True if actually moved]]
}
word_start {
[[Advance to current word start]]
return: bool; [[True if actually moved]]
}
word_end {
[[Advance to current word end]]
return: bool; [[True if actually moved]]
}
line_start {
[[Advance to current line first character]]
return: bool; [[True if actually moved]]
}
line_end {
[[Advance to current line last character]]
return: bool; [[True if actually moved]]
}
paragraph_first {
[[Advance to current paragraph first character]]
return: bool; [[True if actually moved]]
}
paragraph_last {
[[Advance to current paragraph last character]]
return: bool; [[True if actually moved]]
}
paragraph_next {
[[Advances to the start of the next text node]]
return: bool; [[True if actually moved]]
}
paragraph_prev {
[[Advances to the end of the previous text node]]
return: bool; [[True if actually moved]]
}
```
Reviewers: woohyun, tasn, segfaultxavi
Reviewed By: woohyun
Subscribers: a.srour, bu5hm4n, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D10542
2019-11-22 00:35:54 -08:00
|
|
|
Efl.Text_Markup, Efl.Text_Format, Efl.Text_Font, Efl.Text_Style
|
2017-05-30 00:31:19 -07:00
|
|
|
{
|
|
|
|
[[Represents a TEXT part of a layout
|
|
|
|
|
|
|
|
Its lifetime is limited to one function call only, unless an extra
|
2017-12-22 02:30:32 -08:00
|
|
|
reference is explicitly held.
|
2017-05-30 00:31:19 -07:00
|
|
|
]]
|
2018-11-06 06:52:53 -08:00
|
|
|
methods {
|
|
|
|
@property text_expand {
|
|
|
|
[[Sizing policy for text parts.
|
|
|
|
|
|
|
|
This will determine whether to consider height or width
|
|
|
|
constraints, if text-specific behaviors occur (such as ellipsis,
|
|
|
|
line-wrapping etc.
|
2019-01-18 05:22:23 -08:00
|
|
|
]]
|
2018-11-06 06:52:53 -08:00
|
|
|
values {
|
2019-07-08 07:56:49 -07:00
|
|
|
type: Efl.Canvas.Layout_Part_Text_Expand; [[Desired sizing policy.]]
|
2018-11-06 06:52:53 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2017-05-30 00:31:19 -07:00
|
|
|
data: null;
|
|
|
|
implements {
|
|
|
|
Efl.Text.text { set; get; }
|
2018-04-06 04:30:40 -07:00
|
|
|
Efl.Text_Markup.markup { get; set; }
|
2018-11-06 06:52:53 -08:00
|
|
|
Efl.Text_Format.ellipsis { set; get; }
|
|
|
|
Efl.Text_Format.wrap { set; get; }
|
2019-11-27 23:55:26 -08:00
|
|
|
Efl.Text_Font.font_family { set; get; }
|
|
|
|
Efl.Text_Font.font_size { set; get; }
|
2018-11-06 06:52:53 -08:00
|
|
|
Efl.Text_Style.normal_color { set; get; }
|
|
|
|
Efl.Text_Style.backing_type { set; get; }
|
|
|
|
Efl.Text_Style.backing_color { set; get;}
|
|
|
|
Efl.Text_Style.underline_type { set; }
|
|
|
|
Efl.Text_Style.underline_color { set; get; }
|
|
|
|
Efl.Text_Style.underline2_color { set; get; }
|
|
|
|
Efl.Text_Style.underline_dashed_color { set; get; }
|
|
|
|
Efl.Text_Style.underline_height { set; }
|
|
|
|
Efl.Text_Style.underline_dashed_width { set; }
|
|
|
|
Efl.Text_Style.underline_dashed_gap { set; }
|
|
|
|
Efl.Text_Style.strikethrough_type { set; }
|
|
|
|
Efl.Text_Style.strikethrough_color { set; get; }
|
|
|
|
Efl.Text_Style.effect_type { set; }
|
|
|
|
Efl.Text_Style.shadow_direction { set; }
|
|
|
|
Efl.Text_Style.outline_color { set; get; }
|
|
|
|
Efl.Text_Style.shadow_color { set; get; }
|
|
|
|
Efl.Text_Style.glow_color { set; get; }
|
|
|
|
Efl.Text_Style.glow2_color { set; get; }
|
2017-05-30 00:31:19 -07:00
|
|
|
}
|
|
|
|
}
|