forked from enlightenment/efl
Merge branch 'master' into devs/hermet/lottie
This commit is contained in:
commit
7bd9f4319e
|
@ -95,7 +95,6 @@ example_preparation = {
|
|||
"eina_file_02" : prep_eina_file_02,
|
||||
"eina_xattr_01" : prep_eina_xattr_01,
|
||||
"eina_xattr_02" : prep_eina_xattr_02,
|
||||
"eet-data-simple" : prep_eet_data_simple,
|
||||
"eet-data-nested" : prep_eet_data_nested,
|
||||
"eet-data-simple" : prep_eet_data_simple,
|
||||
"eet-data-file_descriptor_01" : prep_eet_data_file_descriptor_01,
|
||||
|
|
|
@ -20,6 +20,7 @@ using System.Runtime.InteropServices;
|
|||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Diagnostics.Contracts;
|
||||
|
||||
using static Eina.TraitFunctions;
|
||||
using static Eina.ArrayNativeFunctions;
|
||||
|
@ -468,6 +469,7 @@ public class Array<T> : IList<T>, IEnumerable<T>, IDisposable
|
|||
/// </summary>
|
||||
public bool Append(T[] values)
|
||||
{
|
||||
Contract.Requires(values != null, nameof(values));
|
||||
foreach (T v in values)
|
||||
{
|
||||
if (!Push(v))
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics.Contracts;
|
||||
|
||||
namespace Eina
|
||||
{
|
||||
|
@ -214,6 +215,7 @@ public class Binbuf : IDisposable
|
|||
/// <returns>true on success, false if data could not be appended.</returns>
|
||||
public bool Append(byte[] str)
|
||||
{
|
||||
Contract.Requires(str != null, nameof(str));
|
||||
return 0 != eina_binbuf_append_length(Handle, str, (UIntPtr)(str.Length));
|
||||
}
|
||||
|
||||
|
@ -238,6 +240,7 @@ public class Binbuf : IDisposable
|
|||
/// <returns>true on success, false if data could not be appended.</returns>
|
||||
public bool Append(Binbuf bb)
|
||||
{
|
||||
Contract.Requires(bb != null, nameof(bb));
|
||||
return 0 != eina_binbuf_append_buffer(Handle, bb.Handle);
|
||||
}
|
||||
|
||||
|
@ -273,6 +276,7 @@ public class Binbuf : IDisposable
|
|||
/// <returns>true on success, false if data could not be appended.</returns>
|
||||
public bool Insert(byte[] str, uint pos)
|
||||
{
|
||||
Contract.Requires(str != null, nameof(str));
|
||||
return 0 != eina_binbuf_insert_length(Handle, str, (UIntPtr)(str.Length), (UIntPtr)pos);
|
||||
}
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ using System.Runtime.InteropServices;
|
|||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Diagnostics.Contracts;
|
||||
|
||||
using static Eina.TraitFunctions;
|
||||
using static Eina.InarrayNativeFunctions;
|
||||
|
@ -485,6 +486,7 @@ public class Inarray<T> : IEnumerable<T>, IDisposable
|
|||
/// <returns>true on success, false otherwise.</returns>
|
||||
public bool Append(T[] values)
|
||||
{
|
||||
Contract.Requires(values != null, nameof(values));
|
||||
foreach (T v in values)
|
||||
{
|
||||
if (Push(v) == -1)
|
||||
|
|
|
@ -20,6 +20,7 @@ using System.Runtime.InteropServices;
|
|||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Diagnostics.Contracts;
|
||||
|
||||
using static Eina.TraitFunctions;
|
||||
using static Eina.InlistNativeFunctions;
|
||||
|
@ -422,6 +423,7 @@ public class Inlist<T> : IEnumerable<T>, IDisposable
|
|||
/// <param name="values">The values to be added.</param>
|
||||
public void AppendArray(T[] values)
|
||||
{
|
||||
Contract.Requires(values != null, nameof(values));
|
||||
foreach (T v in values)
|
||||
{
|
||||
Append(v);
|
||||
|
|
|
@ -20,6 +20,7 @@ using System.Runtime.InteropServices;
|
|||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Diagnostics.Contracts;
|
||||
|
||||
using static Eina.TraitFunctions;
|
||||
using static Eina.ListNativeFunctions;
|
||||
|
@ -533,6 +534,7 @@ public class List<T> : IList<T>, IEnumerable<T>, IDisposable
|
|||
/// <param name="values">The values to be appended.</param>
|
||||
public void Append(T[] values)
|
||||
{
|
||||
Contract.Requires(values != null, nameof(values));
|
||||
RequireWritable();
|
||||
|
||||
foreach (T v in values)
|
||||
|
|
|
@ -18,7 +18,7 @@ using System.Runtime.InteropServices;
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.ComponentModel;
|
||||
|
||||
using System.Diagnostics.Contracts;
|
||||
|
||||
using static Eina.EinaNative.PromiseNativeMethods;
|
||||
|
||||
|
@ -207,6 +207,7 @@ public class Promise : IDisposable
|
|||
/// </summary>
|
||||
public void Resolve(Eina.Value value)
|
||||
{
|
||||
Contract.Requires(value != null, nameof(value));
|
||||
SanityChecks();
|
||||
eina_promise_resolve(this.Handle, value);
|
||||
// Promise will take care of releasing this value correctly.
|
||||
|
@ -280,6 +281,7 @@ public class Future
|
|||
/// <param name="cb">The callback to be called when the attached promise resolves.</param>
|
||||
public Future(Promise promise, ResolvedCb cb = null)
|
||||
{
|
||||
Contract.Requires(promise != null, nameof(promise));
|
||||
IntPtr intermediate = eina_future_new(promise.Handle);
|
||||
Handle = ThenRaw(intermediate, (Eina.Value value) =>
|
||||
{
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics.Contracts;
|
||||
|
||||
namespace Eina
|
||||
{
|
||||
|
@ -235,6 +236,7 @@ public static class Eina_SliceUtils
|
|||
{
|
||||
public static byte[] GetBytes(this Eina.ISliceBase slc)
|
||||
{
|
||||
Contract.Requires(slc != null, nameof(slc));
|
||||
var size = (int)(slc.Len);
|
||||
byte[] mArray = new byte[size];
|
||||
Marshal.Copy(slc.Mem, mArray, 0, size);
|
||||
|
|
|
@ -27,6 +27,7 @@ using System.Security;
|
|||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Globalization;
|
||||
using System.Diagnostics.Contracts;
|
||||
|
||||
using static Eina.EinaNative.UnsafeNativeMethods;
|
||||
using static Eina.TraitFunctions;
|
||||
|
@ -1268,8 +1269,10 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
|
|||
/// <para>Since EFL 1.23.</para>
|
||||
/// </summary>
|
||||
/// <param name="obj">The object to be wrapped.</param>
|
||||
[SuppressMessage("Microsoft.Design", "CA1062:ValidateArgumentsOfPublicMethods", Justification="Could not remove warning!")]
|
||||
public Value(object obj) : this()
|
||||
{
|
||||
Contract.Requires(obj != null, nameof(obj));
|
||||
var objType = obj.GetType();
|
||||
|
||||
if (objType == typeof(sbyte))
|
||||
|
@ -1424,6 +1427,7 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
|
|||
/// <param name="v">The value to be copied.</param>
|
||||
public Value(Value v)
|
||||
{
|
||||
Contract.Requires(v != null, nameof(v));
|
||||
Handle = Alloc();
|
||||
if (!eina_value_copy(v.Handle, this.Handle))
|
||||
{
|
||||
|
@ -1615,7 +1619,11 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
|
|||
public static implicit operator ValueNative(Value v) => ToValueNative(v);
|
||||
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public static ValueNative ToValueNative(Value v) => v.GetNative();
|
||||
public static ValueNative ToValueNative(Value v)
|
||||
{
|
||||
Contract.Requires(v != null, nameof(v));
|
||||
return v.GetNative();
|
||||
}
|
||||
|
||||
/// <summary>Implicit conversion from native struct representation to managed wrapper.
|
||||
/// <para>Since EFL 1.23.</para>
|
||||
|
@ -1655,6 +1663,7 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
|
|||
/// <param name="v">The <see cref="Value" /> to be converted.</param>
|
||||
public static byte ToByte(Value v)
|
||||
{
|
||||
Contract.Requires(v != null, nameof(v));
|
||||
byte b;
|
||||
v.Get(out b);
|
||||
|
||||
|
@ -1691,6 +1700,7 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
|
|||
/// <param name="v">The <see cref="Value" /> to be converted.</param>
|
||||
public static sbyte ToSByte(Value v)
|
||||
{
|
||||
Contract.Requires(v != null, nameof(v));
|
||||
sbyte b;
|
||||
v.Get(out b);
|
||||
|
||||
|
@ -1727,6 +1737,7 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
|
|||
/// <param name="v">The <see cref="Value" /> to be converted.</param>
|
||||
public static short ToInt16(Value v)
|
||||
{
|
||||
Contract.Requires(v != null, nameof(v));
|
||||
short b;
|
||||
v.Get(out b);
|
||||
|
||||
|
@ -1763,6 +1774,7 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
|
|||
/// <param name="v">The <see cref="Value" /> to be converted.</param>
|
||||
public static ushort ToUInt16(Value v)
|
||||
{
|
||||
Contract.Requires(v != null, nameof(v));
|
||||
ushort b;
|
||||
v.Get(out b);
|
||||
|
||||
|
@ -1800,6 +1812,7 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
|
|||
/// <param name="v">The <see cref="Value" /> to be converted.</param>
|
||||
public static int ToInt32(Value v)
|
||||
{
|
||||
Contract.Requires(v != null, nameof(v));
|
||||
int b;
|
||||
v.Get(out b);
|
||||
|
||||
|
@ -1836,6 +1849,7 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
|
|||
/// <param name="v">The <see cref="Value" /> to be converted.</param>
|
||||
public static uint ToUInt32(Value v)
|
||||
{
|
||||
Contract.Requires(v != null, nameof(v));
|
||||
uint b;
|
||||
v.Get(out b);
|
||||
|
||||
|
@ -1872,6 +1886,7 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
|
|||
/// <param name="v">The <see cref="Value" /> to be converted.</param>
|
||||
public static long ToInt64(Value v)
|
||||
{
|
||||
Contract.Requires(v != null, nameof(v));
|
||||
long b;
|
||||
v.Get(out b);
|
||||
|
||||
|
@ -1908,6 +1923,7 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
|
|||
/// <param name="v">The <see cref="Value" /> to be converted.</param>
|
||||
public static ulong ToUInt64(Value v)
|
||||
{
|
||||
Contract.Requires(v != null, nameof(v));
|
||||
ulong b;
|
||||
v.Get(out b);
|
||||
|
||||
|
@ -1944,6 +1960,7 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
|
|||
/// <param name="v">The <see cref="Value" /> to be converted.</param>
|
||||
public static float ToSingle(Value v)
|
||||
{
|
||||
Contract.Requires(v != null, nameof(v));
|
||||
float b;
|
||||
v.Get(out b);
|
||||
|
||||
|
@ -1980,6 +1997,7 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
|
|||
/// <param name="v">The <see cref="Value" /> to be converted.</param>
|
||||
public static double ToDouble(Value v)
|
||||
{
|
||||
Contract.Requires(v != null, nameof(v));
|
||||
double b;
|
||||
v.Get(out b);
|
||||
|
||||
|
@ -2016,6 +2034,7 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
|
|||
/// <param name="v">The <see cref="Value" /> to be converted.</param>
|
||||
public static string ToString(Value v)
|
||||
{
|
||||
Contract.Requires(v != null, nameof(v));
|
||||
string b;
|
||||
v.Get(out b);
|
||||
|
||||
|
@ -2171,6 +2190,7 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
|
|||
/// <param name="v">The <see cref="Value" /> to be converted.</param>
|
||||
public static Efl.Object ToObject(Value v)
|
||||
{
|
||||
Contract.Requires(v != null, nameof(v));
|
||||
Efl.Object obj;
|
||||
v.Get(out obj);
|
||||
|
||||
|
@ -2714,6 +2734,7 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
|
|||
/// <returns><c>true</c> if the value was successfully stored.</returns>
|
||||
public bool Set(Efl.Object value)
|
||||
{
|
||||
Contract.Requires(value != null, nameof(value));
|
||||
SanityChecks();
|
||||
|
||||
if (this.Optional)
|
||||
|
@ -2735,6 +2756,7 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
|
|||
/// <returns><c>true</c> if the value was successfully stored.</returns>
|
||||
public bool Set(Value value)
|
||||
{
|
||||
Contract.Requires(value != null, nameof(value));
|
||||
OptionalSanityChecks();
|
||||
ValueType subtype = value.GetValueType();
|
||||
|
||||
|
@ -3321,6 +3343,7 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
|
|||
/// <returns><c>true</c> if the value was successfully appended.</returns>
|
||||
public bool Append(object o)
|
||||
{
|
||||
Contract.Requires(o != null, nameof(o));
|
||||
ContainerSanityChecks();
|
||||
|
||||
switch (GetValueSubType())
|
||||
|
@ -3508,6 +3531,7 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
|
|||
}
|
||||
set
|
||||
{
|
||||
Contract.Requires(value != null, nameof(value));
|
||||
ContainerSanityChecks(i);
|
||||
|
||||
switch (GetValueSubType())
|
||||
|
@ -3650,6 +3674,7 @@ public class ValueMarshaler : ICustomMarshaler
|
|||
/// keeping the managed ownership.</summary>
|
||||
public IntPtr MarshalManagedToNative(object managedObj)
|
||||
{
|
||||
Contract.Requires(managedObj != null, nameof(managedObj));
|
||||
try
|
||||
{
|
||||
Value v = (Value)managedObj;
|
||||
|
@ -3703,6 +3728,7 @@ public class ValueMarshalerOwn : ICustomMarshaler
|
|||
/// when not needed. </summary>
|
||||
public IntPtr MarshalManagedToNative(object managedObj)
|
||||
{
|
||||
Contract.Requires(managedObj != null, nameof(managedObj));
|
||||
try
|
||||
{
|
||||
Value v = (Value)managedObj;
|
||||
|
|
|
@ -19,6 +19,7 @@ using System;
|
|||
using System.Runtime.InteropServices;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Diagnostics.Contracts;
|
||||
|
||||
using static eldbus.EldbusMessageNativeFunctions;
|
||||
|
||||
|
@ -948,12 +949,14 @@ public class ByteMessageArgument : BasicMessageArgument
|
|||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
protected override bool InternalAppendTo(eldbus.Message msg)
|
||||
{
|
||||
Contract.Requires(msg != null, nameof(msg));
|
||||
return eldbus_message_arguments_append(msg.Handle, Signature, value);
|
||||
}
|
||||
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
protected override bool InternalAppendTo(eldbus.MessageIterator iter)
|
||||
{
|
||||
Contract.Requires(iter != null, nameof(iter));
|
||||
return eldbus_message_iter_basic_append(iter.Handle, TypeCode, value);
|
||||
}
|
||||
}
|
||||
|
@ -997,12 +1000,14 @@ public class BoolMessageArgument : BasicMessageArgument
|
|||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
protected override bool InternalAppendTo(eldbus.Message msg)
|
||||
{
|
||||
Contract.Requires(msg != null, nameof(msg));
|
||||
return eldbus_message_arguments_append(msg.Handle, Signature, value);
|
||||
}
|
||||
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
protected override bool InternalAppendTo(eldbus.MessageIterator iter)
|
||||
{
|
||||
Contract.Requires(iter != null, nameof(iter));
|
||||
return eldbus_message_iter_basic_append(iter.Handle, TypeCode, value);
|
||||
}
|
||||
}
|
||||
|
@ -1046,12 +1051,14 @@ public class Int16MessageArgument : BasicMessageArgument
|
|||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
protected override bool InternalAppendTo(eldbus.Message msg)
|
||||
{
|
||||
Contract.Requires(msg != null, nameof(msg));
|
||||
return eldbus_message_arguments_append(msg.Handle, Signature, value);
|
||||
}
|
||||
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
protected override bool InternalAppendTo(eldbus.MessageIterator iter)
|
||||
{
|
||||
Contract.Requires(iter != null, nameof(iter));
|
||||
return eldbus_message_iter_basic_append(iter.Handle, TypeCode, value);
|
||||
}
|
||||
}
|
||||
|
@ -1095,12 +1102,14 @@ public class UInt16MessageArgument : BasicMessageArgument
|
|||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
protected override bool InternalAppendTo(eldbus.Message msg)
|
||||
{
|
||||
Contract.Requires(msg != null, nameof(msg));
|
||||
return eldbus_message_arguments_append(msg.Handle, Signature, value);
|
||||
}
|
||||
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
protected override bool InternalAppendTo(eldbus.MessageIterator iter)
|
||||
{
|
||||
Contract.Requires(iter != null, nameof(iter));
|
||||
return eldbus_message_iter_basic_append(iter.Handle, TypeCode, value);
|
||||
}
|
||||
}
|
||||
|
@ -1144,12 +1153,14 @@ public class Int32MessageArgument : BasicMessageArgument
|
|||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
protected override bool InternalAppendTo(eldbus.Message msg)
|
||||
{
|
||||
Contract.Requires(msg != null, nameof(msg));
|
||||
return eldbus_message_arguments_append(msg.Handle, Signature, value);
|
||||
}
|
||||
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
protected override bool InternalAppendTo(eldbus.MessageIterator iter)
|
||||
{
|
||||
Contract.Requires(iter != null, nameof(iter));
|
||||
return eldbus_message_iter_basic_append(iter.Handle, TypeCode, value);
|
||||
}
|
||||
}
|
||||
|
@ -1193,12 +1204,14 @@ public class UInt32MessageArgument : BasicMessageArgument
|
|||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
protected override bool InternalAppendTo(eldbus.Message msg)
|
||||
{
|
||||
Contract.Requires(msg != null, nameof(msg));
|
||||
return eldbus_message_arguments_append(msg.Handle, Signature, value);
|
||||
}
|
||||
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
protected override bool InternalAppendTo(eldbus.MessageIterator iter)
|
||||
{
|
||||
Contract.Requires(iter != null, nameof(iter));
|
||||
return eldbus_message_iter_basic_append(iter.Handle, TypeCode, value);
|
||||
}
|
||||
}
|
||||
|
@ -1242,12 +1255,14 @@ public class Int64MessageArgument : BasicMessageArgument
|
|||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
protected override bool InternalAppendTo(eldbus.Message msg)
|
||||
{
|
||||
Contract.Requires(msg != null, nameof(msg));
|
||||
return eldbus_message_arguments_append(msg.Handle, Signature, value);
|
||||
}
|
||||
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
protected override bool InternalAppendTo(eldbus.MessageIterator iter)
|
||||
{
|
||||
Contract.Requires(iter != null, nameof(iter));
|
||||
return eldbus_message_iter_basic_append(iter.Handle, TypeCode, value);
|
||||
}
|
||||
}
|
||||
|
@ -1291,12 +1306,14 @@ public class UInt64MessageArgument : BasicMessageArgument
|
|||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
protected override bool InternalAppendTo(eldbus.Message msg)
|
||||
{
|
||||
Contract.Requires(msg != null, nameof(msg));
|
||||
return eldbus_message_arguments_append(msg.Handle, Signature, value);
|
||||
}
|
||||
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
protected override bool InternalAppendTo(eldbus.MessageIterator iter)
|
||||
{
|
||||
Contract.Requires(iter != null, nameof(iter));
|
||||
return eldbus_message_iter_basic_append(iter.Handle, TypeCode, value);
|
||||
}
|
||||
}
|
||||
|
@ -1340,12 +1357,14 @@ public class DoubleMessageArgument : BasicMessageArgument
|
|||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
protected override bool InternalAppendTo(eldbus.Message msg)
|
||||
{
|
||||
Contract.Requires(msg != null, nameof(msg));
|
||||
return eldbus_message_arguments_append(msg.Handle, Signature, value);
|
||||
}
|
||||
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
protected override bool InternalAppendTo(eldbus.MessageIterator iter)
|
||||
{
|
||||
Contract.Requires(iter != null, nameof(iter));
|
||||
return eldbus_message_iter_basic_append(iter.Handle, TypeCode, value);
|
||||
}
|
||||
}
|
||||
|
@ -1371,12 +1390,14 @@ public abstract class StringLikeMessageArgument : BasicMessageArgument
|
|||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
protected override bool InternalAppendTo(eldbus.Message msg)
|
||||
{
|
||||
Contract.Requires(msg != null, nameof(msg));
|
||||
return eldbus_message_arguments_append(msg.Handle, Signature, value);
|
||||
}
|
||||
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
protected override bool InternalAppendTo(eldbus.MessageIterator iter)
|
||||
{
|
||||
Contract.Requires(iter != null, nameof(iter));
|
||||
return eldbus_message_iter_basic_append(iter.Handle, TypeCode, value);
|
||||
}
|
||||
}
|
||||
|
@ -1522,12 +1543,14 @@ public class UnixFdMessageArgument : BasicMessageArgument
|
|||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
protected override bool InternalAppendTo(eldbus.Message msg)
|
||||
{
|
||||
Contract.Requires(msg != null, nameof(msg));
|
||||
return eldbus_message_arguments_append(msg.Handle, Signature, value);
|
||||
}
|
||||
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
protected override bool InternalAppendTo(eldbus.MessageIterator iter)
|
||||
{
|
||||
Contract.Requires(iter != null, nameof(iter));
|
||||
return eldbus_message_iter_basic_append(iter.Handle, TypeCode, value);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics.Contracts;
|
||||
|
||||
using static eldbus.EldbusMessageNativeFunctions;
|
||||
|
||||
|
@ -773,6 +774,7 @@ public class MessageIterator
|
|||
/// <returns>A <see cref="eldbus.MessageIterator" />.</returns>
|
||||
public eldbus.MessageIterator AppendOpenContainer(string signature)
|
||||
{
|
||||
Contract.Requires(signature != null, nameof(signature));
|
||||
CheckHandle();
|
||||
|
||||
IntPtr new_iter = IntPtr.Zero;
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics.Contracts;
|
||||
|
||||
using static eldbus.EldbusProxyNativeFunctions;
|
||||
|
||||
|
@ -123,6 +124,7 @@ public class Proxy : IDisposable
|
|||
/// <param name="_interface">The interface name.</param>
|
||||
public Proxy(eldbus.Object obj, string _interface)
|
||||
{
|
||||
Contract.Requires(obj != null, nameof(obj));
|
||||
InitNew(eldbus_proxy_get(obj.Handle, _interface), true);
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ win.setText("Bg Plain");
|
|||
win.setAutohide(true);
|
||||
|
||||
bg = new efl.Elm.Bg(win);
|
||||
bg.setColor(255, 0,0,255)
|
||||
bg.setColor(255, 0,0,255);
|
||||
bg.setHintWeight(1.0, 1.0);
|
||||
win.setContent(bg);
|
||||
bg.setVisible(true);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
efl = require('efl');
|
||||
|
||||
function setIcon(widget, icon) {
|
||||
container = widget.part("icon").cast("Efl.Content");
|
||||
var container = widget.part("icon").cast("Efl.Content");
|
||||
container.setContent(icon);
|
||||
}
|
||||
|
||||
|
@ -144,7 +144,7 @@ up.setHintWeight(1.0, 0.0);
|
|||
up.setHintAlign(-1.0, 0.0);
|
||||
box.packEnd(up);
|
||||
up.setVisible(true);
|
||||
up.on('repeated', _btn_cursors_move)
|
||||
up.on('repeated', _btn_cursors_move);
|
||||
up.on('unpressed', _btn_cursors_release);
|
||||
icon_up = new efl.Efl.Ui.Image(win);
|
||||
icon_up.setIcon("arrow_up");
|
||||
|
@ -164,7 +164,7 @@ left.setHintWeight(0.0, 1.0);
|
|||
left.setHintAlign(0.0, -1.0);
|
||||
box_inferior.packEnd(left);
|
||||
left.setVisible(true);
|
||||
left.on('repeated', _btn_cursors_move)
|
||||
left.on('repeated', _btn_cursors_move);
|
||||
left.on('unpressed', _btn_cursors_release);
|
||||
|
||||
icon_left = new efl.Efl.Ui.Image(win);
|
||||
|
|
|
@ -91,13 +91,13 @@ sl.setVisible(true);
|
|||
|
||||
sl.on('changed', function(obj)
|
||||
{
|
||||
val = obj.getProgressValue();
|
||||
var val = obj.getProgressValue();
|
||||
console.log("Changed to " + val);
|
||||
});
|
||||
|
||||
sl.on('delay_changed', function(obj)
|
||||
{
|
||||
val = obj.getProgressValue();
|
||||
var val = obj.getProgressValue();
|
||||
console.log("Delay changed to " + val);
|
||||
});
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ fs = require('fs');
|
|||
request = require('request');
|
||||
Twitter = require('twitter');
|
||||
|
||||
user_acount = 'EnlightenmentKo'
|
||||
user_acount = 'EnlightenmentKo';
|
||||
|
||||
var twit = new Twitter({
|
||||
consumer_key: '', // replace with consumer_key
|
||||
|
@ -43,7 +43,7 @@ twit.get('statuses/user_timeline', {screen_name: user_acount, count:10}, functio
|
|||
if (error)
|
||||
return;
|
||||
|
||||
for(i=0; i < tweets.length; i++){
|
||||
for(var i=0; i < tweets.length; i++){
|
||||
var user_name = tweets[i].user.name;
|
||||
var screen_name = tweets[i].user.screen_name;
|
||||
var text = tweets[i].text;
|
||||
|
@ -52,13 +52,13 @@ twit.get('statuses/user_timeline', {screen_name: user_acount, count:10}, functio
|
|||
var filename = path.join(__dirname, 'twitter_example_01.edj');
|
||||
layout.setFile(filename, "tweet");
|
||||
|
||||
layout.setPartText("user_name", screen_name);
|
||||
layout.setPartText("user_name", user_name);
|
||||
layout.setPartText("screen_name", " - @"+screen_name);
|
||||
|
||||
var entry = new efl.Elm.Entry(win);
|
||||
entry.setPartText("elm.text", text);
|
||||
entry.setEditable(false);
|
||||
part = layout.part("tweet_text").cast("Efl.Content");
|
||||
var part = layout.part("tweet_text").cast("Efl.Content");
|
||||
part.setContent(entry);
|
||||
|
||||
layout.setHintMin(127, 96);
|
||||
|
@ -68,7 +68,7 @@ twit.get('statuses/user_timeline', {screen_name: user_acount, count:10}, functio
|
|||
var icon = new efl.Efl.Ui.Image(win);
|
||||
icon.fillInside = true;
|
||||
icon_array.push(icon);
|
||||
user_icon = layout.part("user_icon").cast("Efl.Content");
|
||||
var user_icon = layout.part("user_icon").cast("Efl.Content");
|
||||
user_icon.setContent(icon);
|
||||
item = tweet_box.packEnd(layout);
|
||||
layout.setVisible(true);
|
||||
|
@ -78,7 +78,7 @@ twit.get('statuses/user_timeline', {screen_name: user_acount, count:10}, functio
|
|||
var file = fs.createWriteStream(icon_filename);
|
||||
file.on('finish', function() {
|
||||
console.log("finished loading the icon file.");
|
||||
for (i=0; i < icon_array.length; i++) {
|
||||
for (var i=0; i < icon_array.length; i++) {
|
||||
icon_array[i].setFile(icon_filename, null);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -149,7 +149,7 @@ _efl_canvas_layout_part_text_efl_text_format_ellipsis_get(const Eo *obj,
|
|||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_canvas_layout_part_text_efl_text_font_font_family_set(Eo *obj,
|
||||
_efl_canvas_layout_part_text_efl_text_font_properties_font_family_set(Eo *obj,
|
||||
void *_pd EINA_UNUSED, const char *font)
|
||||
{
|
||||
Edje_User_Defined *eud;
|
||||
|
@ -165,7 +165,7 @@ _efl_canvas_layout_part_text_efl_text_font_font_family_set(Eo *obj,
|
|||
}
|
||||
|
||||
EOLIAN static const char *
|
||||
_efl_canvas_layout_part_text_efl_text_font_font_family_get(const Eo *obj,
|
||||
_efl_canvas_layout_part_text_efl_text_font_properties_font_family_get(const Eo *obj,
|
||||
void *_pd EINA_UNUSED)
|
||||
{
|
||||
PROXY_DATA_GET(obj, pd);
|
||||
|
@ -175,7 +175,7 @@ _efl_canvas_layout_part_text_efl_text_font_font_family_get(const Eo *obj,
|
|||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_canvas_layout_part_text_efl_text_font_font_size_set(Eo *obj,
|
||||
_efl_canvas_layout_part_text_efl_text_font_properties_font_size_set(Eo *obj,
|
||||
void *_pd EINA_UNUSED, Efl_Font_Size size)
|
||||
{
|
||||
Edje_User_Defined *eud;
|
||||
|
@ -191,7 +191,7 @@ _efl_canvas_layout_part_text_efl_text_font_font_size_set(Eo *obj,
|
|||
}
|
||||
|
||||
EOLIAN static Efl_Font_Size
|
||||
_efl_canvas_layout_part_text_efl_text_font_font_size_get(const Eo *obj,
|
||||
_efl_canvas_layout_part_text_efl_text_font_properties_font_size_get(const Eo *obj,
|
||||
void *_pd EINA_UNUSED)
|
||||
{
|
||||
PROXY_DATA_GET(obj, pd);
|
||||
|
|
|
@ -11,7 +11,7 @@ enum @beta Efl.Canvas.Layout_Part_Text_Expand
|
|||
}
|
||||
|
||||
class @beta Efl.Canvas.Layout_Part_Text extends Efl.Canvas.Layout_Part implements Efl.Text,
|
||||
Efl.Text_Markup, Efl.Text_Format, Efl.Text_Font, Efl.Text_Style
|
||||
Efl.Text_Markup, Efl.Text_Format, Efl.Text.Font.Properties, Efl.Text_Style
|
||||
{
|
||||
[[Represents a TEXT part of a layout
|
||||
|
||||
|
@ -38,8 +38,8 @@ Efl.Text_Markup, Efl.Text_Format, Efl.Text_Font, Efl.Text_Style
|
|||
Efl.Text_Markup.markup { get; set; }
|
||||
Efl.Text_Format.ellipsis { set; get; }
|
||||
Efl.Text_Format.wrap { set; get; }
|
||||
Efl.Text_Font.font_family { set; get; }
|
||||
Efl.Text_Font.font_size { set; get; }
|
||||
Efl.Text.Font.Properties.font_family { set; get; }
|
||||
Efl.Text.Font.Properties.font_size { set; get; }
|
||||
Efl.Text_Style.text_color { set; get; }
|
||||
Efl.Text_Style.text_background_type { set; get; }
|
||||
Efl.Text_Style.text_background_color { set; get;}
|
||||
|
|
|
@ -207,7 +207,7 @@ typedef Efl_Gfx_Path_Command_Type Efl_Gfx_Path_Command;
|
|||
#include "interfaces/efl_io_queue.eo.h"
|
||||
|
||||
/* Text interfaces */
|
||||
#include "interfaces/efl_text_font.eo.h"
|
||||
#include "interfaces/efl_text_font_properties.eo.h"
|
||||
#include "interfaces/efl_text_style.eo.h"
|
||||
#include "interfaces/efl_text_format.eo.h"
|
||||
#include "interfaces/efl_text_markup.eo.h"
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include "interfaces/efl_player.eo.c"
|
||||
#include "interfaces/efl_audio_control.eo.c"
|
||||
#include "interfaces/efl_text.eo.c"
|
||||
#include "interfaces/efl_text_font.eo.c"
|
||||
#include "interfaces/efl_text_font_properties.eo.c"
|
||||
#include "interfaces/efl_text_style.eo.c"
|
||||
#include "interfaces/efl_text_format.eo.c"
|
||||
#include "interfaces/efl_text_markup.eo.c"
|
||||
|
|
|
@ -46,7 +46,7 @@ enum @beta Efl.Text_Font_Bitmap_Scalable {
|
|||
color = (1 << 0), [[Enable scalable feature for color bitmap fonts.]]
|
||||
}
|
||||
|
||||
interface @beta Efl.Text_Font {
|
||||
interface @beta Efl.Text.Font.Properties {
|
||||
[[Font settings for text.
|
||||
]]
|
||||
c_prefix: efl_text;
|
|
@ -77,7 +77,7 @@ interface @beta Efl.Text_Format {
|
|||
}
|
||||
}
|
||||
|
||||
@property linegap {
|
||||
@property line_gap {
|
||||
[[Minimal line gap (top and bottom) for each line in the text.
|
||||
|
||||
$value is absolute size.
|
||||
|
@ -88,7 +88,7 @@ interface @beta Efl.Text_Format {
|
|||
}
|
||||
}
|
||||
|
||||
@property linerelgap {
|
||||
@property line_rel_gap {
|
||||
[[Relative line gap (top and bottom) for each line in the text.
|
||||
|
||||
The original line gap value is multiplied by $value.
|
||||
|
@ -99,7 +99,7 @@ interface @beta Efl.Text_Format {
|
|||
}
|
||||
}
|
||||
|
||||
@property tabstops {
|
||||
@property tab_stops {
|
||||
[[Size of the tab character.]]
|
||||
values
|
||||
{
|
||||
|
|
|
@ -40,7 +40,7 @@ pub_eo_files = [
|
|||
'efl_player.eo',
|
||||
'efl_audio_control.eo',
|
||||
'efl_text.eo',
|
||||
'efl_text_font.eo',
|
||||
'efl_text_font_properties.eo',
|
||||
'efl_text_style.eo',
|
||||
'efl_text_format.eo',
|
||||
'efl_text_markup.eo',
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import efl_text_types;
|
||||
|
||||
interface @beta Efl.Text_Interactive extends Efl.Text, Efl.Text_Font,
|
||||
interface @beta Efl.Text_Interactive extends Efl.Text, Efl.Text.Font.Properties,
|
||||
Efl.Text_Format, Efl.Text_Style
|
||||
{
|
||||
[[Interface for interactive (editable) text inputs (text entries).
|
||||
|
|
|
@ -147,6 +147,8 @@ _efl_ui_item_efl_object_destructor(Eo *obj, Efl_Ui_Item_Data *pd EINA_UNUSED)
|
|||
EOLIAN static int
|
||||
_efl_ui_item_index_get(const Eo *obj, Efl_Ui_Item_Data *pd)
|
||||
{
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(pd->container, -1);
|
||||
EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(pd->container, EFL_PACK_LINEAR_INTERFACE), -1);
|
||||
return efl_pack_index_get(pd->container, obj);
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,11 @@ abstract Efl.Ui.Item extends Efl.Ui.Layout_Base implements Efl.Ui.Selectable, Ef
|
|||
@property index {
|
||||
[[The index of this item inside its container.
|
||||
|
||||
The container must be set through the @Efl.Ui.Item.container property.]]
|
||||
The container must be set through the @Efl.Ui.Item.container property and be exposing an @Efl.Pack_Linear interface.
|
||||
If the container is not an @Efl.Pack_Linear, -1 will be returned.
|
||||
|
||||
Finally, it is a very slow API that must not be used in any performance constrained case.
|
||||
]]
|
||||
get {}
|
||||
values {
|
||||
index : int; [[The index where to find this item in its @.container.]]
|
||||
|
|
|
@ -1679,7 +1679,7 @@ EINA_DEPRECATED EAPI void elm_win_name_set(Evas_Object *obj, const char *name);
|
|||
* @param[in] start_angle Start angle of the circle
|
||||
* @param[in] direction Textpath direction
|
||||
*
|
||||
* @deprecated Use elm_textpath_circluar_set() instead.
|
||||
* @deprecated Use elm_textpath_circular_set() instead.
|
||||
*
|
||||
* @ingroup Elm_Textpath_Group
|
||||
*/
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import efl_text_types;
|
||||
|
||||
class @beta Efl.Canvas.Textblock extends Efl.Canvas.Object implements Efl.Text,
|
||||
Efl.Canvas.Filter.Internal, Efl.Text_Font,
|
||||
Efl.Canvas.Filter.Internal, Efl.Text.Font.Properties,
|
||||
Efl.Text_Style, Efl.Text_Format,
|
||||
Efl.Text_Markup, Efl.Ui.I18n
|
||||
{
|
||||
|
@ -9,7 +9,7 @@ class @beta Efl.Canvas.Textblock extends Efl.Canvas.Object implements Efl.Text,
|
|||
if you need user interaction consider the classes in $[Efl.Ui].
|
||||
|
||||
Note: No text will be rendered until a font, a font size and a font color are specified.
|
||||
This can be accomplished using @Efl.Text_Font.font_family, @Efl.Text_Font.font_size and
|
||||
This can be accomplished using @Efl.Text.Font.Properties.font_family, @Efl.Text.Font.Properties.font_size and
|
||||
@Efl.Text_Style.text_color.
|
||||
Alternatively, @.style_apply can be used providing the attributes $font, $font_size and $color.
|
||||
]]
|
||||
|
@ -92,7 +92,7 @@ class @beta Efl.Canvas.Textblock extends Efl.Canvas.Object implements Efl.Text,
|
|||
[[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.
|
||||
@Efl.Text.Font.Properties.font_slant or @Efl.Text_Format.wrap, for example.
|
||||
|
||||
The formatting string is a whitespace-separated list of $[attribute=value] pairs.
|
||||
|
||||
|
@ -101,43 +101,43 @@ class @beta Efl.Canvas.Textblock extends Efl.Canvas.Object implements Efl.Text,
|
|||
- $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.
|
||||
See @Efl.Text.Font.Properties.font_family.
|
||||
|
||||
- $font_fallbacks: Comma-delimited list of fonts to try if finding the primary font fails.
|
||||
Example: $[font_fallbacks=consolas,courier,monospace].
|
||||
Default value is empty.
|
||||
See @Efl.Text_Font.font_fallbacks.
|
||||
See @Efl.Text.Font.Properties.font_fallbacks.
|
||||
|
||||
- $font_size: Height of font, in points.
|
||||
Default value is 0.
|
||||
Requires $font and $font_color.
|
||||
See @Efl.Text_Font.font_size.
|
||||
See @Efl.Text.Font.Properties.font_size.
|
||||
|
||||
- $font_source: Path to the file containing the font to use.
|
||||
Example: $[font_source=/usr/share/fonts/Sans.ttf].
|
||||
Default value is empty.
|
||||
See @Efl.Text_Font.font_source.
|
||||
See @Efl.Text.Font.Properties.font_source.
|
||||
|
||||
- $font_weight: Thickness of the font. The value must be one of: $normal, $thin, $ultralight, $extralight,
|
||||
$light, $book, $medium, $semibold, $bold, $ultrabold, $extrabold, $black and $extrablack.
|
||||
Default value is $normal.
|
||||
See @Efl.Text_Font.font_weight.
|
||||
See @Efl.Text.Font.Properties.font_weight.
|
||||
|
||||
- $font_style: Style of the font. The value must be one of: $normal, $oblique and $italic.
|
||||
Default value is $normal.
|
||||
See @Efl.Text_Font.font_slant.
|
||||
See @Efl.Text.Font.Properties.font_slant.
|
||||
|
||||
- $font_width: How wide the font is, relative to its height. The value must be one of:
|
||||
$normal, $ultracondensed, $extracondensed, $condensed, $semicondensed, $semiexpanded, $expanded,
|
||||
$extraexpanded and $ultraexpanded.
|
||||
Default value is $normal.
|
||||
See @Efl.Text_Font.font_weight.
|
||||
See @Efl.Text.Font.Properties.font_weight.
|
||||
|
||||
- $lang: A 2-letter ISO 639-1 language code, $auto (to use the system locale setting) or $none (to disable
|
||||
language support).
|
||||
Example: $[lang=he].
|
||||
Default value is empty.
|
||||
See @Efl.Text_Font.font_lang.
|
||||
See @Efl.Text.Font.Properties.font_lang.
|
||||
|
||||
- $color: Color code for the text (See bottom for the complete list of supported codes).
|
||||
Default value is $[rgba(0,0,0,0)] meaning that no text will be rendered.
|
||||
|
@ -259,7 +259,7 @@ class @beta Efl.Canvas.Textblock extends Efl.Canvas.Object implements Efl.Text,
|
|||
|
||||
- $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.
|
||||
See @Efl.Text_Format.tab_stops.
|
||||
|
||||
- $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
|
||||
|
@ -276,13 +276,13 @@ class @beta Efl.Canvas.Textblock extends Efl.Canvas.Object implements Efl.Text,
|
|||
- $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.
|
||||
See @Efl.Text_Format.line_gap.
|
||||
|
||||
- $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.
|
||||
See @Efl.Text_Format.line_rel_gap.
|
||||
|
||||
- $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
|
||||
|
@ -340,7 +340,7 @@ class @beta Efl.Canvas.Textblock extends Efl.Canvas.Object implements Efl.Text,
|
|||
@property all_styles {
|
||||
[[A string representing the complete set of attributes applied to this text object.
|
||||
This includes the default attributes plus any additional style applied with @.style_apply
|
||||
or individual style properties like @Efl.Text_Font.font_slant or @Efl.Text_Format.wrap.
|
||||
or individual style properties like @Efl.Text.Font.Properties.font_slant or @Efl.Text_Format.wrap.
|
||||
|
||||
See @.style_apply for the description of all attributes.
|
||||
]]
|
||||
|
@ -455,15 +455,15 @@ class @beta Efl.Canvas.Textblock extends Efl.Canvas.Object implements Efl.Text,
|
|||
Efl.Canvas.Filter.Internal.filter_dirty;
|
||||
Efl.Canvas.Filter.Internal.filter_input_render;
|
||||
Efl.Canvas.Filter.Internal.filter_state_prepare;
|
||||
Efl.Text_Font.font_family { get; set; }
|
||||
Efl.Text_Font.font_size { get; set; }
|
||||
Efl.Text_Font.font_source { get; set; }
|
||||
Efl.Text_Font.font_fallbacks { get; set; }
|
||||
Efl.Text_Font.font_lang { get; set; }
|
||||
Efl.Text_Font.font_weight { get; set; }
|
||||
Efl.Text_Font.font_slant { get; set; }
|
||||
Efl.Text_Font.font_width { get; set; }
|
||||
Efl.Text_Font.font_bitmap_scalable { get; set; }
|
||||
Efl.Text.Font.Properties.font_family { get; set; }
|
||||
Efl.Text.Font.Properties.font_size { get; set; }
|
||||
Efl.Text.Font.Properties.font_source { get; set; }
|
||||
Efl.Text.Font.Properties.font_fallbacks { get; set; }
|
||||
Efl.Text.Font.Properties.font_lang { get; set; }
|
||||
Efl.Text.Font.Properties.font_weight { get; set; }
|
||||
Efl.Text.Font.Properties.font_slant { get; set; }
|
||||
Efl.Text.Font.Properties.font_width { get; set; }
|
||||
Efl.Text.Font.Properties.font_bitmap_scalable { get; set; }
|
||||
Efl.Text_Style.text_color { get; set; }
|
||||
Efl.Text_Style.text_background_type { get; set; }
|
||||
Efl.Text_Style.text_background_color { get; set; }
|
||||
|
@ -489,9 +489,9 @@ class @beta Efl.Canvas.Textblock extends Efl.Canvas.Object implements Efl.Text,
|
|||
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; }
|
||||
Efl.Text_Format.line_gap { get; set; }
|
||||
Efl.Text_Format.line_rel_gap { get; set; }
|
||||
Efl.Text_Format.tab_stops { get; set; }
|
||||
Efl.Text_Format.password { get; set; }
|
||||
Efl.Text_Format.replacement_char { get; set; }
|
||||
Efl.Text_Markup.markup { set; get; }
|
||||
|
|
|
@ -105,10 +105,13 @@ _efl_text_cursor_compare(const Eo *obj EINA_UNUSED, Efl_Text_Cursor_Data *pd, co
|
|||
EOLIAN static void
|
||||
_efl_text_cursor_copy(const Eo *obj EINA_UNUSED, Efl_Text_Cursor_Data *pd, Efl_Text_Cursor *dst)
|
||||
{
|
||||
Efl_Text_Cursor_Data *pd_dest = efl_data_scope_safe_get(dst, MY_CLASS);
|
||||
EINA_SAFETY_ON_NULL_RETURN(pd_dest);
|
||||
if (!pd->handle) return;
|
||||
|
||||
Efl_Text_Cursor_Handle *handle = evas_object_textblock_cursor_new(pd->handle->obj);
|
||||
evas_textblock_cursor_copy(pd->handle, handle);
|
||||
pd_dest->text_obj = pd->text_obj;
|
||||
efl_text_cursor_handle_set(dst, handle);
|
||||
evas_textblock_cursor_unref(handle, NULL);
|
||||
}
|
||||
|
@ -203,7 +206,7 @@ _efl_text_cursor_line_jump_by(Eo *obj EINA_UNUSED, Efl_Text_Cursor_Data *pd, int
|
|||
Eina_Bool moved = EINA_FALSE;
|
||||
int pos = evas_textblock_cursor_pos_get(pd->handle);
|
||||
evas_textblock_cursor_line_jump_by(pd->handle, by);
|
||||
moved = (pos == evas_textblock_cursor_pos_get(pd->handle));
|
||||
moved = (pos != evas_textblock_cursor_pos_get(pd->handle));
|
||||
return moved;
|
||||
}
|
||||
|
||||
|
@ -432,7 +435,8 @@ efl_text_cursor_handle_get(const Eo *obj)
|
|||
|
||||
void efl_text_cursor_text_object_set(Eo *cursor, Eo *canvas_text_obj, Eo *text_obj)
|
||||
{
|
||||
Efl_Text_Cursor_Data *pd = efl_data_scope_get(cursor, MY_CLASS);
|
||||
Efl_Text_Cursor_Data *pd = efl_data_scope_safe_get(cursor, MY_CLASS);
|
||||
EINA_SAFETY_ON_NULL_RETURN(pd);
|
||||
Efl_Text_Cursor_Handle *handle = NULL;
|
||||
if (efl_isa(canvas_text_obj, EFL_CANVAS_TEXTBLOCK_CLASS))
|
||||
{
|
||||
|
|
|
@ -9954,6 +9954,7 @@ evas_textblock_cursor_word_start(Efl_Text_Cursor_Handle *cur)
|
|||
const Eina_Unicode *text;
|
||||
size_t i;
|
||||
char *breaks;
|
||||
size_t old_cursor_pos = cur->pos;
|
||||
|
||||
Evas_Object_Protected_Data *obj = efl_data_scope_get(cur->obj, EFL_CANVAS_OBJECT_CLASS);
|
||||
evas_object_async_block(obj);
|
||||
|
@ -10004,8 +10005,12 @@ evas_textblock_cursor_word_start(Efl_Text_Cursor_Handle *cur)
|
|||
cur->pos = i;
|
||||
|
||||
free(breaks);
|
||||
_evas_textblock_cursor_object_changed(cur);
|
||||
return EINA_TRUE;
|
||||
if (cur->pos != old_cursor_pos)
|
||||
{
|
||||
_evas_textblock_cursor_object_changed(cur);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
|
@ -10015,6 +10020,7 @@ evas_textblock_cursor_word_end(Efl_Text_Cursor_Handle *cur)
|
|||
const Eina_Unicode *text;
|
||||
size_t i;
|
||||
char *breaks;
|
||||
size_t old_cursor_pos = cur->pos;
|
||||
|
||||
Evas_Object_Protected_Data *obj = efl_data_scope_get(cur->obj, EFL_CANVAS_OBJECT_CLASS);
|
||||
evas_object_async_block(obj);
|
||||
|
@ -10022,8 +10028,9 @@ evas_textblock_cursor_word_end(Efl_Text_Cursor_Handle *cur)
|
|||
|
||||
size_t len = eina_ustrbuf_length_get(cur->node->unicode);
|
||||
|
||||
// No movement happend, return false
|
||||
if (cur->pos == len)
|
||||
return EINA_TRUE;
|
||||
return EINA_FALSE;
|
||||
|
||||
text = eina_ustrbuf_string_get(cur->node->unicode);
|
||||
|
||||
|
@ -10059,8 +10066,12 @@ evas_textblock_cursor_word_end(Efl_Text_Cursor_Handle *cur)
|
|||
cur->pos = i;
|
||||
|
||||
free(breaks);
|
||||
_evas_textblock_cursor_object_changed(cur);
|
||||
return EINA_TRUE;
|
||||
if (cur->pos != old_cursor_pos)
|
||||
{
|
||||
_evas_textblock_cursor_object_changed(cur);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
static char *
|
||||
|
@ -10153,11 +10164,11 @@ _evas_textblock_cursor_cluster_pos_get(Evas_Textblock_Cursor *cur, Eina_Bool inc
|
|||
Evas_Object_Textblock_Text_Item *ti = _ITEM_TEXT(last_it);
|
||||
Evas_Text_Props_Info *info = ti->text_props.info;
|
||||
int it_index = ((inc) ? cur->pos : ret) - last_it->text_pos;
|
||||
|
||||
*is_single_glyph = EINA_FALSE;
|
||||
Evas_Font_OT_Info ot = {0};
|
||||
Evas_BiDi_Direction itdir = ti->text_props.bidi_dir;
|
||||
if (ti->text_props.len != ti->text_props.text_len)/*if code point count same as glyph count skip it*/
|
||||
{
|
||||
Evas_BiDi_Direction itdir = ti->text_props.bidi_dir;
|
||||
int i = 0;
|
||||
if (itdir == EFL_TEXT_BIDIRECTIONAL_TYPE_RTL)
|
||||
{
|
||||
|
@ -10200,9 +10211,14 @@ _evas_textblock_cursor_cluster_pos_get(Evas_Textblock_Cursor *cur, Eina_Bool inc
|
|||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
if (*is_single_glyph == EINA_FALSE)
|
||||
{
|
||||
is_single_glyph = EINA_FALSE;
|
||||
Eina_Unicode content = 0;
|
||||
if (!inc && cur->pos > 0)
|
||||
content = eina_ustrbuf_string_get(cur->node->unicode)[cur->pos - 1];
|
||||
else if (inc && cur->pos >= 0 && eina_ustrbuf_length_get(cur->node->unicode) > (cur->pos + 1))
|
||||
content = eina_ustrbuf_string_get(cur->node->unicode)[cur->pos + 1];
|
||||
if (VAR_SEQ(content)) *is_single_glyph = EINA_TRUE;
|
||||
}
|
||||
}
|
||||
#else//#ifdef OT_SUPPORT
|
||||
|
@ -11028,7 +11044,7 @@ evas_textblock_cursor_line_jump_by(Efl_Text_Cursor_Handle *cur, int by)
|
|||
pnode = cur->node;
|
||||
ppos = cur->pos;
|
||||
|
||||
evas_textblock_cursor_geometry_get(cur, &cx, NULL, &cw, NULL, NULL, EVAS_TEXTBLOCK_CURSOR_UNDER);
|
||||
evas_textblock_cursor_geometry_get(cur, &cx, NULL, &cw, NULL, NULL, EVAS_TEXTBLOCK_CURSOR_BEFORE);
|
||||
cx += (cw / 2);
|
||||
evas_textblock_cursor_paragraph_last(cur);
|
||||
last = evas_textblock_cursor_line_geometry_get(cur, NULL, NULL, NULL, NULL);
|
||||
|
@ -16124,7 +16140,7 @@ _canvas_text_format_changed(Eo *eo_obj, Efl_Canvas_Textblock_Data *o)
|
|||
/* Efl.Text.Font interface implementation */
|
||||
|
||||
static void
|
||||
_efl_canvas_textblock_efl_text_font_font_family_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, const char *font)
|
||||
_efl_canvas_textblock_efl_text_font_properties_font_family_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, const char *font)
|
||||
{
|
||||
ASYNC_BLOCK;
|
||||
Eina_Bool changed = EINA_FALSE;
|
||||
|
@ -16156,13 +16172,13 @@ _efl_canvas_textblock_efl_text_font_font_family_set(Eo *obj EINA_UNUSED, Efl_Can
|
|||
}
|
||||
|
||||
static const char *
|
||||
_efl_canvas_textblock_efl_text_font_font_family_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o)
|
||||
_efl_canvas_textblock_efl_text_font_properties_font_family_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o)
|
||||
{
|
||||
return o->default_format.info.font;
|
||||
}
|
||||
|
||||
static void
|
||||
_efl_canvas_textblock_efl_text_font_font_size_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o, int size)
|
||||
_efl_canvas_textblock_efl_text_font_properties_font_size_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o, int size)
|
||||
{
|
||||
ASYNC_BLOCK;
|
||||
EINA_SAFETY_ON_FALSE_RETURN(size > 0);
|
||||
|
@ -16174,13 +16190,13 @@ _efl_canvas_textblock_efl_text_font_font_size_set(Eo *obj EINA_UNUSED, Efl_Canva
|
|||
}
|
||||
|
||||
static Efl_Font_Size
|
||||
_efl_canvas_textblock_efl_text_font_font_size_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o)
|
||||
_efl_canvas_textblock_efl_text_font_properties_font_size_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o)
|
||||
{
|
||||
return o->default_format.info.size;
|
||||
}
|
||||
|
||||
static void
|
||||
_efl_canvas_textblock_efl_text_font_font_source_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, const char *font_source EINA_UNUSED)
|
||||
_efl_canvas_textblock_efl_text_font_properties_font_source_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, const char *font_source EINA_UNUSED)
|
||||
{
|
||||
Eina_Stringshare *nfont_source;
|
||||
if (o->default_format.info.font_source != font_source)
|
||||
|
@ -16201,13 +16217,13 @@ _efl_canvas_textblock_efl_text_font_font_source_set(Eo *obj EINA_UNUSED, Efl_Can
|
|||
}
|
||||
|
||||
static const char*
|
||||
_efl_canvas_textblock_efl_text_font_font_source_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED)
|
||||
_efl_canvas_textblock_efl_text_font_properties_font_source_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED)
|
||||
{
|
||||
return _FMT_INFO(font_source);
|
||||
}
|
||||
|
||||
static void
|
||||
_efl_canvas_textblock_efl_text_font_font_fallbacks_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, const char *font_fallbacks EINA_UNUSED)
|
||||
_efl_canvas_textblock_efl_text_font_properties_font_fallbacks_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, const char *font_fallbacks EINA_UNUSED)
|
||||
{
|
||||
Eina_Stringshare *nfont_fallbacks;
|
||||
if (o->default_format.info.font_fallbacks != font_fallbacks)
|
||||
|
@ -16228,13 +16244,13 @@ _efl_canvas_textblock_efl_text_font_font_fallbacks_set(Eo *obj EINA_UNUSED, Efl_
|
|||
}
|
||||
|
||||
static const char*
|
||||
_efl_canvas_textblock_efl_text_font_font_fallbacks_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED)
|
||||
_efl_canvas_textblock_efl_text_font_properties_font_fallbacks_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED)
|
||||
{
|
||||
return _FMT_INFO(font_fallbacks);
|
||||
}
|
||||
|
||||
static void
|
||||
_efl_canvas_textblock_efl_text_font_font_lang_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, const char *font_lang EINA_UNUSED)
|
||||
_efl_canvas_textblock_efl_text_font_properties_font_lang_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, const char *font_lang EINA_UNUSED)
|
||||
{
|
||||
if (_FMT_INFO(font_lang) != font_lang)
|
||||
{
|
||||
|
@ -16246,13 +16262,13 @@ _efl_canvas_textblock_efl_text_font_font_lang_set(Eo *obj EINA_UNUSED, Efl_Canva
|
|||
}
|
||||
|
||||
static const char*
|
||||
_efl_canvas_textblock_efl_text_font_font_lang_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED)
|
||||
_efl_canvas_textblock_efl_text_font_properties_font_lang_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED)
|
||||
{
|
||||
return _FMT_INFO(font_lang);
|
||||
}
|
||||
|
||||
static void
|
||||
_efl_canvas_textblock_efl_text_font_font_weight_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, Efl_Text_Font_Weight font_weight EINA_UNUSED)
|
||||
_efl_canvas_textblock_efl_text_font_properties_font_weight_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, Efl_Text_Font_Weight font_weight EINA_UNUSED)
|
||||
{
|
||||
if (_FMT_INFO(font_weight) == font_weight) return;
|
||||
_FMT_INFO(font_weight) = font_weight;
|
||||
|
@ -16260,13 +16276,13 @@ _efl_canvas_textblock_efl_text_font_font_weight_set(Eo *obj EINA_UNUSED, Efl_Can
|
|||
}
|
||||
|
||||
static Efl_Text_Font_Weight
|
||||
_efl_canvas_textblock_efl_text_font_font_weight_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED)
|
||||
_efl_canvas_textblock_efl_text_font_properties_font_weight_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED)
|
||||
{
|
||||
return _FMT_INFO(font_weight);
|
||||
}
|
||||
|
||||
static void
|
||||
_efl_canvas_textblock_efl_text_font_font_slant_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, Efl_Text_Font_Slant font_slant EINA_UNUSED)
|
||||
_efl_canvas_textblock_efl_text_font_properties_font_slant_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, Efl_Text_Font_Slant font_slant EINA_UNUSED)
|
||||
{
|
||||
ASYNC_BLOCK;
|
||||
if (_FMT_INFO(font_slant) == font_slant) return;
|
||||
|
@ -16275,13 +16291,13 @@ _efl_canvas_textblock_efl_text_font_font_slant_set(Eo *obj EINA_UNUSED, Efl_Canv
|
|||
}
|
||||
|
||||
static Efl_Text_Font_Slant
|
||||
_efl_canvas_textblock_efl_text_font_font_slant_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED)
|
||||
_efl_canvas_textblock_efl_text_font_properties_font_slant_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED)
|
||||
{
|
||||
return _FMT_INFO(font_slant);
|
||||
}
|
||||
|
||||
static void
|
||||
_efl_canvas_textblock_efl_text_font_font_width_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, Efl_Text_Font_Width font_width EINA_UNUSED)
|
||||
_efl_canvas_textblock_efl_text_font_properties_font_width_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, Efl_Text_Font_Width font_width EINA_UNUSED)
|
||||
{
|
||||
ASYNC_BLOCK;
|
||||
if (_FMT_INFO(font_width) == font_width) return;
|
||||
|
@ -16290,13 +16306,13 @@ _efl_canvas_textblock_efl_text_font_font_width_set(Eo *obj EINA_UNUSED, Efl_Canv
|
|||
}
|
||||
|
||||
static Efl_Text_Font_Width
|
||||
_efl_canvas_textblock_efl_text_font_font_width_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED)
|
||||
_efl_canvas_textblock_efl_text_font_properties_font_width_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED)
|
||||
{
|
||||
return _FMT_INFO(font_width);
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_canvas_textblock_efl_text_font_font_bitmap_scalable_set(Eo *obj, Efl_Canvas_Textblock_Data *o, Efl_Text_Font_Bitmap_Scalable bitmap_scalable)
|
||||
_efl_canvas_textblock_efl_text_font_properties_font_bitmap_scalable_set(Eo *obj, Efl_Canvas_Textblock_Data *o, Efl_Text_Font_Bitmap_Scalable bitmap_scalable)
|
||||
{
|
||||
if (_FMT_INFO(bitmap_scalable) == bitmap_scalable) return;
|
||||
_FMT_INFO(bitmap_scalable) = bitmap_scalable;
|
||||
|
@ -16304,7 +16320,7 @@ _efl_canvas_textblock_efl_text_font_font_bitmap_scalable_set(Eo *obj, Efl_Canvas
|
|||
}
|
||||
|
||||
EOLIAN static Efl_Text_Font_Bitmap_Scalable
|
||||
_efl_canvas_textblock_efl_text_font_font_bitmap_scalable_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o)
|
||||
_efl_canvas_textblock_efl_text_font_properties_font_bitmap_scalable_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o)
|
||||
{
|
||||
return _FMT_INFO(bitmap_scalable);
|
||||
}
|
||||
|
@ -16817,7 +16833,7 @@ _efl_canvas_textblock_efl_text_format_text_vertical_align_get(const Eo *obj EINA
|
|||
}
|
||||
|
||||
static void
|
||||
_efl_canvas_textblock_efl_text_format_linegap_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, double value EINA_UNUSED)
|
||||
_efl_canvas_textblock_efl_text_format_line_gap_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, double value EINA_UNUSED)
|
||||
{
|
||||
ASYNC_BLOCK;
|
||||
double linerelgap = _FMT(linerelgap);
|
||||
|
@ -16836,13 +16852,13 @@ _efl_canvas_textblock_efl_text_format_linegap_set(Eo *obj EINA_UNUSED, Efl_Canva
|
|||
}
|
||||
|
||||
static double
|
||||
_efl_canvas_textblock_efl_text_format_linegap_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED)
|
||||
_efl_canvas_textblock_efl_text_format_line_gap_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED)
|
||||
{
|
||||
return _FMT(linegap);
|
||||
}
|
||||
|
||||
static void
|
||||
_efl_canvas_textblock_efl_text_format_linerelgap_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, double value EINA_UNUSED)
|
||||
_efl_canvas_textblock_efl_text_format_line_rel_gap_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, double value EINA_UNUSED)
|
||||
{
|
||||
ASYNC_BLOCK;
|
||||
double linegap = _FMT(linegap);
|
||||
|
@ -16860,20 +16876,20 @@ _efl_canvas_textblock_efl_text_format_linerelgap_set(Eo *obj EINA_UNUSED, Efl_Ca
|
|||
}
|
||||
|
||||
static double
|
||||
_efl_canvas_textblock_efl_text_format_linerelgap_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED)
|
||||
_efl_canvas_textblock_efl_text_format_line_rel_gap_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED)
|
||||
{
|
||||
return _FMT(linerelgap);
|
||||
}
|
||||
|
||||
static void
|
||||
_efl_canvas_textblock_efl_text_format_tabstops_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, int value EINA_UNUSED)
|
||||
_efl_canvas_textblock_efl_text_format_tab_stops_set(Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED, int value EINA_UNUSED)
|
||||
{
|
||||
ASYNC_BLOCK;
|
||||
_FMT_SET(tabstops, value);
|
||||
}
|
||||
|
||||
static int
|
||||
_efl_canvas_textblock_efl_text_format_tabstops_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED)
|
||||
_efl_canvas_textblock_efl_text_format_tab_stops_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Textblock_Data *o EINA_UNUSED)
|
||||
{
|
||||
return _FMT(tabstops);
|
||||
}
|
||||
|
@ -17397,9 +17413,6 @@ EAPI int evas_textblock_fit_size_range_set(Evas_Object *obj, unsigned int min_f
|
|||
if (!max_changed && !min_changed)
|
||||
return EVAS_ERROR_SUCCESS;
|
||||
|
||||
if (min_font_size < 0 || max_font_size <0)
|
||||
return EVAS_ERROR_INVALID_PARAM;
|
||||
|
||||
if (max_font_size < min_font_size)
|
||||
return EVAS_ERROR_INVALID_PARAM;
|
||||
|
||||
|
|
|
@ -293,6 +293,6 @@ static const Efl_Class_Description _evas_text_class_desc = {
|
|||
NULL
|
||||
};
|
||||
|
||||
EFL_DEFINE_CLASS(evas_text_class_get, &_evas_text_class_desc, EFL_CANVAS_OBJECT_CLASS, EFL_TEXT_INTERFACE, EFL_TEXT_FONT_INTERFACE, EFL_CANVAS_FILTER_INTERNAL_MIXIN, NULL);
|
||||
EFL_DEFINE_CLASS(evas_text_class_get, &_evas_text_class_desc, EFL_CANVAS_OBJECT_CLASS, EFL_TEXT_INTERFACE, EFL_TEXT_FONT_PROPERTIES_INTERFACE, EFL_CANVAS_FILTER_INTERNAL_MIXIN, NULL);
|
||||
|
||||
#include "evas_text_eo.legacy.c"
|
||||
|
|
|
@ -23,7 +23,7 @@ extern "C" {
|
|||
#include "efl_loop_consumer.eo.h"
|
||||
#include "efl_object.eo.h"
|
||||
#include "efl_text.eo.h"
|
||||
#include "efl_text_font.eo.h"
|
||||
#include "efl_text_font_properties.eo.h"
|
||||
#include "efl_ui_i18n.eo.h"
|
||||
#include "evas_text_eo.h"
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ extern "C" {
|
|||
#include "efl_loop_consumer.eo.hh"
|
||||
#include "efl_object.eo.hh"
|
||||
#include "efl_text.eo.hh"
|
||||
#include "efl_text_font.eo.hh"
|
||||
#include "efl_text_font_properties.eo.hh"
|
||||
#include "efl_ui_i18n.eo.hh"
|
||||
#ifndef EVAS_TEXT_FWD_GUARD
|
||||
#define EVAS_TEXT_FWD_GUARD
|
||||
|
|
|
@ -122,6 +122,6 @@ static const Efl_Class_Description _evas_textgrid_class_desc = {
|
|||
NULL
|
||||
};
|
||||
|
||||
EFL_DEFINE_CLASS(evas_textgrid_class_get, &_evas_textgrid_class_desc, EFL_CANVAS_OBJECT_CLASS, EFL_TEXT_FONT_INTERFACE, NULL);
|
||||
EFL_DEFINE_CLASS(evas_textgrid_class_get, &_evas_textgrid_class_desc, EFL_CANVAS_OBJECT_CLASS, EFL_TEXT_FONT_PROPERTIES_INTERFACE, NULL);
|
||||
|
||||
#include "evas_textgrid_eo.legacy.c"
|
||||
|
|
|
@ -20,7 +20,7 @@ extern "C" {
|
|||
#include "efl_loop.eo.h"
|
||||
#include "efl_loop_consumer.eo.h"
|
||||
#include "efl_object.eo.h"
|
||||
#include "efl_text_font.eo.h"
|
||||
#include "efl_text_font_properties.eo.h"
|
||||
#include "efl_ui_i18n.eo.h"
|
||||
#include "evas_textgrid_eo.h"
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ extern "C" {
|
|||
#include "efl_loop.eo.hh"
|
||||
#include "efl_loop_consumer.eo.hh"
|
||||
#include "efl_object.eo.hh"
|
||||
#include "efl_text_font.eo.hh"
|
||||
#include "efl_text_font_properties.eo.hh"
|
||||
#include "efl_ui_i18n.eo.hh"
|
||||
#ifndef EVAS_TEXTGRID_FWD_GUARD
|
||||
#define EVAS_TEXTGRID_FWD_GUARD
|
||||
|
|
|
@ -4488,15 +4488,32 @@ EFL_START_TEST(efl_canvas_textblock_cursor)
|
|||
efl_event_callback_add(txt, EFL_CANVAS_TEXTBLOCK_EVENT_CHANGED, _increment_int_changed, &changed_emit);
|
||||
const char *buf = "abcdefghij";
|
||||
efl_text_set(txt, buf);
|
||||
fail_if(strcmp(efl_text_get(txt), buf));
|
||||
ck_assert_int_eq(strcmp(efl_text_get(txt), buf), 0);
|
||||
|
||||
efl_text_cursor_line_jump_by(cur_obj, -1);
|
||||
pos = efl_text_cursor_position_get(cur_obj);
|
||||
ck_assert_int_eq(pos, 0);
|
||||
efl_text_cursor_line_jump_by(cur_obj, 1);
|
||||
ck_assert(!efl_text_cursor_line_jump_by(cur_obj, -1));
|
||||
pos = efl_text_cursor_position_get(cur_obj);
|
||||
ck_assert_int_eq(pos, 0);
|
||||
ck_assert(efl_text_cursor_line_jump_by(cur_obj, 1));
|
||||
pos = efl_text_cursor_position_get(cur_obj);
|
||||
ck_assert_int_eq(pos, 10);
|
||||
|
||||
efl_text_markup_set(txt, "Hello World<ps/>This is EFL<br/>Enlightenment");
|
||||
efl_text_cursor_position_set(cur_obj, 0);
|
||||
ck_assert_int_eq(efl_text_cursor_line_number_get(cur_obj), 0);
|
||||
ck_assert(efl_text_cursor_line_jump_by(cur_obj, 2));
|
||||
ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 24);
|
||||
ck_assert_int_eq(efl_text_cursor_line_number_get(cur_obj), 2);
|
||||
ck_assert(efl_text_cursor_line_jump_by(cur_obj, -2));
|
||||
ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 0);
|
||||
ck_assert_int_eq(efl_text_cursor_line_number_get(cur_obj), 0);
|
||||
|
||||
ck_assert(efl_text_cursor_line_jump_by(cur_obj, 2));
|
||||
efl_text_cursor_line_number_set(cur_obj, 2);
|
||||
ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 24);
|
||||
efl_text_cursor_line_number_set(cur_obj, 0);
|
||||
ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 0);
|
||||
|
||||
Eo * cursor1 = efl_add(EFL_TEXT_CURSOR_CLASS, txt);
|
||||
pos = efl_text_cursor_position_get(cursor1);
|
||||
|
@ -4513,9 +4530,251 @@ EFL_START_TEST(efl_canvas_textblock_cursor)
|
|||
efl_text_set(txt, "");
|
||||
efl_text_set(txt, "");
|
||||
efl_text_cursor_text_insert(cursor1, "aa");
|
||||
|
||||
ck_assert_int_eq(changed_emit, 3);
|
||||
|
||||
efl_text_set(txt, "");
|
||||
ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_NEXT));
|
||||
ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_PREV));
|
||||
ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CLUSTER_NEXT));
|
||||
ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CLUSTER_PREV));
|
||||
ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_START));
|
||||
ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_END));
|
||||
ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_LINE_START));
|
||||
ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_LINE_END));
|
||||
ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_WORD_START));
|
||||
ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_WORD_END));
|
||||
ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_NEXT));
|
||||
ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_PREV));
|
||||
ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_FIRST));
|
||||
ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_LAST));
|
||||
ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 0);
|
||||
|
||||
ck_assert_int_eq(changed_emit, 4);
|
||||
|
||||
efl_text_markup_set(txt, "Hello World<ps/>This is EFL<br/>Enlightenment");
|
||||
ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_NEXT));
|
||||
ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 1);
|
||||
ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_PREV));
|
||||
ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 0);
|
||||
ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CLUSTER_NEXT));
|
||||
ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 1);
|
||||
ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CLUSTER_PREV));
|
||||
ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 0);
|
||||
|
||||
efl_text_cursor_position_set(cur_obj, 0);
|
||||
ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_WORD_END));
|
||||
ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 4);
|
||||
ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_WORD_END));
|
||||
ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 4);
|
||||
ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_WORD_START));
|
||||
ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 0);
|
||||
ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_WORD_START));
|
||||
ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 0);
|
||||
|
||||
ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_WORD_END));
|
||||
ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_NEXT));
|
||||
ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 5);
|
||||
ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_WORD_END));
|
||||
ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 10);
|
||||
ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_NEXT));
|
||||
ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_WORD_END));
|
||||
ck_assert_int_ne(efl_text_cursor_position_get(cur_obj), 10);
|
||||
|
||||
ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_LINE_END));
|
||||
ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 23);
|
||||
ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_LINE_END));
|
||||
ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 23);
|
||||
ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_LINE_START));
|
||||
ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 12);
|
||||
ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_LINE_START));
|
||||
ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 12);
|
||||
ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_PREV));
|
||||
ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_LINE_START));
|
||||
ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 0);
|
||||
|
||||
#if defined(HAVE_FRIBIDI) && defined(HAVE_HARFBUZZ)
|
||||
efl_text_markup_set(txt, "الْبَرْمَجةُ<ps/>مَرْحبَاً");
|
||||
efl_text_cursor_cluster_coord_set(cur_obj, EINA_POSITION2D(0, 0));
|
||||
ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CLUSTER_NEXT));
|
||||
ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 1);
|
||||
ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CLUSTER_NEXT));
|
||||
ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 3);
|
||||
ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CLUSTER_NEXT));
|
||||
ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 5);
|
||||
ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_PREV));
|
||||
ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 4);
|
||||
ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_NEXT));
|
||||
ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 5);
|
||||
ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_NEXT));
|
||||
ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 6);
|
||||
ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CLUSTER_NEXT));
|
||||
ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 7);
|
||||
|
||||
ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_NEXT));
|
||||
ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 13);
|
||||
ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_NEXT));
|
||||
ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 13);
|
||||
ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_END));
|
||||
ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 22);
|
||||
ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_END));
|
||||
ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 22);
|
||||
ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_LAST));
|
||||
ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 22);
|
||||
ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_START));
|
||||
ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 13);
|
||||
ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_END));
|
||||
ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 22);
|
||||
ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_FIRST));
|
||||
ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 0);
|
||||
#endif
|
||||
|
||||
Eo *nCur = efl_add(EFL_TEXT_CURSOR_CLASS, txt), *nCur2 = efl_add(EFL_TEXT_CURSOR_CLASS, txt), *nCur3 = efl_add(EFL_TEXT_CURSOR_CLASS, txt);
|
||||
efl_text_markup_set(txt, "Hello World<ps/>This is EFL<br/>Enlightenment");
|
||||
efl_text_cursor_position_set(cur_obj, 0);
|
||||
efl_text_cursor_copy(cur_obj, nCur);
|
||||
ck_assert_ptr_ne(nCur, NULL);
|
||||
efl_text_cursor_copy(cur_obj, nCur2);
|
||||
efl_text_cursor_copy(cur_obj, nCur3);
|
||||
ck_assert_ptr_ne(nCur2, NULL);
|
||||
ck_assert_ptr_ne(nCur3, NULL);
|
||||
|
||||
ck_assert(efl_text_cursor_equal(cur_obj, nCur));
|
||||
ck_assert(efl_text_cursor_equal(cur_obj, nCur2));
|
||||
ck_assert(efl_text_cursor_equal(cur_obj, nCur3));
|
||||
ck_assert(efl_text_cursor_equal(nCur2, nCur3));
|
||||
|
||||
ck_assert_int_eq(efl_text_cursor_compare(cur_obj, nCur3), 0);
|
||||
ck_assert_int_eq(efl_text_cursor_compare(nCur2, nCur3), 0);
|
||||
ck_assert_int_eq(efl_text_cursor_compare(cur_obj, nCur), 0);
|
||||
|
||||
ck_assert(efl_text_cursor_move(nCur, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_NEXT));
|
||||
ck_assert_int_lt(efl_text_cursor_compare(cur_obj, nCur), 0);
|
||||
ck_assert_int_gt(efl_text_cursor_compare(nCur, cur_obj), 0);
|
||||
efl_text_cursor_copy(nCur, nCur2);
|
||||
ck_assert_int_lt(efl_text_cursor_compare(cur_obj, nCur2), 0);
|
||||
ck_assert_int_gt(efl_text_cursor_compare(nCur2, cur_obj), 0);
|
||||
ck_assert(!efl_text_cursor_equal(nCur2, nCur3));
|
||||
|
||||
efl_text_set(txt, "");
|
||||
efl_text_cursor_text_insert(cur_obj, "Hello World");
|
||||
ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 11);
|
||||
efl_text_cursor_text_insert(cur_obj, "Hello World");
|
||||
ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 22);
|
||||
ck_assert_str_eq(efl_text_get(txt), "Hello WorldHello World");
|
||||
|
||||
efl_text_set(txt, "");
|
||||
efl_text_cursor_markup_insert(cur_obj, "Hello World<ps/>Hello World");
|
||||
ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 23);
|
||||
|
||||
efl_text_cursor_char_coord_set(cur_obj, EINA_POSITION2D(0, 0));
|
||||
ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 0);
|
||||
efl_text_cursor_char_coord_set(cur_obj, EINA_POSITION2D(500, 500));
|
||||
ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 23);
|
||||
efl_text_cursor_cluster_coord_set(cur_obj, EINA_POSITION2D(0, 0));
|
||||
ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 0);
|
||||
efl_text_cursor_cluster_coord_set(cur_obj, EINA_POSITION2D(500, 500));
|
||||
ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 23);
|
||||
|
||||
efl_text_cursor_position_set(nCur, 0);
|
||||
efl_text_cursor_position_set(cur_obj, 5);
|
||||
|
||||
ck_assert_str_eq(efl_text_cursor_range_text_get(cur_obj, nCur), "Hello");
|
||||
ck_assert_str_eq(efl_text_cursor_range_text_get(nCur, cur_obj), "Hello");
|
||||
|
||||
efl_text_cursor_position_set(nCur, 0);
|
||||
efl_text_cursor_position_set(cur_obj, 17);
|
||||
|
||||
Eina_Iterator *iter = efl_text_cursor_range_geometry_get(cur_obj, nCur);
|
||||
Eina_Rect *geoRect;
|
||||
int x = 0;
|
||||
|
||||
EINA_ITERATOR_FOREACH(iter, geoRect)
|
||||
{
|
||||
x ++;
|
||||
ck_assert_int_ne(geoRect->w, 0);
|
||||
ck_assert_int_ne(geoRect->h, 0);
|
||||
}
|
||||
|
||||
ck_assert_int_eq(x, 3);
|
||||
|
||||
iter = efl_text_cursor_range_precise_geometry_get(cur_obj, nCur);
|
||||
x = 0;
|
||||
|
||||
EINA_ITERATOR_FOREACH(iter, geoRect)
|
||||
{
|
||||
x ++;
|
||||
ck_assert_int_ne(geoRect->w, 0);
|
||||
ck_assert_int_ne(geoRect->h, 0);
|
||||
}
|
||||
|
||||
ck_assert_int_eq(x, 2);
|
||||
|
||||
ck_assert_str_eq(efl_text_cursor_range_markup_get(cur_obj, nCur), "Hello World<ps/>Hello");
|
||||
ck_assert_str_eq(efl_text_cursor_range_markup_get(nCur, cur_obj), "Hello World<ps/>Hello");
|
||||
|
||||
efl_text_cursor_position_set(nCur, 0);
|
||||
efl_text_cursor_position_set(cur_obj, 5);
|
||||
|
||||
efl_text_cursor_range_delete(nCur, cur_obj);
|
||||
|
||||
ck_assert_str_eq(efl_text_markup_get(txt), " World<ps/>Hello World");
|
||||
ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 0);
|
||||
ck_assert_int_eq(efl_text_cursor_position_get(nCur), 0);
|
||||
|
||||
efl_text_markup_set(txt, "Hello World<ps/>Hello World");
|
||||
efl_text_cursor_position_set(cur_obj, 6);
|
||||
Eina_Unicode str[2] = {0};
|
||||
str[0] = efl_text_cursor_content_get(cur_obj);
|
||||
ck_assert_str_eq(eina_unicode_unicode_to_utf8(str, NULL), "W");
|
||||
|
||||
efl_text_cursor_char_delete(cur_obj);
|
||||
|
||||
str[0] = efl_text_cursor_content_get(cur_obj);
|
||||
ck_assert_str_eq(eina_unicode_unicode_to_utf8(str, NULL), "o");
|
||||
|
||||
Eo *cur_txt = efl_text_cursor_text_object_get(cur_obj);
|
||||
Eo *cur_txt2 = efl_text_cursor_text_object_get(nCur);
|
||||
ck_assert_ptr_eq(cur_txt, txt);
|
||||
ck_assert_ptr_eq(cur_txt2, txt);
|
||||
|
||||
efl_text_cursor_position_set(cur_obj, 1);
|
||||
Eina_Rect rect = efl_text_cursor_content_geometry_get(cur_obj);
|
||||
ck_assert_int_ne(rect.w, 0);
|
||||
ck_assert_int_ne(rect.h, 0);
|
||||
ck_assert_int_ne(rect.x, 0);
|
||||
|
||||
rect = efl_text_cursor_geometry_get(cur_obj, EFL_TEXT_CURSOR_TYPE_BEFORE);
|
||||
ck_assert_int_eq(rect.w, 0);
|
||||
ck_assert_int_ne(rect.h, 0);
|
||||
ck_assert_int_ne(rect.x, 0);
|
||||
|
||||
Eina_Rect rect2 = efl_text_cursor_geometry_get(cur_obj, EFL_TEXT_CURSOR_TYPE_UNDER);
|
||||
ck_assert_int_ne(rect2.w, 0);
|
||||
ck_assert_int_ne(rect2.h, 0);
|
||||
ck_assert_int_ne(rect2.x, 0);
|
||||
|
||||
ck_assert_int_ne(rect2.w, rect.w);
|
||||
ck_assert_int_eq(rect2.h, rect.h);
|
||||
ck_assert_int_eq(rect2.x, rect.x);
|
||||
ck_assert_int_eq(rect2.y, rect.y);
|
||||
|
||||
efl_text_markup_set(txt, "Hello World");
|
||||
efl_text_cursor_position_set(cur_obj, 11);
|
||||
ck_assert(!efl_text_cursor_lower_cursor_geometry_get(cur_obj, &rect2));
|
||||
#ifdef HAVE_FRIBIDI
|
||||
efl_text_cursor_text_insert(cur_obj, "مرحباً");
|
||||
rect = efl_text_cursor_geometry_get(cur_obj, EFL_TEXT_CURSOR_TYPE_BEFORE);
|
||||
ck_assert(efl_text_cursor_lower_cursor_geometry_get(cur_obj, &rect2));
|
||||
ck_assert_int_eq(rect2.w, 0);
|
||||
ck_assert_int_ne(rect2.h, 0);
|
||||
ck_assert_int_ne(rect2.x, 0);
|
||||
|
||||
ck_assert_int_eq(rect2.w, rect.w);
|
||||
ck_assert_int_eq(rect2.h, rect.h);
|
||||
ck_assert_int_ne(rect2.x, rect.x);
|
||||
ck_assert_int_eq(rect2.y, rect.y);
|
||||
#endif
|
||||
|
||||
END_EFL_CANVAS_TEXTBLOCK_TEST();
|
||||
}
|
||||
EFL_END_TEST
|
||||
|
@ -4618,7 +4877,7 @@ EFL_START_TEST(efl_canvas_textblock_style)
|
|||
efl_text_underline_type_set(txt, EFL_TEXT_STYLE_UNDERLINE_TYPE_DOUBLE);
|
||||
efl_text_font_weight_set(txt, EFL_TEXT_FONT_WEIGHT_EXTRABOLD);
|
||||
efl_text_font_slant_set(txt, EFL_TEXT_FONT_SLANT_OBLIQUE);
|
||||
efl_text_tabstops_set(txt, 20);
|
||||
efl_text_tab_stops_set(txt, 20);
|
||||
|
||||
efl_canvas_textblock_style_apply(txt, "color=#90E135");
|
||||
|
||||
|
|
Loading…
Reference in New Issue