}
};
+/// <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)
+/// </summary>
+[StructLayout(LayoutKind.Sequential)]
+[Efl.Eo.BindingEntity]
+public struct Event
+{
+ /// <summary>The object the callback was called on.
+ /// (Since EFL 1.22)</summary>
+ public Efl.Object Object;
+
+ /// <summary>The event description.
+ /// (Since EFL 1.22)</summary>
+ public Efl.EventDescription Desc;
+
+ /// <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>
+ public System.IntPtr Info;
+
+ /// <summary>Constructor for Event.</summary>
+ public Event(
+ Efl.Object obj = default(Efl.Object),
+ Efl.EventDescription desc = default(Efl.EventDescription),
+ System.IntPtr info = default(System.IntPtr))
+ {
+ this.Object = obj;
+ this.Desc = desc;
+ this.Info = info;
+ }
+
+ /// <summary>Implicit conversion to the managed representation from a native pointer.</summary>
+ /// <param name="ptr">Native pointer to be converted.</param>
+ public static implicit operator Event(IntPtr ptr)
+ {
+ var tmp = (Event.NativeStruct) Marshal.PtrToStructure(ptr, typeof(Event.NativeStruct));
+ return tmp;
+ }
+
+ /// <summary>Internal wrapper for struct Event.</summary>
+ [StructLayout(LayoutKind.Sequential)]
+ public struct NativeStruct
+ {
+ /// <summary>Internal wrapper for field Object</summary>
+ public System.IntPtr Object;
+
+ /// <summary>Internal wrapper for field Desc</summary>
+ public System.IntPtr Desc;
+
+ /// <summary>Internal wrapper for field Info</summary>
+ public System.IntPtr Info;
+
+ /// <summary>Implicit conversion to the internal/marshalling representation.</summary>
+ /// <param name="externalStruct">Managed struct to be converted.</param>
+ /// <returns>Native representation of the managed struct.</returns>
+ public static implicit operator Event.NativeStruct(Event externalStruct)
+ {
+ var internalStruct = new Event.NativeStruct();
+ internalStruct.Object = externalStruct.Object?.NativeHandle ?? System.IntPtr.Zero;
+ internalStruct.Desc = Eina.PrimitiveConversion.ManagedToPointerAlloc(externalStruct.Desc);
+ internalStruct.Info = externalStruct.Info;
+ return internalStruct;
+ }
+
+ /// <summary>Implicit conversion to the managed representation.</summary>
+ /// <param name="internalStruct">Native struct to be converted.</param>
+ /// <returns>Managed representation of the native struct.</returns>
+ public static implicit operator Event(Event.NativeStruct internalStruct)
+ {
+ var externalStruct = new Event();
+ externalStruct.Object = (Efl.Object) Efl.Eo.Globals.CreateWrapperFor(internalStruct.Object);
+ externalStruct.Desc = Eina.PrimitiveConversion.PointerToManaged<Efl.EventDescription>(internalStruct.Desc);
+ externalStruct.Info = internalStruct.Info;
+ return externalStruct;
+ }
+ }
+}
+
public delegate void EventCb(System.IntPtr data, ref Event.NativeStruct evt);
public delegate void FreeWrapperSupervisorCb(System.IntPtr obj);
// Integer //
- /*
public static void test_eina_array_int_in()
{
var t = new Dummy.TestObject();
Test.Assert(arr.Handle == IntPtr.Zero);
}
+ /*
public static void test_eina_array_int_in_own()
{
var t = new Dummy.TestObject();
Test.Assert(arr.Handle == IntPtr.Zero);
Test.Assert(t.CheckEinaArrayIntInOwn());
}
+ */
public static void test_eina_array_int_out()
{
Test.Assert(t.CheckEinaArrayIntOut());
}
+ /*
public static void test_eina_array_int_out_own()
{
var t = new Dummy.TestObject();
arr.Dispose();
Test.Assert(arr.Handle == IntPtr.Zero);
}
+ */
public static void test_eina_array_int_return()
{
Test.Assert(t.CheckEinaArrayIntReturn());
}
+ /*
public static void test_eina_array_int_return_own()
{
var t = new Dummy.TestObject();
// Integer //
- /*
public static void test_eina_list_int_in()
{
var t = new Dummy.TestObject();
Test.Assert(lst.Handle == IntPtr.Zero);
}
+ /*
public static void test_eina_list_int_in_own()
{
var t = new Dummy.TestObject();
Test.Assert(lst.Handle == IntPtr.Zero);
Test.Assert(t.CheckEinaListIntInOwn());
}
+ */
public static void test_eina_list_int_out()
{
Test.Assert(t.CheckEinaListIntOut());
}
+ /*
public static void test_eina_list_int_out_own()
{
var t = new Dummy.TestObject();
lst.Dispose();
Test.Assert(lst.Handle == IntPtr.Zero);
}
+ */
public static void test_eina_list_int_return()
{
Test.Assert(t.CheckEinaListIntReturn());
}
+ /*
public static void test_eina_list_int_return_own()
{
var t = new Dummy.TestObject();
// Integer //
- /*
public static void test_eina_hash_int_in()
{
var t = new Dummy.TestObject();
Test.Assert(hsh.Handle == IntPtr.Zero);
}
+ /*
public static void test_eina_hash_int_in_own()
{
var t = new Dummy.TestObject();
Test.Assert(hsh.Handle == IntPtr.Zero);
Test.Assert(t.CheckEinaHashIntInOwn());
}
+ */
public static void test_eina_hash_int_out()
{
Test.Assert(t.CheckEinaHashIntOut());
}
+ /*
public static void test_eina_hash_int_out_own()
{
var t = new Dummy.TestObject();
Test.Assert(hsh.Handle == IntPtr.Zero);
Test.Assert(t.CheckEinaHashIntOutOwn());
}
+ */
public static void test_eina_hash_int_return()
{
Test.Assert(t.CheckEinaHashIntReturn());
}
+ /*
public static void test_eina_hash_int_return_own()
{
var t = new Dummy.TestObject();
simple.Ffloat = -16777216.0f;
simple.Fdouble = -9007199254740992.0;
simple.Fbool = true;
- simple.Fvoid_ptr = (IntPtr) 0xFE;
simple.Fenum = Dummy.SampleEnum.V2;
simple.Fstring = "test/string";
simple.Fmstring = "test/mstring";
Test.Assert(simple.Ffloat == -16777216.0f);
Test.Assert(simple.Fdouble == -9007199254740992.0);
Test.Assert(simple.Fbool == true);
- Test.Assert(simple.Fvoid_ptr == (IntPtr) 0xFE);
Test.Assert(simple.Fenum == Dummy.SampleEnum.V2);
Test.Assert(simple.Fstring == "test/string");
Test.Assert(simple.Fmstring == "test/mstring");
Test.Assert(simple.Ffloat == 0);
Test.Assert(simple.Fdouble == 0);
Test.Assert(simple.Fbool == false);
- Test.Assert(simple.Fvoid_ptr == IntPtr.Zero);
Test.Assert(simple.Fenum == Dummy.SampleEnum.V0);
Test.Assert(simple.Fstring == null);
Test.Assert(simple.Fmstring == null);
simple->ffloat = -16777216.0;
simple->fdouble = -9007199254740992.0;
simple->fbool = EINA_TRUE;
- simple->fvoid_ptr = (void*) 0xFE;
simple->fenum = DUMMY_SAMPLEENUM_V2;
simple->fstring = "test/string";
simple->fmstring = strdup("test/mstring");
&& EQUAL(simple->ffloat, -16777216.0)
&& EQUAL(simple->fdouble, -9007199254740992.0)
&& EQUAL(simple->fbool, EINA_TRUE)
- && EQUAL(simple->fvoid_ptr, (void*) 0xFE)
&& EQUAL(simple->fenum, DUMMY_SAMPLEENUM_V2)
&& STR_EQUAL(simple->fstring, "test/string")
&& STR_EQUAL(simple->fmstring, "test/mstring")
ffloat: float;
fdouble: double;
fbool: bool;
- fvoid_ptr: void_ptr;
fenum: Dummy.SampleEnum;
// fboolptr: ptr(bool); // TODO
// fbyteptr: ptr(byte);
/* Eina Array */
/* Integer */
- /*
eina_array_int_in {
params {
- @in arr: array<ptr(int)>;
+ @in arr: array<int>;
}
return: bool;
}
+ /*
eina_array_int_in_own {
params {
- @in arr: array<free(ptr(int),free) @owned> @owned;
+ @in arr: array<int> @owned; // <int @owned>
}
return: bool;
}
check_eina_array_int_in_own {
return: bool;
}
+ */
eina_array_int_out {
params {
- @out arr: array<ptr(int)>;
+ @out arr: array<int>;
}
return: bool;
}
return: bool;
}
+ /*
eina_array_int_out_own {
params {
- @out arr: array<free(ptr(int),free) @owned> @owned;
+ @out arr: array<int> @owned; // <int @owned>
}
return: bool;
}
+ */
eina_array_int_return {
- return: array<ptr(int)>;
+ return: array<int>;
}
check_eina_array_int_return {
return: bool;
}
+ /*
eina_array_int_return_own {
- return: array<free(ptr(int),free) @owned> @owned;
+ return: array<int> @owned; // <int @owned>
}
*/
/* Eina List */
/* Integer */
- /*
eina_list_int_in {
params {
- @in lst: list<ptr(int)>;
+ @in lst: list<int>;
}
return: bool;
}
+ /*
eina_list_int_in_own {
params {
- @in lst: list<free(ptr(int),free) @owned> @owned;
+ @in lst: list<int> @owned; // <int @owned>
}
return: bool;
}
check_eina_list_int_in_own {
return: bool;
}
+ */
eina_list_int_out {
params {
- @out lst: list<ptr(int)>;
+ @out lst: list<int>;
}
return: bool;
}
return: bool;
}
+ /*
eina_list_int_out_own {
params {
- @out lst: list<free(ptr(int),free) @owned> @owned;
+ @out lst: list<int> @owned; // <int @owned>
}
return: bool;
}
+ */
eina_list_int_return {
- return: list<ptr(int)>;
+ return: list<int>;
}
check_eina_list_int_return {
return: bool;
}
+ /*
eina_list_int_return_own {
- return: list<free(ptr(int),free) @owned> @owned;
+ return: list<int> @owned; // <int @owned>
}
*/
// Eina Hash //
// Integer //
- /*
eina_hash_int_in {
params {
- @in hsh: hash<ptr(int), ptr(int)>;
+ @in hsh: hash<int, int>;
}
return: bool;
}
+ /*
eina_hash_int_in_own {
params {
- @in hsh: hash<ptr(int), free(ptr(int),free) @owned> @owned;
+ @in hsh: hash<int, int> @owned; // <, int @owned>
}
return: bool;
}
check_eina_hash_int_in_own {
return: bool;
}
+ */
eina_hash_int_out {
params {
- @out hsh: hash<ptr(int), ptr(int)>;
+ @out hsh: hash<int, int>;
}
return: bool;
}
return: bool;
}
+ /*
eina_hash_int_out_own {
params {
- @out hsh: hash<ptr(int), free(ptr(int),free) @owned> @owned;
+ @out hsh: hash<int, int> @owned; // <, int @owned>
}
return: bool;
}
check_eina_hash_int_out_own {
return: bool;
}
+ */
eina_hash_int_return {
- return: hash<ptr(int), ptr(int)>;
+ return: hash<int, int>;
}
check_eina_hash_int_return {
return: bool;
}
+ /*
eina_hash_int_return_own {
- return: hash<ptr(int), free(ptr(int),free) @owned> @owned;
+ return: hash<int, int> @owned; // <, int @owned>
}
check_eina_hash_int_return_own {
return: bool;