summaryrefslogtreecommitdiff
path: root/src/lib/efl/interfaces/efl_text_cursor.eo
diff options
context:
space:
mode:
authorAli Alzyod <ali198724@gmail.com>2019-11-22 17:35:54 +0900
committerWooHyun Jung <wh0705.jung@samsung.com>2019-11-22 17:35:54 +0900
commitd7352f4db41dc8975eaeb3f79dff326338a5a63c (patch)
treebe0fc63995e40f4c3a764f2ffdb66716dfcc6c38 /src/lib/efl/interfaces/efl_text_cursor.eo
parent17ba8515f1c9534ebd47a71adda71db2eff6799a (diff)
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
Diffstat (limited to '')
-rw-r--r--src/lib/efl/interfaces/efl_text_cursor.eo246
1 files changed, 0 insertions, 246 deletions
diff --git a/src/lib/efl/interfaces/efl_text_cursor.eo b/src/lib/efl/interfaces/efl_text_cursor.eo
deleted file mode 100644
index cef645a173..0000000000
--- a/src/lib/efl/interfaces/efl_text_cursor.eo
+++ /dev/null
@@ -1,246 +0,0 @@
1import eina_types;
2import efl_text_types;
3
4enum @beta Efl.Text_Cursor_Get_Type {
5 [[All available cursor states]]
6 default = 0, [[Main cursor state (alias to "main")]]
7 main, [[Main cursor state]]
8 selection_begin, [[Selection begin cursor state]]
9 selection_end, [[Selection end cursor state]]
10 preedit_start, [[Pre-edit start cursor state]]
11 preedit_end, [[Pre-edit end cursor state]]
12 user, [[User cursor state]]
13 user_extra [[User extra cursor state]]
14}
15
16enum @beta Efl.Text_Cursor_Type
17{
18 [[Text cursor types]]
19 before, [[Cursor type before]]
20 under [[Cursor type under]]
21}
22
23interface @beta Efl.Text_Cursor {
24 [[Cursor API
25 ]]
26 methods {
27 // Cursor
28 @property text_cursor {
29 [[The object's main cursor.
30 ]]
31 get {
32 return: ptr(Efl.Text_Cursor_Cursor); [[Text cursor object]]
33 }
34 keys {
35 get_type: Efl.Text_Cursor_Get_Type; [[Cursor type]]
36 }
37 }
38 @property cursor_position {
39 [[Cursor position]]
40 set { }
41 get { }
42 values {
43 position: int; [[Cursor position]]
44 }
45 keys {
46 cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
47 }
48 }
49 @property cursor_content {
50 [[The content of the cursor (the character under the cursor)]]
51 get {
52 }
53 values {
54 content: Eina.Unicode; [[The unicode codepoint of the character]]
55 }
56 keys {
57 cur: ptr(const(Efl.Text_Cursor_Cursor)); [[Cursor object]]
58 }
59 }
60 @property cursor_geometry {
61 [[Returns the geometry of two cursors ("split cursor"), if logical cursor is
62 between LTR/RTL text, also considering paragraph direction.
63 Upper cursor is shown for the text of the same direction as paragraph,
64 lower cursor - for opposite.
65
66 Split cursor geometry is valid only in '|' cursor mode.
67 In this case $true is returned and $cx2, $cy2, $cw2, $ch2 are set.
68 ]]
69 get {
70 return: bool; [[ $true if split cursor, $false otherwise.]]
71 }
72 keys {
73 cur: ptr(const(Efl.Text_Cursor_Cursor)); [[Cursor object]]
74 ctype: Efl.Text_Cursor_Type; [[The type of the cursor.]]
75 }
76 values {
77 cx: int; [[The x of the cursor (or upper cursor)]]
78 cy: int; [[The y of the cursor (or upper cursor)]]
79 cw: int; [[The width of the cursor (or upper cursor)]]
80 ch: int; [[The height of the cursor (or upper cursor)]]
81 cx2: int; [[The x of the lower cursor]]
82 cy2: int; [[The y of the lower cursor]]
83 cw2: int; [[The width of the lower cursor]]
84 ch2: int; [[The height of the lower cursor]]
85 }
86 }
87 cursor_new {
88 [[Create new cursor]]
89 return: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
90 }
91 cursor_free {
92 [[Free existing cursor]]
93 params {
94 cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
95 }
96 }
97 cursor_equal {
98 [[Check if two cursors are equal]]
99 params {
100 @in cur1: ptr(const(Efl.Text_Cursor_Cursor)); [[Cursor 1 object]]
101 @in cur2: ptr(const(Efl.Text_Cursor_Cursor)); [[Cursor 2 object]]
102 }
103 return: bool; [[$true if cursors are equal, $false otherwise]]
104 }
105 cursor_compare {
106 [[Compare two cursors]]
107 params {
108 @in cur1: ptr(const(Efl.Text_Cursor_Cursor)); [[Cursor 1 object]]
109 @in cur2: ptr(const(Efl.Text_Cursor_Cursor)); [[Cursor 2 object]]
110 }
111 return: int; [[Difference between cursors]]
112 }
113 cursor_copy {
114 [[Copy existing cursor]]
115 params {
116 /* @out */ dst: ptr(Efl.Text_Cursor_Cursor); [[Destination cursor]]
117 @in src: ptr(const(Efl.Text_Cursor_Cursor)); [[Source cursor]]
118 }
119 }
120 cursor_char_next {
121 [[Advances to the next character]]
122 params {
123 /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
124 }
125 }
126 cursor_char_prev {
127 [[Advances to the previous character]]
128 params {
129 /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
130 }
131 }
132 cursor_cluster_next {
133 [[Advances to the next grapheme cluster]]
134 params {
135 /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
136 }
137 }
138 cursor_cluster_prev {
139 [[Advances to the previous grapheme cluster]]
140 params {
141 /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
142 }
143 }
144 cursor_paragraph_char_first {
145 [[Advances to the first character in this paragraph]]
146 params {
147 /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
148 }
149 }
150 cursor_paragraph_char_last {
151 [[Advances to the last character in this paragraph]]
152 params {
153 /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
154 }
155 }
156 cursor_word_start {
157 [[Advance to current word start]]
158 params {
159 /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
160 }
161 }
162 cursor_word_end {
163 [[Advance to current word end]]
164 params {
165 /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
166 }
167 }
168 cursor_line_char_first {
169 [[Advance to current line first character]]
170 params {
171 /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
172 }
173 }
174 cursor_line_char_last {
175 [[Advance to current line last character]]
176 params {
177 /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
178 }
179 }
180 cursor_paragraph_first {
181 [[Advance to current paragraph first character]]
182 params {
183 /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
184 }
185 }
186 cursor_paragraph_last {
187 [[Advance to current paragraph last character]]
188 params {
189 /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
190 }
191 }
192 cursor_paragraph_next {
193 [[Advances to the start of the next text node]]
194 params {
195 /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
196 }
197 }
198 cursor_paragraph_prev {
199 [[Advances to the end of the previous text node]]
200 params {
201 /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
202 }
203 }
204 cursor_line_jump_by {
205 [[Jump the cursor by the given number of lines]]
206 params {
207 /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
208 by: int; [[Number of lines]]
209 }
210 }
211 cursor_coord_set {
212 [[Set cursor coordinates]]
213 params {
214 /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
215 @in x: int; [[X coord to set by.]]
216 @in y: int; [[Y coord to set by.]]
217 }
218 }
219 cursor_cluster_coord_set {
220 [[Set cursor coordinates according to grapheme clusters.
221 It does not allow to put a cursor to the middle of a grapheme cluster.
222 ]]
223 params {
224 /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
225 @in x: int; [[X coord to set by.]]
226 @in y: int; [[Y coord to set by.]]
227 }
228 }
229 cursor_text_insert {
230 [[Adds text to the current cursor position and set the cursor to
231 *after* the start of the text just added.
232 ]]
233 params {
234 /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
235 @in text: string; [[Text to append (UTF-8 format).]]
236 }
237 return: int; [[Length of the appended text.]]
238 }
239 cursor_char_delete {
240 [[Deletes a single character from position pointed by given cursor.]]
241 params {
242 /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
243 }
244 }
245 }
246}