aboutsummaryrefslogtreecommitdiffstats
path: root/src/examples
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2018-11-29 21:04:37 -0200
committerVitor Sousa <vitorsousa@expertisesolutions.com.br>2018-11-29 21:29:48 -0200
commit3623753c1d6b893955a1c31e8559a2312f674192 (patch)
treee862682ff92d34ce4ebf44c95efa24ba3a57fe7a /src/examples
parentelementary: Support using no frame object (diff)
downloadefl-3623753c1d6b893955a1c31e8559a2312f674192.tar.gz
csharp: Change to new class API.
Summary: As discussed in https://phab.enlightenment.org/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 https://phab.enlightenment.org/T7336 by removing a deprecated example and adding efl_loop_timer_example to build system. Fixes https://phab.enlightenment.org/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 https://phab.enlightenment.org/D7260 Reviewers: segfaultxavi, vitor.sousa, felipealmeida, Jaehyun_Cho Reviewed By: vitor.sousa Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: https://phab.enlightenment.org/T7451, https://phab.enlightenment.org/T7336 Differential Revision: https://phab.enlightenment.org/D7262
Diffstat (limited to 'src/examples')
-rw-r--r--src/examples/ecore.mk19
-rw-r--r--src/examples/ecore/efl_loop_callback_add_event.cs43
-rw-r--r--src/examples/ecore/efl_mono_loop_timer_example.cs (renamed from src/examples/ecore/efl_loop_timer_example.cs)31
-rw-r--r--src/examples/efl_mono/EoInherit01.cs10
-rw-r--r--src/examples/efl_mono/FunctionPointer01.cs6
-rw-r--r--src/examples/eina/EinaArray01.cs4
-rw-r--r--src/examples/eina/EinaBinbuf01.cs4
-rw-r--r--src/examples/eina/EinaError01.cs34
-rw-r--r--src/examples/eina/EinaHash01.cs4
-rw-r--r--src/examples/elementary/efl_ui_slider_mono.cs34
-rw-r--r--src/examples/elementary/efl_ui_unit_converter.cs56
-rw-r--r--src/examples/evas/evas_mono_box.cs28
-rw-r--r--src/examples/evas/evas_mono_image.cs30
-rw-r--r--src/examples/evas/evas_mono_image2.cs18
-rw-r--r--src/examples/evas/evas_mono_rectangle.cs20
-rw-r--r--src/examples/evas/evas_mono_table.cs30
-rw-r--r--src/examples/evas/evas_mono_text.cs35
17 files changed, 193 insertions, 213 deletions
diff --git a/src/examples/ecore.mk b/src/examples/ecore.mk
index 014cb4ef66..0e4bbee8c6 100644
--- a/src/examples/ecore.mk
+++ b/src/examples/ecore.mk
@@ -391,6 +391,25 @@ ecore_ecore_ipc_server_example_CPPFLAGS = $(ECORE_COMMON_CPPFLAGS) $(AM_CPPFLAGS
ecore_ecore_ipc_client_example_SOURCES = ecore/ecore_ipc_client_example.c
ecore_ecore_ipc_client_example_CPPFLAGS = $(ECORE_COMMON_CPPFLAGS) $(AM_CPPFLAGS)
+if HAVE_CSHARP
+
+if HAVE_WIN32
+MCSFLAGS ?=
+MCSFLAGS += -define:WIN32
+endif
+
+EXTRA_PROGRAMS += \
+ecore/efl_mono_loop_timer_example
+
+ecore_efl_mono_loop_timer_example_SOURCES = \
+ ecore/efl_mono_loop_timer_example.cs
+
+ecore/efl_mono_loop_timer_example$(EXEEXT): $(ecore_efl_mono_loop_timer_example_SOURCES) $(am_dirstamp) $(top_builddir)/src/lib/efl_mono/libefl_mono.dll
+ @rm -f ecore/efl_mono_loop_timer_example$(EXEEXT)
+ $(AM_V_MCS) $(MCS) $(MCSFLAGS) -r:$(abs_top_builddir)/src/lib/efl_mono/libefl_mono.dll -out:$@ $(filter %.cs, $(^))
+
+endif
+
ECORE_SRCS = \
ecore/ecore_animator_example.c \
diff --git a/src/examples/ecore/efl_loop_callback_add_event.cs b/src/examples/ecore/efl_loop_callback_add_event.cs
deleted file mode 100644
index fe81bfd9ad..0000000000
--- a/src/examples/ecore/efl_loop_callback_add_event.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-using System;
-using System.Runtime.InteropServices;
-using System.Runtime.CompilerServices;
-
-class TestMain
-{
- /* private efl.Loop loop; */
-
- public TestMain(efl.Loop loop)
- {
- /* this.loop = loop; */
- }
-
- static void Main(string[] args)
- {
- efl.All.Init();
-
- efl.Loop loop = new efl.LoopConcrete();
-
- TestMain listener = new TestMain(loop);
-
- loop.CALLBACK_ADD += listener.callback_added_cb;
-
- loop.CALLBACK_ADD += listener.on_idle_enter;
- loop.CALLBACK_ADD -= listener.on_idle_enter;
-
- loop.IDLE += listener.on_idle_enter; // Will trigger CALLBACK_ADD
-
- efl.All.Shutdown();
- }
-
- public void on_idle_enter(object sender, EventArgs e)
- {
- Console.WriteLine("I should not be called while the loop is not running...");
- }
-
- public void callback_added_cb(object sender, EventArgs e)
- {
- Console.WriteLine("Looks like we added a new callback.");
- }
-}
-
-
diff --git a/src/examples/ecore/efl_loop_timer_example.cs b/src/examples/ecore/efl_mono_loop_timer_example.cs
index dd6b2b8606..8c692753a4 100644
--- a/src/examples/ecore/efl_loop_timer_example.cs
+++ b/src/examples/ecore/efl_mono_loop_timer_example.cs
@@ -4,10 +4,10 @@ using System.Runtime.CompilerServices;
class TestMain
{
- private efl.Loop loop;
+ private Efl.Loop loop;
private int count;
- public TestMain(efl.Loop loop)
+ public TestMain(Efl.Loop loop)
{
this.loop = loop;
this.count = 0;
@@ -15,32 +15,35 @@ class TestMain
static void Main(string[] args)
{
- efl.All.Init();
+ Efl.All.Init();
- efl.Loop loop = new efl.LoopConcrete();
- efl.loop.Timer timer = new efl.loop.TimerConcrete(loop);
+ var loop = new Efl.Loop();
+ var timer = new Efl.LoopTimer(loop, (Efl.LoopTimer t) => {
+ t.SetInterval(1.0);
+ });
TestMain listener = new TestMain(loop);
Console.WriteLine("Starting MainLoop");
- timer.interval_set(1.0);
+ timer.TickEvt += listener.on_tick;
+ timer.TickEvt += listener.another_callback;
+ timer.TickEvt -= listener.another_callback;
- timer.TICK += listener.on_tick;
- timer.TICK += listener.another_callback;
- timer.TICK -= listener.another_callback;
+ loop.Begin();
- loop.begin();
-
- efl.All.Shutdown();
+ Efl.All.Shutdown();
}
public void on_tick(object sender, EventArgs e)
{
Console.WriteLine("on_tick called on listener");
- if (count++ == 5)
- loop.quit(0);
+ if (count++ == 5) {
+ Eina.Value v = new Eina.Value(Eina.ValueType.Int32);
+ v.Set(0);
+ loop.Quit(v);
+ }
}
public void another_callback(object sender, EventArgs e)
diff --git a/src/examples/efl_mono/EoInherit01.cs b/src/examples/efl_mono/EoInherit01.cs
index cf35ca5f3e..26cff96c1a 100644
--- a/src/examples/efl_mono/EoInherit01.cs
+++ b/src/examples/efl_mono/EoInherit01.cs
@@ -1,8 +1,8 @@
using static System.Console;
-class PlusTenNumberWrapper : example.NumberwrapperInherit
+class PlusTenNumberWrapper : Example.Numberwrapper
{
- public PlusTenNumberWrapper(efl.IObject parent = null)
+ public PlusTenNumberWrapper(Efl.Object parent = null)
: base(parent)
{}
@@ -20,8 +20,8 @@ public class ExampleEoInherit01
{
public static void Main()
{
- eina.Config.Init();
- efl.eo.Config.Init();
+ Eina.Config.Init();
+ Efl.Eo.Config.Init();
var inheritObj = new PlusTenNumberWrapper();
@@ -52,7 +52,7 @@ public class ExampleEoInherit01
WriteLine("## Using original object ##\n");
// Check original EFL object
- var origObj = new example.Numberwrapper();
+ var origObj = new Example.Numberwrapper();
given = 111;
origObj.SetNumber(given);
stored = origObj.GetNumber();
diff --git a/src/examples/efl_mono/FunctionPointer01.cs b/src/examples/efl_mono/FunctionPointer01.cs
index c32f53cd51..3eaa29d91c 100644
--- a/src/examples/efl_mono/FunctionPointer01.cs
+++ b/src/examples/efl_mono/FunctionPointer01.cs
@@ -12,10 +12,10 @@ public class ExampleFunctionPointer01
public static void Main()
{
- eina.Config.Init();
- efl.eo.Config.Init();
+ Eina.Config.Init();
+ Efl.Eo.Config.Init();
- var obj = new example.Numberwrapper();
+ var obj = new Example.Numberwrapper();
// Set internal value
obj.SetNumber(12);
diff --git a/src/examples/eina/EinaArray01.cs b/src/examples/eina/EinaArray01.cs
index 4ac4a77812..944c0bd397 100644
--- a/src/examples/eina/EinaArray01.cs
+++ b/src/examples/eina/EinaArray01.cs
@@ -4,7 +4,7 @@ public class ExampleEinaArray01
{
public static void Main()
{
- eina.Config.Init();
+ Eina.Config.Init();
var strings = new string[]{
"helo", "hera", "starbuck", "kat", "boomer",
@@ -13,7 +13,7 @@ public class ExampleEinaArray01
"skulls", "bulldog", "flat top", "hammerhead", "gonzo"
};
- var array = new eina.Array<string>(20U);
+ var array = new Eina.Array<string>(20U);
// Push new elements
foreach (string s in strings)
diff --git a/src/examples/eina/EinaBinbuf01.cs b/src/examples/eina/EinaBinbuf01.cs
index 395616879d..5482328ea2 100644
--- a/src/examples/eina/EinaBinbuf01.cs
+++ b/src/examples/eina/EinaBinbuf01.cs
@@ -4,11 +4,11 @@ public class ExampleEinaBinbuf01
{
public static void Main()
{
- eina.Config.Init();
+ Eina.Config.Init();
var bytes = new byte[]{0, 1, 2, 3, 4, 5, 6};
- var bb = new eina.Binbuf();
+ var bb = new Eina.Binbuf();
// Append initial bytes
bb.Append(bytes);
diff --git a/src/examples/eina/EinaError01.cs b/src/examples/eina/EinaError01.cs
index 61af99508b..09062717c7 100644
--- a/src/examples/eina/EinaError01.cs
+++ b/src/examples/eina/EinaError01.cs
@@ -3,73 +3,73 @@ using static System.Console;
public class ExampleEinaError01
{
private static bool RegisteredErrors = false;
- private static eina.Error MyErrorNegative;
- private static eina.Error MyErrorNull;
+ private static Eina.Error MyErrorNegative;
+ private static Eina.Error MyErrorNull;
private static void testFunc(int n, string s)
{
if (!RegisteredErrors)
{
- MyErrorNegative = eina.Error.Register("Negative number");
- MyErrorNull = eina.Error.Register("NULL pointer");
+ MyErrorNegative = Eina.Error.Register("Negative number");
+ MyErrorNull = Eina.Error.Register("NULL pointer");
RegisteredErrors = true;
}
if (n < 0)
{
- eina.Error.Set(MyErrorNegative);
+ Eina.Error.Set(MyErrorNegative);
return;
}
if (s == null)
{
- eina.Error.Set(MyErrorNull);
+ Eina.Error.Set(MyErrorNull);
return;
}
}
public static void Main()
{
- eina.Config.Init();
- efl.eo.Config.Init();
+ Eina.Config.Init();
+ Efl.Eo.Config.Init();
// Handling Eina_Error with exception
try
{
testFunc(-1, "abc");
- eina.Error.RaiseIfOccurred();
+ Eina.Error.RaiseIfOccurred();
}
- catch(efl.EflException e)
+ catch(Efl.EflException e)
{
WriteLine($"Caught error: {e.Message}");
}
// Handling Eina_Error directly
testFunc(42, null);
- eina.Error err = eina.Error.Get();
+ Eina.Error err = Eina.Error.Get();
if (err != 0)
{
WriteLine($"Error set: {err.Message}");
}
- eina.Error.Clear();
+ Eina.Error.Clear();
// No error set
try
{
testFunc(42, "abc");
- eina.Error.RaiseIfOccurred();
+ Eina.Error.RaiseIfOccurred();
- err = eina.Error.Get();
- WriteLine($"Really no error? {err == eina.Error.NO_ERROR}.");
+ err = Eina.Error.Get();
+ WriteLine($"Really no error? {err == Eina.Error.NO_ERROR}.");
}
catch
{
WriteLine("Unspected error!!!");
}
- WriteLine("No error message is empty string: \"{0}\"", eina.Error.NO_ERROR.Message);
- WriteLine("No error message is empty string: \"{0}\"", eina.Error.MsgGet(0));
+ WriteLine("No error message is empty string: \"{0}\"", Eina.Error.NO_ERROR.Message);
+ WriteLine("No error message is empty string: \"{0}\"", Eina.Error.MsgGet(0));
}
}
diff --git a/src/examples/eina/EinaHash01.cs b/src/examples/eina/EinaHash01.cs
index a645dde1ab..31f3c152f9 100644
--- a/src/examples/eina/EinaHash01.cs
+++ b/src/examples/eina/EinaHash01.cs
@@ -4,9 +4,9 @@ public class ExampleEinaHash01
{
public static void Main()
{
- eina.Config.Init();
+ Eina.Config.Init();
- var phone_book = new eina.Hash<string, string>();
+ var phone_book = new Eina.Hash<string, string>();
// Add initial entries to our hash
phone_book.Add("Wolfgang Amadeus Mozart", "+01 23 456-78910");
diff --git a/src/examples/elementary/efl_ui_slider_mono.cs b/src/examples/elementary/efl_ui_slider_mono.cs
index 62b3504fcd..3ef10cbb0e 100644
--- a/src/examples/elementary/efl_ui_slider_mono.cs
+++ b/src/examples/elementary/efl_ui_slider_mono.cs
@@ -2,20 +2,20 @@ using System;
public class Example
{
- public static efl.ui.IButton CreateButton(efl.IObject parent,
+ public static Efl.Ui.Button CreateButton(Efl.Object parent,
string text,
int w, int h,
EventHandler callback) {
- efl.ui.IButton button = new efl.ui.Button(parent);
+ Efl.Ui.Button button = new Efl.Ui.Button(parent);
button.SetText(text);
- button.SetSize(new eina.Size2D(w, h));
+ button.SetSize(new Eina.Size2D(w, h));
- button.ClickedEvt += callback;
+ ((Efl.Ui.Clickable)button).ClickedEvt += callback;
return button;
}
- public static void Formatter(eina.Strbuf buf, eina.Value val){
+ public static void Formatter(Eina.Strbuf buf, Eina.Value val){
double ratio;
if (val.Get(out ratio)) {
buf.Append($"{(int)(ratio*100)}%");
@@ -34,27 +34,27 @@ public class Example
int W = 120;
int H = 30;
- efl.All.Init(efl.Components.Ui);
+ Efl.All.Init(Efl.Components.Ui);
- efl.ui.Win win = new efl.ui.Win(null);
+ Efl.Ui.Win win = new Efl.Ui.Win(null);
win.SetText("Hello, C#!!");
win.SetAutohide(true);
- efl.ui.Box_Flow box = new efl.ui.Box_Flow(win);
+ Efl.Ui.BoxFlow box = new Efl.Ui.BoxFlow(win);
- efl.ui.IButton button = CreateButton(box, "Click to exit", 120, 30,
+ Efl.Ui.Button button = CreateButton(box, "Click to exit", 120, 30,
(object sender, EventArgs e) => {
- efl.ui.Config.Exit();
+ Efl.Ui.Config.Exit();
});
box.DoPack(button);
- efl.ui.Progressbar bar = new efl.ui.Progressbar(box);
- bar.SetSize(new eina.Size2D(W, H));
+ Efl.Ui.Progressbar bar = new Efl.Ui.Progressbar(box);
+ bar.SetSize(new Eina.Size2D(W, H));
bar.SetFormatCb(Formatter);
- efl.ui.ISlider slider = new efl.ui.Slider(box);
- slider.SetSize(new eina.Size2D(W, H));
+ Efl.Ui.Slider slider = new Efl.Ui.Slider(box);
+ slider.SetSize(new Eina.Size2D(W, H));
slider.ChangedEvt += (object sender, EventArgs e) => {
bar.SetRangeValue(slider.GetRangeValue());
@@ -66,12 +66,12 @@ public class Example
button.SetVisible(true);
box.SetVisible(true);
- win.SetSize(new eina.Size2D(W, 3 * H));
+ win.SetSize(new Eina.Size2D(W, 3 * H));
win.SetVisible(true);
- efl.ui.Config.Run();
+ Efl.Ui.Config.Run();
- efl.All.Shutdown();
+ Efl.All.Shutdown();
}
}
diff --git a/src/examples/elementary/efl_ui_unit_converter.cs b/src/examples/elementary/efl_ui_unit_converter.cs
index 3f6c7abd26..5bbbe1723a 100644
--- a/src/examples/elementary/efl_ui_unit_converter.cs
+++ b/src/examples/elementary/efl_ui_unit_converter.cs
@@ -14,16 +14,16 @@ public class Example
return miles * KMS_PER_MILE;
}
- private static void ShowErrorPopup(efl.ui.Win win, string message)
+ private static void ShowErrorPopup(Efl.Ui.Win win, string message)
{
- efl.ui.IAlert_Popup popup = new efl.ui.Alert_Popup(win);
- efl.ui.Text popup_text = new efl.ui.Text(popup);
+ Efl.Ui.AlertPopup popup = new Efl.Ui.AlertPopup(win);
+ Efl.Ui.Text popup_text = new Efl.Ui.Text(popup);
popup_text.SetText($"Error: {message}");
popup.SetContent(popup_text);
popup.SetVisible(true);
- popup.SetButton(efl.ui.Alert_Popup_Button.Positive, "Ok", null);
- popup.SetSize(new eina.Size2D(150, 30));
- popup.ButtonClickedEvt += (object sender, efl.ui.Alert_Popup.ButtonClickedEvt_Args e) => {
+ popup.SetButton(Efl.Ui.AlertPopupButton.Positive, "Ok", null);
+ popup.SetSize(new Eina.Size2D(150, 30));
+ popup.ButtonClickedEvt += (object sender, Efl.Ui.AlertPopupButtonClickedEvt_Args e) => {
popup.SetParent(null);
popup.Invalidate();
};
@@ -37,34 +37,34 @@ public class Example
public static void Main() {
int W = 120;
int H = 30;
- eina.Size2D size = new eina.Size2D(W, H);
+ Eina.Size2D size = new Eina.Size2D(W, H);
- efl.All.Init(efl.Components.Ui);
+ Efl.All.Init(Efl.Components.Ui);
- efl.ui.Win win = new efl.ui.Win(null);
+ Efl.Ui.Win win = new Efl.Ui.Win(null);
win.SetText("C# Unit Converter");
win.SetAutohide(true);
- efl.ui.Box_Flow box = new efl.ui.Box_Flow(win);
- box.SetDirection(efl.ui.Dir.Horizontal);
+ Efl.Ui.BoxFlow box = new Efl.Ui.BoxFlow(win);
+ box.SetDirection(Efl.Ui.Dir.Horizontal);
- efl.ui.Box_Flow miles_box = new efl.ui.Box_Flow(box);
- miles_box.SetDirection(efl.ui.Dir.Down);
+ Efl.Ui.BoxFlow miles_box = new Efl.Ui.BoxFlow(box);
+ miles_box.SetDirection(Efl.Ui.Dir.Down);
box.DoPack(miles_box);
- efl.ui.Text miles_label = new efl.ui.Text(miles_box);
+ Efl.Ui.Text miles_label = new Efl.Ui.Text(miles_box);
miles_label.SetText("Miles:");
miles_label.SetSize(size);
miles_label.SetVisible(true);
- efl.ui.Text_Editable miles_input = new efl.ui.Text_Editable(miles_box);
+ Efl.Ui.TextEditable miles_input = new Efl.Ui.TextEditable(miles_box);
miles_input.SetText("");
miles_input.SetScrollable(true);
miles_input.SetSize(size);
miles_input.SetVisible(true);
- efl.ui.IButton miles_button = new efl.ui.Button(miles_box);
+ Efl.Ui.Button miles_button = new Efl.Ui.Button(miles_box);
miles_button.SetText("To Km");
miles_button.SetSize(size);
miles_button.SetVisible(true);
@@ -74,23 +74,23 @@ public class Example
miles_box.DoPack(miles_button);
- efl.ui.Box_Flow kms_box = new efl.ui.Box_Flow(box);
- kms_box.SetDirection(efl.ui.Dir.Down);
+ Efl.Ui.BoxFlow kms_box = new Efl.Ui.BoxFlow(box);
+ kms_box.SetDirection(Efl.Ui.Dir.Down);
box.DoPack(kms_box);
- efl.ui.Text kms_label = new efl.ui.Text(kms_box);
+ Efl.Ui.Text kms_label = new Efl.Ui.Text(kms_box);
kms_label.SetText("Kilometers:");
kms_label.SetSize(size);
kms_label.SetVisible(true);
- efl.ui.Text_Editable kms_input = new efl.ui.Text_Editable(kms_box);
+ Efl.Ui.TextEditable kms_input = new Efl.Ui.TextEditable(kms_box);
kms_input.SetText("");
kms_input.SetScrollable(true);
kms_input.SetSize(size);
kms_input.SetVisible(true);
- efl.ui.IButton kms_button = new efl.ui.Button(kms_box);
+ Efl.Ui.Button kms_button = new Efl.Ui.Button(kms_box);
kms_button.SetText("To Miles");
kms_button.SetSize(size);
kms_button.SetVisible(true);
@@ -99,7 +99,7 @@ public class Example
kms_box.DoPack(kms_input);
kms_box.DoPack(kms_button);
- kms_button.ClickedEvt += (object sender, EventArgs e) => {
+ ((Efl.Ui.Clickable)kms_button).ClickedEvt += (object sender, EventArgs e) => {
try
{
string text = kms_input.GetText();
@@ -115,7 +115,7 @@ public class Example
}
};
- miles_button.ClickedEvt += (object sender, EventArgs e) => {
+ ((Efl.Ui.Clickable)miles_button).ClickedEvt += (object sender, EventArgs e) => {
try
{
string text = miles_input.GetText();
@@ -134,17 +134,17 @@ public class Example
kms_box.SetVisible(true);
miles_box.SetVisible(true);
- box.SetPosition(new eina.Position2D(20, 30));
+ box.SetPosition(new Eina.Position2D(20, 30));
box.SetVisible(true);
- win.SetPosition(new eina.Position2D(200, 200));
+ win.SetPosition(new Eina.Position2D(200, 200));
- win.SetSize(new eina.Size2D(400, 120));
+ win.SetSize(new Eina.Size2D(400, 120));
win.SetVisible(true);
- efl.ui.Config.Run();
+ Efl.Ui.Config.Run();
- efl.All.Shutdown();
+ Efl.All.Shutdown();
}
}
diff --git a/src/examples/evas/evas_mono_box.cs b/src/examples/evas/evas_mono_box.cs
index 97c161c536..dbfd15e372 100644
--- a/src/examples/evas/evas_mono_box.cs
+++ b/src/examples/evas/evas_mono_box.cs
@@ -2,9 +2,9 @@ using System;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
-public class MyBox : evas.BoxInherit
+public class MyBox : Evas.Box
{
- public MyBox(efl.IObject parent) : base(parent) {}
+ public MyBox(Efl.Object parent) : base(parent) {}
[DllImport("evas")] static extern void evas_obj_box_layout_vertical(IntPtr obj, IntPtr data, IntPtr privdata);
[DllImport("evas")] static extern void evas_obj_box_layout_horizontal(IntPtr obj, IntPtr data, IntPtr privdata);
@@ -15,11 +15,11 @@ public class MyBox : evas.BoxInherit
override public void CalculateGroup()
{
- IntPtr evas = evas_object_evas_get(raw_handle);
+ IntPtr evas = evas_object_evas_get(NativeHandle);
evas_event_freeze(evas);
Console.WriteLine("called group_calculate");
/* layouting_set(true); */
- evas_obj_box_layout_vertical(raw_handle, IntPtr.Zero, IntPtr.Zero);
+ evas_obj_box_layout_vertical(NativeHandle, IntPtr.Zero, IntPtr.Zero);
/* layouting_set(false); */
/* children_changed_set(false); */
evas_event_thaw(evas);
@@ -30,21 +30,21 @@ class TestMain
{
static void Main(string[] args)
{
- efl.All.Init();
+ Efl.All.Init();
- efl.Loop loop = new efl.Loop();
+ Efl.Loop loop = new Efl.Loop();
EcoreEvas ecore_evas = new EcoreEvas();
- efl.canvas.IObject canvas = ecore_evas.canvas;
+ Efl.Canvas.Object canvas = ecore_evas.canvas;
canvas.SetVisible(true);
- efl.IObject parent = canvas.GetParent();
- System.Diagnostics.Debug.Assert(parent.raw_handle != IntPtr.Zero);
+ Efl.Object parent = canvas.GetParent();
+ System.Diagnostics.Debug.Assert(parent.NativeHandle != IntPtr.Zero);
- evas.IBox box = new MyBox(canvas);
- eina.Size2D size = new eina.Size2D();
+ Evas.Box box = new MyBox(canvas);
+ Eina.Size2D size = new Eina.Size2D();
size.W = 320;
size.H = 240;
@@ -52,7 +52,7 @@ class TestMain
box.SetSize(size);
box.SetVisible(true);
- efl.canvas.Rectangle rect = new efl.canvas.Rectangle(canvas);
+ Efl.Canvas.Rectangle rect = new Efl.Canvas.Rectangle(canvas);
rect.SetColor(0, 0, 255, 255);
size.W = 320;
size.H = 120;
@@ -60,7 +60,7 @@ class TestMain
rect.SetVisible(true);
box.Append(rect);
- efl.canvas.Rectangle rect2 = new efl.canvas.Rectangle(canvas);
+ Efl.Canvas.Rectangle rect2 = new Efl.Canvas.Rectangle(canvas);
rect2.SetColor(0, 255, 0, 255);
rect2.SetSize(size);
rect2.SetVisible(true);
@@ -68,6 +68,6 @@ class TestMain
loop.Begin();
- efl.All.Shutdown();
+ Efl.All.Shutdown();
}
}
diff --git a/src/examples/evas/evas_mono_image.cs b/src/examples/evas/evas_mono_image.cs
index 47f9b36023..865aa42502 100644
--- a/src/examples/evas/evas_mono_image.cs
+++ b/src/examples/evas/evas_mono_image.cs
@@ -6,7 +6,7 @@ class TestMain
static int WIDTH = 320;
static int HEIGHT = 240;
- evas.IImage image;
+ Evas.Image image;
static string ImagePath([CallerFilePath] string folder="")
@@ -14,27 +14,27 @@ class TestMain
return System.IO.Path.GetDirectoryName(folder);
}
- public TestMain(evas.IImage image)
+ public TestMain(Evas.Image image)
{
this.image = image;
}
static void Main(string[] args)
{
- efl.All.Init();
+ Efl.All.Init();
- efl.Loop loop = new efl.Loop();
+ Efl.Loop loop = new Efl.Loop();
EcoreEvas ecore_evas = new EcoreEvas();
- eina.Size2D size = new eina.Size2D();
+ Eina.Size2D size = new Eina.Size2D();
- efl.canvas.IObject canvas = ecore_evas.canvas;
+ Efl.Canvas.Object canvas = ecore_evas.canvas;
canvas.SetVisible(true);
- efl.IObject parent = canvas.GetParent();
- System.Diagnostics.Debug.Assert(parent.raw_handle != IntPtr.Zero);
+ Efl.Object parent = canvas.GetParent();
+ System.Diagnostics.Debug.Assert(parent.NativeHandle != IntPtr.Zero);
- efl.canvas.Rectangle bg = new efl.canvas.Rectangle(canvas);
+ Efl.Canvas.Rectangle bg = new Efl.Canvas.Rectangle(canvas);
bg.SetColor(255, 255, 255, 255);
size.W = WIDTH;
size.H = HEIGHT;
@@ -42,15 +42,15 @@ class TestMain
bg.SetVisible(true);
string valid_path = args[0];
- evas.Image image = new evas.Image(canvas);
+ Evas.Image image = new Evas.Image(canvas);
image.SetFile(valid_path, null);
/* FIXME evas-image uses error handling code from
* evas_object_image_load_error_get, which seems to be not available
- * efl.image.load.State state = image.load_error_get(); */
+ * Efl.image.load.State state = image.load_error_get(); */
// FIXME missing move
- eina.Rect rect = new eina.Rect();
+ Eina.Rect rect = new Eina.Rect();
rect.X = 0;
rect.Y = 0;
@@ -75,13 +75,13 @@ class TestMain
/* EventListener callback = new EventListener(); */
/* bg.key_focus_set(true); */
- /* bg.event_callback_priority_add(evas.Callback_Type.Key_down, */
- /* efl.Callback_Priority.Default, */
+ /* bg.event_callback_priority_add(Evas.Callback_Type.Key_down, */
+ /* Efl.Callback_Priority.Default, */
/* callback, null); */
loop.Begin();
- efl.All.Shutdown();
+ Efl.All.Shutdown();
}
public void on_key_down(object sender, EventArgs e)
diff --git a/src/examples/evas/evas_mono_image2.cs b/src/examples/evas/evas_mono_image2.cs
index 1f0e52ac62..0ad8fb0872 100644
--- a/src/examples/evas/evas_mono_image2.cs
+++ b/src/examples/evas/evas_mono_image2.cs
@@ -10,19 +10,19 @@ class TestMain
static void Main(string[] args)
{
- efl.All.Init();
+ Efl.All.Init();
- efl.Loop loop = new efl.Loop();
+ Efl.Loop loop = new Efl.Loop();
EcoreEvas ecore_evas = new EcoreEvas();
- eina.Size2D size = new eina.Size2D();
- eina.Position2D pos = new eina.Position2D();
+ Eina.Size2D size = new Eina.Size2D();
+ Eina.Position2D pos = new Eina.Position2D();
- efl.canvas.IObject canvas = ecore_evas.canvas;
+ Efl.Canvas.Object canvas = ecore_evas.canvas;
canvas.SetVisible(true);
- efl.canvas.Rectangle bg = new efl.canvas.Rectangle(canvas);
+ Efl.Canvas.Rectangle bg = new Efl.Canvas.Rectangle(canvas);
bg.SetColor(255, 255, 255, 255);
pos.X = 0;
pos.Y = 0;
@@ -33,7 +33,7 @@ class TestMain
bg.SetVisible(true);
string path = args[0];
- evas.Image logo = new evas.Image(canvas);
+ Evas.Image logo = new Evas.Image(canvas);
logo.SetFillAuto(true);
// TODO add preloaded support (depends on events)
@@ -53,7 +53,7 @@ class TestMain
pixels[i] = generator.Next();
}
- evas.Image noise_img = new evas.Image(canvas);
+ Evas.Image noise_img = new Evas.Image(canvas);
size.W = WIDTH / 4;
size.H = HEIGHT / 4;
noise_img.SetSize(size);
@@ -66,7 +66,7 @@ class TestMain
noise_img.SetVisible(true);
Console.WriteLine("Creating noise image with sizez %d, %d", WIDTH/4, HEIGHT/4);
- efl.canvas.Proxy proxy_img = new efl.canvas.Proxy(canvas);
+ Efl.Canvas.Proxy proxy_img = new Efl.Canvas.Proxy(canvas);
proxy_img.SetSource(noise_img);
pos.X = WIDTH / 2;
pos.Y = HEIGHT / 2;
diff --git a/src/examples/evas/evas_mono_rectangle.cs b/src/examples/evas/evas_mono_rectangle.cs
index c31c24785e..85afbd2e61 100644
--- a/src/examples/evas/evas_mono_rectangle.cs
+++ b/src/examples/evas/evas_mono_rectangle.cs
@@ -12,28 +12,28 @@ class TestMain
{
int color_index = 0;
- efl.All.Init();
+ Efl.All.Init();
- efl.Loop loop = new efl.Loop();
+ Efl.Loop loop = new Efl.Loop();
EcoreEvas ecore_evas = new EcoreEvas();
- efl.canvas.IObject canvas = ecore_evas.canvas;
+ Efl.Canvas.Object canvas = ecore_evas.canvas;
canvas.SetVisible(true);
- efl.IObject parent = canvas.GetParent();
- System.Diagnostics.Debug.Assert(parent.raw_handle != IntPtr.Zero);
+ Efl.Object parent = canvas.GetParent();
+ System.Diagnostics.Debug.Assert(parent.NativeHandle != IntPtr.Zero);
- efl.canvas.Rectangle rect = new efl.canvas.Rectangle(canvas);
+ Efl.Canvas.Rectangle rect = new Efl.Canvas.Rectangle(canvas);
rect.SetColor(colors[0, 0], colors[0, 1], colors[0, 2], 255);
- eina.Size2D size = new eina.Size2D();
+ Eina.Size2D size = new Eina.Size2D();
size.W = 640;
size.H = 480;
rect.SetSize(size);
rect.SetVisible(true);
- canvas.KeyDownEvt += (object sender, efl.input.Interface.KeyDownEvt_Args e) => {
+ canvas.KeyDownEvt += (object sender, Efl.Input.InterfaceKeyDownEvt_Args e) => {
color_index = (color_index + 1) % 3;
Console.WriteLine("Key Down");
- Console.WriteLine("Got key obj at {0}", e.arg.raw_handle.ToString("X"));
+ Console.WriteLine("Got key obj at {0}", e.arg.NativeHandle.ToString("X"));
Console.WriteLine("Got key_get() == [{0}]", e.arg.GetKey());
rect.SetColor(colors[color_index, 0],
colors[color_index, 1],
@@ -42,6 +42,6 @@ class TestMain
loop.Begin();
- efl.All.Shutdown();
+ Efl.All.Shutdown();
}
}
diff --git a/src/examples/evas/evas_mono_table.cs b/src/examples/evas/evas_mono_table.cs
index db329b22cd..b42057d651 100644
--- a/src/examples/evas/evas_mono_table.cs
+++ b/src/examples/evas/evas_mono_table.cs
@@ -9,37 +9,37 @@ class TestMain
static void Main(string[] args)
{
- efl.All.Init();
+ Efl.All.Init();
- efl.Loop loop = new efl.Loop();
+ Efl.Loop loop = new Efl.Loop();
EcoreEvas ecore_evas = new EcoreEvas();
- eina.Size2D size = new eina.Size2D();
+ Eina.Size2D size = new Eina.Size2D();
size.W = WIDTH;
size.H = HEIGHT;
- eina.Size2D hint = new eina.Size2D();
+ Eina.Size2D hint = new Eina.Size2D();
- efl.canvas.IObject canvas = ecore_evas.canvas;
+ Efl.Canvas.Object canvas = ecore_evas.canvas;
canvas.SetVisible(true);
- efl.IObject parent = canvas.GetParent();
- System.Diagnostics.Debug.Assert(parent.raw_handle != IntPtr.Zero);
+ Efl.Object parent = canvas.GetParent();
+ System.Diagnostics.Debug.Assert(parent.NativeHandle != IntPtr.Zero);
- efl.canvas.Rectangle bg = new efl.canvas.Rectangle(canvas);
+ Efl.Canvas.Rectangle bg = new Efl.Canvas.Rectangle(canvas);
bg.SetColor(255, 255, 255, 255);
bg.SetSize(size);
bg.SetVisible(true);
- evas.Table table = new evas.Table(canvas);
- table.SetHomogeneous(evas.object_table.Homogeneous_Mode.None);
+ Evas.Table table = new Evas.Table(canvas);
+ table.SetHomogeneous(Evas.ObjectTable.HomogeneousMode.None);
table.SetPadding(0, 0);
table.SetSize(size);
table.SetVisible(true);
- efl.canvas.Rectangle rect = new efl.canvas.Rectangle(canvas);
+ Efl.Canvas.Rectangle rect = new Efl.Canvas.Rectangle(canvas);
rect.SetColor(255, 0, 0, 255);
hint.W = 100;
hint.H = 50;
@@ -47,7 +47,7 @@ class TestMain
rect.SetVisible(true);
table.Pack(rect, 1, 1, 2, 1);
- rect = new efl.canvas.Rectangle(canvas);
+ rect = new Efl.Canvas.Rectangle(canvas);
rect.SetColor(0, 255, 0, 255);
hint.W = 50;
hint.H = 100;
@@ -55,7 +55,7 @@ class TestMain
rect.SetVisible(true);
table.Pack(rect, 1, 2, 1, 2);
- rect = new efl.canvas.Rectangle(canvas);
+ rect = new Efl.Canvas.Rectangle(canvas);
rect.SetColor(0, 0, 255, 255);
hint.W = 50;
hint.H = 50;
@@ -63,7 +63,7 @@ class TestMain
rect.SetVisible(true);
table.Pack(rect, 2, 2, 1, 1);
- rect = new efl.canvas.Rectangle(canvas);
+ rect = new Efl.Canvas.Rectangle(canvas);
rect.SetColor(255, 255, 0, 255);
rect.SetHintMin(hint);
rect.SetVisible(true);
@@ -71,7 +71,7 @@ class TestMain
loop.Begin();
- efl.All.Shutdown();
+ Efl.All.Shutdown();
}
}
diff --git a/src/examples/evas/evas_mono_text.cs b/src/examples/evas/evas_mono_text.cs
index a1532a4583..52b89f2f10 100644
--- a/src/examples/evas/evas_mono_text.cs
+++ b/src/examples/evas/evas_mono_text.cs
@@ -22,19 +22,19 @@ class TestMain
static int HEIGHT = 240;
private EcoreEvas ecore_evas;
- private efl.canvas.IObject canvas;
- private efl.canvas.IRectangle bg;
- private evas.Text text;
- private evas.Image border;
+ private Efl.Canvas.Object canvas;
+ private Efl.Canvas.Rectangle bg;
+ private Evas.Text text;
+ private Evas.Image border;
public TestMain(String border_file) {
ecore_evas = new EcoreEvas();
- eina.Size2D size = new eina.Size2D();
- eina.Position2D position = new eina.Position2D();
+ Eina.Size2D size = new Eina.Size2D();
+ Eina.Position2D position = new Eina.Position2D();
canvas = ecore_evas.canvas;
canvas.SetVisible(true);
- bg = new efl.canvas.Rectangle(canvas);
+ bg = new Efl.Canvas.Rectangle(canvas);
bg.SetColor(255, 255, 255, 255);
position.X = 0;
position.Y = 0;
@@ -45,10 +45,11 @@ class TestMain
bg.SetVisible(true);
bg.SetKeyFocus(true);
+ /* ((Efl.Input.Interface)bg).KeyDownEvt += On_KeyDown; */
bg.KeyDownEvt += On_KeyDown;
- text = new evas.Text(canvas);
- text.SetStyle(evas.Text_Style_Type.OutlineSoftShadow);
+ text = new Evas.Text(canvas);
+ text.SetStyle(Evas.TextStyleType.OutlineSoftShadow);
text.SetColor(0, 0, 0, 255);
text.SetGlowColor(255, 0, 0, 255);
@@ -65,13 +66,13 @@ class TestMain
text.SetPosition(position);
text.SetVisible(true);
- efl.font.Size font_size = 0;
+ Efl.Font.Size font_size = 0;
String font = String.Empty;
text.GetFont(out font, out font_size);
Console.WriteLine("Adding text object with font {0} and size {1}", font, size);
// setup border
- border = new evas.Image(canvas);
+ border = new Evas.Image(canvas);
border.SetFile(border_file, null);
border.SetBorder(3, 3, 3, 3);
border.SetBorderCenterFill(0);
@@ -87,15 +88,15 @@ class TestMain
}
- private void On_KeyDown(object sender, efl.input.Interface.KeyDownEvt_Args e)
+ private void On_KeyDown(object sender, Efl.Input.InterfaceKeyDownEvt_Args e)
{
var key = e.arg.GetKey();
if (key == "h") {
Console.WriteLine(commands);
} else if (key == "t") {
- evas.Text_Style_Type type = text.GetStyle();
- type = (evas.Text_Style_Type)(((int)type + 1) % 10); // 10 hardcoded from C example
+ Evas.TextStyleType type = text.GetStyle();
+ type = (Evas.TextStyleType)(((int)type + 1) % 10); // 10 hardcoded from C example
text.SetStyle(type);
}
}
@@ -107,19 +108,19 @@ class TestMain
static void Main(string[] args)
{
- efl.All.Init();
+ Efl.All.Init();
String border_path = "./src/examples/evas/resources/images/red.png";
if (args.Length >= 1)
border_path = args[0];
- efl.Loop loop = new efl.Loop();
+ Efl.Loop loop = new Efl.Loop();
TestMain t = new TestMain(border_path);
loop.Begin();
- efl.All.Shutdown();
+ Efl.All.Shutdown();
}
}