summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Hirt <hirt.danny@gmail.com>2017-05-22 17:36:41 +0300
committerDaniel Hirt <hirt.danny@gmail.com>2017-05-28 13:36:16 +0300
commitda2ef30f2b4d53aa3c1658b83c8c8381743469a0 (patch)
treea6c7bc8bdf26546de71592c90ff4b915df4e03dc
parent57a0343775f41e256d8b8d7e0e2faeec19851b09 (diff)
Efl text: add Font, Format and Style interfaces
The following text interfaces are added: - Efl.Text.Font: font settings that decide which font to display in the text - Efl.Text.Format: formatting that affects the looks and layout of the text - Efl.Text.Style: decorations and overlays that shouldn't affect the font choice or the layout @feature
-rw-r--r--src/Makefile_Efl.am3
-rw-r--r--src/lib/efl/Efl.h5
-rw-r--r--src/lib/efl/interfaces/efl_interfaces_main.c3
-rw-r--r--src/lib/efl/interfaces/efl_text_font.eo117
-rw-r--r--src/lib/efl/interfaces/efl_text_format.eo106
-rw-r--r--src/lib/efl/interfaces/efl_text_style.eo257
6 files changed, 491 insertions, 0 deletions
diff --git a/src/Makefile_Efl.am b/src/Makefile_Efl.am
index 5cde197bd2..60041edd6f 100644
--- a/src/Makefile_Efl.am
+++ b/src/Makefile_Efl.am
@@ -16,6 +16,9 @@ efl_eolian_files = \
16 lib/efl/interfaces/efl_part.eo \ 16 lib/efl/interfaces/efl_part.eo \
17 lib/efl/interfaces/efl_player.eo \ 17 lib/efl/interfaces/efl_player.eo \
18 lib/efl/interfaces/efl_text.eo \ 18 lib/efl/interfaces/efl_text.eo \
19 lib/efl/interfaces/efl_text_font.eo \
20 lib/efl/interfaces/efl_text_style.eo \
21 lib/efl/interfaces/efl_text_format.eo \
19 lib/efl/interfaces/efl_text_properties.eo \ 22 lib/efl/interfaces/efl_text_properties.eo \
20 lib/efl/interfaces/efl_gfx_stack.eo \ 23 lib/efl/interfaces/efl_gfx_stack.eo \
21 lib/efl/interfaces/efl_gfx_view.eo \ 24 lib/efl/interfaces/efl_gfx_view.eo \
diff --git a/src/lib/efl/Efl.h b/src/lib/efl/Efl.h
index 4a3f858d11..c428a2dd2f 100644
--- a/src/lib/efl/Efl.h
+++ b/src/lib/efl/Efl.h
@@ -143,6 +143,11 @@ typedef Efl_Gfx_Path_Command_Type Efl_Gfx_Path_Command;
143#include "interfaces/efl_io_buffer.eo.h" 143#include "interfaces/efl_io_buffer.eo.h"
144#include "interfaces/efl_io_queue.eo.h" 144#include "interfaces/efl_io_queue.eo.h"
145 145
146/* Text interfaces */
147#include "interfaces/efl_text_font.eo.h"
148#include "interfaces/efl_text_style.eo.h"
149#include "interfaces/efl_text_format.eo.h"
150
146#else 151#else
147 152
148#ifndef EFL_NOLEGACY_API_SUPPORT 153#ifndef EFL_NOLEGACY_API_SUPPORT
diff --git a/src/lib/efl/interfaces/efl_interfaces_main.c b/src/lib/efl/interfaces/efl_interfaces_main.c
index 1b052e4d94..209f9e4eec 100644
--- a/src/lib/efl/interfaces/efl_interfaces_main.c
+++ b/src/lib/efl/interfaces/efl_interfaces_main.c
@@ -14,6 +14,9 @@
14#include "interfaces/efl_player.eo.c" 14#include "interfaces/efl_player.eo.c"
15#include "interfaces/efl_text.eo.c" 15#include "interfaces/efl_text.eo.c"
16#include "interfaces/efl_text_properties.eo.c" 16#include "interfaces/efl_text_properties.eo.c"
17#include "interfaces/efl_text_font.eo.c"
18#include "interfaces/efl_text_style.eo.c"
19#include "interfaces/efl_text_format.eo.c"
17 20
18#include "interfaces/efl_gfx.eo.c" 21#include "interfaces/efl_gfx.eo.c"
19#include "interfaces/efl_gfx_buffer.eo.c" 22#include "interfaces/efl_gfx_buffer.eo.c"
diff --git a/src/lib/efl/interfaces/efl_text_font.eo b/src/lib/efl/interfaces/efl_text_font.eo
new file mode 100644
index 0000000000..3f4a1ac511
--- /dev/null
+++ b/src/lib/efl/interfaces/efl_text_font.eo
@@ -0,0 +1,117 @@
1// src/lib/efl/interfaces/efl_text_font.eo
2
3enum Efl.Text.Font.Weight {
4 [[Type of font weight]]
5 normal,
6 thin,
7 ultralight,
8 extralight,
9 light,
10 book,
11 medium,
12 semibold,
13 bold,
14 ultrabold,
15 extrabold,
16 black,
17 extrablack,
18}
19
20enum Efl.Text.Font.Width {
21 [[Type of font width]]
22 normal,
23 ultracondensed,
24 extracondensed,
25 condensed,
26 semicondensed,
27 semiexpanded,
28 expanded,
29 extraexpanded,
30 ultraexpanded,
31}
32
33enum Efl.Text.Font.Slant {
34 [[Type of font slant]]
35 normal,
36 oblique,
37 italic,
38}
39
40interface Efl.Text.Font {
41 [[Font settings of the text
42
43 @since 1.20
44 ]]
45 methods {
46 @property font {
47 [[The font name and size that is used for the displayed text]]
48 values {
49 font: string;
50 size: int;
51 }
52 }
53 @property font_source {
54 [[The source that will be used to lookup the font of the text
55
56 The source can be either a path to a font file e.g.
57 "/path/to/font.ttf", or an eet file e.g. "/path/to/font.eet".
58 ]]
59 values {
60 font_source: string;
61 }
62 }
63
64 @property font_fallbacks {
65 [[Comma-separated list of font fallbacks
66
67 Will be used in case the primary font isn't available.
68 ]]
69 values {
70 font_fallbacks: string;
71 }
72 }
73
74 @property font_weight {
75 [[Type of weight of the displayed font
76
77 Default is $Efl.Text.Font.Weight.normal\.
78 ]]
79 values {
80 font_weight: Efl.Text.Font.Weight;
81 }
82 }
83
84 @property font_slant {
85 [[Type of slant of the displayed font
86
87 Default is $Efl.Text.Font.Slant.normal\.
88 ]]
89 values {
90 style: Efl.Text.Font.Slant;
91 }
92 }
93
94 @property font_width {
95 [[Type of width of the displayed font
96
97 Default is $Efl.Text.Font.Width.normal\.
98 ]]
99 values {
100 width: Efl.Text.Font.Width;
101 }
102 }
103
104 @property font_lang {
105 [[Specific language of the displayed font
106
107 This is used to lookup fonts suitable to the specified language, as
108 well as helping the font shaper backend.
109 The language $lang can be either a code e.g "en_US",
110 "auto" to use the system locale, or "none".
111 ]]
112 values {
113 lang: string;
114 }
115 }
116 }
117}
diff --git a/src/lib/efl/interfaces/efl_text_format.eo b/src/lib/efl/interfaces/efl_text_format.eo
new file mode 100644
index 0000000000..acc58b9cc3
--- /dev/null
+++ b/src/lib/efl/interfaces/efl_text_format.eo
@@ -0,0 +1,106 @@
1enum Efl.Text.Format.Wrap {
2 [[Wrap mode of the text (not in effect if not multiline)]]
3 none,
4 char,
5 word,
6 mixed,
7 hyphenation
8}
9
10interface Efl.Text.Format {
11 [[The look and layout of the text
12
13 The text format can affect the geometry of the text object, as well as
14 how characters are presented.
15
16 @since 1.20
17 ]]
18 methods {
19 @property format_ellipsis {
20 [[Ellipsis value (number from -1.0 to 1.0)]]
21 values
22 {
23 value: double;
24 }
25 }
26
27 @property format_wrap {
28 [[Wrap mode for use in the text]]
29 values {
30 wrap: Efl.Text.Format.Wrap;
31 }
32 }
33
34 @property format_multiline {
35 [[Multiline is enabled or not]]
36 values {
37 enabled: bool;
38 }
39 }
40
41 @property format_halign {
42 [[Horizontal alignment of text (number from 0.0 to 1.0)]]
43 values
44 {
45 value: double;
46 }
47 }
48
49 @property format_valign {
50 [[Vertical alignment of text (number from -1.0 to 1.0)]]
51 values
52 {
53 value: double;
54 }
55 }
56
57 @property format_linegap {
58 [[Minimal line gap (top and bottom) for each line in the text
59
60 $value is absolute size.
61 ]]
62 values
63 {
64 value: double;
65 }
66 }
67
68 @property format_linerelgap {
69 [[Relative line gap (top and bottom) for each line in the text
70
71 The original line gap value is multiplied by $value.
72 ]]
73 values
74 {
75 value: double;
76 }
77 }
78
79 @property format_tabstops {
80 [[Tabstops value]]
81 values
82 {
83 value: int;
84 }
85 }
86
87 @property format_password {
88 [[Whether text is a password]]
89 values
90 {
91 enabled: bool;
92 }
93 }
94
95 @property format_replacement_char {
96 [[The character used to replace characters that can not be displayed
97
98 Currently, only used to replace characters if @.format_password
99 is enabled.
100 ]]
101 values {
102 repch: string;
103 }
104 }
105 }
106}
diff --git a/src/lib/efl/interfaces/efl_text_style.eo b/src/lib/efl/interfaces/efl_text_style.eo
new file mode 100644
index 0000000000..136a80fe20
--- /dev/null
+++ b/src/lib/efl/interfaces/efl_text_style.eo
@@ -0,0 +1,257 @@
1enum Efl.Text.Style.Backing_Type
2{
3 [[Whether to apply backing style to the displayed text or not]]
4 disabled = 0, [[Do not use backing]]
5 enabled, [[Use backing style]]
6}
7
8enum Efl.Text.Style.Strikethrough_Type
9{
10 [[Whether to apply strikethrough style to the displayed text or not]]
11 disabled = 0, [[Do not use strikethrough]]
12 enabled, [[Use strikethrough style]]
13}
14
15enum Efl.Text.Style.Effect_Type
16{
17 [[Effect to apply to the displayed text]]
18 none = 0,
19
20 // colored with shadow_color
21 shadow,
22 far_shadow,
23 soft_shadow,
24 far_soft_shadow,
25 // colored with glow_color
26 glow,
27 // colored with outline_color
28 outline,
29 soft_outline,
30 // colored with outline_color + shadow_color
31 outline_shadow,
32 outline_soft_shadow,
33}
34
35enum Efl.Text.Style.Shadow_Direction
36{
37 [[Direction of the shadow style, if used]]
38 bottom_right = 0,
39 bottom,
40 bottom_left,
41 left,
42 top_left,
43 top,
44 top_right,
45 right,
46}
47
48enum Efl.Text.Style.Underline_Type
49{
50 [[Underline type of the displayed text]]
51 off = 0,
52 on,
53 single,
54 double,
55 dashed,
56}
57
58interface Efl.Text.Style {
59 [[Style to apply to the text
60
61 A style can be coloring, effects, underline, strikethrough etc.
62
63 @since 1.20
64 ]]
65 methods {
66 @property normal_color {
67 [[Color of text, excluding style]]
68 values
69 {
70 r: ubyte;
71 g: ubyte;
72 b: ubyte;
73 a: ubyte;
74 }
75 }
76
77 @property backing_type {
78 values
79 {
80 type: Efl.Text.Style.Backing_Type;
81 }
82 }
83
84 @property backing_color {
85 values
86 {
87 r: ubyte;
88 g: ubyte;
89 b: ubyte;
90 a: ubyte;
91 }
92 }
93
94 @property underline_type {
95 [[Sets an underline style on the text]]
96 values
97 {
98 type: Efl.Text.Style.Underline_Type;
99 }
100 }
101
102 @property underline_color
103 {
104 [[Color of normal underline style]]
105 values
106 {
107 r: ubyte;
108 g: ubyte;
109 b: ubyte;
110 a: ubyte;
111 }
112 }
113
114 @property underline_height
115 {
116 [[Height of underline style]]
117 values
118 {
119 height: double;
120 }
121 }
122
123 @property underline_dashed_color
124 {
125 [[Color of dashed underline style]]
126 values
127 {
128 r: ubyte;
129 g: ubyte;
130 b: ubyte;
131 a: ubyte;
132 }
133 }
134
135 @property underline_dashed_width
136 {
137 [[Width of dashed underline style]]
138 values
139 {
140 width: int;
141 }
142 }
143
144 @property underline_dashed_gap
145 {
146 [[Gap of dashed underline style]]
147 values
148 {
149 gap: int;
150 }
151 }
152
153 @property underline2_type
154 {
155 [[Type of underline2 style]]
156 values
157 {
158 type: Efl.Text.Style.Underline_Type;
159 }
160 }
161
162 @property underline2_color
163 {
164 [[Color of underline2 style]]
165 values
166 {
167 r: ubyte;
168 g: ubyte;
169 b: ubyte;
170 a: ubyte;
171 }
172 }
173
174 @property strikethrough_type {
175 [[Type of strikethrough style]]
176 values
177 {
178 type: Efl.Text.Style.Strikethrough_Type;
179 }
180 }
181
182 @property strikethrough_color
183 {
184 [[Color of strikethrough_style]]
185 values
186 {
187 r: ubyte;
188 g: ubyte;
189 b: ubyte;
190 a: ubyte;
191 }
192 }
193
194 @property effect_type {
195 [[Type of effect used for the displayed text]]
196 values {
197 type: Efl.Text.Style.Effect_Type;
198 }
199 }
200 @property outline_color
201 {
202 [[Color of outline effect]]
203 values
204 {
205 r: ubyte;
206 g: ubyte;
207 b: ubyte;
208 a: ubyte;
209 }
210 }
211
212 @property shadow_direction
213 {
214 [[Direction of shadow effect]]
215 values
216 {
217 type: Efl.Text.Style.Shadow_Direction;
218 }
219 }
220
221 @property shadow_color
222 {
223 [[Color of shadow effect]]
224 values
225 {
226 r: ubyte;
227 g: ubyte;
228 b: ubyte;
229 a: ubyte;
230 }
231 }
232
233 @property glow_color
234 {
235 [[Color of glow effect]]
236 values
237 {
238 r: ubyte;
239 g: ubyte;
240 b: ubyte;
241 a: ubyte;
242 }
243 }
244
245 @property glow2_color
246 {
247 [[Second color of the glow effect]]
248 values
249 {
250 r: ubyte;
251 g: ubyte;
252 b: ubyte;
253 a: ubyte;
254 }
255 }
256 }
257}