forked from enlightenment/efl
Merge branch 'master' into devs/hermet/lottie
This commit is contained in:
commit
bbc24cfb02
|
@ -133,9 +133,14 @@ struct unpack_event_args_visitor
|
|||
{
|
||||
return as_generator("(Efl.Eo.Globals.CreateWrapperFor(info) as " + name_helpers::klass_full_concrete_name(cls) + ")").generate(sink, attributes::unused, *context);
|
||||
}
|
||||
bool operator()(attributes::complex_type_def const&) const
|
||||
bool operator()(attributes::complex_type_def const& types) const
|
||||
{
|
||||
return as_generator("new " << eolian_mono::type << "(info, false, false)").generate(sink, type, *context);
|
||||
if (types.outer.base_type == "iterator")
|
||||
return as_generator("Efl.Eo.Globals.IteratorTo" << eolian_mono::type << "(info)").generate(sink, type, *context);
|
||||
else if (types.outer.base_type == "accessor")
|
||||
return as_generator("Efl.Eo.Globals.AccessorTo" << eolian_mono::type << "(info)").generate(sink, type, *context);
|
||||
else
|
||||
return as_generator("new " << eolian_mono::type << "(info, false, false)").generate(sink, type, *context);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -222,9 +227,12 @@ struct pack_event_info_and_call_visitor
|
|||
<< "CallNativeEventCallback(" << library_name << ", \"_" << evt_c_name << "\", IntPtr.Zero, null);\n"
|
||||
).generate(sink, attributes::unused, *context);
|
||||
}
|
||||
bool operator()(attributes::complex_type_def const&) const
|
||||
bool operator()(attributes::complex_type_def const& type) const
|
||||
{
|
||||
auto const& indent = current_indentation(*context);
|
||||
if ((type.outer.base_type == "iterator") || (type.outer.base_type == "accessor"))
|
||||
return true;
|
||||
|
||||
return as_generator(indent << "IntPtr info = e.arg.Handle;\n"
|
||||
<< "CallNativeEventCallback(" << library_name << ", \"_" << evt_c_name << "\", IntPtr.Zero, null);\n"
|
||||
).generate(sink, attributes::unused, *context);
|
||||
|
|
|
@ -639,16 +639,23 @@ struct native_convert_in_variable_generator
|
|||
<< ");\n"
|
||||
).generate(sink, std::make_tuple(in_variable_name(param.param_name), param.type), context);
|
||||
}
|
||||
else if (param.type.c_type == "Eina_Iterator *" || param.type.c_type == "const Eina_Iterator *"
|
||||
|| param.type.c_type == "Eina_Accessor *" || param.type.c_type == "const Eina_Accessor *"
|
||||
)
|
||||
else if (param.type.c_type == "Eina_Iterator *" || param.type.c_type == "const Eina_Iterator *")
|
||||
{
|
||||
attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(¶m.type.original_type);
|
||||
if (!complex)
|
||||
return false;
|
||||
return as_generator(
|
||||
"var " << string << " = new " << type << "(" << escape_keyword(param.param_name)
|
||||
<< ", " << (param.type.has_own ? "true" : "false")
|
||||
"var " << string << " = Efl.Eo.Globals.IteratorTo" << type << "(" << escape_keyword(param.param_name)
|
||||
<< ");\n"
|
||||
).generate(sink, std::make_tuple(in_variable_name(param.param_name), param.type), context);
|
||||
}
|
||||
else if (param.type.c_type == "Eina_Accessor *" || param.type.c_type == "const Eina_Accessor *")
|
||||
{
|
||||
attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(¶m.type.original_type);
|
||||
if (!complex)
|
||||
return false;
|
||||
return as_generator(
|
||||
"var " << string << " = Efl.Eo.Globals.AccessorTo" << type << "(" << escape_keyword(param.param_name)
|
||||
<< ");\n"
|
||||
).generate(sink, std::make_tuple(in_variable_name(param.param_name), param.type), context);
|
||||
}
|
||||
|
@ -724,8 +731,6 @@ struct convert_in_variable_generator
|
|||
}
|
||||
else if (param.type.c_type == "Eina_Array *" || param.type.c_type == "const Eina_Array *"
|
||||
|| param.type.c_type == "Eina_List *" || param.type.c_type == "const Eina_List *"
|
||||
|| param.type.c_type == "Eina_Iterator *" || param.type.c_type == "const Eina_Iterator *"
|
||||
|| param.type.c_type == "Eina_Accessor *" || param.type.c_type == "const Eina_Accessor *"
|
||||
)
|
||||
{
|
||||
attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(¶m.type.original_type);
|
||||
|
@ -741,18 +746,34 @@ struct convert_in_variable_generator
|
|||
).generate(sink, attributes::unused, context))
|
||||
return false;
|
||||
|
||||
// Iterators and Accessors can't own their content.
|
||||
if (param.type.c_type == "Eina_Iterator *" || param.type.c_type == "const Eina_Iterator *"
|
||||
|| param.type.c_type == "Eina_Accessor *" || param.type.c_type == "const Eina_Accessor *"
|
||||
)
|
||||
return true;
|
||||
|
||||
if ((param.type.has_own && (complex->subtypes.front().is_value_type || complex->subtypes.front().has_own))
|
||||
&& !as_generator(
|
||||
escape_keyword(param.param_name) << ".OwnContent = false;\n"
|
||||
).generate(sink, attributes::unused, context))
|
||||
return false;
|
||||
}
|
||||
else if (param.type.c_type == "Eina_Iterator *" || param.type.c_type == "const Eina_Iterator *")
|
||||
{
|
||||
attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(¶m.type.original_type);
|
||||
if (!complex)
|
||||
return false;
|
||||
auto var_name = in_variable_name(param.param_name);
|
||||
if (!as_generator(
|
||||
"var " << string << " = Efl.Eo.Globals.IEnumerableToIterator(" << escape_keyword(param.param_name) << ", " << (param.type.has_own ? "true" : "false")<< ");\n"
|
||||
).generate(sink, var_name, context))
|
||||
return false;
|
||||
}
|
||||
else if (param.type.c_type == "Eina_Accessor *" || param.type.c_type == "const Eina_Accessor *")
|
||||
{
|
||||
attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(¶m.type.original_type);
|
||||
if (!complex)
|
||||
return false;
|
||||
auto var_name = in_variable_name(param.param_name);
|
||||
if (!as_generator(
|
||||
"var " << string << " = Efl.Eo.Globals.IEnumerableToAccessor(" << escape_keyword(param.param_name) << ", " << (param.type.has_own ? "true" : "false")<< ");\n"
|
||||
).generate(sink, var_name, context))
|
||||
return false;
|
||||
}
|
||||
else if (param.type.c_type == "Eina_Value")
|
||||
{
|
||||
return as_generator(
|
||||
|
@ -991,11 +1012,7 @@ struct convert_out_assign_generator
|
|||
<< ");\n"
|
||||
).generate(sink, std::make_tuple(escape_keyword(param.param_name), param.type, out_variable_name(param.param_name)), context);
|
||||
}
|
||||
else if (param_is_acceptable(param, "Eina_Iterator *", WANT_OWN, WANT_OUT)
|
||||
|| param_is_acceptable(param, "Eina_Iterator *", !WANT_OWN, WANT_OUT)
|
||||
|| param_is_acceptable(param, "const Eina_Iterator *", WANT_OWN, WANT_OUT)
|
||||
|| param_is_acceptable(param, "const Eina_Iterator *", !WANT_OWN, WANT_OUT)
|
||||
|| param_is_acceptable(param, "Eina_Accessor *", WANT_OWN, WANT_OUT)
|
||||
else if (param_is_acceptable(param, "Eina_Accessor *", WANT_OWN, WANT_OUT)
|
||||
|| param_is_acceptable(param, "Eina_Accessor *", !WANT_OWN, WANT_OUT)
|
||||
|| param_is_acceptable(param, "const Eina_Accessor *", WANT_OWN, WANT_OUT)
|
||||
|| param_is_acceptable(param, "const Eina_Accessor *", !WANT_OWN, WANT_OUT)
|
||||
|
@ -1005,8 +1022,21 @@ struct convert_out_assign_generator
|
|||
if (!complex)
|
||||
return false;
|
||||
return as_generator(
|
||||
string << " = new " << type << "(" << string
|
||||
<< ", " << (param.type.has_own ? "true" : "false")
|
||||
string << " = Efl.Eo.Globals.AccessorTo" << type << "(" << string
|
||||
<< ");\n"
|
||||
).generate(sink, std::make_tuple(escape_keyword(param.param_name), param.type, out_variable_name(param.param_name)), context);
|
||||
}
|
||||
else if (param_is_acceptable(param, "Eina_Iterator *", WANT_OWN, WANT_OUT)
|
||||
|| param_is_acceptable(param, "Eina_Iterator *", !WANT_OWN, WANT_OUT)
|
||||
|| param_is_acceptable(param, "const Eina_Iterator *", WANT_OWN, WANT_OUT)
|
||||
|| param_is_acceptable(param, "const Eina_Iterator *", !WANT_OWN, WANT_OUT)
|
||||
)
|
||||
{
|
||||
attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(¶m.type.original_type);
|
||||
if (!complex)
|
||||
return false;
|
||||
return as_generator(
|
||||
string << " = Efl.Eo.Globals.IteratorTo" << type << "(" << string
|
||||
<< ");\n"
|
||||
).generate(sink, std::make_tuple(escape_keyword(param.param_name), param.type, out_variable_name(param.param_name)), context);
|
||||
}
|
||||
|
@ -1121,14 +1151,21 @@ struct convert_return_generator
|
|||
.generate(sink, ret_type, context))
|
||||
return false;
|
||||
}
|
||||
else if(ret_type.c_type == "Eina_Iterator *" || ret_type.c_type == "const Eina_Iterator *"
|
||||
|| ret_type.c_type == "Eina_Accessor *" || ret_type.c_type == "const Eina_Accessor *"
|
||||
)
|
||||
else if (ret_type.c_type == "Eina_Accessor *" || ret_type.c_type == "const Eina_Accessor *")
|
||||
{
|
||||
attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(&ret_type.original_type);
|
||||
if (!complex)
|
||||
return false;
|
||||
if (!as_generator("return new " << type << "(_ret_var, " << std::string{ret_type.has_own ? "true" : "false"} << ");\n")
|
||||
if (!as_generator("return Efl.Eo.Globals.AccessorTo" << type << "(_ret_var);")
|
||||
.generate(sink, ret_type, context))
|
||||
return false;
|
||||
}
|
||||
else if (ret_type.c_type == "Eina_Iterator *" || ret_type.c_type == "const Eina_Iterator *")
|
||||
{
|
||||
attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(&ret_type.original_type);
|
||||
if (!complex)
|
||||
return false;
|
||||
if (!as_generator("return Efl.Eo.Globals.IteratorTo" << type << "(_ret_var);")
|
||||
.generate(sink, ret_type, context))
|
||||
return false;
|
||||
}
|
||||
|
@ -1239,14 +1276,6 @@ struct native_convert_out_assign_generator
|
|||
|| param_is_acceptable(param, "Eina_List *", !WANT_OWN, WANT_OUT)
|
||||
|| param_is_acceptable(param, "const Eina_List *", WANT_OWN, WANT_OUT)
|
||||
|| param_is_acceptable(param, "const Eina_List *", !WANT_OWN, WANT_OUT)
|
||||
|| param_is_acceptable(param, "Eina_Iterator *", WANT_OWN, WANT_OUT)
|
||||
|| param_is_acceptable(param, "Eina_Iterator *", !WANT_OWN, WANT_OUT)
|
||||
|| param_is_acceptable(param, "const Eina_Iterator *", WANT_OWN, WANT_OUT)
|
||||
|| param_is_acceptable(param, "const Eina_Iterator *", !WANT_OWN, WANT_OUT)
|
||||
|| param_is_acceptable(param, "Eina_Accessor *", WANT_OWN, WANT_OUT)
|
||||
|| param_is_acceptable(param, "Eina_Accessor *", !WANT_OWN, WANT_OUT)
|
||||
|| param_is_acceptable(param, "const Eina_Accessor *", WANT_OWN, WANT_OUT)
|
||||
|| param_is_acceptable(param, "const Eina_Accessor *", !WANT_OWN, WANT_OUT)
|
||||
)
|
||||
{
|
||||
attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(¶m.type.original_type);
|
||||
|
@ -1262,18 +1291,42 @@ struct native_convert_out_assign_generator
|
|||
).generate(sink, outvar, context))
|
||||
return false;
|
||||
|
||||
// Iterators and Accessors can't own their content.
|
||||
if (param.type.c_type == "Eina_Iterator *" || param.type.c_type == "const Eina_Iterator *"
|
||||
|| param.type.c_type == "Eina_Accessor *" || param.type.c_type == "const Eina_Accessor *"
|
||||
)
|
||||
return true;
|
||||
|
||||
if ((param.type.has_own && (complex->subtypes.front().is_value_type && complex->subtypes.front().has_own))
|
||||
&& !as_generator(
|
||||
string << ".OwnContent = false;\n"
|
||||
).generate(sink, outvar, context))
|
||||
return false;
|
||||
}
|
||||
else if (param_is_acceptable(param, "Eina_Accessor *", WANT_OWN, WANT_OUT)
|
||||
|| param_is_acceptable(param, "Eina_Accessor *", !WANT_OWN, WANT_OUT)
|
||||
|| param_is_acceptable(param, "const Eina_Accessor *", WANT_OWN, WANT_OUT)
|
||||
|| param_is_acceptable(param, "const Eina_Accessor *", !WANT_OWN, WANT_OUT)
|
||||
)
|
||||
{
|
||||
attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(¶m.type.original_type);
|
||||
if (!complex)
|
||||
return false;
|
||||
auto outvar = out_variable_name(param.param_name);
|
||||
if (!as_generator(
|
||||
string << " = Efl.Eo.Globals.IEnumerableToAccessor(" << string << ", " << (param.type.has_own ? "true" : "false")<< ");\n"
|
||||
).generate(sink, std::make_tuple(escape_keyword(param.param_name), outvar), context))
|
||||
return false;
|
||||
}
|
||||
else if (param_is_acceptable(param, "Eina_Iterator *", WANT_OWN, WANT_OUT)
|
||||
|| param_is_acceptable(param, "Eina_Iterator *", !WANT_OWN, WANT_OUT)
|
||||
|| param_is_acceptable(param, "const Eina_Iterator *", WANT_OWN, WANT_OUT)
|
||||
|| param_is_acceptable(param, "const Eina_Iterator *", !WANT_OWN, WANT_OUT)
|
||||
)
|
||||
{
|
||||
attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(¶m.type.original_type);
|
||||
if (!complex)
|
||||
return false;
|
||||
auto outvar = out_variable_name(param.param_name);
|
||||
if (!as_generator(
|
||||
string << " = Efl.Eo.Globals.IEnumerableToIterator(" << string << ", " << (param.type.has_own ? "true" : "false")<< ");\n"
|
||||
).generate(sink, std::make_tuple(escape_keyword(param.param_name), outvar), context))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1284,7 +1337,13 @@ struct native_convert_return_variable_generator
|
|||
template <typename OutputIterator, typename Context>
|
||||
bool generate(OutputIterator sink, attributes::type_def const& ret_type, Context const& context) const
|
||||
{
|
||||
if (ret_type.c_type != "void")
|
||||
if (ret_type.c_type == "Eina_Accessor *" || ret_type.c_type == "const Eina_Accessor *" ||
|
||||
ret_type.c_type == "Eina_Iterator *" || ret_type.c_type == "const Eina_Iterator *")
|
||||
return as_generator(
|
||||
type << " _ret_var = null;"
|
||||
).generate(sink, ret_type, context);
|
||||
|
||||
else if (ret_type.c_type != "void")
|
||||
return as_generator(
|
||||
type << " _ret_var = default(" << type << ");"
|
||||
).generate(sink, std::make_tuple(ret_type, ret_type), context);
|
||||
|
@ -1379,8 +1438,6 @@ struct native_convert_return_generator
|
|||
}
|
||||
else if (ret_type.c_type == "Eina_Array *" || ret_type.c_type == "const Eina_Array *"
|
||||
|| ret_type.c_type == "Eina_List *" || ret_type.c_type == "const Eina_List *"
|
||||
|| ret_type.c_type == "Eina_Iterator *" || ret_type.c_type == "const Eina_Iterator *"
|
||||
|| ret_type.c_type == "Eina_Accessor *" || ret_type.c_type == "const Eina_Accessor *"
|
||||
)
|
||||
{
|
||||
attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(&ret_type.original_type);
|
||||
|
@ -1390,20 +1447,19 @@ struct native_convert_return_generator
|
|||
.generate(sink, attributes::unused, context))
|
||||
return false;
|
||||
|
||||
// Iterators and Accessors can't own their content.
|
||||
if (ret_type.c_type != "Eina_Iterator *" && ret_type.c_type != "const Eina_Iterator *"
|
||||
&& ret_type.c_type != "Eina_Accessor *" && ret_type.c_type != "const Eina_Accessor *"
|
||||
)
|
||||
{
|
||||
if ((ret_type.has_own && (complex->subtypes.front().is_value_type || complex->subtypes.front().has_own))
|
||||
&& !as_generator("_ret_var.OwnContent = false; ")
|
||||
.generate(sink, attributes::unused, context))
|
||||
return false;
|
||||
}
|
||||
|
||||
return as_generator("return _ret_var.Handle;")
|
||||
.generate(sink, attributes::unused, context);
|
||||
}
|
||||
else if (ret_type.c_type == "Eina_Accessor *" || ret_type.c_type == "const Eina_Accessor *")
|
||||
{
|
||||
return as_generator(lit("return Efl.Eo.Globals.IEnumerableToAccessor(_ret_var, ") << (ret_type.has_own ? "true" : "false") << ");")
|
||||
.generate(sink, attributes::unused, context);
|
||||
}
|
||||
else if (ret_type.c_type == "Eina_Iterator *" || ret_type.c_type == "const Eina_Iterator *")
|
||||
{
|
||||
return as_generator(lit("return Efl.Eo.Globals.IEnumerableToIterator(_ret_var, ") << (ret_type.has_own ? "true" : "false") << ");")
|
||||
.generate(sink, attributes::unused, context);
|
||||
}
|
||||
else if (ret_type.c_type != "void")
|
||||
return as_generator("return _ret_var;").generate(sink, ret_type, context);
|
||||
return true;
|
||||
|
|
|
@ -69,9 +69,15 @@ struct to_internal_field_convert_generator
|
|||
.generate(sink, std::make_tuple(field_name, field_name), context))
|
||||
return false;
|
||||
}
|
||||
else if ((complex && (complex->outer.base_type == "iterator")))
|
||||
{
|
||||
if (!as_generator(
|
||||
indent << scope_tab << scope_tab << "_internal_struct." << string << " = Efl.Eo.Globals.IEnumerableToIterator(_external_struct." << string << ", " << (field.type.has_own ? "true" : "false") << ");\n")
|
||||
.generate(sink, std::make_tuple(field_name, field_name), context))
|
||||
return false;
|
||||
}
|
||||
else if ((complex && (complex->outer.base_type == "array"
|
||||
|| complex->outer.base_type == "list"
|
||||
|| complex->outer.base_type == "iterator"
|
||||
|| complex->outer.base_type == "hash"))
|
||||
|| field.type.c_type == "Eina_Binbuf *" || field.type.c_type == "const Eina_Binbuf *")
|
||||
{
|
||||
|
@ -206,7 +212,7 @@ struct to_external_field_convert_generator
|
|||
else if (complex && complex->outer.base_type == "iterator")
|
||||
{
|
||||
if (!as_generator(
|
||||
indent << scope_tab << scope_tab << "_external_struct." << string << " = new " << type << "(_internal_struct." << string << ", false);\n")
|
||||
indent << scope_tab << scope_tab << "_external_struct." << string << " = Efl.Eo.Globals.IteratorTo" << type << "(_internal_struct." << string << ");\n")
|
||||
.generate(sink, std::make_tuple(field_name, field.type, field_name), context))
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -393,14 +393,14 @@ struct visitor_generate
|
|||
, {"iterator", nullptr, nullptr, [&]
|
||||
{
|
||||
complex_type_def c = complex;
|
||||
c.outer.base_type = "Eina.Iterator";
|
||||
c.outer.base_type = "IEnumerable";
|
||||
return c;
|
||||
}
|
||||
}
|
||||
, {"accessor", nullptr, nullptr, [&]
|
||||
{
|
||||
complex_type_def c = complex;
|
||||
c.outer.base_type = "Eina.Accessor";
|
||||
c.outer.base_type = "IEnumerable";
|
||||
return c;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ public class GenericModel<T> : Efl.Object, Efl.IModel
|
|||
}
|
||||
|
||||
/// <summary>The list of properties available in the wrapped model.</summary>
|
||||
public Eina.Iterator< System.String> Properties
|
||||
public IEnumerable<System.String> Properties
|
||||
{
|
||||
get { return GetProperties(); }
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ public class GenericModel<T> : Efl.Object, Efl.IModel
|
|||
|
||||
/// <summary>The list of properties available in the wrapped model.</summary>
|
||||
/// <returns>The list of properties in the model.</returns>
|
||||
public Eina.Iterator<System.String> GetProperties()
|
||||
public IEnumerable<System.String> GetProperties()
|
||||
{
|
||||
return model.GetProperties();
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ public enum Components : Int32
|
|||
/// <summary>
|
||||
/// Elementary Widget toolkit: Elm.
|
||||
/// <para>it's depend of <see cref="Efl.Csharp.Components.Basic" />.</para>
|
||||
/// <para>Since EFL 1.24</para>
|
||||
/// <para>Since EFL 1.24.</para>
|
||||
/// </summary>
|
||||
Ui = Basic | 0x2,
|
||||
|
||||
|
@ -199,7 +199,8 @@ public abstract class Application
|
|||
Init(components);
|
||||
Efl.App app = Efl.App.AppMain;
|
||||
var command_line = new Eina.Array<Eina.Stringshare>();
|
||||
command_line.Append(Array.ConvertAll(Environment.GetCommandLineArgs(), s => (Eina.Stringshare)s));
|
||||
//command_line.Add(List.ConvertAll(Environment.GetCommandLineArgs(), s => (Eina.Stringshare)s));
|
||||
//command_line.AddRange(Environment.GetCommandLineArgs());
|
||||
#if EFL_BETA
|
||||
app.SetCommandArray(command_line);
|
||||
#endif
|
||||
|
|
|
@ -18,6 +18,7 @@ using System.Collections;
|
|||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
using static Eina.TraitFunctions;
|
||||
|
||||
|
@ -28,8 +29,10 @@ namespace Eina
|
|||
|
||||
internal class AccessorNativeFunctions
|
||||
{
|
||||
[DllImport(efl.Libs.Eina)] public static extern IntPtr
|
||||
eina_carray_length_accessor_new(IntPtr array, uint step, uint length);
|
||||
[DllImport(efl.Libs.Eina)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool
|
||||
eina_accessor_data_get(IntPtr accessor, uint position, IntPtr data);
|
||||
eina_accessor_data_get(IntPtr accessor, uint position, out IntPtr data);
|
||||
[DllImport(efl.Libs.Eina)] public static extern void
|
||||
eina_accessor_free(IntPtr accessor);
|
||||
}
|
||||
|
@ -38,6 +41,8 @@ internal class AccessorNativeFunctions
|
|||
/// similar to C++ STL's and C# IEnumerable.
|
||||
/// <para>Since EFL 1.23.</para>
|
||||
/// </summary>
|
||||
[SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix",
|
||||
Justification="This is a generalized container mapping the native one.")]
|
||||
public class Accessor<T> : IEnumerable<T>, IDisposable
|
||||
{
|
||||
/// <summary>Pointer to the native accessor.</summary>
|
||||
|
@ -145,6 +150,7 @@ public class Accessor<T> : IEnumerable<T>, IDisposable
|
|||
/// <returns>An enumerator to walk through the acessor items.</returns>
|
||||
public IEnumerator<T> GetEnumerator()
|
||||
{
|
||||
/*
|
||||
if (Handle == IntPtr.Zero)
|
||||
{
|
||||
throw new ObjectDisposedException(base.GetType().Name);
|
||||
|
@ -152,7 +158,6 @@ public class Accessor<T> : IEnumerable<T>, IDisposable
|
|||
|
||||
IntPtr tmp = MemoryNative.Alloc(Marshal.SizeOf(typeof(IntPtr)));
|
||||
uint position = 0;
|
||||
|
||||
try
|
||||
{
|
||||
while (eina_accessor_data_get(Handle, position, tmp))
|
||||
|
@ -166,6 +171,8 @@ public class Accessor<T> : IEnumerable<T>, IDisposable
|
|||
{
|
||||
MemoryNative.Free(tmp);
|
||||
}
|
||||
*/
|
||||
yield break;
|
||||
}
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
|
@ -177,6 +184,8 @@ public class Accessor<T> : IEnumerable<T>, IDisposable
|
|||
/// <summary>Accessor for Inlists.
|
||||
/// <para>Since EFL 1.23.</para>
|
||||
/// </summary>
|
||||
[SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix",
|
||||
Justification="This is a generalized container mapping the native one.")]
|
||||
public class AccessorInList<T> : Accessor<T>
|
||||
{
|
||||
/// <summary>Create a new accessor wrapping the given pointer.
|
||||
|
@ -202,6 +211,8 @@ public class AccessorInList<T> : Accessor<T>
|
|||
/// <summary>Accessor for Inarrays.
|
||||
/// <para>Since EFL 1.23.</para>
|
||||
/// </summary>
|
||||
[SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix",
|
||||
Justification="This is a generalized container mapping the native one.")]
|
||||
public class AccessorInArray<T> : Accessor<T>
|
||||
{
|
||||
/// <summary>Create a new accessor wrapping the given pointer.
|
||||
|
|
|
@ -19,6 +19,7 @@ using System;
|
|||
using System.Runtime.InteropServices;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
using static Eina.TraitFunctions;
|
||||
using static Eina.ArrayNativeFunctions;
|
||||
|
@ -65,6 +66,8 @@ public static class ArrayNativeFunctions
|
|||
/// <summary>A container of contiguous allocated elements.
|
||||
/// <para>Since EFL 1.23.</para>
|
||||
/// </summary>
|
||||
[SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix",
|
||||
Justification="This is a generalized container mapping the native one.")]
|
||||
public class Array<T> : IEnumerable<T>, IDisposable
|
||||
{
|
||||
public const uint DefaultStep = 32;
|
||||
|
|
|
@ -16,7 +16,7 @@ internal static class Environment
|
|||
/// <summary>
|
||||
/// Returns the value of the environment variable named <c>name</c>.
|
||||
///
|
||||
/// <para>Since EFL 1.24</para>
|
||||
/// <para>Since EFL 1.24.</para>
|
||||
/// </summary>
|
||||
/// <param name="name">The name of the variable to be retrieved</param>
|
||||
/// <returns>The value of the variable. <c>null</c> if not set.</returns>
|
||||
|
@ -28,7 +28,7 @@ internal static class Environment
|
|||
/// <summary>
|
||||
/// Sets a native environment variable.
|
||||
///
|
||||
/// <para>Since EFL 1.24</para>
|
||||
/// <para>Since EFL 1.24.</para>
|
||||
/// </summary>
|
||||
/// <param name="name">The name of the variable</param>
|
||||
/// <param name="value">The value to be set.</param>
|
||||
|
@ -50,4 +50,4 @@ internal static partial class NativeCustomExportFunctions
|
|||
public static extern Eina.Error efl_mono_native_setenv(string name, string value, int overwrite);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace Eina
|
||||
{
|
||||
|
@ -153,6 +154,8 @@ public struct Error : IComparable<Error>, IEquatable<Error>
|
|||
/// back to the native code. For example, in an event handler.
|
||||
/// <para>Since EFL 1.23.</para>
|
||||
/// </summary>
|
||||
[SuppressMessage("Microsoft.Design", "CA1030:UseEventsWhereAppropriate",
|
||||
Justification = "It's not an event.")]
|
||||
public static void RaiseIfUnhandledException()
|
||||
{
|
||||
Error e = Get();
|
||||
|
@ -167,6 +170,8 @@ public struct Error : IComparable<Error>, IEquatable<Error>
|
|||
/// Raises an exception.
|
||||
/// <para>Since EFL 1.23.</para>
|
||||
/// </summary>
|
||||
[SuppressMessage("Microsoft.Design", "CA1030:UseEventsWhereAppropriate",
|
||||
Justification = "It's not an event.")]
|
||||
public static void Raise(Error e)
|
||||
{
|
||||
if (e != 0)
|
||||
|
|
|
@ -19,6 +19,7 @@ using System;
|
|||
using System.Runtime.InteropServices;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
using static Eina.TraitFunctions;
|
||||
using static Eina.IteratorNativeFunctions;
|
||||
|
@ -196,8 +197,10 @@ public static class HashNativeFunctions
|
|||
|
||||
/// <summary>Wrapper around native dictionary mapping keys to values.
|
||||
///
|
||||
/// Since EFL 1.23.
|
||||
/// <para>Since EFL 1.23.</para>
|
||||
/// </summary>
|
||||
[SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix",
|
||||
Justification = "This is a generalized container mapping the native one.")]
|
||||
public class Hash<TKey, TValue> : IEnumerable<KeyValuePair<TKey, TValue>>, IDisposable
|
||||
{
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
|
|
|
@ -19,6 +19,7 @@ using System;
|
|||
using System.Runtime.InteropServices;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
using static Eina.TraitFunctions;
|
||||
using static Eina.InarrayNativeFunctions;
|
||||
|
@ -87,6 +88,8 @@ public static class InarrayNativeFunctions
|
|||
/// <summary>Wrapper around an inplace array.
|
||||
/// <para>Since EFL 1.23.</para>
|
||||
/// </summary>
|
||||
[SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix",
|
||||
Justification="This is a generalized container mapping the native one.")]
|
||||
public class Inarray<T> : IEnumerable<T>, IDisposable
|
||||
{
|
||||
public const uint DefaultStep = 0;
|
||||
|
|
|
@ -19,6 +19,7 @@ using System;
|
|||
using System.Runtime.InteropServices;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
using static Eina.TraitFunctions;
|
||||
using static Eina.InlistNativeFunctions;
|
||||
|
@ -100,6 +101,8 @@ public static class InlistNativeFunctions
|
|||
/// <summary>Wrapper around an inplace list.
|
||||
/// <para>Since EFL 1.23.</para>
|
||||
/// </summary>
|
||||
[SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix",
|
||||
Justification="This is a generalized container mapping the native one.")]
|
||||
public class Inlist<T> : IEnumerable<T>, IDisposable
|
||||
{
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
|
|
|
@ -19,6 +19,7 @@ using System;
|
|||
using System.Runtime.InteropServices;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
using static Eina.TraitFunctions;
|
||||
using static Eina.IteratorNativeFunctions;
|
||||
|
@ -44,11 +45,15 @@ public static class IteratorNativeFunctions
|
|||
|
||||
[DllImport(efl.Libs.Eina)] internal static extern IntPtr
|
||||
eina_carray_iterator_new(IntPtr array);
|
||||
[DllImport(efl.Libs.Eina)] internal static extern IntPtr
|
||||
eina_carray_length_iterator_new(IntPtr array, uint step, uint length);
|
||||
}
|
||||
|
||||
/// <summary>Wrapper around a native Eina iterator.
|
||||
/// <para>Since EFL 1.23.</para>
|
||||
/// </summary>
|
||||
[SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix",
|
||||
Justification="This is a generalized container mapping the native one.")]
|
||||
public class Iterator<T> : IEnumerable<T>, IDisposable
|
||||
{
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
|
|
|
@ -19,6 +19,7 @@ using System;
|
|||
using System.Runtime.InteropServices;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
using static Eina.TraitFunctions;
|
||||
using static Eina.ListNativeFunctions;
|
||||
|
@ -124,6 +125,8 @@ public static class ListNativeFunctions
|
|||
/// <summary>Native wrapper around a linked list of items.
|
||||
/// <para>Since EFL 1.23.</para>
|
||||
/// </summary>
|
||||
[SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix",
|
||||
Justification="This is a generalized container mapping the native one.")]
|
||||
public class List<T> : IList<T>, IEnumerable<T>, IDisposable
|
||||
{
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ public interface ISliceBase
|
|||
|
||||
/// <summary>Pointer to a slice of native memory.
|
||||
///
|
||||
/// Since EFL 1.23.
|
||||
/// <para>Since EFL 1.23.</para>
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct Slice : ISliceBase, IEquatable<Slice>
|
||||
|
@ -114,7 +114,7 @@ public struct Slice : ISliceBase, IEquatable<Slice>
|
|||
=> (Length == other.Length) ^ (Mem == other.Mem);
|
||||
|
||||
/// <summary>Returns whether <c>lhs</c> is equal to <c>rhs</c>.
|
||||
/// <para>Since EFL 1.24</para>
|
||||
/// <para>Since EFL 1.24.</para>
|
||||
/// </summary>
|
||||
/// <param name="lhs">The left hand side of the operator.</param>
|
||||
/// <param name="rhs">The right hand side of the operator.</param>
|
||||
|
@ -134,7 +134,7 @@ public struct Slice : ISliceBase, IEquatable<Slice>
|
|||
|
||||
/// <summary>Pointer to a slice of native memory.
|
||||
///
|
||||
/// Since EFL 1.23.
|
||||
/// <para>Since EFL 1.23.</para>
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct RwSlice : ISliceBase, IEquatable<RwSlice>
|
||||
|
|
|
@ -927,7 +927,7 @@ static class ValueTypeMethods
|
|||
/// marshall_type_impl.hh in the generator). User-facing API still uses Eina.ValueType
|
||||
/// normally.</para>
|
||||
///
|
||||
/// Since EFL 1.23.
|
||||
/// <para>Since EFL 1.23.</para>
|
||||
/// </summary>
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public class ValueTypeBox
|
||||
|
|
|
@ -87,7 +87,7 @@ public struct ObjectPath : IEquatable<ObjectPath>
|
|||
/// </summary>
|
||||
/// <param name="path">The ObjectPath to be converted.</param>
|
||||
public static string ToString(ObjectPath path) => path.value;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets a hash for <see cref="ObjectPath" />.
|
||||
/// <para>Since EFL 1.24.</para>
|
||||
|
@ -1551,6 +1551,8 @@ public static class Common
|
|||
/// Register the NullError.
|
||||
/// <para>Since EFL 1.23.</para>
|
||||
/// </summary>
|
||||
[SuppressMessage("Microsoft.Design", "CA1030:UseEventsWhereAppropriate",
|
||||
Justification = "It's not an event.")]
|
||||
public static void RaiseNullHandle()
|
||||
{
|
||||
if (NullHandleError == 0)
|
||||
|
|
|
@ -292,9 +292,7 @@ public class Object : System.IDisposable
|
|||
/// <summary>
|
||||
/// Decrease object reference.
|
||||
/// <para>If reference == 0 object will be freed and all its children.</para>
|
||||
///<para>
|
||||
/// Since EFL 1.23.
|
||||
///</para>
|
||||
/// <para>Since EFL 1.23.</para>
|
||||
/// </summary>
|
||||
public void Unref()
|
||||
{
|
||||
|
|
|
@ -100,7 +100,7 @@ public abstract class EoWrapper : IWrapper, IDisposable
|
|||
[CallerFilePath] string file = null,
|
||||
[CallerLineNumber] int line = 0)
|
||||
{
|
||||
generated = Efl.Eo.BindingEntity.IsBindingEntity(((object)this).GetType());
|
||||
generated = Efl.Eo.BindingEntityAttribute.IsBindingEntity(((object)this).GetType());
|
||||
IntPtr actual_klass = baseKlass;
|
||||
if (!generated)
|
||||
{
|
||||
|
|
|
@ -759,6 +759,125 @@ public static class Globals
|
|||
Monitor.Exit(Efl.All.InitLock);
|
||||
}
|
||||
|
||||
internal static IEnumerable<T> AccessorToIEnumerable<T>(IntPtr accessor)
|
||||
{
|
||||
if (accessor == IntPtr.Zero)
|
||||
throw new ArgumentException("accessor is null", nameof(accessor));
|
||||
|
||||
IntPtr data = IntPtr.Zero;
|
||||
uint position = 0;
|
||||
|
||||
while (Eina.AccessorNativeFunctions.eina_accessor_data_get(accessor, position, out data))
|
||||
{
|
||||
yield return Eina.TraitFunctions.NativeToManaged<T>(data);
|
||||
position += 1;
|
||||
}
|
||||
}
|
||||
|
||||
internal static IntPtr IEnumerableToAccessor<T>(IEnumerable<T> enumerable, bool isMoved)
|
||||
{
|
||||
if (enumerable == null)
|
||||
{
|
||||
throw new ArgumentException("enumerable is null", nameof(enumerable));
|
||||
}
|
||||
|
||||
// If we are a wrapper around an existing Eina.Accessor, we can just forward
|
||||
// it and avoid unnecessary copying in non-owning transfers.
|
||||
var wrappedAccessor = enumerable as Eina.Accessor<T>;
|
||||
|
||||
if (wrappedAccessor != null && !isMoved)
|
||||
{
|
||||
return wrappedAccessor.Handle;
|
||||
}
|
||||
|
||||
var list = new List<IntPtr>();
|
||||
foreach (T data in enumerable)
|
||||
{
|
||||
list.Add(Eina.TraitFunctions.ManagedToNativeAlloc<T>(data));
|
||||
}
|
||||
IntPtr[] dataArray = list.ToArray();
|
||||
GCHandle pinnedArray = GCHandle.Alloc(dataArray, GCHandleType.Pinned); //FIXME: Need to free.
|
||||
IntPtr ret = Eina.AccessorNativeFunctions.eina_carray_length_accessor_new(pinnedArray.AddrOfPinnedObject(), (uint)(IntPtr.Size), (uint)dataArray.Length);
|
||||
|
||||
if (!isMoved)
|
||||
{
|
||||
// FIXME Need to free ret and unpin pinnedArray in the future.
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
internal static IEnumerable<T> IteratorToIEnumerable<T>(IntPtr iterator)
|
||||
{
|
||||
if (iterator == IntPtr.Zero)
|
||||
throw new ArgumentException("iterator is null", nameof(iterator));
|
||||
|
||||
while (Eina.IteratorNativeFunctions.eina_iterator_next(iterator, out IntPtr data))
|
||||
{
|
||||
yield return Eina.TraitFunctions.NativeToManaged<T>(data);
|
||||
}
|
||||
}
|
||||
|
||||
internal static IntPtr IEnumerableToIterator<T>(IEnumerable<T> enumerable, bool isMoved)
|
||||
{
|
||||
if (enumerable == null)
|
||||
{
|
||||
throw new ArgumentException("enumerable is null", nameof(enumerable));
|
||||
}
|
||||
|
||||
// If we are a wrapper around an existing Eina.Iterator, we can just forward
|
||||
// it and avoid unnecessary copying in non-owning transfers.
|
||||
var wrappedIterator = enumerable as Eina.Iterator<T>;
|
||||
|
||||
if (wrappedIterator != null && !isMoved)
|
||||
{
|
||||
return wrappedIterator.Handle;
|
||||
}
|
||||
|
||||
var list = new List<IntPtr>();
|
||||
foreach (T data in enumerable)
|
||||
{
|
||||
list.Add(Eina.TraitFunctions.ManagedToNativeAlloc<T>(data));
|
||||
}
|
||||
|
||||
IntPtr[] dataArray = list.ToArray();
|
||||
GCHandle pinnedArray = GCHandle.Alloc(dataArray, GCHandleType.Pinned);
|
||||
IntPtr ret = Eina.IteratorNativeFunctions.eina_carray_length_iterator_new(pinnedArray.AddrOfPinnedObject(), (uint)(IntPtr.Size), (uint)dataArray.Length);
|
||||
|
||||
if (!isMoved)
|
||||
{
|
||||
// FIXME Need to free ret and unpin pinnedArray in the future.
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
internal static IEnumerable<T> ListToIEnumerable<T>(IntPtr list)
|
||||
{
|
||||
if (list == IntPtr.Zero)
|
||||
throw new ArgumentException("list is null", nameof(list));
|
||||
|
||||
IntPtr l;
|
||||
|
||||
for (l = list; l != IntPtr.Zero; l = Eina.ListNativeFunctions.eina_list_next_custom_export_mono(l))
|
||||
{
|
||||
yield return Eina.TraitFunctions.NativeToManaged<T>(Eina.ListNativeFunctions.eina_list_data_get_custom_export_mono(l));
|
||||
}
|
||||
}
|
||||
|
||||
internal static IntPtr IEnumerableToList<T>(IEnumerable<T> enumerable)
|
||||
{
|
||||
if (enumerable == null)
|
||||
throw new ArgumentException("enumerable is null", nameof(enumerable));
|
||||
|
||||
IntPtr list = IntPtr.Zero;
|
||||
foreach (T data in enumerable)
|
||||
{
|
||||
list = Eina.ListNativeFunctions.eina_list_append(list, Eina.TraitFunctions.ManagedToNativeAlloc(data));
|
||||
}
|
||||
// FIXME need to free `list` if the returned list is not @moved
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
} // Globals
|
||||
|
@ -828,11 +947,11 @@ class PrivateNativeClass : NativeClass
|
|||
AllowMultiple = false,
|
||||
Inherited = false)
|
||||
]
|
||||
public class BindingEntity: System.Attribute
|
||||
public class BindingEntityAttribute: System.Attribute
|
||||
{
|
||||
public static bool IsBindingEntity(System.Type t)
|
||||
{
|
||||
return Attribute.GetCustomAttribute(t, typeof(BindingEntity), false) != null;
|
||||
return Attribute.GetCustomAttribute(t, typeof(BindingEntityAttribute), false) != null;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1034,7 +1153,7 @@ internal static class ClassRegister
|
|||
///
|
||||
/// <para>For internal usage by generated code.</para>
|
||||
///
|
||||
/// <para>Since EFL 1.24</para>
|
||||
/// <para>Since EFL 1.24.</para>
|
||||
/// </summary>
|
||||
class MarshalEoNoMove : ICustomMarshaler
|
||||
{
|
||||
|
@ -1117,7 +1236,7 @@ class MarshalEoNoMove : ICustomMarshaler
|
|||
///
|
||||
/// <para>For internal usage by generated code.</para>
|
||||
///
|
||||
/// <para>Since EFL 1.24</para>
|
||||
/// <para>Since EFL 1.24.</para>
|
||||
/// </summary>
|
||||
class MarshalEoMove : ICustomMarshaler
|
||||
{
|
||||
|
|
|
@ -111,7 +111,10 @@ internal struct EflObjectOps
|
|||
namespace Efl
|
||||
{
|
||||
|
||||
///<summary>This struct holds the description of a specific event (Since EFL 1.22).</summary>
|
||||
/// <summary>
|
||||
/// This struct holds the description of a specific event.
|
||||
/// <para>Since EFL 1.22.</para>
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
internal struct EventDescription
|
||||
{
|
||||
|
@ -164,25 +167,31 @@ internal struct EventDescription
|
|||
/// <summary>
|
||||
/// A parameter passed in event callbacks holding extra event parameters.
|
||||
/// This is the full event information passed to callbacks in C.
|
||||
/// (Since EFL 1.22)
|
||||
/// <para>Since EFL 1.22.</para>
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
[Efl.Eo.BindingEntity]
|
||||
internal struct Event
|
||||
{
|
||||
/// <summary>The object the callback was called on.
|
||||
/// (Since EFL 1.22)</summary>
|
||||
/// <summary>
|
||||
/// The object the callback was called on.
|
||||
/// <para>Since EFL 1.22.</para>
|
||||
/// </summary>
|
||||
public Efl.Object Object;
|
||||
|
||||
/// <summary>The event description.
|
||||
/// (Since EFL 1.22)</summary>
|
||||
/// <summary>
|
||||
/// The event description.
|
||||
/// <para>Since EFL 1.22.</para>
|
||||
/// </summary>
|
||||
public Efl.EventDescription Desc;
|
||||
|
||||
/// <summary>Extra event information passed by the event caller.
|
||||
/// <summary>
|
||||
/// Extra event information passed by the event caller.
|
||||
/// Must be cast to the event type declared in the EO file. Keep in mind that:
|
||||
/// 1) Objects are passed as a normal Eo*. Event subscribers can call functions on these objects.
|
||||
/// 2) Structs, built-in types and containers are passed as const pointers, with one level of indirection.
|
||||
/// (Since EFL 1.22)</summary>
|
||||
/// <para>Since EFL 1.22.</para>
|
||||
/// </summary>
|
||||
public System.IntPtr Info;
|
||||
|
||||
/// <summary>Constructor for Event.</summary>
|
||||
|
|
|
@ -12,7 +12,7 @@ icon.setIcon("home");
|
|||
var path, group;
|
||||
r = icon.getFile(path, group);
|
||||
path = r[0];
|
||||
gruop = r[1];
|
||||
group = r[1];
|
||||
console.log("path = " + path + ", group = " + group);
|
||||
|
||||
var name;
|
||||
|
|
|
@ -1,53 +1,53 @@
|
|||
import efl_gfx_types;
|
||||
enum @beta Efl.Text_Font_Weight {
|
||||
[[Type of font weight]]
|
||||
normal, [[Normal font weight]]
|
||||
thin, [[Thin font weight]]
|
||||
ultralight, [[Ultralight font weight]]
|
||||
extralight, [[Extralight font weight]]
|
||||
light, [[Light font weight]]
|
||||
book, [[Book font weight]]
|
||||
medium, [[Medium font weight]]
|
||||
semibold, [[Semibold font weight]]
|
||||
bold, [[Bold font weight]]
|
||||
ultrabold, [[Ultrabold font weight]]
|
||||
extrabold, [[Extrabold font weight]]
|
||||
black, [[Black font weight]]
|
||||
extrablack, [[Extrablack font weight]]
|
||||
[[Type of font weight.]]
|
||||
normal, [[Normal font weight.]]
|
||||
thin, [[Thin font weight.]]
|
||||
ultralight, [[Ultralight font weight.]]
|
||||
extralight, [[Extralight font weight.]]
|
||||
light, [[Light font weight.]]
|
||||
book, [[Book font weight.]]
|
||||
medium, [[Medium font weight.]]
|
||||
semibold, [[Semibold font weight.]]
|
||||
bold, [[Bold font weight.]]
|
||||
ultrabold, [[Ultrabold font weight.]]
|
||||
extrabold, [[Extrabold font weight.]]
|
||||
black, [[Black font weight.]]
|
||||
extrablack, [[Extrablack font weight.]]
|
||||
}
|
||||
|
||||
enum @beta Efl.Text_Font_Width {
|
||||
[[Type of font width]]
|
||||
normal, [[Normal font width]]
|
||||
ultracondensed, [[Ultracondensed font width]]
|
||||
extracondensed, [[Extracondensed font width]]
|
||||
condensed, [[Condensed font width]]
|
||||
semicondensed, [[Semicondensed font width]]
|
||||
semiexpanded, [[Semiexpanded font width]]
|
||||
expanded, [[Expanded font width]]
|
||||
extraexpanded, [[Extraexpanded font width]]
|
||||
ultraexpanded, [[Ultraexpanded font width]]
|
||||
[[Type of font width.]]
|
||||
normal, [[Normal font width.]]
|
||||
ultracondensed, [[Ultracondensed font width.]]
|
||||
extracondensed, [[Extracondensed font width.]]
|
||||
condensed, [[Condensed font width.]]
|
||||
semicondensed, [[Semicondensed font width.]]
|
||||
semiexpanded, [[Semiexpanded font width.]]
|
||||
expanded, [[Expanded font width.]]
|
||||
extraexpanded, [[Extraexpanded font width.]]
|
||||
ultraexpanded, [[Ultraexpanded font width.]]
|
||||
}
|
||||
|
||||
enum @beta Efl.Text_Font_Slant {
|
||||
[[Type of font slant]]
|
||||
normal, [[Normal font slant]]
|
||||
oblique, [[Oblique font slant]]
|
||||
italic, [[Italic font slant]]
|
||||
[[Type of font slant.]]
|
||||
normal, [[Normal font slant.]]
|
||||
oblique, [[Oblique font slant.]]
|
||||
italic, [[Italic font slant.]]
|
||||
}
|
||||
|
||||
/* FIXME: It needs to support "normal" option for non-color bitmap font.
|
||||
For supporting "normal" option, S/W glyph drawing engine should be updated.
|
||||
*/
|
||||
enum @beta Efl.Text_Font_Bitmap_Scalable {
|
||||
[[Scalable of bitmap fonts
|
||||
[[Scalable of bitmap fonts.
|
||||
]]
|
||||
none = 0, [[Disable scalable feature for bitmap fonts.]]
|
||||
color = (1 << 0), [[Enable scalable feature for color bitmap fonts.]]
|
||||
}
|
||||
|
||||
interface @beta Efl.Text_Font {
|
||||
[[Font settings of the text
|
||||
[[Font settings for text.
|
||||
]]
|
||||
c_prefix: efl_text;
|
||||
methods {
|
||||
|
@ -105,42 +105,42 @@ interface @beta Efl.Text_Font {
|
|||
}
|
||||
|
||||
@property font_fallbacks {
|
||||
[[Comma-separated list of font fallbacks
|
||||
[[Comma-separated list of font fallbacks.
|
||||
|
||||
Will be used in case the primary font isn't available.
|
||||
]]
|
||||
values {
|
||||
font_fallbacks: string; [[Font name fallbacks]]
|
||||
font_fallbacks: string; [[List of fallback font names.]]
|
||||
}
|
||||
}
|
||||
|
||||
@property font_weight {
|
||||
[[Type of weight of the displayed font
|
||||
|
||||
Default is @Efl.Text_Font_Weight.normal\.
|
||||
Default is @Efl.Text_Font_Weight.normal.
|
||||
]]
|
||||
values {
|
||||
font_weight: Efl.Text_Font_Weight; [[Font weight]]
|
||||
font_weight: Efl.Text_Font_Weight; [[Font weight.]]
|
||||
}
|
||||
}
|
||||
|
||||
@property font_slant {
|
||||
[[Type of slant of the displayed font
|
||||
[[Type of slant of the displayed font.
|
||||
|
||||
Default is @Efl.Text_Font_Slant.normal\.
|
||||
Default is @Efl.Text_Font_Slant.normal.
|
||||
]]
|
||||
values {
|
||||
style: Efl.Text_Font_Slant; [[Font slant]]
|
||||
style: Efl.Text_Font_Slant; [[Font slant.]]
|
||||
}
|
||||
}
|
||||
|
||||
@property font_width {
|
||||
[[Type of width of the displayed font
|
||||
[[Type of width of the displayed font.
|
||||
|
||||
Default is @Efl.Text_Font_Width.normal\.
|
||||
Default is @Efl.Text_Font_Width.normal.
|
||||
]]
|
||||
values {
|
||||
width: Efl.Text_Font_Width; [[Font width]]
|
||||
width: Efl.Text_Font_Width; [[Font width.]]
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -153,19 +153,19 @@ interface @beta Efl.Text_Font {
|
|||
"auto" to use the system locale, or "none".
|
||||
]]
|
||||
values {
|
||||
lang: string; [[Language]]
|
||||
lang: string; [[Language code.]]
|
||||
}
|
||||
}
|
||||
|
||||
@property font_bitmap_scalable {
|
||||
[[The bitmap fonts have fixed size glyphs for several available sizes.
|
||||
Basically, it is not scalable. But, it needs to be scalable for some use cases.
|
||||
(ex. colorful emoji fonts)
|
||||
(e.g. colorful emoji fonts)
|
||||
|
||||
Default is @Efl.Text_Font_Bitmap_Scalable.none\.
|
||||
Default is @Efl.Text_Font_Bitmap_Scalable.none.
|
||||
]]
|
||||
values {
|
||||
scalable: Efl.Text_Font_Bitmap_Scalable; [[Scalable]]
|
||||
scalable: Efl.Text_Font_Bitmap_Scalable; [[Scalable.]]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,22 +1,23 @@
|
|||
enum @beta Efl.Text_Format_Wrap {
|
||||
[[Wrap mode of the text (not in effect if not multiline)]]
|
||||
none, [[No wrapping]]
|
||||
char, [[Wrap mode character]]
|
||||
word, [[Wrap mode word]]
|
||||
mixed, [[Wrap mode mixed]]
|
||||
hyphenation [[Wrap mode hyphenation]]
|
||||
[[Wrapping policy of the text.]]
|
||||
none, [[No wrapping.]]
|
||||
char, [[Wrap at character boundaries.]]
|
||||
word, [[Wrap at word boundaries.]]
|
||||
mixed, [[Wrap at word boundaries if possible, at any character if not.]]
|
||||
hyphenation [[Hyphenate if possible, otherwise try word boundaries or
|
||||
at any character.]]
|
||||
}
|
||||
|
||||
enum @beta Efl.Text_Format_Horizontal_Alignment_Auto_Type {
|
||||
[[Auto-horizontal alignment of the text]]
|
||||
none, [[No auto-alignment rule]]
|
||||
normal, [[Respects LTR/RTL (bidirectional) settings]]
|
||||
locale, [[Respects locale's langauge settings]]
|
||||
end [[Text is places at opposite side of LTR/RTL (bidirectional) settings]]
|
||||
[[Auto-horizontal alignment of the text.]]
|
||||
none, [[No auto-alignment rule.]]
|
||||
normal, [[Respects LTR/RTL (bidirectional) settings.]]
|
||||
locale, [[Respects locale's language settings.]]
|
||||
end [[Text is placed at opposite side of LTR/RTL (bidirectional) settings.]]
|
||||
}
|
||||
|
||||
interface @beta Efl.Text_Format {
|
||||
[[The look and layout of the text
|
||||
[[The look and layout of the text.
|
||||
|
||||
The text format can affect the geometry of the text object, as well as
|
||||
how characters are presented.
|
||||
|
@ -24,83 +25,96 @@ interface @beta Efl.Text_Format {
|
|||
c_prefix: efl_text;
|
||||
methods {
|
||||
@property ellipsis {
|
||||
[[Ellipsis value (number from -1.0 to 1.0)]]
|
||||
[[Controls automatic addition of ellipsis "..." to replace text which cannot be shown.
|
||||
The value must be a number indicating the position of the ellipsis inside the visible text.
|
||||
$[0.0] means the beginning of the text, $[1.0] means the end of the text, and values in between
|
||||
mean the proportional position inside the text.
|
||||
Any value smaller than 0 or greater than 1 disables ellipsis.
|
||||
]]
|
||||
values
|
||||
{
|
||||
value: double; [[Ellipsis value]]
|
||||
value: double; [[Ellipsis value.]]
|
||||
}
|
||||
}
|
||||
|
||||
@property wrap {
|
||||
[[Wrap mode for use in the text]]
|
||||
[[Wrapping policy of the text. Requires @.multiline to be $true.]]
|
||||
values {
|
||||
wrap: Efl.Text_Format_Wrap; [[Wrap mode]]
|
||||
wrap: Efl.Text_Format_Wrap; [[Wrap mode.]]
|
||||
}
|
||||
}
|
||||
|
||||
@property multiline {
|
||||
[[Multiline is enabled or not]]
|
||||
[[Enables text to span multiple lines.
|
||||
|
||||
When $false, new-line characters are ignored and no text wrapping occurs.
|
||||
]]
|
||||
values {
|
||||
enabled: bool; [[$true if multiline is enabled, $false otherwise]]
|
||||
enabled: bool; [[$true if multiline is enabled.]]
|
||||
}
|
||||
}
|
||||
|
||||
@property horizontal_align_auto_type {
|
||||
[[Horizontal alignment of text]]
|
||||
@property text_horizontal_align_auto_type {
|
||||
[[Horizontal alignment of text.]]
|
||||
values {
|
||||
value: Efl.Text_Format_Horizontal_Alignment_Auto_Type; [[Alignment type]]
|
||||
value: Efl.Text_Format_Horizontal_Alignment_Auto_Type; [[Alignment type.]]
|
||||
}
|
||||
}
|
||||
|
||||
@property horizontal_align {
|
||||
[[Horizontal alignment of text]]
|
||||
@property text_horizontal_align {
|
||||
[[Horizontal alignment of text. $[0.0] means "left"
|
||||
and $[1.0] means "right".]]
|
||||
values {
|
||||
value: double; [[Horizontal alignment value]]
|
||||
value: double; [[Alignment value between $[0.0] and $[1.0].]]
|
||||
}
|
||||
}
|
||||
|
||||
@property vertical_align {
|
||||
[[Vertical alignment of text]]
|
||||
@property text_vertical_align {
|
||||
[[Vertical alignment of text.$[0.0] means "top"
|
||||
and $[1.0] means "bottom"]]
|
||||
values {
|
||||
value: double; [[Vertical alignment value]]
|
||||
value: double; [[Alignment value between $[0.0] and $[1.0].]]
|
||||
}
|
||||
}
|
||||
|
||||
@property linegap {
|
||||
[[Minimal line gap (top and bottom) for each line in the text
|
||||
[[Minimal line gap (top and bottom) for each line in the text.
|
||||
|
||||
$value is absolute size.
|
||||
]]
|
||||
values
|
||||
{
|
||||
value: double; [[Line gap value]]
|
||||
value: double; [[Line gap value, in pixels.]]
|
||||
}
|
||||
}
|
||||
|
||||
@property linerelgap {
|
||||
[[Relative line gap (top and bottom) for each line in the text
|
||||
[[Relative line gap (top and bottom) for each line in the text.
|
||||
|
||||
The original line gap value is multiplied by $value.
|
||||
]]
|
||||
values
|
||||
{
|
||||
value: double; [[Relative line gap value]]
|
||||
value: double; [[Relative line gap value. $[1.0] means original size.]]
|
||||
}
|
||||
}
|
||||
|
||||
@property tabstops {
|
||||
[[Tabstops value]]
|
||||
[[Size of the tab character.]]
|
||||
values
|
||||
{
|
||||
value: int; [[Tapstops value]]
|
||||
value: int; [[Size in pixels.]]
|
||||
}
|
||||
}
|
||||
|
||||
@property password {
|
||||
[[Whether text is a password]]
|
||||
[[Enabling this causes all characters to be replaced by @.replacement_char.
|
||||
|
||||
This is useful for password input boxes.
|
||||
]]
|
||||
values
|
||||
{
|
||||
enabled: bool; [[$true if the text is a password, $false otherwise]]
|
||||
enabled: bool; [[$true if the text is a password.]]
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,248 +1,257 @@
|
|||
enum @beta Efl.Text_Style_Backing_Type
|
||||
{
|
||||
[[Whether to apply backing style to the displayed text or not]]
|
||||
disabled = 0, [[Do not use backing]]
|
||||
enabled, [[Use backing style]]
|
||||
[[Whether to add a background colored rectangle (backing) to each line of text or not.]]
|
||||
disabled = 0, [[Do not use backing.]]
|
||||
enabled, [[Use backing.]]
|
||||
}
|
||||
|
||||
enum @beta Efl.Text_Style_Strikethrough_Type
|
||||
{
|
||||
[[Whether to apply strikethrough style to the displayed text or not]]
|
||||
disabled = 0, [[Do not use strikethrough]]
|
||||
enabled, [[Use strikethrough style]]
|
||||
[[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
|
||||
{
|
||||
[[Effect to apply to the displayed text]]
|
||||
none = 0, [[No effect]]
|
||||
[[Effect to apply to the displayed text.]]
|
||||
none = 0, [[No effect.]]
|
||||
|
||||
// colored with shadow_color
|
||||
shadow, [[Shadow effect]]
|
||||
far_shadow, [[Far shadow effect]]
|
||||
soft_shadow, [[Soft shadow effect]]
|
||||
far_soft_shadow, [[Far and soft shadow effect]]
|
||||
shadow, [[Shadow effect.]]
|
||||
far_shadow, [[Far shadow effect.]]
|
||||
soft_shadow, [[Soft shadow effect.]]
|
||||
far_soft_shadow, [[Far and soft shadow effect.]]
|
||||
// colored with glow_color
|
||||
glow, [[Glow effect]]
|
||||
glow, [[Glow effect.]]
|
||||
// colored with outline_color
|
||||
outline, [[Outline effect]]
|
||||
soft_outline, [[Soft outline effect]]
|
||||
outline, [[Outline effect.]]
|
||||
soft_outline, [[Soft outline effect.]]
|
||||
// colored with outline_color + shadow_color
|
||||
outline_shadow, [[Outline shadow effect]]
|
||||
outline_soft_shadow, [[Outline soft shadow effect]]
|
||||
outline_shadow, [[Outline + shadow effect.]]
|
||||
outline_soft_shadow, [[Outline + soft shadow effect.]]
|
||||
}
|
||||
|
||||
enum @beta Efl.Text_Style_Shadow_Direction
|
||||
{
|
||||
[[Direction of the shadow style, if used]]
|
||||
bottom_right = 0, [[Shadow towards bottom right]]
|
||||
bottom, [[Shadow towards botom]]
|
||||
bottom_left, [[Shadow towards bottom left]]
|
||||
left, [[Shadow towards left]]
|
||||
top_left, [[Shadow towards top left]]
|
||||
top, [[Shadow towards top]]
|
||||
top_right, [[Shadow towards top right]]
|
||||
right, [[Shadow towards right]]
|
||||
[[Direction of the shadow.]]
|
||||
bottom_right = 0, [[Shadow towards bottom right.]]
|
||||
bottom, [[Shadow towards bottom.]]
|
||||
bottom_left, [[Shadow towards bottom left.]]
|
||||
left, [[Shadow towards left.]]
|
||||
top_left, [[Shadow towards top left.]]
|
||||
top, [[Shadow towards top.]]
|
||||
top_right, [[Shadow towards top right.]]
|
||||
right, [[Shadow towards right.]]
|
||||
}
|
||||
|
||||
enum @beta Efl.Text_Style_Underline_Type
|
||||
{
|
||||
[[Underline type of the displayed text]]
|
||||
off = 0, [[Text without underline]]
|
||||
on, [[Underline enabled]]
|
||||
single, [[Underlined with a signle line]]
|
||||
double, [[Underlined with a double line]]
|
||||
dashed, [[Underlined with a dashed line]]
|
||||
[[Type of underline of the displayed text.]]
|
||||
off = 0, [[Text without underline.]]
|
||||
on, [[Underline enabled.]]
|
||||
single, [[Underlined with a single line.]]
|
||||
double, [[Underlined with a double line.]]
|
||||
dashed, [[Underlined with a dashed line.]]
|
||||
}
|
||||
|
||||
interface @beta Efl.Text_Style {
|
||||
[[Style to apply to the text
|
||||
[[Decorations to add to the text.
|
||||
|
||||
A style can be coloring, effects, underline, strikethrough etc.
|
||||
Decorations can be coloring, effects, underlines, strike-through etc.
|
||||
]]
|
||||
c_prefix: efl_text;
|
||||
methods {
|
||||
@property normal_color {
|
||||
[[Color of text, excluding style]]
|
||||
[[Color of text, excluding decorations like, shadow, outline or glow.]]
|
||||
values
|
||||
{
|
||||
r: ubyte; [[Red component]]
|
||||
g: ubyte; [[Green component]]
|
||||
b: ubyte; [[Blue component]]
|
||||
a: ubyte; [[Alpha component]]
|
||||
r: ubyte; [[Red component.]]
|
||||
g: ubyte; [[Green component.]]
|
||||
b: ubyte; [[Blue component.]]
|
||||
a: ubyte; [[Alpha component.]]
|
||||
}
|
||||
}
|
||||
|
||||
@property backing_type {
|
||||
[[Enable or disable backing 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_Backing_Type; [[Backing type.]]
|
||||
}
|
||||
}
|
||||
|
||||
@property backing_color {
|
||||
[[Backing color]]
|
||||
[[Color of the background rectangle (backing) behind each line of text.]]
|
||||
values
|
||||
{
|
||||
r: ubyte; [[Red component]]
|
||||
g: ubyte; [[Green component]]
|
||||
b: ubyte; [[Blue component]]
|
||||
a: ubyte; [[Alpha component]]
|
||||
r: ubyte; [[Red component.]]
|
||||
g: ubyte; [[Green component.]]
|
||||
b: ubyte; [[Blue component.]]
|
||||
a: ubyte; [[Alpha component.]]
|
||||
}
|
||||
}
|
||||
|
||||
@property underline_type {
|
||||
[[Sets an underline style on the text]]
|
||||
[[Underline style for the text.]]
|
||||
values
|
||||
{
|
||||
type: Efl.Text_Style_Underline_Type; [[Underline type]]
|
||||
type: Efl.Text_Style_Underline_Type; [[Underline type.]]
|
||||
}
|
||||
}
|
||||
|
||||
@property underline_color
|
||||
{
|
||||
[[Color of normal underline style]]
|
||||
[[Color of normal underline style.]]
|
||||
values
|
||||
{
|
||||
r: ubyte; [[Red component]]
|
||||
g: ubyte; [[Green component]]
|
||||
b: ubyte; [[Blue component]]
|
||||
a: ubyte; [[Alpha component]]
|
||||
r: ubyte; [[Red component.]]
|
||||
g: ubyte; [[Green component.]]
|
||||
b: ubyte; [[Blue component.]]
|
||||
a: ubyte; [[Alpha component.]]
|
||||
}
|
||||
}
|
||||
|
||||
@property underline_height
|
||||
{
|
||||
[[Height of underline style]]
|
||||
[[Width (in pixels) of the single underline when @.underline_type is
|
||||
@Efl.Text_Style_Underline_Type.single.]]
|
||||
values
|
||||
{
|
||||
height: double; [[Height]]
|
||||
height: double; [[Underline width in pixels.]]
|
||||
}
|
||||
}
|
||||
|
||||
@property underline_dashed_color
|
||||
{
|
||||
[[Color of dashed underline style]]
|
||||
[[Color of the dashed underline. Only valid when @.underline_type is
|
||||
@Efl.Text_Style_Underline_Type.dashed.]]
|
||||
values
|
||||
{
|
||||
r: ubyte; [[Red component]]
|
||||
g: ubyte; [[Green component]]
|
||||
b: ubyte; [[Blue component]]
|
||||
a: ubyte; [[Alpha component]]
|
||||
r: ubyte; [[Red component.]]
|
||||
g: ubyte; [[Green component.]]
|
||||
b: ubyte; [[Blue component.]]
|
||||
a: ubyte; [[Alpha component.]]
|
||||
}
|
||||
}
|
||||
|
||||
@property underline_dashed_width
|
||||
{
|
||||
[[Width of dashed underline style]]
|
||||
[[Length (in pixels) of the dashes when @.underline_type is
|
||||
@Efl.Text_Style_Underline_Type.dashed.]]
|
||||
values
|
||||
{
|
||||
width: int; [[Width]]
|
||||
width: int; [[Dash length in pixels.]]
|
||||
}
|
||||
}
|
||||
|
||||
@property underline_dashed_gap
|
||||
{
|
||||
[[Gap of dashed underline style]]
|
||||
[[Length (in pixels) of the gaps between the dashes when @.underline_type is
|
||||
@Efl.Text_Style_Underline_Type.dashed.]]
|
||||
values
|
||||
{
|
||||
gap: int; [[Gap]]
|
||||
gap: int; [[Gap length in pixels.]]
|
||||
}
|
||||
}
|
||||
|
||||
@property underline2_color
|
||||
{
|
||||
[[Color of underline2 style]]
|
||||
[[Color of the secondary underline. Only valid when @.underline_type is
|
||||
@Efl.Text_Style_Underline_Type.double.]]
|
||||
values
|
||||
{
|
||||
r: ubyte; [[Red component]]
|
||||
g: ubyte; [[Green component]]
|
||||
b: ubyte; [[Blue component]]
|
||||
a: ubyte; [[Alpha component]]
|
||||
r: ubyte; [[Red component.]]
|
||||
g: ubyte; [[Green component.]]
|
||||
b: ubyte; [[Blue component.]]
|
||||
a: ubyte; [[Alpha component.]]
|
||||
}
|
||||
}
|
||||
|
||||
@property strikethrough_type {
|
||||
[[Type of strikethrough style]]
|
||||
[[Enables crossed-out text.]]
|
||||
values
|
||||
{
|
||||
type: Efl.Text_Style_Strikethrough_Type; [[Strikethrough type]]
|
||||
type: Efl.Text_Style_Strikethrough_Type; [[Strike-through type.]]
|
||||
}
|
||||
}
|
||||
|
||||
@property strikethrough_color
|
||||
{
|
||||
[[Color of strikethrough_style]]
|
||||
[[Color of the line striking through the text.]]
|
||||
values
|
||||
{
|
||||
r: ubyte; [[Red component]]
|
||||
g: ubyte; [[Green component]]
|
||||
b: ubyte; [[Blue component]]
|
||||
a: ubyte; [[Alpha component]]
|
||||
r: ubyte; [[Red component.]]
|
||||
g: ubyte; [[Green component.]]
|
||||
b: ubyte; [[Blue component.]]
|
||||
a: ubyte; [[Alpha component.]]
|
||||
}
|
||||
}
|
||||
|
||||
@property effect_type {
|
||||
[[Type of effect used for the displayed text]]
|
||||
[[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]]
|
||||
type: Efl.Text_Style_Effect_Type; [[Effect type.]]
|
||||
}
|
||||
}
|
||||
@property outline_color
|
||||
{
|
||||
[[Color of outline effect]]
|
||||
[[Color of the text outline.]]
|
||||
values
|
||||
{
|
||||
r: ubyte; [[Red component]]
|
||||
g: ubyte; [[Green component]]
|
||||
b: ubyte; [[Blue component]]
|
||||
a: ubyte; [[Alpha component]]
|
||||
r: ubyte; [[Red component.]]
|
||||
g: ubyte; [[Green component.]]
|
||||
b: ubyte; [[Blue component.]]
|
||||
a: ubyte; [[Alpha component.]]
|
||||
}
|
||||
}
|
||||
|
||||
@property shadow_direction
|
||||
{
|
||||
[[Direction of shadow effect]]
|
||||
[[Direction of shadow effect.]]
|
||||
values
|
||||
{
|
||||
type: Efl.Text_Style_Shadow_Direction; [[Shadow direction]]
|
||||
type: Efl.Text_Style_Shadow_Direction; [[Shadow direction.]]
|
||||
}
|
||||
}
|
||||
|
||||
@property shadow_color
|
||||
{
|
||||
[[Color of shadow effect]]
|
||||
[[Color of the shadow.]]
|
||||
values
|
||||
{
|
||||
r: ubyte; [[Red component]]
|
||||
g: ubyte; [[Green component]]
|
||||
b: ubyte; [[Blue component]]
|
||||
a: ubyte; [[Alpha component]]
|
||||
r: ubyte; [[Red component.]]
|
||||
g: ubyte; [[Green component.]]
|
||||
b: ubyte; [[Blue component.]]
|
||||
a: ubyte; [[Alpha component.]]
|
||||
}
|
||||
}
|
||||
|
||||
@property glow_color
|
||||
{
|
||||
[[Color of glow effect]]
|
||||
[[Color of the glow decoration.]]
|
||||
values
|
||||
{
|
||||
r: ubyte; [[Red component]]
|
||||
g: ubyte; [[Green component]]
|
||||
b: ubyte; [[Blue component]]
|
||||
a: ubyte; [[Alpha component]]
|
||||
r: ubyte; [[Red component.]]
|
||||
g: ubyte; [[Green component.]]
|
||||
b: ubyte; [[Blue component.]]
|
||||
a: ubyte; [[Alpha component.]]
|
||||
}
|
||||
}
|
||||
|
||||
@property glow2_color
|
||||
{
|
||||
[[Second color of the glow effect]]
|
||||
[[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.
|
||||
]]
|
||||
values
|
||||
{
|
||||
r: ubyte; [[Red component]]
|
||||
g: ubyte; [[Green component]]
|
||||
b: ubyte; [[Blue component]]
|
||||
a: ubyte; [[Alpha component]]
|
||||
r: ubyte; [[Red component.]]
|
||||
g: ubyte; [[Green component.]]
|
||||
b: ubyte; [[Blue component.]]
|
||||
a: ubyte; [[Alpha component.]]
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
mixin @beta Efl.Canvas.Object_Animation requires Efl.Object
|
||||
{
|
||||
[[A mixin that provides animation capabilities to @Efl.Canvas.Object.
|
||||
|
||||
By including this mixin canvas objects can be animated just by calling @.animation_start.
|
||||
]]
|
||||
methods {
|
||||
@property animation {
|
||||
[[The animation that is currently played on the canvas object.
|
||||
|
@ -13,43 +17,50 @@ mixin @beta Efl.Canvas.Object_Animation requires Efl.Object
|
|||
}
|
||||
}
|
||||
@property animation_progress {
|
||||
[[The current progress of the animation, between 0.0 and 1.0.
|
||||
[[The current progress of the animation, between $[0.0] and $[1.0].
|
||||
|
||||
Even if the animation is going backwards (speed < 0.0). the progress will still go from 0.0 to 1.0.
|
||||
Even if the animation is going backwards (speed < 0.0) the progress will still go from $[0.0] to $[1.0].
|
||||
|
||||
If there is no animation going on, this will return -1.0.
|
||||
If there is no animation going on, this will return $[-1.0].
|
||||
]]
|
||||
get {
|
||||
|
||||
}
|
||||
values {
|
||||
progress : double; [[The progress the animation applying is currently in.]]
|
||||
progress : double; [[Current progress of the animation.]]
|
||||
}
|
||||
}
|
||||
@property animation_pause {
|
||||
[[Pause the animation
|
||||
[[Pause the animation.
|
||||
|
||||
The animation will not be unset. When $pause is unset, the animation will be resumed at the same progress it has right now.
|
||||
@.animation will not be unset. When $pause is $false, the animation will be resumed at the same progress it
|
||||
was when it was paused.
|
||||
]]
|
||||
values {
|
||||
pause : bool;
|
||||
pause : bool; [[Paused state.]]
|
||||
}
|
||||
}
|
||||
animation_start {
|
||||
[[Start a new animation.
|
||||
|
||||
If there is a animation going on, this is stopped. The previous @.animation object will be replaced. The lifetime is adjusted accordingly.
|
||||
If there is an animation going on, it is stopped and the previous @.animation object is replaced.
|
||||
Its lifetime is adjusted accordingly.
|
||||
]]
|
||||
params {
|
||||
animation : Efl.Canvas.Animation @move; [[The animation to start. When not needed anymore, the reference that was passed is given up.]]
|
||||
speed : double; [[The speed of the playback. `1.0` is normal playback. Negative values mean backward playback.]]
|
||||
starting_progress : double; [[The progress to start, must be between 0.0 and 1.0.]]
|
||||
animation : Efl.Canvas.Animation @move; [[The animation to start. When not needed anymore,
|
||||
the reference that was passed is given up.]]
|
||||
speed : double; [[The speed of the playback. $[1.0] is normal playback. Negative values mean reverse playback.
|
||||
]]
|
||||
starting_progress : double; [[The progress point where to start. Must be between $[0.0] and $[1.0].
|
||||
Useful to revert an animation which has already started.
|
||||
]]
|
||||
}
|
||||
}
|
||||
animation_stop {
|
||||
[[Stop the animation.
|
||||
|
||||
After this call, @.animation will return $null. The reference that was taken during @.animation_start will be given up on.
|
||||
After this call, @.animation will return $null.
|
||||
The reference that was taken during @.animation_start will be given up.
|
||||
]]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,7 +6,13 @@ class @beta Efl.Canvas.Textblock extends Efl.Canvas.Object implements Efl.Text,
|
|||
Efl.Text_Markup, Efl.Ui.I18n
|
||||
{
|
||||
[[This is the Canvas-level text class. This class only takes care of rendering text,
|
||||
if you need user interaction consider the classes in $Efl.Ui.]]
|
||||
if you need user interaction consider the classes in $[Efl.Ui].
|
||||
|
||||
Note: No text will be rendered until a font, a font size and a font color are specified.
|
||||
This can be accomplished using @Efl.Text_Font.font_family, @Efl.Text_Font.font_size and
|
||||
@Efl.Text_Style.normal_color.
|
||||
Alternatively, @.style_apply can be used providing the attributes $font, $font_size and $color.
|
||||
]]
|
||||
methods {
|
||||
@property is_empty {
|
||||
[[Whether the object is empty (no text) or not.
|
||||
|
@ -80,337 +86,265 @@ class @beta Efl.Canvas.Textblock extends Efl.Canvas.Object implements Efl.Text,
|
|||
}
|
||||
}
|
||||
style_apply {
|
||||
[[Applies a style to the text object. Applied style attributes override old ones, leaving other attributes
|
||||
unaffected.
|
||||
This is similar to setting individual style attributes using properties like @Efl.Text_Font.font_slant or
|
||||
@Efl.Text_Format.wrap.
|
||||
[[Applies several style attributes at once using a formatting string.
|
||||
Given style attributes override previous values, leaving other attributes unaffected.
|
||||
This is akin to setting individual style attributes using properties like
|
||||
@Efl.Text_Font.font_slant or @Efl.Text_Format.wrap, for example.
|
||||
|
||||
The style can be set as "attribute"="Value".
|
||||
Multible attribute can be set at once separated by space.
|
||||
The formatting string is a whitespace-separated list of $[attribute=value] pairs.
|
||||
|
||||
The following styling attributes are accepted:
|
||||
The following attributes are accepted:
|
||||
|
||||
- Font
|
||||
- Font fallback
|
||||
- Font size
|
||||
- Font source
|
||||
- Font weight
|
||||
- Font style
|
||||
- Font width
|
||||
- Language
|
||||
- Color
|
||||
- Underline Color
|
||||
- Second Underline Color
|
||||
- Underline Dash Color
|
||||
- Outline Color
|
||||
- Shadow Color
|
||||
- First Glow Color
|
||||
- Second Glow Color
|
||||
- Backing Color
|
||||
- Strikethrough Color
|
||||
- Horizontal Align
|
||||
- Vertical Align
|
||||
- Wrap
|
||||
- Left margin
|
||||
- Right margin
|
||||
- Underline
|
||||
- Strikethrough
|
||||
- Backing
|
||||
- Style
|
||||
- Tabstops
|
||||
- Line size
|
||||
- Relative line size
|
||||
- Line gap
|
||||
- Relative line gap
|
||||
- Item
|
||||
- Line fill
|
||||
- Ellipsis
|
||||
- Password
|
||||
- Underline dash width
|
||||
- Underline dash gap
|
||||
- Underline height
|
||||
- $font: Name of the font to use.
|
||||
Default value is empty, meaning that no text will be rendered.
|
||||
Requires $font_size and $font_color.
|
||||
See @Efl.Text_Font.font_family.
|
||||
|
||||
Font
|
||||
This sets the name of the font to be used.
|
||||
font=<font name>
|
||||
- $font_fallbacks: Comma-delimited list of fonts to try if finding the primary font fails.
|
||||
Example: $[font_fallbacks=consolas,courier,monospace].
|
||||
Default value is empty.
|
||||
See @Efl.Text_Font.font_fallbacks.
|
||||
|
||||
Font fallback
|
||||
A comma delimited list of fonts to try if finding the primary font fails.
|
||||
font_fallbacks=<font names>
|
||||
- $font_size: Height of font, in points.
|
||||
Default value is 0.
|
||||
Requires $font and $font_color.
|
||||
See @Efl.Text_Font.font_size.
|
||||
|
||||
Font size
|
||||
This sets the the size of font in points to be used.
|
||||
font_size=<size>
|
||||
- $font_source: Path to the file containing the font to use.
|
||||
Example: $[font_source=/usr/share/fonts/Sans.ttf].
|
||||
Default value is empty.
|
||||
See @Efl.Text_Font.font_source.
|
||||
|
||||
Font source
|
||||
Specify source from which to search for the font.
|
||||
font_source=<source>
|
||||
- $font_weight: Thickness of the font. The value must be one of: $normal, $thin, $ultralight, $extralight,
|
||||
$light, $book, $medium, $semibold, $bold, $ultrabold, $extrabold, $black and $extrablack.
|
||||
Default value is $normal.
|
||||
See @Efl.Text_Font.font_weight.
|
||||
|
||||
Font weight
|
||||
Sets the weight of the font. The value must be one of:
|
||||
"normal"
|
||||
"thin"
|
||||
"ultralight"
|
||||
"extralight"
|
||||
"light"
|
||||
"book"
|
||||
"medium"
|
||||
"semibold"
|
||||
"bold"
|
||||
"ultrabold"
|
||||
"extrabold"
|
||||
"black"
|
||||
"extrablack"
|
||||
font_weight=<weight>
|
||||
- $font_style: Style of the font. The value must be one of: $normal, $oblique and $italic.
|
||||
Default value is $normal.
|
||||
See @Efl.Text_Font.font_slant.
|
||||
|
||||
Font style
|
||||
Sets the style of the font. The value must be one of:
|
||||
"normal"
|
||||
"oblique"
|
||||
"italic"
|
||||
font_style=<style>
|
||||
- $font_width: How wide the font is, relative to its height. The value must be one of:
|
||||
$normal, $ultracondensed, $extracondensed, $condensed, $semicondensed, $semiexpanded, $expanded,
|
||||
$extraexpanded and $ultraexpanded.
|
||||
Default value is $normal.
|
||||
See @Efl.Text_Font.font_weight.
|
||||
|
||||
Font width
|
||||
Sets the width of the font. The value must be one of:
|
||||
"normal"
|
||||
"ultracondensed"
|
||||
"extracondensed"
|
||||
"condensed"
|
||||
"semicondensed"
|
||||
"semiexpanded"
|
||||
"expanded"
|
||||
"extraexpanded"
|
||||
"ultraexpanded"
|
||||
font_width=<width>
|
||||
- $lang: A 2-letter ISO 639-1 language code, $auto (to use the system locale setting) or $none (to disable
|
||||
language support).
|
||||
Example: $[lang=he].
|
||||
Default value is empty.
|
||||
See @Efl.Text_Font.font_lang.
|
||||
|
||||
Language
|
||||
Overrides the language defined in font. For example, lang=he.
|
||||
The value can either be a language text or one of presets:
|
||||
"auto" - Respects system locale settings as language
|
||||
"none" - Disable language support
|
||||
lang=<language>
|
||||
- $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.
|
||||
|
||||
Color Commands <color>:
|
||||
The following formats are accepted:
|
||||
"#RRGGBB"
|
||||
"#RRGGBBAA"
|
||||
"#RGB"
|
||||
"#RGBA"
|
||||
"rgb(r,g,b)"
|
||||
"rgba(r,g,b,a)"
|
||||
"color_name" like "red" (X11 color names)
|
||||
- $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.
|
||||
|
||||
Color
|
||||
Sets the color of the text.
|
||||
color=<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.
|
||||
|
||||
Underline Color
|
||||
Sets the color of the underline.
|
||||
underline_color=<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.
|
||||
|
||||
Second Underline Color
|
||||
Sets the color of the second line of underline(when using underline mode "double").
|
||||
underline2_color=<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.
|
||||
|
||||
Underline Dash Color
|
||||
Sets the color of dashed underline.
|
||||
underline_dash_color=<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.
|
||||
|
||||
Outline Color
|
||||
Sets the color of the outline of the text.
|
||||
outline_color=<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.
|
||||
|
||||
Shadow Color
|
||||
Sets the color of the shadow of the text.
|
||||
shadow_color=<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.
|
||||
|
||||
First Glow Color
|
||||
Sets the first color of the glow of text.
|
||||
glow_color=<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.
|
||||
|
||||
Second Glow Color
|
||||
Sets the second color of the glow of text.
|
||||
glow2_color=<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.
|
||||
|
||||
Backing Color
|
||||
Sets a background color for text.
|
||||
backing_color=<color>
|
||||
- $align: Horizontal alignment of the text. The value can either be a decimal number ($[0.0] means "left"
|
||||
and $[1.0] means "right"), a percentage ($[0%] means "left" and $[100%] means "right") or one of:
|
||||
$auto (Respects LTR/RTL settings), $locale (Respects language direction settings), $center
|
||||
(Centers the text in the line), $middle (Alias for $center), $left (Puts the text at the left of the line),
|
||||
$right (Puts the text at the right of the line), $start (Alias for $auto), $end (Puts the text at the
|
||||
opposite side of LTR/RTL settings).
|
||||
Default value is $auto.
|
||||
See @Efl.Text_Format.text_horizontal_align.
|
||||
|
||||
Strikethrough Color
|
||||
Sets the color of text that is striked through.
|
||||
strikethrough_color=<color>
|
||||
- $valign: Vertical alignment of the text. The value can either be a decimal number ($[0.0] means "top"
|
||||
and $[1.0] means "bottom"), a percentage ($[0%] means "top" and $[100%] means "bottom") or one of:
|
||||
$top (Puts the text at the top of the text box), $center (Puts the text at the middle of the text box),
|
||||
$middle (Alias for $center), $bottom (Puts the text at the bottom of the text box),
|
||||
$baseline (Puts the text's baseline at the middle of the text box), $base (Alias for $baseline).
|
||||
Default value is $baseline.
|
||||
See @Efl.Text_Format.text_vertical_align.
|
||||
|
||||
Horizontal Align
|
||||
Sets the horizontal alignment of the text. The value can either be a number, a percentage or one of several presets:
|
||||
"auto" - Respects LTR/RTL settings
|
||||
"locale" - Respects locale(language) direction settings
|
||||
"center" - Centers the text in the line
|
||||
"middle" - Alias for "center"
|
||||
"left" - Puts the text at the left of the line
|
||||
"right" - Puts the text at the right of the line
|
||||
"start" - Respects LTR/RTL settings. It is same with "auto"
|
||||
"end" - Puts the text at the opposite side of LTR/RTL settings
|
||||
<number> - A number between 0.0 and 1.0 where 0.0 represents "left" and 1.0 represents "right"
|
||||
<number>% - A percentage between 0% and 100% where 0% represents "left" and 100% represents "right"
|
||||
align=<value or preset>
|
||||
- $wrap: Wrapping policy of the text. The value must be one of the following: $word (Only wraps lines at
|
||||
word boundaries), $char (Wraps at any character), $mixed (Wraps at word boundaries if possible,
|
||||
at any character if not), $hyphenation (Hyphenate if possible, otherwise try wrapping at word boundaries
|
||||
or at any character) or $none to disable wrapping.
|
||||
Default value is $none.
|
||||
See @Efl.Text_Format.wrap.
|
||||
|
||||
Vertical Align
|
||||
Sets the vertical alignment of the text.
|
||||
The value can either be a number or one of the following presets:
|
||||
"top" - Puts text at the top of the line
|
||||
"center" - Centers the text in the line
|
||||
"middle" - Alias for "center"
|
||||
"bottom" - Puts the text at the bottom of the line
|
||||
"baseline" - Baseline
|
||||
"base" - Alias for "baseline"
|
||||
<number> - A number between 0.0 and 1.0 where 0.0 represents "top" and 1.0 represents "bottom"
|
||||
<number>% - A percentage between 0% and 100% where 0% represents "top" and 100% represents "bottom"
|
||||
valign=<value or preset>
|
||||
See explanation of baseline at: https://en.wikipedia.org/wiki/Baseline_%28typography%29
|
||||
- $left_margin: Distance in pixels from the left side of the text block to the beginning of the text
|
||||
(inner margin). The value can be a number (to set the margin), or a number preceded by $[+] or $[-]
|
||||
to increment or decrement the existing margin value. $reset is also accepted, to set the margin to
|
||||
0 pixels.
|
||||
Default value is $[0].
|
||||
Examples: $[left_margin=10], $[left_margin=+10], $[left_margin=reset].
|
||||
|
||||
Wrap
|
||||
Sets the wrap policy of the text. The value must be one of the following:
|
||||
"word" - Only wraps lines at word boundaries
|
||||
"char" - Wraps at any character
|
||||
"mixed" - Wrap at words if possible, if not at any character
|
||||
"hyphenation" - Hyphenate if possible, if not wrap at words if possible, if not at any character
|
||||
"none" - Don't wrap, this is the default value
|
||||
wrap=<value or preset>
|
||||
- $right_margin: Distance in pixels from the right side of the text block to the beginning of the text
|
||||
(inner margin). The value can be a number (to set the margin), or a number preceded by $[+] or $[-]
|
||||
to increment or decrement the existing margin value. $reset is also accepted, to set the margin to
|
||||
0 pixels.
|
||||
Default value is $[0].
|
||||
Examples: $[right_margin=10], $[right_margin=+10], $[right_margin=reset].
|
||||
|
||||
Left margin
|
||||
Sets the left margin of the text (in pixel). The value can be a number, an increment, decrement or "reset":
|
||||
+<number> - Increments existing left margin by <number>
|
||||
-<number> - Decrements existing left margin by <number>
|
||||
<number> - Sets left margin to <number>
|
||||
"reset" - Sets left margin to 0
|
||||
left_margin=<value or reset>
|
||||
- $underline: Style of the underline. The value must be one of $off (No underlining),
|
||||
$single (A single line under the text), $on (Alias for $single), $double (Two lines under the 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.
|
||||
|
||||
Right margin
|
||||
Sets the right margin of the text (in pixel). The value can be a number, an increment, decrement or "reset":
|
||||
+<number> - Increments existing right margin by <number>
|
||||
-<number> - Decrements existing right margin by <number>
|
||||
<number> - Sets left margin to <number>
|
||||
"reset" - Sets left margin to 0
|
||||
right_margin=<value or reset>
|
||||
- $strikethrough: Enables crossed-out text. Possible values are $on and $off.
|
||||
Default value is $off.
|
||||
Requires $strikethrough_color.
|
||||
See @Efl.Text_Style.strikethrough_type.
|
||||
|
||||
Underline
|
||||
Sets if and how a text will be underlined. The value must be one of the following:
|
||||
"off" - No underlining
|
||||
"single" - A single line under the text
|
||||
"on" - Alias for "single"
|
||||
"double" - Two lines under the text
|
||||
"dashed" - A dashed line under the text
|
||||
underline=off/single/on/double/dashed
|
||||
- $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.
|
||||
|
||||
Strikethrough
|
||||
Sets if the text will be striked through. The value must be one of the following:
|
||||
"off" - No strikethrough
|
||||
"on" - Strikethrough
|
||||
strikethrough=on/off
|
||||
- $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),
|
||||
$shadow, $outline, $soft_outline, $outline_shadow, $outline_soft_shadow, $glow (alias for $soft_outline),
|
||||
$far_shadow, $soft_shadow and $far_soft_shadow.
|
||||
All values involving a shadow accept a second parameter, separated by a comma, to indicate the shadow
|
||||
direction. Valid positions are $bottom_right, $bottom, $bottom_left, $left, $top_left, $top, $top_right
|
||||
and $right.
|
||||
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.
|
||||
|
||||
Backing
|
||||
Sets if the text will have background color enabled or disabled. The value must be one of the following:
|
||||
"off" - No backing
|
||||
"on" - Backing
|
||||
backing=on/off
|
||||
- $tabstops: Size (in pixels) of the tab character. The value must be a number greater than one.
|
||||
Default value is $[32].
|
||||
See @Efl.Text_Format.tabstops.
|
||||
|
||||
Style
|
||||
Sets the style of the text. The value must be a string composed of two comma separated parts.
|
||||
The first part of the value sets the appearance of the text, the second the position.
|
||||
The first part may be any of the following values:
|
||||
"plain"
|
||||
"off" - Alias for "plain"
|
||||
"none" - Alias for "plain"
|
||||
"shadow"
|
||||
"outline"
|
||||
"soft_outline"
|
||||
"outline_shadow"
|
||||
"outline_soft_shadow"
|
||||
"glow"
|
||||
"far_shadow"
|
||||
"soft_shadow"
|
||||
"far_soft_shadow" The second part may be any of the following values:
|
||||
"bottom_right"
|
||||
"bottom"
|
||||
"bottom_left"
|
||||
"left"
|
||||
"top_left"
|
||||
"top"
|
||||
"top_right"
|
||||
"right"
|
||||
style=<appearance>,<position>
|
||||
- $linesize: Distance (in pixels) from the baseline of one line of text to the next. This is, a value of
|
||||
$[0] would render all lines on top of each other (However, this value will be ignored if it results in
|
||||
overlapping lines of text).
|
||||
Setting this value sets $linerelsize to $[0%] (disables it).
|
||||
Default value is $[0].
|
||||
|
||||
Tabstops
|
||||
Sets the size (in pixel) of the tab character. The value must be a number greater than one.
|
||||
tabstops=<number>
|
||||
- $linerelsize: Distance (in percentage over the natural line height) from the baseline of one line of
|
||||
text to the next. A value of $[100%] does not have any impact, smaller values render lines closer together
|
||||
and bigger values render them further apart.
|
||||
Setting this value sets $linesize to $[0] (disables it).
|
||||
Default value is $[0%].
|
||||
|
||||
Line size
|
||||
Sets the size (in pixel) of line of text. The value should be a number.
|
||||
Setting this value sets linerelsize to 0%!
|
||||
linesize=<number>
|
||||
- $linegap: Additional empty space (in pixels) between the bottom of one line of text and the top of the
|
||||
next. Setting this value sets $linerelgap to $[0%] (disables it).
|
||||
Default value is $[0].
|
||||
See @Efl.Text_Format.linegap.
|
||||
|
||||
Relative line size
|
||||
Percentage indicating the wanted size of the line relative to the calculated size.
|
||||
Setting this value sets linesize to 0!
|
||||
linerelsize=<number>%
|
||||
- $linerelgap: Additional empty space (in percentage over the natural line height) between the bottom of
|
||||
one line of text and the top of the next.
|
||||
Setting this value sets $linegap to $[0] (disables it).
|
||||
Default value is $[0%].
|
||||
See @Efl.Text_Format.linerelgap.
|
||||
|
||||
Line gap
|
||||
Sets the size (in pixel) of the line gap in text (distance between lines). The value should be a number.
|
||||
Setting this value sets linerelgap to 0%!
|
||||
linegap=<number>
|
||||
- $linefill: An alternate way to specify the $linesize as a percentage of the canvas height.
|
||||
A value of $[100%] means that a single line fills the canvas, whereas $[25%] means that 4 lines
|
||||
fit in the same height.
|
||||
When both $linefill and $linesize are specified the one resulting in the smallest line size is used.
|
||||
Default value is $[0].
|
||||
|
||||
Relative line gap
|
||||
Sets the relative size of the line gap in text based calculated size. The value must be a percentage.
|
||||
Setting this value sets linegap to 0!
|
||||
linerelgap=<number>%
|
||||
- $ellipsis: Controls automatic addition of ellipsis "..." to replace text which cannot be shown.
|
||||
The value must be a number indicating the position of the ellipsis inside the visible text.
|
||||
$[0.0] means the beginning of the text, $[1.0] means the end of the text, and values in between
|
||||
mean the proportional position inside the text.
|
||||
Any value smaller than 0 or greater than 1 disables ellipsis.
|
||||
Default value is $[-1].
|
||||
Examples: $[ellipsis=0.5
|
||||
See @Efl.Text_Format.ellipsis.
|
||||
|
||||
Line fill
|
||||
Sets the size of the line fill in text. The value must be a percentage (how much line fill its canvas).
|
||||
For example setting value to 100%, means the one line will fill it canvas.
|
||||
linefill=<number>%
|
||||
- $password: Enabling this causes all characters to be replaced by $replacement_char.
|
||||
This is useful for password input boxes.
|
||||
Value must be either $on or $off.
|
||||
Default value is $[off].
|
||||
Requires $replacement_char.
|
||||
See @Efl.Text_Format.password.
|
||||
|
||||
Ellipsis
|
||||
Sets ellipsis mode. The value should be a number.
|
||||
Any value smaller than 0.0 or greater than 1.0 disables ellipsis.
|
||||
A value of 0 means ellipsizing the leftmost portion of the text first, 1 on the other hand the rightmost portion.
|
||||
ellipsis=<number>
|
||||
- $replacement_char: Character to use instead of the actual characters when $password is $on.
|
||||
Default value is empty, meaning that no replacement will take place.
|
||||
Requires $password.
|
||||
Examples: $[replacement_char=*].
|
||||
See @Efl.Text_Format.replacement_char.
|
||||
|
||||
Password
|
||||
Sets if the text is being used for passwords.
|
||||
Enabling this causes all characters to be substituted for '*'. Value must be one of the following:
|
||||
"on" - Enable
|
||||
"off" - Disable
|
||||
password=on/off
|
||||
- $underline_dash_width: Length (in pixels) of the dashes when $underline is $dashed.
|
||||
Default value is $[6].
|
||||
See @Efl.Text_Style.underline_dashed_width.
|
||||
|
||||
Underline dash width
|
||||
Sets the width of the underline dash (in pixel). The value should be a number.
|
||||
underline_dash_width=<number>
|
||||
- $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.
|
||||
|
||||
Underline dash gap
|
||||
Sets the gap of the underline dash (in pixel). The value should be a number.
|
||||
underline_dash_gap=<number>
|
||||
- $underline_height: Width (in pixels) of the single underline when $underline is $single.
|
||||
Default value is $[1].
|
||||
See @Efl.Text_Style.underline_height.
|
||||
|
||||
Underline height
|
||||
Sets the height of the single underline (in pixel). The value should be a floating number.
|
||||
underline_height=<floatingnumber>
|
||||
- $gfx_filter: Experimental filter name. See @Efl.Gfx.Filter for more information.
|
||||
|
||||
Gfx Filter
|
||||
Experimental filter, see efl_gfx_filter for more information.
|
||||
gfx_filter='filter name'
|
||||
Color codes: Colors can be specified using any of the following formats:
|
||||
$[#RRGGBB], $[#RRGGBBAA], $[#RGB], $[#RGBA], $[rgb(r,g,b)], $[rgba(r,g,b,a)].
|
||||
Additionally, X11 color names like $red or $blanchedalmond can be used.
|
||||
See https://en.wikipedia.org/wiki/X11_color_names for the full list.
|
||||
]]
|
||||
|
||||
params {
|
||||
@in style: string; [[A whitespace-separated list of $[property=value] pairs, for example, $[font=sans font_size=30].]]
|
||||
@in style: string; [[A whitespace-separated list of $[attribute=value] pairs, for example,
|
||||
$[font=sans font_size=30 color=white].]]
|
||||
}
|
||||
}
|
||||
@property all_styles {
|
||||
[[A string representing the complete set of styles applied to this text object.
|
||||
[[A string representing the complete set of attributes applied to this text object.
|
||||
This includes the default attributes plus any additional style applied with @.style_apply
|
||||
or individual style properties like @Efl.Text_Font.font_slant or @Efl.Text_Format.wrap.]]
|
||||
or individual style properties like @Efl.Text_Font.font_slant or @Efl.Text_Format.wrap.
|
||||
|
||||
See @.style_apply for the description of all attributes.
|
||||
]]
|
||||
get {}
|
||||
values {
|
||||
style: string; [[A whitespace-separated list of $[property=value] pairs, for example,
|
||||
$[font=sans size=30]. Do not free.]]
|
||||
style: string; [[A whitespace-separated list of $[attribute=value] pairs, for example,
|
||||
$[font=sans font_size=30 color=white].]]
|
||||
}
|
||||
}
|
||||
@property size_formatted {
|
||||
|
@ -545,9 +479,9 @@ class @beta Efl.Canvas.Textblock extends Efl.Canvas.Object implements Efl.Text,
|
|||
Efl.Text_Format.ellipsis { get; set; }
|
||||
Efl.Text_Format.wrap { get; set; }
|
||||
Efl.Text_Format.multiline { get; set; }
|
||||
Efl.Text_Format.horizontal_align { get; set; }
|
||||
Efl.Text_Format.horizontal_align_auto_type { get; set; }
|
||||
Efl.Text_Format.vertical_align { get; set; }
|
||||
Efl.Text_Format.text_horizontal_align { get; set; }
|
||||
Efl.Text_Format.text_horizontal_align_auto_type { get; set; }
|
||||
Efl.Text_Format.text_vertical_align { get; set; }
|
||||
Efl.Text_Format.linegap { get; set; }
|
||||
Efl.Text_Format.linerelgap { get; set; }
|
||||
Efl.Text_Format.tabstops { get; set; }
|
||||
|
|
|
@ -16750,7 +16750,7 @@ _efl_canvas_textblock_efl_text_format_multiline_get(const Eo *obj EINA_UNUSED, E
|
|||
}
|
||||
|
||||
static void
|
||||
_efl_canvas_textblock_efl_text_format_horizontal_align_auto_type_set(Eo *obj, Efl_Canvas_Textblock_Data *o, Efl_Text_Format_Horizontal_Alignment_Auto_Type type)
|
||||
_efl_canvas_textblock_efl_text_format_text_horizontal_align_auto_type_set(Eo *obj, Efl_Canvas_Textblock_Data *o, Efl_Text_Format_Horizontal_Alignment_Auto_Type type)
|
||||
{
|
||||
ASYNC_BLOCK;
|
||||
if (type == EFL_TEXT_FORMAT_HORIZONTAL_ALIGNMENT_AUTO_TYPE_NONE)
|
||||
|
@ -16772,7 +16772,7 @@ _efl_canvas_textblock_efl_text_format_horizontal_align_auto_type_set(Eo *obj, Ef
|
|||
}
|
||||
|
||||
static Efl_Text_Format_Horizontal_Alignment_Auto_Type
|
||||
_efl_canvas_textblock_efl_text_format_horizontal_align_auto_type_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o)
|
||||
_efl_canvas_textblock_efl_text_format_text_horizontal_align_auto_type_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o)
|
||||
{
|
||||
Efl_Text_Format_Horizontal_Alignment_Auto_Type ret =
|
||||
EFL_TEXT_FORMAT_HORIZONTAL_ALIGNMENT_AUTO_TYPE_NONE;
|
||||
|
@ -16793,7 +16793,7 @@ _efl_canvas_textblock_efl_text_format_horizontal_align_auto_type_get(const Eo *o
|
|||
}
|
||||
|
||||
static void
|
||||
_efl_canvas_textblock_efl_text_format_horizontal_align_set(Eo *obj, Efl_Canvas_Textblock_Data *o,
|
||||
_efl_canvas_textblock_efl_text_format_text_horizontal_align_set(Eo *obj, Efl_Canvas_Textblock_Data *o,
|
||||
double value)
|
||||
{
|
||||
ASYNC_BLOCK;
|
||||
|
@ -16803,13 +16803,13 @@ _efl_canvas_textblock_efl_text_format_horizontal_align_set(Eo *obj, Efl_Canvas_T
|
|||
}
|
||||
|
||||
static double
|
||||
_efl_canvas_textblock_efl_text_format_horizontal_align_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED)
|
||||
_efl_canvas_textblock_efl_text_format_text_horizontal_align_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED)
|
||||
{
|
||||
return _FMT(halign);
|
||||
}
|
||||
|
||||
static void
|
||||
_efl_canvas_textblock_efl_text_format_vertical_align_set(Eo *obj, Efl_Canvas_Textblock_Data *o,
|
||||
_efl_canvas_textblock_efl_text_format_text_vertical_align_set(Eo *obj, Efl_Canvas_Textblock_Data *o,
|
||||
double value)
|
||||
{
|
||||
ASYNC_BLOCK;
|
||||
|
@ -16821,7 +16821,7 @@ _efl_canvas_textblock_efl_text_format_vertical_align_set(Eo *obj, Efl_Canvas_Tex
|
|||
}
|
||||
|
||||
static double
|
||||
_efl_canvas_textblock_efl_text_format_vertical_align_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED)
|
||||
_efl_canvas_textblock_efl_text_format_text_vertical_align_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED)
|
||||
{
|
||||
return o->valign;
|
||||
}
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
#ifndef _ECORE_EVAS_EXTN_ENGINE_H_
|
||||
#define _ECORE_EVAS_EXTN_ENGINE_H_
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
@ -222,3 +225,5 @@ struct _Ipc_Data_Ev_Key_Down
|
|||
unsigned int timestamp;
|
||||
Evas_Event_Flags event_flags;
|
||||
};
|
||||
|
||||
#endif /*_ECORE_EVAS_EXTN_ENGINE_H_*/
|
||||
|
|
|
@ -4100,10 +4100,10 @@ class TestEinaIterator
|
|||
Test.Assert(arr.Own);
|
||||
Test.Assert(arr.OwnContent);
|
||||
|
||||
// Will take ownership of the Iterator
|
||||
// Will copy the Iterator, owning the copy.
|
||||
Test.Assert(t.EinaIteratorIntInOwn(itr));
|
||||
|
||||
Test.Assert(!itr.Own);
|
||||
Test.Assert(itr.Own);
|
||||
Test.Assert(arr.Own);
|
||||
// Content must continue to be owned by the array
|
||||
Test.Assert(arr.OwnContent);
|
||||
|
@ -4118,12 +4118,10 @@ class TestEinaIterator
|
|||
public static void test_eina_iterator_int_out()
|
||||
{
|
||||
var t = new Dummy.TestObject();
|
||||
Eina.Iterator<int> itr;
|
||||
IEnumerable<int> itr;
|
||||
|
||||
Test.Assert(t.EinaIteratorIntOut(out itr));
|
||||
|
||||
Test.Assert(!itr.Own);
|
||||
|
||||
int idx = 0;
|
||||
foreach (int e in itr)
|
||||
{
|
||||
|
@ -4132,8 +4130,6 @@ class TestEinaIterator
|
|||
}
|
||||
Test.AssertEquals(idx, base_seq_int.Length);
|
||||
|
||||
itr.Dispose();
|
||||
|
||||
Test.Assert(t.CheckEinaIteratorIntOut());
|
||||
t.Dispose();
|
||||
}
|
||||
|
@ -4141,12 +4137,10 @@ class TestEinaIterator
|
|||
public static void test_eina_iterator_int_out_own()
|
||||
{
|
||||
var t = new Dummy.TestObject();
|
||||
Eina.Iterator<int> itr;
|
||||
IEnumerable<int> itr;
|
||||
|
||||
Test.Assert(t.EinaIteratorIntOutOwn(out itr));
|
||||
|
||||
Test.Assert(itr.Own);
|
||||
|
||||
int idx = 0;
|
||||
foreach (int e in itr)
|
||||
{
|
||||
|
@ -4155,7 +4149,6 @@ class TestEinaIterator
|
|||
}
|
||||
Test.AssertEquals(idx, base_seq_int.Length);
|
||||
|
||||
itr.Dispose();
|
||||
t.Dispose();
|
||||
}
|
||||
|
||||
|
@ -4165,8 +4158,6 @@ class TestEinaIterator
|
|||
|
||||
var itr = t.EinaIteratorIntReturn();
|
||||
|
||||
Test.Assert(!itr.Own);
|
||||
|
||||
int idx = 0;
|
||||
foreach (int e in itr)
|
||||
{
|
||||
|
@ -4175,8 +4166,6 @@ class TestEinaIterator
|
|||
}
|
||||
Test.AssertEquals(idx, base_seq_int.Length);
|
||||
|
||||
itr.Dispose();
|
||||
|
||||
Test.Assert(t.CheckEinaIteratorIntReturn());
|
||||
t.Dispose();
|
||||
}
|
||||
|
@ -4187,8 +4176,6 @@ class TestEinaIterator
|
|||
|
||||
var itr = t.EinaIteratorIntReturnOwn();
|
||||
|
||||
Test.Assert(itr.Own);
|
||||
|
||||
int idx = 0;
|
||||
foreach (int e in itr)
|
||||
{
|
||||
|
@ -4197,7 +4184,6 @@ class TestEinaIterator
|
|||
}
|
||||
Test.AssertEquals(idx, base_seq_int.Length);
|
||||
|
||||
itr.Dispose();
|
||||
t.Dispose();
|
||||
}
|
||||
|
||||
|
@ -4238,7 +4224,7 @@ class TestEinaIterator
|
|||
|
||||
Test.Assert(t.EinaIteratorStrInOwn(itr));
|
||||
|
||||
Test.Assert(!itr.Own);
|
||||
Test.Assert(itr.Own);
|
||||
Test.Assert(arr.Own);
|
||||
Test.Assert(arr.OwnContent);
|
||||
|
||||
|
@ -4252,12 +4238,10 @@ class TestEinaIterator
|
|||
public static void test_eina_iterator_str_out()
|
||||
{
|
||||
var t = new Dummy.TestObject();
|
||||
Eina.Iterator<string> itr;
|
||||
IEnumerable<string> itr;
|
||||
|
||||
Test.Assert(t.EinaIteratorStrOut(out itr));
|
||||
|
||||
Test.Assert(!itr.Own);
|
||||
|
||||
int idx = 0;
|
||||
foreach (string e in itr)
|
||||
{
|
||||
|
@ -4266,8 +4250,6 @@ class TestEinaIterator
|
|||
}
|
||||
Test.AssertEquals(idx, base_seq_str.Length);
|
||||
|
||||
itr.Dispose();
|
||||
|
||||
Test.Assert(t.CheckEinaIteratorStrOut());
|
||||
t.Dispose();
|
||||
}
|
||||
|
@ -4275,12 +4257,10 @@ class TestEinaIterator
|
|||
public static void test_eina_iterator_str_out_own()
|
||||
{
|
||||
var t = new Dummy.TestObject();
|
||||
Eina.Iterator<string> itr;
|
||||
IEnumerable<string> itr;
|
||||
|
||||
Test.Assert(t.EinaIteratorStrOutOwn(out itr));
|
||||
|
||||
Test.Assert(itr.Own);
|
||||
|
||||
int idx = 0;
|
||||
foreach (string e in itr)
|
||||
{
|
||||
|
@ -4289,7 +4269,6 @@ class TestEinaIterator
|
|||
}
|
||||
Test.AssertEquals(idx, base_seq_str.Length);
|
||||
|
||||
itr.Dispose();
|
||||
t.Dispose();
|
||||
}
|
||||
|
||||
|
@ -4299,8 +4278,6 @@ class TestEinaIterator
|
|||
|
||||
var itr = t.EinaIteratorStrReturn();
|
||||
|
||||
Test.Assert(!itr.Own);
|
||||
|
||||
int idx = 0;
|
||||
foreach (string e in itr)
|
||||
{
|
||||
|
@ -4309,8 +4286,6 @@ class TestEinaIterator
|
|||
}
|
||||
Test.AssertEquals(idx, base_seq_str.Length);
|
||||
|
||||
itr.Dispose();
|
||||
|
||||
Test.Assert(t.CheckEinaIteratorStrReturn());
|
||||
t.Dispose();
|
||||
}
|
||||
|
@ -4321,8 +4296,6 @@ class TestEinaIterator
|
|||
|
||||
var itr = t.EinaIteratorStrReturnOwn();
|
||||
|
||||
Test.Assert(itr.Own);
|
||||
|
||||
int idx = 0;
|
||||
foreach (string e in itr)
|
||||
{
|
||||
|
@ -4331,7 +4304,6 @@ class TestEinaIterator
|
|||
}
|
||||
Test.AssertEquals(idx, base_seq_str.Length);
|
||||
|
||||
itr.Dispose();
|
||||
t.Dispose();
|
||||
}
|
||||
|
||||
|
@ -4372,7 +4344,8 @@ class TestEinaIterator
|
|||
|
||||
Test.Assert(t.EinaIteratorStrshareInOwn(itr));
|
||||
|
||||
Test.Assert(!itr.Own);
|
||||
// Moving collections currently copy them, should not reflect on managed objects.
|
||||
Test.Assert(itr.Own);
|
||||
Test.Assert(arr.Own);
|
||||
Test.Assert(arr.OwnContent);
|
||||
|
||||
|
@ -4386,12 +4359,10 @@ class TestEinaIterator
|
|||
public static void test_eina_iterator_strshare_out()
|
||||
{
|
||||
var t = new Dummy.TestObject();
|
||||
Eina.Iterator<Eina.Stringshare> itr;
|
||||
IEnumerable<Eina.Stringshare> itr;
|
||||
|
||||
Test.Assert(t.EinaIteratorStrshareOut(out itr));
|
||||
|
||||
Test.Assert(!itr.Own);
|
||||
|
||||
int idx = 0;
|
||||
foreach (Eina.Stringshare e in itr)
|
||||
{
|
||||
|
@ -4400,8 +4371,6 @@ class TestEinaIterator
|
|||
}
|
||||
Test.AssertEquals(idx, base_seq_strshare.Length);
|
||||
|
||||
itr.Dispose();
|
||||
|
||||
Test.Assert(t.CheckEinaIteratorStrshareOut());
|
||||
t.Dispose();
|
||||
}
|
||||
|
@ -4409,12 +4378,10 @@ class TestEinaIterator
|
|||
public static void test_eina_iterator_strshare_out_own()
|
||||
{
|
||||
var t = new Dummy.TestObject();
|
||||
Eina.Iterator<Eina.Stringshare> itr;
|
||||
IEnumerable<Eina.Stringshare> itr;
|
||||
|
||||
Test.Assert(t.EinaIteratorStrshareOutOwn(out itr));
|
||||
|
||||
Test.Assert(itr.Own);
|
||||
|
||||
int idx = 0;
|
||||
foreach (Eina.Stringshare e in itr)
|
||||
{
|
||||
|
@ -4423,7 +4390,6 @@ class TestEinaIterator
|
|||
}
|
||||
Test.AssertEquals(idx, base_seq_strshare.Length);
|
||||
|
||||
itr.Dispose();
|
||||
t.Dispose();
|
||||
}
|
||||
|
||||
|
@ -4433,8 +4399,6 @@ class TestEinaIterator
|
|||
|
||||
var itr = t.EinaIteratorStrshareReturn();
|
||||
|
||||
Test.Assert(!itr.Own);
|
||||
|
||||
int idx = 0;
|
||||
foreach (Eina.Stringshare e in itr)
|
||||
{
|
||||
|
@ -4443,8 +4407,6 @@ class TestEinaIterator
|
|||
}
|
||||
Test.AssertEquals(idx, base_seq_strshare.Length);
|
||||
|
||||
itr.Dispose();
|
||||
|
||||
Test.Assert(t.CheckEinaIteratorStrshareReturn());
|
||||
t.Dispose();
|
||||
}
|
||||
|
@ -4455,8 +4417,6 @@ class TestEinaIterator
|
|||
|
||||
var itr = t.EinaIteratorStrshareReturnOwn();
|
||||
|
||||
Test.Assert(itr.Own);
|
||||
|
||||
int idx = 0;
|
||||
foreach (Eina.Stringshare e in itr)
|
||||
{
|
||||
|
@ -4465,7 +4425,6 @@ class TestEinaIterator
|
|||
}
|
||||
Test.AssertEquals(idx, base_seq_strshare.Length);
|
||||
|
||||
itr.Dispose();
|
||||
t.Dispose();
|
||||
}
|
||||
|
||||
|
@ -4506,7 +4465,7 @@ class TestEinaIterator
|
|||
|
||||
Test.Assert(t.EinaIteratorObjInOwn(itr));
|
||||
|
||||
Test.Assert(!itr.Own);
|
||||
Test.Assert(itr.Own);
|
||||
Test.Assert(arr.Own);
|
||||
Test.Assert(arr.OwnContent);
|
||||
|
||||
|
@ -4520,12 +4479,10 @@ class TestEinaIterator
|
|||
public static void test_eina_iterator_obj_out()
|
||||
{
|
||||
var t = new Dummy.TestObject();
|
||||
Eina.Iterator<Dummy.Numberwrapper> itr;
|
||||
IEnumerable<Dummy.Numberwrapper> itr;
|
||||
|
||||
Test.Assert(t.EinaIteratorObjOut(out itr));
|
||||
|
||||
Test.Assert(!itr.Own);
|
||||
|
||||
var base_seq_obj = BaseSeqObj();
|
||||
|
||||
int idx = 0;
|
||||
|
@ -4536,8 +4493,6 @@ class TestEinaIterator
|
|||
}
|
||||
Test.AssertEquals(idx, base_seq_obj.Length);
|
||||
|
||||
itr.Dispose();
|
||||
|
||||
Test.Assert(t.CheckEinaIteratorObjOut());
|
||||
t.Dispose();
|
||||
}
|
||||
|
@ -4545,12 +4500,10 @@ class TestEinaIterator
|
|||
public static void test_eina_iterator_obj_out_own()
|
||||
{
|
||||
var t = new Dummy.TestObject();
|
||||
Eina.Iterator<Dummy.Numberwrapper> itr;
|
||||
IEnumerable<Dummy.Numberwrapper> itr;
|
||||
|
||||
Test.Assert(t.EinaIteratorObjOutOwn(out itr));
|
||||
|
||||
Test.Assert(itr.Own);
|
||||
|
||||
var base_seq_obj = BaseSeqObj();
|
||||
|
||||
int idx = 0;
|
||||
|
@ -4561,7 +4514,6 @@ class TestEinaIterator
|
|||
}
|
||||
Test.AssertEquals(idx, base_seq_obj.Length);
|
||||
|
||||
itr.Dispose();
|
||||
t.Dispose();
|
||||
}
|
||||
|
||||
|
@ -4571,8 +4523,6 @@ class TestEinaIterator
|
|||
|
||||
var itr = t.EinaIteratorObjReturn();
|
||||
|
||||
Test.Assert(!itr.Own);
|
||||
|
||||
var base_seq_obj = BaseSeqObj();
|
||||
|
||||
int idx = 0;
|
||||
|
@ -4583,8 +4533,6 @@ class TestEinaIterator
|
|||
}
|
||||
Test.AssertEquals(idx, base_seq_obj.Length);
|
||||
|
||||
itr.Dispose();
|
||||
|
||||
Test.Assert(t.CheckEinaIteratorObjReturn());
|
||||
t.Dispose();
|
||||
}
|
||||
|
@ -4595,8 +4543,6 @@ class TestEinaIterator
|
|||
|
||||
var itr = t.EinaIteratorObjReturnOwn();
|
||||
|
||||
Test.Assert(itr.Own);
|
||||
|
||||
var base_seq_obj = BaseSeqObj();
|
||||
|
||||
int idx = 0;
|
||||
|
@ -4607,7 +4553,6 @@ class TestEinaIterator
|
|||
}
|
||||
Test.AssertEquals(idx, base_seq_obj.Length);
|
||||
|
||||
itr.Dispose();
|
||||
t.Dispose();
|
||||
}
|
||||
} // < TestEinaIterator
|
||||
|
|
|
@ -257,25 +257,47 @@ class TestVariables
|
|||
|
||||
class TestEoAccessors
|
||||
{
|
||||
public static void basic_eo_accessors()
|
||||
private static void do_eo_accessors(IEnumerable<int> accessor)
|
||||
{
|
||||
var obj = new Dummy.TestObject();
|
||||
Eina.List<int> lst = new Eina.List<int>();
|
||||
lst.Append(4);
|
||||
lst.Append(3);
|
||||
lst.Append(2);
|
||||
lst.Append(5);
|
||||
Eina.Accessor<int> acc = obj.CloneAccessor(lst.GetAccessor());
|
||||
|
||||
var zipped = acc.Zip(lst, (first, second) => new Tuple<int, int>(first, second));
|
||||
IEnumerable<int> acc = obj.CloneAccessor(accessor);
|
||||
|
||||
var zipped = acc.Zip(accessor, (first, second) => new Tuple<int, int>(first, second));
|
||||
|
||||
foreach (Tuple<int, int> pair in zipped)
|
||||
{
|
||||
Test.AssertEquals(pair.Item1, pair.Item2);
|
||||
}
|
||||
lst.Dispose();
|
||||
obj.Dispose();
|
||||
}
|
||||
|
||||
public static void eina_eo_accessors()
|
||||
{
|
||||
Eina.List<int> lst = new Eina.List<int>();
|
||||
lst.Append(4);
|
||||
lst.Append(3);
|
||||
lst.Append(2);
|
||||
lst.Append(5);
|
||||
|
||||
// FIXME: Replace the first accessor with the list once Eina.List implements Eina.IList
|
||||
do_eo_accessors(lst.GetAccessor());
|
||||
|
||||
lst.Dispose();
|
||||
}
|
||||
|
||||
public static void managed_eo_accessors()
|
||||
{
|
||||
var obj = new Dummy.TestObject();
|
||||
|
||||
List<int> lst = new List<int>();
|
||||
lst.Add(-1);
|
||||
lst.Add(1);
|
||||
lst.Add(4);
|
||||
lst.Add(42);
|
||||
|
||||
do_eo_accessors(lst);
|
||||
}
|
||||
}
|
||||
|
||||
class TestEoFinalize
|
||||
|
|
Loading…
Reference in New Issue