2019-10-24 06:01:50 -07:00
|
|
|
/*
|
|
|
|
* Copyright 2019 by its authors. See AUTHORS.
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
2017-12-06 16:03:55 -08:00
|
|
|
#pragma warning disable 1591
|
2017-11-23 16:49:22 -08:00
|
|
|
|
|
|
|
using System;
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
2017-12-06 16:03:55 -08:00
|
|
|
///<summary>Eo class description, passed to efl_class_new.</summary>
|
2017-11-23 16:49:22 -08:00
|
|
|
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Ansi)]
|
|
|
|
public struct ClassDescription
|
|
|
|
{
|
2017-12-06 16:03:55 -08:00
|
|
|
///<summary>Current Eo version.</summary>
|
2017-11-23 16:49:22 -08:00
|
|
|
public uint version;
|
2017-12-06 16:03:55 -08:00
|
|
|
///<summary>Name of the class.</summary>
|
2017-11-23 16:49:22 -08:00
|
|
|
[MarshalAs(UnmanagedType.LPStr)] public String name;
|
2017-12-06 16:03:55 -08:00
|
|
|
///<summary>Class type.</summary>
|
2017-11-23 16:49:22 -08:00
|
|
|
public int class_type;
|
2017-12-06 16:03:55 -08:00
|
|
|
///<summary>Size of data (private + protected + public) per instance.</summary>
|
2017-11-23 16:49:22 -08:00
|
|
|
public UIntPtr data_size;
|
2017-12-06 16:03:55 -08:00
|
|
|
///<summary>Initializer for the class.</summary>
|
2017-11-23 16:49:22 -08:00
|
|
|
public IntPtr class_initializer;
|
2017-12-06 16:03:55 -08:00
|
|
|
///<summary>Constructor of the class.</summary>
|
2017-11-23 16:49:22 -08:00
|
|
|
public IntPtr class_constructor;
|
2017-12-06 16:03:55 -08:00
|
|
|
///<summary>Destructor of the class.</summary>
|
2017-11-23 16:49:22 -08:00
|
|
|
public IntPtr class_destructor;
|
|
|
|
}
|
|
|
|
|
2017-12-06 16:03:55 -08:00
|
|
|
///<summary>Description of an Eo API operation.</summary>
|
2017-11-23 16:49:22 -08:00
|
|
|
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Ansi)]
|
2019-10-17 09:57:22 -07:00
|
|
|
public struct EflOpDescription
|
2017-11-23 16:49:22 -08:00
|
|
|
{
|
2017-12-06 16:03:55 -08:00
|
|
|
///<summary>The EAPI function offering this op. (String with the name of the function on Windows)</summary>
|
2017-11-23 16:49:22 -08:00
|
|
|
public IntPtr api_func;
|
2017-12-06 16:03:55 -08:00
|
|
|
///<summary>The static function to be called for this op</summary>
|
2017-11-23 16:49:22 -08:00
|
|
|
public IntPtr func;
|
|
|
|
}
|
|
|
|
|
2017-12-06 16:03:55 -08:00
|
|
|
///<summary>List of operations on a given Object.</summary>
|
2017-11-23 16:49:22 -08:00
|
|
|
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Ansi)]
|
2019-10-17 09:57:22 -07:00
|
|
|
public struct EflObjectOps
|
2017-11-23 16:49:22 -08:00
|
|
|
{
|
2017-12-06 16:03:55 -08:00
|
|
|
///<summary>The op descriptions array of size count.</summary>
|
|
|
|
public IntPtr descs;
|
|
|
|
///<summary>Number of op descriptions.</summary>
|
|
|
|
public UIntPtr count;
|
2017-11-23 16:49:22 -08:00
|
|
|
};
|
|
|
|
|
mono: fix space and brace warnings of StyleCop
Summary:
The following warning rules of StyleCop are checked.
Space rules : SA1000, SA1003, SA1008, SA1009, SA1010, SA1011
Brace rules : SA1500, SA1501, SA1502, SA1503, SA1513
Indentation is also applied.
Reviewers: lauromoura, felipealmeida, vitor.sousa, woohyun
Reviewed By: vitor.sousa
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D8485
2019-04-02 07:51:05 -07:00
|
|
|
namespace Efl
|
|
|
|
{
|
2017-11-23 16:49:22 -08:00
|
|
|
|
2019-09-30 06:26:17 -07:00
|
|
|
///<summary>This struct holds the description of a specific event (Since EFL 1.22).</summary>
|
2017-11-23 16:49:22 -08:00
|
|
|
[StructLayout(LayoutKind.Sequential)]
|
mono: fix space and brace warnings of StyleCop
Summary:
The following warning rules of StyleCop are checked.
Space rules : SA1000, SA1003, SA1008, SA1009, SA1010, SA1011
Brace rules : SA1500, SA1501, SA1502, SA1503, SA1513
Indentation is also applied.
Reviewers: lauromoura, felipealmeida, vitor.sousa, woohyun
Reviewed By: vitor.sousa
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D8485
2019-04-02 07:51:05 -07:00
|
|
|
public struct EventDescription
|
|
|
|
{
|
2019-09-30 06:26:17 -07:00
|
|
|
///<summary>Name of the event.</summary>
|
2017-12-12 06:06:46 -08:00
|
|
|
public IntPtr Name;
|
2019-09-30 06:26:17 -07:00
|
|
|
///<summary><c>true</c> if the event cannot be frozen.</summary>
|
2017-12-12 06:06:46 -08:00
|
|
|
[MarshalAs(UnmanagedType.U1)] public bool Unfreezable;
|
2019-09-30 06:26:17 -07:00
|
|
|
///<summary>Internal use: <c>true</c> if this is a legacy event.</summary>
|
2017-12-12 06:06:46 -08:00
|
|
|
[MarshalAs(UnmanagedType.U1)] public bool Legacy_is;
|
2019-09-30 06:26:17 -07:00
|
|
|
///<summary><c>true</c> if when the even is triggered again from a callback it
|
|
|
|
///will start from where it was.</summary>
|
2017-12-12 06:06:46 -08:00
|
|
|
[MarshalAs(UnmanagedType.U1)] public bool Restart;
|
2017-11-23 16:49:22 -08:00
|
|
|
|
|
|
|
private static Dictionary<string, IntPtr> descriptions = new Dictionary<string, IntPtr>();
|
|
|
|
|
2019-09-30 06:26:17 -07:00
|
|
|
///<summary>Constructor for EventDescription</summary>
|
|
|
|
///<param name="moduleName">The name of the module containing the event.</param>
|
|
|
|
///<param name="name">The name of the event.</param>
|
|
|
|
public EventDescription(string moduleName, string name)
|
2018-09-05 10:25:11 -07:00
|
|
|
{
|
2019-09-30 06:26:17 -07:00
|
|
|
this.Name = GetNative(moduleName, name);
|
2018-09-05 10:25:11 -07:00
|
|
|
this.Unfreezable = false;
|
|
|
|
this.Legacy_is = false;
|
|
|
|
this.Restart = false;
|
|
|
|
}
|
|
|
|
|
2019-09-30 06:26:17 -07:00
|
|
|
///<summary>Get the native structure.</summary>
|
|
|
|
///<param name="moduleName">The name of the module containing the event.</param>
|
|
|
|
///<param name="name">The name of the event.</param>
|
|
|
|
///<returns>Pointer to the native structure.</returns>
|
|
|
|
public static IntPtr GetNative(string moduleName, string name)
|
2017-11-23 16:49:22 -08:00
|
|
|
{
|
|
|
|
if (!descriptions.ContainsKey(name))
|
|
|
|
{
|
2019-09-30 06:26:17 -07:00
|
|
|
IntPtr data = Efl.Eo.FunctionInterop.LoadFunctionPointer(moduleName, name);
|
2017-11-23 16:49:22 -08:00
|
|
|
|
mono: fix space and brace warnings of StyleCop
Summary:
The following warning rules of StyleCop are checked.
Space rules : SA1000, SA1003, SA1008, SA1009, SA1010, SA1011
Brace rules : SA1500, SA1501, SA1502, SA1503, SA1513
Indentation is also applied.
Reviewers: lauromoura, felipealmeida, vitor.sousa, woohyun
Reviewed By: vitor.sousa
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D8485
2019-04-02 07:51:05 -07:00
|
|
|
if (data == IntPtr.Zero)
|
|
|
|
{
|
csharp: Change to new class API.
Summary:
As discussed in T7204:
- Eo Interfaces/mixins -> C# Interfaces with concrete class
implementations
- Eo Regular/Abstracts -> Proper C# classes
- Added some new generators and helper methods.
- Refactored the class generator, splitting into helper methods
Eo handles now are stored only in the "root" class in any given
inheritance tree (generally, Efl.Object), and accessible to each child.
Methods also are defined in a single place instead of repeatedly
generated in everyfile, reducing the size of the generated .dll from
30MB to around 4.5MB.
Mixins are generated as C# interfaces but any regular class it inherits
from is lost, as we can't have interfaces inheriting from regular
classes. This will be dealt with in a later commit.
Summary of API Changes:
- Merged Inherit/Concrete classes. (These suffixes disappear from
regular classes).
- Interface still have implementations with 'Concrete' suffix for when
they are returned from methods.
- Removed 'I' from interface names.
- Removed interfaces for regular/abstract Eo classes.
- Concrete classes for interfaces/mixins hold the event argument struct.
- Removed '_' from classes, enums, structs, etc, as indicated in C#
naming conventions.
- Namespaces are now Camel.Cased.
- Renamed IWrapper's raw_handle/raw_klass to NativeHandle/NativeClass
Also renamed the test classes as after the namespace change, the
test namespace Test can conflict with the helper Test namespace.
(And use more meaningful names than Test.Testing...)
Also Fixes T7336 by removing a deprecated example and adding
efl_loop_timer_example to build system.
Fixes T7451 by hiding the class_get DllImports and renaming the IWrapper
fields. The native handlers are used in the manual binding.
Still need to work:
- As there are still some events names clashing (e.g. Efl.Ui.Bg with "resize"
from Efl.Gfx.Entity and Efl.Gfx.Image), Events are currently declared on
the interface and implemented "namespaced" in the classes,
requiring the cast to the interface to access the event.
- The Mixin Conundrum. Mixin inheritance will be dealt in a future
commit.
Depends on D7260
Reviewers: segfaultxavi, vitor.sousa, felipealmeida, Jaehyun_Cho
Reviewed By: vitor.sousa
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T7451, T7336
Differential Revision: https://phab.enlightenment.org/D7262
2018-11-29 15:04:37 -08:00
|
|
|
string error = Eina.StringConversion.NativeUtf8ToManagedString(Efl.Eo.Globals.dlerror());
|
2017-11-23 16:49:22 -08:00
|
|
|
throw new Exception(error);
|
|
|
|
}
|
mono: fix space and brace warnings of StyleCop
Summary:
The following warning rules of StyleCop are checked.
Space rules : SA1000, SA1003, SA1008, SA1009, SA1010, SA1011
Brace rules : SA1500, SA1501, SA1502, SA1503, SA1513
Indentation is also applied.
Reviewers: lauromoura, felipealmeida, vitor.sousa, woohyun
Reviewed By: vitor.sousa
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D8485
2019-04-02 07:51:05 -07:00
|
|
|
|
2017-11-23 16:49:22 -08:00
|
|
|
descriptions.Add(name, data);
|
|
|
|
}
|
mono: fix space and brace warnings of StyleCop
Summary:
The following warning rules of StyleCop are checked.
Space rules : SA1000, SA1003, SA1008, SA1009, SA1010, SA1011
Brace rules : SA1500, SA1501, SA1502, SA1503, SA1513
Indentation is also applied.
Reviewers: lauromoura, felipealmeida, vitor.sousa, woohyun
Reviewed By: vitor.sousa
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D8485
2019-04-02 07:51:05 -07:00
|
|
|
|
2018-09-05 10:25:11 -07:00
|
|
|
return descriptions[name];
|
2017-11-23 16:49:22 -08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
csharp: fix EFL# by updating it to reflect the newest changes in Eolian
Summary:
`Efl.Event` became a builtin type that is no longer declared in `efl_object.eo`,
and therefore it is no longer automatically generated in EFL#.
Given that, we define a struct manually to reflect the memory layout of the
native struct.
Containers of value types are now allowed in eolian, so tests that were disabled
because of the restriction on `ptr` were re-enabled using the plain type.
But since these containers have just arrived, handling of ownership for value
types is currently undefined in bindings.
Hence, tests that used `ptr(int) @owned` as elements were left disable.
This will be solved in a future patch.
`void_pr` is now deprecated, so we remove it from tests also.
Reviewers: q66, segfaultxavi, lauromoura, felipealmeida
Reviewed By: lauromoura
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9417
2019-07-26 10:40:38 -07:00
|
|
|
/// <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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-03-25 13:14:32 -07:00
|
|
|
public delegate void EventCb(System.IntPtr data, ref Event.NativeStruct evt);
|
csharp: Refactor wrapper lifetime.
Summary:
This commit makes use of the `ownership,shared` and `ownership,unique`
events from Efl.Object in order to avoid the C# wrapper from being
collected while C code holds a reference to the object.
For example, creating a list of items in a for loop and attaching events to
them would fails without this commit, as the C# GC may collect the wrapper.
The basic idea is that we use a `WrapperSupervisor`, which is stored in
the Eo data storage, with a GCHandle allocated for the lifetime of the
underlying Eo object. This supervisor takes care of holding either a
weak C# reference (when in unique mode, allowing the wrapper to be GC'd)
or a hard C# reference (when in shared mode, making the wrapper
non-collectable while the Eo has extra references).
One limitation is that object graphs can leak if a shared object in the
graph - an Eo child for example - stores a hard reference to another
object in the graph as a C# field. In this example, this causes the
parent to always have a hard C# reference (from the child) as the child
is non-collectable due to the parent holding an Eo reference to it.
Depends on D8678
Test Plan: `ninja test` and `make test`
Reviewers: lauromoura, felipealmeida, woohyun, segfaultxavi
Reviewed By: lauromoura
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9014
2019-05-31 13:43:11 -07:00
|
|
|
public delegate void FreeWrapperSupervisorCb(System.IntPtr obj);
|
2017-11-23 16:49:22 -08:00
|
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential)]
|
mono: fix space and brace warnings of StyleCop
Summary:
The following warning rules of StyleCop are checked.
Space rules : SA1000, SA1003, SA1008, SA1009, SA1010, SA1011
Brace rules : SA1500, SA1501, SA1502, SA1503, SA1513
Indentation is also applied.
Reviewers: lauromoura, felipealmeida, vitor.sousa, woohyun
Reviewed By: vitor.sousa
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D8485
2019-04-02 07:51:05 -07:00
|
|
|
public struct TextCursorCursor
|
|
|
|
{
|
2017-11-23 16:49:22 -08:00
|
|
|
IntPtr obj;
|
|
|
|
UIntPtr pos; // UIntPtr to automatically change size_t between 32/64
|
|
|
|
IntPtr node;
|
|
|
|
[MarshalAsAttribute(UnmanagedType.U1)]bool changed;
|
|
|
|
}
|
|
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential)]
|
mono: fix space and brace warnings of StyleCop
Summary:
The following warning rules of StyleCop are checked.
Space rules : SA1000, SA1003, SA1008, SA1009, SA1010, SA1011
Brace rules : SA1500, SA1501, SA1502, SA1503, SA1513
Indentation is also applied.
Reviewers: lauromoura, felipealmeida, vitor.sousa, woohyun
Reviewed By: vitor.sousa
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D8485
2019-04-02 07:51:05 -07:00
|
|
|
public struct TextAnnotateAnnotation
|
|
|
|
{
|
2017-11-23 16:49:22 -08:00
|
|
|
IntPtr list;
|
|
|
|
IntPtr obj;
|
|
|
|
IntPtr start_node;
|
|
|
|
IntPtr end_node;
|
|
|
|
[MarshalAsAttribute(UnmanagedType.U1)]bool is_item;
|
|
|
|
}
|
|
|
|
|
mono: fix space and brace warnings of StyleCop
Summary:
The following warning rules of StyleCop are checked.
Space rules : SA1000, SA1003, SA1008, SA1009, SA1010, SA1011
Brace rules : SA1500, SA1501, SA1502, SA1503, SA1513
Indentation is also applied.
Reviewers: lauromoura, felipealmeida, vitor.sousa, woohyun
Reviewed By: vitor.sousa
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D8485
2019-04-02 07:51:05 -07:00
|
|
|
namespace Access
|
|
|
|
{
|
2017-11-23 16:49:22 -08:00
|
|
|
|
mono: fix space and brace warnings of StyleCop
Summary:
The following warning rules of StyleCop are checked.
Space rules : SA1000, SA1003, SA1008, SA1009, SA1010, SA1011
Brace rules : SA1500, SA1501, SA1502, SA1503, SA1513
Indentation is also applied.
Reviewers: lauromoura, felipealmeida, vitor.sousa, woohyun
Reviewed By: vitor.sousa
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D8485
2019-04-02 07:51:05 -07:00
|
|
|
public struct ActionData
|
|
|
|
{
|
2017-11-23 16:49:22 -08:00
|
|
|
public IntPtr name;
|
|
|
|
public IntPtr action;
|
|
|
|
public IntPtr param;
|
|
|
|
public IntPtr func;
|
|
|
|
}
|
|
|
|
|
csharp: Change to new class API.
Summary:
As discussed in T7204:
- Eo Interfaces/mixins -> C# Interfaces with concrete class
implementations
- Eo Regular/Abstracts -> Proper C# classes
- Added some new generators and helper methods.
- Refactored the class generator, splitting into helper methods
Eo handles now are stored only in the "root" class in any given
inheritance tree (generally, Efl.Object), and accessible to each child.
Methods also are defined in a single place instead of repeatedly
generated in everyfile, reducing the size of the generated .dll from
30MB to around 4.5MB.
Mixins are generated as C# interfaces but any regular class it inherits
from is lost, as we can't have interfaces inheriting from regular
classes. This will be dealt with in a later commit.
Summary of API Changes:
- Merged Inherit/Concrete classes. (These suffixes disappear from
regular classes).
- Interface still have implementations with 'Concrete' suffix for when
they are returned from methods.
- Removed 'I' from interface names.
- Removed interfaces for regular/abstract Eo classes.
- Concrete classes for interfaces/mixins hold the event argument struct.
- Removed '_' from classes, enums, structs, etc, as indicated in C#
naming conventions.
- Namespaces are now Camel.Cased.
- Renamed IWrapper's raw_handle/raw_klass to NativeHandle/NativeClass
Also renamed the test classes as after the namespace change, the
test namespace Test can conflict with the helper Test namespace.
(And use more meaningful names than Test.Testing...)
Also Fixes T7336 by removing a deprecated example and adding
efl_loop_timer_example to build system.
Fixes T7451 by hiding the class_get DllImports and renaming the IWrapper
fields. The native handlers are used in the manual binding.
Still need to work:
- As there are still some events names clashing (e.g. Efl.Ui.Bg with "resize"
from Efl.Gfx.Entity and Efl.Gfx.Image), Events are currently declared on
the interface and implemented "namespaced" in the classes,
requiring the cast to the interface to access the event.
- The Mixin Conundrum. Mixin inheritance will be dealt in a future
commit.
Depends on D7260
Reviewers: segfaultxavi, vitor.sousa, felipealmeida, Jaehyun_Cho
Reviewed By: vitor.sousa
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T7451, T7336
Differential Revision: https://phab.enlightenment.org/D7262
2018-11-29 15:04:37 -08:00
|
|
|
} // namespace Access
|
|
|
|
|
|
|
|
} // namespace Efl
|
|
|
|
|
2017-11-23 16:49:22 -08:00
|
|
|
// Global delegates
|
csharp: Change to new class API.
Summary:
As discussed in T7204:
- Eo Interfaces/mixins -> C# Interfaces with concrete class
implementations
- Eo Regular/Abstracts -> Proper C# classes
- Added some new generators and helper methods.
- Refactored the class generator, splitting into helper methods
Eo handles now are stored only in the "root" class in any given
inheritance tree (generally, Efl.Object), and accessible to each child.
Methods also are defined in a single place instead of repeatedly
generated in everyfile, reducing the size of the generated .dll from
30MB to around 4.5MB.
Mixins are generated as C# interfaces but any regular class it inherits
from is lost, as we can't have interfaces inheriting from regular
classes. This will be dealt with in a later commit.
Summary of API Changes:
- Merged Inherit/Concrete classes. (These suffixes disappear from
regular classes).
- Interface still have implementations with 'Concrete' suffix for when
they are returned from methods.
- Removed 'I' from interface names.
- Removed interfaces for regular/abstract Eo classes.
- Concrete classes for interfaces/mixins hold the event argument struct.
- Removed '_' from classes, enums, structs, etc, as indicated in C#
naming conventions.
- Namespaces are now Camel.Cased.
- Renamed IWrapper's raw_handle/raw_klass to NativeHandle/NativeClass
Also renamed the test classes as after the namespace change, the
test namespace Test can conflict with the helper Test namespace.
(And use more meaningful names than Test.Testing...)
Also Fixes T7336 by removing a deprecated example and adding
efl_loop_timer_example to build system.
Fixes T7451 by hiding the class_get DllImports and renaming the IWrapper
fields. The native handlers are used in the manual binding.
Still need to work:
- As there are still some events names clashing (e.g. Efl.Ui.Bg with "resize"
from Efl.Gfx.Entity and Efl.Gfx.Image), Events are currently declared on
the interface and implemented "namespaced" in the classes,
requiring the cast to the interface to access the event.
- The Mixin Conundrum. Mixin inheritance will be dealt in a future
commit.
Depends on D7260
Reviewers: segfaultxavi, vitor.sousa, felipealmeida, Jaehyun_Cho
Reviewed By: vitor.sousa
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T7451, T7336
Differential Revision: https://phab.enlightenment.org/D7262
2018-11-29 15:04:37 -08:00
|
|
|
public delegate void EinaFreeCb(IntPtr data);
|
|
|
|
public delegate void EvasSmartCb(IntPtr data, IntPtr obj, IntPtr event_info);
|