Merge branch 'master' into devs/hermet/lottie

This commit is contained in:
Hermet Park 2019-12-24 11:26:47 +09:00
commit c3bbcfc813
75 changed files with 1662 additions and 695 deletions

View File

@ -41,7 +41,7 @@ group { "efl/view_grid";
data.item: "version" "123";
}
group { "efl/grid_item"; data.item: "version" "123";
group { "efl/grid_item"; data.item: "version" "124";
data.item: "selectraise" "on";
data.item: "focusraise" "on";
images.image: "bevel_dark_out.png" COMP;
@ -52,15 +52,6 @@ group { "efl/grid_item"; data.item: "version" "123";
parts {
// BASE PARTS //
rect { "event";
desc { "default";
color: 0 0 0 0;
}
desc { "disabled";
inherit: "default";
hid;
}
}
rect { "base"; mouse;
desc { "default";
}
@ -208,6 +199,15 @@ group { "efl/grid_item"; data.item: "version" "123";
color: 255 255 255 64;
}
}
rect { "event";
desc { "default";
color: 0 0 0 0;
}
desc { "disabled";
inherit: "default";
hid;
}
}
swallow { "efl.icon";
clip_to: "icon_area";
desc { "default";
@ -258,6 +258,7 @@ group { "efl/grid_item"; data.item: "version" "123";
// TOP PARTS //
}
programs {
EFL_UI_CLICKABLE_PART_BIND("event")
program {
signal: "efl,state,selected"; source: "efl";
action: STATE_SET "selected";

View File

@ -8,7 +8,7 @@ Group: efl/group_item (@since 1.23)
*/
group { "efl/group_item"; data.item: "version" "123"; nomouse; program_source: "efl";
group { "efl/group_item"; data.item: "version" "124"; nomouse; program_source: "efl";
images.image: "shadow_square_tiny.png" COMP;
images.image: "bevel_out.png" COMP;
images.image: "horizontal_separated_bar_small_glow.png" COMP;

View File

@ -56,7 +56,7 @@ group { "efl/list_view";
data.item: "version" "123";
}
group { "efl/list_item"; data.item: "version" "123";
group { "efl/list_item"; data.item: "version" "124";
data.item: "selectraise" "on";
data.item: "focusraise" "on";
images.image: "bevel_curved_horiz_out.png" COMP;
@ -65,15 +65,6 @@ group { "efl/list_item"; data.item: "version" "123";
images.image: "bevel_horiz_out.png" COMP;
images.image: "shine.png" COMP;
parts {
rect { "event";
desc { "default";
color: 0 0 0 0;
}
desc { "disabled";
inherit: "default";
hid;
}
}
rect { "base"; nomouse;
desc { "default";
color: 64 64 64 255;
@ -218,6 +209,15 @@ group { "efl/list_item"; data.item: "version" "123";
hid;
}
}
rect { "event";
desc { "default";
color: 0 0 0 0;
}
desc { "disabled";
inherit: "default";
hid;
}
}
//##//
swallow { "efl.icon";
desc { "default";
@ -268,6 +268,7 @@ group { "efl/list_item"; data.item: "version" "123";
}
}
programs {
EFL_UI_CLICKABLE_PART_BIND("event")
program {
signal: "efl,state,odd"; source: "efl";
action: STATE_SET "odd";
@ -343,7 +344,7 @@ group { "efl/list_item"; data.item: "version" "123";
}
}
group { "efl/list_item:placeholder"; data.item: "version" "123";
group { "efl/list_item:placeholder"; data.item: "version" "124";
data.item: "selectraise" "on";
data.item: "focusraise" "on";
images.image: "bevel_curved_horiz_out.png" COMP;
@ -352,15 +353,6 @@ group { "efl/list_item:placeholder"; data.item: "version" "123";
images.image: "bevel_horiz_out.png" COMP;
images.image: "shine.png" COMP;
parts {
rect { "event";
desc { "default";
color: 0 0 0 0;
}
desc { "disabled";
inherit: "default";
hid;
}
}
rect { "base"; nomouse;
desc { "default";
color: 64 64 64 255;
@ -425,6 +417,15 @@ group { "efl/list_item:placeholder"; data.item: "version" "123";
vis;
}
}
rect { "event";
desc { "default";
color: 0 0 0 0;
}
desc { "disabled";
inherit: "default";
hid;
}
}
//##//
swallow { "efl.content"; mouse;
scale;
@ -463,6 +464,7 @@ group { "efl/list_item:placeholder"; data.item: "version" "123";
}
}
programs {
EFL_UI_CLICKABLE_PART_BIND("event")
program {
signal: "efl,state,odd"; source: "efl";
action: STATE_SET "odd";

View File

@ -1,6 +1,5 @@
#!/usr/bin/python3
import os
import sys
import subprocess
import json
import time

View File

@ -1,7 +1,7 @@
#!/usr/bin/python3
import sys
import os
from ete3 import Tree, TreeStyle, AttrFace, CircleFace, faces, NodeStyle
from ete3 import Tree, TreeStyle, AttrFace, faces, NodeStyle
import argparse
parser = argparse.ArgumentParser(description='Create a image showing all widgets')
@ -11,8 +11,6 @@ G = parser.parse_args()
sys.path.insert(0, os.path.join(G.sourcedir, 'src', 'scripts', 'pyolian'))
import eolian
from eolian import Eolian_Type_Type
from eolian import Eolian_Type_Builtin_Type
SCAN_FOLDER = os.path.join(G.sourcedir, 'src', 'lib')

View File

@ -16,7 +16,7 @@ _apply_style(Eo *obj, size_t start_pos, size_t end_pos, const char *style)
efl_text_cursor_position_set(start, start_pos);
efl_text_cursor_position_set(end, end_pos);
efl_text_attribute_factory_attribute_insert(start, end, style);
efl_text_formatter_attribute_insert(start, end, style);
efl_del(start);
efl_del(end);
@ -166,7 +166,7 @@ test_efl_ui_text(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
efl_text_font_family_set(en, "Sans");
efl_text_font_size_set(en, 12);
efl_text_font_width_set(en, EFL_TEXT_FONT_WIDTH_ULTRACONDENSED);
efl_text_normal_color_set(en, 255, 255, 255, 255);
efl_text_color_set(en, 255, 255, 255, 255);
efl_text_set(en,
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod\n"

View File

@ -819,7 +819,7 @@ test_image_zoomable_animated(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSE
efl_gfx_hint_weight_set(efl_added, 1, 0),
efl_text_font_family_set(efl_added, "Sans"),
efl_text_font_size_set(efl_added, 10),
efl_text_normal_color_set(efl_added, 255, 255, 255, 255),
efl_text_color_set(efl_added, 255, 255, 255, 255),
efl_pack(bx, efl_added)
);

View File

@ -150,9 +150,34 @@ inline bool is_alias_blacklisted(attributes::alias_def const& alias, Context con
return name_helpers::alias_full_eolian_name(alias) == "Eina.Error";
}
inline bool is_property_blacklisted(std::string const&)
inline bool is_property_blacklisted(std::string const& name)
{
return false;
auto properties = std::vector<std::string>{
// These properties encode (void* arr, int len) arrays
"Efl.Gfx.IGradient.Stop"
, "Efl.Gfx.GradientConcrete.Stop"
, "Efl.Gfx.IShape.StrokeDash"
, "Efl.Gfx.ShapeConcrete.StrokeDash"
, "Efl.Gfx.Vg.ValueProvider.Transform"
, "Efl.Canvas.Vg.Node.Transformation"
// Will be bound manually
, "Efl.Core.Env.Env"
// Setter returns a future
, "Efl.IModel.Property"
// Protected
, "Efl.Access.IAction.ActionName"
, "Efl.Access.IAction.ActionLocalizedName"
, "Efl.Access.IComponent.Extents"
, "Efl.Access.IText.AccessSelection"
, "Efl.Access.IText.AccessText"
, "Efl.Access.IText.BoundedRanges"
, "Efl.Access.IText.Character"
, "Efl.Access.IText.OffsetAtPoint"
, "Efl.Access.IText.String"
, "Efl.Access.IText.TextAttributes"
};
return std::find(std::begin(properties), std::end(properties), name) != std::end(properties);
}
template<typename Context>

View File

@ -21,6 +21,7 @@
#include "grammar/html_escaped_string.hpp"
#include "using_decl.hh"
#include "name_helpers.hh"
#include "helpers.hh"
#include "generation_contexts.hh"
#include "blacklist.hh"
@ -76,7 +77,11 @@ struct documentation_generator
// The name_tail parameter is the last 4 chars of the original string, which
// could be ".set" or ".get" and in this case they are ignored by Eolian.
// We want them to know what the documentation intended to reference.
static std::string function_conversion(const ::Eolian_Object *klass, const ::Eolian_Function *function, std::string name_tail)
template<typename Context>
static std::string function_conversion(const ::Eolian_Object *klass
, const ::Eolian_Function *function
, std::string name_tail
, Context const& context)
{
::Eolian_Function_Type ftype = ::eolian_function_type_get(function);
const char* eo_name = ::eolian_function_name_get(function);
@ -122,13 +127,27 @@ struct documentation_generator
break;
case ::EOLIAN_PROPERTY:
{
int getter_nkeys = property_num_keys(function, ::EOLIAN_PROP_GET);
int setter_nkeys = property_num_keys(function, ::EOLIAN_PROP_SET);
std::string short_name = name_helpers::property_managed_name(klass_d, eo_name);
bool blacklisted = blacklist::is_property_blacklisted(name + "." + short_name);
// EO properties with keys or blacklisted are not converted into C# properties.
// In these cases we refer to the getter method instead of the property.
if ((getter_nkeys > 0) || (setter_nkeys > 0) || (blacklisted)) name += ".Get" + short_name;
// We need to replace the current class context with the context
// from the class that originated this property.
class_context::wrapper_kind klass_kind;
if (helpers::is_managed_interface(klass_d))
klass_kind = class_context::interface;
else
klass_kind = class_context::inherit;
auto my_context = grammar::context_replace_tag(class_context{klass_kind}, context);
auto unit = eolian_object_unit_get((const Eolian_Object*)function);
attributes::function_def getter_func{function, ::EOLIAN_PROP_GET, nullptr, unit};
attributes::function_def setter_func{function, ::EOLIAN_PROP_SET, nullptr, unit};
attributes::property_def prop{function, getter_func, setter_func, unit};
auto has_wrapper = helpers::has_property_wrapper(prop, &klass_d, my_context);
if (has_wrapper == helpers::has_property_wrapper_bit::has_none)
name += ".Get" + short_name;
else if (name_tail == ".get") name += ".Get" + short_name;
else if (name_tail == ".set") name += ".Set" + short_name;
else name += "." + short_name;
@ -165,9 +184,13 @@ struct documentation_generator
}
// Turns an Eolian reference like @Efl.Input.Pointer.tool into a <see> tag
static std::string ref_conversion(const ::Eolian_Doc_Token *token, const Eolian_State *state, std::string name_tail,
bool want_beta)
template<typename Context>
static std::string ref_conversion(const ::Eolian_Doc_Token *token
, const Eolian_State *state
, std::string name_tail
, Context const& context)
{
bool want_beta = context_want_beta(context);
const Eolian_Object *data, *data2;
::Eolian_Object_Type type =
::eolian_doc_token_ref_resolve(token, state, &data, &data2);
@ -195,7 +218,7 @@ struct documentation_generator
is_beta = eolian_object_is_beta(data) || eolian_object_is_beta(data2);
break;
case ::EOLIAN_OBJECT_FUNCTION:
ref += function_conversion(data, (const ::Eolian_Function *)data2, name_tail);
ref += function_conversion(data, (const ::Eolian_Function *)data2, name_tail, context);
is_beta = eolian_object_is_beta(data) || eolian_object_is_beta(data2);
break;
case ::EOLIAN_OBJECT_CONSTANT:
@ -227,7 +250,8 @@ struct documentation_generator
}
// Turns EO documentation syntax into C# triple-slash XML comment syntax
static std::string syntax_conversion(std::string text, const Eolian_State *state, bool want_beta)
template<typename Context>
static std::string syntax_conversion(std::string text, const Eolian_State *state, Context const& context)
{
std::string new_text, ref;
::Eolian_Doc_Token_Type previous_token_type = ::EOLIAN_DOC_TOKEN_UNKNOWN;
@ -266,7 +290,7 @@ struct documentation_generator
new_text += token_text;
break;
case ::EOLIAN_DOC_TOKEN_REF:
ref = ref_conversion(&token, state, name_tail, want_beta);
ref = ref_conversion(&token, state, name_tail, context);
if (ref != "")
{
if (utils::ends_with(ref, BETA_REF_SUFFIX))
@ -331,7 +355,7 @@ struct documentation_generator
if (!as_generator(html_escaped_string).generate(std::back_inserter(new_text), text, context))
return false;
auto options = context_find_tag<options_context>(context);
new_text = syntax_conversion( new_text, context_find_tag<eolian_state_context>(context).state, options.want_beta);
new_text = syntax_conversion( new_text, context_find_tag<eolian_state_context>(context).state, context);
std::string tabs;
as_generator(scope_tab(scope_size) << "/// ").generate (std::back_inserter(tabs), attributes::unused, context);
@ -653,7 +677,7 @@ struct documentation_string_generator
auto options = context_find_tag<options_context>(context);
auto state = context_find_tag<eolian_state_context>(context).state;
if (!as_generator(string).generate(sink, documentation_generator::syntax_conversion(escaped, state, options.want_beta), context))
if (!as_generator(string).generate(sink, documentation_generator::syntax_conversion(escaped, state, context), context))
return false;
return true;

View File

@ -26,6 +26,7 @@
#include "grammar/list.hpp"
#include "grammar/alternative.hpp"
#include "grammar/attribute_reorder.hpp"
#include "grammar/eps.hpp"
#include "grammar/counter.hpp"
#include "logging.hh"
#include "type.hh"
@ -44,7 +45,7 @@ namespace eolian_mono {
struct native_function_definition_generator
{
attributes::klass_def const* klass;
template <typename OutputIterator, typename Context>
bool generate(OutputIterator sink, attributes::function_def const& f, Context const& context) const
{
@ -181,7 +182,7 @@ struct native_function_definition_generator
return true;
}
};
struct function_definition_generator
{
function_definition_generator(bool do_super = false)
@ -323,6 +324,199 @@ property_extension_method_definition_generator property_extension_method_definit
struct property_wrapper_definition_generator
{
template <typename OutputIterator, typename Context>
bool generate_get_indexer(OutputIterator sink, attributes::property_def const& property, Context const& context
, std::string get_scope
, bool is_interface) const
{
if (is_interface)
{
if (!as_generator(scope_tab << scope_tab << get_scope << "get;\n"
).generate(sink, attributes::unused, context))
return false;
}
else
{
if (!as_generator(scope_tab << scope_tab << get_scope << "get\n"
<< scope_tab << scope_tab << "{\n"
<< scope_tab << scope_tab(2) << "var i = new "
<< name_helpers::property_concrete_indexer_name(property) << "();\n"
<< scope_tab << scope_tab(2) << "i.Self = this;\n"
<< scope_tab << scope_tab(2) << "return i;\n"
<< scope_tab << scope_tab << "}\n"
).generate(sink, attributes::unused, context))
return false;
}
return true;
}
template <typename OutputIterator, typename Context, typename C1, typename C2>
bool generate_indexer(OutputIterator sink
, attributes::property_def const& property
, Context const& context
, std::string scope, std::string get_scope, std::string set_scope
, std::string class_name
, C1 keys, C2 values
, bool is_interface
, bool is_concrete_for_interface
, bool has_setter) const
{
if (is_interface)
return true;
auto size_not_one = [] (std::vector<attributes::parameter_def> k) { return k.size() != 1; };
auto type_or_tuple
=
(
(
attribute_conditional(size_not_one)["("]
<< (type(false) % ", ")
<< ")"
)
| *type(false)
)
;
std::string parentship = "\n";
bool is_self_property = *implementing_klass == *klass_from_property;
if (!(is_self_property && !is_concrete_for_interface))
parentship = " : " + name_helpers::property_interface_indexer_name(property, *klass_from_property) + "\n";
if (!as_generator
(
scope_tab << scope << "class " << name_helpers::property_concrete_indexer_name(property) << parentship
<< scope_tab << "{\n"
<< scope_tab(2) << "public " << class_name << " Self {get; set;}\n"
<< scope_tab(2) << "public "
<< type_or_tuple << " this[" << type_or_tuple <<" i]\n"
<< scope_tab(2) << "{\n"
).generate(sink, make_tuple(values, values, keys, keys), context))
return false;
assert (!keys.empty());
std::vector<std::string> get_keys;
if(keys.size() != 1)
{
unsigned int i = 0;
for (auto&& key : keys)
{
static_cast<void>(key);
++i;
get_keys.push_back("i.Item" + std::to_string(i));
}
}
else
{
get_keys.push_back ("i");
}
assert (!get_keys.empty());
generate_get(sink, property, context, get_scope, get_keys, values, is_interface, "Self.");
if (has_setter)
generate_set(sink, property, context, set_scope, get_keys, values, is_interface, "Self.");
if (!as_generator
(
scope_tab(2) << "}\n"
<< scope_tab << "};\n"
).generate(sink, attributes::unused, context))
return false;
return true;
}
template <typename OutputIterator, typename Context, typename CK, typename CV>
bool generate_set(OutputIterator sink, attributes::property_def const& property, Context const& context
, std::string set_scope
, CK keys, CV values
, bool is_interface
, std::string name_prefix = "") const
{
using efl::eolian::grammar::counter;
if (is_interface)
{
if (!as_generator(scope_tab << scope_tab << set_scope << "set;\n"
).generate(sink, attributes::unused, context))
return false;
}
else if (values.size() == 1)
{
if (!as_generator(scope_tab << scope_tab << set_scope << "set " << "{ " << name_prefix << name_helpers::managed_method_name(*property.setter) + "(" << *(string << ",") << "value); }\n"
).generate(sink, keys, context))
return false;
}
else if (values.size() > 1)
{
if (!as_generator(
scope_tab << scope_tab << set_scope << "set "
<< ("{ " << name_prefix << name_helpers::managed_method_name(*property.setter) + "(")
<< *(string << ",") << ((" value.Item" << counter(1)) % ", ")
<< "); }\n"
).generate(sink, std::make_tuple(keys, values), context))
return false;
}
return true;
}
template <typename OutputIterator, typename Context, typename CK, typename CV>
bool generate_get(OutputIterator sink, attributes::property_def const& property, Context const& context
, std::string get_scope
, CK keys, CV values
, bool is_interface
, std::string name_prefix = "") const
{
using efl::eolian::grammar::attribute_reorder;
using efl::eolian::grammar::attributes::parameter_direction;
using efl::eolian::grammar::attributes::parameter_def;
if (is_interface) // only declaration
{
if (!as_generator(scope_tab << scope_tab << get_scope << "get;\n"
).generate(sink, attributes::unused, context))
return false;
}
else
if (/*has_getter && */values.size() == 1)
{
if (!as_generator
(scope_tab << scope_tab << get_scope
<< "get " << "{ return " << name_prefix << name_helpers::managed_method_name(*property.getter)
<< "(" << (string % ",") << "); }\n"
).generate(sink, keys, context))
return false;
}
else if (/*has_getter && */values.size() > 1)
{
if (!as_generator
(scope_tab << scope_tab << get_scope << "get "
<< "{\n"
<< *attribute_reorder<1, -1, 1>
(scope_tab(3) << type(true) << " _out_"
<< argument(false) << " = default(" << type(true) << ");\n"
)
<< scope_tab(3) << name_prefix << name_helpers::managed_method_name(*property.getter)
<< "(" << *(string << ",") << (("out _out_" << argument(false)) % ", ") << ");\n"
<< scope_tab(3) << "return (" << (("_out_"<< argument(false)) % ", ") << ");\n"
<< scope_tab(2) << "}" << "\n"
).generate(sink, std::make_tuple(values, keys, values, values), context))
return false;
}
// else if (values.size() == 1)
// {
// if (!as_generator
// (scope_tab << scope_tab << get_scope << "get "
// << "{\n"
// << *attribute_reorder<1, -1, 1>(scope_tab(3) << type(true) << " _out_" << argument(false) << " = default(" << type(true) << ");\n")
// << scope_tab(3) << name_prefix << name_helpers::managed_method_name(*property.getter)
// << "(" << *(string << ",") << (("out _out_" << argument(false)) % ",") << ");\n"
// << scope_tab(3) << "return " << (("_out_"<< argument(false)) % ",") << ";\n"
// << scope_tab(2) << "}" << "\n"
// ).generate(sink, std::make_tuple(values, keys, values, values), context))
// return false;
// }
return true;
}
template<typename OutputIterator, typename Context>
bool generate(OutputIterator sink, attributes::property_def const& property, Context const& context) const
{
@ -331,103 +525,127 @@ struct property_wrapper_definition_generator
using efl::eolian::grammar::attributes::parameter_direction;
using efl::eolian::grammar::attributes::parameter_def;
if (blacklist::is_property_blacklisted(property, *implementing_klass, context))
return true;
/// C(k) = keys count, C(v) = values count
/// /------------\ /------\.
/// |blacklisted?|---yes-----| skip |--------------\.
/// \------------/ \------/ |
/// | | |
/// no yes |
/// | | |
/// /---------\ /------------\ |
/// |is-static|----yes-----|is-interface| |
/// \---------/ \------------/ |
/// | | |
/// no no |
/// | | |
/// /--------\ /-----------\ |
/// |has-get?|---no-conc---|is-concrete|-----yes---/
/// \--------/ \-----------/
/// / \.
/// no yes
/// / \.
/// /----\ /--------------------------------------\.
/// |skip|-yes-|explicit return != Eina.Error or void |
/// \----/ \--------------------------------------/
/// |
/// no
/// |
/// /--------\.
/// |has-set?|
/// \--------/
/// / \.
/// no yes
/// / \.
/// /------\ /--------------------------------------\.
/// /------------------|no-set| |explicit return != Eina.Error or void |---- yes --\.
/// | \------/ \--------------------------------------/ |
/// | \------------|----------------------------------------------/
/// | no
/// | |
/// | /--------\.
/// | |has-both|
/// | \--------/
/// | |
/// | /-------------------\.
/// | |set-keys = get-keys|
/// | \-------------------/
/// | / |
/// | no |
/// | / |
/// | /----\ /-----------------------\.
/// | |skip|--no---|set-values = get-values|
/// | \----/ \-----------------------/
/// | /
/// | yes
/// | /
/// | /--------\.
/// \-------------------------| keys |
/// \--------/
/// / \.
/// 0 >0
/// / \.
/// /----------\ /----------\.
/// |no-indexer| | keys > 1 |
/// \----------/ \----------/
/// | / |
/// | no yes
/// | / |
/// | / |
/// | /---------\ /-------------------\.
/// | | indexer | | indexer tuple key |
/// | \---------/ \-------------------/
/// | / |
/// /--------\ |
/// | values |----------/
/// \--------/
/// / \.
/// 1 >1
/// / \.
/// /----------------\ /-------------\.
/// | no tuple value | | tuple value |
/// \----------------/ \-------------/
///
auto has_wrapper = helpers::has_property_wrapper (property, implementing_klass, context);
bool has_getter = has_wrapper & helpers::has_property_wrapper_bit::has_getter;
if (!has_getter) return true;
bool has_setter = has_wrapper & helpers::has_property_wrapper_bit::has_setter;
bool has_indexer = has_wrapper & helpers::has_property_wrapper_bit::has_indexer;
bool is_interface = context_find_tag<class_context>(context).current_wrapper_kind == class_context::interface;
bool is_static = (property.getter.is_engaged() && property.getter->is_static)
|| (property.setter.is_engaged() && property.setter->is_static);
bool is_concrete = context_find_tag<class_context>(context).current_wrapper_kind == class_context::concrete;
bool is_concrete_for_interface = is_concrete
&& (implementing_klass->type == attributes::class_type::interface_
|| implementing_klass->type == attributes::class_type::mixin);
if ((is_concrete || is_interface) && is_static)
return true;
auto get_params = property.getter.is_engaged() ? property.getter->parameters.size() : 0;
//auto set_params = property.setter.is_engaged() ? property.setter->parameters.size() : 0;
// C# properties must have a single value.
//
// Single values in getters are automatically converted to return_type,
// meaning they should have 0 parameters.
//
// For setters, we ignore the return type - usually boolean.
// if (get_params > 0 || set_params > 1)
// return true;
if (property.getter
&& std::find_if (property.getter->parameters.begin()
, property.getter->parameters.end()
, [] (parameter_def const& p)
{
return p.direction != parameter_direction::out;
}) != property.getter->parameters.end())
return true;
if (property.setter
&& std::find_if (property.setter->parameters.begin()
, property.setter->parameters.end()
, [] (parameter_def const& p)
{
return p.direction != parameter_direction::in;
}) != property.setter->parameters.end())
return true;
if (property.getter && property.setter)
//if (name_helpers::klass_concrete_or_interface_name (*implementing_klass) == "IMapping")
if (false)
{
if (get_params != 0 && property.setter->parameters.size() != property.getter->parameters.size())
return true;
if (!as_generator(grammar::lit("/// is interface ") << (int)is_interface
<< " is static " << (int)is_static
<< " is concrete " << (int)is_concrete
<< " is concrete_for_interface " << (int)is_concrete_for_interface
<< " klass_from_property->type " << (int)klass_from_property->type
<< " has_setter " << (int)has_setter
<< " property.setter->explicit_return_type != attributes::void_ " << (property.setter && property.setter->explicit_return_type != attributes::void_)
<< " property.setter->keys != property.getter->keys " << (property.setter && property.setter->keys != property.getter->keys)
<< " property.setter->values != property.getter->values " << (property.setter && property.setter->values != property.getter->values)
<< " has_setter && property.setter->scope != attributes::member_scope::scope_public " << (property.setter && property.setter->scope != attributes::member_scope::scope_public)
<< "\n")
.generate (sink, attributes::unused, context))
return false;
}
std::vector<attributes::parameter_def> parameters;
if (property.setter.is_engaged())
{
std::transform (property.setter->parameters.begin(), property.setter->parameters.end()
, std::back_inserter(parameters)
, [] (parameter_def p) -> parameter_def
{
//p.direction = efl::eolian::attributes::parameter_direction::in;
return p;
});
}
else if (property.getter.is_engaged())
{
// if getter has parameters, then we ignore return type, otherwise
// we use the return type.
if (get_params == 0)
parameters.push_back({parameter_direction::in
, property.getter->return_type, "propertyResult", {}
, property.getter->unit});
else
std::transform (property.getter->parameters.begin(), property.getter->parameters.end()
, std::back_inserter(parameters)
, [] (parameter_def p) -> parameter_def
{
p.direction = parameter_direction::in;
return p;
});
}
else
{
EINA_CXX_DOM_LOG_ERR(eolian_mono::domain) << "Property must have either a getter or a setter." << std::endl;
return false;
}
std::string dir_mod;
if (property.setter.is_engaged())
dir_mod = direction_modifier(property.setter->parameters[0]);
if (blacklist::is_property_blacklisted(property, context))
return true;
std::string managed_name = name_helpers::property_managed_name(property);
std::string scope = "public ";
std::string get_scope = property.getter.is_engaged() ? eolian_mono::function_scope_get(*property.getter) : "";
bool is_get_public = get_scope == "public ";
std::string set_scope = property.setter.is_engaged() ? eolian_mono::function_scope_get(*property.setter) : "";
bool is_set_public = set_scope == "public ";
// No need to generate this wrapper as no accessor is public.
if (is_interface && (!is_get_public && !is_set_public))
return true;
std::string get_scope = eolian_mono::function_scope_get(*property.getter);
std::string set_scope = has_setter ? eolian_mono::function_scope_get(*property.setter) : "";
// C# interface members are declared automatically as public
if (is_interface)
@ -442,23 +660,64 @@ struct property_wrapper_definition_generator
get_scope = "";
set_scope = "";
}
else if (!property.setter.is_engaged() || (get_scope == scope))
else if (!has_setter || (get_scope == scope))
{
scope = get_scope;
get_scope = "";
}
else if (!property.getter.is_engaged() || (set_scope == scope))
{
scope = set_scope;
set_scope = "";
}
if (parameters.size() == 1)
std::string virtual_mod = (is_static || is_interface || is_concrete) ? "" : "virtual ";
auto keys = property.getter->keys;
auto values = property.getter->values;
auto generated_values = values;
auto klass_name = name_helpers::klass_concrete_or_interface_name (*implementing_klass);
if (has_indexer)
{
assert (!!implementing_klass);
generate_indexer (sink, property, context, scope, get_scope, set_scope
, klass_name, keys, values
, is_interface, is_concrete_for_interface, has_setter);
generated_values.clear();
if (!is_interface && *implementing_klass == *klass_from_property
&& !is_concrete_for_interface)
{
generated_values.push_back
(attributes::parameter_def
{parameter_direction::in
, attributes::type_def
{
attributes::regular_type_def{name_helpers::property_concrete_indexer_name(property), {attributes::qualifier_info::is_none, ""}, {}}
, name_helpers::property_concrete_indexer_name(property)
, false, false, false, ""
}
, "indexer", {}, nullptr
});
}
else
{
generated_values.push_back
(attributes::parameter_def
{parameter_direction::in
, attributes::type_def
{
attributes::regular_type_def{name_helpers::klass_full_concrete_or_interface_name (*klass_from_property) + managed_name + "Indexer", {attributes::qualifier_info::is_none, ""}, {}}
, name_helpers::property_interface_indexer_name(property, *klass_from_property)
, false, false, false, ""
}
, "indexer", {}, nullptr
});
}
}
if (generated_values.size() == 1)
{
if (!as_generator(
documentation(1)
<< scope_tab << scope << (is_static ? "static " : "") << type(true) << " " << managed_name << " {\n"
).generate(sink, std::make_tuple(property, parameters[0].type), context))
<< scope_tab << scope << (is_static ? "static " : virtual_mod) << type(true) << " " << managed_name << " {\n"
).generate(sink, std::make_tuple(property, generated_values[0].type), context))
return false;
}
else
@ -469,73 +728,21 @@ struct property_wrapper_definition_generator
<< scope_tab << scope << (is_static ? "static (" : "(")
<< (attribute_reorder<1, -1>(type(true) /*<< " " << argument*/) % ", ") << ") "
<< managed_name << " {\n"
).generate(sink, std::make_tuple(property, parameters), context))
).generate(sink, std::make_tuple(property, generated_values), context))
return false;
}
if (property.getter.is_engaged() && is_interface)
if (has_indexer)
{
if (is_get_public)
if (!as_generator(scope_tab << scope_tab << set_scope << "get;\n"
).generate(sink, attributes::unused, context))
return false;
generate_get_indexer (sink, property, context, get_scope, is_interface);
}
else if (property.getter.is_engaged() && get_params == 0/*parameters.size() == 1 && property.getter.is_engaged()*/)
else
{
if (!as_generator
(scope_tab << scope_tab << get_scope
<< "get " << "{ return " + name_helpers::managed_method_name(*property.getter) + "(); }\n"
).generate(sink, attributes::unused, context))
return false;
}
else if (parameters.size() >= 1 && property.getter)
{
if (!as_generator
(scope_tab << scope_tab << get_scope << "get "
<< "{\n"
<< *attribute_reorder<1, -1, 1>
(scope_tab(3) << type(true) << " _out_"
<< argument(false) << " = default(" << type(true) << ");\n"
)
<< scope_tab(3) << name_helpers::managed_method_name(*property.getter)
<< "(" << (("out _out_" << argument(false)) % ", ") << ");\n"
<< scope_tab(3) << "return (" << (("_out_"<< argument(false)) % ", ") << ");\n"
<< scope_tab(2) << "}" << "\n"
).generate(sink, std::make_tuple(parameters, parameters, parameters), context))
return false;
}
// else if (parameters.size() == 1)
// {
// if (!as_generator
// (scope_tab << scope_tab << get_scope << "get "
// << "{\n"
// << *attribute_reorder<1, -1, 1>(scope_tab(3) << type(true) << " _out_" << argument(false) << " = default(" << type(true) << ");\n")
// << scope_tab(3) << name_helpers::managed_method_name(*property.getter)
// << "(" << (("out _out_" << argument(false)) % ",") << ");\n"
// << scope_tab(3) << "return " << (("_out_"<< argument(false)) % ",") << ";\n"
// << scope_tab(2) << "}" << "\n"
// ).generate(sink, std::make_tuple(parameters, parameters, parameters), context))
// return false;
// }
std::vector<std::string> empty_keys;
generate_get(sink, property, context, get_scope, empty_keys, values, is_interface);
if (property.setter.is_engaged() && is_interface)
{
if (is_set_public)
if (!as_generator(scope_tab << scope_tab << set_scope << "set;\n"
).generate(sink, attributes::unused, context))
return false;
}
else if (parameters.size() == 1 && property.setter.is_engaged())
{
if (!as_generator(scope_tab << scope_tab << set_scope << "set " << "{ " + name_helpers::managed_method_name(*property.setter) + "(" + dir_mod + "value); }\n"
).generate(sink, attributes::unused, context))
return false;
}
else if (parameters.size() > 1 && property.setter.is_engaged())
{
if (!as_generator(scope_tab << scope_tab << set_scope << "set " << ("{ " + name_helpers::managed_method_name(*property.setter) + "(" + dir_mod) << ((" value.Item" << counter(1)) % ", ") << "); }" << "\n"
).generate(sink, parameters, context))
return false;
if (has_setter)
generate_set (sink, property, context, set_scope, empty_keys, values, is_interface);
}
if (!as_generator(scope_tab << "}\n\n").generate(sink, attributes::unused, context))
@ -543,13 +750,14 @@ struct property_wrapper_definition_generator
return true;
}
attributes::klass_def const* implementing_klass;
attributes::klass_def const* implementing_klass, *klass_from_property;
};
struct property_wrapper_definition_parameterized
{
property_wrapper_definition_generator operator()(attributes::klass_def const& klass) const
property_wrapper_definition_generator operator()(attributes::klass_def const& klass
, attributes::klass_def const& prop_from_klass) const
{
return {&klass};
return {&klass, &prop_from_klass};
}
} const property_wrapper_definition;
property_wrapper_definition_generator as_generator(property_wrapper_definition_parameterized)
@ -557,6 +765,45 @@ property_wrapper_definition_generator as_generator(property_wrapper_definition_p
return {};
}
struct interface_property_indexer_definition_generator
{
template<typename OutputIterator, typename Context>
bool generate(OutputIterator sink, attributes::property_def const& property, Context const& context) const
{
using efl::eolian::grammar::attribute_reorder;
using efl::eolian::grammar::counter;
using efl::eolian::grammar::attributes::parameter_direction;
using efl::eolian::grammar::attributes::parameter_def;
bool is_interface = context_find_tag<class_context>(context).current_wrapper_kind == class_context::interface;
assert (is_interface);
auto klass_name = name_helpers::klass_concrete_or_interface_name (*implementing_klass);
std::string managed_name = name_helpers::property_managed_name(property);
if (!as_generator
("public interface " << name_helpers::property_interface_indexer_short_name(property, *implementing_klass) << "\n"
<< "{\n"
<< "}\n"
).generate (sink, attributes::unused, context))
return false;
return true;
}
attributes::klass_def const* implementing_klass;
};
struct interface_property_indexer_definition_parameterized
{
interface_property_indexer_definition_generator operator()(attributes::klass_def const& klass) const
{
return {&klass};
}
} const interface_property_indexer_definition;
interface_property_indexer_definition_generator as_generator(interface_property_indexer_definition_parameterized)
{
return {};
}
}
namespace efl { namespace eolian { namespace grammar {
@ -572,6 +819,10 @@ struct is_eager_generator< ::eolian_mono::property_wrapper_definition_generator>
template <>
struct is_eager_generator< ::eolian_mono::property_wrapper_definition_parameterized> : std::true_type {};
template <>
struct is_eager_generator< ::eolian_mono::interface_property_indexer_definition_parameterized> : std::true_type {};
template <>
struct is_eager_generator< ::eolian_mono::interface_property_indexer_definition_generator> : std::true_type {};
template <>
struct is_generator< ::eolian_mono::function_definition_generator> : std::true_type {};
template <>
struct is_generator< ::eolian_mono::native_function_definition_generator> : std::true_type {};
@ -583,6 +834,10 @@ template <>
struct is_generator< ::eolian_mono::property_wrapper_definition_generator> : std::true_type {};
template <>
struct is_generator< ::eolian_mono::property_wrapper_definition_parameterized> : std::true_type {};
template <>
struct is_generator< ::eolian_mono::interface_property_indexer_definition_parameterized> : std::true_type {};
template <>
struct is_generator< ::eolian_mono::interface_property_indexer_definition_generator> : std::true_type {};
namespace type_traits {
template <>
@ -601,8 +856,13 @@ template <>
struct attributes_needed< ::eolian_mono::property_wrapper_definition_generator> : std::integral_constant<int, 1> {};
template <>
struct attributes_needed< ::eolian_mono::property_wrapper_definition_parameterized> : std::integral_constant<int, 1> {};
template <>
struct attributes_needed< ::eolian_mono::interface_property_indexer_definition_parameterized> : std::integral_constant<int, 1> {};
template <>
struct attributes_needed< ::eolian_mono::interface_property_indexer_definition_generator> : std::integral_constant<int, 1> {};
}
} } }
#endif

View File

@ -26,6 +26,7 @@ namespace eolian_mono {
struct class_context
{
enum wrapper_kind {
none,
interface,
concrete,
inherit,
@ -109,6 +110,12 @@ struct options_context {
std::string examples_dir;
};
template<typename Context>
bool context_want_beta(Context const& context)
{
return efl::eolian::grammar::context_find_tag<options_context>(context).want_beta;
}
}
#endif

View File

@ -17,6 +17,7 @@
#define EOLIAN_MONO_HELPERS_HH
#include "grammar/klass_def.hpp"
#include "grammar/context.hpp"
#include "blacklist.hh"
#include "generation_contexts.hh"
#include "name_helpers.hh"
@ -305,6 +306,106 @@ inline std::vector<attributes::constructor_def> reorder_constructors(std::vector
return constructors;
}
enum class has_property_wrapper_bit
{
has_none = 0
, has_getter = 1 << 0
, has_setter = 1 << 1
, has_indexer = 1 << 2
, has_key_tuple = 1 << 3
, has_value_tuple = 1 << 4
, has_set_error_check = 1 << 5
, has_get_error_check = 1 << 6
};
has_property_wrapper_bit& operator|=(has_property_wrapper_bit& self, has_property_wrapper_bit bit)
{
self = static_cast<has_property_wrapper_bit>(static_cast<int>(self) | static_cast<int>(bit));
return self;
}
bool operator&(has_property_wrapper_bit self, has_property_wrapper_bit bit)
{
return static_cast<int>(self) & static_cast<int>(bit);
}
template <typename Context>
has_property_wrapper_bit has_property_wrapper(attributes::property_def const& property, attributes::klass_def const* implementing_klass
, Context const& context)
{
using efl::eolian::grammar::context_find_tag;
has_property_wrapper_bit r = has_property_wrapper_bit::has_none;
if (blacklist::is_property_blacklisted(property, *implementing_klass, context))
return r;
bool has_getter = property.getter.is_engaged();
bool has_setter = property.setter.is_engaged();
bool is_interface = context_find_tag<class_context>(context).current_wrapper_kind == class_context::interface;
bool is_static = (property.getter.is_engaged() && property.getter->is_static)
|| (has_setter && property.setter->is_static);
bool is_concrete = context_find_tag<class_context>(context).current_wrapper_kind == class_context::concrete;
if (is_static)
{
if (is_interface) return r;
else if (is_concrete) return r;
}
// EINA_LOG_ERR("Generating property %s", name_helpers::property_managed_name(property).c_str());
// C# interface can have only
if (is_interface)
{
has_getter = has_getter && property.getter->scope == attributes::member_scope:: scope_public;
}
if (!has_getter)
{
return r;
}
if (property.getter->explicit_return_type != attributes::void_)
{
return r;
}
else if (has_setter)
{
if (property.setter->explicit_return_type != attributes::void_)
has_setter = false; // do not generate setter
else if (property.setter->keys != property.getter->keys)
has_setter = false;
else if (property.setter->values != property.getter->values)
has_setter = false;
}
if (is_interface)
{
if (property.getter->scope != attributes::member_scope::scope_public)
return r;
else if (has_setter && property.setter->scope != attributes::member_scope::scope_public)
has_setter = false;
}
if (has_getter)
r |= has_property_wrapper_bit::has_getter;
if (has_setter)
r |= has_property_wrapper_bit::has_setter;
if (property.getter->keys.size() == 1)
r |= has_property_wrapper_bit::has_indexer;
else if (property.getter->keys.size() > 1)
{
r |= has_property_wrapper_bit::has_indexer;
r |= has_property_wrapper_bit::has_key_tuple;
}
if (property.getter->values.size() > 1)
r |= has_property_wrapper_bit::has_value_tuple;
return r;
}
} // namespace helpers
} // namespace eolian_mono

View File

@ -106,6 +106,10 @@ struct klass
name_helpers::klass_full_concrete_or_interface_name(cls)},
context);
// Property wrappers
if (!as_generator(*(interface_property_indexer_definition(cls))).generate(sink, cls.properties, iface_cxt))
return false;
if(!as_generator(documentation).generate(sink, cls, iface_cxt))
return false;
@ -158,7 +162,7 @@ struct klass
).generate(sink, p, iface_cxt))
return false;
if (!as_generator(*(property_wrapper_definition(cls))).generate(sink, cls.properties, iface_cxt))
if (!as_generator(*(property_wrapper_definition(cls, cls))).generate(sink, cls.properties, iface_cxt))
return false;
// End of interface declaration
@ -259,13 +263,13 @@ struct klass
return false;
// Property wrappers
if (!as_generator(*(property_wrapper_definition(cls))).generate(sink, cls.properties, concrete_cxt))
if (!as_generator(*(property_wrapper_definition(cls, cls))).generate(sink, cls.properties, concrete_cxt))
return false;
for (auto&& klass : helpers::non_implemented_interfaces(cls, concrete_cxt))
{
attributes::klass_def c(get_klass(klass, cls.unit), cls.unit);
if (!as_generator(*(property_wrapper_definition(cls))).generate(sink, c.properties, concrete_cxt))
if (!as_generator(*(property_wrapper_definition(cls, c))).generate(sink, c.properties, concrete_cxt))
return false;
}
@ -343,13 +347,13 @@ struct klass
return false;
// Property wrappers
if (!as_generator(*(property_wrapper_definition(cls))).generate(sink, cls.properties, inherit_cxt))
if (!as_generator(*(property_wrapper_definition(cls, cls))).generate(sink, cls.properties, inherit_cxt))
return false;
for (auto&& klass : helpers::non_implemented_interfaces(cls, inherit_cxt))
{
attributes::klass_def c(get_klass(klass, cls.unit), cls.unit);
if (!as_generator(*(property_wrapper_definition(cls))).generate(sink, c.properties, inherit_cxt))
if (!as_generator(*(property_wrapper_definition(cls, c))).generate(sink, c.properties, inherit_cxt))
return false;
}
@ -381,7 +385,16 @@ struct klass
std::copy(c.properties.begin(), c.properties.end(), std::back_inserter(implementable_properties));
}
if (implementable_properties.size() == 0 && cls.parts.size() == 0)
std::stringstream extension_method_stream;
std::ostream_iterator<char> extension_method_iterator(extension_method_stream);
if (!as_generator
(*property_extension_method_definition(cls)
<< *part_extension_method_definition(cls))
.generate(extension_method_iterator, std::make_tuple(implementable_properties, cls.parts), context))
return false;
if (extension_method_stream.tellp() <= 0)
return true;
if(!as_generator
@ -389,12 +402,11 @@ struct klass
<< "#pragma warning disable CS1591\n" // Disabling warnings as DocFx will hide these classes
<<"public static class " << (string % "_") << name_helpers::klass_inherit_name(cls)
<< "_ExtensionMethods {\n"
<< *(property_extension_method_definition(cls))
<< *(part_extension_method_definition(cls))
<< extension_method_stream.str()
<< "}\n"
<< "#pragma warning restore CS1591\n"
<< "#endif\n")
.generate(sink, std::make_tuple(cls.namespaces, implementable_properties, cls.parts), context))
.generate(sink, cls.namespaces, context))
return false;
return true;

View File

@ -174,7 +174,8 @@ static const std::vector<std::string> verbs =
"sync",
"toggle",
"unbind",
"unregister"
"unregister",
"unselect"
};
const std::vector<std::string> not_verbs =
@ -333,28 +334,6 @@ inline std::string to_field_name(std::string const& in)
return utils::capitalize(in);
}
template<typename T>
inline std::string property_managed_name(T const& klass, std::string const& name)
{
auto names = utils::split(name, '_');
// No need to escape keyword here as it will be capitalized and already
// namespaced inside the owner class.
auto managed_name = utils::to_pascal_case(names);
auto managed_klass_name = klass_concrete_or_interface_name(klass);
if (managed_name == "Type")
managed_name = managed_klass_name + managed_name;
return managed_name;
}
inline std::string property_managed_name(attributes::property_def const& property)
{
return property_managed_name(property.klass, property.name);
}
inline std::string managed_part_name(attributes::part_def const& part)
{
std::vector<std::string> names = utils::split(part.name, '_');
@ -511,6 +490,45 @@ inline std::string translate_inherited_event_name(const attributes::event_def &e
return join_namespaces(klass.namespaces, '_') + klass_interface_name(klass) + "_" + managed_event_name(evt.name);
}
// Properties
template<typename T>
inline std::string property_managed_name(T const& klass, std::string const& name)
{
auto names = utils::split(name, '_');
// No need to escape keyword here as it will be capitalized and already
// namespaced inside the owner class.
auto managed_name = utils::to_pascal_case(names);
auto managed_klass_name = klass_concrete_or_interface_name(klass);
if (managed_name == "Type")
managed_name = managed_klass_name + managed_name;
return managed_name;
}
inline std::string property_managed_name(attributes::property_def const& property)
{
return property_managed_name(property.klass, property.name);
}
inline std::string property_concrete_indexer_name(attributes::property_def const& property)
{
return property_managed_name(property) + "Indexer";
}
template<typename T>
inline std::string property_interface_indexer_name(attributes::property_def const& property, T const& current_klass)
{
return name_helpers::klass_full_interface_name(current_klass) + property_concrete_indexer_name(property);
}
template<typename T>
inline std::string property_interface_indexer_short_name(attributes::property_def const& property, T const& current_klass)
{
return name_helpers::klass_interface_name(current_klass) + property_concrete_indexer_name(property);
}
// Open/close namespaces
template<typename OutputIterator, typename Context>
bool open_namespaces(OutputIterator sink, std::vector<std::string> namespaces, Context const& context)

View File

@ -65,7 +65,7 @@ struct is_generator< ::eolian_mono::parameter_generator> : std::true_type {};
namespace type_traits {
template <>
struct attributes_needed< ::eolian_mono::parameter_generator> : std::integral_constant<int, 1> {};
struct attributes_needed< ::eolian_mono::parameter_generator> : std::integral_constant<int, 1> {};
}
template <>
@ -75,9 +75,9 @@ struct is_generator< ::eolian_mono::marshall_parameter_generator> : std::true_ty
namespace type_traits {
template <>
struct attributes_needed< ::eolian_mono::marshall_parameter_generator> : std::integral_constant<int, 1> {};
struct attributes_needed< ::eolian_mono::marshall_parameter_generator> : std::integral_constant<int, 1> {};
}
template <>
struct is_eager_generator< ::eolian_mono::argument_generator> : std::true_type {};
template <>
@ -85,9 +85,9 @@ struct is_generator< ::eolian_mono::argument_generator> : std::true_type {};
namespace type_traits {
template <>
struct attributes_needed< ::eolian_mono::argument_generator> : std::integral_constant<int, 1> {};
struct attributes_needed< ::eolian_mono::argument_generator> : std::integral_constant<int, 1> {};
}
template <>
struct is_eager_generator< ::eolian_mono::argument_invocation_generator> : std::true_type {};
template <>
@ -1553,7 +1553,7 @@ struct native_convert_function_pointer_generator
struct constructor_parameter_name_generator
{
template <typename OutputIterator, typename Context>
bool generate(OutputIterator sink, attributes::parameter_def const& param, Context const& context) const
{

View File

@ -45,11 +45,11 @@ struct constant_definition_generator
template<typename OutputIterator, typename Context>
bool generate(OutputIterator sink, attributes::constant_def constant, Context const& context) const
{
// Open partial class
// Open static partial class
if (!name_helpers::open_namespaces(sink, constant.namespaces, context))
return false;
if (!as_generator("public partial class Constants\n{\n").generate(sink, attributes::unused, context))
if (!as_generator("public static partial class Constants\n{\n").generate(sink, attributes::unused, context))
return false;
std::string literal;
@ -83,7 +83,7 @@ struct constant_definition_generator
// FIXME missing documentation generator
// Close partial class
// Close static partial class
if (!as_generator("}\n").generate(sink, attributes::unused, context))
return false;

View File

@ -182,13 +182,14 @@ run(options_type const& opts)
auto context = context_add_tag(eolian_mono::indentation_context{0},
context_add_tag(eolian_mono::eolian_state_context{opts.state},
context_add_tag(eolian_mono::class_context{eolian_mono::class_context::none},
context_add_tag(eolian_mono::options_context{opts.want_beta,
opts.examples_dir},
context_add_tag(eolian_mono::library_context{opts.dllimport,
opts.v_major,
opts.v_minor,
opts.references_map},
efl::eolian::grammar::context_null()))));
efl::eolian::grammar::context_null())))));
EINA_ITERATOR_FOREACH(aliases, tp)
{

View File

@ -52,7 +52,7 @@ public class GenericModel<T> : Efl.Object, Efl.IModel
/// <summary>Gets the value of the given property in the wrapped model.</summary>
/// <param name="property">The property of the model.</param>
/// <returns>The value of the property.</returns>
public Eina.Value GetProperty( System.String property)
public Eina.Value GetProperty(System.String property)
{
return model.GetProperty(property);
}
@ -62,7 +62,7 @@ public class GenericModel<T> : Efl.Object, Efl.IModel
/// <param name="value">The value of the property.</param>
/// <returns>An <see cref="Eina.Future" /> that resolves when the property has
/// been set or reports an error if it could not be set.</returns>
public Eina.Future SetProperty( System.String property, Eina.Value value)
public Eina.Future SetProperty(System.String property, Eina.Value value)
{
return model.SetProperty(property, value);
}
@ -77,7 +77,7 @@ public class GenericModel<T> : Efl.Object, Efl.IModel
/// <summary>Returns an <see cref="Eina.Future" /> that will resolve when the property is ready to be read.</summary>
/// <param name="property">The property of the model.</param>
/// <returns>An <see cref="Eina.Future" /> that resolves when the property is ready.</returns>
public Eina.Future GetPropertyReady( System.String property)
public Eina.Future GetPropertyReady(System.String property)
{
return model.GetPropertyReady(property);
}
@ -87,7 +87,7 @@ public class GenericModel<T> : Efl.Object, Efl.IModel
/// <param name="count">The size of the range.</param>
/// <returns>An <see cref="Eina.Future" /> that resolves to an
/// <see cref="Eina.Array&lt;T&gt;" /> of children models.</returns>
public Eina.Future GetChildrenSlice( uint start, uint count)
public Eina.Future GetChildrenSlice(uint start, uint count)
{
return model.GetChildrenSlice(start, count);
}
@ -141,7 +141,7 @@ public class GenericModel<T> : Efl.Object, Efl.IModel
/// <param name="token">The token for the task's cancellation.</param>
/// <returns>Task that resolves when the property has been set or could not
/// be set.</returns>
public System.Threading.Tasks.Task<Eina.Value> SetPropertyAsync( System.String property, Eina.Value value, System.Threading.CancellationToken token=default(System.Threading.CancellationToken))
public System.Threading.Tasks.Task<Eina.Value> SetPropertyAsync(System.String property, Eina.Value value, System.Threading.CancellationToken token=default(System.Threading.CancellationToken))
{
return model.SetPropertyAsync(property, value, token);
}
@ -151,7 +151,7 @@ public class GenericModel<T> : Efl.Object, Efl.IModel
/// <param name="token">The token for the task's cancellation.</param>
/// <returns>Task that resolves when the given property is ready to be
/// read.</returns>
public System.Threading.Tasks.Task<Eina.Value> GetPropertyReadyAsync( System.String property, System.Threading.CancellationToken token=default(System.Threading.CancellationToken))
public System.Threading.Tasks.Task<Eina.Value> GetPropertyReadyAsync(System.String property, System.Threading.CancellationToken token=default(System.Threading.CancellationToken))
{
return model.GetPropertyReadyAsync(property, token);
}
@ -162,7 +162,7 @@ public class GenericModel<T> : Efl.Object, Efl.IModel
/// <param name="token">Token to notify the async operation of external request to cancel.</param>
/// <returns>Task that resolves when the desired <see cref="Eina.Array&lt;T&gt;" /> of
/// children models is ready.</returns>
public System.Threading.Tasks.Task<Eina.Value> GetChildrenSliceAsync( uint start, uint count, System.Threading.CancellationToken token=default(System.Threading.CancellationToken))
public System.Threading.Tasks.Task<Eina.Value> GetChildrenSliceAsync(uint start, uint count, System.Threading.CancellationToken token=default(System.Threading.CancellationToken))
{
return model.GetChildrenSliceAsync(start, count, token);
}

View File

@ -209,7 +209,7 @@ public abstract class Application
if (evt.arg.Initialization)
{
var evtArgv = evt.arg.Argv;
int n = evtArgv.Length;
int n = evtArgv.Count;
var argv = new string[n];
for (int i = 0; i < n; ++i)
{

View File

@ -28,7 +28,7 @@ namespace Eina
{
[EditorBrowsable(EditorBrowsableState.Never)]
public static class ArrayNativeFunctions
internal static class ArrayNativeFunctions
{
[DllImport(efl.Libs.Eina)] internal static extern IntPtr
eina_array_new(uint step);
@ -36,8 +36,9 @@ public static class ArrayNativeFunctions
eina_array_free(IntPtr array);
[DllImport(efl.Libs.Eina)] internal static extern void
eina_array_flush(IntPtr array);
public delegate bool KeepCb(IntPtr data, IntPtr gdata);
[DllImport(efl.Libs.Eina)] [return: MarshalAs(UnmanagedType.U1)] internal static extern bool
eina_array_remove(IntPtr array, IntPtr keep, IntPtr gdata);
eina_array_remove(IntPtr array, KeepCb keep, IntPtr gdata);
[DllImport(efl.Libs.Eina)] [return: MarshalAs(UnmanagedType.U1)] internal static extern bool
eina_array_push(IntPtr array, IntPtr data);
@ -45,6 +46,10 @@ public static class ArrayNativeFunctions
eina_array_iterator_new(IntPtr array);
[DllImport(efl.Libs.Eina)] internal static extern IntPtr
eina_array_accessor_new(IntPtr array);
[DllImport(efl.Libs.Eina)] [return: MarshalAs(UnmanagedType.U1)]
internal static extern bool
eina_array_find(IntPtr array, IntPtr data,
uint out_idx);
[DllImport(efl.Libs.CustomExports)] internal static extern void
eina_array_clean_custom_export_mono(IntPtr array);
@ -61,6 +66,8 @@ public static class ArrayNativeFunctions
[DllImport(efl.Libs.CustomExports)] [return: MarshalAs(UnmanagedType.U1)] internal static extern bool
eina_array_foreach_custom_export_mono(IntPtr array, IntPtr cb, IntPtr fdata);
[DllImport(efl.Libs.CustomExports)] internal static extern void
eina_array_insert_at_custom_export_mono(IntPtr array, uint index, IntPtr data);
}
/// <summary>A container of contiguous allocated elements.
@ -68,30 +75,42 @@ public static class ArrayNativeFunctions
/// </summary>
[SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix",
Justification="This is a generalized container mapping the native one.")]
public class Array<T> : IEnumerable<T>, IDisposable
public class Array<T> : IList<T>, IEnumerable<T>, IDisposable
{
public const uint DefaultStep = 32;
/// <summary>Pointer to the native buffer.</summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public IntPtr Handle {get;set;} = IntPtr.Zero;
public IntPtr Handle { get; set; } = IntPtr.Zero;
/// <summary>Whether this wrapper owns the native buffer.
/// <para>Since EFL 1.23.</para>
/// </summary>
public bool Own {get;set;}
internal bool Own { get; set; }
/// <summary>Who is in charge of releasing the resources wrapped by
/// this instance.
/// <para>Since EFL 1.23.</para>
/// </summary>
public bool OwnContent {get;set;}
/// <summary> Length of the array.
/// <para>Since EFL 1.23.</para>
internal bool OwnContent { get; set; }
/// <summary> Gets the number of elements contained in the <see cref="Array{T}" />.
/// <para>Since EFL 1.24.</para>
/// </summary>
public int Length
public int Count
{
get { return Count(); }
get => (int)eina_array_count_custom_export_mono(Handle);
}
/// <summary>
/// Gets a value indicating whether the <see cref="Array" /> is read-only.
/// <para>Since EFL 1.24.</para>
///<para>
/// It's the negative of <see cref="OwnContent" />.
///</para>
/// </summary>
public bool IsReadOnly { get => !OwnContent; }
private void InitNew(uint step)
{
Handle = eina_array_new(step);
@ -104,23 +123,62 @@ public class Array<T> : IEnumerable<T>, IDisposable
}
internal bool InternalPush(IntPtr ele)
{
return eina_array_push_custom_export_mono(Handle, ele);
}
=> eina_array_push_custom_export_mono(Handle, ele);
internal IntPtr InternalPop()
{
return eina_array_pop_custom_export_mono(Handle);
}
=> eina_array_pop_custom_export_mono(Handle);
internal IntPtr InternalDataGet(int idx)
{
return eina_array_data_get_custom_export_mono(Handle, (uint)idx); // TODO: Check bounds ???
}
=> eina_array_data_get_custom_export_mono(Handle, CheckBounds(idx));
internal void InternalDataSet(int idx, IntPtr ele)
=> eina_array_data_set_custom_export_mono(Handle, CheckBounds(idx), ele);
private uint CheckBounds(int idx)
{
eina_array_data_set_custom_export_mono(Handle, (uint)idx, ele); // TODO: Check bounds ???
if (!(0 <= idx && idx < Count))
{
throw new ArgumentOutOfRangeException(nameof(idx), $"{nameof(idx)} is out of bounds.");
}
return (uint)idx;
}
private U LoopingThrough<U>(T val, Func<int, U> f1, Func<U> f2)
{
for (int i = 0, count = Count; i < count; ++i)
{
if (NativeToManaged<T>(InternalDataGet(i)).Equals(val))
{
return f1(i);
}
}
return f2();
}
private void CheckOwnerships()
{
if ((Own == false) && (OwnContent == true))
{
throw new InvalidOperationException(nameof(Own) + "/" + nameof(OwnContent));
}
}
private void RequireWritable()
{
if (IsReadOnly)
{
throw new NotSupportedException("This object's instance is read only.");
}
}
private void DeleteData(IntPtr ele)
{
if (OwnContent)
{
NativeFree<T>(ele);
}
}
/// <summary>
@ -156,6 +214,7 @@ public class Array<T> : IEnumerable<T>, IDisposable
$"{nameof(Handle)} can't be null");
Own = own;
OwnContent = own;
CheckOwnerships();
}
/// <summary>
@ -173,6 +232,7 @@ public class Array<T> : IEnumerable<T>, IDisposable
$"{nameof(Handle)} can't be null");
Own = own;
OwnContent = ownContent;
CheckOwnerships();
}
/// <summary>
@ -197,15 +257,17 @@ public class Array<T> : IEnumerable<T>, IDisposable
return;
}
if (Own && OwnContent)
for (int len = (int)eina_array_count_custom_export_mono(h),
i = 0; i < len; ++i)
{
int len = (int)eina_array_count_custom_export_mono(h);
for (int i = 0; i < len; ++i)
if (!OwnContent)
{
NativeFree<T>(eina_array_data_get_custom_export_mono(h, (uint)i));
break;
}
}
DeleteData(eina_array_data_get_custom_export_mono(h, (uint)i));
}
if (Own)
{
if (disposing)
@ -236,27 +298,16 @@ public class Array<T> : IEnumerable<T>, IDisposable
Dispose();
}
/// <summary>
/// Releases the native array.
/// <para>Since EFL 1.23.</para>
/// </summary>
/// <returns>The native array.</returns>
public IntPtr Release()
{
IntPtr h = Handle;
Handle = IntPtr.Zero;
return h;
}
private void FreeElementsIfOwned()
{
if (OwnContent)
if (IsReadOnly)
{
int len = Length;
for (int i = 0; i < len; ++i)
{
NativeFree<T>(InternalDataGet(i));
}
throw new NotSupportedException("This object's instance is read only.");
}
for (int i = 0, count = Count; i < count; ++i)
{
DeleteData(InternalDataGet(i));
}
}
@ -279,26 +330,18 @@ public class Array<T> : IEnumerable<T>, IDisposable
eina_array_flush(Handle);
}
/// <summary>
/// Returns the number of elements in an array.
/// <para>Since EFL 1.23.</para>
/// </summary>
/// <returns>The number of elements.</returns>
public int Count()
{
return (int)eina_array_count_custom_export_mono(Handle);
}
public void SetOwnership(bool ownAll)
internal void SetOwnership(bool ownAll)
{
Own = ownAll;
OwnContent = ownAll;
CheckOwnerships();
}
public void SetOwnership(bool own, bool ownContent)
internal void SetOwnership(bool own, bool ownContent)
{
Own = own;
OwnContent = ownContent;
CheckOwnerships();
}
/// <summary>
@ -308,6 +351,8 @@ public class Array<T> : IEnumerable<T>, IDisposable
/// <param name="val">The value of the element to be inserted.</param>
public bool Push(T val)
{
RequireWritable();
IntPtr ele = ManagedToNativeAlloc(val);
var r = InternalPush(ele);
if (!r)
@ -334,11 +379,13 @@ public class Array<T> : IEnumerable<T>, IDisposable
/// <returns>The element at the end position.</returns>
public T Pop()
{
RequireWritable();
IntPtr ele = InternalPop();
var r = NativeToManaged<T>(ele);
if (OwnContent && ele != IntPtr.Zero)
if (ele != IntPtr.Zero)
{
NativeFree<T>(ele);
DeleteData(ele);
}
return r;
@ -351,10 +398,7 @@ public class Array<T> : IEnumerable<T>, IDisposable
/// <param name="idx">The position of the desired element.</param>
/// <returns>The element at the specified position</returns>
public T DataGet(int idx)
{
IntPtr ele = InternalDataGet(idx);
return NativeToManaged<T>(ele);
}
=> NativeToManaged<T>(InternalDataGet(idx));
/// <summary>
/// Returns the element of the array at the specified position.
@ -363,9 +407,8 @@ public class Array<T> : IEnumerable<T>, IDisposable
/// <param name="idx">The position of the desired element.</param>
/// <returns>The element at the specified position</returns>
public T At(int idx)
{
return DataGet(idx);
}
=> DataGet(idx);
/// <summary>
/// Replaces the element at the specified position.
@ -373,16 +416,17 @@ public class Array<T> : IEnumerable<T>, IDisposable
/// </summary>
/// <param name="idx">The position of the desired element.</param>
/// <param name="val">The value of the element to be inserted.</param>
public void DataSet(int idx, T val)
internal void DataSet(int idx, T val)
{
IntPtr ele = InternalDataGet(idx); // TODO: check bondaries ??
if (OwnContent && ele != IntPtr.Zero)
RequireWritable();
IntPtr ele = InternalDataGet(idx);
if (ele != IntPtr.Zero)
{
NativeFree<T>(ele);
DeleteData(ele);
}
ele = ManagedToNativeAlloc(val);
InternalDataSet(idx, ele);
InternalDataSet(idx, ManagedToNativeAlloc(val));
}
/// <summary>
@ -408,7 +452,7 @@ public class Array<T> : IEnumerable<T>, IDisposable
/// <returns>A array</returns>
public T[] ToArray()
{
int len = Length;
int len = Count;
var managed = new T[len];
for (int i = 0; i < len; ++i)
{
@ -440,17 +484,14 @@ public class Array<T> : IEnumerable<T>, IDisposable
/// <para>Since EFL 1.23.</para>
/// </summary>
public Eina.Iterator<T> GetIterator()
{
return new Eina.Iterator<T>(eina_array_iterator_new(Handle), true);
}
=> new Eina.Iterator<T>(eina_array_iterator_new(Handle), true);
/// <summary> Gets an Enumerator for this Array.
/// <para>Since EFL 1.23.</para>
/// </summary>
public IEnumerator<T> GetEnumerator()
{
int len = Length;
for (int i = 0; i < len; ++i)
for (int i = 0, count = Count; i < count; ++i)
{
yield return DataGet(i);
}
@ -460,16 +501,113 @@ public class Array<T> : IEnumerable<T>, IDisposable
/// <para>Since EFL 1.23.</para>
/// </summary>
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
{
return this.GetEnumerator();
}
=> this.GetEnumerator();
/// <summary> Gets an Accessor for this Array.
/// <para>Since EFL 1.23.</para>
/// </summary>
public Eina.Accessor<T> GetAccessor()
=> new Eina.Accessor<T>(eina_array_accessor_new(Handle), Ownership.Managed);
/// <summary>
/// Removes the first occurrence of a specific object.
/// <para>Since EFL 1.24.</para>
/// </summary>
/// <param name="val">The object to remove.</param>
public bool Remove(T val)
=> LoopingThrough(val,
(i) =>
{
RemoveAt(i);
return true;
}, () => false);
/// <summary>
/// Adds an item.
/// <para>Since EFL 1.24.</para>
/// </summary>
/// <param name="val">The object to add.</param>
public void Add(T val) => Push(val);
/// <summary>
/// Removes all items.
/// <para>Since EFL 1.24.</para>
/// </summary>
public void Clear() => Clean();
/// <summary>
/// Determines whether the <see cref="Array{T}" /> contains a specific value.
/// <para>Since EFL 1.24.</para>
/// </summary>
/// <param name="val">The object to locate.</param>
public bool Contains(T val)
=> LoopingThrough(val, (i) => true, () => false);
/// <summary>
/// Copies the elements of the <see cref="Array{T}" /> to an
/// <see cref="Array" />, starting at a particular <see cref="Array" /> index.
/// <para>Since EFL 1.24.</para>
/// </summary>
/// <param name="array">The one-dimensional <see cref="Array" /> that is the
/// destination of the elements copied from <see cref="Array{T}" />.
/// The <see cref="Array" /> must have zero-based indexing.</param>
/// <param name="arrayIndex">The zero-based index in array at which copying
/// begins.</param>
public void CopyTo(T[] array, int arrayIndex)
=> ToArray().CopyTo(array, arrayIndex);
/// <summary>
/// Determines the index of a specific item.
/// <para>Since EFL 1.24.</para>
/// </summary>
/// <param name="val">The object to locate.</param>
public int IndexOf(T val)
=> LoopingThrough(val, (i) => i, () => -1);
/// <summary>
/// Inserts an item to the <see cref="Array{T}" /> at the specified index.
/// <para>Since EFL 1.24.</para>
/// </summary>
/// <param name="index">The zero-based index at which item should be inserted.</param>
/// <param name="val">The object to insert.</param>
public void Insert(int index, T val)
{
return new Eina.Accessor<T>(eina_array_accessor_new(Handle), Ownership.Managed);
RequireWritable();
if (index < 0)
{
throw new ArgumentOutOfRangeException(nameof(index), $"{nameof(index)} cannot be negative.");
}
if (Count < index)
{
throw new ArgumentOutOfRangeException(nameof(index), $"{nameof(index)} is greater than {nameof(Count)} + 1.");
}
if (index == Count)
{
Push(val);
return;
}
eina_array_insert_at_custom_export_mono(Handle, (uint)index,
ManagedToNativeAlloc(val));
}
/// <summary>
/// Removes the <see cref="Array{T}" /> item at the specified index.
/// <para>Since EFL 1.24.</para>
/// </summary>
/// <param name="index">The zero-based index of the item to remove.</param>
public void RemoveAt(int index)
{
RequireWritable();
var ele = InternalDataGet(index);
DeleteData(ele);
eina_array_remove(Handle, (data,gdata)
=> ele != data,
IntPtr.Zero);
}
}

View File

@ -33,7 +33,7 @@ namespace Eina
{
[EditorBrowsable(EditorBrowsableState.Never)]
public enum ElementType
internal enum ElementType
{
NumericType,
StringType,
@ -43,7 +43,7 @@ public enum ElementType
[EditorBrowsable(EditorBrowsableState.Never)]
[StructLayout(LayoutKind.Sequential)]
public struct InlistMem : IEquatable<InlistMem>
internal struct InlistMem : IEquatable<InlistMem>
{
public IntPtr next {get;set;}
public IntPtr prev {get;set;}
@ -98,7 +98,7 @@ public struct InlistMem : IEquatable<InlistMem>
[EditorBrowsable(EditorBrowsableState.Never)]
[StructLayout(LayoutKind.Sequential)]
public struct InlistNode<T> : IEquatable<InlistNode<T>>
internal struct InlistNode<T> : IEquatable<InlistNode<T>>
{
public InlistMem __in_list {get;set;}
public T Val {get;set;}
@ -151,7 +151,7 @@ public struct InlistNode<T> : IEquatable<InlistNode<T>>
}
[EditorBrowsable(EditorBrowsableState.Never)]
public interface IBaseElementTraits<T>
internal interface IBaseElementTraits<T>
{
IntPtr ManagedToNativeAlloc(T man);
IntPtr ManagedToNativeAllocInlistNode(T man);
@ -172,7 +172,7 @@ public interface IBaseElementTraits<T>
}
[EditorBrowsable(EditorBrowsableState.Never)]
public class StringElementTraits : IBaseElementTraits<string>
internal class StringElementTraits : IBaseElementTraits<string>
{
public StringElementTraits()
{
@ -311,7 +311,7 @@ public class StringElementTraits : IBaseElementTraits<string>
}
[EditorBrowsable(EditorBrowsableState.Never)]
public class StringshareElementTraits : IBaseElementTraits<Eina.Stringshare>
internal class StringshareElementTraits : IBaseElementTraits<Eina.Stringshare>
{
public StringshareElementTraits()
{
@ -451,7 +451,7 @@ public class StringshareElementTraits : IBaseElementTraits<Eina.Stringshare>
}
[EditorBrowsable(EditorBrowsableState.Never)]
public class EflObjectElementTraits<T> : IBaseElementTraits<T>
internal class EflObjectElementTraits<T> : IBaseElementTraits<T>
{
public IntPtr ManagedToNativeAlloc(T man)
{
@ -609,7 +609,7 @@ public class EflObjectElementTraits<T> : IBaseElementTraits<T>
}
[EditorBrowsable(EditorBrowsableState.Never)]
public abstract class PrimitiveElementTraits<T>
internal abstract class PrimitiveElementTraits<T>
{
private Eina.Callbacks.EinaCompareCb dlgt = null;
@ -711,7 +711,7 @@ public abstract class PrimitiveElementTraits<T>
}
[EditorBrowsable(EditorBrowsableState.Never)]
abstract public class Primitive32ElementTraits<T> : PrimitiveElementTraits<T>, IBaseElementTraits<T>
internal abstract class Primitive32ElementTraits<T> : PrimitiveElementTraits<T>, IBaseElementTraits<T>
{
private static IBaseElementTraits<Int32> int32Traits = null;
@ -750,7 +750,7 @@ abstract public class Primitive32ElementTraits<T> : PrimitiveElementTraits<T>, I
}
[EditorBrowsable(EditorBrowsableState.Never)]
abstract public class Primitive64ElementTraits<T> : PrimitiveElementTraits<T>, IBaseElementTraits<T>
internal abstract class Primitive64ElementTraits<T> : PrimitiveElementTraits<T>, IBaseElementTraits<T>
{
private static IBaseElementTraits<Int64> int64Traits = null;
@ -789,7 +789,7 @@ abstract public class Primitive64ElementTraits<T> : PrimitiveElementTraits<T>, I
}
[EditorBrowsable(EditorBrowsableState.Never)]
public class IntElementTraits : Primitive32ElementTraits<int>, IBaseElementTraits<int>
internal class IntElementTraits : Primitive32ElementTraits<int>, IBaseElementTraits<int>
{
override public void ManagedToNativeCopyTo(int man, IntPtr mem)
{
@ -814,7 +814,7 @@ public class IntElementTraits : Primitive32ElementTraits<int>, IBaseElementTrait
}
[EditorBrowsable(EditorBrowsableState.Never)]
public class CharElementTraits : Primitive32ElementTraits<char>, IBaseElementTraits<char>
internal class CharElementTraits : Primitive32ElementTraits<char>, IBaseElementTraits<char>
{
override public void ManagedToNativeCopyTo(char man, IntPtr mem)
{
@ -839,7 +839,7 @@ public class CharElementTraits : Primitive32ElementTraits<char>, IBaseElementTra
}
[EditorBrowsable(EditorBrowsableState.Never)]
public class LongElementTraits : Primitive64ElementTraits<long>, IBaseElementTraits<long>
internal class LongElementTraits : Primitive64ElementTraits<long>, IBaseElementTraits<long>
{
override public void ManagedToNativeCopyTo(long man, IntPtr mem)
{
@ -864,7 +864,7 @@ public class LongElementTraits : Primitive64ElementTraits<long>, IBaseElementTra
}
[EditorBrowsable(EditorBrowsableState.Never)]
public class ShortElementTraits : Primitive32ElementTraits<short>, IBaseElementTraits<short>
internal class ShortElementTraits : Primitive32ElementTraits<short>, IBaseElementTraits<short>
{
override public void ManagedToNativeCopyTo(short man, IntPtr mem)
{
@ -889,7 +889,7 @@ public class ShortElementTraits : Primitive32ElementTraits<short>, IBaseElementT
}
[EditorBrowsable(EditorBrowsableState.Never)]
public class FloatElementTraits : Primitive32ElementTraits<float>, IBaseElementTraits<float>
internal class FloatElementTraits : Primitive32ElementTraits<float>, IBaseElementTraits<float>
{
override public void ManagedToNativeCopyTo(float man, IntPtr mem)
{
@ -914,7 +914,7 @@ public class FloatElementTraits : Primitive32ElementTraits<float>, IBaseElementT
}
[EditorBrowsable(EditorBrowsableState.Never)]
public class DoubleElementTraits : Primitive64ElementTraits<double>, IBaseElementTraits<double>
internal class DoubleElementTraits : Primitive64ElementTraits<double>, IBaseElementTraits<double>
{
override public void ManagedToNativeCopyTo(double man, IntPtr mem)
{
@ -939,7 +939,7 @@ public class DoubleElementTraits : Primitive64ElementTraits<double>, IBaseElemen
}
[EditorBrowsable(EditorBrowsableState.Never)]
public class ByteElementTraits : Primitive32ElementTraits<byte>, IBaseElementTraits<byte>
internal class ByteElementTraits : Primitive32ElementTraits<byte>, IBaseElementTraits<byte>
{
override public void ManagedToNativeCopyTo(byte man, IntPtr mem)
{
@ -964,7 +964,7 @@ public class ByteElementTraits : Primitive32ElementTraits<byte>, IBaseElementTra
}
[EditorBrowsable(EditorBrowsableState.Never)]
public static class TraitFunctions
internal static class TraitFunctions
{
public static bool IsEflObject(System.Type type)
{

View File

@ -31,7 +31,7 @@ namespace Eina
[StructLayout(LayoutKind.Sequential)]
[EditorBrowsable(EditorBrowsableState.Never)]
public struct HashTupleNative : IEquatable<HashTupleNative>
internal struct HashTupleNative : IEquatable<HashTupleNative>
{
public IntPtr key;
public IntPtr data;
@ -85,7 +85,7 @@ public struct HashTupleNative : IEquatable<HashTupleNative>
}
[EditorBrowsable(EditorBrowsableState.Never)]
public static class HashNativeFunctions
internal static class HashNativeFunctions
{
[DllImport(efl.Libs.Eina)] internal static extern IntPtr
eina_hash_new(IntPtr key_length_cb, IntPtr key_cmp_cb, IntPtr key_hash_cb, IntPtr data_free_cb, int buckets_power_size);

View File

@ -28,7 +28,7 @@ namespace Eina
{
[EditorBrowsable(EditorBrowsableState.Never)]
public static class InarrayNativeFunctions
internal static class InarrayNativeFunctions
{
[DllImport(efl.Libs.Eina)] internal static extern IntPtr
eina_inarray_new(uint member_size, uint step);

View File

@ -29,7 +29,7 @@ namespace Eina
{
[EditorBrowsable(EditorBrowsableState.Never)]
public static class InlistNativeFunctions
internal static class InlistNativeFunctions
{
[DllImport(efl.Libs.Eina)] internal static extern IntPtr
eina_inlist_append(IntPtr in_list, IntPtr in_item);

View File

@ -28,7 +28,7 @@ namespace Eina
{
[EditorBrowsable(EditorBrowsableState.Never)]
public static class IteratorNativeFunctions
internal static class IteratorNativeFunctions
{
[DllImport(efl.Libs.Eina)] internal static extern void
eina_iterator_free(IntPtr iterator);

View File

@ -29,7 +29,7 @@ namespace Eina
{
[EditorBrowsable(EditorBrowsableState.Never)]
public static class ListNativeFunctions
internal static class ListNativeFunctions
{
[DllImport(efl.Libs.Eina)] internal static extern IntPtr
eina_list_append(IntPtr list, IntPtr data);
@ -188,13 +188,13 @@ public class List<T> : IList<T>, IEnumerable<T>, IDisposable
{
if (!(0 <= idx && idx < Count))
{
throw new ArgumentOutOfRangeException();
throw new ArgumentOutOfRangeException(nameof(idx), $"{nameof(idx)} cannot be negative, neither smaller than {nameof(Count)}");
}
var ele = f(Handle, (uint)idx);
if (ele == IntPtr.Zero)
{
throw new ArgumentOutOfRangeException();
throw new ArgumentOutOfRangeException(nameof(idx), $"There is no position {nameof(idx)}");
}
return ele;

View File

@ -25,7 +25,7 @@ namespace Eina
// TODO: move all native functions to a "NativeMethods" class
[EditorBrowsable(EditorBrowsableState.Never)]
public static partial class NativeMethods
internal static partial class NativeMethods
{
[DllImport(efl.Libs.Eina)] internal static extern IntPtr
eina_stringshare_add(IntPtr str);

View File

@ -34,7 +34,7 @@ namespace Efl
namespace Eo
{
public static class Globals
internal static class Globals
{
/// <summary>Represents the type of the native Efl_Class.</summary>
internal enum EflClassType
@ -920,15 +920,26 @@ internal struct WrappingHandle
public IntPtr NativeHandle { get; private set; }
}
/// <summary>
/// Manage the initialization and cleanup for the Efl object subsystem.
/// <para>Since EFL 1.24.</para>
/// </summary>
public static class Config
{
/// <summary>
/// Initialize the EFL object subsystem.
/// <para>Since EFL 1.24.</para>
/// </summary>
public static void Init()
{
Globals.efl_object_init();
Globals.SetNativeDisposeCallbacks();
}
/// <summary>
/// Shutdown the EFL object subsystem.
/// <para>Since EFL 1.24.</para>
/// </summary>
public static void Shutdown()
{
Globals.efl_object_shutdown();
@ -970,7 +981,7 @@ class PrivateNativeClass : NativeClass
AllowMultiple = false,
Inherited = false)
]
public class BindingEntityAttribute: System.Attribute
internal class BindingEntityAttribute: System.Attribute
{
public static bool IsBindingEntity(System.Type t)
{

View File

@ -134,7 +134,7 @@ efl_main(void *data EINA_UNUSED,
efl_text_markup_set(efl_part(layout, "text"), "This is an example text. This is a layout text part.");
efl_text_wrap_set(efl_part(layout, "text"), wraps[wrap_itr].wrap);
efl_text_normal_color_set(efl_part(layout, "text"), 255, 255, 0, 255);
efl_text_color_set(efl_part(layout, "text"), 255, 255, 0, 255);
efl_text_font_family_set(efl_part(layout, "text"), "Serif");
efl_text_font_size_set(efl_part(layout, "text"), 12);

View File

@ -71,7 +71,7 @@ endif
x11 = dependency('x11', required: false)
if x11.found() == false
x11 = cc.find_library('x11', required: true)
x11 = cc.find_library('X11', required: true)
endif
xcb = dependency('xcb', required: false)
@ -81,7 +81,7 @@ endif
x11_xcb = dependency('x11-xcb', required: false)
if x11_xcb.found() == false
x11_xcb = cc.find_library('x11-xcb', required: true)
x11_xcb = cc.find_library('X11-xcb', required: true)
endif
foreach ecore_x_check : ecore_x_checks

View File

@ -799,20 +799,16 @@ _sel_update(Edje *ed, Evas_Textblock_Cursor *c EINA_UNUSED, Evas_Object *o, Entr
static Eina_Bool
_edje_entry_style_tag_check(Edje_Real_Part *rp, const char *tag)
{
if (!tag) return EINA_FALSE;
const Evas_Textblock_Style *ts = NULL;
ts = evas_object_textblock_style_user_peek(rp->object);
if (!ts) ts = evas_object_textblock_style_get(rp->object);
if (ts)
{
if (strstr(evas_textblock_style_get(ts), tag)) return EINA_TRUE;
}
else
{
ts = evas_object_textblock_style_get(rp->object);
if (ts)
{
if (strstr(evas_textblock_style_get(ts), tag)) return EINA_TRUE;
}
const char *style_str = evas_textblock_style_get(ts);
if (!style_str) return EINA_FALSE;
if (strstr(style_str, tag)) return EINA_TRUE;
}
return EINA_FALSE;

View File

@ -41,9 +41,9 @@ _efl_canvas_layout_part_text_efl_text_markup_markup_set(Eo *obj,
/* More Efl.Text.* API (@since 1.22) */
EOLIAN static void
_efl_canvas_layout_part_text_efl_text_style_backing_type_set(Eo *obj,
_efl_canvas_layout_part_text_efl_text_style_text_background_type_set(Eo *obj,
void *_pd EINA_UNUSED,
Efl_Text_Style_Backing_Type type)
Efl_Text_Style_Background_Type type)
{
Edje_User_Defined *eud;
@ -53,19 +53,19 @@ _efl_canvas_layout_part_text_efl_text_style_backing_type_set(Eo *obj,
eud = _edje_user_text_style_definition_fetch(pd->ed, pd->part);
eud->u.text_style.types |= EDJE_PART_TEXT_PROP_NONE;
efl_text_backing_type_set(pd->rp->object, type);
efl_text_background_type_set(pd->rp->object, type);
}
EOLIAN static Efl_Text_Style_Backing_Type
_efl_canvas_layout_part_text_efl_text_style_backing_type_get(const Eo *obj,
EOLIAN static Efl_Text_Style_Background_Type
_efl_canvas_layout_part_text_efl_text_style_text_background_type_get(const Eo *obj,
void *_pd EINA_UNUSED)
{
PROXY_DATA_GET(obj, pd);
if (pd->rp->part->type == EDJE_PART_TYPE_TEXT)
return EFL_TEXT_STYLE_BACKING_TYPE_DISABLED;
return EFL_TEXT_STYLE_BACKGROUND_TYPE_DISABLED;
return efl_text_backing_type_get(pd->rp->object);
return efl_text_background_type_get(pd->rp->object);
}
#define TEXT_COLOR_IMPL(x, X) \
@ -82,7 +82,7 @@ _efl_canvas_layout_part_text_efl_text_style_ ##x ##_color_set(Eo *obj, \
eud = _edje_user_text_style_definition_fetch(pd->ed, pd->part); \
\
eud->u.text_style.types |= EDJE_PART_TEXT_PROP_COLOR_ ##X; \
efl_text_ ##x ##_color_set(pd->rp->object, r, g, b, a); \
efl_ ##x ##_color_set(pd->rp->object, r, g, b, a); \
} \
\
EOLIAN static void \
@ -93,22 +93,22 @@ _efl_canvas_layout_part_text_efl_text_style_ ##x ##_color_get(const Eo *obj, \
PROXY_DATA_GET(obj, pd); \
*r = *g = *b = *a = 0; \
if (pd->rp->part->type == EDJE_PART_TYPE_TEXT) return; \
efl_text_ ##x ##_color_get(pd->rp->object, r, g, b, a); \
efl_ ##x ##_color_get(pd->rp->object, r, g, b, a); \
}
TEXT_COLOR_IMPL(backing, BACKING)
TEXT_COLOR_IMPL(glow, GLOW)
TEXT_COLOR_IMPL(glow2, GLOW2)
TEXT_COLOR_IMPL(normal, NORMAL)
TEXT_COLOR_IMPL(outline, OUTLINE)
TEXT_COLOR_IMPL(shadow, SHADOW)
TEXT_COLOR_IMPL(strikethrough, STRIKETHROUGH)
TEXT_COLOR_IMPL(underline, UNDERLINE)
TEXT_COLOR_IMPL(underline2, UNDERLINE2)
TEXT_COLOR_IMPL(underline_dashed, UNDERLINE_DASHED)
TEXT_COLOR_IMPL(text_background, BACKING)
TEXT_COLOR_IMPL(text_glow, GLOW)
TEXT_COLOR_IMPL(text_glow2, GLOW2)
TEXT_COLOR_IMPL(text, NORMAL)
TEXT_COLOR_IMPL(text_outline, OUTLINE)
TEXT_COLOR_IMPL(text_shadow, SHADOW)
TEXT_COLOR_IMPL(text_strikethrough, STRIKETHROUGH)
TEXT_COLOR_IMPL(text_underline, UNDERLINE)
TEXT_COLOR_IMPL(text_underline2, UNDERLINE2)
TEXT_COLOR_IMPL(text_underline_dashed, UNDERLINE_DASHED)
EOLIAN static void
_efl_canvas_layout_part_text_efl_text_style_effect_type_set(Eo *obj,
_efl_canvas_layout_part_text_efl_text_style_text_effect_type_set(Eo *obj,
void *_pd EINA_UNUSED,
Efl_Text_Style_Effect_Type type)
{
@ -201,7 +201,7 @@ _efl_canvas_layout_part_text_efl_text_font_font_size_get(const Eo *obj,
}
EOLIAN static void
_efl_canvas_layout_part_text_efl_text_style_shadow_direction_set(Eo *obj,
_efl_canvas_layout_part_text_efl_text_style_text_shadow_direction_set(Eo *obj,
void *_pd EINA_UNUSED,
Efl_Text_Style_Shadow_Direction type)
{
@ -217,7 +217,7 @@ _efl_canvas_layout_part_text_efl_text_style_shadow_direction_set(Eo *obj,
}
EOLIAN static void
_efl_canvas_layout_part_text_efl_text_style_strikethrough_type_set(Eo *obj,
_efl_canvas_layout_part_text_efl_text_style_text_strikethrough_type_set(Eo *obj,
void *_pd EINA_UNUSED,
Efl_Text_Style_Strikethrough_Type type)
{
@ -233,7 +233,7 @@ _efl_canvas_layout_part_text_efl_text_style_strikethrough_type_set(Eo *obj,
}
EOLIAN static void
_efl_canvas_layout_part_text_efl_text_style_underline_type_set(Eo *obj,
_efl_canvas_layout_part_text_efl_text_style_text_underline_type_set(Eo *obj,
void *_pd EINA_UNUSED,
Efl_Text_Style_Underline_Type type)
{
@ -250,7 +250,7 @@ _efl_canvas_layout_part_text_efl_text_style_underline_type_set(Eo *obj,
}
EOLIAN static void
_efl_canvas_layout_part_text_efl_text_style_underline_height_set(Eo *obj,
_efl_canvas_layout_part_text_efl_text_style_text_underline_height_set(Eo *obj,
void *_pd EINA_UNUSED,
double value)
{
@ -266,7 +266,7 @@ _efl_canvas_layout_part_text_efl_text_style_underline_height_set(Eo *obj,
}
EOLIAN static void
_efl_canvas_layout_part_text_efl_text_style_underline_dashed_width_set(Eo *obj,
_efl_canvas_layout_part_text_efl_text_style_text_underline_dashed_width_set(Eo *obj,
void *_pd EINA_UNUSED,
int value)
{
@ -282,7 +282,7 @@ _efl_canvas_layout_part_text_efl_text_style_underline_dashed_width_set(Eo *obj,
}
EOLIAN static void
_efl_canvas_layout_part_text_efl_text_style_underline_dashed_gap_set(Eo *obj,
_efl_canvas_layout_part_text_efl_text_style_text_underline_dashed_gap_set(Eo *obj,
void *_pd EINA_UNUSED,
int value)
{
@ -353,28 +353,28 @@ _canvas_layout_user_text_collect(Edje *ed, Edje_User_Defined *eud)
Edje_Part_Text_Prop *prop;
prop = _prop_new(props, EDJE_PART_TEXT_PROP_BACKING_TYPE);
prop->val.backing = efl_text_backing_type_get(rp->object);
prop->val.backing = efl_text_background_type_get(rp->object);
}
#define STYLE_COLOR_COLLECT(x, X) \
if (eud->u.text_style.types & EDJE_PART_TEXT_PROP_COLOR_ ##X) \
{ \
Edje_Part_Text_Prop *prop; \
prop = _prop_new(props, EDJE_PART_TEXT_PROP_COLOR_ ##X); \
efl_text_ ##x ##_color_get(rp->object, \
efl_ ##x ##_color_get(rp->object, \
&prop->val.color.r, &prop->val.color.g, \
&prop->val.color.b, &prop->val.color.a); \
} \
STYLE_COLOR_COLLECT(backing, BACKING)
STYLE_COLOR_COLLECT(glow, GLOW)
STYLE_COLOR_COLLECT(glow2, GLOW2)
STYLE_COLOR_COLLECT(normal, NORMAL)
STYLE_COLOR_COLLECT(outline, OUTLINE)
STYLE_COLOR_COLLECT(shadow, SHADOW)
STYLE_COLOR_COLLECT(strikethrough, STRIKETHROUGH)
STYLE_COLOR_COLLECT(underline, UNDERLINE)
STYLE_COLOR_COLLECT(underline2, UNDERLINE2)
STYLE_COLOR_COLLECT(underline_dashed, UNDERLINE_DASHED)
STYLE_COLOR_COLLECT(text_background, BACKING)
STYLE_COLOR_COLLECT(text_glow, GLOW)
STYLE_COLOR_COLLECT(text_glow2, GLOW2)
STYLE_COLOR_COLLECT(text, NORMAL)
STYLE_COLOR_COLLECT(text_outline, OUTLINE)
STYLE_COLOR_COLLECT(text_shadow, SHADOW)
STYLE_COLOR_COLLECT(text_strikethrough, STRIKETHROUGH)
STYLE_COLOR_COLLECT(text_underline, UNDERLINE)
STYLE_COLOR_COLLECT(text_underline2, UNDERLINE2)
STYLE_COLOR_COLLECT(text_underline_dashed, UNDERLINE_DASHED)
#undef STYLE_COLOR_COLLECT
if (eud->u.text_style.types & EDJE_PART_TEXT_PROP_EFFECT_TYPE)
@ -468,7 +468,7 @@ _canvas_layout_user_text_apply(Edje_User_Defined *eud, Eo *obj,
{
case EDJE_PART_TEXT_PROP_BACKING_TYPE:
efl_text_backing_type_set(
efl_text_background_type_set(
efl_part(obj,
eud->part),
prop->val.backing);
@ -476,7 +476,7 @@ _canvas_layout_user_text_apply(Edje_User_Defined *eud, Eo *obj,
#define STYLE_COLOR_CASE(x, X) \
case EDJE_PART_TEXT_PROP_COLOR_##X : \
efl_text_##x ##_color_set(efl_part(obj, \
efl_##x ##_color_set(efl_part(obj, \
eud->part), \
prop->val.color.r, \
prop->val.color.g, \
@ -484,16 +484,16 @@ _canvas_layout_user_text_apply(Edje_User_Defined *eud, Eo *obj,
prop->val.color.a); \
break;
STYLE_COLOR_CASE(backing, BACKING)
STYLE_COLOR_CASE(glow, GLOW)
STYLE_COLOR_CASE(glow2, GLOW2)
STYLE_COLOR_CASE(normal, NORMAL)
STYLE_COLOR_CASE(outline, OUTLINE)
STYLE_COLOR_CASE(shadow, SHADOW)
STYLE_COLOR_CASE(strikethrough, STRIKETHROUGH)
STYLE_COLOR_CASE(underline, UNDERLINE)
STYLE_COLOR_CASE(underline2, UNDERLINE2)
STYLE_COLOR_CASE(underline_dashed, UNDERLINE_DASHED)
STYLE_COLOR_CASE(text_background, BACKING)
STYLE_COLOR_CASE(text_glow, GLOW)
STYLE_COLOR_CASE(text_glow2, GLOW2)
STYLE_COLOR_CASE(text, NORMAL)
STYLE_COLOR_CASE(text_outline, OUTLINE)
STYLE_COLOR_CASE(text_shadow, SHADOW)
STYLE_COLOR_CASE(text_strikethrough, STRIKETHROUGH)
STYLE_COLOR_CASE(text_underline, UNDERLINE)
STYLE_COLOR_CASE(text_underline2, UNDERLINE2)
STYLE_COLOR_CASE(text_underline_dashed, UNDERLINE_DASHED)
#undef STYLE_COLOR_CASE
case EDJE_PART_TEXT_PROP_EFFECT_TYPE:

View File

@ -2341,7 +2341,7 @@ typedef struct
int ni; // number integer
int nd; // number double
Efl_Text_Format_Wrap wrap;
Efl_Text_Style_Backing_Type backing;
Efl_Text_Style_Background_Type backing;
Efl_Text_Style_Underline_Type underline;
struct
{

View File

@ -40,23 +40,23 @@ Efl.Text_Markup, Efl.Text_Format, Efl.Text_Font, Efl.Text_Style
Efl.Text_Format.wrap { set; get; }
Efl.Text_Font.font_family { set; get; }
Efl.Text_Font.font_size { set; get; }
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; }
Efl.Text_Style.text_color { set; get; }
Efl.Text_Style.text_background_type { set; get; }
Efl.Text_Style.text_background_color { set; get;}
Efl.Text_Style.text_underline_type { set; }
Efl.Text_Style.text_underline_color { set; get; }
Efl.Text_Style.text_underline2_color { set; get; }
Efl.Text_Style.text_underline_dashed_color { set; get; }
Efl.Text_Style.text_underline_height { set; }
Efl.Text_Style.text_underline_dashed_width { set; }
Efl.Text_Style.text_underline_dashed_gap { set; }
Efl.Text_Style.text_strikethrough_type { set; }
Efl.Text_Style.text_strikethrough_color { set; get; }
Efl.Text_Style.text_effect_type { set; }
Efl.Text_Style.text_shadow_direction { set; }
Efl.Text_Style.text_outline_color { set; get; }
Efl.Text_Style.text_shadow_color { set; get; }
Efl.Text_Style.text_glow_color { set; get; }
Efl.Text_Style.text_glow2_color { set; get; }
}
}

View File

@ -9,7 +9,10 @@ struct Efl.Model_Property_Event {
struct Efl.Model_Children_Event {
[[Every time a child is added the event @[Efl.Model.child,added] is dispatched
passing along this structure.]]
passing along this structure.
@since 1.24
]]
index: uint; [[index is a hint and is intended to provide a way for applications
to control/know children relative positions through listings.]]
child: Efl.Object; [[If an object has been built for this index and it is currently tracked by

View File

@ -1,8 +1,9 @@
enum @beta Efl.Text_Style_Backing_Type
enum @beta Efl.Text_Style_Background_Type
{
[[Whether to add a background colored rectangle (backing) to each line of text or not.]]
disabled = 0, [[Do not use backing.]]
enabled, [[Use backing.]]
[[Whether to add a background colored rectangle (background) to each line of text or not.]]
disabled = 0, [[Do not use background.]]
enabled, [[Use background.]]
}
enum @beta Efl.Text_Style_Strikethrough_Type
@ -10,6 +11,7 @@ enum @beta Efl.Text_Style_Strikethrough_Type
[[Whether to add a strike-through decoration to the displayed text or not.]]
disabled = 0, [[Do not use strike-through.]]
enabled, [[Use strike-through.]]
}
enum @beta Efl.Text_Style_Effect_Type
@ -62,7 +64,7 @@ interface @beta Efl.Text_Style {
]]
c_prefix: efl_text;
methods {
@property normal_color {
@property text_color {
[[Color of text, excluding decorations like, shadow, outline or glow.]]
values
{
@ -73,15 +75,15 @@ interface @beta Efl.Text_Style {
}
}
@property backing_type {
@property text_background_type {
[[Enables rendering of a background rectangle behind each line of text.]]
values
{
type: Efl.Text_Style_Backing_Type; [[Backing type.]]
type: Efl.Text_Style_Background_Type; [[Background type.]]
}
}
@property backing_color {
@property text_background_color {
[[Color of the background rectangle (backing) behind each line of text.]]
values
{
@ -92,7 +94,7 @@ interface @beta Efl.Text_Style {
}
}
@property underline_type {
@property text_underline_type {
[[Underline style for the text.]]
values
{
@ -100,7 +102,7 @@ interface @beta Efl.Text_Style {
}
}
@property underline_color
@property text_underline_color
{
[[Color of normal underline style.]]
values
@ -112,9 +114,9 @@ interface @beta Efl.Text_Style {
}
}
@property underline_height
@property text_underline_height
{
[[Width (in pixels) of the single underline when @.underline_type is
[[Width (in pixels) of the single underline when @.text_underline_type is
@Efl.Text_Style_Underline_Type.single.]]
values
{
@ -122,9 +124,9 @@ interface @beta Efl.Text_Style {
}
}
@property underline_dashed_color
@property text_underline_dashed_color
{
[[Color of the dashed underline. Only valid when @.underline_type is
[[Color of the dashed underline. Only valid when @.text_underline_type is
@Efl.Text_Style_Underline_Type.dashed.]]
values
{
@ -135,9 +137,9 @@ interface @beta Efl.Text_Style {
}
}
@property underline_dashed_width
@property text_underline_dashed_width
{
[[Length (in pixels) of the dashes when @.underline_type is
[[Length (in pixels) of the dashes when @.text_underline_type is
@Efl.Text_Style_Underline_Type.dashed.]]
values
{
@ -145,9 +147,9 @@ interface @beta Efl.Text_Style {
}
}
@property underline_dashed_gap
@property text_underline_dashed_gap
{
[[Length (in pixels) of the gaps between the dashes when @.underline_type is
[[Length (in pixels) of the gaps between the dashes when @.text_underline_type is
@Efl.Text_Style_Underline_Type.dashed.]]
values
{
@ -155,9 +157,9 @@ interface @beta Efl.Text_Style {
}
}
@property underline2_color
@property text_underline2_color
{
[[Color of the secondary underline. Only valid when @.underline_type is
[[Color of the secondary underline. Only valid when @.text_underline_type is
@Efl.Text_Style_Underline_Type.double.]]
values
{
@ -168,7 +170,7 @@ interface @beta Efl.Text_Style {
}
}
@property strikethrough_type {
@property text_strikethrough_type {
[[Enables crossed-out text.]]
values
{
@ -176,7 +178,7 @@ interface @beta Efl.Text_Style {
}
}
@property strikethrough_color
@property text_strikethrough_color
{
[[Color of the line striking through the text.]]
values
@ -188,14 +190,14 @@ interface @beta Efl.Text_Style {
}
}
@property effect_type {
@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 outline_color
@property text_outline_color
{
[[Color of the text outline.]]
values
@ -207,7 +209,7 @@ interface @beta Efl.Text_Style {
}
}
@property shadow_direction
@property text_shadow_direction
{
[[Direction of shadow effect.]]
values
@ -216,7 +218,7 @@ interface @beta Efl.Text_Style {
}
}
@property shadow_color
@property text_shadow_color
{
[[Color of the shadow.]]
values
@ -228,7 +230,7 @@ interface @beta Efl.Text_Style {
}
}
@property glow_color
@property text_glow_color
{
[[Color of the glow decoration.]]
values
@ -240,11 +242,11 @@ interface @beta Efl.Text_Style {
}
}
@property glow2_color
@property text_glow2_color
{
[[Color of the secondary glow decoration.
This is the color of the inner glow (where it touches the text) which
gradually fades into @.glow_color as it reaches the edge.
gradually fades into @.text_glow_color as it reaches the edge.
]]
values
{
@ -255,7 +257,7 @@ interface @beta Efl.Text_Style {
}
}
@property gfx_filter
@property text_gfx_filter
{
[[Program that applies a special filter

View File

@ -294,6 +294,17 @@ EAPI Eina_Bool eina_array_foreach_custom_export_mono(Eina_Array *array, Eina_Eac
return eina_array_foreach(array, cb, fdata);
}
EAPI void eina_array_insert_at_custom_export_mono(Eina_Array* array, unsigned int index, void* const data)
{
eina_array_push(array, data);
for (unsigned int i = eina_array_count(array) - 1; i > index; --i)
{
void* tmp = eina_array_data_get(array, i);
eina_array_data_set(array, i, eina_array_data_get(array, i - 1));
eina_array_data_set(array, i - 1, tmp);
}
}
// List //
EAPI Eina_List *eina_list_last_custom_export_mono(const Eina_List *list)

View File

@ -201,7 +201,7 @@ field_create(Eo *obj, Efl_Ui_Clock_Type field_type)
efl_text_multiline_set(efl_added, EINA_FALSE),
efl_text_interactive_editable_set(efl_added, EINA_FALSE),
efl_input_text_input_panel_autoshow_set(efl_added, EINA_FALSE),
efl_ui_textbox_context_menu_disabled_set(efl_added, EINA_TRUE));
efl_ui_textbox_context_menu_enabled_set(efl_added, EINA_FALSE));
}
evas_object_data_set(field_obj, "_field_type", (void *)field_type);

View File

@ -230,7 +230,7 @@ _image_sizing_eval(Eo *obj, Efl_Ui_Image_Data *sd, Evas_Object *img)
w = ((double)iw * h) / (double)ih;
break;
case EFL_GFX_IMAGE_SCALE_METHOD_EXPAND:
if ((ow - iw) > (oh - ih))
if (iw < ih)
{
w = ow;
h = ((double)ih * w) / (double)iw;

View File

@ -129,7 +129,10 @@ _efl_ui_item_efl_object_finalize(Eo *obj, Efl_Ui_Item_Data *pd EINA_UNUSED)
/* Support Item Focus Feature */
elm_widget_can_focus_set(obj, EINA_TRUE);
efl_ui_action_connector_bind_clickable_to_object(wd->resize_obj, obj);
if (efl_ui_layout_theme_version_get(obj) == 123)
efl_ui_action_connector_bind_clickable_to_object(wd->resize_obj, obj);
else
efl_ui_action_connector_bind_clickable_to_theme(wd->resize_obj, obj);
return eo;
}

View File

@ -645,6 +645,12 @@ _efl_ui_layout_base_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Layout_Data *sd)
return EFL_UI_THEME_APPLY_ERROR_NONE;
}
EOLIAN static int
_efl_ui_layout_base_theme_version_get(const Eo *obj EINA_UNUSED, Efl_Ui_Layout_Data *pd)
{
return pd->version;
}
EOLIAN static Eina_Bool
_efl_ui_layout_base_efl_ui_focus_object_on_focus_update(Eo *obj, Efl_Ui_Layout_Data *_pd EINA_UNUSED)
{

View File

@ -87,6 +87,22 @@ abstract Efl.Ui.Layout_Base extends Efl.Ui.Widget implements Efl.Container,
orientation : int; [[The new rotation angle, in degrees.]]
}
}
@property theme_version {
[[The version a theme does offer
A theme might offer older theme versions, with this property you can detect which version is running. The theme version is bound to the efl-version, the oldest version you will get here is 123. The newest of released EFL.
This property is only valid after @Efl.Ui.Widget.theme_apply has been called.
In case there is no version specified, 0 is returned.
]]
get {
}
values {
version : int; [[Theme version of this objec, for a EFL version called 1.23, this property will return 123.]]
}
}
}
implements {
class.constructor;

View File

@ -102,7 +102,7 @@ struct _Efl_Ui_Textbox_Data
Eina_Future *primary;
Eina_Future *clipboard;
} sel_future;
Eina_Bool sel_handler_disabled : 1;
Eina_Bool sel_handler_enabled : 1;
Eina_Bool start_handler_down : 1;
Eina_Bool start_handler_shown : 1;
Eina_Bool end_handler_down : 1;
@ -110,7 +110,7 @@ struct _Efl_Ui_Textbox_Data
Eina_Bool deferred_decoration_selection : 1;
Eina_Bool deferred_decoration_cursor : 1;
Eina_Bool deferred_decoration_anchor : 1;
Eina_Bool context_menu : 1;
Eina_Bool context_menu_enabled : 1;
Eina_Bool long_pressed : 1;
Eina_Bool auto_save : 1;
Eina_Bool has_text : 1;
@ -465,7 +465,7 @@ _update_selection_handler(Eo *obj)
return;
}
if (!sd->sel_handler_disabled)
if (sd->sel_handler_enabled)
{
Eina_Rect rect;
Eina_Position2D off;
@ -1176,7 +1176,7 @@ _menu_call(Evas_Object *obj)
{
sd->api->obj_longpress(obj);
}
else if (sd->context_menu)
else if (sd->context_menu_enabled)
{
const char *context_menu_orientation;
Eina_Bool ownersel;
@ -1925,7 +1925,7 @@ _update_text_theme(Eo *obj, Efl_Ui_Textbox_Data *sd)
colorcode = edje_object_data_get(wd->resize_obj, "style.color");
if (colorcode && _format_color_parse(colorcode, strlen(colorcode), &r, &g, &b, &a))
{
efl_text_normal_color_set(sd->text_obj, r, g, b, a);
efl_text_color_set(sd->text_obj, r, g, b, a);
}
// Guide Text
@ -1943,7 +1943,7 @@ _update_text_theme(Eo *obj, Efl_Ui_Textbox_Data *sd)
colorcode = edje_object_data_get(wd->resize_obj, "guide.style.color");
if (colorcode && _format_color_parse(colorcode, strlen(colorcode), &r, &g, &b, &a))
{
efl_text_normal_color_set(sd->text_guide_obj, r, g, b, a);
efl_text_color_set(sd->text_guide_obj, r, g, b, a);
}
}
@ -1974,13 +1974,13 @@ _efl_ui_textbox_efl_object_constructor(Eo *obj, Efl_Ui_Textbox_Data *sd)
sd->entry_edje = wd->resize_obj;
sd->cnp_mode = EFL_UI_SELECTION_FORMAT_TEXT;
sd->line_wrap = ELM_WRAP_WORD;
sd->context_menu = EINA_TRUE;
sd->context_menu_enabled = EINA_TRUE;
sd->auto_save = EINA_TRUE;
efl_text_interactive_editable_set(obj, EINA_TRUE);
efl_text_interactive_selection_allowed_set(obj, EINA_TRUE);
sd->drop_format = EFL_UI_SELECTION_FORMAT_MARKUP | EFL_UI_SELECTION_FORMAT_IMAGE;
sd->last.scroll = EINA_SIZE2D(0, 0);
sd->sel_handler_disabled = EINA_TRUE;
sd->sel_handler_enabled = EINA_FALSE;
return obj;
}
@ -2197,16 +2197,16 @@ _efl_ui_textbox_selection_get(const Eo *obj, Efl_Ui_Textbox_Data *sd EINA_UNUSED
}
EOLIAN static void
_efl_ui_textbox_selection_handler_disabled_set(Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *sd, Eina_Bool disabled)
_efl_ui_textbox_selection_handler_enabled_set(Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *sd, Eina_Bool enabled)
{
if (sd->sel_handler_disabled == disabled) return;
sd->sel_handler_disabled = disabled;
if (sd->sel_handler_enabled == enabled) return;
sd->sel_handler_enabled = enabled;
}
EOLIAN static Eina_Bool
_efl_ui_textbox_selection_handler_disabled_get(const Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *sd)
_efl_ui_textbox_selection_handler_enabled_get(const Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *sd)
{
return sd->sel_handler_disabled;
return sd->sel_handler_enabled;
}
static void
@ -2349,16 +2349,16 @@ _efl_ui_textbox_selection_paste(Eo *obj, Efl_Ui_Textbox_Data *sd EINA_UNUSED)
}
EOLIAN static void
_efl_ui_textbox_context_menu_disabled_set(Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *sd, Eina_Bool disabled)
_efl_ui_textbox_context_menu_enabled_set(Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *sd, Eina_Bool enabled)
{
if (sd->context_menu == !disabled) return;
sd->context_menu = !disabled;
if (sd->context_menu_enabled == enabled) return;
sd->context_menu_enabled = enabled;
}
EOLIAN static Eina_Bool
_efl_ui_textbox_context_menu_disabled_get(const Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *sd)
_efl_ui_textbox_context_menu_enabled_get(const Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *sd)
{
return !sd->context_menu;
return sd->context_menu_enabled;
}
EOLIAN static Eina_Error
@ -2808,7 +2808,7 @@ _textblock_node_format_to_atspi_text_attr(Efl_Text_Attribute_Handle *annotation)
Efl_Access_Text_Attribute *ret;
const char *txt;
txt = efl_text_attribute_factory_attribute_get(annotation);
txt = efl_text_formatter_attribute_get(annotation);
if (!txt) return NULL;
ret = calloc(1, sizeof(Efl_Access_Text_Attribute));
@ -2843,7 +2843,7 @@ _efl_ui_textbox_efl_access_text_attribute_get(const Eo *obj, Efl_Ui_Textbox_Data
efl_text_cursor_position_set(cur1, *start_offset);
efl_text_cursor_position_set(cur2, *end_offset);
annotations = efl_text_attribute_factory_range_attributes_get(cur1, cur2);
annotations = efl_text_formatter_range_attributes_get(cur1, cur2);
efl_del(cur1);
efl_del(cur2);
@ -2889,7 +2889,7 @@ _efl_ui_textbox_efl_access_text_text_attributes_get(const Eo *obj, Efl_Ui_Textbo
efl_text_cursor_position_set(cur1, *start_offset);
efl_text_cursor_position_set(cur2, *end_offset);
annotations = efl_text_attribute_factory_range_attributes_get(cur1, cur2);
annotations = efl_text_formatter_range_attributes_get(cur1, cur2);
efl_del(cur1);
efl_del(cur2);
@ -2924,7 +2924,7 @@ _efl_ui_textbox_efl_access_text_default_attributes_get(const Eo *obj, Efl_Ui_Tex
efl_text_cursor_move(start, EFL_TEXT_CURSOR_MOVE_TYPE_FIRST);
efl_text_cursor_move(end, EFL_TEXT_CURSOR_MOVE_TYPE_LAST);
annotations = efl_text_attribute_factory_range_attributes_get(start, end);
annotations = efl_text_formatter_range_attributes_get(start, end);
EINA_ITERATOR_FOREACH(annotations, an)
{
@ -3288,14 +3288,14 @@ _anchor_get(Eo *obj, Efl_Ui_Textbox_Data *sd, Efl_Text_Attribute_Handle *an)
Eina_List *i;
const char *str;
str = efl_text_attribute_factory_attribute_get(an);
str = efl_text_formatter_attribute_get(an);
EINA_LIST_FOREACH(sd->anchors, i, anc)
{
if (anc->annotation == an) break;
}
if (!anc && (efl_text_attribute_factory_attribute_is_item(an) || !strncmp(str, "a ", 2)))
if (!anc && (efl_text_formatter_attribute_is_item(an) || !strncmp(str, "a ", 2)))
{
const char *p;
@ -3304,7 +3304,7 @@ _anchor_get(Eo *obj, Efl_Ui_Textbox_Data *sd, Efl_Text_Attribute_Handle *an)
{
anc->obj = obj;
anc->annotation = an;
anc->item = efl_text_attribute_factory_attribute_is_item(an);
anc->item = efl_text_formatter_attribute_is_item(an);
p = strstr(str, "href=");
if (p)
{
@ -3344,7 +3344,7 @@ _anchors_update(Eo *obj, Efl_Ui_Textbox_Data *sd)
efl_text_cursor_move(start, EFL_TEXT_CURSOR_MOVE_TYPE_FIRST);
efl_text_cursor_move(end, EFL_TEXT_CURSOR_MOVE_TYPE_LAST);
it = efl_text_attribute_factory_range_attributes_get(start, end);
it = efl_text_formatter_range_attributes_get(start, end);
efl_del(start);
efl_del(end);
@ -3386,7 +3386,7 @@ _anchors_update(Eo *obj, Efl_Ui_Textbox_Data *sd)
}
rect = eina_list_data_get(anc->rects);
efl_text_attribute_factory_item_geometry_get(anc->annotation, &cx, &cy, &cw, &ch);
efl_text_formatter_item_geometry_get(anc->annotation, &cx, &cy, &cw, &ch);
efl_gfx_entity_size_set(rect->obj, EINA_SIZE2D(cw, ch));
efl_gfx_entity_position_set(rect->obj,
EINA_POSITION2D(off.x + cx, off.y + cy));
@ -3400,7 +3400,7 @@ _anchors_update(Eo *obj, Efl_Ui_Textbox_Data *sd)
size_t count;
start = efl_ui_textbox_cursor_create(obj);
end = efl_ui_textbox_cursor_create(obj);
efl_text_attribute_factory_attribute_cursors_get(anc->annotation, start, end);
efl_text_formatter_attribute_cursors_get(anc->annotation, start, end);
range = efl_text_cursor_range_geometry_get(start, end);
count = eina_list_count(eina_iterator_container_get(range));

View File

@ -19,14 +19,14 @@ class @beta Efl.Ui.Textbox extends Efl.Ui.Layout_Base implements Efl.Input.Click
scroll: bool; [[$true to enable scrolling. Default is $false.]]
}
}
@property context_menu_disabled {
[[This disables the entry's contextual (longpress) menu.]]
@property context_menu_enabled {
[[This enables or disables the entry's contextual (longpress) menu.]]
set {
}
get {
}
values {
disabled: bool; [[If $true, the menu is disabled.]]
enabled: bool; [[If $true, the menu is enabled.]]
}
}
@property cnp_mode {
@ -45,14 +45,14 @@ class @beta Efl.Ui.Textbox extends Efl.Ui.Layout_Base implements Efl.Input.Click
format: Efl.Ui.Selection_Format; [[Format for copy & paste.]]
}
}
@property selection_handler_disabled {
[[This disables the entry's selection handlers.]]
@property selection_handler_enabled {
[[This enables or disables the entry's selection handlers.]]
set {
}
get {
}
values {
disabled: bool; [[If $true, the selection handlers are disabled.]]
enabled: bool; [[If $true, the selection handlers are enabled.]]
}
}

View File

@ -381,8 +381,8 @@ abstract Efl.Ui.Widget extends Efl.Canvas.Group implements Efl.Access.Object,
}
}
parts {
shadow : Efl.Ui.Widget_Part_Shadow;
background : Efl.Ui.Widget_Part_Bg;
shadow : Efl.Ui.Widget_Part_Shadow; [[Drop-shadow or glow effect around the widget.]]
background : Efl.Ui.Widget_Part_Bg; [[Background of the widget.]]
}
implements {
class.constructor;

View File

@ -61,6 +61,7 @@ struct _Elm_Transit
} repeat;
double progress;
double inter_progress;
double base_progress;
double revert_begin_progress;
double revert_duration;
double total_revert_time;
@ -359,6 +360,7 @@ _transit_animate_cb(void *data)
}
/* Intervention Progress */
transit->base_progress = transit->progress;
transit->progress += transit->inter_progress;
switch (transit->tween_mode)
@ -956,7 +958,7 @@ elm_transit_progress_value_set(Elm_Transit *transit, double progress)
if (progress < 0) progress = 0;
else if (progress > 1) progress = 1;
transit->inter_progress = (progress - transit->progress);
transit->inter_progress = (progress - transit->base_progress);
}
EAPI double

View File

@ -536,6 +536,8 @@ parse_struct(Eo_Lexer *ls, const char *name, Eina_Bool is_extern,
qual_end:
check_next(ls, ';');
FILL_DOC(ls, fdef, doc);
if (def->doc && fdef->doc && def->doc->since && !fdef->doc->since)
fdef->doc->since = eina_stringshare_ref (def->doc->since);
}
check_match(ls, '}', '{', bline, bcolumn);
FILL_BASE(def->base, ls, line, column, TYPEDECL);
@ -656,6 +658,8 @@ parse_enum(Eo_Lexer *ls, const char *name, Eina_Bool is_extern,
if (want_next)
eo_lexer_get(ls);
FILL_DOC(ls, fdef, doc);
if (def->doc && fdef->doc && def->doc->since && !fdef->doc->since)
fdef->doc->since = eina_stringshare_ref (def->doc->since);
if (!want_next || ls->t.token == '}')
break;
}

View File

@ -897,7 +897,7 @@ struct function_def
}
else if(type == EOLIAN_PROP_GET)
{
for(auto&& v : values)
for(auto v : values)
{
v.direction = parameter_direction::out;
parameters.push_back(v);

View File

@ -84,7 +84,7 @@ extern "C" {
*/
#include <canvas/efl_canvas_snapshot.eo.h>
#include <canvas/efl_text_cursor.eo.h>
#include <canvas/efl_text_attribute_factory.eo.h>
#include <canvas/efl_text_formatter.eo.h>
#include <canvas/efl_canvas_textblock.eo.h>
#include <canvas/efl_canvas_textblock_factory.eo.h>
#include <canvas/efl_canvas_vg_node.eo.h>

View File

@ -148,7 +148,7 @@ struct _Efl_Canvas_Object_Animation_Event
* @{
*/
#include "canvas/efl_text_cursor.eo.h"
#include "canvas/efl_text_attribute_factory.eo.h"
#include "canvas/efl_text_formatter.eo.h"
#include "canvas/efl_canvas_textblock.eo.h"
#include "canvas/efl_canvas_textblock_factory.eo.h"
/**

View File

@ -322,12 +322,12 @@ EAPI Eina_Bool evas_textblock_cursor_at_cluster_as_single_glyph(Evas_Textblock_C
/*Attribute Factory Internal function*/
EAPI const char * efl_text_attribute_factory_attribute_get(Efl_Text_Attribute_Handle *annotation);
EAPI Eina_Iterator * efl_text_attribute_factory_range_attributes_get(const Efl_Text_Cursor *start, const Efl_Text_Cursor *end);
EAPI void efl_text_attribute_factory_attribute_cursors_get(const Efl_Text_Attribute_Handle *handle, Efl_Text_Cursor *start, Efl_Text_Cursor *end);
EAPI void efl_text_attribute_factory_remove(Efl_Text_Attribute_Handle *annotation);
EAPI Eina_Bool efl_text_attribute_factory_attribute_is_item(Efl_Text_Attribute_Handle *annotation);
EAPI Eina_Bool efl_text_attribute_factory_item_geometry_get(const Efl_Text_Attribute_Handle *annotation, int *x, int *y, int *w, int *h);
EAPI const char * efl_text_formatter_attribute_get(Efl_Text_Attribute_Handle *annotation);
EAPI Eina_Iterator * efl_text_formatter_range_attributes_get(const Efl_Text_Cursor *start, const Efl_Text_Cursor *end);
EAPI void efl_text_formatter_attribute_cursors_get(const Efl_Text_Attribute_Handle *handle, Efl_Text_Cursor *start, Efl_Text_Cursor *end);
EAPI void efl_text_formatter_remove(Efl_Text_Attribute_Handle *annotation);
EAPI Eina_Bool efl_text_formatter_attribute_is_item(Efl_Text_Attribute_Handle *annotation);
EAPI Eina_Bool efl_text_formatter_item_geometry_get(const Efl_Text_Attribute_Handle *annotation, int *x, int *y, int *w, int *h);
#ifdef __cplusplus
}

View File

@ -10,7 +10,7 @@ class @beta Efl.Canvas.Textblock extends Efl.Canvas.Object implements Efl.Text,
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.font_family, @Efl.Text_Font.font_size and
@Efl.Text_Style.normal_color.
@Efl.Text_Style.text_color.
Alternatively, @.style_apply can be used providing the attributes $font, $font_size and $color.
]]
methods {
@ -54,7 +54,8 @@ class @beta Efl.Canvas.Textblock extends Efl.Canvas.Object implements Efl.Text,
@property style_insets {
[[Gets the left, right, top and bottom insets of the text.
The inset is any applied padding on the text.
The inset is any applied padding on the text (which is calculated
internally by styling applied to Textblock).
]]
get {}
values {
@ -78,11 +79,13 @@ class @beta Efl.Canvas.Textblock extends Efl.Canvas.Object implements Efl.Text,
}
@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.move method.
]]
set {}
get {}
values {
mode: bool; [[$true for legacy mode, $false otherwise.]]
mode: bool; [[$true to treat new line as paragraph separator, $false otherwise.]]
}
}
style_apply {
@ -139,53 +142,53 @@ class @beta Efl.Canvas.Textblock extends Efl.Canvas.Object implements Efl.Text,
- $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.normal_color.
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.
See @Efl.Text_Style.underline_color.
See @Efl.Text_Style.text_underline_color.
- $underline2_color: Color code for the secondary text underline (See bottom for the complete list of
supported codes). Only valid when $[underline=double].
Default value is $[rgba(0,0,0,0)] meaning that secondary underline will not be rendered.
See @Efl.Text_Style.underline2_color.
See @Efl.Text_Style.text_underline2_color.
- $underline_dash_color: Color code for the dashed underline (See bottom for the complete list of supported
codes). Only valid when $[underline=dashed].
Default value is $[rgba(0,0,0,0)] meaning that dashed underline will not be rendered.
See @Efl.Text_Style.underline_dashed_color.
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 $style attribute includes an outline.
Default value is $[rgba(0,0,0,0)] meaning that no outline will be rendered.
See @Efl.Text_Style.outline_color.
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 $style attribute includes a shadow.
Default value is $[rgba(0,0,0,0)] meaning that no shadow will be rendered.
See @Efl.Text_Style.shadow_color.
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 $style attribute includes a glow.
Default value is $[rgba(0,0,0,0)] meaning that no glow will be rendered.
See @Efl.Text_Style.glow_color.
See @Efl.Text_Style.text_glow_color.
- $glow2_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 $style 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.glow2_color.
See @Efl.Text_Style.text_glow2_color.
- $backing_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 backing will be rendered.
Requires $backing.
See @Efl.Text_Style.backing_color.
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=on]
Default value is $[rgba(0,0,0,0)] meaning that no strike-through line will be rendered.
See @Efl.Text_Style.strikethrough_color.
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:
@ -230,17 +233,17 @@ class @beta Efl.Canvas.Textblock extends Efl.Canvas.Object implements Efl.Text,
$dashed (A dashed line under the text).
Default value is $off.
Requires either $underline_color, $underline2_color or $underline_dash_color.
See @Efl.Text_Style.underline_type.
See @Efl.Text_Style.text_underline_type.
- $strikethrough: Enables crossed-out text. Possible values are $on and $off.
Default value is $off.
Requires $strikethrough_color.
See @Efl.Text_Style.strikethrough_type.
See @Efl.Text_Style.text_strikethrough_type.
- $backing: Enables background color for the text. Possible values are $on and $off.
Default value is $off.
Requires $backing_color.
See @Efl.Text_Style.backing_type.
See @Efl.Text_Style.text_background_type.
- $style: Controls a number of decorations around the text, like shadow, outline and glow, including
combinations of them. Possible values are $plain (No decoration, alias for $off and $none),
@ -252,7 +255,7 @@ class @beta Efl.Canvas.Textblock extends Efl.Canvas.Object implements Efl.Text,
Default value is $plain.
Requires either $shadow_color, $glow_color or $outline_color.
Examples: $[style=outline], $[style=shadow,bottom_right], $[style=outline_shadow,bottom].
See @Efl.Text_Style.effect_type and @Efl.Text_Style.shadow_direction.
See @Efl.Text_Style.text_effect_type and @Efl.Text_Style.text_shadow_direction.
- $tabstops: Size (in pixels) of the tab character. The value must be a number greater than one.
Default value is $[32].
@ -311,15 +314,15 @@ class @beta Efl.Canvas.Textblock extends Efl.Canvas.Object implements Efl.Text,
- $underline_dash_width: Length (in pixels) of the dashes when $underline is $dashed.
Default value is $[6].
See @Efl.Text_Style.underline_dashed_width.
See @Efl.Text_Style.text_underline_dashed_width.
- $underline_dash_gap: Length (in pixels) of the gaps between the dashes when $underline is $dashed.
Default value is $[2].
See @Efl.Text_Style.underline_dashed_gap.
See @Efl.Text_Style.text_underline_dashed_gap.
- $underline_height: Width (in pixels) of the single underline when $underline is $single.
Default value is $[1].
See @Efl.Text_Style.underline_height.
See @Efl.Text_Style.text_underline_height.
- $gfx_filter: Experimental filter name. See @Efl.Gfx.Filter for more information.
@ -433,6 +436,10 @@ class @beta Efl.Canvas.Textblock extends Efl.Canvas.Object implements Efl.Text,
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<Eina.Rect>; [[Future for layout result.]]
}
@ -457,25 +464,25 @@ class @beta Efl.Canvas.Textblock extends Efl.Canvas.Object implements Efl.Text,
Efl.Text_Font.font_slant { get; set; }
Efl.Text_Font.font_width { get; set; }
Efl.Text_Font.font_bitmap_scalable { 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_color { get; set; }
Efl.Text_Style.strikethrough_type { get; set; }
Efl.Text_Style.strikethrough_color { get; set; }
Efl.Text_Style.effect_type { 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.gfx_filter { 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_underline2_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_glow2_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; }

View File

@ -4,15 +4,15 @@
#include "efl_canvas_textblock_internal.h"
#include "efl_text_cursor.eo.h"
#define MY_CLASS EFL_TEXT_ATTRIBUTE_FACTORY_CLASS
#define MY_CLASS EFL_TEXT_FORMATTER_CLASS
typedef struct
{
} Efl_Text_Attribute_Factory_Data;
} Efl_Text_Formatter_Data;
EOLIAN static void
_efl_text_attribute_factory_attribute_insert(const Efl_Text_Cursor *start, const Efl_Text_Cursor *end, const char *format)
_efl_text_formatter_attribute_insert(const Efl_Text_Cursor *start, const Efl_Text_Cursor *end, const char *format)
{
EINA_SAFETY_ON_TRUE_RETURN(!efl_text_cursor_handle_get(start) ||
!efl_text_cursor_handle_get(end) ||
@ -27,19 +27,19 @@ _efl_text_attribute_factory_attribute_insert(const Efl_Text_Cursor *start, const
}
EOLIAN static unsigned int
_efl_text_attribute_factory_attribute_clear(const Efl_Text_Cursor *start, const Efl_Text_Cursor *end)
_efl_text_formatter_attribute_clear(const Efl_Text_Cursor *start, const Efl_Text_Cursor *end)
{
unsigned int ret = 0;
Eina_Iterator *annotations;
Efl_Text_Attribute_Handle *an;
annotations = efl_text_attribute_factory_range_attributes_get(start, end);
annotations = efl_text_formatter_range_attributes_get(start, end);
if (!annotations) return ret;
EINA_ITERATOR_FOREACH(annotations, an)
{
ret++;
efl_text_attribute_factory_remove(an);
efl_text_formatter_remove(an);
}
eina_iterator_free(annotations);
@ -47,7 +47,7 @@ _efl_text_attribute_factory_attribute_clear(const Efl_Text_Cursor *start, const
}
const char *
efl_text_attribute_factory_attribute_get(Efl_Text_Attribute_Handle *annotation)
efl_text_formatter_attribute_get(Efl_Text_Attribute_Handle *annotation)
{
EINA_SAFETY_ON_TRUE_RETURN_VAL(!annotation || !(annotation->obj), NULL);
@ -55,7 +55,7 @@ efl_text_attribute_factory_attribute_get(Efl_Text_Attribute_Handle *annotation)
}
Eina_Iterator *
efl_text_attribute_factory_range_attributes_get(const Efl_Text_Cursor *start, const Efl_Text_Cursor *end)
efl_text_formatter_range_attributes_get(const Efl_Text_Cursor *start, const Efl_Text_Cursor *end)
{
Eina_List *lst = NULL;
Efl_Text_Attribute_Handle *it;
@ -86,7 +86,7 @@ efl_text_attribute_factory_range_attributes_get(const Efl_Text_Cursor *start, co
}
void
efl_text_attribute_factory_attribute_cursors_get(const Efl_Text_Attribute_Handle *handle, Efl_Text_Cursor *start, Efl_Text_Cursor *end)
efl_text_formatter_attribute_cursors_get(const Efl_Text_Attribute_Handle *handle, Efl_Text_Cursor *start, Efl_Text_Cursor *end)
{
EINA_SAFETY_ON_TRUE_RETURN (!handle || !(handle->obj));
@ -97,7 +97,7 @@ efl_text_attribute_factory_attribute_cursors_get(const Efl_Text_Attribute_Handle
}
void
efl_text_attribute_factory_remove(Efl_Text_Attribute_Handle *annotation)
efl_text_formatter_remove(Efl_Text_Attribute_Handle *annotation)
{
EINA_SAFETY_ON_TRUE_RETURN (!annotation || !(annotation->obj));
@ -106,7 +106,7 @@ efl_text_attribute_factory_remove(Efl_Text_Attribute_Handle *annotation)
}
Eina_Bool
efl_text_attribute_factory_attribute_is_item(Efl_Text_Attribute_Handle *annotation)
efl_text_formatter_attribute_is_item(Efl_Text_Attribute_Handle *annotation)
{
EINA_SAFETY_ON_TRUE_RETURN_VAL(!annotation || !(annotation->obj), EINA_FALSE);
@ -114,7 +114,7 @@ efl_text_attribute_factory_attribute_is_item(Efl_Text_Attribute_Handle *annotati
}
Eina_Bool
efl_text_attribute_factory_item_geometry_get(const Efl_Text_Attribute_Handle *annotation, int *x, int *y, int *w, int *h)
efl_text_formatter_item_geometry_get(const Efl_Text_Attribute_Handle *annotation, int *x, int *y, int *w, int *h)
{
EINA_SAFETY_ON_TRUE_RETURN_VAL(!annotation || !(annotation->obj), EINA_FALSE);
@ -130,4 +130,4 @@ efl_text_attribute_factory_item_geometry_get(const Efl_Text_Attribute_Handle *an
return evas_textblock_cursor_format_item_geometry_get(&cur, x, y, w, h);
}
#include "efl_text_attribute_factory.eo.c"
#include "efl_text_formatter.eo.c"

View File

@ -1,7 +1,7 @@
import efl_text_types;
abstract @beta Efl.Text.Attribute.Factory extends Efl.Object {
[[Attribute factory API to manage text attributes.
abstract @beta Efl.Text.Formatter extends Efl.Object {
[[Text Formatter API to manage text formatting(attributes).
Use it to insert and remove style attributes (font, size, color, ...) using @Efl.Text.Cursor on EFL Widgets.
Attributes can be assigned to character ranges, selected using two @Efl.Text.Cursor instances.

View File

@ -16345,40 +16345,40 @@ _efl_canvas_textblock_efl_text_font_font_bitmap_scalable_get(const Eo *obj EINA_
if (changed) _canvas_text_format_changed(obj, o);
static void
_efl_canvas_textblock_efl_text_style_normal_color_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, unsigned char r EINA_UNUSED, unsigned char g EINA_UNUSED, unsigned char b EINA_UNUSED, unsigned char a EINA_UNUSED)
_efl_canvas_textblock_efl_text_style_text_color_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, unsigned char r EINA_UNUSED, unsigned char g EINA_UNUSED, unsigned char b EINA_UNUSED, unsigned char a EINA_UNUSED)
{
ASYNC_BLOCK;
_FMT_COLOR_SET(normal);
}
static void
_efl_canvas_textblock_efl_text_style_normal_color_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, unsigned char *r EINA_UNUSED, unsigned char *g EINA_UNUSED, unsigned char *b EINA_UNUSED, unsigned char *a EINA_UNUSED)
_efl_canvas_textblock_efl_text_style_text_color_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, unsigned char *r EINA_UNUSED, unsigned char *g EINA_UNUSED, unsigned char *b EINA_UNUSED, unsigned char *a EINA_UNUSED)
{
_FMT_COLOR_RET(normal);
}
static void
_efl_canvas_textblock_efl_text_style_backing_type_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, Efl_Text_Style_Backing_Type type EINA_UNUSED)
_efl_canvas_textblock_efl_text_style_text_background_type_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, Efl_Text_Style_Background_Type type EINA_UNUSED)
{
ASYNC_BLOCK;
_FMT_SET(backing, type);
}
static Efl_Text_Style_Backing_Type
_efl_canvas_textblock_efl_text_style_backing_type_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED)
static Efl_Text_Style_Background_Type
_efl_canvas_textblock_efl_text_style_text_background_type_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED)
{
return _FMT(backing);
}
static void
_efl_canvas_textblock_efl_text_style_backing_color_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, unsigned char r EINA_UNUSED, unsigned char g EINA_UNUSED, unsigned char b EINA_UNUSED, unsigned char a EINA_UNUSED)
_efl_canvas_textblock_efl_text_style_text_background_color_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, unsigned char r EINA_UNUSED, unsigned char g EINA_UNUSED, unsigned char b EINA_UNUSED, unsigned char a EINA_UNUSED)
{
ASYNC_BLOCK;
_FMT_COLOR_SET(backing);
}
static void
_efl_canvas_textblock_efl_text_style_backing_color_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, unsigned char *r EINA_UNUSED, unsigned char *g EINA_UNUSED, unsigned char *b EINA_UNUSED, unsigned char *a EINA_UNUSED)
_efl_canvas_textblock_efl_text_style_text_background_color_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, unsigned char *r EINA_UNUSED, unsigned char *g EINA_UNUSED, unsigned char *b EINA_UNUSED, unsigned char *a EINA_UNUSED)
{
_FMT_COLOR_RET(backing);
}
@ -16396,7 +16396,7 @@ static struct
};
static void
_efl_canvas_textblock_efl_text_style_underline_type_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, Efl_Text_Style_Underline_Type type EINA_UNUSED)
_efl_canvas_textblock_efl_text_style_text_underline_type_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, Efl_Text_Style_Underline_Type type EINA_UNUSED)
{
ASYNC_BLOCK;
_FMT_SET(underline, _style_underline_map[type].underline_single);
@ -16406,111 +16406,111 @@ _efl_canvas_textblock_efl_text_style_underline_type_set(Eo *obj EINA_UNUSED, Efl
}
static Efl_Text_Style_Underline_Type
_efl_canvas_textblock_efl_text_style_underline_type_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED)
_efl_canvas_textblock_efl_text_style_text_underline_type_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED)
{
return _FMT(underline);
}
static void
_efl_canvas_textblock_efl_text_style_underline_color_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, unsigned char r EINA_UNUSED, unsigned char g EINA_UNUSED, unsigned char b EINA_UNUSED, unsigned char a EINA_UNUSED)
_efl_canvas_textblock_efl_text_style_text_underline_color_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, unsigned char r EINA_UNUSED, unsigned char g EINA_UNUSED, unsigned char b EINA_UNUSED, unsigned char a EINA_UNUSED)
{
ASYNC_BLOCK;
_FMT_COLOR_SET(underline);
}
static void
_efl_canvas_textblock_efl_text_style_underline_color_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, unsigned char *r EINA_UNUSED, unsigned char *g EINA_UNUSED, unsigned char *b EINA_UNUSED, unsigned char *a EINA_UNUSED)
_efl_canvas_textblock_efl_text_style_text_underline_color_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, unsigned char *r EINA_UNUSED, unsigned char *g EINA_UNUSED, unsigned char *b EINA_UNUSED, unsigned char *a EINA_UNUSED)
{
_FMT_COLOR_RET(underline);
}
static void
_efl_canvas_textblock_efl_text_style_underline_height_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, double height EINA_UNUSED)
_efl_canvas_textblock_efl_text_style_text_underline_height_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, double height EINA_UNUSED)
{
ASYNC_BLOCK;
_FMT_SET(underline_height, height);
}
static double
_efl_canvas_textblock_efl_text_style_underline_height_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED)
_efl_canvas_textblock_efl_text_style_text_underline_height_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED)
{
return _FMT(underline_height);
}
static void
_efl_canvas_textblock_efl_text_style_underline_dashed_color_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, unsigned char r EINA_UNUSED, unsigned char g EINA_UNUSED, unsigned char b EINA_UNUSED, unsigned char a EINA_UNUSED)
_efl_canvas_textblock_efl_text_style_text_underline_dashed_color_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, unsigned char r EINA_UNUSED, unsigned char g EINA_UNUSED, unsigned char b EINA_UNUSED, unsigned char a EINA_UNUSED)
{
ASYNC_BLOCK;
_FMT_COLOR_SET(underline_dash);
}
static void
_efl_canvas_textblock_efl_text_style_underline_dashed_color_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, unsigned char *r EINA_UNUSED, unsigned char *g EINA_UNUSED, unsigned char *b EINA_UNUSED, unsigned char *a EINA_UNUSED)
_efl_canvas_textblock_efl_text_style_text_underline_dashed_color_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, unsigned char *r EINA_UNUSED, unsigned char *g EINA_UNUSED, unsigned char *b EINA_UNUSED, unsigned char *a EINA_UNUSED)
{
_FMT_COLOR_RET(underline_dash);
}
static void
_efl_canvas_textblock_efl_text_style_underline_dashed_width_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, int width EINA_UNUSED)
_efl_canvas_textblock_efl_text_style_text_underline_dashed_width_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, int width EINA_UNUSED)
{
ASYNC_BLOCK;
_FMT_SET(underline_dash_width, width);
}
static int
_efl_canvas_textblock_efl_text_style_underline_dashed_width_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED)
_efl_canvas_textblock_efl_text_style_text_underline_dashed_width_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED)
{
return _FMT(underline_dash_width);
}
static void
_efl_canvas_textblock_efl_text_style_underline_dashed_gap_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, int gap EINA_UNUSED)
_efl_canvas_textblock_efl_text_style_text_underline_dashed_gap_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, int gap EINA_UNUSED)
{
ASYNC_BLOCK;
_FMT_SET(underline_dash_gap, gap);
}
static int
_efl_canvas_textblock_efl_text_style_underline_dashed_gap_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED)
_efl_canvas_textblock_efl_text_style_text_underline_dashed_gap_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED)
{
return _FMT(underline_dash_width);
}
static void
_efl_canvas_textblock_efl_text_style_underline2_color_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, unsigned char r EINA_UNUSED, unsigned char g EINA_UNUSED, unsigned char b EINA_UNUSED, unsigned char a EINA_UNUSED)
_efl_canvas_textblock_efl_text_style_text_underline2_color_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, unsigned char r EINA_UNUSED, unsigned char g EINA_UNUSED, unsigned char b EINA_UNUSED, unsigned char a EINA_UNUSED)
{
ASYNC_BLOCK;
_FMT_COLOR_SET(underline2);
}
static void
_efl_canvas_textblock_efl_text_style_underline2_color_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, unsigned char *r EINA_UNUSED, unsigned char *g EINA_UNUSED, unsigned char *b EINA_UNUSED, unsigned char *a EINA_UNUSED)
_efl_canvas_textblock_efl_text_style_text_underline2_color_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, unsigned char *r EINA_UNUSED, unsigned char *g EINA_UNUSED, unsigned char *b EINA_UNUSED, unsigned char *a EINA_UNUSED)
{
_FMT_COLOR_RET(underline2);
}
static void
_efl_canvas_textblock_efl_text_style_strikethrough_type_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, Efl_Text_Style_Strikethrough_Type type EINA_UNUSED)
_efl_canvas_textblock_efl_text_style_text_strikethrough_type_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, Efl_Text_Style_Strikethrough_Type type EINA_UNUSED)
{
ASYNC_BLOCK;
_FMT_SET(strikethrough, type);
}
static Efl_Text_Style_Strikethrough_Type
_efl_canvas_textblock_efl_text_style_strikethrough_type_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED)
_efl_canvas_textblock_efl_text_style_text_strikethrough_type_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED)
{
return _FMT(strikethrough);
}
static void
_efl_canvas_textblock_efl_text_style_strikethrough_color_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, unsigned char r EINA_UNUSED, unsigned char g EINA_UNUSED, unsigned char b EINA_UNUSED, unsigned char a EINA_UNUSED)
_efl_canvas_textblock_efl_text_style_text_strikethrough_color_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, unsigned char r EINA_UNUSED, unsigned char g EINA_UNUSED, unsigned char b EINA_UNUSED, unsigned char a EINA_UNUSED)
{
ASYNC_BLOCK;
_FMT_COLOR_SET(strikethrough);
}
static void
_efl_canvas_textblock_efl_text_style_strikethrough_color_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, unsigned char *r EINA_UNUSED, unsigned char *g EINA_UNUSED, unsigned char *b EINA_UNUSED, unsigned char *a EINA_UNUSED)
_efl_canvas_textblock_efl_text_style_text_strikethrough_color_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, unsigned char *r EINA_UNUSED, unsigned char *g EINA_UNUSED, unsigned char *b EINA_UNUSED, unsigned char *a EINA_UNUSED)
{
_FMT_COLOR_RET(strikethrough);
}
@ -16578,7 +16578,7 @@ _get_dir_from_map(Efl_Text_Style_Shadow_Direction dir)
}
static void
_efl_canvas_textblock_efl_text_style_effect_type_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, Efl_Text_Style_Effect_Type type EINA_UNUSED)
_efl_canvas_textblock_efl_text_style_text_effect_type_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, Efl_Text_Style_Effect_Type type EINA_UNUSED)
{
ASYNC_BLOCK;
_FMT_INFO_SET_START(effect, type);
@ -16590,26 +16590,26 @@ _efl_canvas_textblock_efl_text_style_effect_type_set(Eo *obj EINA_UNUSED, Efl_Ca
}
static Efl_Text_Style_Effect_Type
_efl_canvas_textblock_efl_text_style_effect_type_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED)
_efl_canvas_textblock_efl_text_style_text_effect_type_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED)
{
return _FMT_INFO(effect);
}
static void
_efl_canvas_textblock_efl_text_style_outline_color_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, unsigned char r EINA_UNUSED, unsigned char g EINA_UNUSED, unsigned char b EINA_UNUSED, unsigned char a EINA_UNUSED)
_efl_canvas_textblock_efl_text_style_text_outline_color_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, unsigned char r EINA_UNUSED, unsigned char g EINA_UNUSED, unsigned char b EINA_UNUSED, unsigned char a EINA_UNUSED)
{
ASYNC_BLOCK;
_FMT_COLOR_SET(outline);
}
static void
_efl_canvas_textblock_efl_text_style_outline_color_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, unsigned char *r EINA_UNUSED, unsigned char *g EINA_UNUSED, unsigned char *b EINA_UNUSED, unsigned char *a EINA_UNUSED)
_efl_canvas_textblock_efl_text_style_text_outline_color_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, unsigned char *r EINA_UNUSED, unsigned char *g EINA_UNUSED, unsigned char *b EINA_UNUSED, unsigned char *a EINA_UNUSED)
{
_FMT_COLOR_RET(outline);
}
static void
_efl_canvas_textblock_efl_text_style_shadow_direction_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, Efl_Text_Style_Shadow_Direction type EINA_UNUSED)
_efl_canvas_textblock_efl_text_style_text_shadow_direction_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, Efl_Text_Style_Shadow_Direction type EINA_UNUSED)
{
ASYNC_BLOCK;
_FMT_INFO_SET_START(shadow_direction, type);
@ -16619,52 +16619,52 @@ _efl_canvas_textblock_efl_text_style_shadow_direction_set(Eo *obj EINA_UNUSED, E
}
static Efl_Text_Style_Shadow_Direction
_efl_canvas_textblock_efl_text_style_shadow_direction_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED)
_efl_canvas_textblock_efl_text_style_text_shadow_direction_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED)
{
return _FMT_INFO(shadow_direction);
}
static void
_efl_canvas_textblock_efl_text_style_shadow_color_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, unsigned char r EINA_UNUSED, unsigned char g EINA_UNUSED, unsigned char b EINA_UNUSED, unsigned char a EINA_UNUSED)
_efl_canvas_textblock_efl_text_style_text_shadow_color_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, unsigned char r EINA_UNUSED, unsigned char g EINA_UNUSED, unsigned char b EINA_UNUSED, unsigned char a EINA_UNUSED)
{
ASYNC_BLOCK;
_FMT_COLOR_SET(shadow);
}
static void
_efl_canvas_textblock_efl_text_style_shadow_color_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, unsigned char *r EINA_UNUSED, unsigned char *g EINA_UNUSED, unsigned char *b EINA_UNUSED, unsigned char *a EINA_UNUSED)
_efl_canvas_textblock_efl_text_style_text_shadow_color_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, unsigned char *r EINA_UNUSED, unsigned char *g EINA_UNUSED, unsigned char *b EINA_UNUSED, unsigned char *a EINA_UNUSED)
{
_FMT_COLOR_RET(shadow);
}
static void
_efl_canvas_textblock_efl_text_style_glow_color_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, unsigned char r EINA_UNUSED, unsigned char g EINA_UNUSED, unsigned char b EINA_UNUSED, unsigned char a EINA_UNUSED)
_efl_canvas_textblock_efl_text_style_text_glow_color_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, unsigned char r EINA_UNUSED, unsigned char g EINA_UNUSED, unsigned char b EINA_UNUSED, unsigned char a EINA_UNUSED)
{
ASYNC_BLOCK;
_FMT_COLOR_SET(glow);
}
static void
_efl_canvas_textblock_efl_text_style_glow_color_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, unsigned char *r EINA_UNUSED, unsigned char *g EINA_UNUSED, unsigned char *b EINA_UNUSED, unsigned char *a EINA_UNUSED)
_efl_canvas_textblock_efl_text_style_text_glow_color_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, unsigned char *r EINA_UNUSED, unsigned char *g EINA_UNUSED, unsigned char *b EINA_UNUSED, unsigned char *a EINA_UNUSED)
{
_FMT_COLOR_RET(glow);
}
static void
_efl_canvas_textblock_efl_text_style_glow2_color_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, unsigned char r EINA_UNUSED, unsigned char g EINA_UNUSED, unsigned char b EINA_UNUSED, unsigned char a EINA_UNUSED)
_efl_canvas_textblock_efl_text_style_text_glow2_color_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, unsigned char r EINA_UNUSED, unsigned char g EINA_UNUSED, unsigned char b EINA_UNUSED, unsigned char a EINA_UNUSED)
{
ASYNC_BLOCK;
_FMT_COLOR_SET(glow2);
}
static void
_efl_canvas_textblock_efl_text_style_glow2_color_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, unsigned char *r EINA_UNUSED, unsigned char *g EINA_UNUSED, unsigned char *b EINA_UNUSED, unsigned char *a EINA_UNUSED)
_efl_canvas_textblock_efl_text_style_text_glow2_color_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, unsigned char *r EINA_UNUSED, unsigned char *g EINA_UNUSED, unsigned char *b EINA_UNUSED, unsigned char *a EINA_UNUSED)
{
_FMT_COLOR_RET(glow2);
}
static void
_efl_canvas_textblock_efl_text_style_gfx_filter_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED,
_efl_canvas_textblock_efl_text_style_text_gfx_filter_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED,
const char *gfx_filter_name)
{
ASYNC_BLOCK;
@ -16688,7 +16688,7 @@ _efl_canvas_textblock_efl_text_style_gfx_filter_set(Eo *obj EINA_UNUSED, Efl_Can
}
static const char *
_efl_canvas_textblock_efl_text_style_gfx_filter_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED)
_efl_canvas_textblock_efl_text_style_text_gfx_filter_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED)
{
return _FMT(gfx_filter)?_FMT(gfx_filter->name):NULL;
}

View File

@ -56,7 +56,7 @@ pub_eo_files = [
'efl_canvas_event_grabber.eo',
'efl_text_cursor.eo',
'efl_canvas_textblock.eo',
'efl_text_attribute_factory.eo',
'efl_text_formatter.eo',
'efl_canvas_object_animation.eo',
]
@ -210,7 +210,7 @@ evas_src += files([
'evas_canvas3d_eet.c',
'efl_canvas_object_animation.c',
'efl_text_cursor.c',
'efl_text_attribute_factory.c'
'efl_text_formatter.c'
])
evas_include_directories += include_directories('.')

View File

@ -276,7 +276,11 @@ evas_cache_vg_surface_key_get(Efl_Canvas_Vg_Node *root, int w, int h, int frame_
Eina_Strbuf *hash_key = eina_strbuf_new();
eina_strbuf_append_printf(hash_key, "%p/%d/%d/%d", root, w, h, frame_idx);
const char *new_key = eina_strbuf_string_get(hash_key);
if (!new_key) return NULL;
if (!new_key)
{
eina_strbuf_free(hash_key);
return NULL;
}
Eina_List *l;
char *key;

View File

@ -1,6 +1,5 @@
#!/usr/bin/env python2
import sys
import os
import os.path
import csv

View File

@ -180,7 +180,7 @@ START_TEST(edje_test_text_color)
efl_file_key_set(layout, "test");
ck_assert(!efl_file_load(layout));
efl_text_normal_color_set(efl_part(layout, "text"), 255, 255, 255, 255);
efl_text_color_set(efl_part(layout, "text"), 255, 255, 255, 255);
}
END_TEST
@ -195,9 +195,9 @@ _basic_check(Eo *layout, Eina_Bool set)
// Just normal_color is enough
if (set)
{
efl_text_normal_color_set(efl_part(layout, "text"),
efl_text_color_set(efl_part(layout, "text"),
255, 255, 255, 255);
efl_text_backing_color_set(efl_part(layout, "text"),
efl_text_background_color_set(efl_part(layout, "text"),
255, 255, 255, 255);
efl_text_glow_color_set(efl_part(layout, "text"),
255, 255, 255, 255);
@ -217,13 +217,13 @@ _basic_check(Eo *layout, Eina_Bool set)
255, 255, 255, 255);
}
efl_text_normal_color_get(efl_part(layout, "text"), &r, &g, &b, &a);
efl_text_color_get(efl_part(layout, "text"), &r, &g, &b, &a);
ck_assert_int_eq(r, 255);
ck_assert_int_eq(g, 255);
ck_assert_int_eq(b, 255);
ck_assert_int_eq(a, 255);
efl_text_backing_color_get(efl_part(layout, "text"), &r, &g, &b, &a);
efl_text_background_color_get(efl_part(layout, "text"), &r, &g, &b, &a);
ck_assert_int_eq(r, 255);
ck_assert_int_eq(g, 255);
ck_assert_int_eq(b, 255);

189
src/tests/efl_mono/Array.cs Normal file
View File

@ -0,0 +1,189 @@
using System;
using System.Collections.Generic;
using System.Linq;
namespace TestSuite
{
class TestArray
{
public static void TestAdd()
{
IList<int> array = new Eina.Array<int>();
Test.AssertEquals(array.Count, 0);
array.Add(1);
Test.AssertEquals(array.Count, 1);
array.Add(2);
Test.AssertEquals(array.Count, 2);
}
public static void TestRemoveAt()
{
IList<int> array = new Eina.Array<int>();
Test.AssertEquals(array.Count, 0);
array.Add(1);
Test.AssertEquals(array.Count, 1);
Test.AssertEquals(array[0], 1);
array.RemoveAt(0);
Test.AssertEquals(array.Count, 0);
array.Add(1);
array.Add(0);
array.Add(1);
Test.AssertEquals(array.Count, 3);
Test.AssertEquals(array[2], 1);
array.RemoveAt(2);
Test.AssertEquals(array.Count, 2);
Test.AssertEquals(array[0], 1);
}
public static void TestRemove()
{
IList<int> array = new Eina.Array<int>();
Test.Assert(!array.Remove(0));
Test.AssertEquals(array.Count, 0);
array.Add(1);
Test.AssertEquals(array.Count, 1);
Test.Assert(array.Remove(1));
Test.AssertEquals(array.Count, 0);
array.Add(1);
array.Add(1);
Test.AssertEquals(array.Count, 2);
Test.Assert(array.Remove(1));
Test.AssertEquals(array.Count, 1);
array.Add(0);
array.Add(1);
Test.AssertEquals(array[1], 0);
Test.AssertEquals(array.Count, 3);
Test.Assert(!array.Remove(2));
Test.Assert(array.Remove(1));
Test.AssertEquals(array[1], 1);
Test.AssertEquals(array.Count, 2);
}
public static void TestContains()
{
IList<int> array = new Eina.Array<int>();
Test.AssertEquals(array.Count, 0);
Test.Assert(!array.Contains(0));
array.Add(0);
Test.Assert(array.Contains(0));
Test.Assert(array.Remove(0));
Test.Assert(!array.Contains(0));
array.Add(1);
array.Add(0);
Test.Assert(array.Contains(0));
}
public static void TestClear()
{
IList<int> array = new Eina.Array<int>();
Test.AssertEquals(array.Count, 0);
array.Clear();
Test.AssertEquals(array.Count, 0);
array.Add(0);
Test.AssertEquals(array.Count, 1);
array.Clear();
Test.AssertEquals(array.Count, 0);
array.Add(0);
array.Add(0);
Test.AssertEquals(array.Count, 2);
array.Clear();
Test.AssertEquals(array.Count, 0);
array.Add(0);
array.Add(0);
Test.AssertEquals(array.Count, 2);
Test.Assert(array.Remove(0));
Test.AssertEquals(array.Count, 1);
array.Clear();
Test.AssertEquals(array.Count, 0);
}
public static void TestInsert()
{
IList<int> array = new Eina.Array<int>();
array.Add(99);
Test.AssertEquals(array.Count, 1);
array.Insert(0, 6);
Test.AssertEquals(array.Count, 2);
Test.AssertEquals(array[0], 6);
array.Insert(1, 5);
Test.AssertEquals(array.Count, 3);
Test.AssertEquals(array[1], 5);
array.Insert(1, 10);
Test.AssertEquals(array.Count, 4);
Test.AssertEquals(array[1], 10);
array.RemoveAt(1);
Test.AssertEquals(array.Count, 3);
Test.AssertEquals(array[1], 5);
array.Insert(1, 42);
Test.AssertEquals(array.Count, 4);
Test.AssertEquals(array[1], 42);
}
public static void TestIndexOf()
{
IList<int> array = new Eina.Array<int>();
Test.AssertEquals(array.Count, 0);
array.Add(1);
Test.AssertEquals(array.Count, 1);
Test.AssertEquals(0, array.IndexOf(1));
array.Insert(0, 0);
Test.AssertEquals(array.Count, 2);
Test.AssertEquals(0, array.IndexOf(0));
Test.AssertEquals(1, array.IndexOf(1));
array.Insert(0, 1);
Test.AssertEquals(array.Count, 3);
Test.AssertEquals(0, array.IndexOf(1));
Test.AssertEquals(1, array.IndexOf(0));
array.Insert(0, 1);
Test.AssertEquals(array.Count, 4);
Test.AssertEquals(0, array.IndexOf(1));
Test.AssertEquals(2, array.IndexOf(0));
}
public static void TestCopyTo()
{
IList<int> array = new Eina.Array<int>();
Test.AssertEquals(array.Count, 0);
int[] random = {4, 40, 10, 42, 99};
array.Add(43);
array.Insert(0, 1);
array.Insert(1, 50);
Test.AssertEquals(array.Count, 3);
Array.ForEach(random, (n) => array.Add(n));
Test.AssertEquals(array.Count, 8);
int[] expected = {1, 50, 43, 4, 40, 10, 42, 99};
var result = new int[expected.Length];
array.CopyTo(result, 0);
for (int i = 0; i < expected.Length; ++i)
{
Test.AssertEquals(expected[i], result[i]);
}
}
public static void TestIdxOutBounds()
{
var array = new Eina.Array<int>();
array.Add(4);
Test.AssertRaises<ArgumentOutOfRangeException>(()=>array.At(1));
Test.AssertRaises<ArgumentOutOfRangeException>(()=>array.At(-1));
Test.AssertNotRaises<ArgumentOutOfRangeException>
(()=>array.At(array.IndexOf(4)));
}
public static void TestIsReadOnly()
{
var array = new Eina.Array<int>();
int[] tmp = {1, 3, 2, 6 ,5};
array.Append(tmp);
Test.AssertEquals(array.Count, 5);
array.SetOwnership(false);
Test.AssertRaises<NotSupportedException>(() => array.Add(4));
Test.AssertRaises<NotSupportedException>(() => array.Push(6));
Test.AssertRaises<NotSupportedException>(() => array.Append(tmp));
Test.AssertEquals(array.Count, 5);
Test.AssertRaises<NotSupportedException>(() => array.DataSet(2, 4));
Test.Assert(array.ToArray().SequenceEqual(tmp));
}
}
}

View File

@ -787,16 +787,16 @@ class TestEinaArray
{
var a = new Eina.Array<int>();
Test.Assert(a.Handle != IntPtr.Zero);
Test.Assert(a.Length == 0);
Test.Assert(a.Count == 0);
Test.Assert(a.Push(88));
Test.Assert(a[0] == 88);
Test.Assert(a.Length == 1);
Test.Assert(a.Count == 1);
Test.Assert(a.Push(44));
Test.Assert(a[1] == 44);
Test.Assert(a.Length == 2);
Test.Assert(a.Count == 2);
Test.Assert(a.Push(22));
Test.Assert(a[2] == 22);
Test.Assert(a.Length == 3);
Test.Assert(a.Count == 3);
a.Dispose();
}
@ -804,16 +804,16 @@ class TestEinaArray
{
var a = new Eina.Array<string>();
Test.Assert(a.Handle != IntPtr.Zero);
Test.Assert(a.Length == 0);
Test.Assert(a.Count == 0);
Test.Assert(a.Push("a"));
Test.Assert(a[0] == "a");
Test.Assert(a.Length == 1);
Test.Assert(a.Count == 1);
Test.Assert(a.Push("b"));
Test.Assert(a[1] == "b");
Test.Assert(a.Length == 2);
Test.Assert(a.Count == 2);
Test.Assert(a.Push("c"));
Test.Assert(a[2] == "c");
Test.Assert(a.Length == 3);
Test.Assert(a.Count == 3);
a.Dispose();
}
@ -821,16 +821,16 @@ class TestEinaArray
{
var a = new Eina.Array<Eina.Stringshare>();
Test.Assert(a.Handle != IntPtr.Zero);
Test.Assert(a.Length == 0);
Test.Assert(a.Count == 0);
Test.Assert(a.Push("a"));
Test.Assert(a[0] == "a");
Test.Assert(a.Length == 1);
Test.Assert(a.Count == 1);
Test.Assert(a.Push("b"));
Test.Assert(a[1] == "b");
Test.Assert(a.Length == 2);
Test.Assert(a.Count == 2);
Test.Assert(a.Push("c"));
Test.Assert(a[2] == "c");
Test.Assert(a.Length == 3);
Test.Assert(a.Count == 3);
a.Dispose();
}
@ -951,7 +951,7 @@ class TestEinaArray
Test.Assert(t.EinaArrayIntOut(out arr));
Test.Assert(!arr.Own);
Test.Assert(arr.ToArray().SequenceEqual(base_seq_int));
Test.Assert(arr.Append(append_seq_int));
Test.AssertRaises<NotSupportedException>(() => arr.Append(append_seq_int));
arr.Dispose();
Test.Assert(arr.Handle == IntPtr.Zero);
Test.Assert(t.CheckEinaArrayIntOut());
@ -976,8 +976,9 @@ class TestEinaArray
var t = new Dummy.TestObject();
var arr = t.EinaArrayIntReturn();
Test.Assert(!arr.Own);
Test.Assert(!arr.OwnContent);
Test.Assert(arr.ToArray().SequenceEqual(base_seq_int));
Test.Assert(arr.Append(append_seq_int));
Test.AssertRaises<NotSupportedException>(() => arr.Append(append_seq_int));
arr.Dispose();
Test.Assert(arr.Handle == IntPtr.Zero);
Test.Assert(t.CheckEinaArrayIntReturn());
@ -1031,7 +1032,7 @@ class TestEinaArray
Test.Assert(t.EinaArrayStrOut(out arr));
Test.Assert(!arr.Own);
Test.Assert(arr.ToArray().SequenceEqual(base_seq_str));
Test.Assert(arr.Append(append_seq_str));
Test.AssertRaises<NotSupportedException>(() => arr.Append(append_seq_str));
arr.Dispose();
Test.Assert(arr.Handle == IntPtr.Zero);
Test.Assert(t.CheckEinaArrayStrOut());
@ -1057,7 +1058,7 @@ class TestEinaArray
var arr = t.EinaArrayStrReturn();
Test.Assert(!arr.Own);
Test.Assert(arr.ToArray().SequenceEqual(base_seq_str));
Test.Assert(arr.Append(append_seq_str));
Test.AssertRaises<NotSupportedException>(() => arr.Append(append_seq_str));
arr.Dispose();
Test.Assert(arr.Handle == IntPtr.Zero);
Test.Assert(t.CheckEinaArrayStrReturn());
@ -1111,7 +1112,7 @@ class TestEinaArray
Test.Assert(t.EinaArrayStrshareOut(out arr));
Test.Assert(!arr.Own);
Test.Assert(arr.ToArray().SequenceEqual(base_seq_strshare));
Test.Assert(arr.Append(append_seq_strshare));
Test.AssertRaises<NotSupportedException>(() => arr.Append(append_seq_strshare));
arr.Dispose();
Test.Assert(arr.Handle == IntPtr.Zero);
Test.Assert(t.CheckEinaArrayStrshareOut());
@ -1137,7 +1138,7 @@ class TestEinaArray
var arr = t.EinaArrayStrshareReturn();
Test.Assert(!arr.Own);
Test.Assert(arr.ToArray().SequenceEqual(base_seq_strshare));
Test.Assert(arr.Append(append_seq_strshare));
Test.AssertRaises<NotSupportedException>(() => arr.Append(append_seq_strshare));
arr.Dispose();
Test.Assert(arr.Handle == IntPtr.Zero);
Test.Assert(t.CheckEinaArrayStrshareReturn());
@ -1192,7 +1193,7 @@ class TestEinaArray
Test.Assert(t.EinaArrayObjOut(out arr));
Test.Assert(!arr.Own);
NumberwrapperSequenceAssertEqual(arr.ToArray(), BaseSeqObj());
Test.Assert(arr.Append(AppendSeqObj()));
Test.AssertRaises<NotSupportedException>(() => arr.Append(AppendSeqObj()));
arr.Dispose();
Test.Assert(arr.Handle == IntPtr.Zero);
Test.Assert(t.CheckEinaArrayObjOut());
@ -1218,7 +1219,7 @@ class TestEinaArray
var arr = t.EinaArrayObjReturn();
Test.Assert(!arr.Own);
NumberwrapperSequenceAssertEqual(arr.ToArray(), BaseSeqObj());
Test.Assert(arr.Append(AppendSeqObj()));
Test.AssertRaises<NotSupportedException>(() => arr.Append(AppendSeqObj()));
arr.Dispose();
Test.Assert(arr.Handle == IntPtr.Zero);
Test.Assert(t.CheckEinaArrayObjReturn());
@ -1246,7 +1247,7 @@ class TestEinaArray
var b = t.EinaArrayObjReturnIn(a);
NumberwrapperSequenceAssertEqual(a.ToArray(), b.ToArray());
NumberwrapperSequenceAssertEqual(a.ToArray(), BaseSeqObj());
int len = a.Length;
int len = a.Count;
for (int i=0; i < len; ++i)
{
Test.Assert(a[i].NativeHandle == b[i].NativeHandle);

View File

@ -402,15 +402,15 @@ class TestCsharpProperties
obj.Dispose();
}
public static void test_setter_only()
{
var obj = new Dummy.TestObject();
int val = -1984;
// public static void test_setter_only()
// {
// var obj = new Dummy.TestObject();
// int val = -1984;
obj.SetterOnly = val;
Test.AssertEquals(val, obj.GetSetterOnly());
obj.Dispose();
}
// obj.SetterOnly = val;
// Test.AssertEquals(val, obj.GetSetterOnly());
// obj.Dispose();
// }
public static void test_class_property()
{
@ -436,6 +436,52 @@ class TestCsharpProperties
Test.AssertEquals(ret, (1, 2));
obj.Dispose();
}
public static void test_csharp_keyed_multi_valued_prop()
{
var obj = new Dummy.TestObject();
obj.KeyedMultiValuedProp[100] = (1, 2);
Test.AssertEquals(obj.KeyedMultiValuedProp[100], (1, 2));
obj.Dispose();
}
public static void test_csharp_multi_keyed_multi_valued_prop()
{
var obj = new Dummy.TestObject();
obj.MultiKeyedMultiValuedProp[(100, 101)] = (1, 2);
Test.AssertEquals(obj.MultiKeyedMultiValuedProp[(100, 101)], (1, 2));
obj.Dispose();
}
public static void test_csharp_multi_prop()
{
var obj = new Dummy.TestObject();
obj.MultiKeyedMultiValuedProp[(100, 101)] = (1, 2);
obj.KeyedMultiValuedProp[100] = (1, 2);
Test.AssertEquals(obj.KeyedMultiValuedProp[100],
obj.MultiKeyedMultiValuedProp[(100, 101)]);
int a1, b1, a2, b2;
#if __MonoCS__
(int a, int b) t1 = obj.MultiKeyedMultiValuedProp[(100, 101)];
(a1, b1) = (t1.Item1, t1.Item2);
(int a, int b) t2 = obj.KeyedMultiValuedProp[100];
(a2, b2) = (t2.Item1, t2.Item2);
#else
(a1, b1) = obj.MultiKeyedMultiValuedProp[(100, 101)];
(a2, b2) = obj.KeyedMultiValuedProp[100];
#endif
Test.AssertEquals(a1, a2);
Test.AssertEquals(b1, b2);
var i = (100, 101);
var j = 100;
Test.AssertEquals(obj.KeyedMultiValuedProp[j],
obj.MultiKeyedMultiValuedProp[i]);
obj.MultiKeyedMultiValuedProp[i] = (1, 3);
obj.KeyedMultiValuedProp[j] = obj.MultiKeyedMultiValuedProp[i];
Test.AssertEquals(obj.KeyedMultiValuedProp[j],
obj.MultiKeyedMultiValuedProp[i]);
}
}
class TestEoGrandChildrenFinalize

View File

@ -239,7 +239,7 @@ class TestEoEvents
obj.EmitEventWithArray(sent);
Test.AssertEquals(sent.Length, received.Length);
Test.AssertEquals(sent.Count, received.Count);
var pairs = sent.Zip(received, (string sentItem, string receivedItem) => new { Sent = sentItem, Received = receivedItem } );
foreach (var pair in pairs)
{

View File

@ -43,6 +43,12 @@ _dummy_event_manager_emitter_set(EINA_UNUSED Eo *obj, Dummy_Event_Manager_Data *
pd->emitter = emitter;
}
static Efl_Object*
_dummy_event_manager_emitter_get(EINA_UNUSED Eo const *obj, Dummy_Event_Manager_Data *pd)
{
return pd->emitter;
}
static Eina_Bool
_dummy_event_manager_emit_with_int(EINA_UNUSED Eo *obj, Dummy_Event_Manager_Data *pd, int data)
{

View File

@ -4,8 +4,6 @@ class Dummy.Event_Manager extends Efl.Object {
methods {
@property emitter {
set {
}
values {
emitter: Efl.Object @move;
}

View File

@ -16,6 +16,7 @@
#define DUMMY_TEST_IFACE_PROTECTED
#include <assert.h>
#include "libefl_mono_native_test.h"
typedef struct Dummy_Test_Object_Data
@ -579,7 +580,7 @@ Eina_Bool _dummy_test_object_check_eina_array_int_out(EINA_UNUSED Eo *obj, EINA_
{
if (!_array_int_out_to_check) return EINA_FALSE;
Eina_Bool r = _array_int_equal(_array_int_out_to_check, modified_seq_int, modified_seq_int_size);
Eina_Bool r = _array_int_equal(_array_int_out_to_check, base_seq_int, base_seq_int_size);
unsigned int i;
int *ele;
@ -617,7 +618,7 @@ Eina_Bool _dummy_test_object_check_eina_array_int_return(EINA_UNUSED Eo *obj, EI
{
if (!_array_int_return_to_check) return EINA_FALSE;
Eina_Bool r = _array_int_equal(_array_int_return_to_check, modified_seq_int, modified_seq_int_size);
Eina_Bool r = _array_int_equal(_array_int_return_to_check, base_seq_int, base_seq_int_size);
unsigned int i;
int *ele;
@ -707,7 +708,7 @@ Eina_Bool _dummy_test_object_check_eina_array_str_out(EINA_UNUSED Eo *obj, EINA_
{
if (!_array_str_out_to_check) return EINA_FALSE;
Eina_Bool r = _array_str_equal(_array_str_out_to_check, modified_seq_str, modified_seq_str_size);
Eina_Bool r = _array_str_equal(_array_str_out_to_check, base_seq_str, base_seq_str_size);
unsigned int i;
char *ele;
@ -745,7 +746,7 @@ Eina_Bool _dummy_test_object_check_eina_array_str_return(EINA_UNUSED Eo *obj, EI
{
if (!_array_str_return_to_check) return EINA_FALSE;
Eina_Bool r = _array_str_equal(_array_str_return_to_check, modified_seq_str, modified_seq_str_size);
Eina_Bool r = _array_str_equal(_array_str_return_to_check, base_seq_str,base_seq_str_size);
unsigned int i;
char *ele;
@ -840,7 +841,7 @@ Eina_Bool _dummy_test_object_check_eina_array_strshare_out(EINA_UNUSED Eo *obj,
{
if (!_array_strshare_out_to_check) return EINA_FALSE;
Eina_Bool r = _array_strshare_equal(_array_strshare_out_to_check, modified_seq_str, modified_seq_str_size);
Eina_Bool r = _array_strshare_equal(_array_strshare_out_to_check, base_seq_str, base_seq_str_size);
unsigned int i;
Eina_Stringshare *ele;
@ -878,7 +879,7 @@ Eina_Bool _dummy_test_object_check_eina_array_strshare_return(EINA_UNUSED Eo *ob
{
if (!_array_strshare_return_to_check) return EINA_FALSE;
Eina_Bool r = _array_strshare_equal(_array_strshare_return_to_check, modified_seq_str, modified_seq_str_size);
Eina_Bool r = _array_strshare_equal(_array_strshare_return_to_check, base_seq_str, base_seq_str_size);
unsigned int i;
Eina_Stringshare *ele;
@ -974,7 +975,7 @@ Eina_Bool _dummy_test_object_check_eina_array_obj_out(EINA_UNUSED Eo *obj, EINA_
{
if (!_array_obj_out_to_check) return EINA_FALSE;
Eina_Bool r = _array_obj_equal(_array_obj_out_to_check, modified_seq_obj, modified_seq_obj_size);
Eina_Bool r = _array_obj_equal(_array_obj_out_to_check, base_seq_obj, base_seq_obj_size);
if (!r) return r;
unsigned int i;
@ -1013,7 +1014,7 @@ Eina_Bool _dummy_test_object_check_eina_array_obj_return(EINA_UNUSED Eo *obj, EI
{
if (!_array_obj_return_to_check) return EINA_FALSE;
Eina_Bool r = _array_obj_equal(_array_obj_return_to_check, modified_seq_obj, modified_seq_obj_size);
Eina_Bool r = _array_obj_equal(_array_obj_return_to_check, base_seq_obj, base_seq_obj_size);
if (!r) return r;
unsigned int i;
@ -4612,6 +4613,36 @@ void _dummy_test_object_multi_valued_prop_set(Eo* obj EINA_UNUSED, Dummy_Test_Ob
pd->prop2 = prop2;
}
void _dummy_test_object_keyed_multi_valued_prop_get(Eo const* obj EINA_UNUSED, Dummy_Test_Object_Data* pd, int prop_key1, int* prop1, int* prop2)
{
assert (prop_key1 == 100);
*prop1 = pd->prop1;
*prop2 = pd->prop2;
}
void _dummy_test_object_keyed_multi_valued_prop_set(Eo* obj EINA_UNUSED, Dummy_Test_Object_Data* pd, int prop_key1, int prop1, int prop2)
{
assert (prop_key1 == 100);
pd->prop1 = prop1;
pd->prop2 = prop2;
}
void _dummy_test_object_multi_keyed_multi_valued_prop_get(Eo const* obj EINA_UNUSED, Dummy_Test_Object_Data* pd, int prop_key1, int prop_key2, int* prop1, int* prop2)
{
assert (prop_key1 == 100);
assert (prop_key2 == 101);
*prop1 = pd->prop1;
*prop2 = pd->prop2;
}
void _dummy_test_object_multi_keyed_multi_valued_prop_set(Eo* obj EINA_UNUSED, Dummy_Test_Object_Data* pd, int prop_key1, int prop_key2, int prop1, int prop2)
{
assert (prop_key1 == 100);
assert (prop_key2 == 101);
pd->prop1 = prop1;
pd->prop2 = prop2;
}
/* Class Properties */
static int _dummy_test_object_klass_prop = 0;

View File

@ -1581,6 +1581,31 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
}
}
@property keyed_multi_valued_prop {
get {}
set {}
keys {
key1: int;
}
values {
prop1: int;
prop2: int;
}
}
@property multi_keyed_multi_valued_prop {
get {}
set {}
keys {
key1: int;
key2: int;
}
values {
prop1: int;
prop2: int;
}
}
@property klass_prop @static {
get {}
set {}

View File

@ -83,6 +83,7 @@ efl_mono_src = [
'Inheritance.cs',
'Hash.cs',
'List.cs',
'Array.cs',
]
if get_option('dotnet')

View File

@ -208,6 +208,16 @@ EFL_START_TEST(efl_ui_layout_test_api_ordering)
}
EFL_END_TEST
EFL_START_TEST(efl_ui_layout_test_versioning)
{
Evas_Object *win;
win = win_add(NULL, "layout", EFL_UI_WIN_TYPE_BASIC);
Eo *layout = efl_add(EFL_UI_BUTTON_CLASS, win);
ck_assert_int_eq(efl_ui_layout_theme_version_get(layout), 123);
}
EFL_END_TEST
void efl_ui_test_layout(TCase *tc)
{
tcase_add_test(tc, efl_ui_layout_test_property_bind);
@ -218,4 +228,5 @@ void efl_ui_test_layout(TCase *tc)
tcase_add_test(tc, efl_ui_layout_test_api_ordering);
tcase_add_test(tc, efl_ui_layout_test_callback);
tcase_add_test(tc, efl_ui_layout_test_property_bind_provider);
tcase_add_test(tc, efl_ui_layout_test_versioning);
}

View File

@ -12,7 +12,7 @@
#include "elm_widget.h"
/* spec-meta-start
{"test-interface":"Efl.Ui.Clickable",
"test-widgets": ["Efl.Ui.Button", "Efl.Ui.Image", "Efl.Ui.Panes", "Efl.Ui.Frame", "Efl.Ui.Item.Realized", "Efl.Ui.Radio", "Efl.Ui.Check"]
"test-widgets": ["Efl.Ui.Button", "Efl.Ui.Image", "Efl.Ui.Panes", "Efl.Ui.Frame", "Efl.Ui.Grid_Default_Item", "Efl.Ui.List_Default_Item", "Efl.Ui.Radio", "Efl.Ui.Check"]
}
spec-meta-end
*/
@ -64,10 +64,6 @@ prepare_window(void)
}
else if (efl_isa(widget, EFL_UI_ITEM_CLASS))
{
elm_widget_theme_klass_set(widget, "grid_item");
elm_widget_theme_element_set(widget, NULL);
elm_widget_theme_style_set(widget, NULL);
efl_ui_widget_theme_apply(widget);
pos->x = 30;
pos->y = 30;
}

View File

@ -29,20 +29,30 @@ typedef Eo Eo_Docs;
*/
typedef struct _Foo
{
int field1; /**< Field documentation. */
int field1; /**< Field documentation.
*
* @since 1.66 */
float field2;
short field3; /**< Another field documentation. */
short field3; /**< Another field documentation.
*
* @since 1.66 */
} Foo;
/** Docs for enum Bar.
*
* @since 1.55
*
* @ingroup Bar
*/
typedef enum
{
BAR_BLAH = 0,
BAR_FOO = 1, /**< Docs for foo. */
BAR_BAR = 2 /**< Docs for bar. */
BAR_FOO = 1, /**< Docs for foo.
*
* @since 1.55 */
BAR_BAR = 2 /**< Docs for bar.
*
* @since 1.55 */
} Bar;
/**

View File

@ -19,7 +19,9 @@ struct Foo {
}
enum Bar {
[[Docs for enum Bar.]]
[[Docs for enum Bar.
@since 1.55
]]
blah = 0,
foo = 1, [[Docs for foo.]]
bar = 2 [[Docs for bar.]]

View File

@ -1150,7 +1150,8 @@ EFL_START_TEST(eolian_docs)
fail_if(strcmp(eolian_documentation_summary_get(doc),
"Docs for enum Bar."));
fail_if(eolian_documentation_description_get(doc));
fail_if(eolian_documentation_since_get(doc));
fail_if(strcmp(eolian_documentation_since_get(doc),
"1.55"));
fail_if(!(efl = eolian_typedecl_enum_field_get(tdl, "blah")));
fail_if(eolian_typedecl_enum_field_documentation_get(efl));

View File

@ -279,7 +279,7 @@ EFL_START_TEST(eolian_cxx_test_struct_docs)
doc = field_iter->documentation;
ck_assert_str_eq(doc.summary.c_str(), "Field documentation.");
ck_assert_str_eq(doc.description.c_str(), "");
ck_assert_str_eq(doc.since.c_str(), "");
ck_assert_str_eq(doc.since.c_str(), "1.66");
field_iter++;
@ -293,7 +293,7 @@ EFL_START_TEST(eolian_cxx_test_struct_docs)
doc = field_iter->documentation;
ck_assert_str_eq(doc.summary.c_str(), "Another field documentation.");
ck_assert_str_eq(doc.description.c_str(), "");
ck_assert_str_eq(doc.since.c_str(), "");
ck_assert_str_eq(doc.since.c_str(), "1.66");
}
EFL_END_TEST

View File

@ -4362,17 +4362,17 @@ EFL_START_TEST(evas_textblock_annotation)
efl_text_cursor_position_set(start, 0);
efl_text_cursor_position_set(end, 3);
efl_text_attribute_factory_attribute_insert(start, end, "font_size=80");
efl_text_formatter_attribute_insert(start, end, "font_size=80");
efl_text_cursor_position_set(start, 1);
efl_text_cursor_position_set(end, 2);
efl_text_attribute_factory_attribute_insert(start, end, "font=arial");
efl_text_formatter_attribute_insert(start, end, "font=arial");
efl_text_cursor_position_set(start, 2);
efl_text_cursor_position_set(end, 3);
efl_text_attribute_factory_attribute_insert(start, end, "color=#fff");
efl_text_formatter_attribute_insert(start, end, "color=#fff");
efl_text_cursor_position_set(start, 0);
efl_text_cursor_position_set(end, 3);
unsigned int count = efl_text_attribute_factory_attribute_clear(start, end);
unsigned int count = efl_text_formatter_attribute_clear(start, end);
fail_if(count != 3);
}
EFL_END_TEST;
@ -4649,7 +4649,7 @@ EFL_START_TEST(efl_canvas_textblock_style)
ck_assert_int_eq(efl_text_wrap_get(txt), EFL_TEXT_FORMAT_WRAP_NONE);
efl_canvas_textblock_style_apply(txt, "backing=on");
ck_assert_int_eq(efl_text_backing_type_get(txt), EFL_TEXT_STYLE_BACKING_TYPE_ENABLED);
ck_assert_int_eq(efl_text_background_type_get(txt), EFL_TEXT_STYLE_BACKGROUND_TYPE_ENABLED);
efl_canvas_textblock_style_apply(txt, "style=far_soft_shadow");
ck_assert_int_eq(efl_text_effect_type_get(txt), EFL_TEXT_STYLE_EFFECT_TYPE_FAR_SOFT_SHADOW);
@ -4667,7 +4667,7 @@ EFL_START_TEST(efl_canvas_textblock_style)
ck_assert_int_eq(efl_text_shadow_direction_get(txt), EFL_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM);
efl_canvas_textblock_style_apply(txt, "color=#EF596C");
efl_text_normal_color_get(txt, &r, &g, &b, &a);
efl_text_color_get(txt, &r, &g, &b, &a);
ck_assert_int_eq(r, 0xEF);
ck_assert_int_eq(g, 0x59);
ck_assert_int_eq(b, 0x6C);