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-25 14:26:59 +0300
commit68ef870f1428cf2255bba1273a6819a44daaafde (patch)
tree9d3dc85137c0b6d72db41a8ff283a2972e603e25
parent1624417d9137b87826962e431d08dc591f83d5e5 (diff)
downloadefl-68ef870f1428cf2255bba1273a6819a44daaafde.tar.gz
Efl text: add Font, Format and Style interfaces
-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.eo114
-rw-r--r--src/lib/efl/interfaces/efl_text_format.eo99
-rw-r--r--src/lib/efl/interfaces/efl_text_style.eo255
-rw-r--r--src/lib/evas/canvas/efl_canvas_text.eo37
7 files changed, 515 insertions, 1 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 = \
lib/efl/interfaces/efl_part.eo \
lib/efl/interfaces/efl_player.eo \
lib/efl/interfaces/efl_text.eo \
+ lib/efl/interfaces/efl_text_font.eo \
+ lib/efl/interfaces/efl_text_style.eo \
+ lib/efl/interfaces/efl_text_format.eo \
lib/efl/interfaces/efl_text_properties.eo \
lib/efl/interfaces/efl_gfx_stack.eo \
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;
#include "interfaces/efl_io_buffer.eo.h"
#include "interfaces/efl_io_queue.eo.h"
+/* Text interfaces */
+#include "interfaces/efl_text_font.eo.h"
+#include "interfaces/efl_text_style.eo.h"
+#include "interfaces/efl_text_format.eo.h"
+
#else
#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 @@
#include "interfaces/efl_player.eo.c"
#include "interfaces/efl_text.eo.c"
#include "interfaces/efl_text_properties.eo.c"
+#include "interfaces/efl_text_font.eo.c"
+#include "interfaces/efl_text_style.eo.c"
+#include "interfaces/efl_text_format.eo.c"
#include "interfaces/efl_gfx.eo.c"
#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..931cdc722b
--- /dev/null
+++ b/src/lib/efl/interfaces/efl_text_font.eo
@@ -0,0 +1,114 @@
+// src/lib/efl/interfaces/efl_text_font.eo
+
+enum Efl.Text.Font.Weight {
+ [[Type of font weight]]
+ normal,
+ thin,
+ ultralight,
+ extralight,
+ light,
+ book,
+ medium,
+ semibold,
+ bold,
+ ultrabold,
+ extrabold,
+ black,
+ extrablack,
+}
+
+enum Efl.Text.Font.Width {
+ [[Type of font width]]
+ normal,
+ ultracondensed,
+ extracondensed,
+ condensed,
+ semicondensed,
+ semiexpanded,
+ expanded,
+ extraexpanded,
+ ultraexpanded,
+}
+
+enum Efl.Text.Font.Slant {
+ [[Type of font slant]]
+ normal,
+ oblique,
+ italic,
+}
+
+interface Efl.Text.Font {
+ [[Efl text font interface]]
+ methods {
+ @property font {
+ [[The font name and size that is used for the displayed text]]
+ values {
+ font: string;
+ size: int;
+ }
+ }
+ @property font_source {
+ [[The source that will be used to lookup the font of the text
+
+ The source can be either a path to a font file e.g.
+ "/path/to/font.ttf", or an eet file e.g. "/path/to/font.eet".
+ ]]
+ values {
+ font_source: string;
+ }
+ }
+
+ @property font_fallbacks {
+ [[Comma-separated list of font fallbacks
+
+ Will be used in case the primary font isn't available.
+ ]]
+ values {
+ font_fallbacks: string;
+ }
+ }
+
+ @property font_weight {
+ [[Type of weight of the displayed font
+
+ Default is $Efl.Text.Font.Weight.normal\.
+ ]]
+ values {
+ font_weight: Efl.Text.Font.Weight;
+ }
+ }
+
+ @property font_slant {
+ [[Type of slant of the displayed font
+
+ Default is $Efl.Text.Font.Slant.normal\.
+ ]]
+ values {
+ style: Efl.Text.Font.Slant;
+ }
+ }
+
+ @property font_width {
+ [[Type of width of the displayed font
+
+ Default is $Efl.Text.Font.Width.normal\.
+ ]]
+ values {
+ width: Efl.Text.Font.Width;
+ }
+ }
+
+ @property font_lang {
+ [[Specific language of the displayed font
+
+ This is used to lookup fonts suitable to the specified language, as
+ well as helping the font shaper backend.
+ The language $lang can be either a code e.g "en_US",
+ "auto" to use the system locale, or "none".
+ ]]
+ values {
+ lang: string;
+ }
+ }
+ }
+}
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..b900b2ca7b
--- /dev/null
+++ b/src/lib/efl/interfaces/efl_text_format.eo
@@ -0,0 +1,99 @@
+enum Efl.Text.Format.Wrap {
+ [[Wrap mode of the text (not in effect if not multiline)]]
+ none,
+ char,
+ word,
+ mixed,
+ hyphenation
+}
+
+interface Efl.Text.Format {
+ methods {
+ @property format_ellipsis {
+ [[Ellipsis value (number from -1.0 to 1.0)]]
+ values
+ {
+ value: double;
+ }
+ }
+
+ @property format_wrap {
+ [[Wrap mode for use in the text]]
+ values {
+ wrap: Efl.Text.Format.Wrap;
+ }
+ }
+
+ @property format_multiline {
+ [[Multiline is enabled or not]]
+ values {
+ enabled: bool;
+ }
+ }
+
+ @property format_halign {
+ [[Horizontal alignment of text (number from 0.0 to 1.0)]]
+ values
+ {
+ value: double;
+ }
+ }
+
+ @property format_valign {
+ [[Vertical alignment of text (number from -1.0 to 1.0)]]
+ values
+ {
+ value: double;
+ }
+ }
+
+ @property format_linegap {
+ [[Minimal line gap (top and bottom) for each line in the text
+
+ $value is absolute size.
+ ]]
+ values
+ {
+ value: double;
+ }
+ }
+
+ @property format_linerelgap {
+ [[Relative line gap (top and bottom) for each line in the text
+
+ The original line gap value is multiplied by $value.
+ ]]
+ values
+ {
+ value: double;
+ }
+ }
+
+ @property format_tabstops {
+ [[Tabstops value]]
+ values
+ {
+ value: int;
+ }
+ }
+
+ @property format_password {
+ [[Whether text is a password]]
+ values
+ {
+ enabled: bool;
+ }
+ }
+
+ @property format_replacement_char {
+ [[The character used to replace characters that can not be displayed
+
+ Currently, only used to replace characters if @.format_password
+ is enabled.
+ ]]
+ values {
+ repch: string;
+ }
+ }
+ }
+}
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..c23e344f69
--- /dev/null
+++ b/src/lib/efl/interfaces/efl_text_style.eo
@@ -0,0 +1,255 @@
+enum Efl.Text.Style.Backing_Type
+{
+ [[Whether to apply backing style to the displayed text or not]]
+ disabled = 0, [[Do not use backing]]
+ enabled, [[Use backing style]]
+}
+
+enum Efl.Text.Style.Strikethrough_Type
+{
+ [[Whether to apply strikethrough style to the displayed text or not]]
+ disabled = 0, [[Do not use strikethrough]]
+ enabled, [[Use strikethrough style]]
+}
+
+enum Efl.Text.Style.Effect_Type
+{
+ [[Effect to apply to the displayed text]]
+ none = 0,
+
+ // colored with shadow_color
+ shadow,
+ far_shadow,
+ soft_shadow,
+ far_soft_shadow,
+ // colored with glow_color
+ glow,
+ // colored with outline_color
+ outline,
+ soft_outline,
+ // colored with outline_color + shadow_color
+ outline_shadow,
+ outline_soft_shadow,
+}
+
+enum Efl.Text.Style.Shadow_Direction
+{
+ [[Direction of the shadow style, if used]]
+ bottom_right = 0,
+ bottom,
+ bottom_left,
+ left,
+ top_left,
+ top,
+ top_right,
+ right,
+}
+
+enum Efl.Text.Style.Underline_Type
+{
+ [[Underline type of the displayed text]]
+ off = 0,
+ on,
+ single,
+ double,
+ dashed,
+}
+
+interface Efl.Text.Style {
+ [[Style to apply to the text
+
+ A style can be coloring, effects, underline, strikethrough etc.
+ ]]
+ methods {
+ @property normal_color {
+ [[Color of text, excluding style]]
+ values
+ {
+ r: ubyte;
+ g: ubyte;
+ b: ubyte;
+ a: ubyte;
+ }
+ }
+
+ @property backing_type {
+ values
+ {
+ type: Efl.Text.Style.Backing_Type;
+ }
+ }
+
+ @property backing_color {
+ values
+ {
+ r: ubyte;
+ g: ubyte;
+ b: ubyte;
+ a: ubyte;
+ }
+ }
+
+ @property underline_type {
+ [[Sets an underline style on the text]]
+ values
+ {
+ type: Efl.Text.Style.Underline_Type;
+ }
+ }
+
+ @property underline_color
+ {
+ [[Color of normal underline style]]
+ values
+ {
+ r: ubyte;
+ g: ubyte;
+ b: ubyte;
+ a: ubyte;
+ }
+ }
+
+ @property underline_height
+ {
+ [[Height of underline style]]
+ values
+ {
+ height: double;
+ }
+ }
+
+ @property underline_dashed_color
+ {
+ [[Color of dashed underline style]]
+ values
+ {
+ r: ubyte;
+ g: ubyte;
+ b: ubyte;
+ a: ubyte;
+ }
+ }
+
+ @property underline_dashed_width
+ {
+ [[Width of dashed underline style]]
+ values
+ {
+ width: int;
+ }
+ }
+
+ @property underline_dashed_gap
+ {
+ [[Gap of dashed underline style]]
+ values
+ {
+ gap: int;
+ }
+ }
+
+ @property underline2_type
+ {
+ [[Type of underline2 style]]
+ values
+ {
+ type: Efl.Text.Style.Underline_Type;
+ }
+ }
+
+ @property underline2_color
+ {
+ [[Color of underline2 style]]
+ values
+ {
+ r: ubyte;
+ g: ubyte;
+ b: ubyte;
+ a: ubyte;
+ }
+ }
+
+ @property strikethrough_type {
+ [[Type of strikethrough style]]
+ values
+ {
+ type: Efl.Text.Style.Strikethrough_Type;
+ }
+ }
+
+ @property strikethrough_color
+ {
+ [[Color of strikethrough_style]]
+ values
+ {
+ r: ubyte;
+ g: ubyte;
+ b: ubyte;
+ a: ubyte;
+ }
+ }
+
+ @property effect_type {
+ [[Type of effect used for the displayed text]]
+ values {
+ type: Efl.Text.Style.Effect_Type;
+ }
+ }
+ @property outline_color
+ {
+ [[Color of outline effect]]
+ values
+ {
+ r: ubyte;
+ g: ubyte;
+ b: ubyte;
+ a: ubyte;
+ }
+ }
+
+ @property shadow_direction
+ {
+ [[Direction of shadow effect]]
+ values
+ {
+ type: Efl.Text.Style.Shadow_Direction;
+ }
+ }
+
+ @property shadow_color
+ {
+ [[Color of shadow effect]]
+ values
+ {
+ r: ubyte;
+ g: ubyte;
+ b: ubyte;
+ a: ubyte;
+ }
+ }
+
+ @property glow_color
+ {
+ [[Color of glow effect]]
+ values
+ {
+ r: ubyte;
+ g: ubyte;
+ b: ubyte;
+ a: ubyte;
+ }
+ }
+
+ @property glow2_color
+ {
+ [[Second color of the glow effect]]
+ values
+ {
+ r: ubyte;
+ g: ubyte;
+ b: ubyte;
+ a: ubyte;
+ }
+ }
+ }
+}
diff --git a/src/lib/evas/canvas/efl_canvas_text.eo b/src/lib/evas/canvas/efl_canvas_text.eo
index 34d28a2c37..4d27091365 100644
--- a/src/lib/evas/canvas/efl_canvas_text.eo
+++ b/src/lib/evas/canvas/efl_canvas_text.eo
@@ -1,6 +1,7 @@
struct Efl.Canvas.Text.Style; [[EFL text style data structure]]
-class Efl.Canvas.Text (Efl.Canvas.Object, Efl.Text, Efl.Canvas.Filter.Internal)
+class Efl.Canvas.Text (Efl.Canvas.Object, Efl.Text, Efl.Text.Properties, Efl.Canvas.Filter.Internal,
+Efl.Text.Font, Efl.Text.Style, Efl.Text.Format)
{
[[Efl canvas text class]]
legacy_prefix: evas_object_textblock;
@@ -372,6 +373,40 @@ class Efl.Canvas.Text (Efl.Canvas.Object, Efl.Text, Efl.Canvas.Filter.Internal)
Efl.Canvas.Filter.Internal.filter_dirty;
Efl.Canvas.Filter.Internal.filter_input_render;
Efl.Canvas.Filter.Internal.filter_state_prepare;
+ Efl.Text.Font.font { get; set; }
+ Efl.Text.Font.font_source { get; set; }
+ Efl.Text.Font.font_fallbacks { get; set; }
+ Efl.Text.Font.font_lang { get; set; }
+ Efl.Text.Font.font_weight { get; set; }
+ Efl.Text.Font.font_slant { get; set; }
+ Efl.Text.Font.font_width { get; set; }
+ Efl.Text.Style.normal_color { get; set; }
+ Efl.Text.Style.backing_type { get; set; }
+ Efl.Text.Style.backing_color { get; set; }
+ Efl.Text.Style.underline_type { get; set; }
+ Efl.Text.Style.underline_color { get; set; }
+ Efl.Text.Style.underline_height { get; set; }
+ Efl.Text.Style.underline_dashed_color { get; set; }
+ Efl.Text.Style.underline_dashed_width { get; set; }
+ Efl.Text.Style.underline_dashed_gap { get; set; }
+ Efl.Text.Style.underline2_type { get; set; }
+ Efl.Text.Style.underline2_color { get; set; }
+ Efl.Text.Style.outline_color { get; set; }
+ Efl.Text.Style.shadow_direction { get; set; }
+ Efl.Text.Style.shadow_color { get; set; }
+ Efl.Text.Style.glow_color { get; set; }
+ Efl.Text.Style.glow2_color { get; set; }
+ Efl.Text.Style.strikethrough_color { get; set; }
+ Efl.Text.Format.format_ellipsis { get; set; }
+ Efl.Text.Format.format_wrap { get; set; }
+ Efl.Text.Format.format_multiline { get; set; }
+ Efl.Text.Format.format_halign { get; set; }
+ Efl.Text.Format.format_valign { get; set; }
+ Efl.Text.Format.format_linegap { get; set; }
+ Efl.Text.Format.format_linerelgap { get; set; }
+ Efl.Text.Format.format_tabstops { get; set; }
+ Efl.Text.Format.format_password { get; set; }
+ Efl.Text.Format.format_replacement_char { get; set; }
}
events {
changed; [[Called when the content (text or annotations) changed.]]