diff --git a/src/bindings/cxx/meson.build b/src/bindings/cxx/meson.build index e62b7a2387..5fa9c7336a 100644 --- a/src/bindings/cxx/meson.build +++ b/src/bindings/cxx/meson.build @@ -63,15 +63,22 @@ foreach lib : cxx_sublibs endif subdir_file_location = join_paths(file_location, eo_file_subdir) foreach cxx_gen_file : cxx_pub_eo_files + if package_name in ['evas', 'efl'] and cxx_gen_file in pub_eo_files_optional_ector + cxx_gen_file_input = cxx_gen_file + cxx_gen_file = '@0@'.format(cxx_gen_file) + cxx_gen_file = cxx_gen_file.split('/')[-1] + else + cxx_gen_file_input = subdir_file_location / cxx_gen_file + endif cxx_generator_target += custom_target('eolian_cxx_gen_'+cxx_gen_file.underscorify()+'', - input : join_paths(subdir_file_location, cxx_gen_file), + input : cxx_gen_file_input, output : [cxx_gen_file + '.hh', cxx_gen_file + '.impl.hh'], install : true, install_dir : join_paths(dir_include, package_version_name, eo_file_subdir), command : [eolian_cxx_gen, '-I', meson.current_source_dir(), eolian_include_directories, '-o', join_paths(meson.current_build_dir(), cxx_gen_file + '.hh'), '@INPUT@']) - eo_file_list += files(join_paths(subdir_file_location, cxx_gen_file)) + eo_file_list += files(cxx_gen_file_input) endforeach endforeach diff --git a/src/bindings/mono/meson.build b/src/bindings/mono/meson.build index 74f2d06de7..78ee55d62d 100644 --- a/src/bindings/mono/meson.build +++ b/src/bindings/mono/meson.build @@ -92,13 +92,21 @@ foreach lib : mono_sublibs subdir_file_location = join_paths(file_location, eo_file_subdir) foreach mono_gen_file : mono_pub_eo_files + + if package_name in ['evas', 'efl'] and mono_gen_file in pub_eo_files_optional_ector + mono_gen_file_input = mono_gen_file + mono_gen_file = '@0@'.format(mono_gen_file) + mono_gen_file = mono_gen_file.split('/')[-1] + else + mono_gen_file_input = subdir_file_location / mono_gen_file + endif if not blacklisted_files.contains(mono_gen_file) partial = [] if manual_inheritance_files.contains(mono_gen_file) partial = '-p' endif mono_generator_target += custom_target('eolian_mono_gen_'+mono_gen_file.underscorify()+'', - input : join_paths(subdir_file_location, mono_gen_file), + input : mono_gen_file_input, output : [mono_gen_file + '.cs'], command : [eolian_mono_gen, beta_option, '-I', meson.current_source_dir(), eolian_include_directories, '--dllimport', package_name, diff --git a/src/lib/efl/interfaces/efl_text_style.eo_non_vg b/src/lib/efl/interfaces/efl_text_style.eo_non_vg new file mode 100644 index 0000000000..e33e0c9cd9 --- /dev/null +++ b/src/lib/efl/interfaces/efl_text_style.eo_non_vg @@ -0,0 +1,282 @@ +enum Efl.Text_Style_Background_Type +{ + [[Type of background to use behind each line of text. + + @since 1.24 + ]] + none = 0, [[Do not use background.]] + solid_color, [[Use a solid-color rectangle as background. + Requires @Efl.Text_Style.text_background_color.]] +} + +enum Efl.Text_Style_Strikethrough_Type +{ + [[Whether to add a strike-through decoration to the displayed text or not. + @since 1.24 + ]] + none = 0, [[Do not use strike-through.]] + single, [[Strike-through with a single line. + Requires @Efl.Text_Style.text_strikethrough_color.]] +} + +enum Efl.Text_Style_Effect_Type +{ + [[Effect to apply to the displayed text. + @since 1.24 + ]] + none = 0, [[No effect.]] + shadow, [[Shadow effect. + Uses @Efl.Text_Style.text_shadow_color and @Efl.Text_Style.text_shadow_direction.]] + far_shadow, [[Far shadow effect. + Uses @Efl.Text_Style.text_shadow_color and @Efl.Text_Style.text_shadow_direction.]] + soft_shadow, [[Soft shadow effect. + Uses @Efl.Text_Style.text_shadow_color and @Efl.Text_Style.text_shadow_direction.]] + far_soft_shadow, [[Far and soft shadow effect. + Uses @Efl.Text_Style.text_shadow_color and @Efl.Text_Style.text_shadow_direction.]] + glow, [[Glow effect. + Uses @Efl.Text_Style.text_glow_color and @Efl.Text_Style.text_secondary_glow_color.]] + outline, [[Outline effect. + Uses @Efl.Text_Style.text_outline_color.]] + soft_outline, [[Soft outline effect. + Uses @Efl.Text_Style.text_outline_color.]] + outline_shadow, [[Outline + shadow effect. + Uses @Efl.Text_Style.text_shadow_color, @Efl.Text_Style.text_shadow_direction and + @Efl.Text_Style.text_outline_color.]] + outline_soft_shadow, [[Outline + soft shadow effect. + Uses @Efl.Text_Style.text_shadow_color, @Efl.Text_Style.text_shadow_direction and + @Efl.Text_Style.text_outline_color.]] +} + +enum Efl.Text_Style_Shadow_Direction +{ + [[Direction of the shadow effect. + @since 1.24 + ]] + bottom_right = 0, [[Shadow towards bottom right.]] + bottom, [[Shadow towards bottom.]] + bottom_left, [[Shadow towards bottom left.]] + left, [[Shadow towards left.]] + top_left, [[Shadow towards top left.]] + top, [[Shadow towards top.]] + top_right, [[Shadow towards top right.]] + right, [[Shadow towards right.]] +} + +enum Efl.Text_Style_Underline_Type +{ + [[Type of underline for the displayed text. + @since 1.24 + ]] + none = 0, [[Text without underline.]] + single, [[Underlined with a single line. + Requires @Efl.Text_Style.text_underline_color.]] + double, [[Underlined with a double line. + Requires @Efl.Text_Style.text_underline_color and @Efl.Text_Style.text_secondary_underline_color.]] + dashed, [[Underlined with a dashed line. + Requires @Efl.Text_Style.text_underline_dashed_color, @Efl.Text_Style.text_underline_dashed_width and + @Efl.Text_Style.text_underline_dashed_gap.]] +} + +interface Efl.Text_Style { + [[Decorations to add to the text. + + Decorations include text color, glow, outline, underline, strike-through and shadows. + @since 1.24 + ]] + c_prefix: efl_text; + methods { + @property text_color { + [[Color of text, excluding all other decorations. By default it is invisible.]] + values + { + r: ubyte; [[Red component.]] + g: ubyte; [[Green component.]] + b: ubyte; [[Blue component.]] + a: ubyte; [[Alpha component.]] + } + } + + @property text_background_type { + [[Type of background to use behind each line of text.]] + values + { + type: Efl.Text_Style_Background_Type; [[Background type.]] + } + } + + @property text_background_color { + [[Color of the background behind each line of text. By default it is invisible.]] + values + { + r: ubyte; [[Red component.]] + g: ubyte; [[Green component.]] + b: ubyte; [[Blue component.]] + a: ubyte; [[Alpha component.]] + } + } + + @property text_underline_type { + [[Type of underline to use for the text.]] + values + { + type: Efl.Text_Style_Underline_Type; [[Underline type.]] + } + } + + @property text_underline_color + { + [[Color of the primary underline. By default it is invisible.]] + values + { + r: ubyte; [[Red component.]] + g: ubyte; [[Green component.]] + b: ubyte; [[Blue component.]] + a: ubyte; [[Alpha component.]] + } + } + + @property text_underline_height + { + [[Width (in pixels) of the single underline when @.text_underline_type is + @Efl.Text_Style_Underline_Type.single.]] + values + { + height: double; [[Underline width in pixels.]] + } + } + + @property text_underline_dashed_color + { + [[Color of the dashed underline. Only valid when @.text_underline_type is + @Efl.Text_Style_Underline_Type.dashed. By default it is invisible.]] + values + { + r: ubyte; [[Red component.]] + g: ubyte; [[Green component.]] + b: ubyte; [[Blue component.]] + a: ubyte; [[Alpha component.]] + } + } + + @property text_underline_dashed_width + { + [[Length (in pixels) of the dashes when @.text_underline_type is + @Efl.Text_Style_Underline_Type.dashed.]] + values + { + width: int; [[Dash length in pixels.]] + } + } + + @property text_underline_dashed_gap + { + [[Length (in pixels) of the gaps between the dashes when @.text_underline_type is + @Efl.Text_Style_Underline_Type.dashed.]] + values + { + gap: int; [[Gap length in pixels.]] + } + } + + @property text_secondary_underline_color + { + [[Color of the secondary underline. Only valid when @.text_underline_type is + @Efl.Text_Style_Underline_Type.double. By default it is invisible.]] + values + { + r: ubyte; [[Red component.]] + g: ubyte; [[Green component.]] + b: ubyte; [[Blue component.]] + a: ubyte; [[Alpha component.]] + } + } + + @property text_strikethrough_type { + [[Enables crossed-out text.]] + values + { + type: Efl.Text_Style_Strikethrough_Type; [[Strike-through type.]] + } + } + + @property text_strikethrough_color + { + [[Color of the line striking through the text. By default it is invisible.]] + values + { + r: ubyte; [[Red component.]] + g: ubyte; [[Green component.]] + b: ubyte; [[Blue component.]] + a: ubyte; [[Alpha component.]] + } + } + + @property text_effect_type { + [[Controls a number of decorations around the text, like shadow, outline + and glow, including combinations of them.]] + values { + type: Efl.Text_Style_Effect_Type; [[Effect type.]] + } + } + @property text_outline_color + { + [[Color of the text outline. By default it is invisible.]] + values + { + r: ubyte; [[Red component.]] + g: ubyte; [[Green component.]] + b: ubyte; [[Blue component.]] + a: ubyte; [[Alpha component.]] + } + } + + @property text_shadow_direction + { + [[Direction of the shadow effect.]] + values + { + type: Efl.Text_Style_Shadow_Direction; [[Shadow direction.]] + } + } + + @property text_shadow_color + { + [[Color of the text shadow. By default it is invisible.]] + values + { + r: ubyte; [[Red component.]] + g: ubyte; [[Green component.]] + b: ubyte; [[Blue component.]] + a: ubyte; [[Alpha component.]] + } + } + + @property text_glow_color + { + [[Color of the text glow. By default it is invisible.]] + values + { + r: ubyte; [[Red component.]] + g: ubyte; [[Green component.]] + b: ubyte; [[Blue component.]] + a: ubyte; [[Alpha component.]] + } + } + + @property text_secondary_glow_color + { + [[Color of the secondary glow decoration. + This is the color of the inner glow (where it touches the text) which + gradually fades into @.text_glow_color as it reaches the outer edge. + By default it is invisible. + ]] + values + { + r: ubyte; [[Red component.]] + g: ubyte; [[Green component.]] + b: ubyte; [[Blue component.]] + a: ubyte; [[Alpha component.]] + } + } + } +} diff --git a/src/lib/efl/interfaces/efl_text_style.eo b/src/lib/efl/interfaces/efl_text_style.eo_vg similarity index 97% rename from src/lib/efl/interfaces/efl_text_style.eo rename to src/lib/efl/interfaces/efl_text_style.eo_vg index 74bcb1d2e5..d0cd196e9a 100644 --- a/src/lib/efl/interfaces/efl_text_style.eo +++ b/src/lib/efl/interfaces/efl_text_style.eo_vg @@ -279,16 +279,16 @@ interface Efl.Text_Style { } } - // @property text_gfx_filter - // { - // [[Program that applies a special filter + @property text_gfx_filter + { + [[Program that applies a special filter - // See @Efl.Gfx.Filter. - // ]] - // values - // { - // code: string; [[Filter code.]] - // } - // } + See @Efl.Gfx.Filter. + ]] + values + { + code: string; [[Filter code.]] + } + } } } diff --git a/src/lib/efl/interfaces/meson.build b/src/lib/efl/interfaces/meson.build index 0b1bdd4556..7d4bd8066c 100644 --- a/src/lib/efl/interfaces/meson.build +++ b/src/lib/efl/interfaces/meson.build @@ -1,5 +1,8 @@ eolian_include_directories += ['-I', join_paths(meson.source_root(), 'src', 'lib')] +# for evas/canvas +eolian_include_directories += ['-I', meson.build_root() / 'src' / 'lib'] + pub_legacy_eo_files = [ 'efl_gfx_fill.eo', 'efl_gfx_entity.eo', @@ -28,6 +31,36 @@ foreach eo_file : pub_legacy_eo_files '-gchd', '@INPUT@']) endforeach +eo_file = 'efl_text_style.eo' +if get_option('ector') + in_eo = eo_file + '_vg' +else + in_eo = eo_file + '_non_vg' +endif + +configure_file( + input : in_eo, + output : eo_file, + copy : true, +) + +pub_eo_file_text_style = [meson.current_build_dir() / eo_file] +pub_eo_file_target += custom_target('eolian_gen_' + eo_file, + input : meson.current_build_dir() / eo_file, + output : eo_file + '.h', + depfile : eo_file + '.d', + install : true, + install_dir : join_paths(dir_package_include, 'interfaces'), + command : eolian_gen + [ '-I', meson.current_source_dir(), eolian_include_directories, + '-o', 'h:' + meson.current_build_dir() / eo_file + '.h', + '-o', 'c:' + meson.current_build_dir() / eo_file + '.c', + '-o', 'd:' + meson.current_build_dir() / eo_file + '.d', + '-gchd', '@INPUT@']) + +pub_eo_files_optional_ector = [meson.current_build_dir() / eo_file] + +eolian_include_directories += ['-I', meson.current_build_dir()] + pub_eo_files = [ 'efl_playable.eo', 'efl_config.eo', @@ -41,7 +74,6 @@ pub_eo_files = [ 'efl_audio_control.eo', 'efl_text.eo', 'efl_text_font_properties.eo', - 'efl_text_style.eo', 'efl_text_format.eo', 'efl_text_markup.eo', 'efl_text_markup_util.eo', @@ -133,7 +165,8 @@ foreach eo_file : pub_eo_types_files endforeach if get_option('install-eo-files') - install_data(pub_eo_files + pub_legacy_eo_files + pub_eo_types_files, + install_data(pub_eo_files + pub_legacy_eo_files + pub_eo_types_files + + pub_eo_file_text_style, install_dir: join_paths(eolian_include_dir, package_version_name) ) endif diff --git a/src/lib/evas/canvas/efl_canvas_group.eo b/src/lib/evas/canvas/efl_canvas_group.eo_non_vg similarity index 100% rename from src/lib/evas/canvas/efl_canvas_group.eo rename to src/lib/evas/canvas/efl_canvas_group.eo_non_vg diff --git a/src/lib/evas/canvas/efl_canvas_group.eo_vg b/src/lib/evas/canvas/efl_canvas_group.eo_vg new file mode 100644 index 0000000000..31105a0fc6 --- /dev/null +++ b/src/lib/evas/canvas/efl_canvas_group.eo_vg @@ -0,0 +1,136 @@ +class Efl.Canvas.Group extends Efl.Canvas.Object implements Efl.Gfx.Filter +{ + [[A group object is a container for other canvas objects. Its children + move along their parent and are often clipped with a common clipper. + This is part of the legacy smart object concept. + + A group is not necessarily a container (see @Efl.Container) in the + sense that a standard widget may not have any empty slots for content. + However it's still a group of low-level canvas objects (clipper, raw objects, + etc.). + + @since 1.22 + ]] + data: Evas_Smart_Data; + methods { + @property group_need_recalculate { + [[Indicates that the group's layout needs to be recalculated. + + If this flag is set, then the @.group_calculate function will + be called, during rendering phase of the canvas. After that, + this flag will be automatically unset. + + Note: setting this flag alone will not make the canvas' whole scene + dirty. Using evas_render() will have no effect. To + force this, use @.group_change, which will also call this function + automatically, with the parameter set to $true. + + See also @.group_calculate. + ]] + set { + } + get { + } + values { + value: bool; [[$true if the group layout needs to be recalculated, $false otherwise]] + } + } + group_change { + [[Marks the object as dirty. + + This also forcefully marks the given object as needing + recalculation. As an effect, on the next rendering cycle its + @.group_calculate method will be called. + ]] + } + group_calculate { + [[Triggers an immediate recalculation of this object's geometry. + + This will also reset the flag @.group_need_recalculate. + ]] + } + group_members_iterate @const { + [[Returns an iterator over the children of this object, which are + canvas objects. + + This returns the list of "smart" children. This might be different + from both the @Efl.Object children list as well as the @Efl.Container + content list. + ]] + return: iterator @move; + [[Iterator to object children]] + } + group_member_add { + [[Set a canvas object as a member of a given group (or smart object). + + Members will automatically be stacked and layered together with the + smart object. The various stacking functions will operate on + members relative to the other members instead of the entire canvas, + since they now live on an exclusive layer (see + @Efl.Gfx.Stack.stack_above(), for more details). + + Subclasses inheriting from this one may override this function + to ensure the proper stacking of special objects, such as clippers, + event rectangles, etc... + + See also @.group_member_remove. + See also @.group_member_is. + ]] + params { + @in sub_obj: Efl.Canvas.Object; [[The member object.]] + } + } + group_member_remove { + [[Removes a member object from a given smart object. + + This removes a member object from a smart object, if it was added + to any. The object will still be on the canvas, but no longer + associated with whichever smart object it was associated with. + + See also @.group_member_add. + See also @.group_member_is. + ]] + params { + @in sub_obj: Efl.Canvas.Object; [[The member object to remove.]] + } + } + group_member_is @const { + [[Finds out if a given object is a member of this group.]] + params { + @in sub_obj: const(Efl.Canvas.Object); [[A potential sub object.]] + } + return: bool; [[$true if $sub_obj is a member of this group.]] + } + @property group_clipper @protected { + [[The internal clipper object used by this group. + + This is the object clipping all the child objects. Do not delete + or otherwise modify this clipper! + ]] + values { + clipper: const(Efl.Canvas.Object); [[A clipper rectangle.]] + } + get { + } + } + } + events { + member,added: Efl.Gfx.Entity; [[Called when a member is added to the group.]] + member,removed: Efl.Gfx.Entity; [[Called when a member is removed from the group.]] + } + implements { + class.constructor; + class.destructor; + Efl.Object.constructor; + Efl.Object.destructor; + Efl.Object.debug_name_override; + Efl.Gfx.Color.color { set; } + Efl.Gfx.Entity.visible { set; } + Efl.Gfx.Entity.position { set; } + Efl.Gfx.Entity.size { set; } + Efl.Gfx.Filter.filter_program { set; } + Efl.Canvas.Object.clipper { set; } + Efl.Canvas.Object.no_render { set; } + Efl.Canvas.Object.paragraph_direction { get; set; } + } +} diff --git a/src/lib/evas/canvas/efl_canvas_image_internal.eo b/src/lib/evas/canvas/efl_canvas_image_internal.eo_non_vg similarity index 100% rename from src/lib/evas/canvas/efl_canvas_image_internal.eo rename to src/lib/evas/canvas/efl_canvas_image_internal.eo_non_vg diff --git a/src/lib/evas/canvas/efl_canvas_image_internal.eo_vg b/src/lib/evas/canvas/efl_canvas_image_internal.eo_vg new file mode 100644 index 0000000000..3a96eb972c --- /dev/null +++ b/src/lib/evas/canvas/efl_canvas_image_internal.eo_vg @@ -0,0 +1,38 @@ +abstract @beta Efl.Canvas.Image_Internal extends Efl.Canvas.Object implements Efl.Canvas.Filter.Internal, + Efl.Gfx.Image, Efl.Gfx.Buffer, + Efl.Gfx.Fill, Efl.Gfx.View, + Efl.Gfx.Image_Orientable, Efl.File_Save +{ + [[Efl canvas internal image class]] + data: Evas_Image_Data; + implements { + Efl.Object.constructor; + Efl.Object.destructor; + Efl.Object.finalize; + Efl.Object.debug_name_override; + Efl.File_Save.save; + Efl.Gfx.Image_Orientable.image_orientation { get; set; } + Efl.Gfx.Image.smooth_scale { get; set; } + Efl.Gfx.Image.ratio { get; } + Efl.Gfx.Image.content_region { get; } + Efl.Gfx.Image.border_insets { get; set; } + Efl.Gfx.Image.border_insets_scale { get; set; } + Efl.Gfx.Image.center_fill_mode { get; set; } + Efl.Gfx.Image.stretch_region { get; set; } + Efl.Gfx.Image.scale_hint { get; set; } + Efl.Gfx.Image.content_hint { get; set; } + Efl.Gfx.Image.image_size { get; } + Efl.Gfx.Image.image_load_error { get; } + Efl.Gfx.Buffer.alpha { get; set; } + Efl.Gfx.Buffer.buffer_update_add; + Efl.Gfx.Buffer.colorspace { get; } + Efl.Gfx.Fill.fill { get; set; } + Efl.Gfx.Fill.fill_auto { get; set; } + Efl.Gfx.Filter.filter_program { set; } + Efl.Gfx.View.view_size { get; } + Efl.Canvas.Filter.Internal.filter_dirty; + Efl.Canvas.Filter.Internal.filter_input_alpha; + Efl.Canvas.Filter.Internal.filter_input_render; + Efl.Canvas.Filter.Internal.filter_state_prepare; + } +} diff --git a/src/lib/evas/canvas/efl_canvas_textblock.eo b/src/lib/evas/canvas/efl_canvas_textblock.eo_non_vg similarity index 99% rename from src/lib/evas/canvas/efl_canvas_textblock.eo rename to src/lib/evas/canvas/efl_canvas_textblock.eo_non_vg index 51c24e1814..fa80362c3b 100644 --- a/src/lib/evas/canvas/efl_canvas_textblock.eo +++ b/src/lib/evas/canvas/efl_canvas_textblock.eo_non_vg @@ -242,7 +242,7 @@ class Efl.Canvas.Textblock extends Efl.Canvas.Object implements Efl.Text, $far_shadow, $soft_shadow and $far_soft_shadow. Default value is $none. Requires either $shadow_color, $glow_color or $outline_color. - See @Efl.Text_Style.text_effect_type + See @Efl.Text_Style.text_effect_type - $shadow_direction: Indicate the shadow direction. Valid positions are $bottom_right, $bottom, $bottom_left, $left, $top_left, $top, $top_right and $right. diff --git a/src/lib/evas/canvas/efl_canvas_textblock.eo_vg b/src/lib/evas/canvas/efl_canvas_textblock.eo_vg new file mode 100644 index 0000000000..ba70b71517 --- /dev/null +++ b/src/lib/evas/canvas/efl_canvas_textblock.eo_vg @@ -0,0 +1,505 @@ +class Efl.Canvas.Textblock extends Efl.Canvas.Object implements Efl.Text, + Efl.Canvas.Filter.Internal, Efl.Text_Font_Properties, + Efl.Text_Style, Efl.Text_Format, + Efl.Text_Markup, Efl.Ui.I18n +{ + [[This is the Canvas-level text class. This class only takes care of rendering text, + if you need user interaction consider the classes in $[Efl.Ui]. + + Note: No text will be rendered until a font, a font size and a font color are specified. + This can be accomplished using @Efl.Text_Font_Properties.font_family, @Efl.Text_Font_Properties.font_size and + @Efl.Text_Style.text_color. + Alternatively, @.style_apply can be used providing the attributes $font, $font_size and $color. + + @since 1.24 + ]] + methods { + @property is_empty { + [[Whether the object is empty (no text) or not. + ]] + get { + } + values { + is_empty: bool; [[$true if empty.]] + } + } + cursor_create { + [[Creates a new cursor and adds it to the text object. + This cursor can be used to manipulate and iterate the content of the text object. + ]] + return: Efl.Text_Cursor.Object @move; [[The created text cursor.]] + } + visible_range_get { + [[Returns the currently visible range. + + The given $start and $end cursors are output variables: + they are set to the positions of the start and the end of the + visible range in the text, respectively. + ]] + return: bool; [[$true on success.]] + params { + @in start: Efl.Text_Cursor.Object; [[Range start position.]] + @in end: Efl.Text_Cursor.Object; [[Range end position.]] + } + } + @property style_insets { + [[Gets the left, right, top and bottom insets of the text. + + The inset is any applied padding on the text (which is calculated + internally by styling applied to Textblock). + ]] + get {} + values { + l: int; [[Left padding.]] + r: int; [[Right padding.]] + t: int; [[Top padding.]] + b: int; [[Bottom padding.]] + } + } + @property bidi_delimiters { + [[BiDi delimiters are used for in-paragraph separation of bidirectional + segments. This is useful, for example, in the recipient fields of + e-mail clients where bidi oddities can occur when mixing RTL (right-to-left) + and LTR (left-to-right) text. + ]] + set {} + get {} + values { + delim: string; [[A null terminated string of delimiters, e.g ",|" or $null if empty.]] + } + } + @property newline_as_paragraph_separator { + [[When $true, the newline character will behave as a paragraph separator. + Paragraph separator equal U+2029, and new line equal U+000A. + This will effect a lot of text behaviour like @Efl.Text_Cursor.Object.move method. + ]] + set {} + get {} + values { + mode: bool; [[$true to treat new line as paragraph separator, $false otherwise.]] + } + } + style_apply { + [[Applies several style attributes at once using a formatting string. + Given style attributes override previous values, leaving other attributes unaffected. + This is akin to setting individual style attributes using properties like + @Efl.Text_Font_Properties.font_slant or @Efl.Text_Format.wrap, for example. + + The formatting string is a whitespace-separated list of $[attribute=value] pairs. + + The following attributes are accepted: + + - $font: Name of the font to use. + Default value is empty, meaning that no text will be rendered. + Requires $font_size and $font_color. + See @Efl.Text_Font_Properties.font_family. + + - $font_fallbacks: Comma-delimited list of fonts to try if finding the primary font fails. + Example: $[font_fallbacks=consolas,courier,monospace]. + Default value is empty. + See @Efl.Text_Font_Properties.font_fallbacks. + + - $font_size: Height of font, in points. + Default value is 0. + Requires $font and $font_color. + See @Efl.Text_Font_Properties.font_size. + + - $font_source: Path to the file containing the font to use. + Example: $[font_source=/usr/share/fonts/Sans.ttf]. + Default value is empty. + See @Efl.Text_Font_Properties.font_source. + + - $font_weight: Thickness of the font. The value must be one of: $normal, $thin, $ultralight, $extralight, + $light, $book, $medium, $semibold, $bold, $ultrabold, $extrabold, $black and $extrablack. + Default value is $normal. + See @Efl.Text_Font_Properties.font_weight. + + - $font_style: Style of the font. The value must be one of: $normal, $oblique and $italic. + Default value is $normal. + See @Efl.Text_Font_Properties.font_slant. + + - $font_width: How wide the font is, relative to its height. The value must be one of: + $normal, $ultracondensed, $extracondensed, $condensed, $semicondensed, $semiexpanded, $expanded, + $extraexpanded and $ultraexpanded. + Default value is $normal. + See @Efl.Text_Font_Properties.font_weight. + + - $lang: A 2-letter ISO 639-1 language code, $auto (to use the system locale setting) or $none (to disable + language support). + Example: $[lang=he]. + Default value is empty. + See @Efl.Text_Font_Properties.font_lang. + + - $color: Color code for the text (See bottom for the complete list of supported codes). + Default value is $[rgba(0,0,0,0)] meaning that no text will be rendered. + Requires $font and $font_size. + See @Efl.Text_Style.text_color. + + - $underline_color: Color code for the text underline (See bottom for the complete list of supported codes). + Default value is $[rgba(0,0,0,0)] meaning that no underline will be rendered. + Requires $underline_type. + See @Efl.Text_Style.text_underline_color. + + - $secondary_underline_color: Color code for the secondary text underline (See bottom for the complete list + of supported codes). Only valid when $[underline_type=double]. + Default value is $[rgba(0,0,0,0)] meaning that secondary underline will not be rendered. + See @Efl.Text_Style.text_secondary_underline_color. + + - $underline_dashed_color: Color code for the dashed underline (See bottom for the complete list of supported + codes). Only valid when $[underline_type=dashed]. + Default value is $[rgba(0,0,0,0)] meaning that dashed underline will not be rendered. + See @Efl.Text_Style.text_underline_dashed_color. + + - $outline_color: Color code for the text outline (See bottom for the complete list of supported codes). + Only valid when the $effect_type attribute includes an outline. + Default value is $[rgba(0,0,0,0)] meaning that no outline will be rendered. + See @Efl.Text_Style.text_outline_color. + + - $shadow_color: Color code for the text shadow (See bottom for the complete list of supported codes). + Only valid when the $effect_type attribute includes a shadow. + Default value is $[rgba(0,0,0,0)] meaning that no shadow will be rendered. + See @Efl.Text_Style.text_shadow_color. + + - $glow_color: Color code for the glow component of the text (See bottom for the complete list of supported + codes). Only valid when the $effect_type attribute includes a glow. + Default value is $[rgba(0,0,0,0)] meaning that no glow will be rendered. + See @Efl.Text_Style.text_glow_color. + + - $secondary_glow_color: Color code for the secondary (inner) glow component of the text (See bottom for + the complete list of supported codes). Only valid when the $effect_type attribute includes a glow. + Default value is $[rgba(0,0,0,0)] meaning that only the primary $glow_color will be used. + See @Efl.Text_Style.text_secondary_glow_color. + + - $background_color: Color code for the background of the text (See bottom for the complete list of supported + codes). Use a fully transparent color to disable the background. + Default value is $[rgba(0,0,0,0)] meaning that no background will be rendered. + Requires $background_type. + See @Efl.Text_Style.text_background_color. + + - $strikethrough_color: Color code for the line striking through the text (See bottom for the complete list + of supported codes). Only valid when $[strikethrough_type=single] + Default value is $[rgba(0,0,0,0)] meaning that no strike-through line will be rendered. + See @Efl.Text_Style.text_strikethrough_color. + + - $align: Horizontal alignment of the text. The value can either be a decimal number ($[0.0] means "left" + and $[1.0] means "right"), a percentage ($[0%] means "left" and $[100%] means "right") or one of: + $auto (Respects LTR/RTL settings), $locale (Respects language direction settings), $center + (Centers the text in the line), $middle (Alias for $center), $left (Puts the text at the left of the line), + $right (Puts the text at the right of the line), $start (Alias for $auto), $end (Puts the text at the + opposite side of LTR/RTL settings). + Default value is $auto. + See @Efl.Text_Format.text_horizontal_align. + + - $valign: Vertical alignment of the text. The value can either be a decimal number ($[0.0] means "top" + and $[1.0] means "bottom"), a percentage ($[0%] means "top" and $[100%] means "bottom") or one of: + $top (Puts the text at the top of the text box), $center (Puts the text at the middle of the text box), + $middle (Alias for $center), $bottom (Puts the text at the bottom of the text box), + $baseline (Puts the text's baseline at the middle of the text box), $base (Alias for $baseline). + Default value is $baseline. + See @Efl.Text_Format.text_vertical_align. + + - $wrap: Wrapping policy of the text. The value must be one of the following: $word (Only wraps lines at + word boundaries), $char (Wraps at any character), $mixed (Wraps at word boundaries if possible, + at any character if not), $hyphenation (Hyphenate if possible, otherwise try wrapping at word boundaries + or at any character) or $none to disable wrapping. + Default value is $none. + See @Efl.Text_Format.wrap. + + - $left_margin: Distance in pixels from the left side of the text block to the beginning of the text + (inner margin). The value can be a number (to set the margin), or a number preceded by $[+] or $[-] + to increment or decrement the existing margin value. $reset is also accepted, to set the margin to + 0 pixels. + Default value is $[0]. + Examples: $[left_margin=10], $[left_margin=+10], $[left_margin=reset]. + + - $right_margin: Distance in pixels from the right side of the text block to the beginning of the text + (inner margin). The value can be a number (to set the margin), or a number preceded by $[+] or $[-] + to increment or decrement the existing margin value. $reset is also accepted, to set the margin to + 0 pixels. + Default value is $[0]. + Examples: $[right_margin=10], $[right_margin=+10], $[right_margin=reset]. + + - $underline_type: Style of the underline. The value must be one of $none (No underlining), + $single (A single line under the text) , $double (Two lines under the text), + $dashed (A dashed line under the text). + Default value is $none. + Requires either $underline_color, $secondary_underline_color or $underline_dashed_color. + See @Efl.Text_Style.text_underline_type. + + - $strikethrough_type: Enables crossed-out text. Possible values are $single and $none. + Default value is $none. + Requires $strikethrough_color. + See @Efl.Text_Style.text_strikethrough_type. + + - $background_type: Enables background color for the text. Possible values are $solid and $none. + Default value is $none. + Requires $background_color. + See @Efl.Text_Style.text_background_type. + + - $effect_type: Controls a number of decorations around the text, like shadow, outline and glow, including + combinations of them. Possible values are $none (No decoration), + $shadow, $outline, $soft_outline, $outline_shadow, $outline_soft_shadow, $glow (alias for $soft_outline), + $far_shadow, $soft_shadow and $far_soft_shadow. + Default value is $none. + Requires either $shadow_color, $glow_color or $outline_color. + See @Efl.Text_Style.text_effect_type + + - $shadow_direction: Indicate the shadow direction. Valid positions are $bottom_right, $bottom, $bottom_left, $left, $top_left, $top, $top_right + and $right. + Requires either $effect_type. + See @Efl.Text_Style.text_shadow_direction. + + - $tab_stops: Size (in pixels) of the tab character. The value must be a number greater than one. + Default value is $[32]. + See @Efl.Text_Format.tab_stops. + + - $line_size: Distance (in pixels) from the baseline of one line of text to the next. This is, a value of + $[0] would render all lines on top of each other (However, this value will be ignored if it results in + overlapping lines of text). + Setting this value sets $line_rel_size to $[0%] (disables it). + Default value is $[0]. + + - $line_rel_size: Distance (in percentage over the natural line height) from the baseline of one line of + text to the next. A value of $[100%] does not have any impact, smaller values render lines closer together + and bigger values render them further apart. + Setting this value sets $line_size to $[0] (disables it). + Default value is $[0%]. + + - $line_gap: Additional empty space (in pixels) between the bottom of one line of text and the top of the + next. Setting this value sets $line_rel_gap to $[0%] (disables it). + Default value is $[0]. + See @Efl.Text_Format.line_gap. + + - $line_rel_gap: Additional empty space (in percentage over the natural line height) between the bottom of + one line of text and the top of the next. + Setting this value sets $line_gap to $[0] (disables it). + Default value is $[0%]. + See @Efl.Text_Format.line_rel_gap. + + - $line_fill: An alternate way to specify the $line_size as a percentage of the canvas height. + A value of $[100%] means that a single line fills the canvas, whereas $[25%] means that 4 lines + fit in the same height. + When both $line_fill and $line_size are specified the one resulting in the smallest line size is used. + Default value is $[0]. + + - $ellipsis: Controls automatic addition of ellipsis "..." to replace text which cannot be shown. + The value must be a number indicating the position of the ellipsis inside the visible text. + $[0.0] means the beginning of the text, $[1.0] means the end of the text, and values in between + mean the proportional position inside the text. + Any value smaller than 0 or greater than 1 disables ellipsis. + Default value is $[-1]. + Examples: $[ellipsis=0.5 + See @Efl.Text_Format.ellipsis. + + - $password: Enabling this causes all characters to be replaced by $replacement_char. + This is useful for password input boxes. + Value must be either $on or $off. + Default value is $[off]. + Requires $replacement_char. + See @Efl.Text_Format.password. + + - $replacement_char: Character to use instead of the actual characters when $password is $on. + Default value is empty, meaning that no replacement will take place. + Requires $password. + Examples: $[replacement_char=*]. + See @Efl.Text_Format.replacement_char. + + - $underline_dashed_width: Length (in pixels) of the dashes when $underline_type is $dashed. + Default value is $[6]. + See @Efl.Text_Style.text_underline_dashed_width. + + - $underline_dashed_gap: Length (in pixels) of the gaps between the dashes when $underline_type is $dashed. + Default value is $[2]. + See @Efl.Text_Style.text_underline_dashed_gap. + + - $underline_height: Width (in pixels) of the single underline when $underline_type is $single. + Default value is $[1]. + See @Efl.Text_Style.text_underline_height. + + - $gfx_filter: Experimental filter name. See @Efl.Gfx.Filter for more information. + + Color codes: Colors can be specified using any of the following formats: + $[#RRGGBB], $[#RRGGBBAA], $[#RGB], $[#RGBA], $[rgb(r,g,b)], $[rgba(r,g,b,a)]. + Additionally, X11 color names like $red or $blanchedalmond can be used. + See https://en.wikipedia.org/wiki/X11_color_names for the full list. + ]] + + params { + @in style: string; [[A whitespace-separated list of $[attribute=value] pairs, for example, + $[font=sans font_size=30 color=white].]] + } + } + @property all_styles { + [[A string representing the complete set of attributes applied to this text object. + This includes the default attributes plus any additional style applied with @.style_apply + or individual style properties like @Efl.Text_Font_Properties.font_slant or @Efl.Text_Format.wrap. + + See @.style_apply for the description of all attributes. + ]] + get {} + values { + style: string; [[A whitespace-separated list of $[attribute=value] pairs, for example, + $[font=sans font_size=30 color=white].]] + } + } + @property size_formatted { + [[The formatted width and height of this text block. + + This calculates the actual size after restricting the + text block to the current size of the object. + + The main difference between this and @.size_native + is that the "native" function does not take wrapping into account: + it just calculates the real width of the object as if it was + placed on an infinite canvas, while @.size_formatted gives the + size after wrapping text according to the size restrictions of the + object. + + The formatted width and height do not include padding size. + To get the total size of text with style, you need to query padding size + from @.style_insets. + + For example a text block containing the text: + "You shall not pass!" with no margins or padding and assuming + a monospace font and a size of 7x10 char widths (for simplicity) + has a native size of 19x1 and a formatted size of 5x4. + ]] + get {} + values { + size: Eina.Size2D; [[The formatted size of the object (after wrapping).]] + } + } + @property size_native { + [[The native width and height of this text block. + + This calculates the actual size without taking account the + current size of the object. + + The main difference between this and @.size_formatted + is that the "native" function does not take wrapping into account: + it just calculates the real width of the object as if it was + placed on an infinite canvas, while @.size_formatted gives the + size after wrapping text according to the size restrictions of the + object. + + The native width and height do not include padding size. + To get the total size of text with style, you need to query padding size + from @.style_insets. + + For example a text block containing the text: + "You shall not pass!" with no margins or padding and assuming + a monospace font and a size of 7x10 char widths (for simplicity) + has a native size of 19x1 and a formatted size of 5x4. + ]] + get {} + values { + size: Eina.Size2D; [[The native size of the object (without wrapping).]] + } + } + // Obstacles + obstacle_add @beta { + [[Add obstacle object $eo_obs to be avoided during layout + of text. + + The textblock does the layout of the text according to the + position of the obstacle. + ]] + params { + @in eo_obs: Efl.Canvas.Object; [[Obstacle object.]] + } + return: bool; [[$true on success.]] + } + obstacle_del @beta { + [[Removes $eo_obs from observation during text layout. + ]] + params { + @in eo_obs: Efl.Canvas.Object; [[Obstacle object.]] + } + return: bool; [[$true on success.]] + } + obstacles_update @beta { + [[Triggers for relayout due to obstacles' state change. + + The obstacles alone don't affect the layout, until this is + called. Use this after doing changes (moving, positioning etc.) + in the obstacles that you would like to be considered in the + layout. + + For example: if you have just repositioned the obstacles to + different coordinates relative to the text block, you need to + call this so it will consider this new state and will relayout + the text. + ]] + } + async_layout { + [[Requests to layout the text off the mainloop. + + Once layout is complete, the result is returned as @Eina.Rect, + with the $w and $h fields set. + + This can be used to layout Textblock before it is required + to layout internally in back thread, which can enhance application + performance. + ]] + return: future; [[Future for layout result.]] + } + } + implements { + Efl.Object.constructor; + Efl.Object.destructor; + Efl.Canvas.Object.paragraph_direction { get; set; } + Efl.Text.text { get; set; } + Efl.Gfx.Filter.filter_program { get; set; } + Efl.Gfx.Filter.filter_data { get; set; } + Efl.Gfx.Filter.filter_source { get; set; } + Efl.Canvas.Filter.Internal.filter_dirty; + Efl.Canvas.Filter.Internal.filter_input_render; + Efl.Canvas.Filter.Internal.filter_state_prepare; + Efl.Text_Font_Properties.font_family { get; set; } + Efl.Text_Font_Properties.font_size { get; set; } + Efl.Text_Font_Properties.font_source { get; set; } + Efl.Text_Font_Properties.font_fallbacks { get; set; } + Efl.Text_Font_Properties.font_lang { get; set; } + Efl.Text_Font_Properties.font_weight { get; set; } + Efl.Text_Font_Properties.font_slant { get; set; } + Efl.Text_Font_Properties.font_width { get; set; } + Efl.Text_Font_Properties.font_bitmap_scalable { get; set; } + Efl.Text_Style.text_color { get; set; } + Efl.Text_Style.text_background_type { get; set; } + Efl.Text_Style.text_background_color { get; set; } + Efl.Text_Style.text_underline_type { get; set; } + Efl.Text_Style.text_underline_color { get; set; } + Efl.Text_Style.text_underline_height { get; set; } + Efl.Text_Style.text_underline_dashed_color { get; set; } + Efl.Text_Style.text_underline_dashed_width { get; set; } + Efl.Text_Style.text_underline_dashed_gap { get; set; } + Efl.Text_Style.text_secondary_underline_color { get; set; } + Efl.Text_Style.text_strikethrough_type { get; set; } + Efl.Text_Style.text_strikethrough_color { get; set; } + Efl.Text_Style.text_effect_type { get; set; } + Efl.Text_Style.text_outline_color { get; set; } + Efl.Text_Style.text_shadow_direction { get; set; } + Efl.Text_Style.text_shadow_color { get; set; } + Efl.Text_Style.text_glow_color { get; set; } + Efl.Text_Style.text_secondary_glow_color { get; set; } + Efl.Text_Style.text_gfx_filter { get; set; } + Efl.Text_Format.ellipsis { get; set; } + Efl.Text_Format.wrap { get; set; } + Efl.Text_Format.multiline { get; set; } + Efl.Text_Format.text_horizontal_align { get; set; } + Efl.Text_Format.text_horizontal_align_auto_type { get; set; } + Efl.Text_Format.text_vertical_align { get; set; } + Efl.Text_Format.line_gap { get; set; } + Efl.Text_Format.line_rel_gap { get; set; } + Efl.Text_Format.tab_stops { get; set; } + Efl.Text_Format.password { get; set; } + Efl.Text_Format.replacement_char { get; set; } + Efl.Text_Markup.markup { set; get; } + Efl.Gfx.Entity.scale { set; } + } + events { + changed: void; [[Called when canvas text changed ]] + layout,finished: void; [[Called when the object has been layed out]] + style_insets,changed: void; [[Called when the property @.style_insets changed.]] + } +} diff --git a/src/lib/evas/canvas/meson.build b/src/lib/evas/canvas/meson.build index 39b3498a46..b92315cb03 100644 --- a/src/lib/evas/canvas/meson.build +++ b/src/lib/evas/canvas/meson.build @@ -1,7 +1,45 @@ +_pub_eo_files_optional_ector = [ + 'efl_canvas_group.eo', + 'efl_canvas_image_internal.eo', + 'efl_canvas_textblock.eo', +] + +evas_canvas_eo_files = [] + +foreach eo_file : _pub_eo_files_optional_ector + if get_option('ector') + in_eo = eo_file + '_vg' + else + in_eo = eo_file + '_non_vg' + endif + + configure_file( + input : in_eo, + output : eo_file, + copy: true, + ) + + priv_eo_file_target += custom_target('eolian_gen_' + eo_file, + input : meson.current_build_dir() / eo_file, + output : [eo_file + '.h'], + depfile : eo_file + '.d', + install : true, + install_dir : join_paths(dir_package_include, 'canvas'), + command : eolian_gen + [ '-I', meson.current_source_dir(), eolian_include_directories, + '-o', 'h:' + meson.current_build_dir() / eo_file + '.h', + '-o', 'c:' + meson.current_build_dir() / eo_file + '.c', + '-o', 'd:' + meson.current_build_dir() / eo_file + '.d', + '-gchd', '@INPUT@']) + + pub_evas_eo_files += files(meson.current_build_dir()/eo_file) + pub_eo_files_optional_ector += meson.current_build_dir() / eo_file +endforeach + +evas_canvas_eo_files += pub_eo_files_optional_ector +eolian_include_directories += ['-I', meson.current_build_dir()] pub_eo_files = [ 'efl_canvas_polygon.eo', - 'efl_canvas_image_internal.eo', 'efl_canvas_image.eo', 'efl_canvas_snapshot.eo', 'efl_canvas_proxy.eo', @@ -27,11 +65,9 @@ pub_eo_files = [ 'efl_canvas_textblock_factory.eo', 'efl_canvas_rectangle.eo', 'efl_canvas_object.eo', - 'efl_canvas_group.eo', 'efl_gfx_mapping.eo', 'efl_canvas_event_grabber.eo', 'efl_text_cursor_object.eo', - 'efl_canvas_textblock.eo', 'efl_text_formatter.eo', 'efl_canvas_object_animation.eo', ] @@ -70,7 +106,7 @@ foreach eo_file : priv_eo_files '-gchd', '@INPUT@']) endforeach -evas_canvas_eo_files = pub_eo_files +evas_canvas_eo_files += pub_eo_files pub_evas_eo_files += files(pub_eo_files) diff --git a/src/tests/eolian/eolian_static.c b/src/tests/eolian/eolian_static.c index 18c8d13742..f950f33e79 100644 --- a/src/tests/eolian/eolian_static.c +++ b/src/tests/eolian/eolian_static.c @@ -10,6 +10,7 @@ EFL_START_TEST(eolian_static_check) { Eolian_State *eos = eolian_state_new(); fail_if(!eolian_state_directory_add(eos, EO_SRC_DIR)); + fail_if(!eolian_state_directory_add(eos, EO_BUILD_DIR)); fail_if(!eolian_state_all_eot_files_parse(eos)); fail_if(!eolian_state_all_eo_files_parse(eos)); /* too many failures to enable this yet */ diff --git a/src/tests/eolian/meson.build b/src/tests/eolian/meson.build index f4b6cdc6f1..dc323e5f19 100644 --- a/src/tests/eolian/meson.build +++ b/src/tests/eolian/meson.build @@ -32,6 +32,7 @@ eolian_suite = executable('eolian_suite', '-DEOLIAN_GEN="'+eolian_gen_path+'"', '-DTESTS_BUILD_DIR="'+meson.current_build_dir()+'"', '-DEO_SRC_DIR="'+join_paths(meson.source_root(), 'src', 'lib')+'"', + '-DEO_BUILD_DIR="'+meson.build_root() / 'src' / 'lib'+'"', '-DTESTS_SRC_DIR="'+meson.current_source_dir()+'"'] ) diff --git a/src/tests/eolian_cxx/eolian_cxx_test_binding.cc b/src/tests/eolian_cxx/eolian_cxx_test_binding.cc index 98020bf919..b0a944c7de 100644 --- a/src/tests/eolian_cxx/eolian_cxx_test_binding.cc +++ b/src/tests/eolian_cxx/eolian_cxx_test_binding.cc @@ -75,7 +75,7 @@ EFL_START_TEST(eolian_cxx_test_binding_constructor_all_optionals) g.optional_ctor_b(5); } ); - + ck_assert_int_eq(2, g.req_ctor_a_value_get()); ck_assert_int_eq(3, g.opt_ctor_a_value_get()); ck_assert_int_eq(4, g.req_ctor_b_value_get()); @@ -221,6 +221,7 @@ klass_def init_test_data(std::string const target_file, std::string const target { ck_assert(::eolian_state_directory_add(state.value, TESTS_SRC_DIR)); ck_assert(::eolian_state_directory_add(state.value, EO_SRC_DIR)); + ck_assert(::eolian_state_directory_add(state.value, EO_BUILD_DIR)); ck_assert(::eolian_state_all_eot_files_parse(state.value)); ck_assert(::eolian_state_file_parse(state.value, target_file.c_str())); diff --git a/src/tests/eolian_cxx/meson.build b/src/tests/eolian_cxx/meson.build index 23b2727eaf..5344ae3961 100644 --- a/src/tests/eolian_cxx/meson.build +++ b/src/tests/eolian_cxx/meson.build @@ -65,6 +65,7 @@ eolian_cxx_suite = executable('eolian_cxx_suite', cpp_args : package_c_args +[ '-DTESTS_BUILD_DIR="'+meson.current_build_dir()+'"', '-DEO_SRC_DIR="'+join_paths(meson.source_root(), 'src', 'lib')+'"', + '-DEO_BUILD_DIR="'+meson.build_root() / 'src' / 'lib'+'"', '-DTESTS_SRC_DIR="'+meson.current_source_dir()+'"'] )