From 242ed076f3836f60bf84a32f2ded77879f3bd860 Mon Sep 17 00:00:00 2001 From: Bruno da Silva Belo Date: Thu, 12 Sep 2019 15:01:45 +0200 Subject: [PATCH] csharp: Basic components for all tests without Ui. Summary: Uiless tests use basic components. Make test terminate again. Reviewers: lauromoura, felipealmeida, segfaultxavi Reviewed By: segfaultxavi Subscribers: brunobelo, felipealmeida, lauromoura Differential Revision: https://phab.enlightenment.org/D9916 --- reference/csharp/eina/src/eina_array.cs | 2 +- reference/csharp/eina/src/eina_hash.cs | 2 +- reference/csharp/eina/src/eina_iterator.cs | 2 +- reference/csharp/eina/src/eina_list.cs | 2 +- reference/csharp/eina/src/eina_log.cs | 2 +- reference/csharp/eina/src/eina_value.cs | 2 +- tutorial/csharp/eo-intro/src/eo_intro_main.cs | 2 +- tutorial/csharp/hello-world/src/hello-world.cs | 9 +++++++++ 8 files changed, 16 insertions(+), 7 deletions(-) diff --git a/reference/csharp/eina/src/eina_array.cs b/reference/csharp/eina/src/eina_array.cs index dffb394b..3864bded 100644 --- a/reference/csharp/eina/src/eina_array.cs +++ b/reference/csharp/eina/src/eina_array.cs @@ -76,7 +76,7 @@ public class Example : Efl.Csharp.Application public static void Main() { var example = new Example(); - example.Launch(); + example.Launch(Efl.Csharp.Components.Basic); } } diff --git a/reference/csharp/eina/src/eina_hash.cs b/reference/csharp/eina/src/eina_hash.cs index 07b23199..ee8e6019 100644 --- a/reference/csharp/eina/src/eina_hash.cs +++ b/reference/csharp/eina/src/eina_hash.cs @@ -131,6 +131,6 @@ public class Example : Efl.Csharp.Application public static void Main() { var example = new Example(); - example.Launch(); + example.Launch(Efl.Csharp.Components.Basic); } } diff --git a/reference/csharp/eina/src/eina_iterator.cs b/reference/csharp/eina/src/eina_iterator.cs index 498c3e5a..c8d29f8b 100644 --- a/reference/csharp/eina/src/eina_iterator.cs +++ b/reference/csharp/eina/src/eina_iterator.cs @@ -80,6 +80,6 @@ public class Example : Efl.Csharp.Application public static void Main() { var example = new Example(); - example.Launch(); + example.Launch(Efl.Csharp.Components.Basic); } } diff --git a/reference/csharp/eina/src/eina_list.cs b/reference/csharp/eina/src/eina_list.cs index 059f4d79..8f2956be 100644 --- a/reference/csharp/eina/src/eina_list.cs +++ b/reference/csharp/eina/src/eina_list.cs @@ -70,6 +70,6 @@ public class Example : Efl.Csharp.Application public static void Main() { var example = new Example(); - example.Launch(); + example.Launch(Efl.Csharp.Components.Basic); } } diff --git a/reference/csharp/eina/src/eina_log.cs b/reference/csharp/eina/src/eina_log.cs index f671c9af..159853dd 100644 --- a/reference/csharp/eina/src/eina_log.cs +++ b/reference/csharp/eina/src/eina_log.cs @@ -64,6 +64,6 @@ public class Example : Efl.Csharp.Application public static void Main() { var example = new Example(); - example.Launch(); + example.Launch(Efl.Csharp.Components.Basic); } } diff --git a/reference/csharp/eina/src/eina_value.cs b/reference/csharp/eina/src/eina_value.cs index 328a9dad..3e82e2c7 100644 --- a/reference/csharp/eina/src/eina_value.cs +++ b/reference/csharp/eina/src/eina_value.cs @@ -67,6 +67,6 @@ public class Example : Efl.Csharp.Application public static void Main() { var example = new Example(); - example.Launch(); + example.Launch(Efl.Csharp.Components.Basic); } } diff --git a/tutorial/csharp/eo-intro/src/eo_intro_main.cs b/tutorial/csharp/eo-intro/src/eo_intro_main.cs index a928b91f..b5ee7730 100644 --- a/tutorial/csharp/eo-intro/src/eo_intro_main.cs +++ b/tutorial/csharp/eo-intro/src/eo_intro_main.cs @@ -49,6 +49,6 @@ public class Example : Efl.Csharp.Application public static void Main() { var example = new Example(); - example.Launch(); + example.Launch(Efl.Csharp.Components.Basic); } } diff --git a/tutorial/csharp/hello-world/src/hello-world.cs b/tutorial/csharp/hello-world/src/hello-world.cs index a7b04575..2eac0bfe 100644 --- a/tutorial/csharp/hello-world/src/hello-world.cs +++ b/tutorial/csharp/hello-world/src/hello-world.cs @@ -2,6 +2,14 @@ using System; public class Example : Efl.Csharp.Application { + // Callback to quit the application + public static void QuitCb(object sender, Efl.Gfx.EntityVisibilityChangedEventArgs e) + { + // Exit the EFL main loop + if (e.arg == false) + Efl.App.AppMain.Quit(0); + } + protected override void OnInitialize(string[] args) { // Create a window and initialize it @@ -14,6 +22,7 @@ public class Example : Efl.Csharp.Application // Window size must be explicitly set, otherwise it will be invisible // due to its lack of content. win.SetSize(new Eina.Size2D(360, 240)); + win.VisibilityChangedEvent += QuitCb; } #if WIN32